[master] 60eaab2 Fix bad enum to int conversion

Guillaume Quintard guillaume at varnish-software.com
Thu Sep 8 12:22:12 CEST 2016


commit 60eaab28c7e21223417505669b9b848ba47894b5
Author: Guillaume Quintard <guillaume at varnish-software.com>
Date:   Thu Sep 8 11:57:46 2016 +0200

    Fix bad enum to int conversion

diff --git a/bin/varnishtest/vtc_h2_hpack.c b/bin/varnishtest/vtc_h2_hpack.c
index 1239816..f6378f7 100644
--- a/bin/varnishtest/vtc_h2_hpack.c
+++ b/bin/varnishtest/vtc_h2_hpack.c
@@ -104,7 +104,7 @@ huff_decode(char *str, int nm, struct hpk_iter *iter, int ilen)
 }
 
 /* inspired from Dridi Boukelmoune's cashpack. */
-static int
+static enum hpk_result
 huff_encode(struct hpk_iter *iter, const char *str, int len)
 {
 	uint64_t pack = 0;
@@ -123,7 +123,7 @@ huff_encode(struct hpk_iter *iter, const char *str, int len)
 
 		while (pl >= 8) {
 			if (iter->buf == iter->end)
-				return (1);
+				return (hpk_done);
 			*iter->buf = (char)(pack >> 56);
 			iter->buf++;
 			pack <<= 8;
@@ -143,7 +143,7 @@ huff_encode(struct hpk_iter *iter, const char *str, int len)
 		iter->buf++;
 	}
 
-	return (0);
+	return (hpk_more);
 }
 
 static int



More information about the varnish-commit mailing list