Skip to content

Commit

Permalink
encode_value/decode_value: Fix incorrect signedness of locals
Browse files Browse the repository at this point in the history
  • Loading branch information
zeldin committed Feb 18, 2023
1 parent ce17f81 commit 7afb3c9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2033,10 +2033,10 @@ static void encode_value2(struct svalue *val, struct encode_data *data, int forc
/* Inherit */

/* Flags that have been set by/after the inherit. */
INT16 inherit_flags_set = 0;
unsigned INT16 inherit_flags_set = 0;
/* Mask of flags that may have been affected by
* the inherit. */
INT16 inherit_flags_mask = ~(ID_HIDDEN|ID_INHERITED);
unsigned INT16 inherit_flags_mask = ~(ID_HIDDEN|ID_INHERITED);
struct inherit *inh = p->inherits + inherit_num;
struct reference *ref = p->identifier_references + d;
int i;
Expand All @@ -2061,8 +2061,8 @@ static void encode_value2(struct svalue *val, struct encode_data *data, int forc
/* Calculate id_flags */
for (i = 0; i < inh->prog->num_identifier_references; i++) {
if (ref[i].inherit_offset) {
INT16 id_flags = ref[i].id_flags;
INT16 inh_id_flags =
unsigned INT16 id_flags = ref[i].id_flags;
unsigned INT16 inh_id_flags =
inh->prog->identifier_references[i].id_flags;
/* Ignore identifiers that have been hidden. */
if (!(id_flags & ID_HIDDEN)) {
Expand Down Expand Up @@ -3875,7 +3875,7 @@ static void decode_value2(struct decode_data *data)
int byteorder;
int bytecode_method;
int entry_type;
INT16 id_flags;
unsigned INT16 id_flags;
INT16 p_flags;
ptrdiff_t old_pragmas;
struct compilation *c;
Expand Down

0 comments on commit 7afb3c9

Please sign in to comment.