*** empty log message ***
[deliverable/binutils-gdb.git] / binutils / windmc.c
index 70c9160aba95a1f0adb8d4bc581f136b7f0ea0d5..c7aa8f8e4e9704b237e6655251cd0adc6173059c 100644 (file)
@@ -175,7 +175,7 @@ res_init (void)
 void *
 res_alloc (rc_uint_type bytes)
 {
-  return (void *) obstack_alloc (&res_obstack, (size_t) bytes);
+  return obstack_alloc (&res_obstack, (size_t) bytes);
 }
 
 static FILE *
@@ -381,7 +381,8 @@ convert_unicode_to_ACP (const unichar *usz)
     return NULL;
   codepage_from_unicode (&l, usz, &s, mcset_codepage_out);
   if (! s)
-    fatal ("unicode string not mappable to ASCII codepage 0x%lx.\n", (long) mcset_codepage_out);
+    fatal ("unicode string not mappable to ASCII codepage 0x%lx.\n",
+          (unsigned long) mcset_codepage_out);
   return s;
 }
 
@@ -803,8 +804,8 @@ write_rc (FILE *fp)
   int i, l;
 
   fprintf (fp,
-    "/* Do not edit this file manually.\n"
-    "   This file is autogenerated by windmc.  */\n\n");
+          "/* Do not edit this file manually.\n"
+          "   This file is autogenerated by windmc.  */\n\n");
   if (! mc_nodes_lang_count)
     return;
   n = NULL;
@@ -816,10 +817,11 @@ write_rc (FILE *fp)
       ++i;
       n = mc_nodes_lang[l];
       fprintf (fp, "\n// Country: %s\n// Language: %s\n#pragma code_page(%u)\n",
-       n->lang->lang_info.country, n->lang->lang_info.name,
-       (unsigned) n->lang->lang_info.wincp);
-      fprintf (fp, "LANGUAGE 0x%lx, 0x%lx\n", (long) (n->lang->nval & 0x3ff),
-       (long) ((n->lang->nval & 0xffff) >> 10));
+              n->lang->lang_info.country, n->lang->lang_info.name,
+              (unsigned) n->lang->lang_info.wincp);
+      fprintf (fp, "LANGUAGE 0x%lx, 0x%lx\n",
+              (unsigned long) (n->lang->nval & 0x3ff),
+              (unsigned long) ((n->lang->nval & 0xffff) >> 10));
       fprintf (fp, "1 MESSAGETABLE \"");
       if (mcset_prefix_bin)
        fprintf (fp, "%s_", mcset_mc_basename);
@@ -1142,7 +1144,7 @@ main (int argc, char **argv)
     unichar *u;
     rc_uint_type ul;
     char *buff;
-    long flen;
+    bfd_size_type flen;
     FILE *fp = fopen (input_filename, "rb");
 
     if (!fp)
@@ -1153,7 +1155,8 @@ main (int argc, char **argv)
     fseek (fp, 0, SEEK_SET);
     buff = malloc (flen + 3);
     memset (buff, 0, flen + 3);
-    fread (buff, 1, flen, fp);
+    if (fread (buff, 1, flen, fp) < flen)
+      fatal (_("unable to read contents of %s"), input_filename);
     fclose (fp);
     if (mcset_text_in_is_unicode != 1)
       {
This page took 0.02342 seconds and 4 git commands to generate.