From 1f2b2b119a1ca68a8d3d1295088782f9a8428765 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Fri, 10 Aug 2018 20:48:02 -0700 Subject: [PATCH] Remove some disabled (commented or ifdef'd out) code --- src/fallback.cpp | 15 --------------- src/history.cpp | 9 --------- src/io.cpp | 6 ------ src/parse_tree.cpp | 7 ------- src/proc.cpp | 10 ---------- src/reader.cpp | 1 - 6 files changed, 48 deletions(-) diff --git a/src/fallback.cpp b/src/fallback.cpp index 37c2aa8dc..bfccb7941 100644 --- a/src/fallback.cpp +++ b/src/fallback.cpp @@ -211,21 +211,6 @@ size_t wcslcpy(wchar_t *dst, const wchar_t *src, size_t siz) { } #endif -#if 0 -// These are not currently used. -#ifndef HAVE_LRAND48_R -int lrand48_r(struct drand48_data *buffer, long int *result) { - *result = rand_r(&buffer->seed); - return 0; -} - -int srand48_r(long int seedval, struct drand48_data *buffer) { - buffer->seed = (unsigned int)seedval; - return 0; -} -#endif -#endif - #ifndef HAVE_FUTIMES int futimes(int fd, const struct timeval *times) { errno = ENOSYS; diff --git a/src/history.cpp b/src/history.cpp index 9673e88e9..d578b0a81 100644 --- a/src/history.cpp +++ b/src/history.cpp @@ -555,15 +555,6 @@ bool history_item_t::merge(const history_item_t &item) { return result; } -#if 0 -history_item_t::history_item_t(const wcstring &str) - : contents(str), contents_lower(L""), creation_timestamp(time(NULL)), identifier(0) { - for (wcstring::const_iterator it = str.begin(); it != str.end(); ++it) { - contents_lower.push_back(towlower(*it)); - } - } -#endif - history_item_t::history_item_t(const wcstring &str, time_t when, history_identifier_t ident) : contents(str), contents_lower(L""), creation_timestamp(when), identifier(ident) { for (wcstring::const_iterator it = str.begin(); it != str.end(); ++it) { diff --git a/src/io.cpp b/src/io.cpp index ae4fa0478..dc916c0b8 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -44,12 +44,6 @@ void io_buffer_t::read() { exec_close(pipe_fd[1]); if (io_mode == IO_BUFFER) { -#if 0 - if (fcntl( pipe_fd[0], F_SETFL, 0)) { - wperror( L"fcntl" ); - return; - } -#endif debug(4, L"io_buffer_t::read: blocking read on fd %d", pipe_fd[0]); while (1) { char b[4096]; diff --git a/src/parse_tree.cpp b/src/parse_tree.cpp index 5293544e3..a8d6596ac 100644 --- a/src/parse_tree.cpp +++ b/src/parse_tree.cpp @@ -1096,13 +1096,6 @@ bool parse_tree_from_string(const wcstring &str, parse_tree_flags_t parse_flags, // Acquire the output from the parser. parser.acquire_output(output, errors); -#if 0 - //wcstring result = dump_tree(this->parser->nodes, str); - //fwprintf(stderr, L"Tree (%ld nodes):\n%ls", this->parser->nodes.size(), result.c_str()); - fwprintf(stderr, L"%lu nodes, node size %lu, %lu bytes\n", output->size(), sizeof(parse_node_t), - output->size() * sizeof(parse_node_t)); -#endif - // Indicate if we had a fatal error. return !parser.has_fatal_error(); } diff --git a/src/proc.cpp b/src/proc.cpp index 280f1a74d..e90bab7d0 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -333,16 +333,6 @@ static void handle_child_status(pid_t pid, int status) { sigaction(SIGQUIT, &act, 0); kill(getpid(), WTERMSIG(status)); } - -#if 0 - // TODO: Decide whether to eliminate this block or have it emit a warning message. - // WARNING: See the special short-circuit logic above vis-a-vis signals. - if (!found_proc) { - // A child we lost track of? There have been bugs in both subshell handling and in builtin - // handling that have caused this previously... - } -#endif - return; } process_t::process_t() {} diff --git a/src/reader.cpp b/src/reader.cpp index 1a82961d4..f45b460ea 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -2693,7 +2693,6 @@ const wchar_t *reader_readline(int nchars) { data->search_mode = history_search_mode_t::none; if (data->token_history_pos == (size_t)-1) { - // history_reset(); data->history_search.go_to_end(); reader_set_buffer(data->search_buff, data->search_buff.size()); } else {