Thread: Converting MINI-BASIC in MASM over to C++?

  1. #391
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Ah, I just realized I've been using gcc 4.3.0 for a long time! I thought I was using my trusted 3.4.x version!

    When I switch to the 3.4 version I get tuple errors too. I'm pretty useless with templates, so I'm not sure how to fix that...

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  2. #392
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Really, 4.3.0? Man, I guess it's time for an update.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  3. #393
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    I'm on "4.5-Something". ^_^

    Mats: I got the email regarding the issue (#2). I've suggested before that you close them both.

    Sebastian: Try changing the expansion--the crappy implementation macro--to specify the target template type of the nested template for every use. (The example explains the suggested modifications.)

    Soma

    Code:
    template <> template <>							\
    inline const tuple<2,type>& tuple<2,type>::operator = (const tuple<2,otype>& v)
    Code:
    template <> template <>							\
    inline const tuple<2,type>& tuple<2,type>::operator= <otype> (const tuple<2,otype>& v)

  4. #394
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    No go. And unfortunately, mingw's latest stable version of g++ is 3.4.5, and it won't compile it, either. I'll see if I can figure out a workaround.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  5. #395
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Well, it finally compiled after commenting out these lines:

    Code:
    //UINT32_TUPLE_SPECS(int16_t,uint16_t)
    //UINT32_TUPLE_SPECS(uint16_t,int16_t)
    ...although I have no idea if that might introduce any bugs. Also added a copy of Borlands touch.exe, since mingw doesn't come with one. And of course the configure and makefile changes.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  6. #396
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I'd recommend getting the GnuWin32 package, instead of using a 16-bit touch.

    But we could probably remove the need for reference to ranlib altogether.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #397
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I have fixed several minor issues
    • Saving to text-file (.BAS) (caused by calling fstream::write() with a zero length which set the "fail" bit).
    • Compile errors with older compiler.
    • Makefile problems.


    I still have a problem LOADING .BAS files.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  8. #398
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I have made a bit of progress with the loading .BAS files, but not quite there yet. Now it simply needs to stop when the file is consumed...

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  9. #399
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I just pushed another bit of updates.

    However, I think I've broken the "save" functionality, so I need to unbreak that. Nothing obvious shows up in the past updates, so I'm not sure what it is. Still works to save with "tsave".

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  10. #400
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    I just started on "string variables". It's nowhere near complete.

    Also done a whole lot more code cleanup.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  11. #401
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    I've been pretty busy lately, so I'm afraid I'm going to have to retire from the project (for now, at least). Is everything working well at the moment?
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  12. #402
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by Sebastiani View Post
    I've been pretty busy lately, so I'm afraid I'm going to have to retire from the project (for now, at least). Is everything working well at the moment?
    As far as I know, yes.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  13. #403
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Just spent some more time optimizing (more fun than adding new features!)

    Now I have a file that is 192KB and it takes between 50% to 70% of the time it took 7 changesets ago to run the BM2 benchmarks.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  14. #404
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Mats, I tried pulling the most recent snapshot, but it seems to be missing the include file mbstate.h?
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  15. #405
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Yes, I did notice that shortly after I submittied, but I had a problem uploading it (my wireless network sometimes decides that "Hey, I'm on a break right now, I'm not passing any packets to the rest of the world. Come back later"). As it was way too late in the evening anyways, I decided that was a good sign for "go to bed".

    I've posted it now.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Converting textBox1->Text into a basic string.
    By azjherben in forum C++ Programming
    Replies: 5
    Last Post: 06-07-2009, 08:27 PM
  2. [ANN] New script engine (Basic sintax)
    By MKTMK in forum C++ Programming
    Replies: 1
    Last Post: 11-01-2005, 10:28 AM
  3. what are your thoughts on visual basic?
    By orion- in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 09-22-2005, 04:28 AM
  4. VC++ 6 & MASM (eek)
    By cboard_member in forum C++ Programming
    Replies: 2
    Last Post: 07-16-2005, 10:00 AM