Skip to content

Commit 1d90197

Browse files
committed
Minor style fixes.
1 parent e1654ae commit 1d90197

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

libyara/arena.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,11 @@ void* yr_arena_ref_to_ptr(
435435
if (YR_ARENA_IS_NULL_REF(*ref))
436436
return NULL;
437437

438-
#if defined(__arm__)
438+
#if defined(__arm__)
439439
YR_ARENA_REF tmp_ref;
440440
memcpy(&tmp_ref, ref, sizeof(YR_ARENA_REF));
441441
ref = &tmp_ref;
442-
#endif
442+
#endif
443443

444444
return yr_arena_get_ptr(arena, ref->buffer_id, ref->offset);
445445
}

libyara/notebook.c

+8-6
Original file line numberDiff line numberDiff line change
@@ -146,16 +146,18 @@ void* yr_notebook_alloc(
146146

147147
void *ptr = notebook->page_list_head->data + notebook->page_list_head->used;
148148

149-
#if defined(__arm__)
150-
uintptr_t misalignment = (uintptr_t)ptr & 3;
149+
// In ARM make sure the alignment of the returned buffer is 4 bytes.
150+
#if defined(__arm__)
151+
uintptr_t misalignment = (uintptr_t) ptr & 3;
152+
151153
if (misalignment)
152154
{
153-
size += 4-misalignment;
154-
ptr += 4-misalignment;
155+
size += 4 - misalignment;
156+
ptr += 4 - misalignment;
155157
}
156-
#endif
158+
#endif
157159

158160
notebook->page_list_head->used += size;
159161

160162
return ptr;
161-
}
163+
}

0 commit comments

Comments
 (0)