diff options
| author | Tharo <17233964+Thar0@users.noreply.github.com> | 2021-02-14 00:49:40 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-13 19:49:40 -0500 |
| commit | f9d96d9f73ac090245a518ec04f3fa0e50655d1e (patch) | |
| tree | 9dc905fce276cbfb07a05fc2bf0883bcedddcf23 /src/libultra_boot_O2/_Litob.c | |
| parent | d615ec4f31563b939f8c0dce1c20c79e137c2043 (diff) | |
Fix most compiler warnings in the boot and code segments (#674)
* Less warnings in boot & code segments
* few more warnings gone
* Ran formatter
* z_view warning gone
* -> 1
* f31 -> 31
* Remove function casts
* Few more small improvements
* Separate declaration and assignment in func_80091738 and Item_Give
Co-authored-by: Thar0 <maximilianc64@gmail.com>
Diffstat (limited to 'src/libultra_boot_O2/_Litob.c')
| -rw-r--r-- | src/libultra_boot_O2/_Litob.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/libultra_boot_O2/_Litob.c b/src/libultra_boot_O2/_Litob.c index 0f9452124..2f8152a10 100644 --- a/src/libultra_boot_O2/_Litob.c +++ b/src/libultra_boot_O2/_Litob.c @@ -7,20 +7,20 @@ u8 D_8000AF84[] = "0123456789ABCDEF"; void _Litob(_Pft* args, u8 type) { u8 buff[BUFF_LEN]; - const u8* num_map; + const u8* numMap; s32 base; - s32 buff_ind; + s32 idx; u64 num; lldiv_t quotrem; if (type == 'X') { - num_map = D_8000AF84; + numMap = D_8000AF84; } else { - num_map = D_8000AF70; + numMap = D_8000AF70; } base = (type == 'o') ? 8 : ((type != 'x' && type != 'X') ? 10 : 16); - buff_ind = BUFF_LEN; + idx = BUFF_LEN; num = args->v.ll; if ((type == 'd' || type == 'i') && args->v.ll < 0) { @@ -28,29 +28,29 @@ void _Litob(_Pft* args, u8 type) { } if (num != 0 || args->prec != 0) { - buff[--buff_ind] = num_map[num % base]; + buff[--idx] = numMap[num % base]; } args->v.ll = num / base; - while (args->v.ll > 0 && buff_ind > 0) { + while (args->v.ll > 0 && idx > 0) { quotrem = lldiv(args->v.ll, base); args->v.ll = quotrem.quot; - buff[--buff_ind] = num_map[quotrem.rem]; + buff[--idx] = numMap[quotrem.rem]; } - args->n1 = BUFF_LEN - buff_ind; + args->n1 = BUFF_LEN - idx; - memcpy(args->s, buff + buff_ind, args->n1); + memcpy(args->s, buff + idx, args->n1); if (args->n1 < args->prec) { args->nz0 = args->prec - args->n1; } if (args->prec < 0 && (args->flags & (FLAGS_ZERO | FLAGS_MINUS)) == FLAGS_ZERO) { - buff_ind = args->width - args->n0 - args->nz0 - args->n1; - if (buff_ind > 0) { - args->nz0 += buff_ind; + idx = args->width - args->n0 - args->nz0 - args->n1; + if (idx > 0) { + args->nz0 += idx; } } } |
