From fd10844c2b5fe0c1efa2dc034e6c9173b5ed82cb Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Wed, 5 Feb 2014 16:20:09 -0800 Subject: [PATCH] Unbreak C++11 due to narrowing; use non-conflicting declaration FISH_COLORS instead of COLORS; remove deprecated register type. --- output.cpp | 4 ++-- parse_tree.cpp | 8 ++++++-- wgetopt.cpp | 4 ++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/output.cpp b/output.cpp index 855eecdf3..1f92c32ef 100644 --- a/output.cpp +++ b/output.cpp @@ -52,7 +52,7 @@ /** Number of color names in the col array */ -#define COLORS (sizeof(col)/sizeof(wchar_t *)) +#define FISH_COLORS (sizeof(col)/sizeof(wchar_t *)) static int writeb_internal(char c); @@ -622,7 +622,7 @@ int output_color_code(const wcstring &val, bool is_background) if (! color_name.empty()) { - for (i=0; i(-1), + static_cast(-1)}; /* Terminal token */ -static const parse_token_t kTerminalToken = {parse_token_type_terminate, parse_keyword_none, false, false, -1, -1}; +static const parse_token_t kTerminalToken = {parse_token_type_terminate, +parse_keyword_none, false, false, static_cast(-1), + static_cast(-1)}; static inline bool is_help_argument(const wchar_t *txt) { diff --git a/wgetopt.cpp b/wgetopt.cpp index 08ccc3b14..ef0a64592 100644 --- a/wgetopt.cpp +++ b/wgetopt.cpp @@ -270,7 +270,7 @@ exchange(wchar_t **argv) { /* Bottom segment is the short one. */ int len = middle - bottom; - register int i; + short i; /* Swap it with the top part of the top segment. */ for (i = 0; i < len; i++) @@ -286,7 +286,7 @@ exchange(wchar_t **argv) { /* Top segment is the short one. */ int len = top - middle; - register int i; + short i; /* Swap it with the bottom part of the bottom segment. */ for (i = 0; i < len; i++)