changeset 320:d8889f819081 trunk

[svn] Dereferencing type-punned pointer will break strict-aliasing rules squashed by Mark Loeser <halcy0n@gentoo.org>.
author chainsaw
date Sun, 18 Dec 2005 11:42:07 -0800
parents 1e642d74d68c
children bd81a73eadff
files Plugins/Input/aac/libfaad2/ic_predict.c Plugins/Input/aac/src/libmp4.c
diffstat 2 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Plugins/Input/aac/libfaad2/ic_predict.c	Sun Dec 18 09:06:02 2005 -0800
+++ b/Plugins/Input/aac/libfaad2/ic_predict.c	Sun Dec 18 11:42:07 2005 -0800
@@ -39,7 +39,11 @@
 {
     int32_t flg;
     uint32_t tmp, tmp1, tmp2;
-
+    uint32_t *tmp3, *tmp4, *tmp5;
+    tmp3 = &tmp;
+    tmp4 = &tmp1;
+    tmp5 = &tmp2;
+ 
     tmp = *(uint32_t*)pf;
     flg = tmp & (uint32_t)0x00008000;
     tmp &= (uint32_t)0xffff0000;
@@ -51,17 +55,18 @@
         tmp |= (uint32_t)0x00010000;       /* insert 1 lsb */
         tmp2 = tmp;                             /* add 1 lsb and elided one */
         tmp &= (uint32_t)0xff800000;       /* extract exponent and sign */
-        
-        *pf = *(float32_t*)&tmp1 + *(float32_t*)&tmp2 - *(float32_t*)&tmp;
+ 
+        *pf = *(float32_t*)tmp4 + *(float32_t*)tmp4 - *(float32_t*)tmp5;
     } else {
-        *pf = *(float32_t*)&tmp;
+        *pf = *(float32_t*)tmp3;
     }
 }
 
 static int16_t quant_pred(float32_t x)
 {
     int16_t q;
-    uint32_t *tmp = (uint32_t*)&x;
+    float32_t *tmp1 = &x;
+    uint32_t *tmp = (uint32_t*)tmp1;
 
     q = (int16_t)(*tmp>>16);
 
@@ -71,7 +76,8 @@
 static float32_t inv_quant_pred(int16_t q)
 {
     float32_t x;
-    uint32_t *tmp = (uint32_t*)&x;
+    float32_t *tmp1 = &x;
+    uint32_t *tmp = (uint32_t*)tmp1;
     *tmp = ((uint32_t)q)<<16;
 
     return x;
--- a/Plugins/Input/aac/src/libmp4.c	Sun Dec 18 09:06:02 2005 -0800
+++ b/Plugins/Input/aac/src/libmp4.c	Sun Dec 18 11:42:07 2005 -0800
@@ -359,7 +359,7 @@
     }
     xmmstitle = xmms_get_titlestring(xmms_get_gentitle_format(), input);
     if(xmmstitle == NULL)
-      xmmstitle = g_strdup(input->file_name);
+      xmmstitle = g_path_get_basename(input->file_name);
     if(temp) g_free(temp);
     if(input->performer) g_free(input->performer);
     if(input->album_name) g_free(input->album_name);