[asterisk-commits] trunk r35766 - /trunk/channels/chan_skinny.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jun 23 16:22:57 MST 2006


Author: russell
Date: Fri Jun 23 18:22:57 2006
New Revision: 35766

URL: http://svn.digium.com/view/asterisk?rev=35766&view=rev
Log:
fix some little issues on big endian platforms to resolve compiler warnings
 - don't call the byte swapping macros on single byte numbers
 - don't do a ++ increment in the argument in the argument to the byte swapping
   macros. This gets expanded to incrementing the variable 4 times in a single
   operation, which results in undefined (and obviously undesired) behavior. :)

Modified:
    trunk/channels/chan_skinny.c

Modified: trunk/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_skinny.c?rev=35766&r1=35765&r2=35766&view=diff
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Fri Jun 23 18:22:57 2006
@@ -3138,14 +3138,15 @@
 		switch (btn[i].buttonDefinition) {
 			case BT_CUST_LINESPEEDDIAL:
 				/* assume failure */
-				req->data.buttontemplate.definition[i].buttonDefinition = htolel(BT_NONE);
+				req->data.buttontemplate.definition[i].buttonDefinition = BT_NONE;
 				req->data.buttontemplate.definition[i].instanceNumber = htolel(0);
 
 				for (l = d->lines; l; l = l->next) {
 					if (l->instance == lineInstance) {
 						ast_verbose("Adding button: %d, %d\n", BT_LINE, lineInstance);
-						req->data.buttontemplate.definition[i].buttonDefinition = htolel(BT_LINE);
-						req->data.buttontemplate.definition[i].instanceNumber = htolel(lineInstance++);
+						req->data.buttontemplate.definition[i].buttonDefinition = BT_LINE;
+						req->data.buttontemplate.definition[i].instanceNumber = htolel(lineInstance);
+						lineInstance++;
 						buttonCount++;
 						btnSet = 1;
 						break;
@@ -3156,8 +3157,9 @@
 					for (sd = d->speeddials; sd; sd = sd->next) {
 						if (sd->instance == speeddialInstance) {
 							ast_verbose("Adding button: %d, %d\n", BT_SPEEDDIAL, speeddialInstance);
-							req->data.buttontemplate.definition[i].buttonDefinition = htolel(BT_SPEEDDIAL);
-							req->data.buttontemplate.definition[i].instanceNumber = htolel(speeddialInstance++);
+							req->data.buttontemplate.definition[i].buttonDefinition = BT_SPEEDDIAL;
+							req->data.buttontemplate.definition[i].instanceNumber = htolel(speeddialInstance);
+							speeddialInstance++;
 							buttonCount++;
 							btnSet = 1;
 							break;
@@ -3172,8 +3174,9 @@
 				for (l = d->lines; l; l = l->next) {
 					if (l->instance == lineInstance) {
 						ast_verbose("Adding button: %d, %d\n", BT_LINE, lineInstance);
-						req->data.buttontemplate.definition[i].buttonDefinition = htolel(BT_LINE);
-						req->data.buttontemplate.definition[i].instanceNumber = htolel(lineInstance++);
+						req->data.buttontemplate.definition[i].buttonDefinition = BT_LINE;
+						req->data.buttontemplate.definition[i].instanceNumber = htolel(lineInstance);
+						lineInstance++;
 						buttonCount++;
 						btnSet = 1;
 						break;
@@ -3187,8 +3190,9 @@
 				for (sd = d->speeddials; sd; sd = sd->next) {
 					if (sd->instance == speeddialInstance) {
 						ast_verbose("Adding button: %d, %d\n", BT_SPEEDDIAL, speeddialInstance);
-						req->data.buttontemplate.definition[i].buttonDefinition = htolel(BT_SPEEDDIAL);
-						req->data.buttontemplate.definition[i].instanceNumber = htolel(speeddialInstance++);
+						req->data.buttontemplate.definition[i].buttonDefinition = BT_SPEEDDIAL;
+						req->data.buttontemplate.definition[i].instanceNumber = htolel(speeddialInstance);
+						speeddialInstance++;
 						buttonCount++;
 						btnSet = 1;
 						break;



More information about the asterisk-commits mailing list