diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-23 23:22:57 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-06-23 23:22:57 +0000 |
commit | eb369cb54f132925a4890fc1434b385d57df02ca (patch) | |
tree | 125886d1c4468eb768cc7914b6db74fe39ac3320 /channels | |
parent | 604972725d6443e145cc1344d5b91a94f3a6874d (diff) |
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. :)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@35766 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r-- | channels/chan_skinny.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c index 899bd13df..47f8cd038 100644 --- a/channels/chan_skinny.c +++ b/channels/chan_skinny.c @@ -3138,14 +3138,15 @@ static int handle_button_template_req_message(skinny_req *req, struct skinnysess 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 @@ static int handle_button_template_req_message(skinny_req *req, struct skinnysess 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 @@ static int handle_button_template_req_message(skinny_req *req, struct skinnysess 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 @@ static int handle_button_template_req_message(skinny_req *req, struct skinnysess 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; |