Skip to content

Commit

Permalink
Dead stores
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoff Nixon committed Feb 27, 2014
1 parent 6d74978 commit ddcd2b0
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 25 deletions.
2 changes: 0 additions & 2 deletions builtin_test.cpp
Expand Up @@ -652,7 +652,6 @@ expression *test_parser::parse_args(const wcstring_list_t &args, wcstring &err)
err.append(L"test: ");
err.append(parser.errors.at(i));
err.push_back(L'\n');
errored = true;
// For now we only show the first error
break;
}
Expand All @@ -667,7 +666,6 @@ expression *test_parser::parse_args(const wcstring_list_t &args, wcstring &err)
{
append_format(err, L"test: unexpected argument at index %lu: '%ls'\n", (unsigned long)result->range.end, args.at(result->range.end).c_str());
}
errored = true;

delete result;
result = NULL;
Expand Down
6 changes: 1 addition & 5 deletions common.cpp
Expand Up @@ -866,11 +866,7 @@ void write_screen(const wcstring &msg, wcstring &buff)
/*
If token is zero character long, we don't do anything
*/
if (pos == start)
{
start = pos = pos+1;
}
else if (overflow)
if (overflow)
{
/*
In case of overflow, we print a newline, except if we already are at position 0
Expand Down
2 changes: 0 additions & 2 deletions fish.cpp
Expand Up @@ -213,8 +213,6 @@ static struct config_paths_t determine_config_directory_paths(const char *argv0)
paths.sysconf = L"" SYSCONFDIR "/fish";
paths.doc = L"" DOCDIR;
paths.bin = L"" BINDIR;

done = true;
}

return paths;
Expand Down
7 changes: 1 addition & 6 deletions history.cpp
Expand Up @@ -1338,7 +1338,7 @@ bool history_t::save_internal_via_rewrite()
for (size_t attempt = 0; attempt < 10 && out_fd == -1; attempt++)
{
char *narrow_str = wcs2str(tmp_name_template.c_str());
if (narrow_str && mktemp(narrow_str))
if (narrow_str && mkstemp(narrow_str))
{
/* It was successfully templated; try opening it atomically */
tmp_name = str2wcstring(narrow_str);
Expand Down Expand Up @@ -1507,11 +1507,6 @@ void history_t::save_internal(bool vacuum)
/* Try doing a fast append */
ok = save_internal_via_appending();
}
if (! ok)
{
/* We did not or could not append; rewrite the file ("vacuum" it) */
ok = this->save_internal_via_rewrite();
}
}

void history_t::save(void)
Expand Down
4 changes: 1 addition & 3 deletions pager.cpp
Expand Up @@ -147,7 +147,6 @@ line_t pager_t::completion_print_item(const wcstring &prefix, const comp_t *c, s
}
written += print_max(L"(", packed_color, 1, false, &line_data);
written += print_max(c->desc, packed_color, desc_width, false, &line_data);
written += print_max(L")", packed_color, 1, false, &line_data);
}
else
{
Expand Down Expand Up @@ -635,7 +634,6 @@ bool pager_t::completion_try_print(size_t cols, const wcstring &prefix, const co

/* We limit the width to term_width - 1 */
int search_field_written = print_max(SEARCH_FIELD_PROMPT, highlight_spec_normal, term_width - 1, false, search_field);
search_field_written += print_max(search_field_text, highlight_modifier_force_underline, term_width - search_field_written - 1, false, search_field);
}

}
Expand Down Expand Up @@ -747,7 +745,7 @@ bool pager_t::select_next_completion_in_direction(selection_direction_t directio
}

/* Ok, we had something selected already. Select something different. */
size_t new_selected_completion_idx = selected_completion_idx;
size_t new_selected_completion_idx;
if (! selection_direction_is_cardinal(direction))
{
/* Next, previous, or deselect, all easy */
Expand Down
1 change: 0 additions & 1 deletion parse_execution.cpp
Expand Up @@ -532,7 +532,6 @@ parse_execution_result_t parse_execution_context_t::run_switch_statement(const p
{
/* Store the node that failed to expand */
report_error(switch_value_node, WILDCARD_ERR_MSG, switch_value.c_str());
ret = parse_execution_errored;
break;
}

Expand Down
1 change: 0 additions & 1 deletion parse_tree.cpp
Expand Up @@ -987,7 +987,6 @@ void parse_ll_t::accept_tokens(parse_token_t token1, parse_token_t token2)
{
fprintf(stderr, "Consumed token %ls\n", token1.describe().c_str());
}
consumed = true;
break;
}

Expand Down
4 changes: 0 additions & 4 deletions parser.cpp
Expand Up @@ -2592,10 +2592,6 @@ int parser_t::eval_new_parser(const wcstring &cmd, const io_chain_t &io, enum bl

/* Execute the first node */
int result = 1;
if (! tree.empty())
{
result = this->eval_block_node(0, io, block_type);
}

/* Clean up the execution context stack */
assert(! execution_contexts.empty() && execution_contexts.back() == ctx);
Expand Down
1 change: 0 additions & 1 deletion proc.cpp
Expand Up @@ -398,7 +398,6 @@ static void mark_process_status(const job_t *j, process_t *p, int status)
handler. If things aren't working properly, it's safer to
give up.
*/
ignore = write(2, mess, strlen(mess));
}
}

Expand Down

0 comments on commit ddcd2b0

Please sign in to comment.