From fe559f3ed362087775ea6f6b4dcfec3d8a2bb45c Mon Sep 17 00:00:00 2001 From: Pokechu22 Date: Mon, 3 Jan 2022 21:43:11 -0800 Subject: VideoCommon/Statistics: Require semicolons after statistics macros This is clearer and reduces IntelliSense problems. --- Source/Core/VideoCommon/Statistics.h | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'Source/Core/VideoCommon') diff --git a/Source/Core/VideoCommon/Statistics.h b/Source/Core/VideoCommon/Statistics.h index 5d0a1669f8..dc10a8c780 100644 --- a/Source/Core/VideoCommon/Statistics.h +++ b/Source/Core/VideoCommon/Statistics.h @@ -90,11 +90,32 @@ extern Statistics g_stats; #define STATISTICS #ifdef STATISTICS -#define INCSTAT(a) (a)++; -#define ADDSTAT(a, b) (a) += (b); -#define SETSTAT(a, x) (a) = (int)(x); +#define INCSTAT(a) \ + do \ + { \ + (a)++; \ + } while (false) +#define ADDSTAT(a, b) \ + do \ + { \ + (a) += (b); \ + } while (false) +#define SETSTAT(a, x) \ + do \ + { \ + (a) = static_cast(x); \ + } while (false) #else -#define INCSTAT(a) ; -#define ADDSTAT(a, b) ; -#define SETSTAT(a, x) ; +#define INCSTAT(a) \ + do \ + { \ + } while (false) +#define ADDSTAT(a, b) \ + do \ + { \ + } while (false) +#define SETSTAT(a, x) \ + do \ + { \ + } while (false) #endif -- cgit v1.2.3