Just to clarify: PushVarR exists to force something to be a reference even when its not, while PushVar can do copies and references
Just to clarify: PushVarR exists to force something to be a reference even when its not
Replaced Sqrat::PushVar to Sqrat::PushVarR in Sqrat::Function Evaluate/Execute methods.
Glad it works!
Make sure you are calling Evaluate/Execute with the correct template typenames. Do not let the compiler guess the argument types for you
Make sure you are calling Evaluate/Execute with the correct templates. Do not let the compiler guess them for you
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.
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.
Fixed sqrat not being completely updated to squirrel 3.2
Updated sqrat for squirrel 3.2 version
.SquirrelProp method for Sqrat::Class
The comment on the one with a getter+setter says it's read-only, but otherwise looks good
Arguments validation for .SquirrelFunc method in Sqrat::Array & Sqrat::Class
Added possibility to bind temporary cpp object
added missing sq_pop, added #undef GetObject
The merge request still has zero commits. Let me know when it has content
Added Sqrat::Var<SQUserPointer> support
Tabs to spaces and should be good :)
That would be more fitting. It'd also make sense to put sqratNull.h in there
Needs the tabs to be spaces so it matches the current code but then can be merged
Fixed possible compiler error in SqratBytecode.h
Add null support
Arguments validation for .SquirrelFunc method
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)
Different behavior if calling GetValue before SetValue on table
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!
Different behavior if calling GetValue before SetValue on table
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.
HSQAPI and typeof (compile error)
Fix compile error for gcc
type_of should be fine
Sqrat::Function fails to release env ref when the obj closure is null
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!
I went ahead and merged this. Hopefully incompatibilities are easily resolved!
Added missing function in HSQAPI struct
Function::Evaluate doesn't handle native closures correctly when SCRAT_NO_ERROR_CHECKING is undefined
Fixed by https://sourceforge.net/p/scrat/code/ci/6758c0010cdcabab0bcc033f64a4d01d7ec3a9a9/
Pull request for Issue #103: Function::Evaluate doesn't handle native closures correctly when SCRAT_NO_ERROR_CHECKING is undefined
Setting an object equal to itself yields unexpected results
Fixed in https://sourceforge.net/p/scrat/code/ci/36392c35317708a3616f24f6742d163002b8ee7a/
Pull request for Issue #104 fix
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; }
If you could check if that works and do a pull request it'd be appreciated!
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()); }...
if (SQ_SUCCEEDED(sq_getclosureinfo(vm, -2, &nparams, &nfreevars)) && (nparams != 1) && (nparams != 0)) {
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.
If you're able to submit a pull request that fixes these compiler-specific warnings without changing any functionality, I'll accept it.
Missing sq->getfloat pointer assignment in sqratimport.cpp
Merged fix by Patrix
#101 Fix (sq->getfloat)
Missing sq->getfloat pointer assignment in sqratimport.cpp
I'll merge a pull request if it's made, otherwise this is going to go into a pile of things to do "someday" :)
Compiler warnings in SQRat code
Cleaning up old issue that was already fixed AFAIK
rename value to val so it is not shadowing the member variable
Function::IsNull() should be const
Fixed in merge request
Some strings are missing _SC()
Fixed in merge request
Added Script class methods SaveBytecode / LoadBytecode (issue #89)
VS2015 fixes and make Function::IsNull() const
fix: some strings are missing _SC()
Are your notes specifically referencing this patch? As a side note (since you seem to be doing some work on Sqrat at the moment): If you manage to submit a pull request that cleans up the accepted issues, I'd greatly appreciate it. Currently, I'm just stacking up what little issues there are with Sqrat. My thoughts are that I'll get around to it sometime, but I'm busy developing other software.
In some parts of the code, I think it's using c_str on std::string, which is a similar issue
Similar to GitHub: create a fork, and then request it be merged
Some strings are missing _SC()
Function::IsNull() should be const
sizeof difference with wchar_t
I don't think you should be using that default compiler error handler. It doesn't protect against large errors, which seems wrong at first glance. I do see that it cuts the string early for wchar_t, but it seems to have bigger problems. Note: sqratVM.h is a third-party "helper" included in Sqrat for convenience. It isn't representative of the quality of the rest of the library.
Crash in sqrat_importbin with OS X 10.13.2
The Sqrat import library is not highly tested. I never worked on it personally either. For all I know, the import library was more of a proof-of-concept than a production-quality library. So, I'm unable to easily help you with your issue.
Looks good! I try to fix any warnings I see in my use, but I only compile using GCC and I also don't use all the features of Sqrat in my projects (i.e. not all templates compiled)
Looks good! I try to fix any warnings I see in my use, but I only compile using GCC and I also don't use all the features of Sqrat in my projects.
Compiler warnings in SQRat code
Memory leak with NO_GARBAGE_COLLECTOR
Sweet! C++11 definitely would've made Sqrat much less lengthy.
Manual bindings should be much better in that regard, as Sqrat was made with functionality in mind, and not embedded system performance. Good luck!
Was looking through the code a bit and it seems pretty consistent that sq_release is only called on objects that have a lifetime less than the VM. So, you might run into a few more issues with Sqrat and NO_GARBAGE_COLLECTOR
Possible that you can narrow that down? Is it the sq_release calls? There are a quite a few sq_addref calls with no sq_release corresponding to them.
Check if cleanup_hook is even ran by Squirrel when your NO_GARBAGE_COLLECTOR define is enabled. If it isn't, then you might be able to add some type of atexit function to delete all ClassData.
I'm not familiar with that Squirrel define, but class definitions definitely do create objects in the Squirrel VM. They're intended to never be cleaned up though (only at exit). I never thought they should be explicitly cleaned by the library (because the garbage collector does that).
I know small bug fixes and typo fixes are not considered to contain a copyright. I just wonder how big changes need to be before they are considered to have a copyright. The referenced commits do very straight-forward, easily-reproduced things. Anyways, I posted a link to this issue on the merge requests that spawned those commits. So, the contributors will be messaged if they have notifications turned on.
I provided access
Relicense Sqrat to match Squirrel License?
takecheeze has agreed https://sourceforge.net/p/scrat/code/merge-requests/3/
See https://sourceforge.net/p/scrat/sqrat/94/
Is it OK to relicense Sqrat under the MIT license given your contribution?
Is it OK to relicense Sqrat under the MIT license given your contribution?
Is it OK to relicense Sqrat under the MIT license given your contribution?
I sent out some messages anyways, despite thinking it's fine to change as is
Is it OK to relicense this code under the MIT license?
That unknown commit is by Tassos (https://sourceforge.net/p/scrat/code/merge-requests/1/) I believe that because those contributions are so tiny, and the new license terms are extremely similar, it is safe to change the license without receiving permission from those contributors. Thoughts?
I sent an email to Toji to see if he agrees to have Sqrat's license changed. It's surprising (and a bit suspect) to me that Fagiano would merge parts of Sqrat into Squirrel. However, changing the license isn't a big deal as long as everyone agrees.
I'm interested in why you would actually need a different non-restrictive license
My code can have its license changed, but I don't own all the code.
My code can have its license changed, but I don't own all the copyrights.
My code can have its copyright changed, but I don't own all the copyrights.
Try the following .Overload<void()>("Rewind", &ReadOnlyPacket::Rewind) .Overload<void(uint32_t)>("Rewind",...
Try the following .Overload<void()>("Rewind", &ReadOnlyPacket::Rewind) .Overload<void(uint32_t)>("Rewind",...
Cannot Bind Overloaded Method