summaryrefslogtreecommitdiffhomepage
path: root/src/text.c
diff options
context:
space:
mode:
authorraysan5 <[email protected]>2020-05-14 13:32:57 +0200
committerraysan5 <[email protected]>2020-05-14 13:32:57 +0200
commitca6016cc71a67ccc411e715f4b45afafa08fada6 (patch)
tree42a8c3359709f0575919c2de5ea4831a3979fbfc /src/text.c
parent4ec40e720c2ca0d2fbe22100cb5da8244a539b73 (diff)
downloadraylib-ca6016cc71a67ccc411e715f4b45afafa08fada6.tar.gz
raylib-ca6016cc71a67ccc411e715f4b45afafa08fada6.zip
TextToInteger() always exposed
Diffstat (limited to 'src/text.c')
-rw-r--r--src/text.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/text.c b/src/text.c
index f5331ee0..3293f870 100644
--- a/src/text.c
+++ b/src/text.c
@@ -1132,6 +1132,24 @@ const char *TextFormat(const char *text, ...)
return currentBuffer;
}
+// Get integer value from text
+// NOTE: This function replaces atoi() [stdlib.h]
+int TextToInteger(const char *text)
+{
+ int value = 0;
+ int sign = 1;
+
+ if ((text[0] == '+') || (text[0] == '-'))
+ {
+ if (text[0] == '-') sign = -1;
+ text++;
+ }
+
+ for (int i = 0; ((text[i] >= '0') && (text[i] <= '9')); ++i) value = value*10 + (int)(text[i] - '0');
+
+ return value*sign;
+}
+
#if defined(SUPPORT_TEXT_MANIPULATION)
// Copy one string to another, returns bytes copied
int TextCopy(char *dst, const char *src)
@@ -1415,24 +1433,6 @@ const char *TextToPascal(const char *text)
return buffer;
}
-// Get integer value from text
-// NOTE: This function replaces atoi() [stdlib.h]
-int TextToInteger(const char *text)
-{
- int value = 0;
- int sign = 1;
-
- if ((text[0] == '+') || (text[0] == '-'))
- {
- if (text[0] == '-') sign = -1;
- text++;
- }
-
- for (int i = 0; ((text[i] >= '0') && (text[i] <= '9')); ++i) value = value*10 + (int)(text[i] - '0');
-
- return value*sign;
-}
-
// Encode text codepoint into utf8 text (memory must be freed!)
char *TextToUtf8(int *codepoints, int length)
{