This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[commit] fix more sim 32/64 warnings
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Thu, 28 Aug 2003 13:03:07 -0400
- Subject: [commit] fix more sim 32/64 warnings
Hello,
The attached fixes some 32/64 warnings I hit when building the cross
targets on x86-64. I believe that with this in the cross targets (using
gdb_mbuild.sh) are all building again (?).
committed,
Andrew
Index: common/ChangeLog
2003-08-28 Andrew Cagney <cagney@redhat.com>
* dv-glue.c (hw_glue_finish): Change %d to %ld to match sizeof.
* sim-options.c (print_help): Cast the format with specifier to
"int".
Index: mn10300/ChangeLog
2003-08-28 Andrew Cagney <cagney@redhat.com>
* dv-mn103ser.c (do_polling_event): Change type of "serial_reg" to
"long".
(read_status_reg): Cast "serial_reg" to "long".
* dv-mn103tim.c (do_counter_event): Change type of "timer_nr" to
"long".
(do_counter6_event, write_mode_reg, write_tm6md): Ditto.
Index: common/dv-glue.c
===================================================================
RCS file: /cvs/src/src/sim/common/dv-glue.c,v
retrieving revision 1.2
diff -u -r1.2 dv-glue.c
--- common/dv-glue.c 23 Nov 2002 01:12:05 -0000 1.2
+++ common/dv-glue.c 28 Aug 2003 16:59:52 -0000
@@ -221,7 +221,7 @@
if (glue->sizeof_output == 0)
hw_abort (me, "at least one reg property size must be nonzero");
if (glue->sizeof_output % sizeof (unsigned_word) != 0)
- hw_abort (me, "reg property size must be %d aligned",
+ hw_abort (me, "reg property size must be %ld aligned",
sizeof (unsigned_word));
/* and the address */
hw_unit_address_to_attach_address (hw_parent (me),
@@ -230,7 +230,7 @@
&glue->address,
me);
if (glue->address % (sizeof (unsigned_word) * max_nr_ports) != 0)
- hw_abort (me, "reg property address must be %d aligned",
+ hw_abort (me, "reg property address must be %ld aligned",
sizeof (unsigned_word) * max_nr_ports);
glue->nr_outputs = glue->sizeof_output / sizeof (unsigned_word);
glue->output = hw_zalloc (me, glue->sizeof_output);
Index: common/sim-options.c
===================================================================
RCS file: /cvs/src/src/sim/common/sim-options.c,v
retrieving revision 1.4
diff -u -r1.4 sim-options.c
--- common/sim-options.c 5 Jun 2003 02:17:29 -0000 1.4
+++ common/sim-options.c 28 Aug 2003 16:59:54 -0000
@@ -769,7 +769,10 @@
end --;
if (end == chp)
end = chp + doc_width - 1;
- sim_io_printf (sd, "%.*s\n%*s", end - chp, chp, indent, "");
+ /* The cast should be ok - its distances between to
+ points in a string. */
+ sim_io_printf (sd, "%.*s\n%*s", (int) (end - chp), chp, indent,
+ "");
chp = end;
while (isspace (*chp) && *chp != '\0')
chp++;
Index: mn10300/dv-mn103ser.c
===================================================================
RCS file: /cvs/src/src/sim/mn10300/dv-mn103ser.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 dv-mn103ser.c
--- mn10300/dv-mn103ser.c 16 Apr 1999 01:35:07 -0000 1.1.1.1
+++ mn10300/dv-mn103ser.c 28 Aug 2003 16:59:57 -0000
@@ -240,7 +240,7 @@
void *data)
{
struct mn103ser *serial = hw_data(me);
- int serial_reg = (int) data;
+ long serial_reg = (long) data;
char c;
int count;
@@ -421,7 +421,7 @@
serial->device[serial_reg].event
= hw_event_queue_schedule (me, 1000,
do_polling_event,
- (void *)serial_reg);
+ (void *) (long) serial_reg);
}
if ( nr_bytes == 1 )
Index: mn10300/dv-mn103tim.c
===================================================================
RCS file: /cvs/src/src/sim/mn10300/dv-mn103tim.c,v
retrieving revision 1.2
diff -u -r1.2 dv-mn103tim.c
--- mn10300/dv-mn103tim.c 26 Feb 2003 17:04:19 -0000 1.2
+++ mn10300/dv-mn103tim.c 28 Aug 2003 16:59:58 -0000
@@ -568,7 +568,7 @@
void *data)
{
struct mn103tim *timers = hw_data(me);
- int timer_nr = (int) data;
+ long timer_nr = (long) data;
int next_timer;
/* Check if counting is still enabled. */
@@ -609,7 +609,7 @@
void *data)
{
struct mn103tim *timers = hw_data(me);
- int timer_nr = (int) data;
+ long timer_nr = (long) data;
int next_timer;
/* Check if counting is still enabled. */
@@ -705,7 +705,7 @@
static void
write_mode_reg (struct hw *me,
struct mn103tim *timers,
- int timer_nr,
+ long timer_nr,
const void *source,
unsigned nr_bytes)
/* for timers 0 to 5 */
@@ -716,7 +716,8 @@
if ( nr_bytes != 1 )
{
- hw_abort (me, "bad write size of %d bytes to TM%dMD.", nr_bytes, timer_nr);
+ hw_abort (me, "bad write size of %d bytes to TM%ldMD.", nr_bytes,
+ timer_nr);
}
mode_val = *(unsigned8 *)source;
@@ -742,7 +743,7 @@
{
if ( timer_nr == 0 || timer_nr == 4 )
{
- hw_abort(me, "Timer %d cannot be cascaded.", timer_nr);
+ hw_abort(me, "Timer %ld cannot be cascaded.", timer_nr);
}
}
else
@@ -839,7 +840,7 @@
{
unsigned8 mode_val0 = 0x00, mode_val1 = 0x00;
unsigned32 div_ratio;
- int timer_nr = 6;
+ long timer_nr = 6;
unsigned_word offset = address - timers->block[0].base;