Skip to content

Commit

Permalink
Fix some more GCC-specific warnings and errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamyCecil committed Jul 13, 2024
1 parent fe26720 commit 9eb6ff8
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Sources/Engine/Graphics/GfxLibrary.h
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,10 @@ class ENGINE_API CGfxLibrary
// [Cecil] Check currently used API for debugging
inline void CheckAPI(void)
{
#ifndef NDEBUG
const GfxAPIType eAPI = GetCurrentAPI();
ASSERT(eAPI == GAT_OGL || eAPI == GAT_D3D || eAPI == GAT_NONE);
#endif
};

// canvas functions
Expand Down
4 changes: 2 additions & 2 deletions Sources/Engine/Sound/SoundObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ class ENGINE_API CSoundObject {
inline void Resume(void) { so_slFlags &= ~SOF_PAUSED; };
// check if sound is playing
inline BOOL IsPlaying(void) {
return (so_slFlags&SOF_PLAY);
return (so_slFlags & SOF_PLAY) != 0;
};
// check if sound is paused
inline BOOL IsPaused(void) {
return (so_slFlags&SOF_PAUSED);
return (so_slFlags & SOF_PAUSED) != 0;
};

// Check if hooked
Expand Down
2 changes: 1 addition & 1 deletion Sources/Engine/Templates/BSP_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class BSPNode : public DOUBLEplane3D { // split plane

public:
/* Defualt constructor (for arrays only). */
inline BSPNode(void) : bn_ulPlaneTag(-1), bn_pbnBack(NULL), bn_pbnFront(NULL), bn_bnlLocation(BNL_ILLEGAL) {};
inline BSPNode(void) : bn_bnlLocation(BNL_ILLEGAL), bn_pbnFront(NULL), bn_pbnBack(NULL), bn_ulPlaneTag(-1) {};
/* Constructor for a leaf node. */
inline BSPNode(enum BSPNodeLocation bnl);
/* Constructor for a branch node. */
Expand Down
6 changes: 3 additions & 3 deletions Sources/Engine/Templates/DynamicContainer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ Type *CDynamicContainer<Type>::Pointer(INDEX iObject) {
ASSERT(this != NULL);

// Check if the index is currently valid
ASSERT(iObject >= 0 && iObject < Count());
ASSERT(iObject >= 0 && iObject < this->Count());

#if CHECKARRAYLOCKING
// Check if locked
Expand All @@ -146,7 +146,7 @@ const Type *CDynamicContainer<Type>::Pointer(INDEX iObject) const {
ASSERT(this != NULL);

// Check if the index is currently valid
ASSERT(iObject >= 0 && iObject < Count());
ASSERT(iObject >= 0 && iObject < this->Count());

#if CHECKARRAYLOCKING
// Check if locked
Expand All @@ -160,7 +160,7 @@ const Type *CDynamicContainer<Type>::Pointer(INDEX iObject) const {
template<class Type>
Type &CDynamicContainer<Type>::GetFirst(void)
{
ASSERT(Count() >= 1);
ASSERT(this->Count() >= 1);
return *this->sa_Array[0];
};

Expand Down

0 comments on commit 9eb6ff8

Please sign in to comment.