summaryrefslogtreecommitdiff
path: root/arm9/src/string_util.c
diff options
context:
space:
mode:
authorPikalaxALT <pikalaxalt@gmail.com>2020-05-26 09:42:03 -0400
committerPikalaxALT <pikalaxalt@gmail.com>2020-05-26 09:42:03 -0400
commit8c8a5a07c5e6b1a2d0d0592a30be31ccd140fc1e (patch)
treec23120a706d012bd19c4c2584af5009fd2016ecf /arm9/src/string_util.c
parente643eddc0def8e4851a4195e8ed4de06c847f52d (diff)
parent227da51c377f621f542ffdb52ef56bfb807f29ab (diff)
Merge branch 'master' of github.com:martmists/pokediamond into pikalax_work
Diffstat (limited to 'arm9/src/string_util.c')
-rw-r--r--arm9/src/string_util.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/arm9/src/string_util.c b/arm9/src/string_util.c
index e6ea85de..e36f1a30 100644
--- a/arm9/src/string_util.c
+++ b/arm9/src/string_util.c
@@ -1,4 +1,4 @@
-#include "global.h"
+#include "string_util.h"
#define EOS 0xFFFF
#define NON_DIGIT 0xE2
@@ -124,23 +124,17 @@ THUMB_FUNC u16 *StringFillEOS(u16 *dest, u32 num)
return StringFill(dest, EOS, num);
}
-enum PrintingMode {
- NORMAL,
- PAD_SPACE,
- PAD_ZEROES
-};
-
THUMB_FUNC u16 *ConvertUIntToDecimalString(u16 *dest, u32 value, enum PrintingMode mode, u32 n)
{
- for (u32 x = gPowersOfTen[n - 1]; x != 0; x = x / 10) {
- u16 res = value / x;
+ for (u32 x = (u32)gPowersOfTen[n - 1]; x != 0; x = x / 10) {
+ u16 res = (u16)(value / x);
value = value - x * res;
if (mode == PAD_ZEROES) {
- *dest = res >= 10 ? NON_DIGIT : gDigitTable[res];
+ *dest = res >= 10 ? (u16)NON_DIGIT : gDigitTable[res];
dest++;
} else if (res != 0 || x == 1) {
mode = PAD_ZEROES;
- *dest = res >= 10 ? NON_DIGIT : gDigitTable[res];
+ *dest = res >= 10 ? (u16)NON_DIGIT : gDigitTable[res];
dest++;
} else if (mode == PAD_SPACE) {
*dest = 1;