From d58bef0477b1ea8786185e008e08c49ef4fd1cfe Mon Sep 17 00:00:00 2001 From: Robert Chisholm Date: Wed, 27 Sep 2023 13:56:09 +0100 Subject: [PATCH] Place dstring.h inside namespace. --- include/flamegpu/runtime/detail/curve/DeviceCurve.cuh | 4 ++-- include/flamegpu/util/dstring.h | 6 ++++++ src/flamegpu/runtime/detail/curve/curve_rtc.cpp | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/include/flamegpu/runtime/detail/curve/DeviceCurve.cuh b/include/flamegpu/runtime/detail/curve/DeviceCurve.cuh index a26d69dcf..38e7258b8 100644 --- a/include/flamegpu/runtime/detail/curve/DeviceCurve.cuh +++ b/include/flamegpu/runtime/detail/curve/DeviceCurve.cuh @@ -418,10 +418,10 @@ __device__ __forceinline__ char* DeviceCurve::getEnvironmentMacroProperty(const } __device__ __forceinline__ bool DeviceCurve::isAgent(const char* agent_name) { - return dstrcmp(agent_name, sm()->agent_name) == 0; + return util::dstrcmp(agent_name, sm()->agent_name) == 0; } __device__ __forceinline__ bool DeviceCurve::isState(const char* agent_state) { - return dstrcmp(agent_state, sm()->state_name) == 0; + return util::dstrcmp(agent_state, sm()->state_name) == 0; } } // namespace curve diff --git a/include/flamegpu/util/dstring.h b/include/flamegpu/util/dstring.h index 9fd1472ab..35b8e01b1 100644 --- a/include/flamegpu/util/dstring.h +++ b/include/flamegpu/util/dstring.h @@ -3,6 +3,8 @@ #include +namespace flamegpu { +namespace util { /** * Device implementations of required string.h functionality */ @@ -24,4 +26,8 @@ __device__ __forceinline__ int dstrcmp(const char *s1, const char *s2) { return (*p1 > *p2) - (*p2 > *p1); } + +} // namespace util +} // namespace flamegpu + #endif // INCLUDE_FLAMEGPU_UTIL_DSTRING_H_ diff --git a/src/flamegpu/runtime/detail/curve/curve_rtc.cpp b/src/flamegpu/runtime/detail/curve/curve_rtc.cpp index 282de7908..f9cf4dc38 100644 --- a/src/flamegpu/runtime/detail/curve/curve_rtc.cpp +++ b/src/flamegpu/runtime/detail/curve/curve_rtc.cpp @@ -174,10 +174,10 @@ __device__ __forceinline__ void DeviceCurve::setNewAgentArrayVariable(const char } __device__ __forceinline__ bool DeviceCurve::isAgent(const char* agent_name) { - return dstrcmp(agent_name, "$DYNAMIC_AGENT_NAME") == 0; + return util::dstrcmp(agent_name, "$DYNAMIC_AGENT_NAME") == 0; } __device__ __forceinline__ bool DeviceCurve::isState(const char* agent_state) { - return dstrcmp(agent_state, "$DYNAMIC_AGENT_STATE") == 0; + return util::dstrcmp(agent_state, "$DYNAMIC_AGENT_STATE") == 0; } } // namespace curve