Skip to content

Commit 2260f53

Browse files
authored
fix: Fix unused variables in WW3D (TheSuperHackers#2629)
1 parent 08933c3 commit 2260f53

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

  • Dependencies/Utility/Utility
  • GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2
  • Generals/Code/Libraries/Source/WWVegas/WW3D2

Dependencies/Utility/Utility/CppMacros.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@
4040
#if __cplusplus >= 201703L
4141
#define REGISTER
4242
#define FALLTHROUGH [[fallthrough]]
43+
#define MAYBE_UNUSED [[maybe_unused]]
4344
#else
4445
#define REGISTER register
4546
#define FALLTHROUGH
47+
#define MAYBE_UNUSED
4648
#endif
4749

4850
// noexcept for methods of IUNKNOWN interface

Generals/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,8 +278,9 @@ WW3DErrorType WW3D::Init(void *hwnd, char *defaultpal, bool lite)
278278
WWDEBUG_SAY(("Allocate Debug Resources"));
279279
Allocate_Debug_Resources();
280280

281-
MMRESULT r=timeBeginPeriod(1);
281+
MAYBE_UNUSED MMRESULT r=timeBeginPeriod(1);
282282
WWASSERT(r==TIMERR_NOERROR);
283+
(void)r;
283284

284285
/*
285286
** Initialize the dazzle system
@@ -336,8 +337,9 @@ WW3DErrorType WW3D::Shutdown()
336337
#endif //WW3D_DX8
337338

338339
//restore the previous timer resolution
339-
MMRESULT r=timeEndPeriod(1);
340+
MAYBE_UNUSED MMRESULT r=timeEndPeriod(1);
340341
WWASSERT(r==TIMERR_NOERROR);
342+
(void)r;
341343
/*
342344
** Free memory in predictive LOD optimizer
343345
*/

GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/ww3d.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,9 @@ WW3DErrorType WW3D::Init(void *hwnd, char *defaultpal, bool lite)
279279
WWDEBUG_SAY(("Allocate Debug Resources"));
280280
Allocate_Debug_Resources();
281281

282-
MMRESULT r=timeBeginPeriod(1);
282+
MAYBE_UNUSED MMRESULT r=timeBeginPeriod(1);
283283
WWASSERT(r==TIMERR_NOERROR);
284+
(void)r;
284285

285286
/*
286287
** Initialize the dazzle system
@@ -337,8 +338,9 @@ WW3DErrorType WW3D::Shutdown()
337338
#endif //WW3D_DX8
338339

339340
//restore the previous timer resolution
340-
MMRESULT r=timeEndPeriod(1);
341+
MAYBE_UNUSED MMRESULT r=timeEndPeriod(1);
341342
WWASSERT(r==TIMERR_NOERROR);
343+
(void)r;
342344
/*
343345
** Free memory in predictive LOD optimizer
344346
*/

0 commit comments

Comments
 (0)