Skip to content

Commit 008fa25

Browse files
committed
minor fixes
1 parent 867a0dc commit 008fa25

File tree

7 files changed

+12
-10
lines changed

7 files changed

+12
-10
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if (MSVC OR APPLE)
3535
add_link_options(-fsanitize=address -fsanitize-address-use-after-scope -fsanitize=undefined)
3636
endif()
3737
else()
38-
if(MSVC AND PROJECT_IS_TOP_LEVEL)
38+
if(MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND PROJECT_IS_TOP_LEVEL)
3939
# enable hot reloading
4040
add_compile_options("$<$<CONFIG:Debug>:/ZI>")
4141
add_link_options("$<$<CONFIG:Debug>:/INCREMENTAL>")

benchmark/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <string.h>
1919

2020
#if defined( _WIN64 )
21-
#include <windows.h>
21+
#include <Windows.h>
2222
#elif defined( __APPLE__ )
2323
#include <unistd.h>
2424
#elif defined( __linux__ )

include/box2d/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ typedef struct b2PrismaticJointDef
745745
} b2PrismaticJointDef;
746746

747747
/// Use this to initialize your joint definition
748-
/// @ingroupd prismatic_joint
748+
/// @ingroup prismatic_joint
749749
B2_API b2PrismaticJointDef b2DefaultPrismaticJointDef( void );
750750

751751
/// Revolute joint definition

src/core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
#include "core.h"
55

6+
#include "constants.h"
7+
68
#if defined( B2_COMPILER_MSVC )
79
#define _CRTDBG_MAP_ALLOC
810
#include <crtdbg.h>
@@ -51,7 +53,7 @@ static int b2DefaultAssertFcn( const char* condition, const char* fileName, int
5153
return 1;
5254
}
5355

54-
b2AssertFcn* b2AssertHandler = b2DefaultAssertFcn;
56+
static b2AssertFcn* b2AssertHandler = b2DefaultAssertFcn;
5557

5658
void b2SetAssertFcn( b2AssertFcn* assertFcn )
5759
{
@@ -78,7 +80,7 @@ b2Version b2GetVersion( void )
7880
static b2AllocFcn* b2_allocFcn = NULL;
7981
static b2FreeFcn* b2_freeFcn = NULL;
8082

81-
b2AtomicInt b2_byteCount;
83+
static b2AtomicInt b2_byteCount;
8284

8385
void b2SetAllocator( b2AllocFcn* allocFcn, b2FreeFcn* freeFcn )
8486
{

src/motor_joint.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ void b2SolveMotorJoint( b2JointSim* base, b2StepContext* context )
310310
}
311311

312312
// angular velocity
313-
if ( joint->maxVelocityTorque > 0.0 )
313+
if ( joint->maxVelocityTorque > 0.0f )
314314
{
315315
float cdot = wB - wA - joint->angularVelocity;
316316
float impulse = -joint->angularMass * cdot;

src/physics_world.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
_Static_assert( B2_MAX_WORLDS > 0, "must be 1 or more" );
3434
_Static_assert( B2_MAX_WORLDS < UINT16_MAX, "B2_MAX_WORLDS limit exceeded" );
35-
b2World b2_worlds[B2_MAX_WORLDS];
35+
static b2World b2_worlds[B2_MAX_WORLDS];
3636

3737
B2_ARRAY_SOURCE( b2BodyMoveEvent, b2BodyMoveEvent )
3838
B2_ARRAY_SOURCE( b2ContactBeginTouchEvent, b2ContactBeginTouchEvent )
@@ -1747,10 +1747,10 @@ void b2World_DumpMemoryStats( b2WorldId worldId )
17471747
fprintf( file, "kinematic tree: %d\n", b2DynamicTree_GetByteCount( world->broadPhase.trees + b2_kinematicBody ) );
17481748
fprintf( file, "dynamic tree: %d\n", b2DynamicTree_GetByteCount( world->broadPhase.trees + b2_dynamicBody ) );
17491749
b2HashSet* moveSet = &world->broadPhase.moveSet;
1750-
fprintf( file, "moveSet: %d (%d, %d)\n", b2GetHashSetBytes( moveSet ), moveSet->count, moveSet->capacity );
1750+
fprintf( file, "moveSet: %d (%u, %u)\n", b2GetHashSetBytes( moveSet ), moveSet->count, moveSet->capacity );
17511751
fprintf( file, "moveArray: %d\n", b2IntArray_ByteCount( &world->broadPhase.moveArray ) );
17521752
b2HashSet* pairSet = &world->broadPhase.pairSet;
1753-
fprintf( file, "pairSet: %d (%d, %d)\n", b2GetHashSetBytes( pairSet ), pairSet->count, pairSet->capacity );
1753+
fprintf( file, "pairSet: %d (%u, %u)\n", b2GetHashSetBytes( pairSet ), pairSet->count, pairSet->capacity );
17541754
fprintf( file, "\n" );
17551755

17561756
// solver sets

src/timer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#define WIN32_LEAN_AND_MEAN 1
1414
#endif
1515

16-
#include <windows.h>
16+
#include <Windows.h>
1717

1818
static double s_invFrequency = 0.0;
1919

0 commit comments

Comments
 (0)