clean up warning in lpcxpresso

remove -Wpacked  -Wpadded in gcc
This commit is contained in:
hathach
2014-03-14 11:59:39 +07:00
parent 214af7e988
commit 5e2ed2534e
12 changed files with 77 additions and 46 deletions

View File

@@ -1567,8 +1567,8 @@
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.exe.debug.1239969983.636406670" moduleId="org.eclipse.cdt.core.settings" name="Board EA4357">
<macros>
<stringMacro name="CFLAGS_OFF" type="VALUE_TEXT" value=""/>
<stringMacro name="CFLAGS" type="VALUE_TEXT" value="${CFLAGS_OFF}"/>
<stringMacro name="CFLAGS_ON" type="VALUE_TEXT" value="-pedantic -Wextra -Wswitch-default -Wunsafe-loop-optimizations -Wcast-align -Wlogical-op -Wpacked-bitfield-compat -Wpadded -Wnested-externs -Wredundant-decls -Winline -Wpacked"/>
<stringMacro name="CFLAGS" type="VALUE_TEXT" value="${CFLAGS_ON}"/>
<stringMacro name="CFLAGS_ON" type="VALUE_TEXT" value="-Wextra -Wswitch-default -Wunsafe-loop-optimizations -Wcast-align -Wlogical-op -Wpacked-bitfield-compat -Wnested-externs -Wredundant-decls -Winline"/>
</macros>
<externalSettings/>
<extensions>
@@ -9369,8 +9369,8 @@
<storageModule moduleId="com.crt.config">
<projectStorage>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&#13;
&lt;TargetConfig&gt;&#13;
&lt;Properties property_0="" property_3="NXP" property_4="LPC4330" property_count="5" version="1"/&gt;&#13;
&lt;infoList vendor="NXP"&gt;&lt;info chip="LPC4330" match_id="0x0" name="LPC4330" resetscript="LPC18LPC43ExternalFLASHBootResetscript.scp" stub="crt_emu_lpc18_43_nxp"&gt;&lt;chip&gt;&lt;name&gt;LPC4330&lt;/name&gt;&#13;
&lt;Properties property_0="" property_2="LPC18x7_43x7_2x512_BootA.cfx" property_3="NXP" property_4="LPC4357" property_count="5" version="1"/&gt;&#13;
&lt;infoList vendor="NXP"&gt;&lt;info chip="LPC4357" flash_driver="LPC18x7_43x7_2x512_BootA.cfx" match_id="0x0" name="LPC4357" resetscript="LPC18LPC43InternalFLASHBootResetscript.scp" stub="crt_emu_lpc18_43_nxp"&gt;&lt;chip&gt;&lt;name&gt;LPC4357&lt;/name&gt;&#13;
&lt;family&gt;LPC43xx&lt;/family&gt;&#13;
&lt;vendor&gt;NXP (formerly Philips)&lt;/vendor&gt;&#13;
&lt;reset board="None" core="Real" sys="Real"/&gt;&#13;
@@ -9378,11 +9378,17 @@
&lt;memory can_program="true" id="Flash" is_ro="true" type="Flash"/&gt;&#13;
&lt;memory id="RAM" type="RAM"/&gt;&#13;
&lt;memory id="Periph" is_volatile="true" type="Peripheral"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamLoc128" location="0x10000000" size="0x20000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamLoc72" location="0x10080000" size="0x12000"/&gt;&#13;
&lt;memoryInstance derived_from="Flash" id="MFlashA512" location="0x1a000000" size="0x80000"/&gt;&#13;
&lt;memoryInstance derived_from="Flash" id="MFlashB512" location="0x1b000000" size="0x80000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamLoc32" location="0x10000000" size="0x8000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamLoc40" location="0x10080000" size="0xa000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamAHB32" location="0x20000000" size="0x8000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamAHB16" location="0x20008000" size="0x4000"/&gt;&#13;
&lt;memoryInstance derived_from="RAM" id="RamAHB_ETB16" location="0x2000c000" size="0x4000"/&gt;&#13;
&lt;prog_flash blocksz="0x2000" location="0x1a000000" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/&gt;&#13;
&lt;prog_flash blocksz="0x10000" location="0x1a010000" maxprgbuff="0x400" progwithcode="TRUE" size="0x70000"/&gt;&#13;
&lt;prog_flash blocksz="0x2000" location="0x1b000000" maxprgbuff="0x400" progwithcode="TRUE" size="0x10000"/&gt;&#13;
&lt;prog_flash blocksz="0x10000" location="0x1b010000" maxprgbuff="0x400" progwithcode="TRUE" size="0x70000"/&gt;&#13;
&lt;peripheralInstance derived_from="V7M_MPU" id="MPU" location="0xe000ed90"/&gt;&#13;
&lt;peripheralInstance derived_from="V7M_NVIC" id="NVIC" location="0xe000e000"/&gt;&#13;
&lt;peripheralInstance derived_from="V7M_DCR" id="DCR" location="0xe000edf0"/&gt;&#13;
@@ -9394,6 +9400,7 @@
&lt;peripheralInstance derived_from="EMC" id="EMC" location="0x40005000"/&gt;&#13;
&lt;peripheralInstance derived_from="USB0" id="USB0" location="0x40006000"/&gt;&#13;
&lt;peripheralInstance derived_from="USB1" id="USB1" location="0x40007000"/&gt;&#13;
&lt;peripheralInstance derived_from="LCD" id="LCD" location="0x40008000"/&gt;&#13;
&lt;peripheralInstance derived_from="EEPROM" id="EEPROM" location="0x4000e000"/&gt;&#13;
&lt;peripheralInstance derived_from="ETHERNET" id="ETHERNET" location="0x40010000"/&gt;&#13;
&lt;peripheralInstance derived_from="ATIMER" id="ATIMER" location="0x40040000"/&gt;&#13;

View File

@@ -61,7 +61,7 @@ static uint8_t received_bytes; // set by transfer complete callback
//--------------------------------------------------------------------+
void tusbh_cdc_mounted_cb(uint8_t dev_addr)
{ // application set-up
printf("\na CDC device is mounted\n");
printf("\na CDC device (address %d) is mounted\n", dev_addr);
memclr_(serial_in_buffer, sizeof(serial_in_buffer));
memclr_(serial_out_buffer, sizeof(serial_out_buffer));
@@ -73,11 +73,13 @@ void tusbh_cdc_mounted_cb(uint8_t dev_addr)
void tusbh_cdc_unmounted_cb(uint8_t dev_addr)
{ // application tear-down
printf("\na CDC device is unmounted\n");
printf("\na CDC device (address %d) is unmounted \n", dev_addr);
}
void tusbh_cdc_xfer_isr(uint8_t dev_addr, tusb_event_t event, cdc_pipeid_t pipe_id, uint32_t xferred_bytes)
{
(void) dev_addr; // compiler warnings
switch ( pipe_id )
{
case CDC_PIPE_DATA_IN:
@@ -119,6 +121,8 @@ void cdc_serial_app_init(void)
//------------- main task -------------//
OSAL_TASK_FUNCTION( cdc_serial_app_task ) (void* p_task_para)
{
(void) p_task_para;
OSAL_TASK_LOOP_BEGIN
//------------- send characters got from uart terminal to the first CDC device -------------//

View File

@@ -206,11 +206,11 @@ void cli_poll(char ch)
//------------- Separate Command & Parameter -------------//
putchar('\n');
char* p_space = strchr(cli_buffer, ' ');
uint32_t command_len = (p_space == NULL) ? strlen(cli_buffer) : (p_space - cli_buffer);
uint32_t command_len = (p_space == NULL) ? strlen(cli_buffer) : (uint32_t) (p_space - cli_buffer);
char* p_para = (p_space == NULL) ? (cli_buffer+command_len) : (p_space+1); // point to NULL-character or after space
//------------- Find entered command in lookup table & execute it -------------//
uint32_t cmd_id;
uint8_t cmd_id;
for(cmd_id = CLI_CMDTYPE_COUNT - 1; cmd_id > CLI_CMDTYPE_unknown; cmd_id--)
{
if( 0 == strncmp(cli_buffer, cli_string_tbl[cmd_id], command_len) ) break;
@@ -230,8 +230,9 @@ void cli_poll(char ch)
//--------------------------------------------------------------------+
// UNKNOWN Command
//--------------------------------------------------------------------+
cli_error_t cli_cmd_unknown(char * para)
cli_error_t cli_cmd_unknown(char * p_para)
{
(void) p_para;
puts("unknown command, please type \"help\" for list of supported commands");
return CLI_ERROR_NONE;
}
@@ -239,10 +240,12 @@ cli_error_t cli_cmd_unknown(char * para)
//--------------------------------------------------------------------+
// HELP command
//--------------------------------------------------------------------+
cli_error_t cli_cmd_help(char * para)
cli_error_t cli_cmd_help(char * p_para)
{
(void) p_para;
puts("current supported commands are:");
for(uint32_t cmd_id = CLI_CMDTYPE_help+1; cmd_id < CLI_CMDTYPE_COUNT; cmd_id++)
for(uint8_t cmd_id = CLI_CMDTYPE_help+1; cmd_id < CLI_CMDTYPE_COUNT; cmd_id++)
{
printf("%s\t%s\n", cli_string_tbl[cmd_id], cli_description_tbl[cmd_id]);
}
@@ -255,6 +258,7 @@ cli_error_t cli_cmd_help(char * para)
//--------------------------------------------------------------------+
cli_error_t cli_cmd_clear(char* p_para)
{
(void) p_para;
printf(ANSI_ERASE_SCREEN(2) ANSI_CURSOR_POSITION(1,1) );
return CLI_ERROR_NONE;
}

View File

@@ -67,8 +67,7 @@ static inline void process_kbd_report(hid_keyboard_report_t const * report);
void tusbh_hid_keyboard_mounted_cb(uint8_t dev_addr)
{
// application set-up
puts("\na Keyboard device is mounted");
printf("\na Keyboard device (address %d) is mounted\n", dev_addr);
osal_queue_flush(queue_kbd_hdl);
tusbh_hid_keyboard_get_report(dev_addr, (uint8_t*) &usb_keyboard_report); // first report
@@ -77,7 +76,7 @@ void tusbh_hid_keyboard_mounted_cb(uint8_t dev_addr)
void tusbh_hid_keyboard_unmounted_cb(uint8_t dev_addr)
{
// application tear-down
puts("\na Keyboard device is unmounted");
printf("\na Keyboard device (address %d) is unmounted\n", dev_addr);
}
void tusbh_hid_keyboard_isr(uint8_t dev_addr, tusb_event_t event)
@@ -115,6 +114,8 @@ void keyboard_app_init(void)
//------------- main task -------------//
OSAL_TASK_FUNCTION( keyboard_app_task ) (void* p_task_para)
{
(void) p_task_para;
hid_keyboard_report_t kbd_report;
tusb_error_t error;

View File

@@ -66,8 +66,7 @@ static inline void process_mouse_report(hid_mouse_report_t const * p_report);
void tusbh_hid_mouse_mounted_cb(uint8_t dev_addr)
{
// application set-up
puts("\na Mouse device is mounted");
printf("\na Mouse device (address %d) is mounted\n", dev_addr);
osal_queue_flush(queue_mouse_hdl);
(void) tusbh_hid_mouse_get_report(dev_addr, (uint8_t*) &usb_mouse_report); // first report
@@ -76,7 +75,7 @@ void tusbh_hid_mouse_mounted_cb(uint8_t dev_addr)
void tusbh_hid_mouse_unmounted_cb(uint8_t dev_addr)
{
// application tear-down
puts("\na Mouse device is unmounted\n");
printf("\na Mouse device (address %d) is unmounted\n", dev_addr);
}
void tusbh_hid_mouse_isr(uint8_t dev_addr, tusb_event_t event)
@@ -116,6 +115,8 @@ void mouse_app_init(void)
//------------- main task -------------//
OSAL_TASK_FUNCTION( mouse_app_task ) (void* p_task_para)
{
(void) p_task_para;
tusb_error_t error;
hid_mouse_report_t mouse_report;

View File

@@ -132,7 +132,9 @@ void tusbh_msc_unmounted_cb(uint8_t dev_addr)
void tusbh_msc_isr(uint8_t dev_addr, tusb_event_t event, uint32_t xferred_bytes)
{
(void) dev_addr;
(void) event;
(void) xferred_bytes;
}
//--------------------------------------------------------------------+
@@ -147,6 +149,8 @@ void msc_app_init(void)
//------------- main task -------------//
OSAL_TASK_FUNCTION( msc_app_task ) (void* p_task_para)
{
(void) p_task_para;
OSAL_TASK_LOOP_BEGIN
bool is_any_disk_mounted;