mirror of https://github.com/PrimeDecomp/prime.git
Match COutputStream::DoPut (Thanks HeartPiece!)
Former-commit-id: 26d6394bb1
This commit is contained in:
parent
67fff47df5
commit
b08714313d
|
@ -883,7 +883,7 @@ LIBS = [
|
||||||
"Runtime/e_pow",
|
"Runtime/e_pow",
|
||||||
["Runtime/e_rem_pio2", True],
|
["Runtime/e_rem_pio2", True],
|
||||||
["Runtime/k_cos", True],
|
["Runtime/k_cos", True],
|
||||||
"Runtime/k_rem_pio2",
|
["Runtime/k_rem_pio2", True],
|
||||||
["Runtime/k_sin", True],
|
["Runtime/k_sin", True],
|
||||||
["Runtime/k_tan", True],
|
["Runtime/k_tan", True],
|
||||||
"Runtime/s_atan",
|
"Runtime/s_atan",
|
||||||
|
|
|
@ -760,7 +760,7 @@ MSL_COMMON_MATH :=\
|
||||||
$(BUILD_DIR)/asm/Runtime/e_pow.o\
|
$(BUILD_DIR)/asm/Runtime/e_pow.o\
|
||||||
$(BUILD_DIR)/src/Runtime/e_rem_pio2.o\
|
$(BUILD_DIR)/src/Runtime/e_rem_pio2.o\
|
||||||
$(BUILD_DIR)/src/Runtime/k_cos.o\
|
$(BUILD_DIR)/src/Runtime/k_cos.o\
|
||||||
$(BUILD_DIR)/asm/Runtime/k_rem_pio2.o\
|
$(BUILD_DIR)/src/Runtime/k_rem_pio2.o\
|
||||||
$(BUILD_DIR)/src/Runtime/k_sin.o\
|
$(BUILD_DIR)/src/Runtime/k_sin.o\
|
||||||
$(BUILD_DIR)/src/Runtime/k_tan.o\
|
$(BUILD_DIR)/src/Runtime/k_tan.o\
|
||||||
$(BUILD_DIR)/asm/Runtime/s_atan.o\
|
$(BUILD_DIR)/asm/Runtime/s_atan.o\
|
||||||
|
|
|
@ -21,28 +21,32 @@ COutputStream::~COutputStream() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void COutputStream::DoPut(const void* ptr, size_t len) {
|
void COutputStream::DoPut(const void* ptr, size_t len) {
|
||||||
if (len == 0) {
|
uint offset;
|
||||||
return;
|
uchar* offsetPtr;
|
||||||
}
|
uint tempLen = len;
|
||||||
|
if (tempLen != 0) {
|
||||||
mNumWrites += len;
|
mNumWrites += tempLen;
|
||||||
if (mBufLen <= len + mUnwrittenLen) {
|
if (tempLen + mUnwrittenLen <= mBufLen) {
|
||||||
memcpy((uchar*)mBufPtr + mUnwrittenLen, ptr, len);
|
memcpy((uchar*)mBufPtr + mUnwrittenLen, ptr, tempLen);
|
||||||
mUnwrittenLen += len;
|
mUnwrittenLen += tempLen;
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
while (len != 0) {
|
|
||||||
uint count = mBufLen - mUnwrittenLen;
|
|
||||||
uint offset = len;
|
|
||||||
if (count < len) {
|
|
||||||
len = count;
|
|
||||||
}
|
}
|
||||||
if (count != 0) {
|
|
||||||
memcpy((uchar*)mBufPtr + mUnwrittenLen, (uchar*)ptr + offset, len);
|
offsetPtr = (uchar*)ptr + tempLen;
|
||||||
mUnwrittenLen += len;
|
while (tempLen != 0) {
|
||||||
len -= len;
|
uint count = mBufLen - mUnwrittenLen;
|
||||||
} else {
|
offset = count;
|
||||||
DoFlush();
|
if (tempLen < count) {
|
||||||
|
offset = tempLen;
|
||||||
|
}
|
||||||
|
if (offset != 0) {
|
||||||
|
memcpy((uchar*)mBufPtr + mUnwrittenLen, (offsetPtr - tempLen), offset);
|
||||||
|
|
||||||
|
tempLen -= offset;
|
||||||
|
mUnwrittenLen += offset;
|
||||||
|
} else {
|
||||||
|
DoFlush();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "fdlibm.h"
|
#include "fdlibm.h"
|
||||||
|
|
||||||
#ifdef __STDC__
|
#ifdef __STDC__
|
||||||
static const double
|
static const double
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in New Issue