unsigned char array
Dependents: MGC3130 SmartLabXBeeCore
Diff: BufferedArray.cpp
- Revision:
- 1:77c1ea04eb5a
- Parent:
- 0:b35da77c40ca
- Child:
- 2:765da30c4d9b
--- a/BufferedArray.cpp Wed Nov 11 18:33:41 2015 +0000 +++ b/BufferedArray.cpp Thu Nov 12 02:06:49 2015 +0000 @@ -87,7 +87,7 @@ return; if (position >= max) - expandSpace(1); + expandSpace(position - max + 1); data[position] = value; } @@ -98,16 +98,16 @@ index++; } -void BufferedArray::sets(const void * value, int length) +void BufferedArray::sets(const unsigned char * value, int offset, int length) { if (length <= 0) return; - sets(index, value, length); + sets(index, value, offset, length); index += length; } -void BufferedArray::sets(int position, const void * value, int length) +void BufferedArray::sets(int position, const unsigned char * value, int offset, int length) { if (position < 0) return; @@ -118,5 +118,5 @@ if (position + length > max) expandSpace(position + length - max); - memcpy(data + index, value, length); + memcpy(data + position, value, length); } \ No newline at end of file