Appease the analyzer, but also how did this ever work?
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4818 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
parent
81c66bdddd
commit
7f661d9af9
@ -121,21 +121,21 @@ static int8_t _serialize_readInt8(const char** buffer, size_t* size)
|
|||||||
|
|
||||||
int32_t _serialize_readInt32(const char** buffer, size_t* size)
|
int32_t _serialize_readInt32(const char** buffer, size_t* size)
|
||||||
{
|
{
|
||||||
int32_t result;
|
int32_t result = 0;
|
||||||
_serialize_read(buffer, size, &result, sizeof(result));
|
_serialize_read(buffer, size, &result, sizeof(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
int64_t _serialize_readInt64(const char** buffer, size_t* size)
|
int64_t _serialize_readInt64(const char** buffer, size_t* size)
|
||||||
{
|
{
|
||||||
int64_t result;
|
int64_t result = 0;
|
||||||
_serialize_read(buffer, size, &result, sizeof(result));
|
_serialize_read(buffer, size, &result, sizeof(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
double _serialize_readDouble(const char** buffer, size_t* size)
|
double _serialize_readDouble(const char** buffer, size_t* size)
|
||||||
{
|
{
|
||||||
double result;
|
double result = 0;
|
||||||
_serialize_read(buffer, size, &result, sizeof(result));
|
_serialize_read(buffer, size, &result, sizeof(result));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ static bool _serialize_storeInternal(tf_task_t* task, tf_taskstub_t* to, buffer_
|
|||||||
}
|
}
|
||||||
else if (!JS_IsException((typed = tf_util_try_get_typed_array_buffer(context, value, &offset, &size, &element_size))))
|
else if (!JS_IsException((typed = tf_util_try_get_typed_array_buffer(context, value, &offset, &size, &element_size))))
|
||||||
{
|
{
|
||||||
size_t total_size;
|
size_t total_size = 0;
|
||||||
uint8_t* bytes = tf_util_try_get_array_buffer(context, &total_size, typed);
|
uint8_t* bytes = tf_util_try_get_array_buffer(context, &total_size, typed);
|
||||||
_serialize_writeInt32(buffer, kArrayBuffer);
|
_serialize_writeInt32(buffer, kArrayBuffer);
|
||||||
_serialize_writeInt32(buffer, (int32_t)size);
|
_serialize_writeInt32(buffer, (int32_t)size);
|
||||||
@ -332,8 +332,7 @@ static JSValue _serialize_loadInternal(tf_task_t* task, tf_taskstub_t* from, con
|
|||||||
{
|
{
|
||||||
return JS_UNDEFINED;
|
return JS_UNDEFINED;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
JSContext* context = tf_task_get_context(task);
|
JSContext* context = tf_task_get_context(task);
|
||||||
int32_t type = _serialize_readInt32(buffer, size);
|
int32_t type = _serialize_readInt32(buffer, size);
|
||||||
JSValue result = JS_UNDEFINED;
|
JSValue result = JS_UNDEFINED;
|
||||||
@ -395,19 +394,17 @@ static JSValue _serialize_loadInternal(tf_task_t* task, tf_taskstub_t* from, con
|
|||||||
break;
|
break;
|
||||||
case kException:
|
case kException:
|
||||||
{
|
{
|
||||||
_serialize_readInt32(buffer, size);
|
|
||||||
JSValue error = JS_NewError(context);
|
|
||||||
int32_t length = _serialize_readInt32(buffer, size);
|
int32_t length = _serialize_readInt32(buffer, size);
|
||||||
|
result = JS_NewError(context);
|
||||||
for (int i = 0; i < length; ++i)
|
for (int i = 0; i < length; ++i)
|
||||||
{
|
{
|
||||||
JSValue key = _serialize_loadInternal(task, from, buffer, size, depth + 1);
|
JSValue key = _serialize_loadInternal(task, from, buffer, size, depth + 1);
|
||||||
JSValue value = _serialize_loadInternal(task, from, buffer, size, depth + 1);
|
JSValue value = _serialize_loadInternal(task, from, buffer, size, depth + 1);
|
||||||
const char* key_str = JS_ToCString(context, key);
|
const char* key_str = JS_ToCString(context, key);
|
||||||
JS_SetPropertyStr(context, error, key_str, value);
|
JS_SetPropertyStr(context, result, key_str, value);
|
||||||
JS_FreeCString(context, key_str);
|
JS_FreeCString(context, key_str);
|
||||||
JS_FreeValue(context, key);
|
JS_FreeValue(context, key);
|
||||||
}
|
}
|
||||||
result = error;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case kError:
|
case kError:
|
||||||
@ -432,4 +429,3 @@ static JSValue _serialize_loadInternal(tf_task_t* task, tf_taskstub_t* from, con
|
|||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user