Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] ELF/COFF/PE cleanups

Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/ChangeLog,v
retrieving revision 1.58
diff -u -r1.58 ChangeLog
--- ChangeLog	29 Jan 2003 14:19:33 -0000	1.58
+++ ChangeLog	29 Jan 2003 14:25:38 -0000
@@ -1,5 +1,12 @@
 2003-01-29 Alain Magloire
 
+	* utils/org/eclipse/cdt/utils/elf/Elf.java:
+	* utils/org/eclipse/cdt/utils/coff/Coff.java
+	* utils/org/eclipse/cdt/utils/coff/PE.java
+	Cleanup some warnings when accessing static fields.
+	
+2003-01-29 Alain Magloire
+
 	* model/org/eclipse/cdt/core/model/CoreModel.java (addElementChangedListeners):
 	remove static qualifier.
 	(removeElementChangedListeners): remove static qualifier.
Index: utils/org/eclipse/cdt/utils/coff/Coff.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/Coff.java,v
retrieving revision 1.2
diff -u -r1.2 Coff.java
--- utils/org/eclipse/cdt/utils/coff/Coff.java	25 Nov 2002 05:54:44 -0000	1.2
+++ utils/org/eclipse/cdt/utils/coff/Coff.java	29 Jan 2003 14:25:38 -0000
@@ -448,7 +448,7 @@
 	public SectionHeader[] getSectionHeaders() throws IOException {
 		if (scnhdrs == null) {
 			scnhdrs = new SectionHeader[getFileHeader().f_nscns];
-			long sec = getFileHeader().FILHSZ + getFileHeader().f_opthdr;
+			long sec = FileHeader.FILHSZ + getFileHeader().f_opthdr;
 			for (int i = 0; i < scnhdrs.length; i++, sec += SectionHeader.SCNHSZ) {
 				scnhdrs[i] = new SectionHeader(rfile, sec);
 			}
Index: utils/org/eclipse/cdt/utils/coff/PE.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/coff/PE.java,v
retrieving revision 1.3
diff -u -r1.3 PE.java
--- utils/org/eclipse/cdt/utils/coff/PE.java	28 Nov 2002 00:43:24 -0000	1.3
+++ utils/org/eclipse/cdt/utils/coff/PE.java	29 Jan 2003 14:25:38 -0000
@@ -403,11 +403,11 @@
 
 		/* PE characteristics, FileHeader.f_flags.  */
 		if ((filhdr.f_flags & PEConstants.IMAGE_FILE_DLL) != 0) {
-			attrib.type = attrib.PE_TYPE_SHLIB;
+			attrib.type = Attribute.PE_TYPE_SHLIB;
 		} else if ((filhdr.f_flags & PEConstants.IMAGE_FILE_EXECUTABLE_IMAGE) != 0) {
-			attrib.type = attrib.PE_TYPE_EXE;
+			attrib.type = Attribute.PE_TYPE_EXE;
 		} else {
-			attrib.type = attrib.PE_TYPE_OBJ;
+			attrib.type = Attribute.PE_TYPE_OBJ;
 		}
 
 		// For PE always assume little endian unless otherwise.
Index: utils/org/eclipse/cdt/utils/elf/Elf.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/Elf.java,v
retrieving revision 1.8
diff -u -r1.8 Elf.java
--- utils/org/eclipse/cdt/utils/elf/Elf.java	25 Nov 2002 05:55:31 -0000	1.8
+++ utils/org/eclipse/cdt/utils/elf/Elf.java	29 Jan 2003 14:25:39 -0000
@@ -530,7 +530,7 @@
 		} else {
 			for (int i = 0; i < section.sh_size / section.sh_entsize; i++ ) {
 				Dynamic dynEnt = new Dynamic(section, efile.readIntE(), efile.readIntE());
-				if ( dynEnt.d_tag == dynEnt.DT_NULL ) 
+				if ( dynEnt.d_tag == Dynamic.DT_NULL ) 
 					break;
 				dynList.add(dynEnt);
 			}
@@ -617,16 +617,16 @@
 
         switch( ehdr.e_type ) {
         	case Elf.ELFhdr.ET_CORE:
-				attrib.type = attrib.ELF_TYPE_CORE;
+				attrib.type = Attribute.ELF_TYPE_CORE;
 				break;
             case Elf.ELFhdr.ET_EXEC:
-                attrib.type = attrib.ELF_TYPE_EXE;
+                attrib.type = Attribute.ELF_TYPE_EXE;
                 break;
             case Elf.ELFhdr.ET_REL:
-                attrib.type = attrib.ELF_TYPE_OBJ;
+                attrib.type = Attribute.ELF_TYPE_OBJ;
                 break;
             case Elf.ELFhdr.ET_DYN:
-                attrib.type = attrib.ELF_TYPE_SHLIB;
+                attrib.type = Attribute.ELF_TYPE_SHLIB;
                 break;
         }
 
@@ -744,9 +744,9 @@
 				sections[i].sh_info = efile.readIntE();
 				sections[i].sh_addralign = efile.readIntE();
 				sections[i].sh_entsize = efile.readIntE();
-				if ( sections[i].sh_type == sections[i].SHT_SYMTAB )
+				if ( sections[i].sh_type == Section.SHT_SYMTAB )
 					syms = i;
-				if ( syms == 0 && sections[i].sh_type == sections[i].SHT_DYNSYM )
+				if ( syms == 0 && sections[i].sh_type == Section.SHT_DYNSYM )
 					syms = i;					
 			}
 		}
@@ -843,7 +843,7 @@
 	}
 		
 	public long swapInt( long val ) {
-		if ( ehdr.e_ident[ehdr.EI_DATA] == ehdr.ELFDATA2LSB ) {
+		if ( ehdr.e_ident[ELFhdr.EI_DATA] == ELFhdr.ELFDATA2LSB ) {
 			short tmp[] = new short[4];
 			tmp[0] = (short)(val & 0x00ff);
 			tmp[1] = (short)((val >> 8) & 0x00ff);
@@ -855,7 +855,7 @@
 	}
 
 	public int swapShort( short val ) {
-		if ( ehdr.e_ident[ehdr.EI_DATA] == ehdr.ELFDATA2LSB ) {
+		if ( ehdr.e_ident[ELFhdr.EI_DATA] == ELFhdr.ELFDATA2LSB ) {
 			short tmp[] = new short[2];
 			tmp[0] = (short)(val & 0x00ff);
 			tmp[1] = (short)((val >> 8) & 0x00ff);



Back to the top