diff options
-rw-r--r-- | libidu/scanners.c | 8 | ||||
-rw-r--r-- | src/fid.c | 2 | ||||
-rw-r--r-- | src/fnid.c | 2 | ||||
-rw-r--r-- | src/lid.c | 19 | ||||
-rw-r--r-- | src/mkid.c | 8 | ||||
-rw-r--r-- | src/xtokid.c | 2 |
6 files changed, 24 insertions, 17 deletions
diff --git a/libidu/scanners.c b/libidu/scanners.c index 02aa972..abfb813 100644 --- a/libidu/scanners.c +++ b/libidu/scanners.c @@ -428,7 +428,7 @@ static struct option const long_options_c[] = { "keep", required_argument, 0, 'k' }, { "ignore", required_argument, 0, 'i' }, { "strip-underscore", no_argument, 0, 'u' }, - { 0 } + {NULL, 0, NULL, 0} }; static void @@ -839,7 +839,7 @@ static struct option const long_options_asm[] = { "ignore", required_argument, 0, 'i' }, { "strip-underscore", no_argument, 0, 'u' }, { "no-cpp", no_argument, 0, 'n' }, - { 0 } + {NULL, 0, NULL, 0} }; static void @@ -1110,7 +1110,7 @@ static struct option const long_options_text[] = { { "include", required_argument, 0, 'i' }, { "exclude", required_argument, 0, 'x' }, - { 0 } + {NULL, 0, NULL, 0} }; static void @@ -1315,7 +1315,7 @@ static struct option const long_options_perl[] = { "include", required_argument, 0, 'i' }, { "exclude", required_argument, 0, 'x' }, { "dtags", no_argument, 0, 'd' }, - { 0 } + {NULL, 0, NULL, 0} }; static void @@ -63,7 +63,7 @@ static struct option const long_options[] = { "file", required_argument, 0, 'f' }, { "help", no_argument, &show_help, 1 }, { "version", no_argument, &show_version, 1 }, - { 0 } + {NULL, 0, NULL, 0} }; void @@ -61,7 +61,7 @@ static struct option const long_options[] = { "separator", required_argument, 0, 'S' }, { "help", no_argument, &show_help, 1 }, { "version", no_argument, &show_version, 1 }, - { 0 } + {NULL, 0, NULL, 0} }; static void @@ -45,6 +45,10 @@ #include "lid.h" #include "progname.h" +#ifndef ATTRIBUTE_UNUSED +# define ATTRIBUTE_UNUSED __attribute__ ((__unused__)) +#endif + typedef void (*report_func_t) (char const *name, struct file_link **flinkv); typedef int (*query_func_t) (char const *arg, report_func_t); @@ -229,7 +233,7 @@ static struct option const long_options[] = { "octal", no_argument, 0, 'o' }, { "help", no_argument, &show_help, 1 }, { "version", no_argument, &show_version, 1 }, - { 0 } + {NULL, 0, NULL, 0} }; void @@ -618,11 +622,12 @@ report_grep (char const *name, struct file_link **flinkv) } static char ** -get_editor_argv(char *fullstring, int* argc) +get_editor_argv(char const *fullstring, int* argc) { int i; - char *mark; + char const *mark; char **argv; + char *p; static int already_called; assert(already_called == 0); /* call only once, otherwise leaks */ @@ -636,8 +641,8 @@ get_editor_argv(char *fullstring, int* argc) } argv = xmalloc(sizeof(char *) * (*argc + 1)); - fullstring = xstrdup(fullstring); - argv[0] = strtok(fullstring, " "); + p = xstrdup(fullstring); + argv[0] = strtok(p, " "); for (i = 1; i < (*argc + 1); i++) { argv[i] = strtok(NULL, " "); @@ -650,7 +655,7 @@ get_editor_argv(char *fullstring, int* argc) static void report_edit (char const *name, struct file_link **flinkv) { - static char *editor; /* editor program name from env */ + static char const *editor; /* editor program name from env */ static char **editor_argv; /* editor base arguments from env */ static int editor_argc; @@ -804,7 +809,7 @@ editit: } static void -report_nothing (char const *name, struct file_link **flinkv) +report_nothing (char const *name, struct file_link **flinkv ATTRIBUTE_UNUSED) { if (key_style != ks_none) puts (name); @@ -142,7 +142,7 @@ static struct option const long_options[] = { "statistics", no_argument, 0, 's' }, { "help", no_argument, &show_help, 1 }, { "version", no_argument, &show_version, 1 }, - { 0 } + {NULL, 0, NULL, 0} }; static void @@ -555,8 +555,10 @@ report_statistics (void) printf (_("Tokens=%ld, "), occurrences); printf (_("Bytes=%ld Kb, "), input_chars / 1024); printf (_("Heap=%llu+%llu Kb, "), - (unsigned long long) (heap_after_scan - heap_after_walk) / 1024, - (unsigned long long) (heap_after_walk - heap_initial) / 1024); + (unsigned long long) ((char *) heap_after_scan + - (char *) heap_after_walk) / 1024, + (unsigned long long) ((char *) heap_after_walk + - (char *) heap_initial) / 1024); printf (_("Output=%ld (%ld tok, %ld hit)\n"), output_length, tokens_length, hits_length); diff --git a/src/xtokid.c b/src/xtokid.c index 36aa356..c45d5be 100644 --- a/src/xtokid.c +++ b/src/xtokid.c @@ -61,7 +61,7 @@ static struct option const long_options[] = { "prune", required_argument, 0, 'p' }, { "help", no_argument, &show_help, 1 }, { "version", no_argument, &show_version, 1 }, - { 0 } + {NULL, 0, NULL, 0} }; static void |