[svn-commits] russell: branch group/newcdr r196553 - in /team/group/newcdr: cel/ include/as...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sat May 23 11:34:28 CDT 2009


Author: russell
Date: Sat May 23 11:34:24 2009
New Revision: 196553

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=196553
Log:
minor formatting and constification

Modified:
    team/group/newcdr/cel/cel_pgsql.c
    team/group/newcdr/cel/cel_radius.c
    team/group/newcdr/include/asterisk/cel.h
    team/group/newcdr/main/cel.c

Modified: team/group/newcdr/cel/cel_pgsql.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_pgsql.c?view=diff&rev=196553&r1=196552&r2=196553
==============================================================================
--- team/group/newcdr/cel/cel_pgsql.c (original)
+++ team/group/newcdr/cel/cel_pgsql.c Sat May 23 11:34:24 2009
@@ -216,7 +216,7 @@
 					ast_str_append(&sql2, 0, "%s%f", first ? "" : ",", (double)eventtype);
 				} else {
 					/* Char field, probably */
-					char *t2 = ast_cel_eventtype2str(eventtype);
+					const char *t2 = ast_cel_eventtype2str(eventtype);
 					LENGTHEN_BUF2(strlen(t2)+1);
 					ast_str_append(&sql2, 0, "%s'%s'", first ? "" : ",", t2);
 				}

Modified: team/group/newcdr/cel/cel_radius.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/cel/cel_radius.c?view=diff&rev=196553&r1=196552&r2=196553
==============================================================================
--- team/group/newcdr/cel/cel_radius.c (original)
+++ team/group/newcdr/cel/cel_radius.c Sat May 23 11:34:24 2009
@@ -103,7 +103,7 @@
 	int recordtype = PW_STATUS_STOP;
 	struct ast_tm tm;
 	char timestr[128];
-	char *tmp;
+	const char *tmp;
 
 	if (!rc_avpair_add(rh, send, PW_ACCT_STATUS_TYPE, &recordtype, 0, 0)) {
 		return -1;

Modified: team/group/newcdr/include/asterisk/cel.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/include/asterisk/cel.h?view=diff&rev=196553&r1=196552&r2=196553
==============================================================================
--- team/group/newcdr/include/asterisk/cel.h (original)
+++ team/group/newcdr/include/asterisk/cel.h Sat May 23 11:34:24 2009
@@ -106,12 +106,12 @@
  */
 struct ast_cel *ast_cel_alloc(void);
 
-char *ast_cel_eventtype2str(enum ast_cel_eventtype eventtype);
-enum ast_cel_eventtype ast_cel_str2eventtype(char *eventname);
+const char *ast_cel_eventtype2str(enum ast_cel_eventtype eventtype);
+enum ast_cel_eventtype ast_cel_str2eventtype(const char *eventname);
 
 
 /*! Converts AMA flag to printable string */
-char *ast_cel_flags2str(int flag);
+const char *ast_cel_flags2str(int flag);
 
 /*! If at least one CEL backend is looking for CEL_LINKEDID_END
  * events, this function will check if the given channel is the last

Modified: team/group/newcdr/main/cel.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/newcdr/main/cel.c?view=diff&rev=196553&r1=196552&r2=196553
==============================================================================
--- team/group/newcdr/main/cel.c (original)
+++ team/group/newcdr/main/cel.c Sat May 23 11:34:24 2009
@@ -14,25 +14,17 @@
  * at the top of the source tree.
  */
 
-/*! \file
+/*! 
+ * \file
  *
  * \brief Channel Event Logging API 
  *
  * \author Steve Murphy <murf at digium.com>
- * 
  */
 
-
 #include "asterisk.h"
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
-
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <signal.h>
-#include <ctype.h>
 
 #include "asterisk/lock.h"
 #include "asterisk/channel.h"
@@ -90,7 +82,7 @@
 
 static struct ast_cli_entry cli_status = AST_CLI_DEFINE(handle_cli_status, "Display the CEL status");
 
-enum ast_cel_eventtype ast_cel_str2eventtype(char *eventname)
+enum ast_cel_eventtype ast_cel_str2eventtype(const char *eventname)
 {
 	if (!strcasecmp(eventname,"ALL")) {
 		return 0;
@@ -332,10 +324,9 @@
 	return res;
 }
 
-char *ast_cel_eventtype2str(enum ast_cel_eventtype eventtype)
-{
-	switch (eventtype)
-	{
+const char *ast_cel_eventtype2str(enum ast_cel_eventtype eventtype)
+{
+	switch (eventtype) {
 	case CEL_CHANNEL_START:
 		return "CEL_CHAN_START";
 	case CEL_CHANNEL_END:
@@ -391,7 +382,7 @@
 }
 
 /*! Converts AMA flag to printable string */
-char *ast_cel_flags2str(int flag)
+const char *ast_cel_flags2str(int flag)
 {
 	switch (flag) {
 	case AST_CEL_OMIT:
@@ -407,8 +398,7 @@
 /* called whenever a channel is destroyed or a linkedid is changed to
  * potentially emit a CEL_LINKEDID_END event */
 
-struct channel_find_data
-{
+struct channel_find_data {
 	const struct ast_channel *chan;
 	const char *linkedid;
 };
@@ -543,8 +533,7 @@
 
 void ast_cel_report_event(const struct ast_channel *chan, enum ast_cel_eventtype eventtype, char *userdefevname, const char *extra, const struct ast_channel *peer2)
 {
-	if (ast_cel_track_event(eventtype))
-	{
+	if (ast_cel_track_event(eventtype)) {
 		int trackit = 1;
 
 		ast_debug(3,"CEL event tracked: %s\n", ast_cel_eventtype2str(eventtype));




More information about the svn-commits mailing list