From e1a55739f0637fc119068e371cfada70e56e3bf1 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Thu, 5 Mar 2009 04:30:15 +0000 Subject: [PATCH] update git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12442 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/include/switch_xml_config.h | 2 +- src/switch_xml_config.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/include/switch_xml_config.h b/src/include/switch_xml_config.h index 016aa42b53..2371c2df95 100644 --- a/src/include/switch_xml_config.h +++ b/src/include/switch_xml_config.h @@ -87,7 +87,7 @@ struct switch_xml_config_item { * \param options instrutions on how to parse the elements * \see switch_xml_config_item_t */ -switch_status_t switch_xml_config_parse(switch_xml_t xml, int reload, switch_xml_config_item_t *options); +SWITCH_DECLARE(switch_status_t) switch_xml_config_parse(switch_xml_t xml, int reload, switch_xml_config_item_t *instructions); #endif /* !defined(SWITCH_XML_CONFIG_H) */ diff --git a/src/switch_xml_config.c b/src/switch_xml_config.c index d05aef471f..02e9be1db2 100644 --- a/src/switch_xml_config.c +++ b/src/switch_xml_config.c @@ -77,13 +77,13 @@ SWITCH_DECLARE(switch_status_t) switch_xml_config_parse(switch_xml_t xml, int re case SWITCH_CONFIG_STRING: { switch_xml_config_string_options_t *string_options = (switch_xml_config_string_options_t*)item->data; - if (options->length > 0) { + if (string_options->length > 0) { /* We have a preallocated buffer */ char *dest = (char*)item->ptr; if (value) { switch_copy_string(dest, value, string_options->length); - } else if (options->defaultvalue){ - switch_copy_string(dest, value, string_options->length); + } else if (item->defaultvalue){ + switch_copy_string(dest, item->defaultvalue, string_options->length); } } else { char **dest = (char**)item->ptr; @@ -145,7 +145,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_config_parse(switch_xml_t xml, int re case SWITCH_CONFIG_FLAG: { int32_t *dest = (int32_t*)item->ptr; - int index = (int)item->data; + int index = (int)(intptr_t)item->data; if (value) { if (switch_true(value)) { *dest |= (1 << index); @@ -164,7 +164,7 @@ SWITCH_DECLARE(switch_status_t) switch_xml_config_parse(switch_xml_t xml, int re case SWITCH_CONFIG_FLAGARRAY: { int8_t *dest = (int8_t*)item->ptr; - int index = (int)item->data; + int index = (int)(intptr_t)item->data; if (value) { dest[index] = !!switch_true(value); } else {