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

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


Author: seanbright
Date: Sat Jan 10 17:27:22 2009
New Revision: 168391

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=168391
Log:
cdr.c compiles now.

Modified:
    team/group/asterisk-cpp/include/asterisk/cdr.h
    team/group/asterisk-cpp/main/cdr.c

Modified: team/group/asterisk-cpp/include/asterisk/cdr.h
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/include/asterisk/cdr.h?view=diff&rev=168391&r1=168390&r2=168391
==============================================================================
--- team/group/asterisk-cpp/include/asterisk/cdr.h (original)
+++ team/group/asterisk-cpp/include/asterisk/cdr.h Sat Jan 10 17:27:22 2009
@@ -298,7 +298,7 @@
  * Converts the binary form of a disposition to string form.
  * \return a pointer to the string form
  */
-char *ast_cdr_disp2str(int disposition);
+const char *ast_cdr_disp2str(int disposition);
 
 /*! 
  * \brief Reset the detail record, optionally posting it first 
@@ -322,7 +322,7 @@
  * Converts binary flags to string flags
  * Returns string with flag name
  */
-char *ast_cdr_flags2str(int flags);
+const char *ast_cdr_flags2str(int flags);
 
 /*! 
  * \brief Move the non-null data from the "from" cdr to the "to" cdr

Modified: team/group/asterisk-cpp/main/cdr.c
URL: http://svn.digium.com/svn-view/asterisk/team/group/asterisk-cpp/main/cdr.c?view=diff&rev=168391&r1=168390&r2=168391
==============================================================================
--- team/group/asterisk-cpp/main/cdr.c (original)
+++ team/group/asterisk-cpp/main/cdr.c Sat Jan 10 17:27:22 2009
@@ -126,7 +126,7 @@
 		}
 	}
 
-	if (!(i = ast_calloc(1, sizeof(*i)))) 	
+	if (!(i = (struct ast_cdr_beitem *) ast_calloc(1, sizeof(*i))))
 		return -1;
 
 	i->be = be;
@@ -451,8 +451,7 @@
 
 struct ast_cdr *ast_cdr_alloc(void)
 {
-	struct ast_cdr *x;
-	x = ast_calloc(1, sizeof(*x));
+	struct ast_cdr *x = (struct ast_cdr *) ast_calloc(1, sizeof(*x));
 	if (!x)
 		ast_log(LOG_ERROR,"Allocation Failure for a CDR!\n");
 	return x;
@@ -673,7 +672,7 @@
 
 void ast_cdr_start(struct ast_cdr *cdr)
 {
-	char *chan; 
+	const char *chan;
 
 	for (; cdr; cdr = cdr->next) {
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
@@ -726,7 +725,7 @@
 
 void ast_cdr_noanswer(struct ast_cdr *cdr)
 {
-	char *chan; 
+	const char *chan;
 
 	while (cdr) {
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
@@ -818,7 +817,7 @@
 
 int ast_cdr_init(struct ast_cdr *cdr, struct ast_channel *c)
 {
-	char *chan;
+	const char *chan;
 
 	for ( ; cdr ; cdr = cdr->next) {
 		if (!ast_test_flag(cdr, AST_CDR_FLAG_LOCKED)) {
@@ -877,7 +876,7 @@
 	}
 }
 
-char *ast_cdr_disp2str(int disposition)
+const char *ast_cdr_disp2str(int disposition)
 {
 	switch (disposition) {
 	case AST_CDR_NULL:
@@ -885,9 +884,9 @@
 	case AST_CDR_NOANSWER:
 		return "NO ANSWER";
 	case AST_CDR_FAILED:
-		return "FAILED";		
+		return "FAILED";
 	case AST_CDR_BUSY:
-		return "BUSY";		
+		return "BUSY";
 	case AST_CDR_ANSWERED:
 		return "ANSWERED";
 	}
@@ -895,7 +894,7 @@
 }
 
 /*! Converts AMA flag to printable string */
-char *ast_cdr_flags2str(int flag)
+const char *ast_cdr_flags2str(int flag)
 {
 	switch (flag) {
 	case AST_CDR_OMIT:
@@ -1003,7 +1002,7 @@
 
 static void post_cdr(struct ast_cdr *cdr)
 {
-	char *chan;
+	const char *chan;
 	struct ast_cdr_beitem *i;
 
 	for ( ; cdr ; cdr = cdr->next) {
@@ -1122,7 +1121,7 @@
 static int init_batch(void)
 {
 	/* This is the single meta-batch used to keep track of all CDRs during the entire life of the program */
-	if (!(batch = ast_malloc(sizeof(*batch))))
+	if (!(batch = (struct ast_cdr_batch *) ast_malloc(sizeof(*batch))))
 		return -1;
 
 	reset_batch();
@@ -1133,7 +1132,7 @@
 static void *do_batch_backend_process(void *data)
 {
 	struct ast_cdr_batch_item *processeditem;
-	struct ast_cdr_batch_item *batchitem = data;
+	struct ast_cdr_batch_item *batchitem = (struct ast_cdr_batch_item *) data;
 
 	/* Push each CDR into storage mechanism(s) and free all the memory */
 	while (batchitem) {
@@ -1225,7 +1224,7 @@
 	ast_debug(1, "CDR detaching from this thread\n");
 
 	/* we'll need a new tail for every CDR */
-	if (!(newtail = ast_calloc(1, sizeof(*newtail)))) {
+	if (!(newtail = (struct ast_cdr_batch_item *) ast_calloc(1, sizeof(*newtail)))) {
 		post_cdr(cdr);
 		ast_cdr_free(cdr);
 		return;
@@ -1357,8 +1356,8 @@
 	return CLI_SUCCESS;
 }
 
-static struct ast_cli_entry cli_submit = AST_CLI_DEFINE(handle_cli_submit, "Posts all pending batched CDR data");
-static struct ast_cli_entry cli_status = AST_CLI_DEFINE(handle_cli_status, "Display the CDR status");
+static struct ast_cli_entry cli_submit(handle_cli_submit, "Posts all pending batched CDR data");
+static struct ast_cli_entry cli_status(handle_cli_status, "Display the CDR status");
 
 static int do_reload(int reload)
 {




More information about the asterisk-commits mailing list