Skip to content

Commit

Permalink
externalterm: fix signed/unsigned with ? operator warning
Browse files Browse the repository at this point in the history
Just explicitly cast type for both branches.

Signed-off-by: Davide Bettio <davide@uninstall.it>
  • Loading branch information
bettio committed Nov 29, 2023
1 parent 76349d0 commit 077e089
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libAtomVM/externalterm.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
#define SMALL_ATOM_EXT_BASE_SIZE 2

// Assuming two's-complement implementation of signed integers
#define SIGNED_INT_TO_UNSIGNED(val, unsigned_type) ((val) < 0 ? ~((unsigned_type) (val)) + 1 : (val))
#define SIGNED_INT_TO_UNSIGNED(val, unsigned_type) \
((val) < 0 ? ~((unsigned_type) (val)) + 1 : (unsigned_type) (val))

// MAINTENANCE NOTE. Range checking on the external term buffer is only performed in
// the calculate_heap_usage function, which will fail with an invalid term if there is
Expand Down

0 comments on commit 077e089

Please sign in to comment.