When doing pointer math use intptr_t

git-svn-id: https://svn.eduke32.com/eduke32@788 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
qbix79 2008-06-10 19:21:16 +00:00
parent 5a4ccf69af
commit 9f361fd293
1 changed files with 3 additions and 2 deletions

View File

@ -185,11 +185,12 @@ int scriptfile_getbraces(scriptfile *sf, char **braceend)
int scriptfile_getlinum(scriptfile *sf, char *ptr)
{
int i, stp, ind;
int i, stp;
intptr_t ind;
//for(i=0;i<sf->linenum;i++) if (sf->lineoffs[i] >= ind) return(i+1); //brute force algo
ind = ((int)ptr) - ((int)sf->textbuf);
ind = ((intptr_t)ptr) - ((intptr_t)sf->textbuf);
for (stp=1;stp+stp<sf->linenum;stp+=stp); //stp = highest power of 2 less than sf->linenum
for (i=0;stp;stp>>=1)