Skip to content

Commit

Permalink
ctl: clang-format for coherent indentation and coding style
Browse files Browse the repository at this point in the history
  • Loading branch information
linuxmaniac committed May 18, 2023
1 parent 913ef5b commit 4940fd2
Show file tree
Hide file tree
Showing 15 changed files with 2,472 additions and 2,335 deletions.
27 changes: 10 additions & 17 deletions src/modules/ctl/binrpc.c
Expand Up @@ -22,25 +22,18 @@
#include "binrpc.h"

/* WARNING: keep in sync with the errors listed in binrpc.h */
static const char* binrpc_str_errors[]={
"no error",
"invalid function arguments",
"buffer too small (overflow)",
"corrupted packet",
"more data needed",
"end of packet encountered",
"binrpc parse context not initialized",
"record doesn't match type",
"bad record",
"bug -- internal error",
"unknown/invalid error code"
};
static const char *binrpc_str_errors[] = {"no error",
"invalid function arguments", "buffer too small (overflow)",
"corrupted packet", "more data needed", "end of packet encountered",
"binrpc parse context not initialized", "record doesn't match type",
"bad record", "bug -- internal error", "unknown/invalid error code"};



const char* binrpc_error(int err)
const char *binrpc_error(int err)
{
if (err<0) err=-err;
if (err>(-E_BINRPC_LAST)) err=-E_BINRPC_LAST;
if(err < 0)
err = -err;
if(err > (-E_BINRPC_LAST))
err = -E_BINRPC_LAST;
return binrpc_str_errors[err];
}

0 comments on commit 4940fd2

Please sign in to comment.