From bf460ff3ce8c2e4bff5d7d8cf171f535a116e431 Mon Sep 17 00:00:00 2001 From: Florian Ragwitz Date: Mon, 2 May 2011 22:21:41 +0200 Subject: Make helper functions static Avoid pollution namespaces and others abusing this C API we accidentally exposed. --- XS.xs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'XS.xs') diff --git a/XS.xs b/XS.xs index a36fd67..fc3078a 100644 --- a/XS.xs +++ b/XS.xs @@ -103,7 +103,7 @@ typedef struct { static U32 name_hash, namespace_hash, type_hash; static SV *name_key, *namespace_key, *type_key; -const char *vartype_to_string(vartype_t type) +static const char *vartype_to_string(vartype_t type) { switch (type) { case VAR_SCALAR: @@ -121,7 +121,7 @@ const char *vartype_to_string(vartype_t type) } } -I32 vartype_to_svtype(vartype_t type) +static I32 vartype_to_svtype(vartype_t type) { switch (type) { case VAR_SCALAR: @@ -139,7 +139,7 @@ I32 vartype_to_svtype(vartype_t type) } } -vartype_t string_to_vartype(char *vartype) +static vartype_t string_to_vartype(char *vartype) { if (strEQ(vartype, "SCALAR")) { return VAR_SCALAR; @@ -161,7 +161,7 @@ vartype_t string_to_vartype(char *vartype) } } -void _deconstruct_variable_name(SV *variable, varspec_t *varspec) +static void _deconstruct_variable_name(SV *variable, varspec_t *varspec) { char *varpv; @@ -194,7 +194,7 @@ void _deconstruct_variable_name(SV *variable, varspec_t *varspec) } } -void _deconstruct_variable_hash(HV *variable, varspec_t *varspec) +static void _deconstruct_variable_hash(HV *variable, varspec_t *varspec) { HE *val; @@ -211,7 +211,7 @@ void _deconstruct_variable_hash(HV *variable, varspec_t *varspec) varspec->type = string_to_vartype(SvPV_nolen(HeVAL(val))); } -int _valid_for_type(SV *value, vartype_t type) +static int _valid_for_type(SV *value, vartype_t type) { svtype sv_type = SvROK(value) ? SvTYPE(SvRV(value)) : SVt_NULL; @@ -235,7 +235,7 @@ int _valid_for_type(SV *value, vartype_t type) } } -HV *_get_namespace(SV *self) +static HV *_get_namespace(SV *self) { dSP; SV *ret; @@ -253,7 +253,7 @@ HV *_get_namespace(SV *self) return (HV*)SvRV(ret); } -SV *_get_name(SV *self) +static SV *_get_name(SV *self) { dSP; SV *ret; @@ -271,7 +271,7 @@ SV *_get_name(SV *self) return ret; } -void _expand_glob(SV *self, SV *varname) +static void _expand_glob(SV *self, SV *varname) { SV *name; @@ -285,7 +285,7 @@ void _expand_glob(SV *self, SV *varname) SvREFCNT_dec(name); } -SV *_get_symbol(SV *self, varspec_t *variable, int vivify) +static SV *_get_symbol(SV *self, varspec_t *variable, int vivify) { HV *namespace; HE *entry; -- cgit v1.2.3-54-g00ecf