mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-31 02:19:09 +00:00
Codechange: use std::string_view for sq_throwerror
This commit is contained in:
3
src/3rdparty/squirrel/include/squirrel.h
vendored
3
src/3rdparty/squirrel/include/squirrel.h
vendored
@@ -306,8 +306,7 @@ SQRESULT sq_call(HSQUIRRELVM v,SQInteger params,SQBool retval,SQBool raiseerror,
|
||||
SQRESULT sq_resume(HSQUIRRELVM v,SQBool retval,SQBool raiseerror);
|
||||
const SQChar *sq_getlocal(HSQUIRRELVM v,SQUnsignedInteger level,SQUnsignedInteger idx);
|
||||
const SQChar *sq_getfreevariable(HSQUIRRELVM v,SQInteger idx,SQUnsignedInteger nval);
|
||||
SQRESULT sq_throwerror(HSQUIRRELVM v,const SQChar *err, SQInteger len = -1);
|
||||
inline SQRESULT sq_throwerror(HSQUIRRELVM v, std::string_view err) { return sq_throwerror(v, err.data(), err.size()); }
|
||||
SQRESULT sq_throwerror(HSQUIRRELVM v,std::string_view err);
|
||||
void sq_reseterror(HSQUIRRELVM v);
|
||||
void sq_getlasterror(HSQUIRRELVM v);
|
||||
|
||||
|
4
src/3rdparty/squirrel/squirrel/sqapi.cpp
vendored
4
src/3rdparty/squirrel/squirrel/sqapi.cpp
vendored
@@ -930,9 +930,9 @@ void sq_resetobject(HSQOBJECT *po)
|
||||
po->_unVal.pUserPointer=nullptr;po->_type=OT_NULL;
|
||||
}
|
||||
|
||||
SQRESULT sq_throwerror(HSQUIRRELVM v,const SQChar *err, SQInteger len)
|
||||
SQRESULT sq_throwerror(HSQUIRRELVM v,std::string_view error)
|
||||
{
|
||||
v->_lasterror=SQString::Create(_ss(v),err, len);
|
||||
v->_lasterror=SQString::Create(_ss(v),error);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user