Don't use memset with non-zero value to fill ints

Coverity reported using value -2 as a bad memset. Really doesn't make sense when filling ints and not bytes too.
This commit is contained in:
Zack Middleton 2014-05-25 16:10:01 -05:00
parent 9d74227559
commit e21ff01946
1 changed files with 5 additions and 1 deletions

View File

@ -1132,6 +1132,7 @@ static qboolean R_LoadMDR( model_t *mod, void *buffer, int filesize, const char
** RE_BeginRegistration
*/
void RE_BeginRegistration( glconfig_t *glconfigOut ) {
int i;
R_Init();
@ -1140,7 +1141,10 @@ void RE_BeginRegistration( glconfig_t *glconfigOut ) {
R_IssuePendingRenderCommands();
tr.visIndex = 0;
memset(tr.visClusters, -2, sizeof(tr.visClusters)); // force markleafs to regenerate
// force markleafs to regenerate
for(i = 0; i < MAX_VISCOUNTS; i++) {
tr.visClusters[i] = -2;
}
R_ClearFlares();
RE_ClearScene();