Fix signed vs unsigned comparison warning from GCC

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson 2019-10-21 11:15:36 +02:00
parent e65f815333
commit 4382136d18
2 changed files with 4 additions and 4 deletions

View File

@ -807,7 +807,7 @@ static void LogLine(char *ptr, int len)
** verify there is room in the line buffer
*/
sym_space = space + (line - sym_start);
if (sym_space < strlen(symbol) + 30) { /*(30 should be overkill)*/
if (sym_space < (int)strlen(symbol) + 30) { /*(30 should be overkill)*/
parse_state = PARSING_TEXT; /* not enough space */
break;
}

View File

@ -466,9 +466,9 @@ char *LookupModuleSymbol(unsigned long value, struct symbol *sym)
++nsym) {
if (mp->sym_array[nsym].value > value) {
if (sym->size == 0 ||
(value - last->value) < sym->offset ||
((sym->offset == (value - last->value)) &&
(mp->sym_array[nsym].value - last->value) < sym->size)) {
(value - last->value) < (unsigned long)sym->offset ||
(((unsigned long)sym->offset == (value - last->value)) &&
(mp->sym_array[nsym].value - last->value) < (unsigned long)sym->size)) {
sym->offset = value - last->value;
sym->size = mp->sym_array[nsym].value -
last->value;