Commit eb5885fc authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Generate VCL_RET_* as enumbering instead of bitmap, compensate

elsewhere as required.

Remove unecessary args to VCL_[RM]ET_MAC().

Rely on VCL_RET_* definition in vcl.h



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@3484 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent ac783415
...@@ -144,7 +144,7 @@ puts $fo "\n#define VCL_MET_MAX\t\t$u\n" ...@@ -144,7 +144,7 @@ puts $fo "\n#define VCL_MET_MAX\t\t$u\n"
puts $fo "/* VCL Returns */" puts $fo "/* VCL Returns */"
set i 0 set i 0
foreach k $returns { foreach k $returns {
puts $fo "#define VCL_RET_[string toupper $k]\t\t(1 << $i)" puts $fo "#define VCL_RET_[string toupper $k]\t\t$i"
incr i incr i
} }
puts $fo "\n#define VCL_RET_MAX\t\t$i\n" puts $fo "\n#define VCL_RET_MAX\t\t$i\n"
...@@ -186,11 +186,9 @@ set i 0 ...@@ -186,11 +186,9 @@ set i 0
foreach k $returns { foreach k $returns {
set u [string toupper $k] set u [string toupper $k]
if {$k == "error"} { if {$k == "error"} {
puts $for "#ifdef VCL_RET_MAC_E" puts $for "VCL_RET_MAC($k, $u)"
puts $for "VCL_RET_MAC_E($k, $u, (1 << $i), $i)"
puts $for "#endif"
} else { } else {
puts $for "VCL_RET_MAC($k, $u, (1 << $i), $i)" puts $for "VCL_RET_MAC($k, $u)"
} }
incr i incr i
} }
...@@ -202,12 +200,12 @@ foreach m $methods { ...@@ -202,12 +200,12 @@ foreach m $methods {
puts -nonewline $for "VCL_MET_MAC([lindex $m 0]" puts -nonewline $for "VCL_MET_MAC([lindex $m 0]"
puts -nonewline $for ",[string toupper [lindex $m 0]]" puts -nonewline $for ",[string toupper [lindex $m 0]]"
set l [lindex $m 1] set l [lindex $m 1]
puts -nonewline $for ",\n (VCL_RET_[string toupper [lindex $l 0]]" puts $for ","
puts $for " ((1 << VCL_RET_[string toupper [lindex $l 0]])"
foreach r [lrange $l 1 end] { foreach r [lrange $l 1 end] {
puts -nonewline $for "|VCL_RET_[string toupper $r]" puts $for " | (1 << VCL_RET_[string toupper $r])"
} }
puts -nonewline $for ")" puts $for "))"
puts $for ")"
incr u incr u
} }
puts $for "#endif" puts $for "#endif"
...@@ -400,12 +398,6 @@ puts $fo "" ...@@ -400,12 +398,6 @@ puts $fo ""
puts $fo "void" puts $fo "void"
puts $fo "vcl_output_lang_h(struct vsb *sb)" puts $fo "vcl_output_lang_h(struct vsb *sb)"
puts $fo "{" puts $fo "{"
set i 0
foreach k $returns {
set u [string toupper $k]
puts $fo "\tvsb_cat(sb, \"#define VCL_RET_$u (1 << $i)\\n\");"
incr i
}
copy_include ../../include/vcl.h copy_include ../../include/vcl.h
copy_include ../../include/vrt.h copy_include ../../include/vrt.h
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment