Merged revisions 107464 via svnmerge from
authorKevin P. Fleming <kpfleming@digium.com>
Tue, 11 Mar 2008 15:13:38 +0000 (15:13 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Tue, 11 Mar 2008 15:13:38 +0000 (15:13 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r107464 | kpfleming | 2008-03-11 09:53:03 -0500 (Tue, 11 Mar 2008) | 2 lines

fix various other problems found by gcc 4.3

........

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

apps/app_rpt.c
apps/app_sms.c
channels/misdn/isdn_lib.c
codecs/Makefile

index 0957af0..1246e39 100644 (file)
@@ -888,12 +888,8 @@ static void load_rpt_vars(int n, int init)
                ast_free(rpt_vars[n].p.tailmsgbuf);
        memset(&rpt_vars[n].p, 0, sizeof(rpt_vars[n].p));
        if (init) {
-               char *cp;
-               int savearea = (char *)&rpt_vars[n].p - (char *)&rpt_vars[n];
-
-               cp = (char *) &rpt_vars[n].p;
-               memset(cp + sizeof(rpt_vars[n].p), 0,
-                       sizeof(rpt_vars[n]) - (sizeof(rpt_vars[n].p) + savearea));
+               /* clear all the fields in the structure after 'p' */
+               memset(&rpt_vars[n].p + sizeof(rpt_vars[0].p), 0, sizeof(rpt_vars[0]) - sizeof(rpt_vars[0].p) - offsetof(typeof(rpt_vars[0]), p));
                rpt_vars[n].tele.next = &rpt_vars[n].tele;
                rpt_vars[n].tele.prev = &rpt_vars[n].tele;
                rpt_vars[n].rpt_thread = AST_PTHREADT_NULL;
index 717f710..2af6a25 100644 (file)
@@ -528,9 +528,10 @@ static void packdate(unsigned char *o, time_t w)
 }
 
 /*! \brief unpack a date and return */
-static time_t unpackdate(unsigned char *i)
+static struct timeval unpackdate(unsigned char *i)
 {
-       struct tm t;
+       struct ast_tm t;
+
        t.tm_year = 100 + (i[0] & 0xF) * 10 + (i[0] >> 4);
        t.tm_mon = (i[1] & 0xF) * 10 + (i[1] >> 4) - 1;
        t.tm_mday = (i[2] & 0xF) * 10 + (i[2] >> 4);
@@ -542,6 +543,7 @@ static time_t unpackdate(unsigned char *i)
                t.tm_min += 15 * ((i[6] & 0x7) * 10 + (i[6] >> 4));
        else
                t.tm_min -= 15 * ((i[6] & 0x7) * 10 + (i[6] >> 4));
+
        return ast_mktime(&t, NULL);
 }
 
@@ -1058,7 +1060,7 @@ static unsigned char sms_handleincoming (sms_t * h)
                        p += unpackaddress(h->oa, h->imsg + p);
                        h->pid = h->imsg[p++];
                        h->dcs = h->imsg[p++];
-                       h->scts.tv_sec = unpackdate(h->imsg + p);
+                       h->scts = unpackdate(h->imsg + p);
                        p += 7;
                        p += unpacksms(h->dcs, h->imsg + p, h->udh, &h->udhl, h->ud, &h->udl, h->udhi);
                        h->rx = 1;                               /* received message */
index b951e2e..90a6c8d 100644 (file)
@@ -2419,12 +2419,12 @@ static int handle_bchan(msg_t *msg)
     
        case PH_CONTROL|INDICATION:
        {
-               unsigned int cont = *((unsigned int *)&frm->data.p);
+               unsigned int *cont = (unsigned int *) &frm->data.p;
                
                cb_log(4, stack->port, "PH_CONTROL: channel:%d oad%d:%s dad%d:%s \n", bc->channel, bc->onumplan,bc->oad, bc->dnumplan,bc->dad);
 
-               if ((cont&~DTMF_TONE_MASK) == DTMF_TONE_VAL) {
-                       int dtmf = cont & DTMF_TONE_MASK;
+               if ((*cont & ~DTMF_TONE_MASK) == DTMF_TONE_VAL) {
+                       int dtmf = *cont & DTMF_TONE_MASK;
                        cb_log(4, stack->port, " --> DTMF TONE: %c\n",dtmf);
                        bc->dtmf=dtmf;
                        cb_event(EVENT_DTMF_TONE, bc, glob_mgr->user_data);
@@ -2432,12 +2432,12 @@ static int handle_bchan(msg_t *msg)
                        free_msg(msg);
                        return 1;
                }
-               if (cont == BF_REJECT) {
+               if (*cont == BF_REJECT) {
                        cb_log(4, stack->port, " --> BF REJECT\n");
                        free_msg(msg);
                        return 1;
                }
-               if (cont == BF_ACCEPT) {
+               if (*cont == BF_ACCEPT) {
                        cb_log(4, stack->port, " --> BF ACCEPT\n");
                        free_msg(msg);
                        return 1;
index b7647b2..6de9cac 100644 (file)
@@ -46,7 +46,7 @@ $(LIBLPC10):
 $(if $(filter codec_lpc10,$(EMBEDDED_MODS)),modules.link,codec_lpc10.so): $(LIBLPC10)
 
 $(LIBILBC):
-       @$(MAKE) -C ilbc all
+       @$(MAKE) -C ilbc all ASTCFLAGS="$(ASTCFLAGS) $(AST_NO_STRICT_OVERFLOW)"
 
 $(if $(filter codec_ilbc,$(EMBEDDED_MODS)),modules.link,codec_ilbc.so): $(LIBILBC)