Update of /cvsroot/alsa/alsa-lib/src/pcm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21946

Modified Files:
        pcm_lfloat.c pcm_local.h plugin_ops.h 
Log Message:
- fixed the type punning (compilation warnings with the recent GCC).



Index: pcm_lfloat.c
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_lfloat.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- pcm_lfloat.c        25 Jul 2003 17:02:03 -0000      1.14
+++ pcm_lfloat.c        31 Jan 2004 12:16:32 -0000      1.15
@@ -110,8 +110,8 @@
                int src_step, dst_step;
                snd_pcm_uframes_t frames1;
                int32_t sample = 0;
-               float tmp_float;
-               double tmp_double;
+               snd_tmp_float_t tmp_float;
+               snd_tmp_double_t tmp_double;
                const snd_pcm_channel_area_t *src_area = &src_areas[channel];
                const snd_pcm_channel_area_t *dst_area = &dst_areas[channel];
                src = snd_pcm_channel_area_addr(src_area, src_offset);
@@ -154,10 +154,9 @@
                char *dst;
                int src_step, dst_step;
                snd_pcm_uframes_t frames1;
-               int32_t sample;
-               int64_t sample64;
-               float tmp_float;
-               double tmp_double;
+               int32_t sample = 0;
+               snd_tmp_float_t tmp_float;
+               snd_tmp_double_t tmp_double;
                const snd_pcm_channel_area_t *src_area = &src_areas[channel];
                const snd_pcm_channel_area_t *dst_area = &dst_areas[channel];
                src = snd_pcm_channel_area_addr(src_area, src_offset);

Index: pcm_local.h
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_local.h,v
retrieving revision 1.130
retrieving revision 1.131
diff -u -r1.130 -r1.131
--- pcm_local.h 8 Aug 2003 09:06:41 -0000       1.130
+++ pcm_local.h 31 Jan 2004 12:16:33 -0000      1.131
@@ -787,3 +787,15 @@
         (1U << SND_PCM_FORMAT_FLOAT_BE) | \
         (1U << SND_PCM_FORMAT_FLOAT64_LE) | \
         (1U << SND_PCM_FORMAT_FLOAT64_BE)) }
+
+
+typedef union snd_tmp_float {
+       float f;
+       int32_t i;
+} snd_tmp_float_t;
+
+typedef union snd_tmp_double {
+       double d;
+       int64_t l;
+} snd_tmp_double_t;
+

Index: plugin_ops.h
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/plugin_ops.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- plugin_ops.h        21 Jul 2002 08:19:41 -0000      1.17
+++ plugin_ops.h        31 Jan 2004 12:16:33 -0000      1.18
@@ -720,11 +720,11 @@
 
 #ifdef PUT32F_END
 put32f_1234_1234F: as_float(dst) = (float_t)((int32_t)sample) / 
(float_t)0x80000000UL; goto PUT32F_END;
-put32f_1234_4321F: tmp_float = (float_t)((int32_t)sample) / (float_t)0x80000000UL;
-                  as_u32(dst) = bswap_32(as_u32c(&tmp_float)); goto PUT32F_END;
+put32f_1234_4321F: tmp_float.f = (float_t)((int32_t)sample) / (float_t)0x80000000UL;
+                  as_u32(dst) = bswap_32(tmp_float.i); goto PUT32F_END;
 put32f_1234_1234D: as_double(dst) = (double_t)((int32_t)sample) / 
(double_t)0x80000000UL; goto PUT32F_END;
-put32f_1234_4321D: tmp_double = (double_t)((int32_t)sample) / (double_t)0x80000000UL;
-                  as_u64(dst) = bswap_64(as_u64c(&tmp_double)); goto PUT32F_END;
+put32f_1234_4321D: tmp_double.d = (double_t)((int32_t)sample) / 
(double_t)0x80000000UL;
+                  as_u64(dst) = bswap_64(tmp_double.l); goto PUT32F_END;
 #endif
 
 #ifdef GET32F_LABELS
@@ -738,39 +738,37 @@
 #endif
 
 #ifdef GET32F_END
-get32f_1234F_1234: tmp_float = as_floatc(src);
-                  if (tmp_float >= 1.0)
+get32f_1234F_1234: tmp_float.f = as_floatc(src);
+                  if (tmp_float.f >= 1.0)
                        sample = 0x7fffffff;
-                  else if (tmp_float <= -1.0)
+                  else if (tmp_float.f <= -1.0)
                        sample = 0x80000000;
                   else
-                       sample = (int32_t)(tmp_float * (float_t)0x80000000UL);
+                       sample = (int32_t)(tmp_float.f * (float_t)0x80000000UL);
                   goto GET32F_END;
-get32f_4321F_1234: sample = bswap_32(as_u32c(src));
-                  tmp_float = as_floatc(&sample);
-                  if (tmp_float >= 1.0)
+get32f_4321F_1234: tmp_float.i = bswap_32(as_u32c(src));
+                  if (tmp_float.f >= 1.0)
                        sample = 0x7fffffff;
-                  else if (tmp_float <= -1.0)
+                  else if (tmp_float.f <= -1.0)
                        sample = 0x80000000;
                   else
-                       sample = (int32_t)(tmp_float * (float_t)0x80000000UL);
+                       sample = (int32_t)(tmp_float.f * (float_t)0x80000000UL);
                   goto GET32F_END;
-get32f_1234D_1234: tmp_double = as_doublec(src);
-                  if (tmp_double >= 1.0)
+get32f_1234D_1234: tmp_double.d = as_doublec(src);
+                  if (tmp_double.d >= 1.0)
                        sample = 0x7fffffff;
-                  else if (tmp_double <= -1.0)
+                  else if (tmp_double.d <= -1.0)
                        sample = 0x80000000;
                   else
-                       sample = (int32_t)(tmp_double * (double_t)0x80000000UL);
+                       sample = (int32_t)(tmp_double.d * (double_t)0x80000000UL);
                   goto GET32F_END;
-get32f_4321D_1234: sample64 = bswap_64(as_u64c(src));
-                  tmp_double = as_doublec(&sample);
-                  if (tmp_double >= 1.0)
+get32f_4321D_1234: tmp_double.l = bswap_64(as_u64c(src));
+                  if (tmp_double.d >= 1.0)
                        sample = 0x7fffffff;
-                  else if (tmp_double <= -1.0)
+                  else if (tmp_double.d <= -1.0)
                        sample = 0x80000000;
                   else
-                       sample = (int32_t)(tmp_double * (double_t)0x80000000UL);
+                       sample = (int32_t)(tmp_double.d * (double_t)0x80000000UL);
                   goto GET32F_END;
 #endif
 



-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to