aboutsummaryrefslogtreecommitdiff
path: root/gcc/java/jcf-write.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/java/jcf-write.c')
-rw-r--r--gcc/java/jcf-write.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index a73b7be..d775a81 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -772,7 +772,8 @@ static int
find_constant_wide (HOST_WIDE_INT lo, HOST_WIDE_INT hi,
struct jcf_partial *state)
{
- HOST_WIDE_INT w1, w2;
+ unsigned HOST_WIDE_INT w1;
+ HOST_WIDE_INT w2;
lshift_double (lo, hi, -32, 64, &w1, &w2, 1);
return find_constant2 (&state->cpool, CONSTANT_Long,
(jword)(w1 & 0xFFFFFFFF), (jword)(lo & 0xFFFFFFFF));
@@ -822,7 +823,8 @@ find_constant_index (tree value, struct jcf_partial *state)
static void
push_long_const (HOST_WIDE_INT lo, HOST_WIDE_INT hi, struct jcf_partial *state)
{
- HOST_WIDE_INT highpart, dummy;
+ unsigned HOST_WIDE_INT highpart;
+ HOST_WIDE_INT dummy;
jint lowpart = WORD_TO_INT (lo);
rshift_double (lo, hi, 32, 64, &highpart, &dummy, 1);
@@ -833,7 +835,8 @@ push_long_const (HOST_WIDE_INT lo, HOST_WIDE_INT hi, struct jcf_partial *state)
OP1(OPCODE_lconst_0 + lowpart);
}
else if ((highpart == 0 && lowpart > 0 && lowpart < 32768)
- || (highpart == -1 && lowpart < 0 && lowpart >= -32768))
+ || (highpart == (unsigned HOST_WIDE_INT)-1
+ && lowpart < 0 && lowpart >= -32768))
{
push_int_const (lowpart, state);
RESERVE (1);
@@ -2929,11 +2932,11 @@ generate_classfile (tree clas, struct jcf_partial *state)
{
struct chunk *cpool_chunk;
const char *source_file, *s;
- char *ptr;
+ unsigned char *ptr;
int i;
- char *fields_count_ptr;
+ unsigned char *fields_count_ptr;
int fields_count = 0;
- char *methods_count_ptr;
+ unsigned char *methods_count_ptr;
int methods_count = 0;
tree part;
int total_supers
@@ -3079,7 +3082,7 @@ generate_classfile (tree clas, struct jcf_partial *state)
int code_attributes_count = 0;
static tree Code_node = NULL_TREE;
tree t;
- char *attr_len_ptr;
+ unsigned char *attr_len_ptr;
struct jcf_handler *handler;
if (Code_node == NULL_TREE)
Code_node = get_identifier ("Code");