[svn-commits] twilson: branch twilson/bug_11520-datastore_dial_features r105462 - in /team/...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Feb 29 18:56:46 CST 2008


Author: twilson
Date: Fri Feb 29 18:56:45 2008
New Revision: 105462

URL: http://svn.digium.com/view/asterisk?view=rev&rev=105462
Log:
Merge in whitespace cleanups and suggestions by Kevin

Modified:
    team/twilson/bug_11520-datastore_dial_features/apps/app_dial.c
    team/twilson/bug_11520-datastore_dial_features/include/asterisk/app.h
    team/twilson/bug_11520-datastore_dial_features/main/app.c
    team/twilson/bug_11520-datastore_dial_features/main/features.c
    team/twilson/bug_11520-datastore_dial_features/main/global_datastores.c

Modified: team/twilson/bug_11520-datastore_dial_features/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/twilson/bug_11520-datastore_dial_features/apps/app_dial.c?view=diff&rev=105462&r1=105461&r2=105462
==============================================================================
--- team/twilson/bug_11520-datastore_dial_features/apps/app_dial.c (original)
+++ team/twilson/bug_11520-datastore_dial_features/apps/app_dial.c Fri Feb 29 18:56:45 2008
@@ -1212,13 +1212,13 @@
 {
 	struct ast_flags64 perm_opts = {.flags = 0};
 
-	ast_copy_flags64(&perm_opts, opts, 
-		OPT_CALLER_TRANSFER | OPT_CALLER_PARK | OPT_CALLER_MONITOR | OPT_CALLER_MIXMONITOR | OPT_CALLER_HANGUP | 
+	ast_copy_flags64(&perm_opts, opts,
+		OPT_CALLER_TRANSFER | OPT_CALLER_PARK | OPT_CALLER_MONITOR | OPT_CALLER_MIXMONITOR | OPT_CALLER_HANGUP |
 		OPT_CALLEE_TRANSFER | OPT_CALLEE_PARK | OPT_CALLEE_MONITOR | OPT_CALLEE_MIXMONITOR | OPT_CALLEE_HANGUP);
 
 	memset(features->options, 0, sizeof(features->options));
 
-	ast_app_options2str64(dial_exec_options, &perm_opts, features->options, sizeof(features->options)); 
+	ast_app_options2str64(dial_exec_options, &perm_opts, features->options, sizeof(features->options));
 }
 
 static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags64 *peerflags, int *continue_exec)
@@ -1335,7 +1335,7 @@
 
 	/* Create datastore for channel dial features for caller */
 	if (!(ds_caller_features = ast_channel_datastore_alloc(&dial_features_info, NULL))) {
-		ast_log(LOG_WARNING, "Unable to create channel datastore for dial features. Aborting!\n"); 
+		ast_log(LOG_WARNING, "Unable to create channel datastore for dial features. Aborting!\n");
 		goto out;
 	}
 
@@ -1508,7 +1508,7 @@
 
 		/* Save callee features */
 		if (!(ds_callee_features = ast_channel_datastore_alloc(&dial_features_info, NULL))) {
-			ast_log(LOG_WARNING, "Unable to create channel datastore for dial features. Aborting!\n"); 
+			ast_log(LOG_WARNING, "Unable to create channel datastore for dial features. Aborting!\n");
 			ast_free(tmp);
 			goto out;
 		}

Modified: team/twilson/bug_11520-datastore_dial_features/include/asterisk/app.h
URL: http://svn.digium.com/view/asterisk/team/twilson/bug_11520-datastore_dial_features/include/asterisk/app.h?view=diff&rev=105462&r1=105461&r2=105462
==============================================================================
--- team/twilson/bug_11520-datastore_dial_features/include/asterisk/app.h (original)
+++ team/twilson/bug_11520-datastore_dial_features/include/asterisk/app.h Fri Feb 29 18:56:45 2008
@@ -469,8 +469,8 @@
 */
 void ast_app_options2str64(const struct ast_app_option *options, struct ast_flags64 *flags, char *buf, size_t len);
 
-/*! \brief Present a dialtone and collect a certain length extension. 
-    \return Returns 1 on valid extension entered, -1 on hangup, or 0 on invalid extension. 
+/*! \brief Present a dialtone and collect a certain length extension.
+    \return Returns 1 on valid extension entered, -1 on hangup, or 0 on invalid extension.
 \note Note that if 'collect' holds digits already, new digits will be appended, so be sure it's initialized properly */
 int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect, size_t size, int maxlen, int timeout);
 

Modified: team/twilson/bug_11520-datastore_dial_features/main/app.c
URL: http://svn.digium.com/view/asterisk/team/twilson/bug_11520-datastore_dial_features/main/app.c?view=diff&rev=105462&r1=105461&r2=105462
==============================================================================
--- team/twilson/bug_11520-datastore_dial_features/main/app.c (original)
+++ team/twilson/bug_11520-datastore_dial_features/main/app.c Fri Feb 29 18:56:45 2008
@@ -1673,11 +1673,12 @@
 void ast_app_options2str64(const struct ast_app_option *options, struct ast_flags64 *flags, char *buf, size_t len)
 {
 	unsigned int i, found = 0;
-	for (i =32; i < 128 && found < len; i++) {
+	for (i = 32; i < 128 && found < len; i++) {
 		if (ast_test_flag64(flags, options[i].flag)) {
 			buf[found++] = i;
 		}
 	}
+	buf[found] = '\0';
 }
 
 int ast_get_encoded_char(const char *stream, char *result, size_t *consumed)

Modified: team/twilson/bug_11520-datastore_dial_features/main/features.c
URL: http://svn.digium.com/view/asterisk/team/twilson/bug_11520-datastore_dial_features/main/features.c?view=diff&rev=105462&r1=105461&r2=105462
==============================================================================
--- team/twilson/bug_11520-datastore_dial_features/main/features.c (original)
+++ team/twilson/bug_11520-datastore_dial_features/main/features.c Fri Feb 29 18:56:45 2008
@@ -1695,7 +1695,7 @@
 	struct ast_channel *monitor_chans[2];
 	struct ast_channel *active_channel;
 	int res = 0, ready = 0;
-	
+
 	if ((chan = ast_request(type, format, data, &cause))) {
 		ast_set_callerid(chan, cid_num, cid_name, cid_num);
 		ast_channel_inherit_variables(caller, chan);
@@ -2234,7 +2234,7 @@
 						char returnexten[AST_MAX_EXTENSION];
 						struct ast_datastore *features_datastore;
 						struct ast_dial_features *dialfeatures = NULL;
-		
+
 						ast_channel_lock(chan);
 
 						if ((features_datastore = ast_channel_datastore_find(chan, &dial_features_info, NULL)))
@@ -2249,7 +2249,7 @@
 
 						ast_add_extension2(con, 1, peername_flat, 1, NULL, NULL, "Dial", ast_strdup(returnexten), ast_free_ptr, registrar);
 					}
-					if (comebacktoorigin) { 
+					if (comebacktoorigin) {
 						set_c_e_p(chan, parking_con_dial, peername_flat, 1);
 					} else {
 						ast_log(LOG_WARNING, "now going to parkedcallstimeout,s,1 | ps is %d\n",pu->parkingnum);

Modified: team/twilson/bug_11520-datastore_dial_features/main/global_datastores.c
URL: http://svn.digium.com/view/asterisk/team/twilson/bug_11520-datastore_dial_features/main/global_datastores.c?view=diff&rev=105462&r1=105461&r2=105462
==============================================================================
--- team/twilson/bug_11520-datastore_dial_features/main/global_datastores.c (original)
+++ team/twilson/bug_11520-datastore_dial_features/main/global_datastores.c Fri Feb 29 18:56:45 2008
@@ -35,8 +35,9 @@
 	struct ast_dialed_interface *di = NULL;
 	AST_LIST_HEAD(, ast_dialed_interface) *dialed_interface_list = data;
 	
-	if (!dialed_interface_list)
+	if (!dialed_interface_list) {
 		return;
+	}
 
 	AST_LIST_LOCK(dialed_interface_list);
 	while ((di = AST_LIST_REMOVE_HEAD(dialed_interface_list, list)))
@@ -53,11 +54,13 @@
 	AST_LIST_HEAD(, ast_dialed_interface) *old_list;
 	AST_LIST_HEAD(, ast_dialed_interface) *new_list = NULL;
 
-	if(!(old_list = data))
+	if(!(old_list = data)) {
 		return NULL;
+	}
 
-	if(!(new_list = ast_calloc(1, sizeof(*new_list))))
+	if(!(new_list = ast_calloc(1, sizeof(*new_list)))) {
 		return NULL;
+	}
 
 	AST_LIST_HEAD_INIT(new_list);
 	AST_LIST_LOCK(old_list);
@@ -81,8 +84,9 @@
 {
 	struct ast_dial_features *df = data, *df_copy;
 
-	if (!(df_copy = ast_calloc(1, sizeof(*df))))
+	if (!(df_copy = ast_calloc(1, sizeof(*df)))) {
 		return NULL;
+	}
 
 	memcpy(df_copy, df, sizeof(*df));
 
@@ -91,18 +95,19 @@
 
 static void dial_features_destroy(void *data) {
 	struct ast_dial_features *df = data;
-	if (df)
+	if (df) {
 		ast_free(df);
+	}
 }
 
 const struct ast_datastore_info dialed_interface_info = {
-	.type ="dialed-interface",
+	.type = "dialed-interface",
 	.destroy = dialed_interface_destroy,
 	.duplicate = dialed_interface_duplicate,
 };
 
 const struct ast_datastore_info dial_features_info = {
-	.type="dial-features",
+	.type = "dial-features",
 	.destroy = dial_features_destroy,
 	.duplicate = dial_features_duplicate,
 };




More information about the svn-commits mailing list