Set functions and variables that can be static to be static

This commit is contained in:
Magnus Norddahl 2020-01-28 22:21:53 +01:00
parent 9b88d41169
commit ba23ebdc0f
3 changed files with 28 additions and 27 deletions

View file

@ -89,7 +89,7 @@ static int32_t tribufverts = 0;
static mdmodel_t *mdload(const char *); static mdmodel_t *mdload(const char *);
static void mdfree(mdmodel_t *); static void mdfree(mdmodel_t *);
int32_t globalnoeffect=0; static int32_t globalnoeffect=0;
void freeallmodels() void freeallmodels()
{ {
@ -507,7 +507,7 @@ FTexture *mdloadskin(idmodel_t *m, int32_t number, int32_t pal, int32_t surf, bo
} }
//Note: even though it says md2model, it works for both md2model&md3model //Note: even though it says md2model, it works for both md2model&md3model
void updateanimation(md2model_t *m, tspriteptr_t tspr, uint8_t lpal) static void updateanimation(md2model_t *m, tspriteptr_t tspr, uint8_t lpal)
{ {
if (m->numframes < 2) if (m->numframes < 2)
{ {
@ -904,7 +904,7 @@ static md2model_t *md2load(FileReader & fil, const char *filnam)
//---------------------------------------- MD2 LIBRARY ENDS ---------------------------------------- //---------------------------------------- MD2 LIBRARY ENDS ----------------------------------------
// DICHOTOMIC RECURSIVE SORTING - USED BY MD3DRAW // DICHOTOMIC RECURSIVE SORTING - USED BY MD3DRAW
int32_t partition(uint16_t *indexes, float *depths, int32_t f, int32_t l) static int32_t partition(uint16_t *indexes, float *depths, int32_t f, int32_t l)
{ {
int32_t up = f, down = l; int32_t up = f, down = l;
float piv = depths[f]; float piv = depths[f];
@ -1842,7 +1842,7 @@ static void md3free(md3model_t *m)
//---------------------------------------- MD3 LIBRARY ENDS ---------------------------------------- //---------------------------------------- MD3 LIBRARY ENDS ----------------------------------------
//--------------------------------------- MD LIBRARY BEGINS --------------------------------------- //--------------------------------------- MD LIBRARY BEGINS ---------------------------------------
mdmodel_t *mdload(const char *filnam) static mdmodel_t *mdload(const char *filnam)
{ {
mdmodel_t *vm; mdmodel_t *vm;
int32_t i; int32_t i;
@ -1905,7 +1905,7 @@ int32_t polymost_mddraw(tspriteptr_t tspr)
return 0; return 0;
} }
void mdfree(mdmodel_t *vm) static void mdfree(mdmodel_t *vm)
{ {
if (vm->mdnum == 1) { voxfree((voxmodel_t *)vm); return; } if (vm->mdnum == 1) { voxfree((voxmodel_t *)vm); return; }
if (vm->mdnum == 2 || vm->mdnum == 3) { md3free((md3model_t *)vm); return; } if (vm->mdnum == 2 || vm->mdnum == 3) { md3free((md3model_t *)vm); return; }

View file

@ -74,7 +74,7 @@ typedef struct { float x, cy[2], fy[2]; int32_t tag; int16_t n, p, ctag, ftag; }
static vsptyp vsp[VSPMAX]; static vsptyp vsp[VSPMAX];
static int32_t gtag, viewportNodeCount; static int32_t gtag, viewportNodeCount;
static float xbl, xbr, xbt, xbb; static float xbl, xbr, xbt, xbb;
int32_t domost_rejectcount; static int32_t domost_rejectcount;
#ifdef YAX_ENABLE #ifdef YAX_ENABLE
typedef struct { float x, cy[2]; int32_t tag; int16_t n, p, ctag; } yax_vsptyp; typedef struct { float x, cy[2]; int32_t tag; int16_t n, p, ctag; } yax_vsptyp;
static yax_vsptyp yax_vsp[YAX_MAXBUNCHES*2][VSPMAX]; static yax_vsptyp yax_vsp[YAX_MAXBUNCHES*2][VSPMAX];
@ -92,7 +92,7 @@ static float dxb1[MAXWALLSB], dxb2[MAXWALLSB];
#define SOFTROTMAT 0 #define SOFTROTMAT 0
int32_t r_pogoDebug = 0; static int32_t r_pogoDebug = 0;
int32_t polymostcenterhoriz = 100; int32_t polymostcenterhoriz = 100;
static float gviewxrange; static float gviewxrange;
@ -103,16 +103,16 @@ float gyxscale, ghalfx, grhalfxdown10, grhalfxdown10x, ghalfy;
float gcosang, gsinang, gcosang2, gsinang2; float gcosang, gsinang, gcosang2, gsinang2;
float gtang = 0.f; float gtang = 0.f;
float gchang = 0, gshang = 0, gctang = 0, gstang = 0; static float gchang = 0, gshang = 0, gctang = 0, gstang = 0;
float gvrcorrection = 1.f; static float gvrcorrection = 1.f;
static vec3d_t xtex, ytex, otex, xtex2, ytex2, otex2; static vec3d_t xtex, ytex, otex, xtex2, ytex2, otex2;
float fcosglobalang, fsinglobalang; float fcosglobalang, fsinglobalang;
float fxdim, fydim, fydimen, fviewingrange; float fxdim, fydim, fydimen, fviewingrange;
float fsearchx, fsearchy, fsearchz; static float fsearchx, fsearchy, fsearchz;
int psectnum, pwallnum, pbottomwall, pisbottomwall, psearchstat; static int psectnum, pwallnum, pbottomwall, pisbottomwall, psearchstat;
static int32_t drawpoly_srepeat = 0, drawpoly_trepeat = 0; static int32_t drawpoly_srepeat = 0, drawpoly_trepeat = 0;
#define MAX_DRAWPOLY_VERTS 8 #define MAX_DRAWPOLY_VERTS 8
@ -128,15 +128,15 @@ int32_t r_rortexture = 0;
int32_t r_rortexturerange = 0; int32_t r_rortexturerange = 0;
int32_t r_rorphase = 0; int32_t r_rorphase = 0;
int32_t r_yshearing = 0; static int32_t r_yshearing = 0;
// used for fogcalc // used for fogcalc
static float fogresult, fogresult2; static float fogresult, fogresult2;
char ptempbuf[MAXWALLSB<<1]; static char ptempbuf[MAXWALLSB<<1];
// polymost ART sky control // polymost ART sky control
int32_t r_parallaxskyclamping = 1; static int32_t r_parallaxskyclamping = 1;
#define MIN_CACHETIME_PRINT 10 #define MIN_CACHETIME_PRINT 10
@ -146,10 +146,10 @@ int32_t r_parallaxskyclamping = 1;
int32_t mdtims, omdtims; int32_t mdtims, omdtims;
uint8_t alphahackarray[MAXTILES]; uint8_t alphahackarray[MAXTILES];
int32_t drawingskybox = 0; static int32_t drawingskybox = 0;
int32_t hicprecaching = 0; static int32_t hicprecaching = 0;
hitdata_t polymost_hitdata; static hitdata_t polymost_hitdata;
void polymost_outputGLDebugMessage(uint8_t severity, const char* format, ...) void polymost_outputGLDebugMessage(uint8_t severity, const char* format, ...)
{ {
@ -172,13 +172,14 @@ void gltexapplyprops(void)
//-------------------------------------------------------------------------------------------------- //--------------------------------------------------------------------------------------------------
float glox1, gloy1, glox2, gloy2, gloyxscale, gloxyaspect, glohoriz2, glohorizcorrect, glotang; float glox1;
static float gloy1, glox2, gloy2, gloyxscale, gloxyaspect, glohoriz2, glohorizcorrect, glotang;
//Use this for both initialization and uninitialization of OpenGL. //Use this for both initialization and uninitialization of OpenGL.
static int32_t gltexcacnum = -1; static int32_t gltexcacnum = -1;
//in-place multiply m0=m0*m1 //in-place multiply m0=m0*m1
float* multiplyMatrix4f(float m0[4*4], const float m1[4*4]) static float* multiplyMatrix4f(float m0[4*4], const float m1[4*4])
{ {
float mR[4*4]; float mR[4*4];
@ -242,7 +243,7 @@ void polymost_glreset()
FileReader GetBaseResource(const char* fn); FileReader GetBaseResource(const char* fn);
// one-time initialization of OpenGL for polymost // one-time initialization of OpenGL for polymost
void polymost_glinit() static void polymost_glinit()
{ {
for (int basepalnum = 0; basepalnum < MAXBASEPALS; ++basepalnum) for (int basepalnum = 0; basepalnum < MAXBASEPALS; ++basepalnum)
{ {
@ -1831,7 +1832,7 @@ static inline int polymost_getclosestpointonwall(vec2_t const * const pos, int32
return 0; return 0;
} }
float fgetceilzofslope(usectorptr_t sec, float dax, float day) static float fgetceilzofslope(usectorptr_t sec, float dax, float day)
{ {
if (!(sec->ceilingstat&2)) if (!(sec->ceilingstat&2))
return float(sec->ceilingz); return float(sec->ceilingz);
@ -1849,7 +1850,7 @@ float fgetceilzofslope(usectorptr_t sec, float dax, float day)
return float(sec->ceilingz) + (sec->ceilingheinum*j)/i; return float(sec->ceilingz) + (sec->ceilingheinum*j)/i;
} }
float fgetflorzofslope(usectorptr_t sec, float dax, float day) static float fgetflorzofslope(usectorptr_t sec, float dax, float day)
{ {
if (!(sec->floorstat&2)) if (!(sec->floorstat&2))
return float(sec->floorz); return float(sec->floorz);
@ -1867,7 +1868,7 @@ float fgetflorzofslope(usectorptr_t sec, float dax, float day)
return float(sec->floorz) + (sec->floorheinum*j)/i; return float(sec->floorz) + (sec->floorheinum*j)/i;
} }
void fgetzsofslope(usectorptr_t sec, float dax, float day, float* ceilz, float *florz) static void fgetzsofslope(usectorptr_t sec, float dax, float day, float* ceilz, float *florz)
{ {
*ceilz = float(sec->ceilingz); *florz = float(sec->floorz); *ceilz = float(sec->ceilingz); *florz = float(sec->floorz);
@ -3741,7 +3742,7 @@ typedef struct
int8_t filler; int8_t filler;
} wallspriteinfo_t; } wallspriteinfo_t;
wallspriteinfo_t wsprinfo[MAXSPRITES]; static wallspriteinfo_t wsprinfo[MAXSPRITES];
void Polymost_prepare_loadboard(void) void Polymost_prepare_loadboard(void)
{ {
@ -3774,7 +3775,7 @@ static inline int32_t polymost_findwall(tspritetype const * const tspr, vec2_t c
return closest; return closest;
} }
int32_t polymost_lintersect(int32_t x1, int32_t y1, int32_t x2, int32_t y2, static int32_t polymost_lintersect(int32_t x1, int32_t y1, int32_t x2, int32_t y2,
int32_t x3, int32_t y3, int32_t x4, int32_t y4) int32_t x3, int32_t y3, int32_t x4, int32_t y4)
{ {
// p1 to p2 is a line segment // p1 to p2 is a line segment
@ -4626,7 +4627,7 @@ void polymost_initosdfuncs(void)
{ {
} }
void polymost_precache(int32_t dapicnum, int32_t dapalnum, int32_t datype) static void polymost_precache(int32_t dapicnum, int32_t dapalnum, int32_t datype)
{ {
// dapicnum and dapalnum are like you'd expect // dapicnum and dapalnum are like you'd expect
// datype is 0 for a wall/floor/ceiling and 1 for a sprite // datype is 0 for a wall/floor/ceiling and 1 for a sprite

View file

@ -35,7 +35,7 @@ static voxmodel_t *gvox;
//pitch must equal xsiz*4 //pitch must equal xsiz*4
FHardwareTexture *gloadtex(const int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8bit, int32_t dapal) static FHardwareTexture *gloadtex(const int32_t *picbuf, int32_t xsiz, int32_t ysiz, int32_t is8bit, int32_t dapal)
{ {
// Correct for GL's RGB order; also apply gamma here: // Correct for GL's RGB order; also apply gamma here:
const coltype *const pic = (const coltype *)picbuf; const coltype *const pic = (const coltype *)picbuf;