diff options
author | Tom Hughes <tomhughes@chromium.org> | 2021-04-30 16:10:02 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-05-03 21:40:28 +0000 |
commit | 967ae4603613fb65d989e441c5cd9b630f009a74 (patch) | |
tree | 4ce2359f502fe3059cc3517b1b4d41df3f7e1d80 | |
parent | 6affaa1b390bf653fa8861d04c2d834a230c7487 (diff) | |
download | chrome-ec-967ae4603613fb65d989e441c5cd9b630f009a74.tar.gz |
util: Add const
BRANCH=none
BUG=b:144959033
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I60f5f9211fb48391c1595a6a796596fa4471025f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2864515
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | util/lbcc.c | 5 | ||||
-rw-r--r-- | util/lock/ipc_lock.h | 2 | ||||
-rw-r--r-- | util/uut/main.c | 4 | ||||
-rw-r--r-- | util/uut/main.h | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/util/lbcc.c b/util/lbcc.c index c0bde684da..4a3633153e 100644 --- a/util/lbcc.c +++ b/util/lbcc.c @@ -279,7 +279,8 @@ struct parse_s { /* Fills in struct, returns number of words found. Note that pointers are only * copied. The strings they point to are not duplicated. */ -static int split_line(char *buf, char *delim, struct parse_s *elt, int max) +static int split_line(char *buf, const char *delim, struct parse_s *elt, + int max) { char *w, *ptr, *buf_savetok; int i; @@ -594,7 +595,7 @@ int main(int argc, char *argv[]) int opt_decode = 0; int c; int errorcnt = 0; - char *infile, *outfile; + const char *infile, *outfile; FILE *ifp, *ofp; char *progname = strrchr(argv[0], '/'); diff --git a/util/lock/ipc_lock.h b/util/lock/ipc_lock.h index ca739ac04e..5d0d321af4 100644 --- a/util/lock/ipc_lock.h +++ b/util/lock/ipc_lock.h @@ -33,7 +33,7 @@ struct ipc_lock { int is_held; /* internal */ - char *filename; /* provided by the developer */ + const char *filename; /* provided by the developer */ int fd; /* internal */ }; diff --git a/util/uut/main.c b/util/uut/main.c index 3a8204390e..e1f9720d9b 100644 --- a/util/uut/main.c +++ b/util/uut/main.c @@ -522,7 +522,7 @@ static const struct option long_opts[] = { {NULL, 0, 0, 0} }; -static char *short_opts = "vhqcArb:o:p:f:a:s:O:?"; +static const char *short_opts = "vhqcArb:o:p:f:a:s:O:?"; static void param_parse_cmd_line(int argc, char *argv[]) { @@ -760,7 +760,7 @@ static void exit_uart_app(int32_t exit_status) * black background. *--------------------------------------------------------------------------- */ -void display_color_msg(bool success, char *fmt, ...) +void display_color_msg(bool success, const char *fmt, ...) { va_list argptr; diff --git a/util/uut/main.h b/util/uut/main.h index 10c1391136..2885e7368a 100644 --- a/util/uut/main.h +++ b/util/uut/main.h @@ -65,7 +65,7 @@ extern bool console; * black background. *-------------------------------------------------------------------------- */ -void display_color_msg(bool success, char *fmt, ...); +void display_color_msg(bool success, const char *fmt, ...); #ifdef __cplusplus } |