cppcheck: make parameters const

This commit is contained in:
Denis Pauk 2022-08-28 15:00:49 +03:00
parent 41f12687a4
commit 674e634679
10 changed files with 25 additions and 16 deletions

View file

@ -215,7 +215,7 @@ void R_RotateForEntity (entity_t *e, float *mvMatrix);
void R_MarkLeaves (void);
void EmitWaterPolys (msurface_t *fa, image_t *texture,
float *modelMatrix, float *color,
float *modelMatrix, const float *color,
qboolean solid_surface);
void R_AddSkySurface (msurface_t *fa);
void R_ClearSkyBox (void);
@ -259,7 +259,7 @@ qboolean Vk_ImageHasFreeSpace(void);
void RE_BeginRegistration (char *model);
struct model_s *RE_RegisterModel (char *name);
struct image_s *RE_RegisterSkin (char *name);
void RE_SetSky (char *name, float rotate, vec3_t axis);
void RE_SetSky_s (const char *name, float rotate, const vec3_t axis);
void RE_EndRegistration (void);
void Mat_Identity(float *matrix);

View file

@ -238,7 +238,7 @@ typedef struct model_s
//============================================================================
void Mod_Init (void);
mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model);
mleaf_t *Mod_PointInLeaf (const vec3_t p, model_t *model);
const byte *Mod_ClusterPVS (int cluster, const model_t *model);
void Mod_Modellist_f (void);

View file

@ -294,7 +294,7 @@ static VkSampleCountFlagBits GetSampleCount(int msaa, VkSampleCountFlagBits supp
{
int step = 0, value = 64;
static VkSampleCountFlagBits msaaModes[] = {
const VkSampleCountFlagBits msaaModes[] = {
VK_SAMPLE_COUNT_64_BIT,
VK_SAMPLE_COUNT_32_BIT,
VK_SAMPLE_COUNT_16_BIT,

View file

@ -1016,7 +1016,7 @@ Returns number of mip levels
===============
*/
static uint32_t Vk_Upload8 (byte *data, int width, int height, imagetype_t type,
static uint32_t Vk_Upload8 (const byte *data, int width, int height, imagetype_t type,
byte **texBuffer, int *upload_width, int *upload_height)
{
unsigned *trans;

View file

@ -456,7 +456,7 @@ void R_BuildLightMap (msurface_t *surf, byte *dest, int stride)
int i, j, size;
byte *lightmap;
float scale[4];
int nummaps;
int mapscount;
float *bl;
if ( surf->texinfo->flags & (SURF_SKY|SURF_TRANS33|SURF_TRANS66|SURF_WARP) )
@ -477,14 +477,14 @@ void R_BuildLightMap (msurface_t *surf, byte *dest, int stride)
}
// count the # of maps
for ( nummaps = 0 ; nummaps < MAXLIGHTMAPS && surf->styles[nummaps] != 255 ;
nummaps++)
for ( mapscount = 0 ; mapscount < MAXLIGHTMAPS && surf->styles[mapscount] != 255 ;
mapscount++)
;
lightmap = surf->samples;
// add all the lightmaps
if ( nummaps == 1 )
if ( mapscount == 1 )
{
int maps;

View file

@ -238,7 +238,9 @@ void Mesh_Free (void)
}
static void Vk_LerpVerts( int nverts, dtrivertx_t *v, dtrivertx_t *ov, dtrivertx_t *verts, float *lerp, float move[3], float frontv[3], float backv[3], entity_t *currententity )
static void Vk_LerpVerts( int nverts, dtrivertx_t *v, dtrivertx_t *ov, dtrivertx_t *verts,
float *lerp, const float move[3], const float frontv[3], const float backv[3],
entity_t *currententity )
{
int i;
@ -760,11 +762,12 @@ void R_DrawAliasModel (entity_t *currententity, model_t *currentmodel)
int leftHandOffset = 0;
dmdl_t *paliashdr;
float an;
vec3_t bbox[8];
float prev_viewproj[16];
if ( !( currententity->flags & RF_WEAPONMODEL ) )
{
vec3_t bbox[8];
if ( R_CullAliasModel( bbox, currententity, currentmodel ) )
return;
}

View file

@ -38,7 +38,7 @@ int registration_sequence;
Mod_PointInLeaf
===============
*/
mleaf_t *Mod_PointInLeaf (vec3_t p, model_t *model)
mleaf_t *Mod_PointInLeaf (const vec3_t p, model_t *model)
{
mnode_t *node;

View file

@ -1680,6 +1680,12 @@ static int RE_PrepareForWindow(void)
return SDL_WINDOW_VULKAN;
}
static void
RE_SetSky (char *name, float rotate, vec3_t axis)
{
RE_SetSky_s (name, rotate, axis);
}
/*
===============
GetRefAPI

View file

@ -111,7 +111,7 @@ static VkPresentModeKHR getSwapPresentMode(const VkPresentModeKHR *presentModes,
// internal helper
static VkCompositeAlphaFlagBitsKHR getSupportedCompositeAlpha(VkCompositeAlphaFlagsKHR supportedFlags)
{
VkCompositeAlphaFlagBitsKHR compositeAlphaFlags[] = {
const VkCompositeAlphaFlagBitsKHR compositeAlphaFlags[] = {
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR,
VK_COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR,
VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR,

View file

@ -201,7 +201,7 @@ Does a water warp on the pre-fragmented vkpoly_t chain
*/
void
EmitWaterPolys (msurface_t *fa, image_t *texture, float *modelMatrix,
float *color, qboolean solid_surface)
const float *color, qboolean solid_surface)
{
vkpoly_t *p, *bp;
float *v;
@ -686,12 +686,12 @@ void R_DrawSkyBox (void)
/*
============
RE_SetSky
RE_SetSky_s
============
*/
// 3dstudio environment map names
static char *suf[6] = {"rt", "bk", "lf", "ft", "up", "dn"};
void RE_SetSky (char *name, float rotate, vec3_t axis)
void RE_SetSky_s (const char *name, float rotate, const vec3_t axis)
{
int i;
char pathname[MAX_QPATH];