@@ -62,7 +62,6 @@ static void readConstPool(ClassEntry* class, U2 cp_count, U1** base) {
6262 ConstPool * constPool = newConstPool (cp_count );
6363 assert (NULL != constPool );
6464 int i ;
65- int j ;
6665 for (i = 1 ; i < cp_count ; ++ i ) {
6766 READ_U1 (tag , * base );
6867 constPool -> entries [i ].tag = tag ;
@@ -170,7 +169,6 @@ static void readClassField(Class *cls, U2 field_count, U1** base) {
170169 char * name = NULL ;
171170 U2 acc_flags ;
172171 U2 attr_count ;
173- U2 clsidx ;
174172 U2 nameidx ;
175173 U2 typeidx ;
176174
@@ -576,7 +574,6 @@ static void readAnnotationElementValue(ClassEntry* class, U1** base) {
576574 U2 type_idx ;
577575 U2 num_pairs ;
578576 U2 elem_name_idx ;
579- U1 tag ;
580577 int i , j ;
581578 for (i = 0 ; i < anno_count ; ++ i ) {
582579 READ_U2 (type_idx , * base );
@@ -831,7 +828,7 @@ Class* loadClassFromFile(char *path, char *classname) {
831828 fclose (fp );
832829 return NULL ;
833830 }
834- Class * class = defineClass (classname , buff , size );
831+ Class * class = defineClass (classname , ( const char * ) buff , size );
835832 free (buff );
836833 fclose (fp );
837834 return class ;
@@ -1052,7 +1049,9 @@ void logConstPoolEntry(const ConstPool* pool, const ConstPoolEntry* entry)
10521049 case CONST_Double :
10531050 u4high = entry -> info .double_info .high_bytes ;
10541051 u4low = entry -> info .double_info .low_bytes ;
1055- u8 = u4high <<32 + u4low ;
1052+ u8 = u4high ;
1053+ u8 <<= 32 ;
1054+ u8 += u4low ;
10561055 printf ("double\t%" PRIu64 "\n" , u8 );
10571056 break ;
10581057
@@ -1196,16 +1195,6 @@ void logClassEntry(ClassEntry *clsEntry)
11961195 printf (" major version: %d\n" , (int )clsEntry -> reserve [1 ]);
11971196 printf (" Constant pool count:%d\n" , clsEntry -> constPool -> length );
11981197
1199- int cls_idx ;
1200- int nametype_idx ;
1201- int name_idx ;
1202- int type_idx ;
1203- int index ;
1204-
1205- U4 u4high ;
1206- U4 u4low ;
1207- U8 u8 ;
1208-
12091198 for (i = 1 ; i < clsEntry -> constPool -> length ; ++ i ) {
12101199 printf (" #%d = " , i );
12111200 logConstPoolEntry (clsEntry -> constPool ,
0 commit comments