/* dv-m68hc11tim.c -- Simulation of the 68HC11 timer devices.
- Copyright (C) 1999-2013 Free Software Foundation, Inc.
+ Copyright (C) 1999-2021 Free Software Foundation, Inc.
Written by Stephane Carrez (stcarrez@nerim.fr)
(From a driver model Contributed by Cygnus Solutions.)
COMPARE_EVENT
};
-void
+static void
m68hc11tim_timer_event (struct hw *me, void *data)
{
SIM_DESC sd;
{
char time_buf[32];
char cycle_buf[32];
- static char buf[64];
+ /* Big enough to handle 64-bit t, time_buf, and cycle_buf. */
+ static char buf[128];
time_buf[0] = 0;
cycle_buf[0] = 0;
sprintf (cycle_buf, " cycle%s",
(t > 1 ? "s" : ""));
- if (t < LONG_MAX)
- sprintf (buf, "%9lu%s%s", (unsigned long) t, cycle_buf, time_buf);
- else
- sprintf (buf, "%llu%s%s", t, cycle_buf, time_buf);
+ sprintf (buf, "%9" PRIi64 "%s%s", t, cycle_buf, time_buf);
return buf;
}
else
{
signed64 t;
- sim_cpu* cpu;
+ sim_cpu *cpu;
cpu = STATE_CPU (sd, 0);