diff --git a/coresdk/src/backend/utility_functions.cpp b/coresdk/src/backend/utility_functions.cpp index def71f7f..6cc4a6de 100644 --- a/coresdk/src/backend/utility_functions.cpp +++ b/coresdk/src/backend/utility_functions.cpp @@ -129,7 +129,8 @@ namespace splashkit_lib if(elem.find(PATH_SEP) == 0 and not first) elem.erase(0,1); result += elem; - if(elem.find_last_of(PATH_SEP) < elem.length() - 1) + size_t last_sep = elem.find_last_of(PATH_SEP); + if (last_sep == string::npos || last_sep < elem.length() - 1) result += PATH_SEP; first = false; diff --git a/coresdk/src/backend/utility_functions.h b/coresdk/src/backend/utility_functions.h index e0760f52..6ae0f118 100644 --- a/coresdk/src/backend/utility_functions.h +++ b/coresdk/src/backend/utility_functions.h @@ -94,8 +94,7 @@ namespace splashkit_lib } #define FREE_ALL_FROM_MAP(collection, ptr_kind, fn )\ -size_t sz = collection.size();\ -for(size_t i = 0; i < sz; i++)\ +while(!collection.empty())\ {\ auto resource = collection.begin()->second;\ if (VALID_PTR(resource, ptr_kind))\ @@ -104,7 +103,7 @@ fn(resource);\ }\ else\ {\ -LOG(WARNING) << "Splashkit contains invalid ##ptr_kind !";\ +LOG(WARNING) << "Splashkit contains invalid " #ptr_kind "!";\ collection.erase(collection.begin());\ }\ } diff --git a/coresdk/src/coresdk/logging.h b/coresdk/src/coresdk/logging.h index 7997cdc9..60ebd785 100644 --- a/coresdk/src/coresdk/logging.h +++ b/coresdk/src/coresdk/logging.h @@ -66,7 +66,7 @@ namespace splashkit_lib * @param override_prev_log Determines whether or not a new logging session should override the existing file, if any. Set this to false if you want new log messages to be appended to the bottom of the file; otherwise set it to true if you would like a new file to be created on top of the old one. * @param mode The mode of log output i.e. whether there should be output to the console, a text file, or both. Pass your choice of mode variable in by reference. * - * @attribute suffix _name_override_mode + * @attribute suffix name_override_mode */ void init_custom_logger (string app_name, bool override_prev_log, log_mode mode); diff --git a/coresdk/src/coresdk/timers.h b/coresdk/src/coresdk/timers.h index f4d19452..c4233b16 100644 --- a/coresdk/src/coresdk/timers.h +++ b/coresdk/src/coresdk/timers.h @@ -65,7 +65,7 @@ namespace splashkit_lib * @param name The name of the timer * @return True if SplashKit has created a timer with that name. * - * @attribute suffix _named + * @attribute suffix named */ bool has_timer(string name); @@ -88,7 +88,7 @@ namespace splashkit_lib * * @param name The name of the timer * - * @attribute suffix _named + * @attribute suffix named */ void start_timer(string name); @@ -109,7 +109,7 @@ namespace splashkit_lib * * @param name The name of the timer * - * @attribute suffix _named + * @attribute suffix named */ void stop_timer(string name); @@ -130,7 +130,7 @@ namespace splashkit_lib * * @param name The name of the timer * - * @attribute suffix _named + * @attribute suffix named */ void pause_timer(string name); @@ -149,7 +149,7 @@ namespace splashkit_lib * * @param name The name of the timer * - * @attribute suffix _named + * @attribute suffix named */ void resume_timer(string name); @@ -168,7 +168,7 @@ namespace splashkit_lib * * @param name The name of the timer * - * @attribute suffix _named + * @attribute suffix named */ void reset_timer(string name); @@ -197,7 +197,7 @@ namespace splashkit_lib * timer was created (excluding the time the timer was * paused) * - * @attribute suffix _named + * @attribute suffix named */ unsigned int timer_ticks(string name); @@ -218,7 +218,7 @@ namespace splashkit_lib * @param name The name of the timer * @return True if the timer is paused * - * @attribute suffix _named + * @attribute suffix named */ bool timer_paused(string name); @@ -239,7 +239,7 @@ namespace splashkit_lib * @param name The name of the timer * @return True if the timer has been started * - * @attribute suffix _named + * @attribute suffix named */ bool timer_started(string name); } diff --git a/coresdk/src/coresdk/triangle_geometry.h b/coresdk/src/coresdk/triangle_geometry.h index 51abd9e1..5044ecfd 100644 --- a/coresdk/src/coresdk/triangle_geometry.h +++ b/coresdk/src/coresdk/triangle_geometry.h @@ -23,7 +23,7 @@ namespace splashkit_lib * @param y3 The y coordinate for the third point * @return A triangle at the indicated points * - * @attribute suffix _from_coordinates + * @attribute suffix coordinates */ triangle triangle_from(double x1, double y1, double x2, double y2, double x3, double y3);