Fix a number of msvc level 4 "Unreachable code" warnings by removing unneeded

return statements.

svn path=/trunk/; revision=35709
This commit is contained in:
Bill Meier 2011-01-30 22:32:25 +00:00
parent b0d7bf821c
commit 8a07e469f3
7 changed files with 6 additions and 21 deletions

View File

@ -263,7 +263,7 @@ static void basic_logger(const gchar *log_domain _U_,
static int wslua_panic(lua_State* LS) {
g_error("LUA PANIC: %s",lua_tostring(LS,-1));
return 0;
/** g_error() does an abort() and thus never returns **/
}
static void lua_load_plugins (const char *dirname)

View File

@ -424,7 +424,6 @@ WSLUA_METAMETHOD Field__call (lua_State* L) {
if (! lua_pinfo ) {
WSLUA_ERROR(Field__call,"Fields cannot be used outside dissectors or taps");
return 0;
}
for (;in;in = in->same_name_next) {

View File

@ -216,17 +216,14 @@ WSLUA_FUNCTION wslua_new_dialog(lua_State* L) { /* Pops up a new dialog */
if (! (title = luaL_checkstring(L,WSLUA_ARG_new_dialog_TITLE)) ) {
WSLUA_ARG_ERROR(new_dialog,TITLE,"Must be a string");
return 0;
}
if (! lua_isfunction(L,WSLUA_ARG_new_dialog_ACTION)) {
WSLUA_ARG_ERROR(new_dialog,ACTION,"Must be a function");
return 0;
}
if (top < 3) {
WSLUA_ERROR(new_dialog,"At least one field required");
return 0;
}

View File

@ -507,9 +507,7 @@ WSLUA_METAMETHOD Columns__newindex(lua_State *L) {
}
}
WSLUA_ARG_ERROR(Columns__newindex,COLUMN,"the column name must be a valid column");
return 0;
WSLUA_ARG_ERROR(Columns__newindex,COLUMN,"the column name must be a valid column");
}
WSLUA_METAMETHOD Columns_index(lua_State *L) {

View File

@ -388,7 +388,6 @@ WSLUA_METAMETHOD Prefs__index(lua_State* L) {
} while (( prefs_p = prefs_p->next ));
WSLUA_ARG_ERROR(Prefs__index,NAME,"no preference named like this");
WSLUA_RETURN(0);
}
WSLUA_META Prefs_meta[] = {
@ -605,10 +604,8 @@ WSLUA_CONSTRUCTOR ProtoField_new(lua_State* L) { /* Creates a new field to be us
f->type = get_ftenum(luaL_checkstring(L,WSLUA_ARG_ProtoField_new_TYPE));
/*XXX do it better*/
if (f->type == FT_NONE) {
if (f->type == FT_NONE)
WSLUA_ARG_ERROR(ProtoField_new,TYPE,"invalid FT_type");
return 0;
}
if (! lua_isnil(L,WSLUA_OPTARG_ProtoField_new_VOIDSTRING) ) {
if (f->type == FT_BOOLEAN) {
@ -1086,9 +1083,8 @@ WSLUA_CONSTRUCTOR Proto_new(lua_State* L) {
WSLUA_RETURN(1); /* The newly created protocol */
}
} else {
} else
WSLUA_ARG_ERROR(Proto_new,NAME,"must be a string");
}
return 0;
}

View File

@ -45,10 +45,8 @@ WSLUA_CONSTRUCTOR ByteArray_new(lua_State* L) { /* Creates a ByteArray Object */
if (lua_gettop(L) == 1) {
s = luaL_checkstring(L,WSLUA_OPTARG_ByteArray_new_HEXBYTES);
if (!s) {
if (!s)
WSLUA_OPTARG_ERROR(ByteArray_new,HEXBYTES,"must be a string");
return 0;
}
/* XXX: slow! */
for (; (c = *s); s++) {
@ -144,10 +142,8 @@ WSLUA_METHOD ByteArray_set_size(lua_State* L) {
guint8* padding;
if (!ba) return 0;
if (siz < 0) {
if (siz < 0)
WSLUA_ERROR(ByteArray_set_size,"ByteArray size must be non-negative");
return 0;
}
if (ba->len >= (guint)siz) { /* truncate */
g_byte_array_set_size(ba,siz);

View File

@ -287,7 +287,6 @@ WSLUA_CONSTRUCTOR Dir_open(lua_State* L) {
g_free(dir);
WSLUA_ARG_ERROR(Dir_open,PATHNAME,"could not open directory");
return 0;
}
pushDir(L,dir);