[asterisk-commits] seanbright: branch group/asterisk-cpp r168458 - in /team/group/asterisk-cpp: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jan 11 18:48:12 CST 2009


Author: seanbright
Date: Sun Jan 11 18:48:12 2009
New Revision: 168458

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168458
Log:
features.c compiles

Modified:
    team/group/asterisk-cpp/README-cpp
    team/group/asterisk-cpp/main/features.c

Modified: team/group/asterisk-cpp/README-cpp
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/README-cpp?view=diff&rev=168458&r1=168457&r2=168458
==============================================================================
--- team/group/asterisk-cpp/README-cpp (original)
+++ team/group/asterisk-cpp/README-cpp Sun Jan 11 18:48:12 2009
@@ -2,7 +2,7 @@
 --- Assigned conversions
 ----------------------------------
 
-Objects left in main: channel.o pbx.o rtp.o srv.o features.o
+Objects left in main: channel.o pbx.o rtp.o srv.o
 
 mmichelson: done!
 russell: pbx.c, app.c (fix ast_app_option parsing functions)

Modified: team/group/asterisk-cpp/main/features.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/features.c?view=diff&rev=168458&r1=168457&r2=168458
==============================================================================
--- team/group/asterisk-cpp/main/features.c (original)
+++ team/group/asterisk-cpp/main/features.c Sun Jan 11 18:48:12 2009
@@ -507,6 +507,8 @@
 };
 
 struct ast_park_call_args {
+    ast_park_call_args(const char *channel_name = NULL) :
+        timeout(0), extout(NULL), orig_chan_name(NULL), return_con(NULL), return_ext(NULL), return_pri(0), flags(0) {}
 	/*! How long to wait in the parking lot before the call gets sent back
 	 *  to the specified return extension (or a best guess at where it came
 	 *  from if not explicitly specified). */
@@ -725,7 +727,7 @@
 /*! \brief Park a call */
 int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeout, int *extout)
 {
-	struct ast_park_call_args args = { 0, };
+	struct ast_park_call_args args;
 
 	args.timeout = timeout;
 	args.extout = extout;
@@ -763,7 +765,7 @@
 	}
 
 	{
-		struct ast_park_call_args args = { 0, };
+		struct ast_park_call_args args;
 
 		args.timeout = timeout;
 		args.extout = extout;
@@ -2887,9 +2889,7 @@
 
 	/* Park the call */
 	if (!res) {
-		struct ast_park_call_args args = {
-			.orig_chan_name = orig_chan_name,
-		};
+		struct ast_park_call_args args(orig_chan_name);
 		struct ast_flags flags = { 0 };
 
 		if (parse) {
@@ -3089,14 +3089,14 @@
 }
 
 /*! \brief Allocate parking lot structure */
-static struct ast_parkinglot *create_parkinglot(char *name)
+static struct ast_parkinglot *create_parkinglot(const char *name)
 {
 	struct ast_parkinglot *newlot = (struct ast_parkinglot *) NULL;
 
 	if (!name)
 		return NULL;
 
-	newlot = ao2_alloc(sizeof(*newlot), parkinglot_destroy);
+	newlot = (struct ast_parkinglot *) ao2_alloc(sizeof(*newlot), parkinglot_destroy);
 	if (!newlot)
 		return NULL;
 	
@@ -3108,7 +3108,7 @@
 /*! \brief Destroy a parking lot */
 static void parkinglot_destroy(void *obj)
 {
-	struct ast_parkinglot *ruin = obj;
+	struct ast_parkinglot *ruin = (struct ast_parkinglot *) obj;
 	struct ast_context *con;
 	con = ast_context_find(ruin->parking_con);
 	if (con)
@@ -3117,7 +3117,7 @@
 }
 
 /*! \brief Build parkinglot from configuration and chain it in */
-static struct ast_parkinglot *build_parkinglot(char *name, struct ast_variable *var)
+static struct ast_parkinglot *build_parkinglot(const char *name, struct ast_variable *var)
 {
 	struct ast_parkinglot *parkinglot;
 	struct ast_context *con = NULL;
@@ -3239,7 +3239,7 @@
 {
 	int start = 0, end = 0;
 	int res;
-	int i;
+	size_t i;
 	struct ast_context *con = NULL;
 	struct ast_config *cfg = NULL;
 	struct ast_variable *var = NULL;
@@ -3438,7 +3438,7 @@
 		}
 		AST_RWLIST_UNLOCK(&feature_list);
 				
-		if (!(feature = ast_calloc(1, sizeof(*feature))))
+		if (!(feature = (struct ast_call_feature *) ast_calloc(1, sizeof(*feature))))
 			continue;					
 
 		ast_copy_string(feature->sname, var->name, FEATURE_SNAME_LEN);
@@ -3562,7 +3562,7 @@
  */
 static char *handle_feature_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
-	int i;
+	unsigned int i;
 	struct ast_call_feature *feature;
 	struct ao2_iterator iter;
 	struct ast_parkinglot *curlot;
@@ -3606,7 +3606,7 @@
 	// loop through all the parking lots
 	iter = ao2_iterator_init(parkinglots, 0);
 
-	while ((curlot = ao2_iterator_next(&iter))) {
+	while ((curlot = (struct ast_parkinglot *) ao2_iterator_next(&iter))) {
 		ast_cli(a->fd, "\nCall parking (Parking lot: %s)\n", curlot->name);
 		ast_cli(a->fd, "------------\n");
 		ast_cli(a->fd,"%-22s:      %s\n", "Parking extension", parking_ext);
@@ -3766,7 +3766,7 @@
 	}
 
 	/* setup the bridge thread object and start the bridge */
-	if (!(tobj = ast_calloc(1, sizeof(*tobj)))) {
+	if (!(tobj = (struct ast_bridge_thread_obj *) ast_calloc(1, sizeof(*tobj)))) {
 		ast_log(LOG_WARNING, "Unable to spawn a new bridge thread on %s and %s: %s\n", tmpchana->name, tmpchanb->name, strerror(errno));
 		astman_send_error(s, m, "Unable to spawn a new bridge thread");
 		ast_hangup(tmpchana);
@@ -3828,7 +3828,7 @@
 		, "Context", "Extension", "Pri", "Timeout");
 
 	iter = ao2_iterator_init(parkinglots, 0);
-	while ((curlot = ao2_iterator_next(&iter))) {
+	while ((curlot = (struct ast_parkinglot *) ao2_iterator_next(&iter))) {
 		int lotparked = 0;
 		ast_cli(a->fd, "*** Parking lot: %s\n", curlot->name);
 
@@ -3881,7 +3881,7 @@
 	astman_send_ack(s, m, "Parked calls will follow");
 
 	iter = ao2_iterator_init(parkinglots, 0);
-	while ((curlot = ao2_iterator_next(&iter))) {
+	while ((curlot = (struct ast_parkinglot *) ao2_iterator_next(&iter))) {
 
 		AST_LIST_LOCK(&curlot->parkings);
 		AST_LIST_TRAVERSE(&curlot->parkings, cur, list) {
@@ -3983,7 +3983,7 @@
 }
 
 static int find_channel_by_group(struct ast_channel *c, void *data) {
-	struct ast_channel *chan = data;
+	struct ast_channel *chan = (struct ast_channel *) data;
 
 	return !c->pbx &&
 		/* Accessing 'chan' here is safe without locking, because there is no way for
@@ -4026,7 +4026,7 @@
 	return -1;
 }
 
-static char *app_bridge = "Bridge";
+static const char *app_bridge = "Bridge";
 
 enum {
 	BRIDGE_OPT_PLAYTONE = (1 << 0),
@@ -4057,7 +4057,7 @@
 		AST_APP_ARG(options);
 	);
 	
-	if (ast_strlen_zero(data)) {
+	if (ast_strlen_zero((const char *) data)) {
 		ast_log(LOG_WARNING, "Bridge require at least 1 argument specifying the other end of the bridge\n");
 		return -1;
 	}




More information about the asterisk-commits mailing list