* sim-memopt.c: Include <unistd.h>.
authorAndrew Cagney <cagney@redhat.com>
Mon, 17 Jun 2002 21:45:55 +0000 (21:45 +0000)
committerAndrew Cagney <cagney@redhat.com>
Mon, 17 Jun 2002 21:45:55 +0000 (21:45 +0000)
(do_memopt_add): Fix printf format.
* sim-events.c (sim_events_schedule): Initialize ``dummy''.

sim/common/ChangeLog
sim/common/sim-events.c
sim/common/sim-memopt.c

index d3d21a62e2e70dad4878f3e09ab63e1bbf9b7fea..b7e13e3c55f2f2dd001473d0f40abcbf35831e9b 100644 (file)
@@ -1,3 +1,9 @@
+2002-06-17  Andrew Cagney  <cagney@redhat.com>
+
+       * sim-memopt.c: Include <unistd.h>.
+       (do_memopt_add): Fix printf format.
+       * sim-events.c (sim_events_schedule): Initialize ``dummy''.
+
 2002-06-16  Andrew Cagney  <ac131313@redhat.com>
 
        * aclocal.m4 (SIM_AC_OPTION_WARNINGS): Update to match GDB's
index 22531e3ece27f9bc9361b6ae1a840b0a3adc1457..6cd75eaf5095263e35508581daaad22bb7a755bd 100644 (file)
@@ -481,6 +481,7 @@ sim_events_schedule (SIM_DESC sd,
                     void *data)
 {
   va_list dummy;
+  memset (&dummy, 0, sizeof dummy);
   return sim_events_schedule_vtracef (sd, delta_time, handler, data,
                                      NULL, dummy);
 }
index a8e9df653320ddccd2f2ba6d0065183d52d5c17c..d66dc1ebad01d506acd4feed2e07ebcfbc175d59 100644 (file)
@@ -46,6 +46,9 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 #ifdef HAVE_SYS_STAT_H
 #include <sys/stat.h>
 #endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
 
 /* Memory fill byte. */
 static unsigned8 fill_byte_value;
@@ -167,7 +170,7 @@ do_memopt_add (SIM_DESC sd,
            {
              sim_io_error (sd,
                            "Error, cannot confirm that mmap file is large enough "
-                           "(>= %d bytes)\n", bytes);
+                           "(>= %ld bytes)\n", bytes);
            }
 
          free_buffer = mmap (0, bytes, PROT_READ|PROT_WRITE, MAP_SHARED, mmap_next_fd, 0);