summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-01-04 02:29:36 -0600
committerJesse Luehrs <doy@tozt.net>2013-01-04 02:29:36 -0600
commitf3561afd6afb1f8524cb4f3986f464e9e6420b67 (patch)
tree753fc5a1dbef28f5faae29ba35779dc47bc508d6
parentb7924c9c88494859022597f01517d84df753cd81 (diff)
downloadpackage-stash-xs-f3561afd6afb1f8524cb4f3986f464e9e6420b67.tar.gz
package-stash-xs-f3561afd6afb1f8524cb4f3986f464e9e6420b67.zip
more error checking
-rw-r--r--XS.xs12
1 files changed, 12 insertions, 0 deletions
diff --git a/XS.xs b/XS.xs
index 84f89f7..52a2719 100644
--- a/XS.xs
+++ b/XS.xs
@@ -470,6 +470,9 @@ static void _add_symbol(SV *self, varspec_t variable, SV *initial)
case VAR_IO:
GvSetIO(glob, val);
break;
+ default:
+ croak("Unknown variable type in add_symbol");
+ break;
}
}
@@ -738,6 +741,8 @@ has_symbol(self, variable)
case VAR_IO:
RETVAL = GvIOOK(glob) ? 1 : 0;
break;
+ default:
+ croak("Unknown variable type in has_symbol");
}
}
else {
@@ -807,6 +812,9 @@ remove_symbol(self, variable)
case VAR_IO:
GvSetIO(glob, NULL);
break;
+ default:
+ croak("Unknown variable type in remove_symbol");
+ break;
}
}
else {
@@ -864,6 +872,8 @@ list_all_symbols(self, vartype=VAR_NONE)
if (GvIOOK(val))
mXPUSHp(key, len);
break;
+ default:
+ croak("Unknown variable type in list_all_symbols");
}
}
else if (vartype == VAR_CODE) {
@@ -919,6 +929,8 @@ get_all_symbols(self, vartype=VAR_NONE)
case VAR_NONE:
hv_store(ret, key, len, SvREFCNT_inc_simple_NN(val), 0);
break;
+ default:
+ croak("Unknown variable type in get_all_symbols");
}
}