Post Reply 
emu48 now for android-OS
04-04-2019, 01:05 PM
Post: #24
RE: emu48 now for android-OS
(04-04-2019 12:16 PM)ijabbott Wrote:  I wonder why BOOL was defined as signed char for the Android build? If it was for iOS I could maybe understand it.

To save space? Using a 32-bit type of which you're only using one bit is rather wasteful. Using an 8-bit quantity is still wasteful, but a common compromise since it's usually the smallest addressable unit.

In early C, there was no dedicated Boolean type, so they used int instead, with the convention of saying 0 = false and 1 = true (or any nonzero value). This convention survived for a long time, because it took so long before C adopted bool -- I think bool only became an official part of C in the C99 standard.

In Free42 I used int for bool originally for that exact reason. When I changed the project from C to C++, I started using bool instead of int where appropriate, but mostly in new code, leaving old code alone. Replacing int with bool made data structures more compact, but it also caused compatibility headaches where data structures are persistent, i.e. in the state file.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
emu48 now for android-OS - compsystems - 03-02-2019, 04:27 PM
RE: emu48 now for android-OS - SammysHP - 03-02-2019, 05:39 PM
RE: emu48 now for android-OS - Jlouis - 03-02-2019, 05:54 PM
RE: emu48 now for android-OS - franz.b - 03-02-2019, 07:23 PM
RE: emu48 now for android-OS - Luigi Vampa - 03-03-2019, 05:57 PM
RE: emu48 now for android-OS - SammysHP - 03-04-2019, 06:46 PM
RE: emu48 now for android-OS - EugeneNine - 03-04-2019, 06:47 PM
RE: emu48 now for android-OS - Ken S - 03-04-2019, 07:09 PM
RE: emu48 now for android-OS - compsystems - 03-07-2019, 10:55 PM
RE: emu48 now for android-OS - Gerald H - 03-07-2019, 08:54 AM
RE: emu48 now for android-OS - Marco Polo - 03-25-2019, 09:25 AM
RE: emu48 now for android-OS - Marco Polo - 04-01-2019, 01:17 PM
RE: emu48 now for android-OS - ijabbott - 04-04-2019, 12:16 PM
RE: emu48 now for android-OS - Thomas Okken - 04-04-2019 01:05 PM
RE: emu48 now for android-OS - sunhp - 03-31-2019, 10:26 AM
RE: emu48 now for android-OS - John Keith - 04-02-2019, 06:29 PM
RE: emu48 now for android-OS - Lode - 04-04-2019, 07:53 AM
RE: emu48 now for android-OS - Lode - 04-04-2019, 07:06 PM
RE: emu48 now for android-OS - compsystems - 04-04-2019, 07:19 PM
RE: emu48 now for android-OS - ijabbott - 04-04-2019, 07:51 PM
RE: emu48 now for android-OS - rprosperi - 04-05-2019, 12:25 AM
RE: emu48 now for android-OS - SammysHP - 04-08-2019, 11:01 AM
RE: emu48 now for android-OS - Marco Polo - 04-08-2019, 11:46 AM
RE: emu48 now for android-OS - John Keith - 04-08-2019, 01:29 PM
RE: emu48 now for android-OS - SammysHP - 04-08-2019, 06:07 PM
RE: emu48 now for android-OS - SammysHP - 04-17-2019, 06:16 PM
RE: emu48 now for android-OS - Marco Polo - 04-18-2019, 07:30 AM
RE: emu48 now for android-OS - snrowe - 04-18-2019, 12:39 PM
RE: emu48 now for android-OS - Marco Polo - 04-18-2019, 01:56 PM
RE: emu48 now for android-OS - ijabbott - 04-15-2019, 02:29 PM
RE: emu48 now for android-OS - Jlouis - 04-15-2019, 08:42 PM
RE: emu48 now for android-OS - ijabbott - 04-16-2019, 02:35 PM
RE: emu48 now for android-OS - BartDB - 04-18-2019, 01:18 PM
RE: emu48 now for android-OS - compsystems - 04-18-2019, 01:52 PM
RE: emu48 now for android-OS - jpph - 05-02-2019, 01:23 PM
RE: emu48 now for android-OS - jpph - 05-04-2019, 12:18 PM
RE: emu48 now for android-OS - ijabbott - 05-05-2019, 09:26 AM
RE: emu48 now for android-OS - Jlouis - 05-05-2019, 05:18 PM
RE: emu48 now for android-OS - ijabbott - 05-06-2019, 01:43 PM
RE: emu48 now for android-OS - ijabbott - 05-05-2019, 10:38 PM
RE: emu48 now for android-OS - aamiel - 05-06-2019, 09:56 PM
RE: emu48 now for android-OS - John Keith - 05-07-2019, 12:52 PM
RE: emu48 now for android-OS - aamiel - 05-07-2019, 05:38 PM
RE: emu48 now for android-OS - ijabbott - 06-06-2019, 02:28 PM
RE: emu48 now for android-OS - rprosperi - 06-07-2019, 10:09 PM
RE: emu48 now for android-OS - ijabbott - 06-08-2019, 09:12 AM
RE: emu48 now for android-OS - ijabbott - 06-08-2019, 09:18 AM
RE: emu48 now for android-OS - grsbanks - 06-08-2019, 09:49 AM
RE: emu48 now for android-OS - Ken S - 06-09-2019, 07:26 PM
RE: emu48 now for android-OS - zswobbie12 - 06-10-2019, 07:02 AM
RE: emu48 now for android-OS - ijabbott - 06-10-2019, 07:46 AM
RE: emu48 now for android-OS - zswobbie12 - 06-10-2019, 09:41 AM
RE: emu48 now for android-OS - ijabbott - 07-20-2019, 07:16 PM
RE: emu48 now for android-OS - ijabbott - 07-21-2019, 08:41 PM
RE: emu48 now for android-OS - cdmackay - 07-21-2019, 06:41 PM
RE: emu48 now for android-OS - compsystems - 07-29-2019, 05:29 PM
RE: emu48 now for android-OS - SammysHP - 10-22-2019, 12:59 AM
RE: emu48 now for android-OS - ijabbott - 11-11-2019, 11:08 PM
RE: emu48 now for android-OS - SammysHP - 11-12-2019, 09:03 AM
RE: emu48 now for android-OS - ijabbott - 11-12-2019, 10:14 PM
RE: emu48 now for android-OS - Marco Polo - 12-14-2019, 07:48 PM
RE: emu48 now for android-OS - compsystems - 12-19-2019, 02:57 AM
RE: emu48 now for android-OS - SammysHP - 12-22-2019, 08:06 PM
RE: emu48 now for android-OS - Yellow - 05-31-2020, 01:14 AM
RE: emu48 now for android-OS - Yellow - 05-31-2020, 05:56 PM
RE: emu48 now for android-OS - compsystems - 05-31-2020, 09:30 PM
RE: emu48 now for android-OS - compsystems - 06-10-2020, 03:36 PM
RE: emu48 now for android-OS - SammysHP - 10-31-2020, 08:36 PM
RE: emu48 now for android-OS - Marco Polo - 11-01-2020, 08:22 PM
RE: emu48 now for android-OS - John Keith - 11-19-2020, 09:00 PM
RE: emu48 now for android-OS - Marco Polo - 05-09-2021, 10:41 AM
RE: emu48 now for android-OS - John Keith - 05-09-2021, 05:49 PM
RE: emu48 now for android-OS - Marco Polo - 03-25-2022, 05:56 PM
RE: emu48 now for android-OS - DavidM - 08-23-2022, 10:02 PM
RE: emu48 now for android-OS - compsystems - 08-23-2022, 06:47 PM
RE: emu48 now for android-OS - ijabbott - 08-23-2022, 07:52 PM



User(s) browsing this thread: 2 Guest(s)