Skip to content
Myr

Remove a bunch of unused variables, and useless assignments

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Detected by clang-tidy.

authored by Emanuele Torre · committed by Nico Williams · parent 2b70972 · Browse files · 4 files+3 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

4 files+3 added−5 removed

  • other:+3 added−5 removed

4 files+3 added−5 removed

modified:src/execute.c+1 added-1 removed
1240 unmodified lines
1241 int nerrors = load_program(jq, locations, &program);1242 if (nerrors == 0) {1243 nerrors = builtins_bind(jq, &program);1244 if (nerrors == 0) {1245 nerrors = block_compile(program, &jq->bc, locations, args = args2obj(args));1245 nerrors = block_compile(program, &jq->bc, locations, args2obj(args));1246 }1247 } else1248 jv_free(args);1249 if (nerrors)
96 unmodified lines
modified:src/jq_test.c-1 removed
125 unmodified lines
126 if (take > 0) {127 take--;128 } else if (take == 0) {129 printf("Hit the number of tests limit (%d), breaking\n", tests_to_take);130 take = -1;130 break;131 }132133 int pass = 1;
360 unmodified lines
modified:src/jv.c+1 added-2 removed
1078 unmodified lines
1079/* Copy a UTF8 string, replacing all badly encoded points with U+FFFD */1080static jv jvp_string_copy_replace_bad(const char* data, uint32_t length) {1081 const char* end = data + length;1082 const char* i = data;1083 const char* cstart;10831084 uint32_t maxlength = length * 3 + 1; // worst case: all bad bytes, each becomes a 3-byte U+FFFD1085 jvp_string* s = jvp_string_alloc(maxlength);1086 char* out = s->data;1087 int c = 0;10881090 while ((i = jvp_utf8_next((cstart = i), end, &c))) {1089 while ((i = jvp_utf8_next(i, end, &c))) {1090 if (c == -1) {1091 c = 0xFFFD; // U+FFFD REPLACEMENT CHARACTER1092 }1093 out += jvp_utf8_encode(c, out);
891 unmodified lines
modified:src/util.c+1 added-1 removed
351 unmodified lines
352 * For now we check how much fgets() read by scanning backwards for the353 * terminating '\0'. This only works because we previously memset our354 * buffer with something nonzero.355 */356 for (p = state->buf, i = sizeof(state->buf) - 1; i > 0; i--) {356 for (i = sizeof(state->buf) - 1; i > 0; i--) {357 if (state->buf[i] == '\0')358 break;359 }360 state->buf_valid_len = i;
919 unmodified lines