diff options
author | benl <benl@FreeBSD.org> | 2011-05-18 21:06:20 +0000 |
---|---|---|
committer | benl <benl@FreeBSD.org> | 2011-05-18 21:06:20 +0000 |
commit | 64d799037eb5050745ad9cd7258389275779cc79 (patch) | |
tree | 9a6ac602667d66384a63a7802a3d2d674bde526f /contrib/gperf | |
parent | be96174f193f154a18117e3f36172d4a6632ee6b (diff) | |
download | FreeBSD-src-64d799037eb5050745ad9cd7258389275779cc79.zip FreeBSD-src-64d799037eb5050745ad9cd7258389275779cc79.tar.gz |
Fix clang warnings.
Approved by: philip (mentor)
Diffstat (limited to 'contrib/gperf')
-rw-r--r-- | contrib/gperf/src/gen-perf.cc | 2 | ||||
-rw-r--r-- | contrib/gperf/src/key-list.cc | 48 | ||||
-rw-r--r-- | contrib/gperf/src/options.cc | 2 |
3 files changed, 25 insertions, 27 deletions
diff --git a/contrib/gperf/src/gen-perf.cc b/contrib/gperf/src/gen-perf.cc index 0b5109d..8840dc6 100644 --- a/contrib/gperf/src/gen-perf.cc +++ b/contrib/gperf/src/gen-perf.cc @@ -246,7 +246,7 @@ Gen_Perf::change (List_Node *prior, List_Node *curr) { if (option[DEBUG]) { - fprintf (stderr, " by changing asso_value['%c'] (char #%d) to %d\n", + fprintf (stderr, " by changing asso_value['%c'] (char #%zd) to %d\n", *p, p - union_set + 1, asso_values[(unsigned char)(*p)]); fflush (stderr); } diff --git a/contrib/gperf/src/key-list.cc b/contrib/gperf/src/key-list.cc index 1c941a4..2461470 100644 --- a/contrib/gperf/src/key-list.cc +++ b/contrib/gperf/src/key-list.cc @@ -497,8 +497,8 @@ Key_List::merge (List_Node *list1, List_Node *list2) *resultp = list1; break; } - if (occurrence_sort && list1->occurrence < list2->occurrence - || hash_sort && list1->hash_value > list2->hash_value) + if ((occurrence_sort && list1->occurrence < list2->occurrence) + || (hash_sort && list1->hash_value > list2->hash_value)) { *resultp = list2; resultp = &list2->next; list2 = list1; list1 = *resultp; @@ -1035,17 +1035,16 @@ Key_List::output_hash_function (void) if (option[CPLUSPLUS]) printf ("%s::", option.get_class_name ()); printf ("%s ", option.get_hash_name ()); - printf (option[KRC] ? - "(str, len)\n" - " register char *str;\n" - " register unsigned int len;\n" : - option[C] ? - "(str, len)\n" - " register const char *str;\n" - " register unsigned int len;\n" : - option[ANSIC] | option[CPLUSPLUS] ? - "(register const char *str, register unsigned int len)\n" : - ""); + if (option[KRC] || option[C] || option [ANSIC] || option[CPLUSPLUS]) + printf (option[KRC] ? + "(str, len)\n" + " register char *str;\n" + " register unsigned int len;\n" : + option[C] ? + "(str, len)\n" + " register const char *str;\n" + " register unsigned int len;\n" : + "(register const char *str, register unsigned int len)\n"); /* Note that when the hash function is called, it has already been verified that min_key_len <= len <= max_key_len. */ @@ -1442,7 +1441,7 @@ Key_List::output_lookup_array (void) if (option[DEBUG]) fprintf (stderr, - "dup_ptr[%d]: hash_value = %d, index = %d, count = %d\n", + "dup_ptr[%zd]: hash_value = %d, index = %d, count = %d\n", dup_ptr - duplicates, dup_ptr->hash_value, dup_ptr->index, dup_ptr->count); @@ -1986,17 +1985,16 @@ Key_List::output_lookup_function (void) if (option[CPLUSPLUS]) printf ("%s::", option.get_class_name ()); printf ("%s ", option.get_function_name ()); - printf (option[KRC] ? - "(str, len)\n" - " register char *str;\n" - " register unsigned int len;\n" : - option[C] ? - "(str, len)\n" - " register const char *str;\n" - " register unsigned int len;\n" : - option[ANSIC] | option[CPLUSPLUS] ? - "(register const char *str, register unsigned int len)\n" : - ""); + if (option[KRC] || option[C] || option[ANSIC] || option[CPLUSPLUS]) + printf (option[KRC] ? + "(str, len)\n" + " register char *str;\n" + " register unsigned int len;\n" : + option[C] ? + "(str, len)\n" + " register const char *str;\n" + " register unsigned int len;\n" : + "(register const char *str, register unsigned int len)\n"); /* Output the function's body. */ printf ("{\n"); diff --git a/contrib/gperf/src/options.cc b/contrib/gperf/src/options.cc index d15e21c..7706848 100644 --- a/contrib/gperf/src/options.cc +++ b/contrib/gperf/src/options.cc @@ -237,7 +237,7 @@ Options::print_options (void) { putchar (*arg); arg++; - if (*arg >= 'A' && *arg <= 'Z' || *arg >= 'a' && *arg <= 'z') + if ((*arg >= 'A' && *arg <= 'Z') || (*arg >= 'a' && *arg <= 'z')) { putchar (*arg); arg++; |