[asterisk-commits] mmichelson: branch jrothenberger/asterisk-urgent r106401 - /team/jrothenberge...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Mar 6 14:14:22 CST 2008


Author: mmichelson
Date: Thu Mar  6 14:14:21 2008
New Revision: 106401

URL: http://svn.digium.com/view/asterisk?view=rev&rev=106401
Log:
Some coding guidelines fixups, mainly adding spaces after commas and
not explicitly testing equality with 0.


Modified:
    team/jrothenberger/asterisk-urgent/apps/app_voicemail.c

Modified: team/jrothenberger/asterisk-urgent/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/jrothenberger/asterisk-urgent/apps/app_voicemail.c?view=diff&rev=106401&r1=106400&r2=106401
==============================================================================
--- team/jrothenberger/asterisk-urgent/apps/app_voicemail.c (original)
+++ team/jrothenberger/asterisk-urgent/apps/app_voicemail.c Thu Mar  6 14:14:21 2008
@@ -2549,7 +2549,7 @@
 	char *imapflags = NIL;
 
 	/* Set urgent flag for IMAP message */
-	if (!ast_strlen_zero(flag) && !strcmp(flag,"URGENT")) {
+	if (!ast_strlen_zero(flag) && !strcmp(flag, "URGENT")) {
 		ast_debug(3, "Setting message flag \\\\FLAGGED.\n");
 		imapflags="\\FLAGGED";
 	}
@@ -2680,7 +2680,7 @@
 		if (fold == 1) { /* Old messages */
 			return vms_p->oldmessages;
 		}
-		if(fold == 11) {/*URGENT messages*/
+		if (fold == 11) {/*URGENT messages*/
 		 	return vms_p->urgentmessages;
 		}
 	}
@@ -2866,7 +2866,7 @@
 
 	ast_log(LOG_NOTICE, "Copying message from %s@%s to %s@%s\n", vmu->mailbox, vmu->context, recip->mailbox, recip->context);
 
-	if (strcmp(flag,"URGENT") == 0) { /* If urgent, copy to URGENT folder */
+	if (!strcmp(flag, "URGENT")) { /* If urgent, copy to URGENT folder */
 		create_dirpath(todir, sizeof(todir), recip->context, recip->mailbox, "URGENT");
 	} else {
 		create_dirpath(todir, sizeof(todir), recip->context, recip->mailbox, "INBOX");
@@ -2938,7 +2938,7 @@
 	closedir(dir);
 
 	/* If we are checking INBOX, we should check URGENT as well */
-	if (strcmp(folder,"INBOX") == 0) {
+	if (strcmp(folder, "INBOX") == 0) {
 		return (ret + __has_voicemail(context, mailbox, "URGENT", shortcircuit));
 	} else {
 		return ret;
@@ -3498,7 +3498,7 @@
 #endif
 					}
 #ifndef IMAP_STORAGE
-					if (strcmp(flag,"URGENT") == 0) { /* If this is an URGENT message */
+					if (!strcmp(flag, "URGENT")) { /* If this is an URGENT message */
 						/* Move the message from INBOX to URGENT folder if this is urgent! */
 						char sfn[PATH_MAX];
 						char dfn[PATH_MAX];
@@ -4912,7 +4912,7 @@
 	else if (vms->curmsg == vms->lastmsg)
 		res = wait_file2(chan, vms, "vm-last");		/* "last" */
 	/* Play the word urgent if we are listening to urgent messages */
-	if (!ast_strlen_zero(flag) && strncmp(flag,"URGENT",6) == 0) {
+	if (!ast_strlen_zero(flag) && !strncmp(flag, "URGENT", 6)) {
 		res = wait_file2(chan, vms, "vm-URGENT");	/* "urgent" */
 	}
 
@@ -4925,7 +4925,7 @@
 	}
 
 	/* URGENT has a carriage return on the end, so don't compare that */
-	if (strcmp(flag,"URGENT") == 0) {
+	if (!strcmp(flag, "URGENT")) {
 		res = wait_file2(chan, vms, "vm-marked-urgent");
 	}
 
@@ -5014,7 +5014,7 @@
 	flag = ast_variable_retrieve(msg_cfg, "message", "flag");
 
 	/* Play the word urgent if we are listening to urgent messages */
-	if (!ast_strlen_zero(flag) && strcmp(flag,"URGENT") == 0) {
+	if (!ast_strlen_zero(flag) && !strcmp(flag, "URGENT")) {
 		res = wait_file2(chan, vms, "vm-URGENT");	/* "urgent" */
 	}
 
@@ -5063,7 +5063,7 @@
 	}
 
 	/* URGENT has a carriage return on the end, so don't compare that */
-	if (!ast_strlen_zero(flag) && strcmp(flag,"URGENT") == 0) {
+	if (!ast_strlen_zero(flag) && !strcmp(flag, "URGENT")) {
 		res = wait_file2(chan, vms, "vm-marked-urgent");
 	}
 
@@ -9534,14 +9534,14 @@
 		case '4':
 			if (outsidecaller) {  /* only mark vm messages */
 				/* Mark Urgent */
-				if (flag && strcmp(flag,"URGENT") != 0) {
+				if (!ast_strlen_zero(flag) && strcmp(flag, "URGENT")) {
 					ast_verbose(VERBOSE_PREFIX_3 "marking message as URGENT\n");
 					res = ast_play_and_wait(chan, "vm-marked-urgent");
-					strcpy(flag,"URGENT");
+					strcpy(flag, "URGENT");
 				} else {
 					ast_verbose(VERBOSE_PREFIX_3 "UNmarking message as URGENT\n");
 					res = ast_play_and_wait(chan, "vm-urgent-removed");
-					strcpy(flag,"");
+					strcpy(flag, "");
 				}
 				cmd = 0;
 			} else {
@@ -9585,7 +9585,7 @@
 					cmd = '0';
 				} else if (cmd == '4') {
 					ast_play_and_wait(chan, "vm-marked-urgent");
-					strcpy(flag,"URGENT");
+					strcpy(flag, "URGENT");
 					ast_play_and_wait(chan, "vm-msgsaved");
 					cmd = '0';
 				} else {




More information about the asterisk-commits mailing list