diff options
author | Matt Fleming <matt.fleming@intel.com> | 2012-04-04 12:18:47 +0100 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2012-04-17 11:23:42 +0100 |
commit | 88cebcdc03a4aefa978b20b5f60e7ea10f07b797 (patch) | |
tree | f4c4aadbfe45dcf27b4f58ad7b50ff4965378f4f | |
parent | 461106274b69693d46734d448b7e5702fba4f229 (diff) | |
download | syslinux-88cebcdc03a4aefa978b20b5f60e7ea10f07b797.tar.gz syslinux-88cebcdc03a4aefa978b20b5f60e7ea10f07b797.tar.xz syslinux-88cebcdc03a4aefa978b20b5f60e7ea10f07b797.zip |
Mark unused function parameters as __unused
Move the __unused tag from com32/hdt/ to com32/include/klibc/ so that
it can be used by the entire code base, and mark unused function
parameters as __unused to stop the following kind of build warning,
elflink/load_env32.c: In function ‘load_env32’:
elflink/load_env32.c:107:30: warning: unused parameter ‘regs’
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
-rw-r--r-- | com32/elflink/ldlinux/ldlinux.c | 2 | ||||
-rw-r--r-- | com32/hdt/hdt-common.h | 3 | ||||
-rw-r--r-- | com32/include/klibc/compiler.h | 7 | ||||
-rw-r--r-- | com32/modules/hello.c | 2 | ||||
-rw-r--r-- | com32/modules/meminfo.c | 2 | ||||
-rw-r--r-- | com32/modules/vesainfo.c | 2 | ||||
-rw-r--r-- | core/elflink/load_env32.c | 2 | ||||
-rw-r--r-- | core/font.c | 2 | ||||
-rw-r--r-- | core/init.c | 2 |
9 files changed, 14 insertions, 10 deletions
diff --git a/com32/elflink/ldlinux/ldlinux.c b/com32/elflink/ldlinux/ldlinux.c index 8e15a787..18b35446 100644 --- a/com32/elflink/ldlinux/ldlinux.c +++ b/com32/elflink/ldlinux/ldlinux.c @@ -114,7 +114,7 @@ static void enter_cmdline(void) } } -int main(int argc, char **argv) +int main(int argc __unused, char **argv __unused) { const void *adv; size_t count = 0; diff --git a/com32/hdt/hdt-common.h b/com32/hdt/hdt-common.h index d37fcc8a..fec213d9 100644 --- a/com32/hdt/hdt-common.h +++ b/com32/hdt/hdt-common.h @@ -54,9 +54,6 @@ #include <acpi/acpi.h> #include <libupload/upload_backend.h> -/* Declare a variable or data structure as unused. */ -#define __unused __attribute__ (( unused )) - /* This two values are used for switching for the menu to the CLI mode */ #define HDT_SWITCH_TO_CLI "hdt_switch_to_cli" #define HDT_DUMP "hdt_dump" diff --git a/com32/include/klibc/compiler.h b/com32/include/klibc/compiler.h index b5919d67..210971f1 100644 --- a/com32/include/klibc/compiler.h +++ b/com32/include/klibc/compiler.h @@ -108,6 +108,13 @@ # define __unusedfunc #endif +/* Declare a variable or data structure as unused. */ +#ifdef __GNUC__ +# define __unused __attribute__((unused)) +#else +# define __unused +#endif + /* Used symbol */ #define __used __attribute__((used)) diff --git a/com32/modules/hello.c b/com32/modules/hello.c index f28d38d3..d3d4d299 100644 --- a/com32/modules/hello.c +++ b/com32/modules/hello.c @@ -13,7 +13,7 @@ #define NUM_COUNT 10 #define MAX_NUM 100 -int main(int argc, char **argv) +int main(int argc __unused, char **argv __unused) { int *nums = NULL; diff --git a/com32/modules/meminfo.c b/com32/modules/meminfo.c index a1abc36b..34b3e91d 100644 --- a/com32/modules/meminfo.c +++ b/com32/modules/meminfo.c @@ -122,7 +122,7 @@ static void dump_legacy(void) oreg.ecx.w[0], oreg.ecx.w[0], oreg.edx.w[0], oreg.edx.w[0] << 6); } -int main(int argc, char **argv) +int main(int argc __unused, char **argv __unused) { dump_legacy(); dump_e820(); diff --git a/com32/modules/vesainfo.c b/com32/modules/vesainfo.c index 382bd14a..66b121d7 100644 --- a/com32/modules/vesainfo.c +++ b/com32/modules/vesainfo.c @@ -83,7 +83,7 @@ exit: return; } -int main(int argc, char **argv) +int main(int argc __unused, char **argv __unused) { print_modes(); return 0; diff --git a/core/elflink/load_env32.c b/core/elflink/load_env32.c index 566035bb..b15cdbbb 100644 --- a/core/elflink/load_env32.c +++ b/core/elflink/load_env32.c @@ -104,7 +104,7 @@ again: } /* note to self: do _*NOT*_ use static key word on this function */ -void load_env32(com32sys_t * regs) +void load_env32(com32sys_t * regs __unused) { struct file_info *fp; int fd; diff --git a/core/font.c b/core/font.c index 6ef46c4f..1fcbbe83 100644 --- a/core/font.c +++ b/core/font.c @@ -185,7 +185,7 @@ void adjust_screen(void) VidCols = --cols; /* Store count-1 (same as rows) */ } -void pm_adjust_screen(com32sys_t *regs) +void pm_adjust_screen(com32sys_t *regs __unused) { adjust_screen(); } diff --git a/core/init.c b/core/init.c index fab1ad4f..19db1e27 100644 --- a/core/init.c +++ b/core/init.c @@ -62,7 +62,7 @@ static inline void bios_timer_init(void) } extern void printf_init(void); -void init(com32sys_t *regs) +void init(com32sys_t *regs __unused) { int i; |