]> Kevux Git Server - fll/commit
Update: Make sure constant pointers that are intended to be read-only are just that.
authorKevin Day <thekevinday@gmail.com>
Sun, 20 Feb 2022 06:48:32 +0000 (00:48 -0600)
committerKevin Day <thekevinday@gmail.com>
Sun, 20 Feb 2022 06:48:32 +0000 (00:48 -0600)
commitcc4170426ac31eb5703cc5d7b22ffc3b2519a11d
tree15e6d3841ccda0b5677fea9bf1c89e9dbedd48f4
parent58b2a48b3feafc956874e023785b421c920229f5
Update: Make sure constant pointers that are intended to be read-only are just that.

I often read "const char *name" as a constant pointer.
This is strictly incorrect.
This actual means that this is a pointer to a constant character.

Mass change the pointers to constants that are intended to be themselves constant.
This is changed via a regex and test to compile and run.
I'm not sure if there are any problems with this change but everything seems fine.

This new code looks more awkward but is strictly correct.
Now "const char * const name" represents a constant pointer to a constant string.
This makes the parameter a constant and still allows for the pointer to point to a constant variable.
24 files changed:
level_0/f_account/tests/unit/c/mock-account.c
level_0/f_account/tests/unit/c/mock-account.h
level_0/f_capability/c/capability.c
level_0/f_capability/tests/unit/c/mock-capability.c
level_0/f_capability/tests/unit/c/mock-capability.h
level_0/f_conversion/tests/unit/c/mock-conversion.c
level_0/f_conversion/tests/unit/c/mock-conversion.h
level_0/f_directory/c/private-directory.c
level_0/f_directory/c/private-directory.h
level_0/f_signal/c/signal.c
level_0/f_signal/c/signal.h
level_0/f_string/c/string/common.h
level_0/f_thread/c/thread.c
level_0/f_thread/c/thread.h
level_2/fll_program/c/program.c
level_2/fll_program/c/program.h
level_3/controller/c/control/private-control.c
level_3/controller/c/control/private-control.h
level_3/controller/c/controller/private-controller.c
level_3/controller/c/controller/private-controller.h
level_3/controller/c/entry/private-entry.c
level_3/controller/c/entry/private-entry.h
level_3/fake/c/private-clean.c
level_3/fake/c/private-clean.h