summaryrefslogtreecommitdiff
path: root/Src/Modules/langinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Modules/langinfo.c')
-rw-r--r--Src/Modules/langinfo.c30
1 files changed, 5 insertions, 25 deletions
diff --git a/Src/Modules/langinfo.c b/Src/Modules/langinfo.c
index 677440f52..10754e36c 100644
--- a/Src/Modules/langinfo.c
+++ b/Src/Modules/langinfo.c
@@ -417,9 +417,7 @@ createlihash()
return NULL;
pm->level = pm->old ? locallevel : 0;
- pm->gets.hfn = hashgetfn;
- pm->sets.hfn = hashsetfn;
- pm->unsetfn = stdunsetfn;
+ pm->gsu.h = &stdhash_gsu;
pm->u.hash = ht = newhashtable(7, langinfo_nam, NULL);
ht->hash = hasher;
@@ -447,19 +445,10 @@ getlanginfo(UNUSED(HashTable ht), char *name)
unmetafy(name, &len);
- pm = (Param) zhalloc(sizeof(struct param));
+ pm = (Param) hcalloc(sizeof(struct param));
pm->nam = dupstring(name);
pm->flags = PM_READONLY | PM_SCALAR;
- pm->sets.cfn = NULL;
- pm->gets.cfn = strgetfn;
- pm->sets.ifn = NULL;
- pm->gets.ifn = intgetfn;
- pm->unsetfn = NULL;
- pm->ct = 0;
- pm->env = NULL;
- pm->ename = NULL;
- pm->old = NULL;
- pm->level = 0;
+ pm->gsu.s = &nullsetscalar_gsu;
if(name)
elem = liitem(name);
@@ -486,17 +475,8 @@ scanlanginfo(UNUSED(HashTable ht), ScanFunc func, int flags)
char **element, *langstr;
nl_item *nlcode;
- pm = (Param) zhalloc(sizeof(struct param));
- pm->sets.cfn = NULL;
- pm->gets.cfn = strgetfn;
- pm->sets.ifn = NULL;
- pm->gets.ifn = intgetfn;
- pm->unsetfn = NULL;
- pm->ct = 0;
- pm->env = NULL;
- pm->ename = NULL;
- pm->old = NULL;
-
+ pm = (Param) hcalloc(sizeof(struct param));
+ pm->gsu.s = &nullsetscalar_gsu;
pm->flags = PM_READONLY | PM_SCALAR;
nlcode = &nl_vals[0];