Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
encoding/json: Use unsigned type for bitfield
Enabling -Wsingle-bit-bitfield-constant-conversion compains.
repos/apache-mynewt-core/encoding/json/src/json_encode.c:187:27: error:
    implicit truncation from 'int' to a one-bit wide bit-field changes
    value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
562
    encoder->je_wr_commas = 1;
563
                          ^ ~
564
repos/apache-mynewt-core/encoding/json/src/json_encode.c:199:27: error:
    implicit truncation from 'int' to a one-bit wide bit-field changes
    value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
565
    encoder->je_wr_commas = 1;
566
                          ^ ~
567
repos/apache-mynewt-core/encoding/json/src/json_encode.c:233:27: error:
    implicit truncation from 'int' to a one-bit wide bit-field changes
    value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
568
    encoder->je_wr_commas = 1;
569
                          ^ ~
570
repos/apache-mynewt-core/encoding/json/src/json_encode.c:244:27: error:
    implicit truncation from 'int' to a one-bit wide bit-field changes
    value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
571
    encoder->je_wr_commas = 1;
572
                          ^ ~
  • Loading branch information
sjanc committed Oct 30, 2024
commit 2369f6636426ba3d60d4e644b0944cc351643a56
2 changes: 1 addition & 1 deletion encoding/json/include/json/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ typedef int (*json_write_func_t)(void *buf, char *data,
struct json_encoder {
json_write_func_t je_write;
void *je_arg;
int je_wr_commas:1;
unsigned int je_wr_commas : 1;
char je_encode_buf[64];
};

Expand Down