Keep code within 80 columns.
This commit is contained in:
parent
8f313bf4ec
commit
aa9cfffb34
@ -175,7 +175,8 @@ static bool validateFn(WrenVM* vm, Value* args, int index, const char* argName)
|
|||||||
{
|
{
|
||||||
if (IS_FN(args[index]) || IS_CLOSURE(args[index])) return true;
|
if (IS_FN(args[index]) || IS_CLOSURE(args[index])) return true;
|
||||||
|
|
||||||
args[0] = OBJ_VAL(wrenStringConcat(vm, argName, -1, " must be a function.", -1));
|
args[0] = OBJ_VAL(wrenStringConcat(vm, argName, -1,
|
||||||
|
" must be a function.", -1));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -185,7 +186,8 @@ static bool validateNum(WrenVM* vm, Value* args, int index, const char* argName)
|
|||||||
{
|
{
|
||||||
if (IS_NUM(args[index])) return true;
|
if (IS_NUM(args[index])) return true;
|
||||||
|
|
||||||
args[0] = OBJ_VAL(wrenStringConcat(vm, argName, -1, " must be a number.", -1));
|
args[0] = OBJ_VAL(wrenStringConcat(vm, argName, -1,
|
||||||
|
" must be a number.", -1));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -196,7 +198,8 @@ static bool validateIntValue(WrenVM* vm, Value* args, double value,
|
|||||||
{
|
{
|
||||||
if (trunc(value) == value) return true;
|
if (trunc(value) == value) return true;
|
||||||
|
|
||||||
args[0] = OBJ_VAL(wrenStringConcat(vm, argName, -1, " must be an integer.", -1));
|
args[0] = OBJ_VAL(wrenStringConcat(vm, argName, -1,
|
||||||
|
" must be an integer.", -1));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +266,8 @@ static bool validateString(WrenVM* vm, Value* args, int index,
|
|||||||
{
|
{
|
||||||
if (IS_STRING(args[index])) return true;
|
if (IS_STRING(args[index])) return true;
|
||||||
|
|
||||||
args[0] = OBJ_VAL(wrenStringConcat(vm, argName, -1, " must be a string.", -1));
|
args[0] = OBJ_VAL(wrenStringConcat(vm, argName, -1,
|
||||||
|
" must be a string.", -1));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -659,7 +659,7 @@ Value wrenNewString(WrenVM* vm, const char* text, size_t length);
|
|||||||
// The caller is expected to fully initialize the buffer after calling.
|
// The caller is expected to fully initialize the buffer after calling.
|
||||||
Value wrenNewUninitializedString(WrenVM* vm, size_t length);
|
Value wrenNewUninitializedString(WrenVM* vm, size_t length);
|
||||||
|
|
||||||
// Creates a new string that is the concatenation of [left] and [right] (of
|
// Creates a new string that is the concatenation of [left] and [right] (with
|
||||||
// length [leftLength] and [rightLength], respectively). If -1 is passed
|
// length [leftLength] and [rightLength], respectively). If -1 is passed
|
||||||
// the string length is automatically calculated.
|
// the string length is automatically calculated.
|
||||||
ObjString* wrenStringConcat(WrenVM* vm, const char* left, int leftLength,
|
ObjString* wrenStringConcat(WrenVM* vm, const char* left, int leftLength,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user