]> git.ipfire.org Git - thirdparty/lldpd.git/commit
build: improve const correctness and prototype declarations
authorGeorg Sauthoff <mail@gms.tf>
Fri, 24 Nov 2023 22:37:44 +0000 (23:37 +0100)
committerVincent Bernat <vincent@bernat.ch>
Sat, 25 Nov 2023 18:01:17 +0000 (19:01 +0100)
commitf540397c71985a9b005bc08a592bae39f84fcacc
tree3d6ef4a070f0eadd94ff020af6daa69a33b2cd81
parent247fb1a989fd3b939fe7099c388c7a9d78a2c1d8
build: improve const correctness and prototype declarations

String literals aren't assigned to non-const char pointers anymore, they
aren't returned via non-const char pointers, const strings aren't passed
arround via non-const pointers etc.

As a side effect, this eliminates all -Wdiscarded-qualifiers warnings.

Symbol visibility is minimized by declaring additional functions
static, i.e those which are only used inside a single translation unit.

Also, a few includes are added such that all non-static function
definitions 'see' their declarations - such that accidental differences
in signatures immedialy yield compile errors or warnings.

A few macros are also modified to emit forward declarations for
non-static functions in order to eliminate noise when compiling with
-Wmissing-prototypes.
However, it might make sense to move those non-static function
definitions from a header into a dedicated translation unit,
at some point.
49 files changed:
configure.ac
src/client/client.h
src/client/commands.c
src/client/conf-inv.c
src/client/conf-lldp.c
src/client/conf-med.c
src/client/conf-power.c
src/client/conf-system.c
src/client/display.c
src/client/kv_writer.c
src/client/lldpcli.c
src/client/misc.c
src/client/show.c
src/client/tokenizer.c
src/client/utf8.c
src/client/writer.h
src/client/xml_writer.c
src/daemon/agent.c
src/daemon/agent_priv.c
src/daemon/dmi-linux.c
src/daemon/dmi-openbsd.c
src/daemon/forward-linux.c
src/daemon/lldpd.c
src/daemon/lldpd.h
src/daemon/netlink.c
src/daemon/priv-linux.c
src/daemon/priv.c
src/daemon/protocols/cdp.c
src/daemon/protocols/edp.c
src/daemon/protocols/sonmp.h
src/lib/Makefile.am
src/lib/atom.h
src/lib/atoms/port.c
src/lib/lldpctl.h
src/log.c
src/marshal.h
src/version.c
tests/check_bitmap.c
tests/check_cdp.c
tests/check_edp.c
tests/check_fixedpoint.c
tests/check_lldp.c
tests/check_marshal.c
tests/check_pattern.c
tests/check_snmp.c
tests/check_sonmp.c
tests/common.c
tests/common.h
tests/decode.c