Skip to content

Commit

Permalink
encode-test: MSVC compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
aengelke committed Jul 8, 2024
1 parent 4fe390c commit df01365
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion encode2-test.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void print_hex(const uint8_t* buf, size_t len) {

static int
check(const uint8_t* buf, const void* exp, size_t exp_len, unsigned res, const char* name) {
if (__builtin_expect(res == exp_len && !memcmp(buf, exp, exp_len), 1))
if (res == exp_len && !memcmp(buf, exp, exp_len))
return 0;
printf("Failed case (new) %s:\n", name);
printf(" Exp (%2zu): ", exp_len);
Expand Down
2 changes: 1 addition & 1 deletion encode2-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void print_hex(const uint8_t* buf, size_t len) {

static int
check(const Buffer& buf, const char* exp, size_t exp_len, unsigned res, const char* name) {
if (__builtin_expect(res == exp_len && !std::memcmp(buf.data(), exp, exp_len), 1))
if (res == exp_len && !std::memcmp(buf.data(), exp, exp_len))
return 0;
std::printf("Failed case (new) %s:\n", name);
std::printf(" Exp (%2zu): ", exp_len);
Expand Down

0 comments on commit df01365

Please sign in to comment.