Commit Graph
2 Commits
Author SHA1 Message Date
42b947d470 give three temporaries a name before taking their address
Each of these takes the address of an object that has no name:

    bool b = client->Startup(1,30,&SocketDescriptor(), 1);
    OutputToStream(msg, &(SGP_LOG(s_log.id)));

MSVC allows it as an extension. The temporary lives to the end of the full
expression, which is past the call, so all three happen to work; clang rejects
the address-of outright.

Naming the object changes nothing about when it is built or what is passed,
only that the pointer now refers to something that outlives the statement.
MemMan.cpp already does this with the same logger call:

    sgp::Logger::LogInstance memLeak = SGP_LOG(log_id);

Verification:

    ninja -C build parse         # address-of-temporary class gone: 24 -> 21 sites
    ninja -C build -k 0          # Release, four applications, green
    ninja -C build-debug -k 0    # Debug, four applications, green

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-23 19:29:55 -03:00
majcostaandGitHub 381ab936eb Rename 'Standard Gaming Platform' to 'sgp' (#246)
* rename 'Standard Gaming Platform' to 'sgp'

* Adapt CMakeLists.txt files to renamed SGP directory

* Lowercase it
2023-10-23 10:18:20 -03:00