From 40902a6c09ecc393cb9ee05cb58c2c9558458c83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Mon, 13 Nov 2017 20:57:09 -0800 Subject: [PATCH] Cleanup. --- 3rdparty/.editorconfig | 1 + 3rdparty/ini/ini.h | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/3rdparty/.editorconfig b/3rdparty/.editorconfig index 0555dfa..b419896 100644 --- a/3rdparty/.editorconfig +++ b/3rdparty/.editorconfig @@ -3,3 +3,4 @@ root = true [ini/*] indent_style = space indent_size = 4 +trim_trailing_whitespace = true diff --git a/3rdparty/ini/ini.h b/3rdparty/ini/ini.h index 6851ecb..394c196 100644 --- a/3rdparty/ini/ini.h +++ b/3rdparty/ini/ini.h @@ -166,7 +166,7 @@ to substitute them for your own. Here's an example: #define INI_IMPLEMENTATION #define INI_MEMCPY( dst, src, cnt ) ( my_memcpy_func( dst, src, cnt ) ) #define INI_STRLEN( s ) ( my_strlen_func( s ) ) - #define INI_STRICMP( s1, s2 ) ( my_stricmp_func( s1, s2 ) ) + #define INI_STRNICMP( s1, s2, cnt ) ( my_strnicmp_func( s1, s2, cnt ) ) #include "ini.h" If no custom function is defined, ini.h will default to the C runtime library equivalent. @@ -414,13 +414,13 @@ the length is determined automatically, but in this case `value` has to be zero- #define INI_STRLEN( s ) ( strlen( s ) ) #endif -#ifndef INI_STRICMP +#ifndef INI_STRNICMP #ifdef _WIN32 #include - #define INI_STRICMP( s1, s2 ) ( stricmp( s1, s2 ) ) + #define INI_STRNICMP( s1, s2, cnt ) ( strnicmp( s1, s2, cnt ) ) #else #include - #define INI_STRICMP( s1, s2 ) ( strcasecmp( s1, s2 ) ) + #define INI_STRNICMP( s1, s2, cnt ) ( strncasecmp( s1, s2, cnt ) ) #endif #endif @@ -738,7 +738,7 @@ int ini_find_section( ini_t const* ini, char const* name, int name_length ) { char const* const other = ini->sections[ i ].name_large ? ini->sections[ i ].name_large : ini->sections[ i ].name; - if( (int) INI_STRLEN( other ) == name_length && INI_STRICMP( name, other, name_length) == 0 ) + if( (int) INI_STRLEN( other ) == name_length && INI_STRNICMP( name, other, name_length ) == 0 ) return i; } } @@ -762,7 +762,7 @@ int ini_find_property( ini_t const* ini, int section, char const* name, int name { char const* const other = ini->properties[ i ].name_large ? ini->properties[ i ].name_large : ini->properties[ i ].name; - if( (int) INI_STRLEN( other ) == name_length && INI_STRICMP( name, other, name_length) == 0 ) + if( (int) INI_STRLEN( other ) == name_length && INI_STRNICMP( name, other, name_length ) == 0 ) return c; ++c; }