linappleii / linapple

Apple 2e emulator
GNU General Public License v2.0
138 stars 61 forks source link

Convert BOOL, TRUE, FALSE, etc. #68

Open maxolasersquad opened 4 years ago

maxolasersquad commented 4 years ago

In some files, e.g. Registry.cpp there are uses of VOID, BOOL, etc. Some Googling indicates these are artifacts of win32 programming. What I couldn't tell for sure is if it is safe to just move these to the standard lower-case versions. It looks like VOID can safely be converted, but I'm not so sure about the other keywords.

ghedger commented 4 years ago

As a general rule, I'm in favor of anything overtly Windows-ey becoming closer to language intrinsics (e.g. VOID becomes void, BOOL becomes bool, FALSE -> false, etc.) It's probably best to do these kinds of wide-ranging changes now or in the very near future, not too far removed from the wholesale formatting changes you completed.

rhaleblian commented 4 years ago

Now might be an OK time? Now that Travis is here he can help. :P

maxolasersquad commented 4 years ago

I have addressed a lot of the win32 types that originate from the wincompat.h file in https://github.com/linappleii/linapple/pull/123 This doesn't cover everything, but I believe it covers all of the major types. Types such as typedef WORD far *LPWORD I'm not sure how to convert properly so I just left them alone.

rhaleblian commented 4 years ago

Nice.

maxolasersquad commented 4 years ago

If anyone can instruct me on how to convert the remaining Win32 types I'd be happy to do the grunt work. My dev background is primarily in interpreted languages like Python and Javascript so this kind of stuff isn't exactly in my wheel-house.

rhaleblian commented 4 years ago

Lemme look for WIN32-isms up in here...

rhaleblian commented 4 years ago

Sorry no time. I would say put this in? It's a step on the journey.

maxolasersquad commented 3 years ago

There are 13 remaining uses of BOOL, all in /src/CPU.cpp. There are no remaining usages of TRUE or FALSE.

akhepcat commented 3 years ago

There are 13 remaining uses of BOOL, all in /src/CPU.cpp. There are no remaining usages of TRUE or FALSE.

most of those are for the emulated CPU, and aren't traditional booleans. it'll be fun to break those down and see what can be converted without breaking the CPU...

I guess I can take a look at it?

akhepcat commented 3 years ago

Yeah, i stole the easy ones first, lol. the flags are gonna be ... fun.