[5.2] 055e285 Remove the VUT_g_Arg special case

PÃ¥l Hermunn Johansen hermunn at varnish-software.com
Fri Sep 15 11:17:16 UTC 2017


commit 055e285149a8750ef145664603db23440b8d3407
Author: Dridi Boukelmoune <dridi.boukelmoune at gmail.com>
Date:   Tue Sep 5 10:08:40 2017 +0200

    Remove the VUT_g_Arg special case
    
    It's no longer used anyway, and was already called via the generic
    VUT_Arg function.

diff --git a/include/vut.h b/include/vut.h
index e47ff79..aab3608 100644
--- a/include/vut.h
+++ b/include/vut.h
@@ -69,8 +69,6 @@ extern struct VUT VUT;
 void VUT_Error(int status, const char *fmt, ...)
 	__v_printflike(2, 3) __attribute__((__noreturn__));
 
-int VUT_g_Arg(const char *arg);
-
 int VUT_Arg(int opt, const char *arg);
 
 void VUT_Init(const char *progname, int argc, char * const *argv,
diff --git a/lib/libvarnishapi/libvarnishapi.map b/lib/libvarnishapi/libvarnishapi.map
index 37d8e72..e3e343d 100644
--- a/lib/libvarnishapi/libvarnishapi.map
+++ b/lib/libvarnishapi/libvarnishapi.map
@@ -133,7 +133,6 @@ LIBVARNISHAPI_2.0 {
 		VUT_Init;
 		VUT_Main;
 		VUT_Setup;
-		VUT_g_Arg;
 
     local:
 	*;
diff --git a/lib/libvarnishapi/vut.c b/lib/libvarnishapi/vut.c
index 26f5673..9ce1af5 100644
--- a/lib/libvarnishapi/vut.c
+++ b/lib/libvarnishapi/vut.c
@@ -125,18 +125,6 @@ VUT_Error(int status, const char *fmt, ...)
 }
 
 int
-VUT_g_Arg(const char *arg)
-{
-
-	VUT.g_arg = VSLQ_Name2Grouping(arg, -1);
-	if (VUT.g_arg == -2)
-		VUT_Error(1, "Ambiguous grouping type: %s", arg);
-	else if (VUT.g_arg < 0)
-		VUT_Error(1, "Unknown grouping type: %s", arg);
-	return (1);
-}
-
-int
 VUT_Arg(int opt, const char *arg)
 {
 	int i;
@@ -154,7 +142,12 @@ VUT_Arg(int opt, const char *arg)
 	case 'g':
 		/* Grouping */
 		AN(arg);
-		return (VUT_g_Arg(arg));
+		VUT.g_arg = VSLQ_Name2Grouping(arg, -1);
+		if (VUT.g_arg == -2)
+			VUT_Error(1, "Ambiguous grouping type: %s", arg);
+		else if (VUT.g_arg < 0)
+			VUT_Error(1, "Unknown grouping type: %s", arg);
+		return (1);
 	case 'k':
 		/* Log transaction limit */
 		AN(arg);


More information about the varnish-commit mailing list