Bernhard Voelker 841aa66f1e maint: avoid warnings from sparse tool
https://sparse.docs.kernel.org/
Running the tool against unviled the following warnings:

  find/parser.c:328:7: warning: Using plain integer as NULL pointer
  find/parser.c:328:10: warning: Using plain integer as NULL pointer
  find/parser.c:328:13: warning: Using plain integer as NULL pointer
  find/parser.c:466:49: warning: Using plain integer as NULL pointer
  find/parser.c:656:45: warning: Using plain integer as NULL pointer
  find/print.c:1024:30: warning: Using plain integer as NULL pointer
  lib/regexprops.c:531:7: warning: symbol 'options' shadows an earlier one
  lib/regextype.c:48:24: warning: symbol 'regex_map' was not declared. Should it be static?
  locate/locate.c:131:25: warning: symbol 'check_existence' was not declared. Should it be static?
  locate/locate.c:207:12: warning: symbol 'metacharacters' was not declared. Should it be static?
  xargs/xargs.c:902:24: warning: symbol 'state' shadows an earlier one
  xargs/xargs.c:542:23: warning: Using plain integer as NULL pointer

The fixes for these findings are all trivial, so let's apply them.

* find/parser.c (parse_table): Initialize pointer-type members of
the last element with NULL instead of 0.
(get_noop): Compare to NULL as end condition of for-loop.
(find_parser): Likewise.
* find/print.c (do_fprintf): Initialize linkname with NULL instead of 0.
* lib/regexprops.c (describe_all): Rename local variable options
to regopts to avoid name shadowing.
* lib/regextype.c (regex_map): Declare static.
* locate/locate.c (check_existence): Likewise.
(metacharacters): Likewise.
* xargs/xargs.c (main): Set eof_str to NULL instead of 0.
2022-01-06 03:28:38 +01:00
..