Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLEANUP: remove unused vars #850

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/EX_browser_sources.c
Original file line number Diff line number Diff line change
Expand Up @@ -987,7 +987,6 @@ int rebuild_servers_list = 0;
void Rebuild_Servers_List(void)
{
int i;
int suppressed_servers = 0;
int server_limit = sizeof(servers) / sizeof(servers[0]);
serversn = 0;

Expand Down Expand Up @@ -1020,9 +1019,6 @@ void Rebuild_Servers_List(void)
if (serversn < server_limit) {
servers[serversn++] = sources[i]->servers[j];
}
else {
++suppressed_servers;
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,6 @@ static qbool Con_NotifyMessageLine(float posX, float posY, float width, float he
strlcpy(dest, IRC_GetCurrentChan(), sizeof(dest));
strlcat(dest, ":", sizeof(dest));

indent += Draw_SString(posX, v + bound(0, con_shift.value, 8), dest, scale, proportional);
}
#endif
else if (chat_team == chat_qtvtogame) {
Expand Down Expand Up @@ -846,7 +845,6 @@ void SCR_DrawNotify(int posX, int posY, float scale, int notifyTime, int notifyL
int v, i, idx;
float time;
float timeout = bound (0, notifyTime, MAX_NOTIFICATION_TIME);
float indent = 0;

notifyCols = bound(10, notifyCols, con_linewidth);

Expand Down
4 changes: 0 additions & 4 deletions src/glc_aliasmodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ void GLC_AllocateAliasPoseBuffer(void)
if (!gl_program_aliasmodels.integer) {
int max_verts = 0;
int i;
int total_verts = 0;

for (i = 1; i < MAX_MODELS; ++i) {
model_t* mod = cl.model_precache[i];
Expand All @@ -127,7 +126,6 @@ void GLC_AllocateAliasPoseBuffer(void)

if (hdr) {
max_verts = max(max_verts, hdr->vertsPerPose);
total_verts += hdr->vertsPerPose * hdr->numposes;
}
}
}
Expand All @@ -140,7 +138,6 @@ void GLC_AllocateAliasPoseBuffer(void)

if (hdr) {
max_verts = max(max_verts, hdr->vertsPerPose);
total_verts += hdr->vertsPerPose * hdr->numposes;
}
}
}
Expand All @@ -153,7 +150,6 @@ void GLC_AllocateAliasPoseBuffer(void)

if (hdr) {
max_verts = max(max_verts, hdr->vertsPerPose);
total_verts += hdr->vertsPerPose * hdr->numposes;
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/glm_texture_arrays.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ static void GL_FlagTexturesForModel(model_t* mod)
case mod_sprite:
{
msprite2_t* psprite = (msprite2_t*)Mod_Extradata(mod);
int count = 0;

for (j = 0; j < psprite->numframes; ++j) {
int offset = psprite->frames[j].offset;
Expand All @@ -235,7 +234,6 @@ static void GL_FlagTexturesForModel(model_t* mod)
if (R_TextureReferenceIsValid(frame->gl_texturenum)) {
texture_flags[frame->gl_texturenum.index].flags |= (1 << TEXTURETYPES_SPRITES);
}
++count;
}
break;
}
Expand Down
2 changes: 0 additions & 2 deletions src/hud_gamesummary.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,8 @@ static void SCR_Hud_GameSummary(hud_t* hud)

{
char buffer[10];
int text_size;

snprintf(buffer, sizeof(buffer), "%d", value);
text_size = Draw_StringLength(buffer, -1, hud_gamesummary_scale->value, hud_gamesummary_proportional->integer);

if (hud_gamesummary_circles->integer && background_color) {
float half_width = icon_size * 0.5f * hud_gamesummary_scale->value;
Expand Down
7 changes: 2 additions & 5 deletions src/pr2_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -2437,7 +2437,7 @@ void PF2_Add_Bot( byte * base, uintptr_t mask, pr2val_t * stack, pr2val_t * retv
int topcolor = stack[2]._int;
char *skin = (char *) VM_POINTER( base, mask, stack[3].string );
int edictnum;
int clients, spectators, i;
int clients, i;
extern char *shortinfotbl[];
char *s;
edict_t *ent;
Expand All @@ -2447,14 +2447,11 @@ void PF2_Add_Bot( byte * base, uintptr_t mask, pr2val_t * stack, pr2val_t * retv

// count up the clients and spectators
clients = 0;
spectators = 0;
for ( i = 0, cl = svs.clients; i < MAX_CLIENTS; i++, cl++ )
{
if ( cl->state == cs_free )
continue;
if ( cl->spectator )
spectators++;
else
if ( !cl->spectator )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer an explicit !=0, but okay.. ;)

clients++;
}

Expand Down
4 changes: 0 additions & 4 deletions src/r_brushmodel.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,6 @@ static int R_BrushModelPopulateVBO(model_t* m, void* vbo_buffer, int vbo_pos)

// Order vertices in the VBO by texture & lightmap
for (i = 0; i < m->numtextures; ++i) {
int length = 0;
int surface_count = 0;
qbool has_fb = false, has_luma = false;

if (!m->textures[i]) {
Expand Down Expand Up @@ -215,8 +213,6 @@ static int R_BrushModelPopulateVBO(model_t* m, void* vbo_buffer, int vbo_pos)
vbo_pos = renderer.BrushModelCopyVertToBuffer(m, vbo_buffer, vbo_pos, poly->verts[k], lightmap, material, scaleS, scaleT, surf, has_fb, has_luma);
}

length += poly->numverts;
++surface_count;
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/r_lightmaps.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ static void R_BuildDlightList (msurface_t *surf)
{
float dist;
vec3_t impact;
mtexinfo_t *tex;
int lnum, i, smax, tmax, irad, iminlight, local[2], tdmin, sdmin, distmin;
unsigned int dlightbits;
dlightinfo_t *light;
Expand All @@ -82,7 +81,6 @@ static void R_BuildDlightList (msurface_t *surf)

smax = (surf->extents[0] >> surf->lmshift) + 1;
tmax = (surf->extents[1] >> surf->lmshift) + 1;
tex = surf->texinfo;
dlightbits = surf->dlightbits;

for (lnum = 0; lnum < MAX_DLIGHTS && dlightbits; lnum++) {
Expand Down
7 changes: 1 addition & 6 deletions src/r_texture_load.c
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ static void R_Upload32(gltexture_t* glt, unsigned *data, int width, int height,
{
// Tell OpenGL the texnum of the texture before uploading it.
extern cvar_t gl_lerpimages, gl_wicked_luma_level;
int tempwidth, tempheight, levels;
int tempwidth, tempheight;
byte *newdata;

R_TextureSizeRoundUp(width, height, &tempwidth, &tempheight);
Expand Down Expand Up @@ -528,15 +528,10 @@ static void R_Upload32(gltexture_t* glt, unsigned *data, int width, int height,

if (mode & TEX_MIPMAP) {
int largest = max(width, height);
levels = 0;
while (largest) {
++levels;
largest /= 2;
}
}
else {
levels = 1;
}

if (mode & TEX_BRIGHTEN) {
R_TextureUtil_Brighten32(newdata, width * height * 4);
Expand Down
7 changes: 3 additions & 4 deletions src/sbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -1256,7 +1256,7 @@ static qbool Sbar_ShowTeamKills(void)

static void Sbar_DeathmatchOverlay(int start)
{
int stats_basic, stats_team, stats_touches, stats_caps, playerstats[7];
int stats_team, stats_touches, stats_caps, playerstats[7];
int scoreboardsize, colors_thickness, statswidth, stats_xoffset = 0;
int i, k, x, y, xofs, total, p, skip = 10, fragsint;
int rank_width, leftover, startx, tempx, mynum;
Expand Down Expand Up @@ -1302,11 +1302,10 @@ static void Sbar_DeathmatchOverlay(int start)
rank_width = (cl.teamplay ? RANK_WIDTH_TEAM : RANK_WIDTH_DM);

statswidth = 0;
stats_basic = stats_team = stats_touches = stats_caps = 0;
stats_team = stats_touches = stats_caps = 0;
if (scr_scoreboard_showfrags.value && Stats_IsActive()) {
if (rank_width + statswidth + RANK_WIDTH_BASICSTATS < vid.width - 16) {
statswidth += RANK_WIDTH_BASICSTATS;
stats_basic++;
if (cl.teamplay) {
if (rank_width + statswidth + RANK_WIDTH_TEAMSTATS < vid.width - 16) {
if (Sbar_ShowTeamKills()) {
Expand Down Expand Up @@ -2436,4 +2435,4 @@ static const char* JSON_readstring(json_t* json)
return json_string_value(json);
}
return "";
}
}
4 changes: 0 additions & 4 deletions src/sv_demo_qtv.c
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,6 @@ void QTVcmd_Say_f(mvddest_t *d)
int j;
char *p;
char text[1024], text2[1024], *cmd;
int sent_to = 0;

if (Cmd_Argc () < 2)
return;
Expand Down Expand Up @@ -744,9 +743,6 @@ void QTVcmd_Say_f(mvddest_t *d)
continue; // game started, don't send QTV chat to players, specs still get QTV chat

SV_ClientPrintf2(client, PRINT_CHAT, "%s", text);
if (!client->spectator) {
sent_to |= (1 << j);
}
}

if (sv.mvdrecording) {
Expand Down
5 changes: 1 addition & 4 deletions src/zone.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,11 @@ Otherwise, allocations with the same name will be totaled up before printing.
void Hunk_Print(qbool all)
{
hunk_t *h, *next, *endlow, *starthigh, *endhigh;
int count, sum;
int sum;
int totalblocks;
char name[9];

name[8] = 0;
count = 0;
sum = 0;
totalblocks = 0;

Expand Down Expand Up @@ -125,7 +124,6 @@ void Hunk_Print(qbool all)
}

next = (hunk_t *)((byte *)h + h->size);
count++;
totalblocks++;
sum += h->size;

Expand All @@ -140,7 +138,6 @@ void Hunk_Print(qbool all)
if (!all) {
Con_Printf(" :%8ikb %8s (TOTAL)\n", sum / 1024, name);
}
count = 0;
sum = 0;
}

Expand Down