From a63fcc36aa2230e370a042a4be115394eef9a2be Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 9 Jun 2016 04:35:39 +0200 Subject: [PATCH] Remove string functions --- libretro-common/include/string/stdstring.h | 6 ---- libretro-common/string/stdstring.c | 42 ---------------------- 2 files changed, 48 deletions(-) diff --git a/libretro-common/include/string/stdstring.h b/libretro-common/include/string/stdstring.h index e483435fb5..604d66d488 100644 --- a/libretro-common/include/string/stdstring.h +++ b/libretro-common/include/string/stdstring.h @@ -47,12 +47,6 @@ char *string_ucwords(char* s); char *string_replace_substring(const char *in, const char *pattern, const char *by); -/* Remove whitespace from beginning of string */ -void string_trim_whitespace_left(char *string); - -/* Remove whitespace from end of string */ -void string_trim_whitespace_right(char *string); - RETRO_END_DECLS #endif diff --git a/libretro-common/string/stdstring.c b/libretro-common/string/stdstring.c index c6fff43998..64a50d6f67 100644 --- a/libretro-common/string/stdstring.c +++ b/libretro-common/string/stdstring.c @@ -118,45 +118,3 @@ char *string_replace_substring(const char *in, return out; } - -/* Remove whitespace from beginning of string */ -void string_trim_whitespace_left(char *string) -{ - bool in_whitespace = true; - int32_t si = 0; - int32_t di = 0; - - while(string[si]) - { - bool test = in_whitespace && - isspace(string[si]); - - if(!test) - { - in_whitespace = false; - string[di] = string[si]; - di++; - } - - si++; - } - string[di] = '\0'; -} - -/* Remove whitespace from end of string */ -void string_trim_whitespace_right(char *string) -{ - int32_t len = strlen(string); - - if(len) - { - int32_t x; - for(x = len - 1; x >= 0; x--) - { - if (!isspace(string[x])) - break; - - string[x] = '\0'; - } - } -}