Squirrel

The programming language
Welcome to Squirrel Sign in | Join | Help
in Search

SqPlus - Review version before update

Last post 07-13-2008, 7:41 AM by ats. 15 replies.
Page 1 of 2 (16 items)   1 2 Next >
Sort Posts: Previous Next
  •  05-12-2008, 1:00 PM 2504

    SqPlus - Review version before update

    Hello,

    I've been working at an update of SqPlus, containing accumulated features / bug fixes. Download:

      SqPlus-Review.zip

    Some areas are reworked (such as SquirrelVM) but the API is the same. Most of the test cases in UnitTest needed not modification. Hopefully it will not break too much.

    (There were problems with VM:s being deleted at wrong times before. The updated version works with Squirrel references any created / kept VM, so this should be fixed. Switching between multiple VMs should be safe now).

    If anyone finds problems with this update, please report here ASAP, since I'm up to speeed on this now. After that, maybe a more official update (Katsuaki?).

    For list of changes, see sqplus/changes.txt (highlights: new scheme for inheritence, generic Push/Get/Match handlers, automatic UTF8<->wchar_t conversion, Sandbox VM).

    Recent issues discussed here should be covered (including type safety in release mode).


    Question:

    There are many options available at the top of sqplus.h now, and people will configure this in different ways. I would like to break out a file SqPlusSetup.h with these settings.  Then it's a bit easier to update  SqPlus and keeping local project specific settings. Opinions?


    Regards
    // ATS

  •  05-18-2008, 8:29 AM 2519 in reply to 2504

    Re: SqPlus - Review version before update

    Good job, ATS

    > I would like to break out a file SqPlusSetup.h with these settings. 
    > Then it's a bit easier to update  SqPlus and keeping local project specific settings.
    > Opinions?

    This sounds quite smart. 
    So, is is possible to add a configuration for tentatively enabling string macro _T()
    for backward compatibility?
    (with a notation that urges the migration to the macro _SC())
    --
    K. Kawachi

  •  05-18-2008, 2:35 PM 2520 in reply to 2519

    Re: SqPlus - Review version before update

    Thanks, I'll go ahead and create the SqPlusSetup.h file.

    > So, is is possible to add a configuration for tentatively enabling string macro _T()
    > for backward compatibility?

    We can do this (but it's really only needed outside of Windows?). Something like this:
    #if !defined(_WIN32) && !defined(_WIN64)
      #ifndef _T
        #define _T _SC
      #endif
    #endif
    The potential problem with this (on Windows) is if one want to run Squirrel in different
    character mode (Squirrel in ANSI, app in wchar_t) (my app is like that). Then _T()
    would be broken, but _SC() and _sqT() would work.

    Should we look at updating the version of Squirrel in SVN? (a Squirrel update is about
    to come one of these days I think).

    Regards
    // ATS.
  •  05-21-2008, 9:12 AM 2525 in reply to 2520

    Re: SqPlus - Review version before update

    I've updated the SqPlus review version to include recent suggestions in this group:

      SqPlus-Review.zip

    If If you find any issues, please post here.

    Regards
    // ATS.
  •  05-24-2008, 2:31 AM 2530 in reply to 2525

    Re: SqPlus - Review version before update

    Hi,

    If no issues are found, I hope, I will merge the branch into trunk and
    release it as a next snapshot in a week or so.

    Regards
    --
    K. Kawachi
  •  06-19-2008, 7:18 AM 2570 in reply to 2504

    Re: SqPlus - Review version before update

    Is this version compatible with Squirrel 2.2?
  •  06-24-2008, 6:34 AM 2576 in reply to 2570

    Re: SqPlus - Review version before update

    Although I'm no "hardcore-Squirrel-user" I'm using it with the current version 2.2.1, meaning there are no obvious errors coming up etc...
  •  06-24-2008, 9:59 PM 2579 in reply to 2530

    Re: SqPlus - Review version before update

    Not too big of a deal, but the xxx71.vcproj files for all solutions are marked internally as Version="8.0" and will not open. Editing the file manually and changing the Version line to Version="7.10" fixes the problem.
  •  06-25-2008, 3:03 PM 2581 in reply to 2579

    Re: SqPlus - Review version before update

    Hmm, seems VS 8.0 does this on its own whenever it saves some project modification.

    OK, I'll do some manual editing as described.

    Regards
    // ATS


  •  06-25-2008, 5:24 PM 2582 in reply to 2581

    Re: SqPlus - Review version before update

    Here are a few things that break my particular build:

    1) SquirrelObject::GetBase() has been completely deprecated. Is there an alternative? I can't seem to find one.

    2) SqPlus::CreateConstructNativeClassInstance() no longer resides in the SqPlus scope and has been moved to SquirrelBindingsUtils.h/.cpp. I had to remove the SqPlus:: scope from the call.

    3) The systemlib is still not included by default. Script calls to things like srand() will fail without these changes to SquirrelVM.cpp:

    #include <sqstdsystem.h> //add this line
    ...

    void SquirrelVM::Init()
    {
    ...
        sqstd_register_systemlib(v); //add this line
    ...
    }


    If it is preferred that these are left out by default, how about adding those lines but enabling/disabling them with compiler directives?

    4) This problem didn't break my build, but caused the program to terminate at runtime: Older versions of SqPlus may let you get away with some sloppy class inheritance bindings. I was previously able to bind to a child class without binding the parent, and then fetch a parent native pointer using SquirrelObject::Get<ParentClass *>(). You can no longer get away with this, which is good.

    After dropping in my own version of GetBase() and making the minor changes listed in 2, 3, and 4 above,  my project seems to hum right along using the review version. Awesome job.
  •  06-26-2008, 4:48 AM 2585 in reply to 2582

    Re: SqPlus - Review version before update

    Thanks for feedback.

    1 - I looked in more than one year old SqPlus without finding SquirrelObject::GetBase(). What is it supposed to do? Get the base class in case the object contains a Squirrel class object?

    2 - I added a binding from the SqPlus namespace now. This function is big and not a template so it really belongs in a .cpp file.

    3 - Added a define to SqPlusSetup.h:

    // === Include system library bindings when creating VM:s in SquirrelVM::Init()
    // Define to bind to system lib when VM:s are created automatically in
    // SquirrelVM::Init()
    //#define SQPLUS_SQUIRRELVM_WITH_SYSTEMLIB

    4 - Nothing to do.

    Regards
    // ATS.

  •  06-26-2008, 9:34 AM 2586 in reply to 2585

    Re: SqPlus - Review version before update

    ats:

    1 - I looked in more than one year old SqPlus without finding SquirrelObject::GetBase(). What is it supposed to do? Get the base class in case the object contains a Squirrel class object?


    My mistake - not only did I add this myself, but I posted a message about it here: http://squirrel-lang.org/forums/thread/430.aspx. I have no memory of ever doing this :)

    Thanks





  •  07-05-2008, 6:11 AM 2608 in reply to 2504

    Re: SqPlus - Review version before update

    I check out r190 and it wasn't able to compile due to a smart pointer linker error. I checked out r175 and can compile fine.

    sqplus.lib(SqPlus.obj) : error LNK2019: unresolved external symbol "unsigned char * __cdecl getSmartPointerPointee(unsigned char *)" (?getSmartPointerPointee@@YAPAEPAE@Z) referenced in function "int __cdecl SqPlus::getInstanceVarInfo(struct StackHandler &,struct SqPlus::VarRef * &,void * &)" (?getInstanceVarInfo@SqPlus@@YAHAAUStackHandler@@AAPAUVarRef@1@AAPAX@Z)

    Release/testSqPlus.exe : fatal error LNK1120: 1 unresolved externals

  •  07-05-2008, 5:19 PM 2611 in reply to 2608

    Re: SqPlus - Review version before update

    I don't have much to do with that code, but the header file has  a comment:

    // SqPlusSmartPointer.h
    // SqPlus smart pointer member function support created by James Whitworth.
    // Modular integration 07/11/07 James Whitworth.
    // you must define the function:
    // unsigned char* getSmartPointerPointee(unsigned char*) {
    //         return &(MySmartPointer->pointee);
    // }
    // somewhere in your program so it can correctly lookup member variables on the class pointed to
    // by your smart pointer.

    so it seems responsibility is on app to provide the missing function.

    Probably R175 was compiled without SQPLUS_SMARTPOINTER_OPT while
    it is now enabled by default (which is no good when not using it).

    Can someone involved with SQPLUS_SMARTPOINTER_OPT correct it?

    Regards
    // ATS.

  •  07-13-2008, 1:56 AM 2640 in reply to 2504

    Re: SqPlus - Review version before update

    Hi,

    A new snapshot 20080713 is released:
     http://wiki.squirrel-lang.org/default.aspx/SquirrelWiki/SqPlus.html

    The snapshot includes a lot of updates, extensions and improvements.
    Many many thanks for the contributions.

    Please see the details in sqplus/changes.txt.
    --
    K. Kawachi
Page 1 of 2 (16 items)   1 2 Next >
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems