[polypaudio-commits] r525 - /trunk/src/polypcore/protocol-esound.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon Feb 20 08:21:20 PST 2006


Author: ossman
Date: Mon Feb 20 17:21:19 2006
New Revision: 525

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=525&root=polypaudio&view=rev
Log:
Fix some warnings by making sure we have the right signedness on things.

Modified:
    trunk/src/polypcore/protocol-esound.c

Modified: trunk/src/polypcore/protocol-esound.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/polypcore/protocol-esound.c?rev=525&root=polypaudio&r1=524&r2=525&view=diff
==============================================================================
--- trunk/src/polypcore/protocol-esound.c (original)
+++ trunk/src/polypcore/protocol-esound.c Mon Feb 20 17:21:19 2006
@@ -560,15 +560,15 @@
             response += ESD_NAME_MAX;
             
             /* rate */
-            *((int*) response) = MAYBE_INT32_SWAP(c->swap_byte_order, ce->sample_spec.rate);
+            *((uint32_t*) response) = MAYBE_UINT32_SWAP(c->swap_byte_order, ce->sample_spec.rate);
             response += sizeof(int);
             
             /* left */
-            *((int*) response) = MAYBE_INT32_SWAP(c->swap_byte_order, (ce->volume.values[0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM);
+            *((uint32_t*) response) = MAYBE_UINT32_SWAP(c->swap_byte_order, (ce->volume.values[0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM);
             response += sizeof(int);
             
             /*right*/
-            *((int*) response) = MAYBE_INT32_SWAP(c->swap_byte_order, (ce->volume.values[0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM);
+            *((uint32_t*) response) = MAYBE_UINT32_SWAP(c->swap_byte_order, (ce->volume.values[0]*ESD_VOLUME_BASE)/PA_VOLUME_NORM);
             response += sizeof(int);
             
             /*format*/
@@ -596,10 +596,10 @@
     struct connection *conn;
     assert(c && data && length == sizeof(int)*3);
     
-    idx = MAYBE_UINT32_SWAP(c->swap_byte_order, *(const int*)data)-1;
-    lvolume = MAYBE_UINT32_SWAP(c->swap_byte_order, *((const int*)data + 1));
+    idx = MAYBE_UINT32_SWAP(c->swap_byte_order, *(const uint32_t*)data)-1;
+    lvolume = MAYBE_UINT32_SWAP(c->swap_byte_order, *((const uint32_t*)data + 1));
     lvolume = (lvolume*PA_VOLUME_NORM)/ESD_VOLUME_BASE;
-    rvolume = MAYBE_UINT32_SWAP(c->swap_byte_order, *((const int*)data + 2));
+    rvolume = MAYBE_UINT32_SWAP(c->swap_byte_order, *((const uint32_t*)data + 2));
     rvolume = (rvolume*PA_VOLUME_NORM)/ESD_VOLUME_BASE;
 
     ok = connection_write(c, sizeof(int));




More information about the pulseaudio-commits mailing list