Merge pull request #30 from FabianWolff/master
Fix minor spelling mistakes
This commit is contained in:
commit
6db0aa2095
@ -560,7 +560,7 @@ sets the name of the native closure at the position idx in the stack. the name o
|
|||||||
:param const SQChar * typemask: defines a mask to validate the parametes types passed to the function. if the parameter is NULL no typechecking is applyed(default).
|
:param const SQChar * typemask: defines a mask to validate the parametes types passed to the function. if the parameter is NULL no typechecking is applyed(default).
|
||||||
:remarks: The typemask consists in a zero teminated string that represent the expected parameter type. The types are expressed as follows: 'o' null, 'i' integer, 'f' float, 'n' integer or float, 's' string, 't' table, 'a' array, 'u' userdata, 'c' closure and nativeclosure, 'g' generator, 'p' userpointer, 'v' thread, 'x' instance(class instance), 'y' class, 'b' bool. and '.' any type. The symbol '|' can be used as 'or' to accept multiple types on the same parameter. There isn't any limit on the number of 'or' that can be used. Spaces are ignored so can be inserted between types to increase readbility. For instance to check a function that espect a table as 'this' a string as first parameter and a number or a userpointer as second parameter, the string would be "tsn|p" (table,string,number or userpointer). If the parameters mask is contains less parameters than 'nparamscheck' the remaining parameters will not be typechecked.
|
:remarks: The typemask consists in a zero teminated string that represent the expected parameter type. The types are expressed as follows: 'o' null, 'i' integer, 'f' float, 'n' integer or float, 's' string, 't' table, 'a' array, 'u' userdata, 'c' closure and nativeclosure, 'g' generator, 'p' userpointer, 'v' thread, 'x' instance(class instance), 'y' class, 'b' bool. and '.' any type. The symbol '|' can be used as 'or' to accept multiple types on the same parameter. There isn't any limit on the number of 'or' that can be used. Spaces are ignored so can be inserted between types to increase readbility. For instance to check a function that espect a table as 'this' a string as first parameter and a number or a userpointer as second parameter, the string would be "tsn|p" (table,string,number or userpointer). If the parameters mask is contains less parameters than 'nparamscheck' the remaining parameters will not be typechecked.
|
||||||
|
|
||||||
Sets the parameters validation scheme for the native closure at the top position in the stack. Allows to validate the number of paramters accepted by the function and optionally their types. If the function call do not comply with the parameter schema set by sq_setparamscheck, an exception is thrown.
|
Sets the parameters validation scheme for the native closure at the top position in the stack. Allows to validate the number of parameters accepted by the function and optionally their types. If the function call do not comply with the parameter schema set by sq_setparamscheck, an exception is thrown.
|
||||||
|
|
||||||
*.eg*
|
*.eg*
|
||||||
|
|
||||||
|
2
sq/sq.c
2
sq/sq.c
@ -205,7 +205,7 @@ int getargs(HSQUIRRELVM v,int argc, char* argv[],SQInteger *retval)
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if this point is reached an error occured
|
//if this point is reached an error occurred
|
||||||
{
|
{
|
||||||
const SQChar *err;
|
const SQChar *err;
|
||||||
sq_getlasterror(v);
|
sq_getlasterror(v);
|
||||||
|
@ -103,10 +103,10 @@ static SQInteger _sqstd_aux_printerror(HSQUIRRELVM v)
|
|||||||
const SQChar *sErr = 0;
|
const SQChar *sErr = 0;
|
||||||
if(sq_gettop(v)>=1) {
|
if(sq_gettop(v)>=1) {
|
||||||
if(SQ_SUCCEEDED(sq_getstring(v,2,&sErr))) {
|
if(SQ_SUCCEEDED(sq_getstring(v,2,&sErr))) {
|
||||||
pf(v,_SC("\nAN ERROR HAS OCCURED [%s]\n"),sErr);
|
pf(v,_SC("\nAN ERROR HAS OCCURRED [%s]\n"),sErr);
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
pf(v,_SC("\nAN ERROR HAS OCCURED [unknown]\n"));
|
pf(v,_SC("\nAN ERROR HAS OCCURRED [unknown]\n"));
|
||||||
}
|
}
|
||||||
sqstd_printcallstack(v);
|
sqstd_printcallstack(v);
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQInteger *outlen
|
|||||||
else {
|
else {
|
||||||
n++;
|
n++;
|
||||||
if( nparam > sq_gettop(v) )
|
if( nparam > sq_gettop(v) )
|
||||||
return sq_throwerror(v,_SC("not enough paramters for the given format string"));
|
return sq_throwerror(v,_SC("not enough parameters for the given format string"));
|
||||||
n = validate_format(v,fmt,format,n,w);
|
n = validate_format(v,fmt,format,n,w);
|
||||||
if(n < 0) return -1;
|
if(n < 0) return -1;
|
||||||
SQInteger addlen = 0;
|
SQInteger addlen = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user