aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/exec.cpp
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-05-03 16:23:30 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-05-03 17:14:56 -0700
commitfc44cffac50e6096528f2bde456d91a4e40ea7c9 (patch)
tree3c6c928aa0a8568b6e37a0698deb464575ba3fe2 /src/exec.cpp
parent5c8763be0e68bbdec3fdd1edb5754f4c421098e1 (diff)
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.
Diffstat (limited to 'src/exec.cpp')
-rw-r--r--src/exec.cpp17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/exec.cpp b/src/exec.cpp
index b7735d62..b55e7a26 100644
--- a/src/exec.cpp
+++ b/src/exec.cpp
@@ -257,23 +257,16 @@ static bool io_transmogrify(const io_chain_t &in_chain, io_chain_t *out_chain,
shared_ptr<io_data_t> out; // gets allocated via new
switch (in->io_mode) {
- default:
- // Unknown type, should never happen.
- fprintf(stderr, "Unknown io_mode %ld\n", (long)in->io_mode);
- abort();
- break;
-
- // These redirections don't need transmogrification. They can be passed through.
case IO_PIPE:
case IO_FD:
case IO_BUFFER:
case IO_CLOSE: {
+ // These redirections don't need transmogrification. They can be passed through.
out = in;
break;
}
-
- // Transmogrify file redirections.
case IO_FILE: {
+ // Transmogrify file redirections.
int fd;
CAST_INIT(io_file_t *, in_file, in.get());
if ((fd = open(in_file->filename_cstr, in_file->flags, OPEN_MASK)) == -1) {
@@ -288,6 +281,12 @@ static bool io_transmogrify(const io_chain_t &in_chain, io_chain_t *out_chain,
out.reset(new io_fd_t(in->fd, fd, false));
break;
}
+ default: {
+ // Unknown type, should never happen.
+ fprintf(stderr, "Unknown io_mode %ld\n", (long)in->io_mode);
+ abort();
+ break;
+ }
}
if (out.get() != NULL) result_chain.push_back(out);