]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 208749 via svnmerge from
authorJeff Peeler <jpeeler@digium.com>
Sat, 25 Jul 2009 06:24:47 +0000 (06:24 +0000)
committerJeff Peeler <jpeeler@digium.com>
Sat, 25 Jul 2009 06:24:47 +0000 (06:24 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

................
  r208749 | jpeeler | 2009-07-25 01:23:18 -0500 (Sat, 25 Jul 2009) | 13 lines

  Merged revisions 208746 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/branches/1.4

  ........
    r208746 | jpeeler | 2009-07-25 01:19:50 -0500 (Sat, 25 Jul 2009) | 7 lines

    Fix compiling under dev-mode with gcc 4.4.0.

    Mostly trivial changes, but I did not know of any other way to fix the
    "dereferencing type-punned pointer will break strict-aliasing rules" error
    without creating a tmp variable in chan_skinny.
  ........
................

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.0@208752 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c
channels/chan_skinny.c
main/translate.c

index 16898acc967a3c78eb54f8694e357b11a0c01c56..1627b4e79912e7ce35d0c67b042ac747b0189207 100644 (file)
@@ -4013,7 +4013,7 @@ static enum ast_bridge_result iax2_bridge(struct ast_channel *c0, struct ast_cha
                return AST_BRIDGE_FAILED;
        }
        /* Put them in native bridge mode */
-       if (!flags & (AST_BRIDGE_DTMF_CHANNEL_0 | AST_BRIDGE_DTMF_CHANNEL_1)) {
+       if ((!flags) & (AST_BRIDGE_DTMF_CHANNEL_0 | AST_BRIDGE_DTMF_CHANNEL_1)) {
                iaxs[callno0]->bridgecallno = callno1;
                iaxs[callno1]->bridgecallno = callno0;
        }
index 7cf9a7faa9e7ad947a9453bdd34c2ee82fa7ce0f..8b6c0e117f2d854b784e1b84ca463f423ca0bebc 100644 (file)
@@ -5584,6 +5584,7 @@ static int get_input(struct skinnysession *s)
 {
        int res;
        int dlen = 0;
+       int *bufaddr;
        struct pollfd fds[1];
 
        fds[0].fd = s->fd;
@@ -5630,7 +5631,8 @@ static int get_input(struct skinnysession *s)
                        return -1;
                }
                
-               dlen = letohl(*(int *)s->inbuf);
+               bufaddr = (int *)s->inbuf;
+               dlen = letohl(*bufaddr);
                if (dlen < 4) {
                        ast_debug(1, "Skinny Client sent invalid data.\n");
                        ast_mutex_unlock(&s->lock);
@@ -5639,7 +5641,7 @@ static int get_input(struct skinnysession *s)
                if (dlen+8 > sizeof(s->inbuf)) {
                        dlen = sizeof(s->inbuf) - 8;
                }
-               *(int *)s->inbuf = htolel(dlen);
+               *bufaddr = htolel(dlen);
 
                res = read(s->fd, s->inbuf+4, dlen+4);
                ast_mutex_unlock(&s->lock);
@@ -5658,13 +5660,15 @@ static int get_input(struct skinnysession *s)
 static struct skinny_req *skinny_req_parse(struct skinnysession *s)
 {
        struct skinny_req *req;
+       int *bufaddr;
 
        if (!(req = ast_calloc(1, SKINNY_MAX_PACKET)))
                return NULL;
 
        ast_mutex_lock(&s->lock);
        memcpy(req, s->inbuf, skinny_header_size);
-       memcpy(&req->data, s->inbuf+skinny_header_size, letohl(*(int*)(s->inbuf))-4);
+       bufaddr = (int *)(s->inbuf);
+       memcpy(&req->data, s->inbuf+skinny_header_size, letohl(*bufaddr)-4);
 
        ast_mutex_unlock(&s->lock);
 
index 1d6c155f414147def7363f31be714e3617df5c55..500d40ff1f156f68ee3d4ad278e02315e6659b16 100644 (file)
@@ -855,7 +855,7 @@ unsigned int ast_translate_available_formats(unsigned int dest, unsigned int src
           destination format. */
        for (x = 1; src_audio && (x & AST_FORMAT_AUDIO_MASK); x <<= 1) {
                /* if this is not a desired format, nothing to do */
-               if (!dest & x)
+               if ((!dest) & x)
                        continue;
 
                /* if the source is supplying this format, then
@@ -881,7 +881,7 @@ unsigned int ast_translate_available_formats(unsigned int dest, unsigned int src
           destination format. */
        for (; src_video && (x & AST_FORMAT_VIDEO_MASK); x <<= 1) {
                /* if this is not a desired format, nothing to do */
-               if (!dest & x)
+               if ((!dest) & x)
                        continue;
 
                /* if the source is supplying this format, then