Skip to content
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

Debugger: initialise SavedAddress.address with 0 instead of NULL #10578

Merged
merged 1 commit into from
Jan 8, 2024
Merged

Debugger: initialise SavedAddress.address with 0 instead of NULL #10578

merged 1 commit into from
Jan 8, 2024

Conversation

nekopsykose
Copy link
Contributor

@nekopsykose nekopsykose commented Jan 8, 2024

Description of Changes

Uses an int 0 instead of NULL as the initialiser for the default address

Rationale behind Changes

In c++11 and higher it's valid for NULL to be nullptr_t instead of just a 0 or ((void *)0) (see https://en.cppreference.com/w/cpp/types/NULL , though the only platform that i know of that actually does this by default via their stddef.h is musl libc). When that's the case:

../pcsx2-qt/Debugger/Models/SavedAddressesModel.cpp:122:42: error: cannot initialize a member subobject of type 'u32' (aka 'unsigned int') with an rvalue of type 'std::nullptr_t'
  122 |         const SavedAddress defaultNewAddress = {NULL, "Name", "Description"};
      |                                                 ^~~~

since the intent is a default for u32, a 0 works all the time.

Suggested Testing Steps

None needed.

@stenzek
Copy link
Contributor

stenzek commented Jan 8, 2024

Was about to fix this tonight.

@stenzek stenzek merged commit ab68c57 into PCSX2:master Jan 8, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants