You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2009/12/08 16:42:23 UTC
svn commit: r888447 - in
/incubator/trafficserver/traffic/trunk/iocore/eventsystem: IOBuffer.cc
I_IOBuffer.h
Author: jplevyak
Date: Tue Dec 8 15:42:23 2009
New Revision: 888447
URL: http://svn.apache.org/viewvc?rev=888447&view=rev
Log:
TS-66 IOBuffer memcpy/read/write use char * instead of void * for memory pointers.
This fix requires 'make clean' because of an issue with the dependency system.
Modified:
incubator/trafficserver/traffic/trunk/iocore/eventsystem/IOBuffer.cc
incubator/trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h
Modified: incubator/trafficserver/traffic/trunk/iocore/eventsystem/IOBuffer.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/iocore/eventsystem/IOBuffer.cc?rev=888447&r1=888446&r2=888447&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/iocore/eventsystem/IOBuffer.cc (original)
+++ incubator/trafficserver/traffic/trunk/iocore/eventsystem/IOBuffer.cc Tue Dec 8 15:42:23 2009
@@ -82,8 +82,9 @@
}
int
-MIOBuffer::write(const char *buf, int alen)
+MIOBuffer::write(const void *abuf, int alen)
{
+ char *buf = (char*)abuf;
int len = alen;
while (len) {
if (!_writer)
@@ -186,8 +187,9 @@
}
int
-IOBufferReader::read(char *b, int len)
+IOBufferReader::read(void *ab, int len)
{
+ char *b = (char*)ab;
int max_bytes = read_avail();
int bytes = len <= max_bytes ? len : max_bytes;
int n = bytes;
@@ -238,8 +240,9 @@
}
char *
-IOBufferReader::memcpy(char *p, int len, int offset)
+IOBufferReader::memcpy(void *ap, int len, int offset)
{
+ char *p = (char*)ap;
IOBufferBlock *b = block;
offset += start_offset;
Modified: incubator/trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h?rev=888447&r1=888446&r2=888447&view=diff
==============================================================================
--- incubator/trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h (original)
+++ incubator/trafficserver/traffic/trunk/iocore/eventsystem/I_IOBuffer.h Tue Dec 8 15:42:23 2009
@@ -714,7 +714,7 @@
@return number of bytes copied and consumed.
*/
- inkcoreapi int read(char *buf, int len);
+ inkcoreapi int read(void *buf, int len);
/**
Copy data but do not consume it. Copies 'len' bytes of data from
@@ -733,7 +733,7 @@
parameter buf is set to this value also.
*/
- inkcoreapi char *memcpy(char *buf, int len = INT_MAX, int offset = 0);
+ inkcoreapi char *memcpy(void *buf, int len = INT_MAX, int offset = 0);
/**
Subscript operator. Returns a reference to the character at the
@@ -859,7 +859,7 @@
control. Returns the number of bytes added.
*/
- inkcoreapi int write(const char *rbuf, int nbytes);
+ inkcoreapi int write(const void *rbuf, int nbytes);
#ifdef WRITE_AND_TRANSFER
/**