* [patch] sim: constify sim_fpu_print_status
@ 2010-04-10 20:29 Mike Frysinger
2010-04-10 21:25 ` Mike Frysinger
0 siblings, 1 reply; 2+ messages in thread
From: Mike Frysinger @ 2010-04-10 20:29 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1016 bytes --]
I've committed the following patch as obvious. The local "prefix" variable is
only assigned const strings, and only passed to printf() functions, so add
"const" to avoid gcc warnings:
common/sim-fpu.c: In function 'sim_fpu_print_status':
common/sim-fpu.c:2508: warning: initialization discards qualifiers from
pointer target type
common/sim-fpu.c:2566: warning: assignment discards qualifiers from pointer
target type
-mike
2010-04-10 Mike Frysinger <vapier@gentoo.org>
* sim-fpu.c (sim_fpu_print_status): Add const markings to local
"prefix" var.
RCS file: /cvs/src/src/sim/common/sim-fpu.c,v
retrieving revision 1.17
diff -u -p -r1.17 sim-fpu.c
--- sim/common/sim-fpu.c 10 Apr 2010 08:26:45 -0000 1.17
+++ sim/common/sim-fpu.c 10 Apr 2010 20:25:45 -0000
@@ -2497,7 +2497,7 @@ sim_fpu_print_status (int status,
void *arg)
{
int i = 1;
- char *prefix = "";
+ const char *prefix = "";
while (status >= i)
{
switch ((sim_fpu_status) (status & i))
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [patch] sim: constify sim_fpu_print_status
2010-04-10 20:29 [patch] sim: constify sim_fpu_print_status Mike Frysinger
@ 2010-04-10 21:25 ` Mike Frysinger
0 siblings, 0 replies; 2+ messages in thread
From: Mike Frysinger @ 2010-04-10 21:25 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: Text/Plain, Size: 1293 bytes --]
On Saturday 10 April 2010 16:29:28 Mike Frysinger wrote:
> I've committed the following patch as obvious. The local "prefix" variable
> is only assigned const strings, and only passed to printf() functions, so
> add "const" to avoid gcc warnings:
> common/sim-fpu.c: In function 'sim_fpu_print_status':
> common/sim-fpu.c:2508: warning: initialization discards qualifiers from
> pointer target type
> common/sim-fpu.c:2566: warning: assignment discards qualifiers from pointer
> target type
blah, this takes it a little out of the "obvious" range, but i forgot to
include this hunk. hopefully it doesnt cause problems :/.
2010-04-10 Mike Frysinger <vapier@gentoo.org>
* sim-fpu.c (sim_fpu_print_func): Add const markings to format buffer.
RCS file: /cvs/src/src/sim/common/sim-fpu.h,v
retrieving revision 1.15
diff -u -p -r1.15 sim-fpu.h
--- sim/common/sim-fpu.h 1 Jan 2010 10:03:27 -0000 1.15
+++ sim/common/sim-fpu.h 10 Apr 2010 21:22:23 -0000
@@ -404,7 +404,7 @@ extern const sim_fpu sim_fpu_max64;
/* For debugging */
-typedef void sim_fpu_print_func (void *, char *, ...);
+typedef void sim_fpu_print_func (void *, const char *, ...);
/* Print a sim_fpu with full precision. */
INLINE_SIM_FPU (void) sim_fpu_print_fpu (const sim_fpu *f,
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-04-10 21:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-10 20:29 [patch] sim: constify sim_fpu_print_status Mike Frysinger
2010-04-10 21:25 ` Mike Frysinger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox