[asterisk-commits] seanbright: branch group/asterisk-cpp r169189 - /team/group/asterisk-cpp/pbx/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 17 14:56:45 CST 2009


Author: seanbright
Date: Sat Jan 17 14:56:45 2009
New Revision: 169189

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=169189
Log:
pbx_config compiles

Modified:
    team/group/asterisk-cpp/pbx/pbx_config.c

Modified: team/group/asterisk-cpp/pbx/pbx_config.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/pbx/pbx_config.c?view=diff&rev=169189&r1=169188&r2=169189
==============================================================================
--- team/group/asterisk-cpp/pbx/pbx_config.c (original)
+++ team/group/asterisk-cpp/pbx/pbx_config.c Sat Jan 17 14:56:45 2009
@@ -38,8 +38,8 @@
 #include "asterisk/channel.h"	/* AST_MAX_EXTENSION */
 #include "asterisk/callerid.h"
 
-static char *config = "extensions.conf";
-static char *registrar = "pbx_config";
+static const char *config = "extensions.conf";
+static const char *registrar = "pbx_config";
 static char userscontext[AST_MAX_EXTENSION] = "default";
 
 static int static_config = 0;
@@ -159,7 +159,7 @@
 	*ext = e;
 	c = strchr(e, '@');
 	if (c == NULL)	/* no context part */
-		*ctx = "";	/* it is not overwritten, anyways */
+		*ctx = (char *) "";	/* it is not overwritten, anyways */
 	else {	/* found context, check for duplicity ... */
 		*c++ = '\0';
 		*ctx = c;
@@ -901,7 +901,7 @@
 					} else
 						sep = cid = "";
 				
-					if (el && (snprintf(label, sizeof(label), "(%s)", el) != (strlen(el) + 2)))
+					if (el && (snprintf(label, sizeof(label), "(%s)", el) != (int) (strlen(el) + 2)))
 						incomplete = 1;	/* error encountered or label > 125 chars */
 					
 					fprintf(output, "exten => %s%s%s,%d%s,%s(%s)\n",
@@ -1032,7 +1032,7 @@
 				*app_data = '\0';
 				app_data++;
 			}
-		} else	
+		} else
 			app_data = NULL;
 	}
 
@@ -1040,7 +1040,7 @@
 		return CLI_SHOWUSAGE;
 
 	if (!app_data)
-		app_data="";
+		app_data = (char *) "";
 	if (ast_add_extension(a->argv[5], a->argc == 7 ? 1 : 0, exten, iprior, NULL, cidmatch, app,
 		(void *)strdup(app_data), ast_free_ptr, registrar)) {
 		switch (errno) {
@@ -1464,7 +1464,8 @@
 		for (v = ast_variable_browse(cfg, cxt); v; v = v->next) {
 			char *tc = NULL;
 			char realext[256] = "";
-			char *stringp, *ext;
+			char *stringp;
+			const char *ext;
 
 			if (!strncasecmp(v->name, "same", 4)) {
 				if (ast_strlen_zero(lastextension)) {
@@ -1476,9 +1477,9 @@
 					goto process_extension;
 				}
 			} else if (!strcasecmp(v->name, "exten")) {
-				int ipri = -2;
-				char *plus, *firstp;
-				char *pri, *appl, *data, *cidmatch;
+				int ipri;
+				char *plus, *firstp, *cidmatch;
+				const char *pri, *appl, *data;
 
 				if (!(stringp = tc = ast_strdup(v->value))) {
 					continue;
@@ -1488,13 +1489,14 @@
 				pbx_substitute_variables_helper(NULL, ext, realext, sizeof(realext) - 1);
 				ast_copy_string(lastextension, realext, sizeof(lastextension));
 process_extension:
+				ipri = -2;
 				if ((cidmatch = strchr(realext, '/'))) {
 					*cidmatch++ = '\0';
 					ast_shrink_phone_number(cidmatch);
 				}
 				pri = S_OR(strsep(&stringp, ","), "");
 				pri = ast_skip_blanks(pri);
-				pri = ast_trim_blanks(pri);
+				pri = ast_trim_blanks((char *) pri);
 				if ((label = strchr(pri, '('))) {
 					*label++ = '\0';
 					if ((end = strchr(label, ')'))) {
@@ -1590,7 +1592,8 @@
 				}
 			} else if (!strcasecmp(v->name, "switch") || !strcasecmp(v->name, "lswitch") || !strcasecmp(v->name, "eswitch")) {
 				char *stringp = realvalue;
-				char *appl, *data;
+				char *appl;
+				const char *data;
 				
 				if (!strcasecmp(v->name, "switch")) {
 					pbx_substitute_variables_helper(NULL, v->value, realvalue, sizeof(realvalue) - 1);
@@ -1611,9 +1614,9 @@
 	return 1;
 }
 
-static void append_interface(char *iface, int maxlen, char *add)
-{
-	int len = strlen(iface);
+static void append_interface(char *iface, size_t maxlen, char *add)
+{
+	size_t len = strlen(iface);
 	if (strlen(add) + len < maxlen - 2) {
 		if (strlen(iface)) {
 			iface[len] = '&';
@@ -1755,7 +1758,7 @@
 	return AST_MODULE_LOAD_SUCCESS;
 }
 
-static int load_module(void)
+static enum ast_module_load_result load_module(void)
 {
 	if (pbx_load_module())
 		return AST_MODULE_LOAD_DECLINE;
@@ -1775,7 +1778,7 @@
 }
 
 AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_DEFAULT, "Text Extension Configuration",
-		.load = load_module,
-		.unload = unload_module,
-		.reload = reload,
-	       );
+				load_module,
+				unload_module,
+				reload
+	);




More information about the asterisk-commits mailing list