Replace custom type aliases in types.h with standard types
Summary¶
srchybrid/types.h (or equivalent) defines custom integer type aliases
(uint8, sint8, uint16, sint16, uint32, sint32, uint64, sint64)
that predate C99/C++11 standardized <cstdint>. The project targets C++17
(already set in the build — WWMOD_021 done). Replace the custom aliases with
<cstdint> types throughout.
Current State¶
// types.h or stdafx.h:
typedef unsigned __int8 uint8;
typedef signed __int8 sint8;
typedef unsigned __int16 uint16;
typedef signed __int16 sint16;
typedef unsigned __int32 uint32;
typedef signed __int32 sint32;
typedef unsigned __int64 uint64;
typedef signed __int64 sint64;
These are MSVC-specific (__int8, __int16, etc.) and redundant with
<cstdint>.
Fix¶
- Add
#include <cstdint>instdafx.h(ortypes.h) - Replace the typedef block with
usingaliases for any names that differ from the standard:
#include <cstdint>
// If the codebase uses 'sint8' etc. not in <cstdint>:
using sint8 = int8_t;
using sint16 = int16_t;
using sint32 = int32_t;
using sint64 = int64_t;
// uint8/16/32/64 map directly to uint8_t/16_t/32_t/64_t — either add aliases
// or do a bulk rename (see below)
- If CI-002 (clang-format) is in place, a bulk
sed-style rename ofuint8→uint8_tetc. across the codebase is preferable to keeping aliases. Schedule that as a separate mechanical commit.
Note on _MSC_VER<1400 block¶
The #if _MSC_VER<1400 typedef ... block in stdafx.h is also removed as
part of REF-017 (WWMOD_005). Coordinate so the two changes do not conflict.
Files to Modify¶
| File | Change |
|---|---|
srchybrid/types.h or srchybrid/stdafx.h |
Replace typedef block with <cstdint> + optional aliases |
All files using sint8/sint16/sint32/sint64 |
Rename to int8_t etc. (optional mechanical pass) |
Acceptance Criteria¶
- [ ]
types.h(or the equivalent block in stdafx.h) no longer uses__int8/__int16etc. - [ ]
<cstdint>included in the precompiled header - [ ] All
sint*names either aliased or renamed toint*_t - [ ] Clean build with no type-related errors