[xiph-commits] r14106 - trunk/speex/libspeex

jm at svn.xiph.org jm at svn.xiph.org
Tue Nov 6 04:06:32 PST 2007


Author: jm
Date: 2007-11-06 04:06:32 -0800 (Tue, 06 Nov 2007)
New Revision: 14106

Modified:
   trunk/speex/libspeex/buffer.c
Log:
ring buffer: stop doing arithmetic on void*.


Modified: trunk/speex/libspeex/buffer.c
===================================================================
--- trunk/speex/libspeex/buffer.c	2007-11-06 11:56:00 UTC (rev 14105)
+++ trunk/speex/libspeex/buffer.c	2007-11-06 12:06:32 UTC (rev 14106)
@@ -41,7 +41,7 @@
 #include <speex/speex_buffer.h>
 
 struct SpeexBuffer_ {
-   void *data;
+   char *data;
    int   size;
    int   read_ptr;
    int   write_ptr;
@@ -65,10 +65,11 @@
    speex_free(st);
 }
 
-int speex_buffer_write(SpeexBuffer *st, void *data, int len)
+int speex_buffer_write(SpeexBuffer *st, void *_data, int len)
 {
    int end;
    int end1;
+   char *data = _data;
    if (len > st->size)
    {
       data += len-st->size;
@@ -100,7 +101,7 @@
 {
    /* This is almost the same as for speex_buffer_write() but using 
    speex_memset() instead of speex_move(). Update accordingly. */
-      int end;
+   int end;
    int end1;
    if (len > st->size)
    {
@@ -128,9 +129,10 @@
    return len;
 }
 
-int speex_buffer_read(SpeexBuffer *st, void *data, int len)
+int speex_buffer_read(SpeexBuffer *st, void *_data, int len)
 {
    int end, end1;
+   char *data = _data;
    if (len > st->available)
    {
       speex_memset(data+st->available, 0, st->size-st->available);



More information about the commits mailing list