mirror of
https://git.zap.org.au/git/trader.git
synced 2024-09-01 17:14:15 -04:00
Pedantically type-cast integer comparisons
The latest versions of the GNU Compiler Collection complain about signed and unsigned integer comparisons when run with the "-Wextra" flag. Keep those compilers happy.
This commit is contained in:
parent
9e3f7c7713
commit
f45986e88d
@ -210,7 +210,7 @@ void exchange_stock (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0, found = false; keycode_company[i] != L'\0'; i++) {
|
for (i = 0, found = false; keycode_company[i] != L'\0'; i++) {
|
||||||
if (keycode_company[i] == key) {
|
if (keycode_company[i] == (wchar_t) key) {
|
||||||
found = true;
|
found = true;
|
||||||
if (company[i].on_map) {
|
if (company[i].on_map) {
|
||||||
selection = i;
|
selection = i;
|
||||||
|
@ -1268,7 +1268,7 @@ void mkchstr_conv (chtype *restrict chbuf, int chbufsize,
|
|||||||
// Yes, we want to convert a wide NUL, too!
|
// Yes, we want to convert a wide NUL, too!
|
||||||
n = xwcrtomb(convbuf, *wcbuf, &mbstate);
|
n = xwcrtomb(convbuf, *wcbuf, &mbstate);
|
||||||
|
|
||||||
if (chbufsize > endsize + n) {
|
if (chbufsize > (int) endsize + (int) n) {
|
||||||
for (p = convbuf; n > 0; n--, p++, chbuf++, chbufsize--) {
|
for (p = convbuf; n > 0; n--, p++, chbuf++, chbufsize--) {
|
||||||
if (*p == '\0' || *p == '\n') {
|
if (*p == '\0' || *p == '\n') {
|
||||||
/* This code assumes '\n' can never appear in a
|
/* This code assumes '\n' can never appear in a
|
||||||
|
@ -292,7 +292,7 @@ selection_t get_move (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0, found = false; keycode_game_move[i] != L'\0'; i++) {
|
for (i = 0, found = false; keycode_game_move[i] != L'\0'; i++) {
|
||||||
if (keycode_game_move[i] == key) {
|
if (keycode_game_move[i] == (wchar_t) key) {
|
||||||
found = true;
|
found = true;
|
||||||
selection = i;
|
selection = i;
|
||||||
|
|
||||||
|
@ -747,7 +747,7 @@ char *unscramble (char *restrict dest, const char *restrict src,
|
|||||||
apply_xor(dest, midxor, xorlen - SCRAMBLE_CRC_LEN, key);
|
apply_xor(dest, midxor, xorlen - SCRAMBLE_CRC_LEN, key);
|
||||||
|
|
||||||
// Convert the output to a C string
|
// Convert the output to a C string
|
||||||
assert(size >= xorlen - SCRAMBLE_CRC_LEN + 1);
|
assert(size >= (size_t) xorlen - SCRAMBLE_CRC_LEN + 1);
|
||||||
dest[xorlen - SCRAMBLE_CRC_LEN] = '\0';
|
dest[xorlen - SCRAMBLE_CRC_LEN] = '\0';
|
||||||
|
|
||||||
free(xorbuf);
|
free(xorbuf);
|
||||||
|
Loading…
Reference in New Issue
Block a user