mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-23 15:40:39 +00:00
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:
parent
5a4ccf69af
commit
9f361fd293
1 changed files with 3 additions and 2 deletions
|
@ -185,11 +185,12 @@ int scriptfile_getbraces(scriptfile *sf, char **braceend)
|
||||||
|
|
||||||
int scriptfile_getlinum(scriptfile *sf, char *ptr)
|
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
|
//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 (stp=1;stp+stp<sf->linenum;stp+=stp); //stp = highest power of 2 less than sf->linenum
|
||||||
for (i=0;stp;stp>>=1)
|
for (i=0;stp;stp>>=1)
|
||||||
|
|
Loading…
Reference in a new issue