-
Notifications
You must be signed in to change notification settings - Fork 1
Make NewRgn & friends work #16
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
Conversation
|
Further report from mastodon:
|
|
Just an update on this: I have been working on this, but without conclusion so far. I need to get some clarity on how the different pointer and reference behaviors work before I can properly fix things; and I need to clean up the Take the case of Things become muddy once you have a type ( In the short term I have (non-pushed) work that is aimed at making this type handling stuff testable via the unix coverage build, instead of requiring to run in an emulator, by having a do-nothing implementation of some routines like |
.. it has the packages needed to `make mkapi` preinstalled.
adapted from Inside Macintosh Volume I page 182
8967de9 to
4d29233
Compare
|
I've updated this PR. Now some stuff about mkapi-generated bindings is tested, especially when it comes to RegionHandle/RegionPtr/Region & WindowPtr / GrafPtr / GrafPort. Now, the simulation looks slightly sane. Without a complete test program, I wasn't able to confirm or refute the problems with UnionRgn. |
99b67de to
56263ea
Compare
& do some testing of mkapi-generated bindings
|
static const mp_rom_obj_tuple_t common_103 = ROM_TUPLE(MP_ROM_INT(offsetof(QDGlobals, thePort) | UCTYPE_AGG(PTR)), MP_ROM_PTR((void*)&GrafPtr_obj));
…
{ MP_ROM_QSTR(MP_QSTR_thePort), MP_ROM_PTR((void*)&common_103) },however, since the field is a UCTYPE_AGG(PTR) the 3rd arg should be the dereferenced type (GrafPort) not the pointer type (GrafPtr). |
|
qdGlobals also seem to be behaving now: The seemingly extraneous |
|
would or the special attribute named Otherwise, Python doesn't have any kind of postfix operators to repurpose. |
|
I've added some fresh issues for things that are still rough edges. I think this is enough of an improvement to merit being merged. |
Over on Mastodon, Scott reported that NewRgn didn't work.
There are two problems: First, the API translator is treating RgnHandle as an opaque type (which it's not actually). Second, opaque type handling was wrong.
This fixes the 2nd problem, and also a problem with generated tables for describing aggregates of scalars (e.g., pointer-to-char) in non-opaque types.