[iortcw] 118/497: Rend2: Don't use memset with non-zero value to fill ints

Simon McVittie smcv at debian.org
Fri Sep 8 10:36:35 UTC 2017


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to annotated tag 1.42d
in repository iortcw.

commit 68b8dce901a3b4607c0f499dc296ecf16f471306
Author: M4N4T4RMS at gmail.com <M4N4T4RMS at gmail.com@e65d2741-a53d-b2dc-ae96-bb75fa5e4c4a>
Date:   Mon May 26 09:21:07 2014 +0000

    Rend2: Don't use memset with non-zero value to fill ints
---
 MP/code/rend2/tr_model.c | 7 ++++++-
 SP/code/rend2/tr_model.c | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/MP/code/rend2/tr_model.c b/MP/code/rend2/tr_model.c
index 17ee143..6a9b988 100644
--- a/MP/code/rend2/tr_model.c
+++ b/MP/code/rend2/tr_model.c
@@ -2041,6 +2041,8 @@ static qboolean R_LoadMDS( model_t *mod, void *buffer, const char *mod_name ) {
 ** RE_BeginRegistration
 */
 void RE_BeginRegistration( glconfig_t *glconfigOut ) {
+	int	i;
+
 	ri.Hunk_Clear();    // (SA) MEM NOTE: not in missionpack
 
 	R_Init();
@@ -2049,7 +2051,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();
diff --git a/SP/code/rend2/tr_model.c b/SP/code/rend2/tr_model.c
index b5e0cce..27ccf84 100644
--- a/SP/code/rend2/tr_model.c
+++ b/SP/code/rend2/tr_model.c
@@ -2037,6 +2037,8 @@ static qboolean R_LoadMDS( model_t *mod, void *buffer, const char *mod_name ) {
 ** RE_BeginRegistration
 */
 void RE_BeginRegistration( glconfig_t *glconfigOut ) {
+	int	i;
+
 	ri.Hunk_Clear();    // (SA) MEM NOTE: not in missionpack
 
 	R_Init();
@@ -2045,7 +2047,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();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git



More information about the Pkg-games-commits mailing list