diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-05-15 10:48:02 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-05-15 11:00:00 -0400 |
commit | be2bc30f9cb3e8dd8b566db551a8ce3cc305e015 (patch) | |
tree | b956da9b71b744d3600ee4a1a7817c4f92f3c2ba /sim/ppc/psim.c | |
parent | c5a2e0123b7241be6a2022f1acb8fa700dda628a (diff) | |
download | fsf-binutils-gdb-be2bc30f9cb3e8dd8b566db551a8ce3cc305e015.zip fsf-binutils-gdb-be2bc30f9cb3e8dd8b566db551a8ce3cc305e015.tar.gz fsf-binutils-gdb-be2bc30f9cb3e8dd8b566db551a8ce3cc305e015.tar.bz2 |
sim: ppc: clean up various warnings
A random grab bag of minor fixes to enable -Werror for this port.
Cast address vars to long when the format was using %l.
Use %zu with sizeof operations.
Add const to a bunch of strings.
Trim unused variables.
Fix sizeof call to calculate target storage and not the pointer itself.
Diffstat (limited to 'sim/ppc/psim.c')
-rw-r--r-- | sim/ppc/psim.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/sim/ppc/psim.c b/sim/ppc/psim.c index ebb9cb4..70c02f7 100644 --- a/sim/ppc/psim.c +++ b/sim/ppc/psim.c @@ -93,10 +93,10 @@ psim_tree(void) } STATIC_INLINE_PSIM\ -(char *) -find_arg(char *err_msg, +(const char *) +find_arg(const char *err_msg, int *ptr_to_argp, - char **argv) + char * const *argv) { *ptr_to_argp += 1; if (argv[*ptr_to_argp] == NULL) @@ -216,7 +216,7 @@ psim_usage (int verbose, int help, SIM_OPEN_KIND kind) /* Test "string" for containing a string of digits that form a number between "min" and "max". The return value is the number or "err". */ static -int is_num( char *string, int min, int max, int err) +int is_num(const char *string, int min, int max, int err) { int result = 0; @@ -236,9 +236,9 @@ int is_num( char *string, int min, int max, int err) } INLINE_PSIM\ -(char **) +(char * const *) psim_options(device *root, - char **argv, + char * const *argv, SIM_OPEN_KIND kind) { device *current = root; @@ -247,8 +247,8 @@ psim_options(device *root, return NULL; argp = 0; while (argv[argp] != NULL && argv[argp][0] == '-') { - char *p = argv[argp] + 1; - char *param; + const char *p = argv[argp] + 1; + const char *param; while (*p != '\0') { switch (*p) { default: @@ -395,7 +395,7 @@ psim_options(device *root, INLINE_PSIM\ (void) psim_command(device *root, - char **argv) + char * const *argv) { int argp = 0; if (argv[argp] == NULL) { @@ -409,8 +409,8 @@ psim_command(device *root, trace_option(opt, 1); } else if (strcmp(*argv, "change-media") == 0) { - char *device = find_arg("Missing device name", &argp, argv); - char *media = argv[++argp]; + const char *device = find_arg("Missing device name", &argp, argv); + const char *media = argv[++argp]; device_ioctl(tree_find_device(root, device), NULL, 0, device_ioctl_change_media, media); } @@ -738,8 +738,8 @@ psim_init(psim *system) INLINE_PSIM\ (void) psim_stack(psim *system, - char **argv, - char **envp) + char * const *argv, + char * const *envp) { /* pass the stack device the argv/envp and let it work out what to do with it */ |