Skip to content

Commit

Permalink
Remove a bunch of variables that were written to but never read
Browse files Browse the repository at this point in the history
  • Loading branch information
niner committed Nov 29, 2019
1 parent 8ac4ac2 commit de1bebc
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 16 deletions.
1 change: 0 additions & 1 deletion src/6model/bootstrap.c
Expand Up @@ -226,7 +226,6 @@ static void member(MVMThreadContext *tc, MVMCallsite *callsite, MVMRegister *arg
MVM_args_proc_init(tc, &arg_ctx, callsite, args); \
MVM_args_checkarity(tc, &arg_ctx, 2, 2); \
self = MVM_args_get_required_pos_obj(tc, &arg_ctx, 0); \
type_obj = MVM_args_get_required_pos_obj(tc, &arg_ctx, 1); \
MVM_args_proc_cleanup(tc, &arg_ctx); \
if (!self || !IS_CONCRETE(self) || REPR(self)->ID != MVM_REPR_ID_KnowHOWREPR) \
MVM_exception_throw_adhoc(tc, "KnowHOW methods must be called on object instance with REPR KnowHOWREPR"); \
Expand Down
4 changes: 0 additions & 4 deletions src/profiler/configuration.c
Expand Up @@ -306,13 +306,10 @@ static void validate_op(MVMThreadContext *tc, validatorstate *state) {
}
else if (opcode == MVM_OP_getattr_o) {
MVMuint8 selected_struct_source = state->selected_struct_source;
MVMuint16 target_reg_num;
MVMuint16 source_reg_num;
MVMuint32 string_idx;
MVMuint16 hint;
MVMuint16 *hintptr;

target_reg_num = *((MVMuint16 *)state->bc_pointer);
validate_operand(tc, state, 0, state->cur_op->operands[0]);

source_reg_num = *((MVMuint16 *)state->bc_pointer);
Expand All @@ -324,7 +321,6 @@ static void validate_op(MVMThreadContext *tc, validatorstate *state) {
validate_operand(tc, state, 3, state->cur_op->operands[3]);

hintptr = (MVMuint16 *)state->bc_pointer;
hint = *hintptr;
validate_operand(tc, state, 4, state->cur_op->operands[4]);

junkprint(stderr, "currently on %d struct source, string index is %d\n", selected_struct_source, string_idx);
Expand Down
3 changes: 1 addition & 2 deletions src/spesh/plugin.c
Expand Up @@ -688,7 +688,7 @@ void MVM_spesh_plugin_rewrite_resolve(MVMThreadContext *tc, MVMSpeshGraph *g, MV

/* Collect registers that go with each argument, and delete the arg
* and prepargs instructions. */
MVMuint32 initial_arg_regs_length, arg_regs_length, i;
MVMuint32 arg_regs_length, i;
MVMSpeshOperand *arg_regs = arg_ins_to_reg_list(tc, g, bb, ins, &arg_regs_length);

/* Find result and add it to a spesh slot. */
Expand All @@ -707,7 +707,6 @@ void MVM_spesh_plugin_rewrite_resolve(MVMThreadContext *tc, MVMSpeshGraph *g, MV
MVM_spesh_facts_object_facts(tc, g, ins->operands[0], resolvee);

/* Prepend guards. */
initial_arg_regs_length = arg_regs_length;
MVM_VECTOR_INIT(temps, 0);
while (++guards_start <= guards_end) {
MVMSpeshPluginGuard *guard = &(gs->guards[guards_start]);
Expand Down
9 changes: 3 additions & 6 deletions src/strings/unicode_ops.c
Expand Up @@ -236,7 +236,7 @@ static MVMint32 NFD_and_push_collation_values (MVMThreadContext *tc, MVMCodepoin
return rtrn;
}
/* Returns the number of collation elements pushed onto the stack */
static MVMint32 collation_push_MVM_values (MVMThreadContext *tc, MVMCodepoint cp, collation_stack *stack, MVMCodepointIter *ci, char *name) {
static void collation_push_MVM_values (MVMThreadContext *tc, MVMCodepoint cp, collation_stack *stack, MVMCodepointIter *ci, char *name) {
collation_key MVM_coll_key = {
MVM_unicode_collation_primary(tc, cp), MVM_unicode_collation_secondary(tc, cp), MVM_unicode_collation_tertiary(tc, cp), 0
};
Expand Down Expand Up @@ -278,7 +278,7 @@ static MVMint32 collation_push_MVM_values (MVMThreadContext *tc, MVMCodepoint cp
else {
MVMint32 NFD_rtrn = NFD_and_push_collation_values(tc, cp, stack, ci, name);
if (NFD_rtrn) {
return NFD_rtrn;
return;
}
else {
AAAA = compute_AAAA(cp, 0xFBC0);
Expand All @@ -290,14 +290,12 @@ static MVMint32 collation_push_MVM_values (MVMThreadContext *tc, MVMCodepoint cp
calculated_key[1].s.primary = BBBB;
DEBUG_PRINT_SPECIAL_PUSHED(block_pushed, name, cp);
push_onto_stack(tc, stack, calculated_key, 2, name);
return 2;
}
else {
push_key_to_stack(stack,
MVM_coll_key.s.primary,
MVM_coll_key.s.secondary,
MVM_coll_key.s.tertiary);
return 1;
}
}
/* This is passed the terminal node and it adds the collation elements linked from
Expand Down Expand Up @@ -375,7 +373,6 @@ MVMint64 get_main_node (MVMThreadContext *tc, int cp, int range_min, int range_m
}
/* Returns the number of added collation keys */
static MVMint64 collation_push_cp (MVMThreadContext *tc, collation_stack *stack, MVMCodepointIter *ci, int *cp_maybe, int cp_num, char *name) {
MVMint64 rtrn = 0;
MVMCodepoint cps[10];
MVMint64 num_cps_processed = 0;
int query = -1;
Expand Down Expand Up @@ -440,7 +437,7 @@ static MVMint64 collation_push_cp (MVMThreadContext *tc, collation_stack *stack,
}
else {
/* Push the first codepoint onto the stack */
rtrn = collation_push_MVM_values(tc, cps[0], stack, ci, name);
collation_push_MVM_values(tc, cps[0], stack, ci, name);
num_cps_processed = 1;
}
/* If there are any more codepoints remaining call collation_push_cp on the remaining */
Expand Down
3 changes: 1 addition & 2 deletions src/strings/utf16.c
Expand Up @@ -56,7 +56,7 @@ MVMuint32 MVM_string_utf16_decodestream_main(MVMThreadContext *tc, MVMDecodeStre
MVMGrapheme32 *buffer;
MVMDecodeStreamBytes *cur_bytes;
MVMDecodeStreamBytes *last_accept_bytes = ds->bytes_head;
MVMint32 last_accept_pos, last_was_cr;
MVMint32 last_accept_pos;
MVMuint32 reached_stopper;
int low, high;
/* Set to 1 to remove the BOM even when big endian or little endian are
Expand All @@ -77,7 +77,6 @@ MVMuint32 MVM_string_utf16_decodestream_main(MVMThreadContext *tc, MVMDecodeStre

/* Decode each of the buffers. */
cur_bytes = ds->bytes_head;
last_was_cr = 0;
reached_stopper = 0;
if (utf16_decoder_state(ds) == UTF16_DECODE_LITTLE_ENDIAN) {
low = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/strings/uthash.h
Expand Up @@ -630,7 +630,7 @@ MVM_STATIC_INLINE void HASH_ADD_TO_BKT(MVMThreadContext *tc, UT_hash_bucket *buc
table->bucket_rand = bucket->hh_head ? ROTL(table->bucket_rand, 1) : table->bucket_rand + 1;/* Rotate so our bucket_rand changes somewhat. */
if (bucket->hh_head && table->bucket_rand & 1) {
UT_hash_handle *head = bucket->hh_head;
UT_hash_handle *next = addhh->hh_next = head->hh_next;
addhh->hh_next = head->hh_next;
head->hh_next = addhh;
}
else {
Expand Down

0 comments on commit de1bebc

Please sign in to comment.