sim: replace custom attributes with ansidecl.h
[binutils-gdb.git] / sim / arm / armos.c
index ea3d22979ac8d001ddcab507000fd610bdd0e95b..2ce7051a44ceeb92fa34233402b459ccf758e12c 100644 (file)
@@ -23,6 +23,7 @@
 
 #include "config.h"
 #include "ansidecl.h"
+#include "libiberty.h"
 
 #include <time.h>
 #include <errno.h>
@@ -260,7 +261,7 @@ SWIopen (ARMul_State * state, ARMword name, ARMword SWIflags)
     return;
 
   /* Now we need to decode the Demon open mode.  */
-  if (SWIflags >= sizeof (translate_open_mode) / sizeof (translate_open_mode[0]))
+  if (SWIflags >= ARRAY_SIZE (translate_open_mode))
     flags = 0;
   else
     flags = translate_open_mode[SWIflags];
@@ -292,8 +293,8 @@ SWIread (ARMul_State * state, ARMword f, ARMword ptr, ARMword len)
     {
       sim_callback->printf_filtered
        (sim_callback,
-        "sim: Unable to read 0x%ulx bytes - out of memory\n",
-        len);
+        "sim: Unable to read 0x%lx bytes - out of memory\n",
+        (long)len);
       return;
     }