Dead stores

This commit is contained in:
Geoff Nixon 2014-02-27 03:15:00 -08:00
parent 6d749789ce
commit ddcd2b0810
9 changed files with 3 additions and 25 deletions

View file

@ -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;
}
@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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);
@ -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)

View file

@ -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
{
@ -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);
}
}
@ -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 */

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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);

View file

@ -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));
}
}