From 5fc4886780ecd4c5d450a0a0f0bdcff86275fa12 Mon Sep 17 00:00:00 2001 From: Graham Pentheny Date: Fri, 22 Aug 2025 01:39:14 -0400 Subject: [PATCH] Switch static array definition to extern to prevent unused variable warnings --- RecastDemo/Include/Sample.h | 12 +----------- RecastDemo/Source/Sample.cpp | 12 ++++++++++++ 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/RecastDemo/Include/Sample.h b/RecastDemo/Include/Sample.h index 6501c623..74852623 100644 --- a/RecastDemo/Include/Sample.h +++ b/RecastDemo/Include/Sample.h @@ -45,17 +45,7 @@ enum class SampleToolType : uint8_t MAX_TOOLS }; -static const char* toolNames[] = { - "None", - "Create Tiles", - "Highlight Tile Cache", - "Create Temp Obstacles", - "Test Navmesh", - "Prune Navmesh", - "Create Off-Mesh Connections", - "Create Convex Volumes", - "Create Crowds", -}; +extern const char* toolNames[]; /// These are just sample areas to use consistent values across the samples. /// The use should specify these base on his needs. diff --git a/RecastDemo/Source/Sample.cpp b/RecastDemo/Source/Sample.cpp index d7cdc865..5bfec695 100644 --- a/RecastDemo/Source/Sample.cpp +++ b/RecastDemo/Source/Sample.cpp @@ -35,6 +35,18 @@ # define snprintf _snprintf #endif +const char* toolNames[] = { + "None", + "Create Tiles", + "Highlight Tile Cache", + "Create Temp Obstacles", + "Test Navmesh", + "Prune Navmesh", + "Create Off-Mesh Connections", + "Create Convex Volumes", + "Create Crowds", +}; + namespace {