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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Jan 11 19:47:00 CST 2009


Author: seanbright
Date: Sun Jan 11 19:47:00 2009
New Revision: 168460

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168460
Log:
Get srv.c to compile (this required making some changes to linkedlists.h and other consumers of that include as well)

Modified:
    team/group/asterisk-cpp/README-cpp
    team/group/asterisk-cpp/include/asterisk/channel.h
    team/group/asterisk-cpp/include/asterisk/indications.h
    team/group/asterisk-cpp/include/asterisk/linkedlists.h
    team/group/asterisk-cpp/include/asterisk/slinfactory.h
    team/group/asterisk-cpp/main/audiohook.c
    team/group/asterisk-cpp/main/autoservice.c
    team/group/asterisk-cpp/main/devicestate.c
    team/group/asterisk-cpp/main/event.c
    team/group/asterisk-cpp/main/features.c
    team/group/asterisk-cpp/main/sched.c
    team/group/asterisk-cpp/main/srv.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=168460&r1=168459&r2=168460
==============================================================================
--- team/group/asterisk-cpp/README-cpp (original)
+++ team/group/asterisk-cpp/README-cpp Sun Jan 11 19:47:00 2009
@@ -2,11 +2,11 @@
 --- Assigned conversions
 ----------------------------------
 
-Objects left in main: channel.o pbx.o rtp.o srv.o
+Objects left in main: channel.o pbx.o rtp.o
 
-mmichelson: done!
-russell: pbx.c, app.c (fix ast_app_option parsing functions)
-seanbright: srv.c, channel.c
+mmichelson: done! (for now, maybe.)
+russell: pbx.c
+seanbright: channel.c
 
 ----------------------------------
 ----------------------------------

Modified: team/group/asterisk-cpp/include/asterisk/channel.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/channel.h?view=diff&rev=168460&r1=168459&r2=168460
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/channel.h (original)
+++ team/group/asterisk-cpp/include/asterisk/channel.h Sun Jan 11 19:47:00 2009
@@ -446,7 +446,7 @@
 	struct varshead varshead;			/*!< A linked list for channel variables. See \ref AstChanVar */
 	ast_group_t callgroup;				/*!< Call group for call pickups */
 	ast_group_t pickupgroup;			/*!< Pickup group - which calls groups can be picked up? */
-	AST_LIST_HEAD_NOLOCK(, ast_frame) readq;
+	AST_LIST_HEAD_NOLOCK(frame_read_queue, ast_frame) readq;
 	AST_LIST_ENTRY(ast_channel) chan_list;		/*!< For easy linking */
 	struct ast_jb jb;				/*!< The jitterbuffer state */
 	struct timeval dtmf_tv;				/*!< The time that an in process digit began, or the last digit ended */

Modified: team/group/asterisk-cpp/include/asterisk/indications.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/indications.h?view=diff&rev=168460&r1=168459&r2=168460
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/indications.h (original)
+++ team/group/asterisk-cpp/include/asterisk/indications.h Sun Jan 11 19:47:00 2009
@@ -52,7 +52,7 @@
 	char description[40];				/*!< Description */
 	int  nrringcadence;				/*!< # registered ringcadence elements */
 	int *ringcadence;				/*!< Ring cadence */
-	AST_LIST_HEAD_NOLOCK(, ind_tone_zone_sound) tones;		/*!< The known tones for this zone */
+	AST_LIST_HEAD_NOLOCK(known_tones, ind_tone_zone_sound) tones;		/*!< The known tones for this zone */
 };
 
 /*! \brief set the default tone country */

Modified: team/group/asterisk-cpp/include/asterisk/linkedlists.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/linkedlists.h?view=diff&rev=168460&r1=168459&r2=168460
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/linkedlists.h (original)
+++ team/group/asterisk-cpp/include/asterisk/linkedlists.h Sun Jan 11 19:47:00 2009
@@ -194,6 +194,7 @@
 */
 #define AST_LIST_HEAD_NOLOCK(name, type)				\
 struct name {								\
+    name() : first(NULL), last(NULL) {}     \
 	struct type *first;						\
 	struct type *last;						\
 }

Modified: team/group/asterisk-cpp/include/asterisk/slinfactory.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/slinfactory.h?view=diff&rev=168460&r1=168459&r2=168460
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/slinfactory.h (original)
+++ team/group/asterisk-cpp/include/asterisk/slinfactory.h Sun Jan 11 19:47:00 2009
@@ -27,7 +27,7 @@
 #define AST_SLINFACTORY_MAX_HOLD 1280
 
 struct ast_slinfactory {
-	AST_LIST_HEAD_NOLOCK(, ast_frame) queue; /*!< A list of unaltered frames */
+	AST_LIST_HEAD_NOLOCK(frame_queue, ast_frame) queue; /*!< A list of unaltered frames */
 	struct ast_trans_pvt *trans;             /*!< Translation path that converts fed frames into signed linear */
 	short hold[AST_SLINFACTORY_MAX_HOLD];    /*!< Hold for audio that no longer belongs to a frame (ie: if only some samples were taken from a frame) */
 	short *offset;                           /*!< Offset into the hold where audio begins */

Modified: team/group/asterisk-cpp/main/audiohook.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/audiohook.c?view=diff&rev=168460&r1=168459&r2=168460
==============================================================================
--- team/group/asterisk-cpp/main/audiohook.c (original)
+++ team/group/asterisk-cpp/main/audiohook.c Sun Jan 11 19:47:00 2009
@@ -43,12 +43,14 @@
 	int format;
 };
 
+AST_LIST_HEAD_NOLOCK(hook_list, ast_audiohook);
+
 struct ast_audiohook_list {
 	struct ast_audiohook_translate in_translate[2];
 	struct ast_audiohook_translate out_translate[2];
-	AST_LIST_HEAD_NOLOCK(, ast_audiohook) spy_list;
-	AST_LIST_HEAD_NOLOCK(, ast_audiohook) whisper_list;
-	AST_LIST_HEAD_NOLOCK(, ast_audiohook) manipulate_list;
+    struct hook_list spy_list;
+    struct hook_list whisper_list;
+    struct hook_list manipulate_list;
 };
 
 /*! \brief Initialize an audiohook structure

Modified: team/group/asterisk-cpp/main/autoservice.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/autoservice.c?view=diff&rev=168460&r1=168459&r2=168460
==============================================================================
--- team/group/asterisk-cpp/main/autoservice.c (original)
+++ team/group/asterisk-cpp/main/autoservice.c Sun Jan 11 19:47:00 2009
@@ -59,7 +59,7 @@
 	/*! Frames go on at the head of deferred_frames, so we have the frames
 	 *  from newest to oldest.  As we put them at the head of the readq, we'll
 	 *  end up with them in the right order for the channel's readq. */
-	AST_LIST_HEAD_NOLOCK(, ast_frame) deferred_frames;
+	AST_LIST_HEAD_NOLOCK(deferred_frames_list, ast_frame) deferred_frames;
 	AST_LIST_ENTRY(asent) list;
 };
 

Modified: team/group/asterisk-cpp/main/devicestate.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/devicestate.c?view=diff&rev=168460&r1=168459&r2=168460
==============================================================================
--- team/group/asterisk-cpp/main/devicestate.c (original)
+++ team/group/asterisk-cpp/main/devicestate.c Sun Jan 11 19:47:00 2009
@@ -196,7 +196,7 @@
 	struct ast_event_sub *event_sub;
 	ast_cond_t cond;
 	ast_mutex_t lock;
-	AST_LIST_HEAD_NOLOCK(, devstate_change) devstate_change_q;
+	AST_LIST_HEAD_NOLOCK(devstate_change_queue, devstate_change) devstate_change_q;
 } devstate_collector;
 
 /* Forward declarations */

Modified: team/group/asterisk-cpp/main/event.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/event.c?view=diff&rev=168460&r1=168459&r2=168460
==============================================================================
--- team/group/asterisk-cpp/main/event.c (original)
+++ team/group/asterisk-cpp/main/event.c Sun Jan 11 19:47:00 2009
@@ -97,7 +97,7 @@
 	ast_event_cb_t cb;
 	void *userdata;
 	uint32_t uniqueid;
-	AST_LIST_HEAD_NOLOCK(, ast_event_ie_val) ie_vals;
+	AST_LIST_HEAD_NOLOCK(ie_vals_list, ast_event_ie_val) ie_vals;
 	AST_RWDLLIST_ENTRY(ast_event_sub) entry;
 };
 

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=168460&r1=168459&r2=168460
==============================================================================
--- team/group/asterisk-cpp/main/features.c (original)
+++ team/group/asterisk-cpp/main/features.c Sun Jan 11 19:47:00 2009
@@ -180,7 +180,7 @@
 	AST_DECLARE_STRING_FIELDS(
 		AST_STRING_FIELD(gname);
 	);
-	AST_LIST_HEAD_NOLOCK(, feature_group_exten) features;
+	AST_LIST_HEAD_NOLOCK(features_list, feature_group_exten) features;
 };
 
 static AST_RWLIST_HEAD_STATIC(feature_groups, feature_group);

Modified: team/group/asterisk-cpp/main/sched.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/sched.c?view=diff&rev=168460&r1=168459&r2=168460
==============================================================================
--- team/group/asterisk-cpp/main/sched.c (original)
+++ team/group/asterisk-cpp/main/sched.c Sun Jan 11 19:47:00 2009
@@ -65,7 +65,7 @@
 	struct ast_hashtab *schedq_ht;             /*!< hash table for fast searching */
 
 #ifdef SCHED_MAX_CACHE
-	AST_LIST_HEAD_NOLOCK(, sched) schedc;   /*!< Cache of unused schedule structures and how many */
+	AST_LIST_HEAD_NOLOCK(schedule_cache, sched) schedc;   /*!< Cache of unused schedule structures and how many */
 	unsigned int schedccnt;
 #endif
 };

Modified: team/group/asterisk-cpp/main/srv.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/srv.c?view=diff&rev=168460&r1=168459&r2=168460
==============================================================================
--- team/group/asterisk-cpp/main/srv.c (original)
+++ team/group/asterisk-cpp/main/srv.c Sun Jan 11 19:47:00 2009
@@ -62,9 +62,13 @@
 	char host[1];
 };
 
+/*! define dialed_interfaces type */
+AST_LIST_HEAD_NOLOCK(srv_entries, srv_entry);
+
 struct srv_context {
+    srv_context() : have_weights(0) {}
 	unsigned int have_weights:1;
-	AST_LIST_HEAD_NOLOCK(srv_entries, srv_entry) entries;
+    struct srv_entries entries;
 };
 
 static int parse_srv(unsigned char *answer, int len, unsigned char *msg, struct srv_entry **result)
@@ -79,7 +83,7 @@
 	char repl[256] = "";
 	struct srv_entry *entry;
 
-	if (len < sizeof(*srv))
+	if (len < (int) sizeof(*srv))
 		return -1;
 
 	answer += sizeof(*srv);
@@ -95,7 +99,7 @@
 	if (!strcmp(repl, "."))
 		return -1;
 
-	if (!(entry = ast_calloc(1, sizeof(*entry) + strlen(repl))))
+	if (!(entry = (struct srv_entry *) ast_calloc(1, sizeof(*entry) + strlen(repl))))
 		return -1;
 	
 	entry->priority = ntohs(srv->priority);
@@ -148,13 +152,13 @@
 static void process_weights(struct srv_context *context)
 {
 	struct srv_entry *current;
-	struct srv_entries newlist = AST_LIST_HEAD_NOLOCK_INIT_VALUE;
+	struct srv_entries newlist;
 
 	while (AST_LIST_FIRST(&context->entries)) {
 		unsigned int random_weight;
 		unsigned int weight_sum;
 		unsigned short cur_priority = AST_LIST_FIRST(&context->entries)->priority;
-		struct srv_entries temp_list = AST_LIST_HEAD_NOLOCK_INIT_VALUE;
+		struct srv_entries temp_list;
 		weight_sum = 0;
 
 		AST_LIST_TRAVERSE_SAFE_BEGIN(&context->entries, current, list) {
@@ -199,7 +203,7 @@
 
 int ast_get_srv(struct ast_channel *chan, char *host, int hostlen, int *port, const char *service)
 {
-	struct srv_context context = { .entries = AST_LIST_HEAD_NOLOCK_INIT_VALUE };
+	struct srv_context context;
 	struct srv_entry *current;
 	int ret;
 




More information about the asterisk-commits mailing list