Activity for Sqrat

  • Patrix9999 Patrix9999 created merge request #27 on Code

    Added Sqrat::ClassType::IsValidInstance static method:

  • Wizzard Wizzard modified a comment on merge request #26

    Just to clarify: PushVarR exists to force something to be a reference even when its not, while PushVar can do copies and references

  • Wizzard Wizzard posted a comment on merge request #26

    Just to clarify: PushVarR exists to force something to be a reference even when its not

  • Wizzard Wizzard updated merge request #26

    Replaced Sqrat::PushVar to Sqrat::PushVarR in Sqrat::Function Evaluate/Execute methods.

  • Wizzard Wizzard posted a comment on merge request #26

    Glad it works!

  • Patrix9999 Patrix9999 posted a comment on merge request #26

    It works, i think it's safe to say that closing this merge request is the best approach, because this might break too many things.

  • Patrix9999 Patrix9999 posted a comment on merge request #26

    I'll try this approach and let you know about the results.

  • Patrix9999 Patrix9999 modified a comment on merge request #26

  • Patrix9999 Patrix9999 posted a comment on merge request #26

    About that: ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Called by Sqrat::PushVar to put a class object on the stack /// /// \param vm Target VM /// \param value Value to push on to the VM's stack /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// static void push(HSQUIRRELVM vm, const T& val) { if (ClassType<T>::hasClassData(vm)) ClassType<T>::PushInstanceCopy(vm,...

  • Patrix9999 Patrix9999 posted a comment on merge request #26

    About that: ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// /// Called by Sqrat::PushVar to put a class object on the stack /// /// \param vm Target VM /// \param value Value to push on to the VM's stack /// ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// static void push(HSQUIRRELVM vm, const T& val) { if (ClassType<T>::hasClassData(vm)) ClassType<T>::PushInstanceCopy(vm,...

  • Wizzard Wizzard modified a comment on merge request #26

    Make sure you are calling Evaluate/Execute with the correct template typenames. Do not let the compiler guess the argument types for you

  • Wizzard Wizzard posted a comment on merge request #26

    Make sure you are calling Evaluate/Execute with the correct templates. Do not let the compiler guess them for you

  • Wizzard Wizzard posted a comment on merge request #26

    If the current way doesn't work (verifiable using a debugger and some breakpoints to see if its triggering the correct code) and can't be made to work, then I'd be willing to accept this change as long as it doesn't have unforeseen consequences. It looks like it would force everything to be references always, which would definitely cause issues.

  • Wizzard Wizzard posted a comment on merge request #26

    Not that it was thoroughly tested, but notice how in sqratTypes.h there are overloads for references, pointers, and even SharedPtr that all use PushInstance rather than PushInstanceCopy. If the template magic is happening correctly, then this should be happening already.

  • Patrix9999 Patrix9999 created merge request #26 on Code

    Replaced Sqrat::PushVar to Sqrat::PushVarR in Sqrat::Function Evaluate/Execute methods.

  • Wizzard Wizzard merged merge request #25 on Code

    Fixed sqrat not being completely updated to squirrel 3.2

  • Patrix9999 Patrix9999 created merge request #25 on Code

    Fixed sqrat not being completely updated to squirrel 3.2

  • Wizzard Wizzard merged merge request #24 on Code

    Updated sqrat for squirrel 3.2 version

  • Patrix9999 Patrix9999 created merge request #24 on Code

    Updated sqrat for squirrel 3.2 version

  • Wizzard Wizzard merged merge request #23

    .SquirrelProp method for Sqrat::Class

  • Patrix9999 Patrix9999 posted a comment on merge request #23

    The comment was corrected.

  • Patrix9999 Patrix9999 modified a comment on merge request #23

    These method(s) are useful when you don't want to add _get & _set just to add raw closures as getter & setter. They can be utilized to make a property that can return multiple data types.

  • Wizzard Wizzard posted a comment on merge request #23

    The comment on the one with a getter+setter says it's read-only, but otherwise looks good

  • Patrix9999 Patrix9999 posted a comment on merge request #23

    Thise method(s) are useful when you don't want to add _get & _set just to add raw closures as getter & setter. They can be utilized to make a property that can return multiple data types.

  • Patrix9999 Patrix9999 created merge request #23

    .SquirrelProp method for Sqrat::Class

  • Wizzard Wizzard merged merge request #22

    Arguments validation for .SquirrelFunc method in Sqrat::Array & Sqrat::Class

  • Patrix9999 Patrix9999 created merge request #22

    Arguments validation for .SquirrelFunc method in Sqrat::Array & Sqrat::Class

  • Wizzard Wizzard merged merge request #21

    Added possibility to bind temporary cpp object

  • Patrix9999 Patrix9999 created merge request #21

    Added possibility to bind temporary cpp object

  • Wizzard Wizzard merged merge request #20

    added missing sq_pop, added #undef GetObject

  • Patrix9999 Patrix9999 posted a comment on merge request #20

    Now :)

  • Wizzard Wizzard posted a comment on merge request #20

    The merge request still has zero commits. Let me know when it has content

  • Patrix9999 Patrix9999 created merge request #20

    added missing sq_pop, added #undef GetObject

  • Wizzard Wizzard merged merge request #19

    Added Sqrat::Var<SQUserPointer> support

  • Patrix9999 Patrix9999 posted a comment on merge request #19

    Done

  • Wizzard Wizzard posted a comment on merge request #19

    Tabs to spaces and should be good :)

  • Patrix9999 Patrix9999 posted a comment on merge request #19

    Done.

  • Patrix9999 Patrix9999 modified a comment on merge request #19

    Similarly, maybe moving Sqrat::Var<std::nullpt_t> would also be good idea to this file? What do you think?

  • Patrix9999 Patrix9999 posted a comment on merge request #19

    Ok, i'll make some adjustments.

  • Patrix9999 Patrix9999 posted a comment on merge request #19

    Similarly, maybe moving Sqrat::Var<std::nullpt_t> would also be good idea to this file? What do you think?</std::nullpt_t>

  • Wizzard Wizzard posted a comment on merge request #19

    That would be more fitting. It'd also make sense to put sqratNull.h in there

  • Patrix9999 Patrix9999 modified a comment on merge request #19

    No problem, i'll correct it, one question, maybe it would be more fitting to move the code into sqratTypes.h file?

  • Patrix9999 Patrix9999 posted a comment on merge request #19

    No problem, i'll correct it, one question, maybe it would be more fitting to move it into sqratTypes.h file?

  • Wizzard Wizzard posted a comment on merge request #19

    Needs the tabs to be spaces so it matches the current code but then can be merged

  • Patrix9999 Patrix9999 created merge request #19

    Added Sqrat::Var<SQUserPointer> support

  • Wizzard Wizzard merged merge request #18

    Fixed possible compiler error in SqratBytecode.h

  • Patrix9999 Patrix9999 created merge request #18

    Fixed possible compiler error in SqratBytecode.h

  • Wizzard Wizzard merged merge request #17

    Add null support

  • Paul C Paul C created merge request #17

    Add null support

  • Wizzard Wizzard merged merge request #16

    Arguments validation for .SquirrelFunc method

  • Patrix9999 Patrix9999 created merge request #16

    Arguments validation for .SquirrelFunc method

  • Wizzard Wizzard modified a comment on ticket #107

    Glad you got it worked out! The way I chose to do errors is pretty weird, but I was trying to make it backwards compatible because Sqrat started off with no error checking at all! (it actually works quite a bit faster too when you compile with error checking off)

  • Wizzard Wizzard modified ticket #107

    Different behavior if calling GetValue before SetValue on table

  • Wizzard Wizzard posted a comment on ticket #107

    Glad you got it worked out! The way I chose to do errors is pretty weird, but I was trying to make it backwards compatible because Sqrat started off with no error checking at all!

  • Omega Omega posted a comment on ticket #107

    Hi Wizzard, it looks like I didn't read the API documentation very well. It's setting the error in the VM and it needs to be cleared. Clearing the error between the GetValue and SetValue fixed it: Sqrat::Error::Clear(vm); It's a bit unfortunate you have to know to do this but no change to the code should be needed.

  • Omega Omega posted a comment on ticket #107

    Hi Wizzard. I was able to isolate the problem in the code I was writing to this behavior in Sqrat/squirrel. I haven't taken the time yet to find and fix the issue. I was hoping you had some idea what might be going wrong. I can keep looking at it if you like. Below is the output I got from the test case. In both cases it will call the SetValue but only case A returns the table in the last GetValue call (the one after SetValue). Test Case A =========== Set Get OK Test Case B =========== Set Get F...

  • Wizzard Wizzard modified ticket #107

    Different behavior if calling GetValue before SetValue on table

  • Wizzard Wizzard posted a comment on ticket #107

    Can you tell me the output of your example? I'm willing to accept a pull request submitted by you that fixes this behavior and try to help you work through it if needed.

  • Omega Omega created ticket #107

    Different behavior if calling GetValue before SetValue on table

  • Wizzard Wizzard modified ticket #106

    HSQAPI and typeof (compile error)

  • Wizzard Wizzard merged merge request #15

    Fix compile error for gcc

  • Wizzard Wizzard posted a comment on ticket #106

    type_of should be fine

  • Patrix9999 Patrix9999 created merge request #15

    Fix compile error for gcc

  • Patrix9999 Patrix9999 posted a comment on ticket #106

    Propably the best name for this function would be: type_of. It kinda breaks the naming rule, but it's the most elegant equivalent that i thought of.

  • Patrix9999 Patrix9999 posted a comment on merge request #14

    I've discovered a new issue with changes made in this MR. https://sourceforge.net/p/scrat/sqrat/106/ Please, give me some feedback.

  • Patrix9999 Patrix9999 created ticket #106

    HSQAPI and typeof (compile error)

  • Wizzard Wizzard modified ticket #105

    Sqrat::Function fails to release env ref when the obj closure is null

  • Wizzard Wizzard posted a comment on ticket #105

    I think you should pass valid functions/closures to Sqrat::Function instead of null. I remember trying to look through this when it was first posted to figure out what the exact behavior should be but getting sidetracked. I'm going to close this for now, but if the behavior could be made more convenient then feel free to submit a pull request with some changes!

  • Wizzard Wizzard posted a comment on merge request #14

    I went ahead and merged this. Hopefully incompatibilities are easily resolved!

  • Wizzard Wizzard merged merge request #14

    Added missing function in HSQAPI struct

  • Patrix9999 Patrix9999 created merge request #14

    Added missing function in HSQAPI struct

  • shatteredmoon shatteredmoon created ticket #105

    Sqrat::Function fails to release env ref when the obj closure is null

  • Wizzard Wizzard modified ticket #103

    Function::Evaluate doesn't handle native closures correctly when SCRAT_NO_ERROR_CHECKING is undefined

  • Wizzard Wizzard posted a comment on ticket #103

    Fixed by https://sourceforge.net/p/scrat/code/ci/6758c0010cdcabab0bcc033f64a4d01d7ec3a9a9/

  • Wizzard Wizzard merged merge request #13

    Pull request for Issue #103: Function::Evaluate doesn't handle native closures correctly when SCRAT_NO_ERROR_CHECKING is undefined

  • shatteredmoon shatteredmoon created merge request #13

    Pull request for Issue #103: Function::Evaluate doesn't handle native closures correctly when SCRAT_NO_ERROR_CHECKING is undefined

  • Wizzard Wizzard modified ticket #104

    Setting an object equal to itself yields unexpected results

  • Wizzard Wizzard posted a comment on ticket #104

    Fixed in https://sourceforge.net/p/scrat/code/ci/36392c35317708a3616f24f6742d163002b8ee7a/

  • Wizzard Wizzard merged merge request #12

    Pull request for Issue #104 fix

  • shatteredmoon shatteredmoon created merge request #12

    Pull request for Issue #104 fix

  • shatteredmoon shatteredmoon modified a comment on ticket #104

    Sorry, it's a bit more complicated than that: error C2678: binary '!=': no operator found which takes a left-hand operand of type 'HSQOBJECT' (or there is no acceptable conversion)

  • shatteredmoon shatteredmoon posted a comment on ticket #104

    Yes, this does the trick, thanks!

  • shatteredmoon shatteredmoon modified a comment on ticket #104

    Nevermind, just saw your reply

  • shatteredmoon shatteredmoon posted a comment on ticket #104

    This works, but could probably be done better. I'm having to use DefaultVM::Get() because in my project I hit various points where either the left hand object has a null vm or the right hand object has a null vm, and either case will crash. Object& operator=(const Object& so) { if(*this != so) { if(release) { Release(); } vm = so.vm; obj = so.obj; sq_addref(vm, &GetObject()); } return *this; } bool operator!= ( const Object& so ) const { return !( *this == so ); } bool operator== ( const Object&...

  • Wizzard Wizzard posted a comment on ticket #104

    I mistook HSQOBJECT to by a typedef to a pointer. As long as every Sqrat::Object has its own unique HSQOBJECT, the following will work as far as I can tell. Object& operator=(const Object& so) { if(this != &so) { if(release) { Release(); } vm = so.vm; obj = so.obj; sq_addref(vm, &GetObject()); } return *this; }

  • shatteredmoon shatteredmoon posted a comment on ticket #104

    Sorry, it's a bit more complicated than that: error C2678: binary '!=': no operator found which takes a left-hand operand of type 'HSQOBJECT' (or there is no acceptable conversion) SqPlus uses this for operator== bool SquirrelObject::operator == (const SquirrelObject &o) { bool cmp = false; HSQUIRRELVM v = SquirrelVM::GetVMPtr(); int oldtop = (int)sq_gettop(v); sq_pushobject(v, GetObjectHandle()); sq_pushobject(v, o.GetObjectHandle()); if(sq_cmp(v) == 0) cmp = true; sq_settop(v, oldtop); return cmp;...

  • Wizzard Wizzard posted a comment on ticket #104

    If you could check if that works and do a pull request it'd be appreciated!

  • Wizzard Wizzard posted a comment on ticket #104

    The sq_resetobject call probably needs to stay immediately after the sq_release call (problems were introduced by not following this convention in other places before), and so the issue should be fixed by checking if the object is the same. I also took the liberty of removing the release = so.release part because it felt correct to, but that might be wrong. Object& operator=(const Object& so) { if(obj != so.obj) { if(release) { Release(); } vm = so.vm; obj = so.obj; sq_addref(vm, &GetObject()); }...

  • Wizzard Wizzard posted a comment on ticket #103

    if (SQ_SUCCEEDED(sq_getclosureinfo(vm, -2, &nparams, &nfreevars)) && (nparams != 1) && (nparams != 0)) {

  • Wizzard Wizzard posted a comment on ticket #103

    This is definitely an issue with Sqrat. You're not really supposed to call sq_getclosureinfo on a native closure. The most correct thing to do would be to ignore this check if it's a native closure. However, it might also suffice just to add a nparams != 0 check to all the Evaluate functions. I'll accept a pull request if you add the checks in and can verify it fixes the issue.

  • shatteredmoon shatteredmoon posted a comment on ticket #104

    Sorry, meant to say "or the intrinsic sq_resetobject should be rethought."

  • shatteredmoon shatteredmoon created ticket #104

    Setting an object equal to itself yields unexpected results

  • shatteredmoon shatteredmoon created ticket #103

    Function::Evaluate doesn't handle native closures correctly when SCRAT_NO_ERROR_CHECKING is undefined

  • Wizzard Wizzard posted a comment on ticket #102

    If you're able to submit a pull request that fixes these compiler-specific warnings without changing any functionality, I'll accept it.

  • shatteredmoon shatteredmoon created ticket #102

    Binding a member float var produces verbose compiler warnings in MSVC 2017

  • Wizzard Wizzard modified ticket #101

    Missing sq->getfloat pointer assignment in sqratimport.cpp

  • Wizzard Wizzard posted a comment on ticket #101

    Merged fix by Patrix

  • Wizzard Wizzard merged merge request #11

    #101 Fix (sq->getfloat)

  • Patrix9999 Patrix9999 created merge request #11

    #101 Fix (sq->getfloat)

  • Wizzard Wizzard modified ticket #101

    Missing sq->getfloat pointer assignment in sqratimport.cpp

1 >