From fc44cffac50e6096528f2bde456d91a4e40ea7c9 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Tue, 3 May 2016 16:23:30 -0700 Subject: restyle switch blocks to match project style I missed restyling a few "switch" blocks to make them consistent with the rest of the code base. This fixes that oversight. This should be the final step in restyling the C++ code to have a consistent style. This also includes a few trivial cleanups elsewhere. I also missed restyling the "complete" module when working my way from a to z so this final change includes restyling that module. Total lint errors decreased 36%. Cppcheck errors went from 47 to 24. Oclint P2 errors went from 819 to 778. Oclint P3 errors went from 3252 to 1842. Resolves #2902. --- src/builtin.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/builtin.cpp') diff --git a/src/builtin.cpp b/src/builtin.cpp index 70b379b1..8ed2858b 100644 --- a/src/builtin.cpp +++ b/src/builtin.cpp @@ -1,4 +1,3 @@ -// // Functions for executing builtin functions. // // How to add a new builtin function: @@ -1895,17 +1894,18 @@ static int builtin_read(parser_t &parser, io_streams_t &streams, wchar_t **argv) nchars = fish_wcstoi(w.woptarg, &end, 10); if (errno || *end != 0) { switch (errno) { - case ERANGE: + case ERANGE: { streams.err.append_format(_(L"%ls: Argument '%ls' is out of range\n"), argv[0], w.woptarg); builtin_print_help(parser, streams, argv[0], streams.err); return STATUS_BUILTIN_ERROR; - - default: + } + default: { streams.err.append_format( _(L"%ls: Argument '%ls' must be an integer\n"), argv[0], w.woptarg); builtin_print_help(parser, streams, argv[0], streams.err); return STATUS_BUILTIN_ERROR; + } } } break; -- cgit v1.2.3