[asterisk-commits] twilson: branch twilson/config_work r366501 - in /team/twilson/config_work: i...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 14 17:41:01 CDT 2012


Author: twilson
Date: Mon May 14 17:40:57 2012
New Revision: 366501

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=366501
Log:
Fix some comments and use a more accurate variable name than "pretend" :-)

Modified:
    team/twilson/config_work/include/asterisk/config_options.h
    team/twilson/config_work/main/config_options.c

Modified: team/twilson/config_work/include/asterisk/config_options.h
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/include/asterisk/config_options.h?view=diff&rev=366501&r1=366500&r2=366501
==============================================================================
--- team/twilson/config_work/include/asterisk/config_options.h (original)
+++ team/twilson/config_work/include/asterisk/config_options.h Mon May 14 17:40:57 2012
@@ -116,7 +116,7 @@
 	regex_t *regex;
 	enum aco_category_op category_allow; /*!< Whether the following category regex is a whitelist or blacklist */
 	size_t cfg_offset;         /*!< The offset in the config snapshot for the global config or private config container */
-	size_t pvt_offset;         /*!< The index in the global object array for the private container */
+	size_t pvt_offset;         /*!< The offset in the config snapshot for the private container */
 	aco_type_alloc cfg_alloc; /*!< An allocation function for ao2 object associated with this type */
 
 	/* non-global callbacks */
@@ -145,7 +145,7 @@
 	struct ao2_container *opts; /*!< Internal use - options to parse */
 	aco_pre_apply_config pre_apply_config; /*!< A callback called after processing, but before changes are applied */
 	aco_snapshot_alloc snapshot_alloc;     /*!< Allocate an object to hold all global configs and private containers */
-	void *global_obj;         /*!< The global object array that hold the config object */
+	void *global_obj;         /*!< The global object array that holds the user-defined config object */
 	void *new_config;         /*!< Internal use - A cache of newly created config */
 	const char **preload;     /*!< Categories to parse first. Do something like char *arr[] = {"general", NULL}; and do .preload = arr */
 	struct aco_type *types[]; /*!< The list of types for this config. Required. Use a sentinel! */

Modified: team/twilson/config_work/main/config_options.c
URL: http://svnview.digium.com/svn/asterisk/team/twilson/config_work/main/config_options.c?view=diff&rev=366501&r1=366500&r2=366501
==============================================================================
--- team/twilson/config_work/main/config_options.c (original)
+++ team/twilson/config_work/main/config_options.c Mon May 14 17:40:57 2012
@@ -243,20 +243,21 @@
 
 	/* if type == GLOBAL_OBJ, set defaults and configure the cached cfg object */
 	if (obj->type == ACO_GLOBAL_OBJ && info->new_config + obj->cfg_offset) {
-		void **pretend = info->new_config + obj->cfg_offset;
-		if (aco_set_defaults(info->opts, cat, *pretend)) {
+		void **field = info->new_config + obj->cfg_offset;
+
+		if (aco_set_defaults(info->opts, cat, *field)) {
 			ast_log(LOG_ERROR, "In %s: Setting defaults for %s failed\n", info->filename, cat);
 			return -1;
 		}
-		if (aco_process_category_options(info->opts, cfg, cat, *pretend)) {
+		if (aco_process_category_options(info->opts, cfg, cat, *field)) {
 			ast_log(LOG_ERROR, "In %s: Processing options for %s failed\n", info->filename, cat);
 			return -1;
 		}
 	} else if (obj->type == ACO_PRIVATE_OBJ) {
-		void **pretend = info->new_config + obj->pvt_offset;
+		void **field = info->new_config + obj->pvt_offset;
 		/* If we've already linked a private for cat in newpvts, don't add a second one with the same name */
-		if (*pretend) {
-			if ((tmppvt = obj->find_pvt(*pretend, cat))) {
+		if (*field) {
+			if ((tmppvt = obj->find_pvt(*field, cat))) {
 				ast_log(LOG_ERROR, "In %s: Multiple definitions of %s!\n", info->filename, cat);
 				return -1;
 			}
@@ -296,12 +297,12 @@
 		}
 
 		/* We have a valid pvt/cfg, link 'em */
-		if (tmppvt && !ao2_link(*pretend, tmppvt)) {
+		if (tmppvt && !ao2_link(*field, tmppvt)) {
 			ast_log(LOG_ERROR, "In %s: Linking private for %s failed\n", info->filename, cat);
 			return -1;
 		}
-		pretend = info->new_config + obj->cfg_offset;
-		if (!ao2_link(*pretend, tmpcfg)) {
+		field = info->new_config + obj->cfg_offset;
+		if (!ao2_link(*field, tmpcfg)) {
 			ast_log(LOG_ERROR, "In %s: Linking config for %s failed\n", info->filename, cat);
 			return -1;
 		}




More information about the asterisk-commits mailing list