Skip to content

Commit

Permalink
remove unused argc/argv from help-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
umlaeute committed Nov 26, 2024
1 parent 98c38b5 commit 57bef59
Showing 1 changed file with 14 additions and 15 deletions.
29 changes: 14 additions & 15 deletions utils/v4l2loopback-ctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ static int help_shortcmdline(int detail, const char *program,
dprintf(2, "%s %s\n", program, argstring);
return !detail;
}
static void help_list(const char *program, int detail, int argc, char **argv)
static void help_list(const char *program, int detail)
{
if (detail)
dprintf(2, "\n listing devices ('list')"
Expand All @@ -313,7 +313,7 @@ static void help_list(const char *program, int detail, int argc, char **argv)
"\n \tlist all available loopback-devices"
"");
}
static void help_add(const char *program, int detail, int argc, char **argv)
static void help_add(const char *program, int detail)
{
if (detail)
dprintf(2, "\n adding devices ('add')"
Expand All @@ -339,7 +339,7 @@ static void help_add(const char *program, int detail, int argc, char **argv)
"\n \teither specify a device name (e.g. '/dev/video1') or a device number ('1')."
"\n <capturedevice>\tif given, use separate output & capture devices (otherwise they are the same).");
}
static void help_delete(const char *program, int detail, int argc, char **argv)
static void help_delete(const char *program, int detail)
{
if (detail)
dprintf(2, "\n deleting devices ('delete')"
Expand All @@ -350,7 +350,7 @@ static void help_delete(const char *program, int detail, int argc, char **argv)
"\n <device>\tcan be given one more more times (to delete multiple devices at once)."
"\n \teither specify a device name (e.g. '/dev/video1') or a device number ('1').");
}
static void help_query(const char *program, int detail, int argc, char **argv)
static void help_query(const char *program, int detail)
{
if (detail)
dprintf(2, "\n querying devices ('query')"
Expand All @@ -365,7 +365,7 @@ static void help_query(const char *program, int detail, int argc, char **argv)
"\n <device>\tcan be given one more more times (to query multiple devices at once)."
"\n \teither specify a device name (e.g. '/dev/video1') or a device number ('1').");
}
static void help_setfps(const char *program, int detail, int argc, char **argv)
static void help_setfps(const char *program, int detail)
{
if (detail)
dprintf(2, "\n setting framerate ('set-fps')"
Expand All @@ -376,15 +376,15 @@ static void help_setfps(const char *program, int detail, int argc, char **argv)
"\n <device>\teither specify a device name (e.g. '/dev/video1') or a device number ('1')."
"\n <fps>\tframes per second, either as integer ('30') or fraction ('50/2').");
}
static void help_getfps(const char *program, int detail, int argc, char **argv)
static void help_getfps(const char *program, int detail)
{
if (detail)
dprintf(2, "\n getting framerate ('get-fps')"
"\n =============================");
if (help_shortcmdline(detail, program, "get-fps <device>"))
return;
}
static void help_setcaps(const char *program, int detail, int argc, char **argv)
static void help_setcaps(const char *program, int detail)
{
if (detail)
dprintf(2, "\n setting capabilities ('set-caps')"
Expand Down Expand Up @@ -414,16 +414,15 @@ static void help_setcaps(const char *program, int detail, int argc, char **argv)
}
}
}
static void help_getcaps(const char *program, int detail, int argc, char **argv)
static void help_getcaps(const char *program, int detail)
{
if (detail)
dprintf(2, "\n getting capabilities ('get-caps')"
"\n =================================");
if (help_shortcmdline(detail, program, "get-caps <device>"))
return;
}
static void help_settimeoutimage(const char *program, int detail, int argc,
char **argv)
static void help_settimeoutimage(const char *program, int detail)
{
if (detail)
dprintf(2, "\n setting timeout image ('set-timeout-image')"
Expand All @@ -440,10 +439,10 @@ static void help_settimeoutimage(const char *program, int detail, int argc,
"\n <device>\teither specify a device name (e.g. '/dev/video1') or a device number ('1')."
"\n <image>\timage file");
}
static void help_none(const char *program, int detail, int argc, char **argv)
static void help_none(const char *program, int detail)
{
}
typedef void (*t_help)(const char *, int, int, char **);
typedef void (*t_help)(const char *, int);
static t_help get_help(t_command cmd)
{
switch (cmd) {
Expand Down Expand Up @@ -482,12 +481,12 @@ static void help(const char *name, int status)
"\n\t-h/-?/--help : print this help and exit");
/* brief helps */
for (cmd = ADD; cmd < _UNKNOWN; cmd++)
get_help(cmd)("", 0, 0, 0);
get_help(cmd)("", 0);
dprintf(2, "\n\n");

/* long helps */
for (cmd = ADD; cmd < _UNKNOWN; cmd++) {
get_help(cmd)(name, 1, 0, 0);
get_help(cmd)(name, 1);
dprintf(2, "\n\n");
}

Expand All @@ -503,7 +502,7 @@ static void usage_topic(const char *name, t_command cmd, int argc, char **argv)
if (help_none == hlp)
usage(name);
else
hlp(name, 2, argc, argv);
hlp(name, 2);
dprintf(2, "\n");
exit(1);
}
Expand Down

0 comments on commit 57bef59

Please sign in to comment.