diff options
| author | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-12-15 09:44:14 +0000 |
|---|---|---|
| committer | tromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-12-15 09:44:14 +0000 |
| commit | 5e91b0fd72bd3783ac55c7d60cb5caeeccad18d8 (patch) | |
| tree | 4ce9e7c2ee19f26ed33b23bf64aeeaed86ee0a01 /gcc | |
| parent | 80558472ad52e1a93bc2836ec2318b0db91cbb09 (diff) | |
| download | ppe42-gcc-5e91b0fd72bd3783ac55c7d60cb5caeeccad18d8.tar.gz ppe42-gcc-5e91b0fd72bd3783ac55c7d60cb5caeeccad18d8.zip | |
* gjavah.c (print_field_info): Changed how most negative number is
printed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@24323 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/java/ChangeLog | 5 | ||||
| -rw-r--r-- | gcc/java/gjavah.c | 28 |
2 files changed, 19 insertions, 14 deletions
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index 4032f8ffacd..a3b36c2fd09 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,3 +1,8 @@ +1998-12-15 Tom Tromey <tromey@cygnus.com> + + * gjavah.c (print_field_info): Changed how most negative number is + printed. + Mon Dec 14 18:49:29 1998 Per Bothner <bothner@cygnus.com> * parse.y (fold_constant_for_init): New function. diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index af9a6c78646..45fc7d01052 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -307,39 +307,39 @@ DEFUN(print_field_info, (stream, jcf, name_index, sig_index, flags), case CONSTANT_Integer: { jint num; + int most_negative = 0; fputs (" static const jint ", out); print_name (out, jcf, name_index); fputs (" = ", out); num = JPOOL_INT (jcf, current_field_value); - /* We single out the most negative number to print in - hex. That avoids later warnings from g++. */ + /* We single out the most negative number to print + specially. This avoids later warnings from g++. */ if (num == 0x80000000) { - strcpy (buffer, "0x"); - format_uint (buffer + 2, (jlong) (uint32) num, 16); + most_negative = 1; + ++num; } - else - format_int (buffer, (jlong) num, 10); - fprintf (out, "%sL;\n", buffer); + format_int (buffer, (jlong) num, 10); + fprintf (out, "%sL%s;\n", buffer, most_negative ? " - 1" : ""); } break; case CONSTANT_Long: { jlong num; + int most_negative = 0; fputs (" static const jlong ", out); print_name (out, jcf, name_index); fputs (" = ", out); num = JPOOL_LONG (jcf, current_field_value); - /* We single out the most negative number to print in - hex. That avoids later warnings from g++. */ + /* We single out the most negative number to print + specially.. This avoids later warnings from g++. */ if (num == 0x8000000000000000LL) { - strcpy (buffer, "0x"); - format_uint (buffer + 2, num, 16); + most_negative = 1; + ++num; } - else - format_int (buffer, num, 10); - fprintf (out, "%sLL;\n", buffer); + format_int (buffer, num, 10); + fprintf (out, "%sLL%s;\n", buffer, most_negative ? " - 1" :""); } break; case CONSTANT_Float: |

