[asterisk-commits] may: branch may/ooh323_ipv6_direct_rtp r349671 - in /team/may/ooh323_ipv6_dir...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jan 5 09:05:40 CST 2012


Author: may
Date: Thu Jan  5 09:05:34 2012
New Revision: 349671

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=349671
Log:
fix CODING-GUIDELINS issues

Modified:
    team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c
    team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooCmdChannel.c
    team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c
    team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooStackCmds.c
    team/may/ooh323_ipv6_direct_rtp/addons/ooh323cDriver.c

Modified: team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c?view=diff&rev=349671&r1=349670&r2=349671
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/chan_ooh323.c Thu Jan  5 09:05:34 2012
@@ -4495,7 +4495,7 @@
 
 	ast_mutex_unlock(&p->lock);
 
-	if(gH323Debug) {
+	if (gH323Debug) {
 		ast_verb(0, "+++   setup_rtp_remote\n");
 	}
 
@@ -4525,9 +4525,10 @@
 	ast_sockaddr_set_port(&tmp, remotePort);
 	ast_rtp_instance_set_remote_address(p->rtp, &tmp);
 
-	if (p->writeformat.id == AST_FORMAT_G726_AAL2)
+	if (p->writeformat.id == AST_FORMAT_G726_AAL2) {
                 ast_rtp_codecs_payloads_set_rtpmap_type(ast_rtp_instance_get_codecs(p->rtp), p->rtp, 2,
 							"audio", "G726-32", AST_RTP_OPT_G726_NONSTANDARD);
+	}
 
 	ast_mutex_unlock(&p->lock);
 
@@ -4649,9 +4650,10 @@
 		parameters.rate = AST_T38_RATE_14400;
 		ast_queue_control_data(p->owner, AST_CONTROL_T38_PARAMETERS, &parameters, sizeof(parameters));
 	}
-	if (gH323Debug)
+	if (gH323Debug) {
 		ast_debug(1, "Receiving UDPTL  %s:%d\n", ast_sockaddr_stringify_host(&them),
 							ast_sockaddr_port(&them));
+	}
 
 	ast_channel_unlock(p->owner);
 	ast_mutex_unlock(&p->lock);

Modified: team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooCmdChannel.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooCmdChannel.c?view=diff&rev=349671&r1=349670&r2=349671
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooCmdChannel.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooCmdChannel.c Thu Jan  5 09:05:34 2012
@@ -414,9 +414,9 @@
 	    case OO_CMD_UPDLC:
 		OOTRACEINFO4("Processing UpdLC command %s, localIP is %s, port is %d\n",
 				(char *)cmd.param1, (char *)cmd.param2, *(int *)cmd.param3);
-   		if(cmd.param2) {
+		if(cmd.param2) {
 			ooUpdateAllLogicalChannels(call, (char *)cmd.param2, *(int *)cmd.param3);
-   		}
+		}
 		break;
 
             default: OOTRACEERR1("ERROR:Unknown command\n");

Modified: team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c?view=diff&rev=349671&r1=349670&r2=349671
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooLogChan.c Thu Jan  5 09:05:34 2012
@@ -263,16 +263,16 @@
 {
    OOLogicalChannel * pChannel = NULL;
    pChannel = call->logicalChans;
-   while(pChannel)
-   {
+   while(pChannel) {
       OOTRACEINFO6("Listing logical channel %d cap %d state %d for (%s, %s)\n",
-		pChannel->channelNo, pChannel->chanCap->cap, pChannel->state, 
+		pChannel->channelNo, pChannel->chanCap->cap, pChannel->state,
 		call->callType, call->callToken);
       if(!strcmp(pChannel->dir, "receive") && pChannel->state != OO_LOGICALCHAN_IDLE &&
-					       pChannel->state != OO_LOGICALCHAN_PROPOSEDFS)
+					       pChannel->state != OO_LOGICALCHAN_PROPOSEDFS) {
          return pChannel;
-      else
+      } else {
          pChannel = pChannel->next;
+      }
    }
    return NULL;
 }

Modified: team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooStackCmds.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooStackCmds.c?view=diff&rev=349671&r1=349670&r2=349671
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooStackCmds.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/ooh323c/src/ooStackCmds.c Thu Jan  5 09:05:34 2012
@@ -550,12 +550,11 @@
    OOStackCommand cmd;
    OOH323CallData *call;
 
-   if(!callToken)
-   {
-      return OO_STKCMD_INVALIDPARAM;
-   }
-
-   if(!(call = ooFindCallByToken(callToken))) {
+   if (!callToken) {
+      return OO_STKCMD_INVALIDPARAM;
+   }
+
+   if (!(call = ooFindCallByToken(callToken))) {
       return OO_STKCMD_INVALIDPARAM;
    }
 
@@ -563,8 +562,7 @@
       return OO_STKCMD_INVALIDPARAM;
    }
 
-   if(call->CmdChan == 0)
-   {
+   if (call->CmdChan == 0) {
       if(ooCreateCallCmdConnection(call) != OO_OK)
          return OO_STKCMD_CONNECTIONERR;
    }
@@ -575,11 +573,16 @@
    cmd.param1 = (void*) malloc(strlen(callToken)+1);
    cmd.param2 = (void*) malloc(strlen(localIP)+1);
    cmd.param3 = (void*) malloc(sizeof(int)+1);
-   if(!cmd.param1 || !cmd.param2 || !cmd.param3)
-   {
-      if(cmd.param1)   free(cmd.param1); /* Release memory */
-      if(cmd.param2)   free(cmd.param2);
-      if(cmd.param3)   free(cmd.param3);
+   if (!cmd.param1 || !cmd.param2 || !cmd.param3) {
+      if (cmd.param1) {
+	free(cmd.param1); /* Release memory */
+      }
+      if (cmd.param2) {
+	free(cmd.param2);
+      }
+      if (cmd.param3) {
+	free(cmd.param3);
+      }
       return OO_STKCMD_MEMERR;
    }
    strcpy((char*)cmd.param1, callToken);
@@ -587,15 +590,15 @@
    strcpy((char*)cmd.param2, localIP);
    cmd.plen2 = strlen(localIP);
    *((int *)cmd.param3) = port;
-   cmd.plen3 = sizeof(int)+1;
-   
-   if(ooWriteCallStackCommand(call,&cmd) != OO_OK)
-   {
+   cmd.plen3 = sizeof(int) + 1;
+
+   if (ooWriteCallStackCommand(call,&cmd) != OO_OK) {
       free(cmd.param1);
       free(cmd.param2);
       free(cmd.param3);
       return OO_STKCMD_WRITEERR;
    }
+
    free(cmd.param1);
    free(cmd.param2);
    free(cmd.param3);

Modified: team/may/ooh323_ipv6_direct_rtp/addons/ooh323cDriver.c
URL: http://svnview.digium.com/svn/asterisk/team/may/ooh323_ipv6_direct_rtp/addons/ooh323cDriver.c?view=diff&rev=349671&r1=349670&r2=349671
==============================================================================
--- team/may/ooh323_ipv6_direct_rtp/addons/ooh323cDriver.c (original)
+++ team/may/ooh323_ipv6_direct_rtp/addons/ooh323cDriver.c Thu Jan  5 09:05:34 2012
@@ -230,15 +230,17 @@
 {
    int ret = 0, x;
    struct ast_format tmpfmt;
-   if(gH323Debug)
+   if (gH323Debug) {
      ast_verb(0, "\tAdding capabilities to H323 endpoint\n");
-   
+   }
+
    for(x=0; ast_codec_pref_index(prefs, x, &tmpfmt); x++)
    {
       if(tmpfmt.id == AST_FORMAT_ULAW)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g711 ulaw capability to H323 endpoint\n");
+	 }
          ret= ooH323EpAddG711Capability(OO_G711ULAW64K, gtxframes, grxframes, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,
@@ -247,8 +249,9 @@
       }
       if(tmpfmt.id == AST_FORMAT_ALAW)
       {
-         if(gH323Debug)
+         if (gH323Debug) {
             ast_verb(0, "\tAdding g711 alaw capability to H323 endpoint\n");
+	 }
          ret= ooH323EpAddG711Capability(OO_G711ALAW64K, gtxframes, grxframes, 
                                      OORXANDTX, &ooh323c_start_receive_channel,
                                      &ooh323c_start_transmit_channel,




More information about the asterisk-commits mailing list