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/device.c | |
parent | c5a2e0123b7241be6a2022f1acb8fa700dda628a (diff) | |
download | binutils-be2bc30f9cb3e8dd8b566db551a8ce3cc305e015.zip binutils-be2bc30f9cb3e8dd8b566db551a8ce3cc305e015.tar.gz binutils-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/device.c')
-rw-r--r-- | sim/ppc/device.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/sim/ppc/device.c b/sim/ppc/device.c index 6a0209e..4abef6f 100644 --- a/sim/ppc/device.c +++ b/sim/ppc/device.c @@ -180,10 +180,9 @@ device_full_name(device *leaf, unsigned sizeof_buf) { /* get a buffer */ - char full_name[1024]; - if (buf == (char*)0) { - buf = full_name; - sizeof_buf = sizeof(full_name); + if (buf == NULL) { + sizeof_buf = 1024; + buf = malloc(sizeof_buf); } /* construct a name */ @@ -211,9 +210,6 @@ device_full_name(device *leaf, strcat (buf, unit); } - /* return it usefully */ - if (buf == full_name) - buf = (char *) strdup(full_name); return buf; } @@ -1915,8 +1911,6 @@ INLINE_DEVICE\ device_clean(device *me, void *data) { - psim *system; - system = (psim*)data; TRACE(trace_device_init, ("device_clean - initializing %s", me->path)); clean_device_interrupt_edges(&me->interrupt_destinations); clean_device_instances(me); |