]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: args: increase arg type to 5 bits and limit arg count to 5
authorWilly Tarreau <w@1wt.eu>
Mon, 19 Jan 2015 17:54:49 +0000 (18:54 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 22 Jan 2015 13:24:53 +0000 (14:24 +0100)
We'll soon need to add new argument types, and we don't use the current
limit of 7 arguments, so let's increase the arg type size to 5 bits and
reduce the arg count to 5 (3 max are used today).

include/types/arg.h

index 17008d97fc0c9ba4e4b2ab32a95b745c4aa842d0..8e089bad39b50cf7bf860ecaac3a8b3efad4f26b 100644 (file)
 #include <common/chunk.h>
 #include <common/mini-clist.h>
 
-/* encoding of each arg type */
-#define ARGT_BITS      4
+/* encoding of each arg type : up to 31 types are supported */
+#define ARGT_BITS      5
 #define ARGT_NBTYPES   (1 << ARGT_BITS)
 #define ARGT_MASK      (ARGT_NBTYPES - 1)
 
-/* encoding of the arg count */
+/* encoding of the arg count : up to 5 args are possible. 4 bits are left
+ * unused at the top.
+ */
 #define ARGM_MASK      ((1 << ARGM_BITS) - 1)
-#define ARGM_BITS      4
+#define ARGM_BITS      3
 #define ARGM_NBARGS    (32 - ARGM_BITS) / sizeof(int)
 
 enum {