public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, libjava] gen-from-JIS nits
@ 2008-07-06  9:16 Ralf Wildenhues
  2008-07-06 14:58 ` Tom Tromey
  2008-07-08 18:12 ` Ralf Wildenhues
  0 siblings, 2 replies; 3+ messages in thread
From: Ralf Wildenhues @ 2008-07-06  9:16 UTC (permalink / raw)
  To: gcc-patches, java-patches

This fixes warnings about implicit declarations of strcmp, exit, enter,
print_table, an extra argument to fprintf, and a missing argc check.
And a typo.

Bootstrapped, regtested i686-pc-linux-gnu.  OK for trunk?

Thanks,
Ralf

libjava/ChangeLog:
2008-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>

	* gnu/gcj/convert/make-trie.h: New.
	* gnu/gcj/convert/gen-from-JIS.c: Include it.
	* gnu/gcj/convert/make-trie.c: Likewise.
	Fix typos and compiler warnings, diagnose a missing argument.
	* Makefile.am (gen_from_JIS_SOURCES): Add gnu/gcj/convert/make-trie.h.
	* Makefile.in: Regenerate.

diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 5790104..ac5b7e1 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -589,7 +589,8 @@ noinst_PROGRAMS = gen-from-JIS
 
 gen_from_JIS_SOURCES = \
 	gnu/gcj/convert/gen-from-JIS.c \
-	gnu/gcj/convert/make-trie.c
+	gnu/gcj/convert/make-trie.c \
+	gnu/gcj/convert/make-trie.h
 
 gen_from_JIS_DEPENDENCIES = \
 	gnu/gcj/convert/JIS0201.h \
diff --git a/libjava/gnu/gcj/convert/gen-from-JIS.c b/libjava/gnu/gcj/convert/gen-from-JIS.c
index 1374580..d4cca14 100644
--- a/libjava/gnu/gcj/convert/gen-from-JIS.c
+++ b/libjava/gnu/gcj/convert/gen-from-JIS.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1999  Free Software Foundation
+/* Copyright (C) 1999, 2008  Free Software Foundation
 
    This file is part of libgcj.
 
@@ -7,6 +7,10 @@ Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
 details.  */
 
 #include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "make-trie.h"
+
 struct chval
 {
   unsigned char b1;            /* 1st byte */
@@ -59,6 +63,11 @@ main(int argc, char** argv)
   int low1_uc = 0xFFFF, high1_uc = 0;
   int low2_uc = 0xFFFF, high2_uc = 0;
   int i;  int row, col;
+  if (argc < 2)
+    {
+      fprintf (stderr, "missing argument!\n");
+      exit (-1);
+    }
   if (strcmp (argv[1], "JIS0208") == 0)
     chtab = chtab_0208;
   else if (strcmp (argv[1], "JIS0212") == 0)
@@ -106,8 +115,7 @@ main(int argc, char** argv)
 
   fprintf(out,"/* This file is automatically generated from %s.TXT. */\n",
 	  argv[1]);
-  fprintf(out,"#pragma GCC java_exceptions\n",
-	  argv[1]);
+  fprintf(out,"#pragma GCC java_exceptions\n");
   fprintf(out, "unsigned short %s_to_Unicode[%d][%d] = {\n",
 	  argv[1], max1 - min1 + 1,  max2 - min2 + 1);
   i = 0;
@@ -156,7 +164,7 @@ main(int argc, char** argv)
 		}
 	      else
 		{
-		  fprintf (stderr, "error - char table our of order!\n");
+		  fprintf (stderr, "error - char table out of order!\n");
 		  exit (-1);
 		}
 	      if (col != max2)
diff --git a/libjava/gnu/gcj/convert/make-trie.c b/libjava/gnu/gcj/convert/make-trie.c
index e89f70c..fe2d789 100644
--- a/libjava/gnu/gcj/convert/make-trie.c
+++ b/libjava/gnu/gcj/convert/make-trie.c
@@ -8,6 +8,7 @@ details.  */
 
 #include <stdio.h>
 #include <stdlib.h>
+#include "make-trie.h"
 
 typedef struct trie_node
 {
diff --git a/libjava/gnu/gcj/convert/make-trie.h b/libjava/gnu/gcj/convert/make-trie.h
new file mode 100644
index 0000000..bbe20a5
--- /dev/null
+++ b/libjava/gnu/gcj/convert/make-trie.h
@@ -0,0 +1,13 @@
+/* Copyright (C) 2008  Free Software Foundation
+
+   This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
+details.  */
+
+#include <stddef.h>
+
+extern void print_table (char *name, FILE *out);
+
+extern void enter (int key, int value);

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH, libjava] gen-from-JIS nits
  2008-07-06  9:16 [PATCH, libjava] gen-from-JIS nits Ralf Wildenhues
@ 2008-07-06 14:58 ` Tom Tromey
  2008-07-08 18:12 ` Ralf Wildenhues
  1 sibling, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2008-07-06 14:58 UTC (permalink / raw)
  To: Ralf Wildenhues; +Cc: gcc-patches, java-patches

>>>>> "Ralf" == Ralf Wildenhues <Ralf.Wildenhues@gmx.de> writes:

Ralf> This fixes warnings about implicit declarations of strcmp, exit, enter,
Ralf> print_table, an extra argument to fprintf, and a missing argc check.
Ralf> And a typo.

Ralf> Bootstrapped, regtested i686-pc-linux-gnu.  OK for trunk?

Yes, thanks.

Tom

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH, libjava] gen-from-JIS nits
  2008-07-06  9:16 [PATCH, libjava] gen-from-JIS nits Ralf Wildenhues
  2008-07-06 14:58 ` Tom Tromey
@ 2008-07-08 18:12 ` Ralf Wildenhues
  1 sibling, 0 replies; 3+ messages in thread
From: Ralf Wildenhues @ 2008-07-08 18:12 UTC (permalink / raw)
  To: gcc-patches, java-patches

* Ralf Wildenhues wrote on Sun, Jul 06, 2008 at 11:15:58AM CEST:
> 
> libjava/ChangeLog:
> 2008-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
> 
> 	* gnu/gcj/convert/make-trie.h: New.
> 	* gnu/gcj/convert/gen-from-JIS.c: Include it.
> 	* gnu/gcj/convert/make-trie.c: Likewise.
> 	Fix typos and compiler warnings, diagnose a missing argument.
> 	* Makefile.am (gen_from_JIS_SOURCES): Add gnu/gcj/convert/make-trie.h.
> 	* Makefile.in: Regenerate.

Darn, I forgot to 'svn add gnu/gcj/convert/make-trie.h'.  Fixed now.

Sorry about that,
Ralf

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-07-08 18:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-06  9:16 [PATCH, libjava] gen-from-JIS nits Ralf Wildenhues
2008-07-06 14:58 ` Tom Tromey
2008-07-08 18:12 ` Ralf Wildenhues

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).