From de49138b9ca56406bffaceb9f32c61442a1a18d3 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Mon, 6 Apr 2015 11:04:28 +0200 Subject: [PATCH] CLEANUP: lua: fix confusing local variable naming in hlua_txn_new() Struct hlua_txn is called "htxn" or "ht" everywhere, while here it's called "hs" which is the name used everywhere for struct "hlua_smp". Such confusion participate to the dangers of copy-pasting code, so let's fix the name here. --- src/hlua.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/hlua.c b/src/hlua.c index ad2c22ff9..f379691fa 100644 --- a/src/hlua.c +++ b/src/hlua.c @@ -3318,7 +3318,7 @@ __LJMP static int hlua_get_priv(lua_State *L) */ static int hlua_txn_new(lua_State *L, struct session *s, struct proxy *p, void *l7) { - struct hlua_txn *hs; + struct hlua_txn *htxn; /* Check stack size. */ if (!lua_checkstack(L, 3)) @@ -3330,34 +3330,34 @@ static int hlua_txn_new(lua_State *L, struct session *s, struct proxy *p, void * */ /* Create the object: obj[0] = userdata. */ lua_newtable(L); - hs = lua_newuserdata(L, sizeof(*hs)); + htxn = lua_newuserdata(L, sizeof(*htxn)); lua_rawseti(L, -2, 0); - hs->s = s; - hs->p = p; - hs->l7 = l7; + htxn->s = s; + htxn->p = p; + htxn->l7 = l7; /* Create the "f" field that contains a list of fetches. */ lua_pushstring(L, "f"); - if (!hlua_fetches_new(L, hs, 0)) + if (!hlua_fetches_new(L, htxn, 0)) return 0; lua_settable(L, -3); /* Create the "sf" field that contains a list of stringsafe fetches. */ lua_pushstring(L, "sf"); - if (!hlua_fetches_new(L, hs, 1)) + if (!hlua_fetches_new(L, htxn, 1)) return 0; lua_settable(L, -3); /* Create the "c" field that contains a list of converters. */ lua_pushstring(L, "c"); - if (!hlua_converters_new(L, hs, 0)) + if (!hlua_converters_new(L, htxn, 0)) return 0; lua_settable(L, -3); /* Create the "sc" field that contains a list of stringsafe converters. */ lua_pushstring(L, "sc"); - if (!hlua_converters_new(L, hs, 1)) + if (!hlua_converters_new(L, htxn, 1)) return 0; lua_settable(L, -3); @@ -3376,7 +3376,7 @@ static int hlua_txn_new(lua_State *L, struct session *s, struct proxy *p, void * /* Creates the HTTP object is the current proxy allows http. */ lua_pushstring(L, "http"); if (p->mode == PR_MODE_HTTP) { - if (!hlua_http_new(L, hs)) + if (!hlua_http_new(L, htxn)) return 0; } else