Skip to content

Commit

Permalink
Fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
plusvic committed Sep 25, 2015
1 parent d522a89 commit 62c9bf8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions libyara/arena.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ int _yr_arena_make_relocatable(
if (reloc == NULL)
return ERROR_INSUFICIENT_MEMORY;

reloc->offset = base_offset + offset;
reloc->offset = (uint32_t) (base_offset + offset);
reloc->next = NULL;

if (page->reloc_list_head == NULL)
Expand Down Expand Up @@ -410,7 +410,7 @@ int yr_arena_coalesce(

uint8_t** reloc_address;
uint8_t* reloc_target;
int total_size = 0;
size_t total_size = 0;

page = arena->page_list_head;

Expand Down Expand Up @@ -438,7 +438,7 @@ int yr_arena_coalesce(

while(reloc != NULL)
{
reloc->offset += big_page->used;
reloc->offset += (uint32_t) big_page->used;
reloc = reloc->next;
}

Expand Down
16 changes: 8 additions & 8 deletions libyara/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ typedef struct _CALLBACK_ARGS
} CALLBACK_ARGS;


size_t _yr_scan_compare(
int _yr_scan_compare(
uint8_t* data,
size_t data_size,
uint8_t* string,
Expand All @@ -60,11 +60,11 @@ size_t _yr_scan_compare(
while (i < string_length && *s1++ == *s2++)
i++;

return ((i == string_length) ? i : 0);
return (int) ((i == string_length) ? i : 0);
}


size_t _yr_scan_icompare(
int _yr_scan_icompare(
uint8_t* data,
size_t data_size,
uint8_t* string,
Expand All @@ -81,11 +81,11 @@ size_t _yr_scan_icompare(
while (i < string_length && lowercase[*s1++] == lowercase[*s2++])
i++;

return ((i == string_length) ? i : 0);
return (int) ((i == string_length) ? i : 0);
}


size_t _yr_scan_wcompare(
int _yr_scan_wcompare(
uint8_t* data,
size_t data_size,
uint8_t* string,
Expand All @@ -106,11 +106,11 @@ size_t _yr_scan_wcompare(
i++;
}

return ((i == string_length) ? i * 2 : 0);
return (int) ((i == string_length) ? i * 2 : 0);
}


size_t _yr_scan_wicompare(
int _yr_scan_wicompare(
uint8_t* data,
size_t data_size,
uint8_t* string,
Expand All @@ -131,7 +131,7 @@ size_t _yr_scan_wicompare(
i++;
}

return ((i == string_length) ? i * 2 : 0);
return (int) ((i == string_length) ? i * 2 : 0);
}


Expand Down

0 comments on commit 62c9bf8

Please sign in to comment.