Skip to content

Remove assumptions about the width of long and of pointers - #154

Open
gunnarbeutner wants to merge 3 commits into
OpenTS-Developers:mainfrom
gunnarbeutner:pointer-and-record-widths
Open

Remove assumptions about the width of long and of pointers#154
gunnarbeutner wants to merge 3 commits into
OpenTS-Developers:mainfrom
gunnarbeutner:pointer-and-record-widths

Conversation

@gunnarbeutner

Copy link
Copy Markdown
Contributor

Take the dissolve alpha minimum in DWORD rather than unsigned long

std::min(255ul, ...) compares a DWORD against an unsigned long. Deduction fails once those differ. No change where both are 32 bits.

Pin the trigger action's Value field to a fixed width

TActionClass::Data is serialized raw into saves. int fixes Value at four bytes so the union cannot widen. Unchanged on MSVC, where long is already four.

Format the generated type name the way MSVC's %p does

A type built without an INI name takes one from its address. %p has no portable format, so the name varies by library. Spelling out MSVC's formatting keeps today's string and makes it the same everywhere.

Comment thread code/abstype.cpp Outdated
@gunnarbeutner
gunnarbeutner force-pushed the pointer-and-record-widths branch from 76c56a9 to df2212c Compare September 10, 2026 12:05
@github-actions

Copy link
Copy Markdown

Development builds of df2212c:

The links work without a GitHub account. Artifacts expire after 90 days, and this comment follows the latest successful build.

Comment thread code/taction.h
CrateType Crate;
bool Bool; // Boolean value.
long Value;
int Value;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

int is a 16 or 32 bit long?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's 32-bit on all supported platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants