use int64 instead size_t in MemoryInputStream/MemoryOutputStream

This commit is contained in:
2020-08-08 20:10:27 +08:00
parent 4c22ba5a60
commit 46574e0f49
2 changed files with 10 additions and 10 deletions

View File

@@ -14,8 +14,8 @@ namespace hgl
protected:
const uint8 *buf;
size_t buf_size;
size_t cur_pos;
int64 buf_size;
int64 cur_pos;
public:
@@ -37,7 +37,7 @@ namespace hgl
* @param size 数据长度字节数
* @return 是否成功
*/
bool Link(const void *data,const size_t size)
bool Link(const void *data,const int64 size)
{
if(!data)
return(false);
@@ -55,7 +55,7 @@ namespace hgl
* @param size 数据长度字节数
* @return 是否成功
*/
bool Update(void *data,size_t size)
bool Update(void *data,int64 size)
{
if(!data)
return(false);

View File

@@ -15,9 +15,9 @@ namespace hgl
uint8 *buf;
size_t max_size;
size_t buf_size;
size_t cur_pos;
int64 max_size;
int64 buf_size;
int64 cur_pos;
bool one;
@@ -44,7 +44,7 @@ namespace hgl
* @param len 存放数据长度的指针
* @return 创建好的内存拷贝
*/
void *CreateCopyData(int *len)const
void *CreateCopyData(int64 *len)const
{
if(buf_size<=0)
return(nullptr);
@@ -66,7 +66,7 @@ namespace hgl
* @param one_instance 是否仅此一份实例(如果是将由MemoryOutputStream类负责释放)
* @return 是否成功
*/
bool Link(void *ptr,size_t size,bool one_instance=false)
bool Link(void *ptr,int64 size,bool one_instance=false)
{
if(!ptr||!size)
return(false);
@@ -87,7 +87,7 @@ namespace hgl
* @param size 数据长度字节数
* @return 是否成功
*/
bool Update(void *ptr,size_t size)
bool Update(void *ptr,int64 size)
{
if(!ptr||!size)
return(false);