Index: pjproject/trunk/pjmedia/src/pjmedia-codec/speex/pseudofloat.h
===================================================================
--- pjproject/trunk/pjmedia/src/pjmedia-codec/speex/pseudofloat.h	(revision 278)
+++ pjproject/trunk/pjmedia/src/pjmedia-codec/speex/pseudofloat.h	(revision 628)
@@ -46,7 +46,7 @@
 } spx_float_t;
 
-#define FLOAT_ZERO ((spx_float_t){0,0})
-#define FLOAT_ONE ((spx_float_t){16384,-14})
-#define FLOAT_HALF ((spx_float_t){16384,-15})
+static const spx_float_t FLOAT_ZERO = {0,0};
+static const spx_float_t FLOAT_ONE = {16384,-14};
+static const spx_float_t FLOAT_HALF = {16384,-15};
 
 #define MIN(a,b) ((a)<(b)?(a):(b))
@@ -61,5 +61,8 @@
    }
    if (x==0)
-      return (spx_float_t) {0,0};
+   {
+      spx_float_t r = {0,0};
+      return r;
+   }
    while (x>32767)
    {
@@ -75,7 +78,17 @@
    }
    if (sign)
-      return (spx_float_t) {-x,e};
+   {
+      spx_float_t r;
+      r.m = -x;
+      r.e = e;
+      return r;
+   }
    else      
-      return (spx_float_t) {x,e};
+   {
+      spx_float_t r;
+      r.m = x;
+      r.e = e;
+      return r;
+   }
 }
 
@@ -88,5 +101,14 @@
    else if (b.m==0)
       return a;
-   r = (a).e > (b).e ? (spx_float_t) {((a).m>>1) + ((b).m>>MIN(15,(a).e-(b).e+1)),(a).e+1} : (spx_float_t) {((b).m>>1) + ((a).m>>MIN(15,(b).e-(a).e+1)),(b).e+1};
+   if ((a).e > (b).e) 
+   {
+      r.m = ((a).m>>1) + ((b).m>>MIN(15,(a).e-(b).e+1));
+      r.e = (a).e+1;
+   }
+   else 
+   {
+      r.m = ((b).m>>1) + ((a).m>>MIN(15,(b).e-(a).e+1));
+      r.e = (b).e+1;
+   }
    if (r.m>0)
    {
@@ -114,5 +136,14 @@
    else if (b.m==0)
       return a;
-   r = (a).e > (b).e ? (spx_float_t) {((a).m>>1) - ((b).m>>MIN(15,(a).e-(b).e+1)),(a).e+1} : (spx_float_t) {((a).m>>MIN(15,(b).e-(a).e+1)) - ((b).m>>1) ,(b).e+1};
+   if ((a).e > (b).e)
+   {
+      r.m = ((a).m>>1) - ((b).m>>MIN(15,(a).e-(b).e+1));
+      r.e = (a).e+1;
+   }
+   else 
+   {
+      r.m = ((a).m>>MIN(15,(b).e-(a).e+1)) - ((b).m>>1);
+      r.e = (b).e+1;
+   }
    if (r.m>0)
    {
@@ -153,5 +184,7 @@
 static inline spx_float_t FLOAT_MULT(spx_float_t a, spx_float_t b)
 {
-   spx_float_t r = (spx_float_t) {(spx_int16_t)((spx_int32_t)(a).m*(b).m>>15), (a).e+(b).e+15};
+   spx_float_t r;
+   r.m = (spx_int16_t)((spx_int32_t)(a).m*(b).m>>15);
+   r.e = (a).e+(b).e+15;
    if (r.m>0)
    {
@@ -175,5 +208,8 @@
 static inline spx_float_t FLOAT_SHL(spx_float_t a, int b)
 {
-   return (spx_float_t) {a.m,a.e+b};
+   spx_float_t r;
+   r.m = a.m;
+   r.e = a.e+b;
+   return r;
 }
 
@@ -181,5 +217,5 @@
 {
    if (a.e<0)
-      return (a.m+(1<<(-a.e-1)))>>-a.e;
+      return EXTRACT16((EXTEND32(a.m)+(1<<(-a.e-1)))>>-a.e);
    else
       return a.m<<a.e;
@@ -197,7 +233,10 @@
 {
    int e=0;
+   spx_float_t r;
    /* FIXME: Handle the sign */
    if (a==0)
-      return (spx_float_t) {0,0};
+   {
+      return FLOAT_ZERO;
+   }
    while (a>32767)
    {
@@ -220,5 +259,7 @@
       e--;
    }
-   return (spx_float_t) {MULT16_16_Q15(a,b),e+15};
+   r.m = MULT16_16_Q15(a,b);
+   r.e = e+15;
+   return r;
 }
 
@@ -226,18 +267,23 @@
 {
    int e=0;
+   spx_float_t r;
    /* FIXME: Handle the sign */
    if (a==0)
-      return (spx_float_t) {0,0};
-   while (a<SHL32(b.m,14))
+   {
+      return FLOAT_ZERO;
+   }
+   while (a<SHL32(EXTEND32(b.m),14))
    {
       a <<= 1;
       e--;
    }
-   while (a>=SHL32(b.m-1,15))
+   while (a>=SHL32(EXTEND32(b.m-1),15))
    {
       a >>= 1;
       e++;
    }
-   return (spx_float_t) {DIV32_16(a,b.m),e-b.e};
+   r.m = DIV32_16(a,b.m);
+   r.e = e-b.e;
+   return r;
 }
 
@@ -246,7 +292,10 @@
 {
    int e=0;
+   spx_float_t r;
    /* FIXME: Handle the sign */
    if (a==0)
-      return (spx_float_t) {0,0};
+   {
+      return FLOAT_ZERO;
+   }
    while (b>32767)
    {
@@ -264,5 +313,7 @@
       e++;
    }
-   return (spx_float_t) {DIV32_16(a,b),e};
+   r.m = DIV32_16(a,b);
+   r.e = e;
+   return r;
 }
 
@@ -271,4 +322,5 @@
    int e=0;
    spx_int32_t num;
+   spx_float_t r;
    num = a.m;
    while (a.m >= b.m)
@@ -278,5 +330,7 @@
    }
    num = num << (15-e);
-   return (spx_float_t) {DIV32_16(num,b.m),a.e-b.e-15+e};
+   r.m = DIV32_16(num,b.m);
+   r.e = a.e-b.e-15+e;
+   return r;
 }
 
