[asterisk-commits] seanbright: branch group/asterisk-cpp r168435 - /team/group/asterisk-cpp/main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sat Jan 10 23:06:12 CST 2009


Author: seanbright
Date: Sat Jan 10 23:06:12 2009
New Revision: 168435

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168435
Log:
datastore.c and taskprocessor.c

Modified:
    team/group/asterisk-cpp/main/datastore.c
    team/group/asterisk-cpp/main/taskprocessor.c

Modified: team/group/asterisk-cpp/main/datastore.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/datastore.c?view=diff&rev=168435&r1=168434&r2=168435
==============================================================================
--- team/group/asterisk-cpp/main/datastore.c (original)
+++ team/group/asterisk-cpp/main/datastore.c Sat Jan 10 23:06:12 2009
@@ -38,7 +38,7 @@
 	}
 
 	/* Allocate memory for datastore and clear it */
-	datastore = ast_calloc(1, sizeof(*datastore));
+	datastore = (struct ast_datastore *) ast_calloc(1, sizeof(*datastore));
 	if (!datastore) {
 		return NULL;
 	}

Modified: team/group/asterisk-cpp/main/taskprocessor.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/taskprocessor.c?view=diff&rev=168435&r1=168434&r2=168435
==============================================================================
--- team/group/asterisk-cpp/main/taskprocessor.c (original)
+++ team/group/asterisk-cpp/main/taskprocessor.c Sat Jan 10 23:06:12 2009
@@ -136,7 +136,7 @@
 static struct tps_task *tps_task_alloc(int (*task_exe)(void *datap), void *datap)
 {
 	struct tps_task *t;
-	if ((t = ast_calloc(1, sizeof(*t)))) {
+	if ((t = (struct tps_task *) ast_calloc(1, sizeof(*t)))) {
 		t->execute = task_exe;
 		t->datap = datap;
 	}
@@ -165,7 +165,7 @@
 
 	tklen = strlen(a->word);
 	i = ao2_iterator_init(tps_singletons, 0);
-	while ((p = ao2_iterator_next(&i))) {
+	while ((p = (struct ast_taskprocessor *) ao2_iterator_next(&i))) {
 		if (!strncasecmp(a->word, p->name, tklen) && ++wordnum > a->n) {
 			name = ast_strdup(p->name);
 			ao2_ref(p, -1);
@@ -258,7 +258,7 @@
 
 	ast_cli(a->fd, "\n\t+----- Processor -----+--- Processed ---+- In Queue -+- Max Depth -+");
 	i = ao2_iterator_init(tps_singletons, 0);
-	while ((p = ao2_iterator_next(&i))) {
+	while ((p = (struct ast_taskprocessor *) ao2_iterator_next(&i))) {
 		ast_copy_string(name, p->name, sizeof(name));
 		qsize = p->tps_queue_size;
 		maxqsize = p->stats->max_qsize;
@@ -274,9 +274,9 @@
 /* this is the task processing worker function */
 static void *tps_processing_function(void *data)
 {
-	struct ast_taskprocessor *i = data;
+	struct ast_taskprocessor *i = (struct ast_taskprocessor *) data;
 	struct tps_task *t;
-	int size;
+	size_t size;
 
 	if (!i) {
 		ast_log(LOG_ERROR, "cannot start thread_function loop without a ast_taskprocessor structure.\n");
@@ -329,7 +329,7 @@
 /* hash callback for astobj2 */
 static int tps_hash_cb(const void *obj, const int flags)
 {
-	const struct ast_taskprocessor *tps = obj;
+	const struct ast_taskprocessor *tps = (struct ast_taskprocessor *) obj;
 
 	return ast_str_case_hash(tps->name);
 }
@@ -337,7 +337,9 @@
 /* compare callback for astobj2 */
 static int tps_cmp_cb(void *obj, void *arg, int flags)
 {
-	struct ast_taskprocessor *lhs = obj, *rhs = arg;
+	struct ast_taskprocessor
+        *lhs = (struct ast_taskprocessor *) obj,
+        *rhs = (struct ast_taskprocessor *) arg;
 
 	return !strcasecmp(lhs->name, rhs->name) ? CMP_MATCH | CMP_STOP : 0;
 }
@@ -345,7 +347,7 @@
 /* destroy the taskprocessor */
 static void tps_taskprocessor_destroy(void *tps)
 {
-	struct ast_taskprocessor *t = tps;
+	struct ast_taskprocessor *t = (struct ast_taskprocessor *) tps;
 	
 	if (!tps) {
 		ast_log(LOG_ERROR, "missing taskprocessor\n");
@@ -407,7 +409,7 @@
 struct ast_taskprocessor *ast_taskprocessor_get(char *name, enum ast_tps_options create)
 {
 	struct ast_taskprocessor *p, tmp_tps = {
-		.name = name,
+		name
 	};
 		
 	if (ast_strlen_zero(name)) {
@@ -415,7 +417,7 @@
 		return NULL;
 	}
 	ao2_lock(tps_singletons);
-	p = ao2_find(tps_singletons, &tmp_tps, OBJ_POINTER);
+	p = (struct ast_taskprocessor *) ao2_find(tps_singletons, &tmp_tps, OBJ_POINTER);
 	if (p) {
 		ao2_unlock(tps_singletons);
 		return p;
@@ -426,7 +428,7 @@
 		return NULL;
 	}
 	/* create a new taskprocessor */
-	if (!(p = ao2_alloc(sizeof(*p), tps_taskprocessor_destroy))) {
+	if (!(p = (struct ast_taskprocessor *) ao2_alloc(sizeof(*p), tps_taskprocessor_destroy))) {
 		ao2_unlock(tps_singletons);
 		ast_log(LOG_WARNING, "failed to create taskprocessor '%s'\n", name);
 		return NULL;
@@ -435,7 +437,7 @@
 	ast_cond_init(&p->poll_cond, NULL);
 	ast_mutex_init(&p->taskprocessor_lock);
 
-	if (!(p->stats = ast_calloc(1, sizeof(*p->stats)))) {
+	if (!(p->stats = (struct tps_taskprocessor_stats *) ast_calloc(1, sizeof(*p->stats)))) {
 		ao2_unlock(tps_singletons);
 		ast_log(LOG_WARNING, "failed to create taskprocessor stats for '%s'\n", name);
 		ao2_ref(p, -1);




More information about the asterisk-commits mailing list