Style fixes.

This commit is contained in:
Aaron Gyes
2016-06-23 22:44:58 -07:00
parent 02cef2da23
commit 0d6bdb38e6
8 changed files with 20 additions and 19 deletions

View File

@@ -19,7 +19,6 @@
#include <string>
#include <utility>
#include "autoload.h"
#include "builtin.h"
#include "common.h"

View File

@@ -13,11 +13,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <wctype.h>
#include <sys/signal.h>
#include <iosfwd>
#include <limits>
#include <wctype.h>
#include <cmath>
#include <iosfwd>
#include <limits>
#include "common.h"
#include "env.h"
@@ -31,10 +31,11 @@ struct config_paths_t determine_config_directory_paths(const char *argv0);
double prev_tstamp = std::numeric_limits<double>::quiet_NaN();
static const char *ctrl_equivalents[] = {"\\000", "\\001", "\\002", "\\003", "\\004", "\\005", "\\006", "\\a",
"\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\014", "\\015",
"\\016", "\\017", "\\018", "\\019", "\\020", "\\021", "\\022", "\\023",
"\\024", "\\025", "", "\\e", "\\028", "\\029", "\\030", "\\031"};
static const char *ctrl_equivalents[] = {
"\\000", "\\001", "\\002", "\\003", "\\004", "\\005", "\\006", "\\a",
"\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\014", "\\015",
"\\016", "\\017", "\\018", "\\019", "\\020", "\\021", "\\022", "\\023",
"\\024", "\\025", "", "\\e", "\\028", "\\029", "\\030", "\\031"};
/// Return true if the recent sequence of characters indicates the user wants to exit the program.
bool should_exit(unsigned char c) {
@@ -98,8 +99,8 @@ void process_input(bool continuous_mode) {
if (c < 32) {
// Control characters.
if (ctrl_equivalents[c]) {
printf("dec: %3u hex: %2x char: %s (aka \\c%c)", c, c,
ctrl_equivalents[c], c + 64);
printf("dec: %3u hex: %2x char: %s (aka \\c%c)", c, c, ctrl_equivalents[c],
c + 64);
} else {
printf("dec: %3u hex: %2x char: \\c%c\t", c, c, c + 64);
}
@@ -164,7 +165,7 @@ void setup_and_process_keys(bool continuous_mode) {
}
if (continuous_mode) {
printf("<ctrl-C> ('\\Cc') or type 'exit' or 'quit' followed by enter to terminate this program.\n");
printf("ctrl-C or type 'exit' or 'quit' to terminate this program.\n");
} else {
set_wait_on_escape_ms(500);
}

View File

@@ -2255,7 +2255,8 @@ static int test_universal_helper(int *x) {
static void test_universal() {
say(L"Testing universal variables");
if (system("mkdir -p " "/tmp/fish_uvars_test/")) err(L"mkdir failed");
if (system("mkdir -p /tmp/fish_uvars_test/"))
err(L"mkdir failed");
const int threads = 16;
static int ctx[threads];

View File

@@ -350,7 +350,7 @@ int input_init() {
debug(0, _(L"Your TERM value of '%ls' is not valid"), term.c_str());
debug(0, _(L"Check that your terminal type is supported on this system"));
}
env_set(L"TERM", DEFAULT_TERM, ENV_GLOBAL | ENV_EXPORT);
if (setupterm(NULL, STDOUT_FILENO, &err_ret) == ERR) {
debug(0, _(L"Unable to setup terminal using your TERM or the '%ls' fallback"),

View File

@@ -10,7 +10,7 @@
#include "common.h"
#include "complete.h"
#include "fallback.h"
#include "fallback.h"
#include "highlight.h"
#include "pager.h"
#include "reader.h"
@@ -506,7 +506,7 @@ bool pager_t::completion_try_print(size_t cols, const wcstring &prefix, const co
int search_field_written = print_max(SEARCH_FIELD_PROMPT, highlight_spec_normal,
term_width - 1, false, search_field);
print_max(search_field_text, highlight_modifier_force_underline,
term_width - search_field_written - 1, false, search_field);
term_width - search_field_written - 1, false, search_field);
}
}
return print;

View File

@@ -12,13 +12,13 @@
#include <vector>
#include "common.h"
#include "fallback.h"
#include "fallback.h"
#include "parse_constants.h"
#include "parse_productions.h"
#include "parse_tree.h"
#include "proc.h"
#include "tokenizer.h"
#include "wutil.h" // IWYU pragma: keep
#include "wutil.h" // IWYU pragma: keep
// This array provides strings for each symbol in enum parse_token_type_t in parse_constants.h.
const wchar_t *const token_type_map[] = {

View File

@@ -2176,7 +2176,7 @@ static int threaded_highlight(background_highlight_context_t *ctx) {
/// an asynchronous highlight in the background, which may perform disk I/O.
static void reader_super_highlight_me_plenty(int match_highlight_pos_adjust, bool no_io) {
const editable_line_t *el = &data->command_line;
assert (el != NULL);
assert(el != NULL);
long match_highlight_pos = (long)el->position + match_highlight_pos_adjust;
assert(match_highlight_pos >= 0);

View File

@@ -247,7 +247,7 @@ size_t escape_code_length(const wchar_t *code) {
}
}
}
if (!found) found = is_screen_name_escape_seq(code, &resulting_length);
if (!found) found = is_iterm2_escape_seq(code, &resulting_length);
if (!found) found = is_single_byte_escape_seq(code, &resulting_length);