aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Meier <wmeier@newsguy.com>2010-01-28 15:39:15 +0000
committerBill Meier <wmeier@newsguy.com>2010-01-28 15:39:15 +0000
commit9c4e559887ab16f9ddfe1e0b7efb84d8dcfebd31 (patch)
tree7eb731520d147eed2ac4e347d49bedfab88aedec
parentb3b101e606a6abe8dabd393848cb1f6c0fbd4c56 (diff)
downloadwireshark-9c4e559887ab16f9ddfe1e0b7efb84d8dcfebd31.tar.gz
wireshark-9c4e559887ab16f9ddfe1e0b7efb84d8dcfebd31.tar.bz2
wireshark-9c4e559887ab16f9ddfe1e0b7efb84d8dcfebd31.zip
Fix various gcc -Wshadow warnings.
svn path=/trunk/; revision=31716
-rw-r--r--epan/wslua/wslua.h18
-rw-r--r--epan/wslua/wslua_field.c4
-rw-r--r--epan/wslua/wslua_listener.c12
-rw-r--r--epan/wslua/wslua_proto.c50
-rw-r--r--epan/wslua/wslua_util.c12
5 files changed, 48 insertions, 48 deletions
diff --git a/epan/wslua/wslua.h b/epan/wslua/wslua.h
index ac72856d2b..d12847cb2b 100644
--- a/epan/wslua/wslua.h
+++ b/epan/wslua/wslua.h
@@ -246,15 +246,15 @@ typedef struct _wslua_dir* Dir;
* (a dummy typedef is used to be syntactically correct)
*/
#define WSLUA_CLASS_DEFINE(C,check_code,push_code) \
-C to##C(lua_State* L, int index) { \
- C* v = (C*)lua_touserdata (L, index); \
- if (!v) luaL_typerror(L,index,#C); \
+C to##C(lua_State* L, int idx) { \
+ C* v = (C*)lua_touserdata (L, idx); \
+ if (!v) luaL_typerror(L,idx,#C); \
return *v; \
} \
-C check##C(lua_State* L, int index) { \
+C check##C(lua_State* L, int idx) { \
C* p; \
- luaL_checktype(L,index,LUA_TUSERDATA); \
- p = (C*)luaL_checkudata(L, index, #C); \
+ luaL_checktype(L,idx,LUA_TUSERDATA); \
+ p = (C*)luaL_checkudata(L, idx, #C); \
check_code; \
return p ? *p : NULL; \
} \
@@ -343,7 +343,7 @@ typedef int dummy##C
#define WSLUA_API extern
#define NOP
-#define FAIL_ON_NULL(s) if (! *p) luaL_argerror(L,index,s)
+#define FAIL_ON_NULL(s) if (! *p) luaL_argerror(L,idx,s)
/* Clears or marks references that connects Lua to Wireshark structures */
#define CLEAR_OUTSTANDING(C, marker, marker_val) void clear_outstanding_##C(void) { \
@@ -360,8 +360,8 @@ typedef int dummy##C
#define WSLUA_CLASS_DECLARE(C) \
-extern C to##C(lua_State* L, int index); \
-extern C check##C(lua_State* L, int index); \
+extern C to##C(lua_State* L, int idx); \
+extern C check##C(lua_State* L, int idx); \
extern C* push##C(lua_State* L, C v); \
extern int C##_register(lua_State* L); \
extern gboolean is##C(lua_State* L,int i); \
diff --git a/epan/wslua/wslua_field.c b/epan/wslua/wslua_field.c
index 35530f25a3..e66f509f40 100644
--- a/epan/wslua/wslua_field.c
+++ b/epan/wslua/wslua_field.c
@@ -219,13 +219,13 @@ static int FieldInfo__index(lua_State* L) {
/*
Other attributes:
*/
- const gchar* index = luaL_checkstring(L,2);
+ const gchar* idx = luaL_checkstring(L,2);
const luaL_reg* r;
checkFieldInfo(L,1);
for (r = FieldInfo_get; r->name; r++) {
- if (g_str_equal(r->name, index)) {
+ if (g_str_equal(r->name, idx)) {
return r->func(L);
}
}
diff --git a/epan/wslua/wslua_listener.c b/epan/wslua/wslua_listener.c
index 181070e201..4819aad8b2 100644
--- a/epan/wslua/wslua_listener.c
+++ b/epan/wslua/wslua_listener.c
@@ -265,19 +265,19 @@ static int Listener_newindex(lua_State* L) {
function tap.reset(userdata) ... end
*/
Listener tap = shiftListener(L,1);
- const gchar* index = lua_shiftstring(L,1);
+ const gchar* idx = lua_shiftstring(L,1);
int* refp = NULL;
- if (!index) return 0;
+ if (!idx) return 0;
- if (g_str_equal(index,"packet")) {
+ if (g_str_equal(idx,"packet")) {
refp = &(tap->packet_ref);
- } else if (g_str_equal(index,"draw")) {
+ } else if (g_str_equal(idx,"draw")) {
refp = &(tap->draw_ref);
- } else if (g_str_equal(index,"reset")) {
+ } else if (g_str_equal(idx,"reset")) {
refp = &(tap->init_ref);
} else {
- luaL_error(L,"No such attribute `%s' for a tap",index);
+ luaL_error(L,"No such attribute `%s' for a tap",idx);
return 0;
}
diff --git a/epan/wslua/wslua_proto.c b/epan/wslua/wslua_proto.c
index ad7b279796..de52828e09 100644
--- a/epan/wslua/wslua_proto.c
+++ b/epan/wslua/wslua_proto.c
@@ -251,13 +251,13 @@ WSLUA_METAMETHOD Prefs__newindex(lua_State* L) {
#define WSLUA_ARG_Prefs__newindex_NAME 2 /* The abbreviation of this preference */
#define WSLUA_ARG_Prefs__newindex_PREF 3 /* A valid but still unassigned Pref object */
- Pref prefs = checkPrefs(L,1);
+ Pref prefs_p = checkPrefs(L,1);
const gchar* name = luaL_checkstring(L,WSLUA_ARG_Prefs__newindex_NAME);
Pref pref = checkPref(L,WSLUA_ARG_Prefs__newindex_PREF);
Pref p;
const gchar *c;
- if (! prefs ) return 0;
+ if (! prefs_p ) return 0;
if (! name )
WSLUA_ARG_ERROR(Prefs__newindex,NAME,"must be a string");
@@ -271,7 +271,7 @@ WSLUA_METAMETHOD Prefs__newindex(lua_State* L) {
if (pref->proto)
WSLUA_ARG_ERROR(Prefs__newindex,PREF,"cannot be added to more than one protocol");
- p = prefs;
+ p = prefs_p;
do {
if ( p->name && g_str_equal(p->name,name) ) {
@@ -299,21 +299,21 @@ WSLUA_METAMETHOD Prefs__newindex(lua_State* L) {
if (!pref->label)
pref->label = g_strdup(name);
- if (!prefs->proto->prefs_module) {
- prefs->proto->prefs_module = prefs_register_protocol(prefs->proto->hfid, NULL);
+ if (!prefs_p->proto->prefs_module) {
+ prefs_p->proto->prefs_module = prefs_register_protocol(prefs_p->proto->hfid, NULL);
}
switch(pref->type) {
case PREF_BOOL:
- prefs_register_bool_preference(prefs->proto->prefs_module,
+ prefs_register_bool_preference(prefs_p->proto->prefs_module,
pref->name,
pref->label,
pref->desc,
&(pref->value.b));
break;
case PREF_UINT:
- prefs_register_uint_preference(prefs->proto->prefs_module,
+ prefs_register_uint_preference(prefs_p->proto->prefs_module,
pref->name,
pref->label,
pref->desc,
@@ -321,14 +321,14 @@ WSLUA_METAMETHOD Prefs__newindex(lua_State* L) {
&(pref->value.u));
break;
case PREF_STRING:
- prefs_register_string_preference(prefs->proto->prefs_module,
+ prefs_register_string_preference(prefs_p->proto->prefs_module,
pref->name,
pref->label,
pref->desc,
&(pref->value.s));
break;
case PREF_ENUM:
- prefs_register_enum_preference(prefs->proto->prefs_module,
+ prefs_register_enum_preference(prefs_p->proto->prefs_module,
pref->name,
pref->label,
pref->desc,
@@ -337,7 +337,7 @@ WSLUA_METAMETHOD Prefs__newindex(lua_State* L) {
pref->info.enum_info.radio_buttons);
break;
case PREF_RANGE:
- prefs_register_range_preference(prefs->proto->prefs_module,
+ prefs_register_range_preference(prefs_p->proto->prefs_module,
pref->name,
pref->label,
pref->desc,
@@ -345,7 +345,7 @@ WSLUA_METAMETHOD Prefs__newindex(lua_State* L) {
pref->info.max_value);
break;
case PREF_STATIC_TEXT:
- prefs_register_static_text_preference(prefs->proto->prefs_module,
+ prefs_register_static_text_preference(prefs_p->proto->prefs_module,
pref->name,
pref->label,
pref->desc);
@@ -369,26 +369,26 @@ WSLUA_METAMETHOD Prefs__index(lua_State* L) {
/* Get the value of a preference setting */
#define WSLUA_ARG_Prefs__index_NAME 2 /* The abbreviation of this preference */
- Pref prefs = checkPrefs(L,1);
+ Pref prefs_p = checkPrefs(L,1);
const gchar* name = luaL_checkstring(L,WSLUA_ARG_Prefs__index_NAME);
- if (! ( name && prefs ) ) return 0;
+ if (! ( name && prefs_p ) ) return 0;
- prefs = prefs->next;
+ prefs_p = prefs_p->next;
do {
- if ( g_str_equal(prefs->name,name) ) {
- switch (prefs->type) {
- case PREF_BOOL: lua_pushboolean(L, prefs->value.b); break;
- case PREF_UINT: lua_pushnumber(L,(lua_Number)prefs->value.u); break;
- case PREF_STRING: lua_pushstring(L,prefs->value.s); break;
- case PREF_ENUM: lua_pushnumber(L,(lua_Number)prefs->value.e); break;
- case PREF_RANGE: lua_pushstring(L,range_convert_range(prefs->value.r)); break;
+ if ( g_str_equal(prefs_p->name,name) ) {
+ switch (prefs_p->type) {
+ case PREF_BOOL: lua_pushboolean(L, prefs_p->value.b); break;
+ case PREF_UINT: lua_pushnumber(L,(lua_Number)prefs_p->value.u); break;
+ case PREF_STRING: lua_pushstring(L,prefs_p->value.s); break;
+ case PREF_ENUM: lua_pushnumber(L,(lua_Number)prefs_p->value.e); break;
+ case PREF_RANGE: lua_pushstring(L,range_convert_range(prefs_p->value.r)); break;
default: WSLUA_ERROR(Prefs__index,"Unknow Pref type");
}
WSLUA_RETURN(1); /* The current value of the preference */
}
- } while (( prefs = prefs->next ));
+ } while (( prefs_p = prefs_p->next ));
WSLUA_ARG_ERROR(Prefs__index,NAME,"no preference named like this");
WSLUA_RETURN(0);
@@ -947,9 +947,9 @@ WSLUA_CONSTRUCTOR Proto_new(lua_State* L) {
const gchar* desc = luaL_checkstring(L,WSLUA_ARG_Proto_new_DESC);
if ( name ) {
- gchar* loname = ep_strdup(name);
- g_strdown(loname);
- if ( proto_get_id_by_filter_name(loname) > 0 ) {
+ gchar* loname_a = ep_strdup(name);
+ g_strdown(loname_a);
+ if ( proto_get_id_by_filter_name(loname_a) > 0 ) {
WSLUA_ARG_ERROR(Proto_new,NAME,"there cannot be two protocols with the same name");
} else {
Proto proto = g_malloc(sizeof(wslua_proto_t));
diff --git a/epan/wslua/wslua_util.c b/epan/wslua/wslua_util.c
index bc661676be..8ab47cf300 100644
--- a/epan/wslua/wslua_util.c
+++ b/epan/wslua/wslua_util.c
@@ -58,12 +58,12 @@ WSLUA_API const gchar* lua_shiftstring(lua_State* L, int i) {
WSLUA_FUNCTION wslua_format_date(lua_State* LS) { /* Formats an absolute timestamp into a human readable date */
#define WSLUA_ARG_format_date_TIMESTAMP 1 /* A timestamp value to convert. */
- lua_Number time = luaL_checknumber(LS,WSLUA_ARG_format_date_TIMESTAMP);
+ lua_Number timestamp = luaL_checknumber(LS,WSLUA_ARG_format_date_TIMESTAMP);
nstime_t then;
gchar* str;
- then.secs = (guint32)floor(time);
- then.nsecs = (guint32) ( (time-(double)(then.secs))*1000000000);
+ then.secs = (guint32)floor(timestamp);
+ then.nsecs = (guint32) ( (timestamp-(double)(then.secs))*1000000000);
str = abs_time_to_str(&then, FALSE);
lua_pushstring(LS,str);
@@ -72,12 +72,12 @@ WSLUA_FUNCTION wslua_format_date(lua_State* LS) { /* Formats an absolute timesta
WSLUA_FUNCTION wslua_format_time(lua_State* LS) { /* Formats a relative timestamp in a human readable form */
#define WSLUA_ARG_format_time_TIMESTAMP 1 /* A timestamp value to convert */
- lua_Number time = luaL_checknumber(LS,WSLUA_ARG_format_time_TIMESTAMP);
+ lua_Number timestamp = luaL_checknumber(LS,WSLUA_ARG_format_time_TIMESTAMP);
nstime_t then;
gchar* str;
- then.secs = (guint32)floor(time);
- then.nsecs = (guint32) ( (time-(double)(then.secs))*1000000000);
+ then.secs = (guint32)floor(timestamp);
+ then.nsecs = (guint32) ( (timestamp-(double)(then.secs))*1000000000);
str = rel_time_to_str(&then);
lua_pushstring(LS,str);