get rid of pointer/int cast warnings on 64bit.
authorStefan Reinauer <stepan@openbios.org>
Fri, 26 Sep 2003 09:47:41 +0000 (09:47 +0000)
committerStefan Reinauer <stepan@openbios.org>
Fri, 26 Sep 2003 09:47:41 +0000 (09:47 +0000)
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1139 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/options/build_opt_tbl.c

index 6a489bdb52897234add4d0df5dece02df7368b8c..982e01b136d55c7457e7ec62ccddedc81777ed0d 100644 (file)
@@ -25,7 +25,7 @@ static unsigned char clip[9]={0,1,3,7,0x0f,0x1f,0x3f,0x7f,0xff};
 */
 void test_for_entry_overlaps(int entry_start,int entry_end)
 {
-       int ptr;
+       long ptr;
        int buffer_bit_size;
        int offset;
        int byte;
@@ -155,9 +155,11 @@ int main(int argc, char **argv)
        int entry_mode=0;
        int enum_mode=0;
        int checksum_mode=0;
-       int ptr,cnt;
+       long ptr;
+       int cnt;
        char *cptr;
-       int offset,entry_start;
+       long offset;
+       int entry_start;
        int entries_length;
        int enum_length;
        int len;
@@ -271,8 +273,8 @@ int main(int argc, char **argv)
        }
 
        /* put the length of the entries into the header section */
-       entries_length=(int)cptr;
-       entries_length-=(int)(cmos_table+ct->header_length);
+       entries_length=(long)cptr;
+       entries_length-=(long)(cmos_table+ct->header_length);
 
        /* compute the start of the enumerations section */
        entry_start=(int)cmos_table;
@@ -313,14 +315,14 @@ int main(int argc, char **argv)
                if(cnt%4)
                        cnt+=4-(cnt%4);
                /* store the record length */
-               c_enums->size=((int)&c_enums->text[cnt])-(int)c_enums;
+               c_enums->size=((long)&c_enums->text[cnt])-(long)c_enums;
                /* store the record type */
                c_enums->tag=LB_TAG_OPTION_ENUM;
                /* increment to the next record */
                c_enums=(struct cmos_enums*)&c_enums->text[cnt];
        }
        /* save the enumerations length */
-       enum_length=(int)c_enums-(int)c_enums_start;
+       enum_length=(long)c_enums-(long)c_enums_start;
        ct->size=ct->header_length+enum_length+entries_length;
 
        /* Get the checksum records */