Fix warnings.

This commit is contained in:
Victor M. Alvarez
2020-12-24 12:34:28 +01:00
parent a303a203c6
commit a576d21c64
4 changed files with 11 additions and 10 deletions
+4 -3
View File
@@ -432,7 +432,8 @@ int yr_arena_ptr_to_ref(YR_ARENA* arena, const void* address, YR_ARENA_REF* ref)
(uint8_t*) address < arena->buffers[i].data + arena->buffers[i].used)
{
ref->buffer_id = i;
ref->offset = (uint8_t*) address - arena->buffers[i].data;
ref->offset = (yr_arena_off_t)(
(uint8_t*) address - arena->buffers[i].data);
return 1;
}
}
@@ -542,7 +543,7 @@ int yr_arena_load_stream(YR_STREAM* stream, YR_ARENA** arena)
YR_ARENA_FILE_BUFFER buffers[YR_MAX_ARENA_BUFFERS];
int read = yr_stream_read(
size_t read = yr_stream_read(
buffers, sizeof(buffers[0]), hdr.num_buffers, stream);
if (read != hdr.num_buffers)
@@ -625,7 +626,7 @@ int yr_arena_save_stream(YR_ARENA* arena, YR_STREAM* stream)
{
YR_ARENA_FILE_BUFFER buffer = {
.offset = offset,
.size = arena->buffers[i].used,
.size = (uint32_t) arena->buffers[i].used,
};
if (yr_stream_write(&buffer, sizeof(buffer), 1, stream) != 1)
+1 -1
View File
@@ -112,7 +112,7 @@ static SIZED_STRING* _yr_modified_base64_encode(
}
yr_free(tmp);
out->length = p - (uint8_t*) out->c_string;
out->length = (uint32_t)(p - (uint8_t*) out->c_string);
return out;
}
+1 -1
View File
@@ -67,7 +67,7 @@ typedef struct YR_RELOC YR_RELOC;
struct YR_ARENA_REF
{
uint32_t buffer_id;
uint32_t offset;
yr_arena_off_t offset;
};
#pragma pack(pop)
+5 -5
View File
@@ -1903,7 +1903,7 @@ int yr_re_exec(
case RE_OPCODE_MATCH:
if (matches != NULL)
*matches = bytes_matched;
*matches = (int) bytes_matched;
if (flags & RE_FLAGS_EXHAUSTIVE)
{
@@ -2027,11 +2027,11 @@ int yr_re_fast_exec(
int input_incr;
int sp = 0;
size_t bytes_matched;
size_t max_bytes_matched;
int bytes_matched;
int max_bytes_matched;
max_bytes_matched = flags & RE_FLAGS_BACKWARDS ? input_backwards_size
: input_forwards_size;
max_bytes_matched = flags & RE_FLAGS_BACKWARDS ? (int) input_backwards_size
: (int) input_forwards_size;
input_incr = flags & RE_FLAGS_BACKWARDS ? -1 : 1;