[asterisk-commits] pcadach: branch pcadach/chan_h323-live r39808 - /team/pcadach/chan_h323-live/...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Aug 15 09:54:46 MST 2006


Author: pcadach
Date: Tue Aug 15 11:54:45 2006
New Revision: 39808

URL: http://svn.digium.com/view/asterisk?rev=39808&view=rev
Log:
Made "style" change requested by Kevin Fleming... used initializer in
declaration, brought decl down to block where the variable is used, got
rid of memset.

Modified:
    team/pcadach/chan_h323-live/channels/chan_h323.c

Modified: team/pcadach/chan_h323-live/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/pcadach/chan_h323-live/channels/chan_h323.c?rev=39808&r1=39807&r2=39808&view=diff
==============================================================================
--- team/pcadach/chan_h323-live/channels/chan_h323.c (original)
+++ team/pcadach/chan_h323-live/channels/chan_h323.c Tue Aug 15 11:54:45 2006
@@ -258,8 +258,6 @@
 /* Channel and private structures should be already locked */
 static void __oh323_update_info(struct ast_channel *c, struct oh323_pvt *pvt)
 {
-	struct ast_frame f;
-
 	if (c->nativeformats != pvt->nativeformats) {
 		if (h323debug)
 			ast_log(LOG_DEBUG, "Preparing %s for new native format\n", c->name);
@@ -285,14 +283,8 @@
 		pvt->newcontrol = -1;
 	}
 	if (pvt->newdigit >= 0) {
-		memset(&f, 0, sizeof(f));
-		f.frametype = AST_FRAME_DTMF;
-		f.subclass = pvt->newdigit;
-		f.datalen = 0;
+		struct ast_frame f = { AST_FRAME_DTMF, pvt->newdigit, };
 		f.samples = 800;
-		f.offset = 0;
-		f.data = NULL;
-		f.mallocd = 0;
 		f.src = "UPDATE_INFO";
 		ast_queue_frame(c, &f);
 		pvt->newdigit = -1;
@@ -1177,7 +1169,6 @@
 static int send_digit(unsigned call_reference, char digit, const char *token)
 {
 	struct oh323_pvt *pvt;
-	struct ast_frame f;
 	int res;
 
 	ast_log(LOG_DEBUG, "Received Digit: %c\n", digit);
@@ -1187,14 +1178,8 @@
 		return -1;
 	}
 	if (pvt->owner && !ast_mutex_trylock(&pvt->owner->lock)) {
-		memset(&f, 0, sizeof(f));
-		f.frametype = AST_FRAME_DTMF;
-		f.subclass = digit;
-		f.datalen = 0;
+		struct ast_frame f = { AST_FRAME_DTMF, digit, };
 		f.samples = 800;
-		f.offset = 0;
-		f.data = NULL;
-		f.mallocd = 0;
 		f.src = "SEND_DIGIT";
 		res = ast_queue_frame(pvt->owner, &f);
 		ast_mutex_unlock(&pvt->owner->lock);



More information about the asterisk-commits mailing list