From b3ef2e65c66f81b90bf71844ceee563abb57d279 Mon Sep 17 00:00:00 2001 From: Robert Spalek Date: Wed, 17 May 2006 11:15:30 +0200 Subject: [PATCH] shell/config: remove duplicate type_size() --- lib/shell/config.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/lib/shell/config.c b/lib/shell/config.c index 23954584..4a0910d1 100644 --- a/lib/shell/config.c +++ b/lib/shell/config.c @@ -20,6 +20,7 @@ #include "lib/lib.h" #include "lib/conf.h" #include "lib/getopt.h" +#include "lib/conf-internal.h" #include "lib/clists.h" #include "lib/mempool.h" #include "lib/chartype.h" @@ -330,19 +331,6 @@ generate_section(struct section *section) static bb_t path; -static uns -type_size(enum cf_type type) -{ - switch (type) - { - case CT_INT: return sizeof(int); - case CT_U64: return sizeof(u64); - case CT_DOUBLE: return sizeof(double); - case CT_STRING: return sizeof(byte *); - default: ASSERT(0); - } -} - static void dump_value(uns array, struct item *item, void *v) { @@ -406,7 +394,7 @@ dump_item(struct item *item, void *ptr, uns path_len) { val = *(void **)val; uns len = DARY_LEN(val); - uns size = type_size(item->cf.type); + uns size = cf_type_size(item->cf.type, NULL); for (uns i = 0; i < len; i++, val += size) dump_value(1, item, val); } -- 2.39.2