REORG/MINOR: lua: convert boolean "int" to bitfield

This patch converts a boolean "int" to a bitfiled. The main
reason is to save space in the struct if another flag may will
be require.

Note that this patch is required for next fix and will need to be
backported to 1.6.
diff --git a/include/types/hlua.h b/include/types/hlua.h
index a9b6498..fd7b7d3 100644
--- a/include/types/hlua.h
+++ b/include/types/hlua.h
@@ -29,6 +29,8 @@
 #define HLUA_EXIT      0x00000010
 #define HLUA_MUST_GC   0x00000020
 
+#define HLUA_F_AS_STRING    0x01
+
 enum hlua_exec {
 	HLUA_E_OK = 0,
 	HLUA_E_AGAIN,  /* LUA yield, must resume the stack execution later, when
@@ -114,7 +116,7 @@
 struct hlua_smp {
 	struct stream *s;
 	struct proxy *p;
-	int stringsafe;
+	unsigned int flags;     /* LUA_F_OPT_* */
 	int dir;                /* SMP_OPT_DIR_{REQ,RES} */
 };
 
diff --git a/src/hlua.c b/src/hlua.c
index a03b9dd..43c73f6 100644
--- a/src/hlua.c
+++ b/src/hlua.c
@@ -2961,7 +2961,7 @@
 /* This function creates and push in the stack a fetch object according
  * with a current TXN.
  */
-static int hlua_fetches_new(lua_State *L, struct hlua_txn *txn, int stringsafe)
+static int hlua_fetches_new(lua_State *L, struct hlua_txn *txn, unsigned int flags)
 {
 	struct hlua_smp *hsmp;
 
@@ -2980,7 +2980,7 @@
 	hsmp->s = txn->s;
 	hsmp->p = txn->p;
 	hsmp->dir = txn->dir;
-	hsmp->stringsafe = stringsafe;
+	hsmp->flags = flags;
 
 	/* Pop a class sesison metatable and affect it to the userdata. */
 	lua_rawgeti(L, LUA_REGISTRYINDEX, class_fetches_ref);
@@ -3035,7 +3035,7 @@
 	smp.strm = hsmp->s;
 	smp.opt = hsmp->dir & SMP_OPT_DIR;
 	if (!f->process(args, &smp, f->kw, f->private)) {
-		if (hsmp->stringsafe)
+		if (hsmp->flags & HLUA_F_AS_STRING)
 			lua_pushstring(L, "");
 		else
 			lua_pushnil(L);
@@ -3043,7 +3043,7 @@
 	}
 
 	/* Convert the returned sample in lua value. */
-	if (hsmp->stringsafe)
+	if (hsmp->flags & HLUA_F_AS_STRING)
 		hlua_smp2lua_str(L, &smp);
 	else
 		hlua_smp2lua(L, &smp);
@@ -3069,7 +3069,7 @@
 /* This function creates and push in the stack a Converters object
  * according with a current TXN.
  */
-static int hlua_converters_new(lua_State *L, struct hlua_txn *txn, int stringsafe)
+static int hlua_converters_new(lua_State *L, struct hlua_txn *txn, unsigned int flags)
 {
 	struct hlua_smp *hsmp;
 
@@ -3088,7 +3088,7 @@
 	hsmp->s = txn->s;
 	hsmp->p = txn->p;
 	hsmp->dir = txn->dir;
-	hsmp->stringsafe = stringsafe;
+	hsmp->flags = flags;
 
 	/* Pop a class stream metatable and affect it to the table. */
 	lua_rawgeti(L, LUA_REGISTRYINDEX, class_converters_ref);
@@ -3158,7 +3158,7 @@
 	smp.strm = hsmp->s;
 	smp.opt = hsmp->dir & SMP_OPT_DIR;
 	if (!conv->process(args, &smp, conv->private)) {
-		if (hsmp->stringsafe)
+		if (hsmp->flags & HLUA_F_AS_STRING)
 			lua_pushstring(L, "");
 		else
 			lua_pushnil(L);
@@ -3166,7 +3166,7 @@
 	}
 
 	/* Convert the returned sample in lua value. */
-	if (hsmp->stringsafe)
+	if (hsmp->flags & HLUA_F_AS_STRING)
 		hlua_smp2lua_str(L, &smp);
 	else
 		hlua_smp2lua(L, &smp);
@@ -3222,7 +3222,7 @@
 
 	/* Create the "sf" field that contains a list of stringsafe fetches. */
 	lua_pushstring(L, "sf");
-	if (!hlua_fetches_new(L, &appctx->htxn, 1))
+	if (!hlua_fetches_new(L, &appctx->htxn, HLUA_F_AS_STRING))
 		return 0;
 	lua_settable(L, -3);
 
@@ -3234,7 +3234,7 @@
 
 	/* Create the "sc" field that contains a list of stringsafe converters. */
 	lua_pushstring(L, "sc");
-	if (!hlua_converters_new(L, &appctx->htxn, 1))
+	if (!hlua_converters_new(L, &appctx->htxn, HLUA_F_AS_STRING))
 		return 0;
 	lua_settable(L, -3);
 
@@ -3509,7 +3509,7 @@
 
 	/* Create the "sf" field that contains a list of stringsafe fetches. */
 	lua_pushstring(L, "sf");
-	if (!hlua_fetches_new(L, &appctx->htxn, 1))
+	if (!hlua_fetches_new(L, &appctx->htxn, HLUA_F_AS_STRING))
 		return 0;
 	lua_settable(L, -3);
 
@@ -3521,7 +3521,7 @@
 
 	/* Create the "sc" field that contains a list of stringsafe converters. */
 	lua_pushstring(L, "sc");
-	if (!hlua_converters_new(L, &appctx->htxn, 1))
+	if (!hlua_converters_new(L, &appctx->htxn, HLUA_F_AS_STRING))
 		return 0;
 	lua_settable(L, -3);
 
@@ -4634,7 +4634,7 @@
 
 	/* Create the "sf" field that contains a list of stringsafe fetches. */
 	lua_pushstring(L, "sf");
-	if (!hlua_fetches_new(L, htxn, 1))
+	if (!hlua_fetches_new(L, htxn, HLUA_F_AS_STRING))
 		return 0;
 	lua_rawset(L, -3);
 
@@ -4646,7 +4646,7 @@
 
 	/* Create the "sc" field that contains a list of stringsafe converters. */
 	lua_pushstring(L, "sc");
-	if (!hlua_converters_new(L, htxn, 1))
+	if (!hlua_converters_new(L, htxn, HLUA_F_AS_STRING))
 		return 0;
 	lua_rawset(L, -3);