-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libqb refactor - Part 1 #453
libqb refactor - Part 1 #453
Conversation
Moves the qbs, command, and error handling APIs into separate .cpp files in libqb/src/. This makes only minor changes to the actual code beyond moving the logic, many global variables are left in place to be dealt with in further changes. Fixes: QB64-Phoenix-Edition#146
Are you sure going to replace |
I think @mkilgore replaced all instances of |
Two clarifications on that:
Edit: I guess a third one, it's still an inline function in the header to avoid any kind of performance penalty to calling a function that often, I don't intend to change that. |
There is another issue with that error checking I found yesterday when working on a new function, here simplified:
so after clicking continue in the MB the function correctly returns 0, but now the BASIC part:
this will always print "Success" even when continueing from an error, as the This scheme is probably involved in all conditional checks such as WHILE, UNTIL etc. and we really should rethink this. Oh, and I tried adding a |
@RhoSigma-QB64 I think it's correct in some respect, it's just not desirable behavior. I believe the That said, I don't know why we offer a In QBasic the |
Ah, |
I mean IMO it wouldn't be unreasonable to do a I'm not sure if we want to change that behavior now though, that's probably a separate conversation 🤷 |
As the title says, this is the first of several PRs to split out parts of libqb. For the most part the code is left as-is since it's otherwise hard to verify the changes are correct. You can see the current state of all the changes here, but it's much easier to review the commits in groups.
The main focus of this PR is separating out
qbs
andmem
handling fromlibqb.cpp
. Some other small things are moved and I also turned off C++ warning suppression (except forqbx.cpp
. In a later PR I'll turn it on for that as well).One code change I made was eliminate most direct users of
new_error
, replacing it with the inline functionis_error_pending()
. It was going to be too much of a mess to complete along with all the refactoring so I opted not to remove everynew_error
usage.A big win here is compiling the qbs functions with
-O2
. I haven't done many benchmarks of it, but some basic tests I did showed a 2x speed-up in some cases.Fixes: #146