Half-Life 2 SDK Mirrors
  • C++ 94.6%
  • C 4.8%
  • GLSL 0.3%
  • Perl 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Christian Pfeiffer 7c5bfe038e
Backport tf2's iconv_open error check to sdk2013 (#440)
The POSIX paths of _V_UCS2ToUnicode(), _V_UnicodeToUCS2(),
_V_UCS2ToUTF8() and _V_UTF8ToUCS2() check the result of iconv_open()
with "reinterpret_cast<int>(conv_t) > 0". iconv_open() returns
(iconv_t)-1 on failure, so the check relies on pointers being positive
as an int: it treats a valid descriptor at an address of 2 GiB or more
as a failure. It also doesn't compile where pointers are wider than int:

  tier1/strtools.cpp:1414:7: error: cast from pointer to smaller type 'int' loses information
  tier1/strtools.cpp:1454:7: error: cast from pointer to smaller type 'int' loses information
  tier1/strtools.cpp:1502:7: error: cast from pointer to smaller type 'int' loses information
  tier1/strtools.cpp:1547:7: error: cast from pointer to smaller type 'int' loses information

(clang, -m64; gcc: "cast from 'iconv_t' {aka 'void*'} to 'int' loses
precision"). Compare with (iconv_t)-1, as tf2's strtools.cpp does.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:58:03 +00:00
common
devtools
dx9sdk/utilities
dx10sdk/Utilities/dx9_30
fgdlib
game
gcsdk/bin
lib
materialsystem
mathlib
public Compatibility fixes for Clang 22 2026-04-27 02:17:11 +00:00
raytrace
tier0
tier1 Backport tf2's iconv_open error check to sdk2013 (#440) 2026-11-08 15:58:03 +00:00
utils
vgui2
vpc_scripts
vstdlib
.git-blame-ignore-revs Fix git-blame-ignore-revs 2025-05-17 16:28:24 -04:00
.gitignore
createallprojects
createallprojects.bat
creategameprojects
creategameprojects.bat