mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-25 11:10:47 +00:00
Mostly useless const-ifying and minor variable scope reduction in cache1d
git-svn-id: https://svn.eduke32.com/eduke32@7030 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
c2f26439d1
commit
a3bfaed262
1 changed files with 8 additions and 10 deletions
|
@ -761,10 +761,10 @@ int initgroupfile(const char *filename)
|
||||||
|
|
||||||
kread_grp(numgroupfiles,gfilelist[numgroupfiles],gnumfiles[numgroupfiles]<<4);
|
kread_grp(numgroupfiles,gfilelist[numgroupfiles],gnumfiles[numgroupfiles]<<4);
|
||||||
|
|
||||||
int32_t j = (gnumfiles[numgroupfiles]+1)<<4, k;
|
int32_t j = (gnumfiles[numgroupfiles]+1)<<4;
|
||||||
for (bssize_t i=0; i<gnumfiles[numgroupfiles]; i++)
|
for (bssize_t i=0; i<gnumfiles[numgroupfiles]; i++)
|
||||||
{
|
{
|
||||||
k = B_LITTLE32(*((int32_t *)&gfilelist[numgroupfiles][(i<<4)+12]));
|
int32_t const k = B_LITTLE32(*((int32_t *)&gfilelist[numgroupfiles][(i<<4)+12]));
|
||||||
gfilelist[numgroupfiles][(i<<4)+12] = 0;
|
gfilelist[numgroupfiles][(i<<4)+12] = 0;
|
||||||
gfileoffs[numgroupfiles][i] = j;
|
gfileoffs[numgroupfiles][i] = j;
|
||||||
j += k;
|
j += k;
|
||||||
|
@ -1144,9 +1144,7 @@ int32_t kread_internal(int32_t handle, void *buffer, int32_t leng, uint8_t *arra
|
||||||
|
|
||||||
int32_t klseek_internal(int32_t handle, int32_t offset, int32_t whence, uint8_t *arraygrp, intptr_t *arrayhan, int32_t *arraypos)
|
int32_t klseek_internal(int32_t handle, int32_t offset, int32_t whence, uint8_t *arraygrp, intptr_t *arrayhan, int32_t *arraypos)
|
||||||
{
|
{
|
||||||
int32_t i, groupnum;
|
int32_t const groupnum = arraygrp[handle];
|
||||||
|
|
||||||
groupnum = arraygrp[handle];
|
|
||||||
|
|
||||||
if (groupnum == GRP_FILESYSTEM) return Blseek(arrayhan[handle],offset,whence);
|
if (groupnum == GRP_FILESYSTEM) return Blseek(arrayhan[handle],offset,whence);
|
||||||
#ifdef WITHKPLIB
|
#ifdef WITHKPLIB
|
||||||
|
@ -1170,9 +1168,11 @@ int32_t klseek_internal(int32_t handle, int32_t offset, int32_t whence, uint8_t
|
||||||
case BSEEK_SET:
|
case BSEEK_SET:
|
||||||
arraypos[handle] = offset; break;
|
arraypos[handle] = offset; break;
|
||||||
case BSEEK_END:
|
case BSEEK_END:
|
||||||
i = arrayhan[handle];
|
{
|
||||||
|
int32_t const i = arrayhan[handle];
|
||||||
arraypos[handle] = (gfileoffs[groupnum][i+1]-gfileoffs[groupnum][i])+offset;
|
arraypos[handle] = (gfileoffs[groupnum][i+1]-gfileoffs[groupnum][i])+offset;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
case BSEEK_CUR:
|
case BSEEK_CUR:
|
||||||
arraypos[handle] += offset; break;
|
arraypos[handle] += offset; break;
|
||||||
}
|
}
|
||||||
|
@ -1183,9 +1183,7 @@ int32_t klseek_internal(int32_t handle, int32_t offset, int32_t whence, uint8_t
|
||||||
|
|
||||||
int32_t kfilelength_internal(int32_t handle, uint8_t *arraygrp, intptr_t *arrayhan, int32_t *arraypos)
|
int32_t kfilelength_internal(int32_t handle, uint8_t *arraygrp, intptr_t *arrayhan, int32_t *arraypos)
|
||||||
{
|
{
|
||||||
int32_t i, groupnum;
|
int32_t const groupnum = arraygrp[handle];
|
||||||
|
|
||||||
groupnum = arraygrp[handle];
|
|
||||||
if (groupnum == GRP_FILESYSTEM)
|
if (groupnum == GRP_FILESYSTEM)
|
||||||
{
|
{
|
||||||
// return (filelength(arrayhan[handle]))
|
// return (filelength(arrayhan[handle]))
|
||||||
|
@ -1204,7 +1202,7 @@ int32_t kfilelength_internal(int32_t handle, uint8_t *arraygrp, intptr_t *arrayh
|
||||||
return kzfilelength();
|
return kzfilelength();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
i = arrayhan[handle];
|
int32_t const i = arrayhan[handle];
|
||||||
return gfileoffs[groupnum][i+1]-gfileoffs[groupnum][i];
|
return gfileoffs[groupnum][i+1]-gfileoffs[groupnum][i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue