Page MenuHomeWildfire Games

Remove the CStrIntern constructor for const char*
AbandonedPublic

Authored by phosit on Oct 11 2023, 4:56 PM.

Details

Reviewers
vladislavbelov
Summary

A std::string would be constructed either way (for an argument to find).
The interface is easyer.

Test Plan

Start the game nothing should have changed.

Diff Detail

Repository
rP 0 A.D. Public Repository
Lint
Lint Skipped
SeverityLocationCodeMessage
Errorsource/ps/CStrIntern.cpp:1LICENCE YEAR1Inaccurate Copyright Year
Errorsource/ps/CStrIntern.h:1LICENCE YEAR1Inaccurate Copyright Year
Unit
Unit Tests Skipped
Build Status
Buildable 22460
Build 54976: Vulcan BuildJenkins
Build 54975: Vulcan Build (macOS)Jenkins
Build 54974: Vulcan Build (Windows)Jenkins

Event Timeline

phosit created this revision.Oct 11 2023, 4:56 PM

Build failure - The Moirai have given mortals hearts that can endure.

Link to build: https://jenkins.wildfiregames.com/job/macos-differential/7382/display/redirect

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/vs2015-differential/8471/display/redirect

Successful build - Chance fights ever on the side of the prudent.

builderr-debug-gcc7.txt
../../../source/renderer/backend/gl/ShaderProgram.cpp: In constructor 'Renderer::Backend::GL::CShaderProgramGLSL::CShaderProgramGLSL(Renderer::Backend::GL::CDevice*, const CStr8&, const VfsPath&, PS::span<const std::tuple<Path, unsigned int> >, const CShaderDefines&, const std::map<CStrIntern, int>&, int)':
../../../source/renderer/backend/gl/ShaderProgram.cpp:649:31: warning: unused variable 'type' [-Wunused-variable]
   for (const auto& [path, type] : shaderStages)
                               ^
builderr-release-gcc7.txt
../../../source/renderer/backend/gl/ShaderProgram.cpp: In constructor 'Renderer::Backend::GL::CShaderProgramGLSL::CShaderProgramGLSL(Renderer::Backend::GL::CDevice*, const CStr8&, const VfsPath&, PS::span<const std::tuple<Path, unsigned int> >, const CShaderDefines&, const std::map<CStrIntern, int>&, int)':
../../../source/renderer/backend/gl/ShaderProgram.cpp:649:31: warning: unused variable 'type' [-Wunused-variable]
   for (const auto& [path, type] : shaderStages)
                               ^
In member function 'void CInput::UpdateText(int, int, int)':
cc1plus: warning: 'void* __builtin_memset(void*, int, long unsigned int)': specified size 18446744073709551612 exceeds maximum object size 9223372036854775807 [-Wstringop-overflow=]

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/9053/display/redirect

phosit requested review of this revision.Oct 11 2023, 6:46 PM

Currently it's better to fix the behavior rather than making it always allocating. It was broken in rP23191. We construct CStrIntern with the same const char* many times per frame.

phosit abandoned this revision.Oct 13 2023, 10:52 PM