From 113c0aa411da000054fd5199fde63fd65b9ab982 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Thu, 10 Sep 2015 17:37:39 +0200 Subject: [PATCH] pcsx2: use sizeof of object instead of pointer (portability) CID 146912 (#1 of 1): Sizeof not portable (SIZEOF_MISMATCH) suspicious_sizeof: Passing argument recConstBuf of type u32 * and argument 131072U /* RECCONSTBUF_SIZE * sizeof (recConstBuf) */ to function memset is suspicious. In this case, sizeof (u32 *) is equal to sizeof (u32), but this is not a portable assumption. --- pcsx2/x86/ix86-32/iR5900-32.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index f31ec16b3e..14a8f534f4 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -710,7 +710,7 @@ static void recResetRaw() maxrecmem = 0; - memset(recConstBuf, 0, RECCONSTBUF_SIZE * sizeof(recConstBuf)); + memset(recConstBuf, 0, RECCONSTBUF_SIZE * sizeof(*recConstBuf)); if( s_pInstCache ) memset( s_pInstCache, 0, sizeof(EEINST)*s_nInstCacheSize );