Skip to content

Commit

Permalink
global fix source indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rd235 committed Oct 22, 2023
1 parent cad9a00 commit 587735d
Show file tree
Hide file tree
Showing 73 changed files with 1,398 additions and 1,398 deletions.
64 changes: 32 additions & 32 deletions cmd/vu_insmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
static char *progname;
void usage()
{
fprintf(stderr,
fprintf(stderr,
"Usage:\n"
" %s OPTIONS vu_module [vu_module] ...\n"
" OPTIONS:\n"
" -p --permanent: rmmod forbidden\n\n"
" -h --help: print this help message\n\n", progname);

exit(2);
exit(2);
}

static const char *short_options = "p";
Expand All @@ -47,38 +47,38 @@ static const struct option long_options[] = {

int main(int argc, char *argv[])
{
int c;
int permanent=0;
int c;
int permanent=0;
progname = basename(argv[0]);
if (vu_check() < 0) {
fprintf(stderr,"This is a VUOS command."
if (vu_check() < 0) {
fprintf(stderr,"This is a VUOS command."
"It works only inside a vuos virtual namespace\n");
usage();
}
while (1) {
c=getopt_long(argc, argv,
usage();
}
while (1) {
c=getopt_long(argc, argv,
short_options, long_options, NULL);
if (c == -1) break;
switch (c) {
case 'p': permanent=1;
break;
case 'h': usage();
break;
}
}
if (argc - optind < 1)
usage();
else {
int rv=0;
int i;
for (i = optind; i < argc; i++) {
if (vu_insmod(argv[i], permanent) < 0) {
perror(argv[i]);
rv=1;
}
}
return rv;
}
return 0;
if (c == -1) break;
switch (c) {
case 'p': permanent=1;
break;
case 'h': usage();
break;
}
}
if (argc - optind < 1)
usage();
else {
int rv=0;
int i;
for (i = optind; i < argc; i++) {
if (vu_insmod(argv[i], permanent) < 0) {
perror(argv[i]);
rv=1;
}
}
return rv;
}
return 0;
}

36 changes: 18 additions & 18 deletions cmd/vu_lsmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
static char *progname;
void usage()
{
fprintf(stderr,
fprintf(stderr,
"Usage:\n"
" %s OPTIONS\n"
" OPTIONS:\n"
" -h --help: print this help message\n\n", progname);
exit(2);
exit(2);
}

static const char *short_options = "p";
Expand All @@ -44,31 +44,31 @@ static const struct option long_options[] = {

int main(int argc, char *argv[])
{
int c;
int c;
progname = basename(argv[0]);
size_t bufsize;
if (vu_check() < 0) {
fprintf(stderr,"This is a VUOS command."
if (vu_check() < 0) {
fprintf(stderr,"This is a VUOS command."
"It works only inside a vuos virtual namespace\n");
usage();
}
while (1) {
c=getopt_long(argc, argv,
usage();
}
while (1) {
c=getopt_long(argc, argv,
short_options, long_options, NULL);
if (c == -1) break;
switch (c) {
case 'h': usage();
break;
}
}
if (argc - optind > 0)
usage();
if (c == -1) break;
switch (c) {
case 'h': usage();
break;
}
}
if (argc - optind > 0)
usage();
if ((bufsize = vu_lsmod(NULL, 0)) > 0) {
char buf[bufsize];
if (vu_lsmod(buf, bufsize) < 0)
perror(progname);
else
printf("%s", buf);
}
return 0;
return 0;
}
58 changes: 29 additions & 29 deletions cmd/vu_rmmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@
static char *progname;
void usage()
{
fprintf(stderr,
fprintf(stderr,
"Usage:\n"
" %s OPTIONS vu_module [vu_module] ...\n"
" OPTIONS:\n"
" -h --help: print this help message\n\n", progname);
exit(2);
exit(2);
}

static const char *short_options = "p";
Expand All @@ -44,34 +44,34 @@ static const struct option long_options[] = {

int main(int argc, char *argv[])
{
int c;
int c;
progname = basename(argv[0]);
if (vu_check() < 0) {
fprintf(stderr,"This is a VUOS command."
if (vu_check() < 0) {
fprintf(stderr,"This is a VUOS command."
"It works only inside a vuos virtual namespace\n");
usage();
}
while (1) {
c=getopt_long(argc, argv,
usage();
}
while (1) {
c=getopt_long(argc, argv,
short_options, long_options, NULL);
if (c == -1) break;
switch (c) {
case 'h': usage();
break;
}
}
if (argc - optind < 1)
usage();
else {
int rv=0;
int i;
for (i = optind; i < argc; i++) {
if (vu_rmmod(argv[i]) < 0) {
perror(argv[i]);
rv=1;
}
}
return rv;
}
return 0;
if (c == -1) break;
switch (c) {
case 'h': usage();
break;
}
}
if (argc - optind < 1)
usage();
else {
int rv=0;
int i;
for (i = optind; i < argc; i++) {
if (vu_rmmod(argv[i]) < 0) {
perror(argv[i]);
rv=1;
}
}
return rv;
}
return 0;
}
22 changes: 11 additions & 11 deletions cmd/vudebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
static char *progname;
void usage()
{
fprintf(stderr,
fprintf(stderr,
"Usage: %s [ARG] [ARG] ... [ -- cmd args ]\n"
" ARG = --help | DEBUGSPEC\n"
" DEBUGSPEC = [+|-]TAG[TAG]...[:COLORSPEC]\n"
Expand All @@ -42,7 +42,7 @@ void usage()
" +:,bright, -: dim, _: underlined, *: blinking, #: reverse\n\n",
progname);

exit(2);
exit(2);
}

static inline void unique(int c) {
Expand All @@ -64,7 +64,7 @@ static void vu_ls_debugtags(char *lstags) {
char tagname[32];
vu_get_debugtagname(c, tagname, 32);
if (((lstags != NULL && strchr(lstags, c)) ||
(lstags == NULL && (tagselected || *tagname != '\0'))))
(lstags == NULL && (tagselected || *tagname != '\0'))))
printf("%c %c%s%s\n", c,
tagselected ? '+' : '-',
ltagselected ? "(+)" : " ",
Expand All @@ -76,16 +76,16 @@ static char functions[] = "+-?";
int main(int argc, char *argv[])
{
progname = basename(argv[0]);
if (vu_check() < 0) {
fprintf(stderr,"This is a VUOS command."
if (vu_check() < 0) {
fprintf(stderr,"This is a VUOS command."
"It works only inside a vuos virtual namespace\n");
usage();
}
usage();
}
if (argc == 1) {
char tags[DEBUG_NTAGS+1];
char ltags[DEBUG_NTAGS+1];
vu_get_debugtags(tags, DEBUG_NTAGS+1, 0);
vu_get_debugtags(ltags, DEBUG_NTAGS+1, 1);
vu_get_debugtags(tags, DEBUG_NTAGS+1, 0);
vu_get_debugtags(ltags, DEBUG_NTAGS+1, 1);
if (*tags)
printf("%s\n",tags);
if (*ltags)
Expand Down Expand Up @@ -120,12 +120,12 @@ int main(int argc, char *argv[])
case '?': vu_ls_debugtags(*tags ? tags : NULL);
break;
default: if (color == NULL)
usage();
usage();
break;
}
char *colorstring;
if (asprintf(&colorstring, "%s:%s", *tags ? tags : ALLTAGS,
(color) ? color : "") >= 0) {
(color) ? color : "") >= 0) {
vu_set_debugcolor(colorstring);
free(colorstring);
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/vumount.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ char *parse_options(char *options, unsigned long *mountflags) {
tags[i] = STROPTX_DELETED_TAG;
}
return stropt2str(tags, args, ',', '=');
} else
} else
return options;
}

Expand Down
Loading

0 comments on commit 587735d

Please sign in to comment.