Skip to content

Issue #123 - Removing Macros (#369)#371

Merged
SaintWish merged 1 commit into
devfrom
st
May 21, 2026
Merged

Issue #123 - Removing Macros (#369)#371
SaintWish merged 1 commit into
devfrom
st

Conversation

@SaintWish
Copy link
Copy Markdown
Member

  • Removed static keyword

  • Removed magic numbers in favor of defines for NULL/TRUE/FALSE

  • Removed massive comment block from 2011.

  • Removed some comments. Addeec constexpr to defined constants.
    FIxed warning C5055 after enum changes.

  • Removed whitespace

  • Removed multiple enum definitions, MS defines are in cbase.h

  • Added missing enums in DMG types to to remove multiple declarations.

  • Changes defines to enums and constexpr where appropriate

  • Changes macro define to enum

  • Changed macros to constexpr/enums

  • Removed commented logic

  • Fixed warninng on sign mismatch. Fixed wasrning on unintialized variables.
    Templated clrmem() macro

  • Fixed pass by reference not in template

  • changed define to constexpr. moved include to top of file.

  • Changed enum to reference enum name.

  • removed unneded define with menu.h include.

  • Converted macros to wrapper functions.

  • templated clrmem macro into function.

  • Reworked IS_NAN function. thanks copilot for type safety.

  • Added nanmask to reworkedd IS_NAN

  • Changed defines to enums/constexpr

  • Fixed missing semi colon.

  • Fixed missing equals. Removed duplicate enum def.

  • Changed vector.h class to allow for constexpr initialization. Changes macros to constexpr/enums in util.h

  • fixed accidental change to var in init.

  • Reverted init change for member vars

  • templated fabs and DotProduct functions

  • Changed macros to templated functions. Fixed / changed unneeded assignment.

  • templated FDotProduct function

  • consted var pass in

  • changes header functions to be specified as inline

  • removed fabs unneeded redefinition

  • Moved VecMutiply definition to inline header function. Converted from macro.

  • changes two defines to constexpr

  • fixed ifndef syntax

  • Revferted syntax change

  • Removed macro

  • Fixed warning 4018 signed/unsigned mismatches

  • Fixed var references and set operations

  • Changed defines to constexpr/enums. Moved/deduplicated multiple defines for some constants.

  • changed define to constexpr

  • Changed macros to functions or constexpr where possible

  • changed some var to constexpr

  • removed unneeded define. change some defines to constexpr

  • Changed iscrript RETURN Macros to functions. Fixed missing typedef in vector include for all builds

  • fixed reference pass in for vector

  • changes some defines to constexpr where applicable

  • Fixed some magic number with enums. Changes a few defines to const.

  • Line end

  • Rename STATPROP enums to STAT_PROP

  • changed unsigned int to int with comment saying may return -1.

  • removed HUDSCRIPT macro in favor of referencing gHUD struct directly

  • changed defines to enum/constexpr. changes PI Reference.
    increased PI precision.

  • reverting commit

  • Revert "changed unsigned int to int with comment saying may return -1."

This reverts commit 9e3d972.

  • Revert "changed defines to enum/constexpr."

This reverts commit d8069fe.

  • Fixed broken jaw bone, fixed position return not working right.

  • fixed removal of not operastions

  • Reapply "changed unsigned int to int with comment saying may return -1."

This reverts commit ec7df61.

  • changes defines to constexpr enums. fixed enum/float equality comparison warnings.

  • Fixed flot/int equality comparison warning.

  • Changed RANDOM_LONG to template. Fixed signed/unsigned warnings.

  • turned random_float macro into template.

  • changed macros to enums and/or constexpr. functionalize ALLOC_STRING for client def.

  • removed vec3_t define. Changed references to Vector type.

  • Removed extra space from replace

  • changed some defines to constexpr/enum

  • Removed macro. Changed classes to have buffer/name hard mentioned on class object.

  • Changed a few NULL to null ptr. changes Screen values

  • changed READ_BOOL to function

  • Changed define to constexpr

  • changed define to constexpr

  • changed to safe versions of strcpy and strncpy. ensured keyname was 0 terminated.
    changed NULL to nullptr in a few places.

  • fixed keyname not being zero terminated

  • Revert "Changed a few NULL to null ptr."

This reverts commit 7111818.

  • changed GAME_LEAP to function, changed NULL to nullptr
    changed defines to enum

  • changed defines to costexpr or enums where applicable

  • fixed tabbing

  • changed define to constexpr

  • Changed ScreenHeight/ScreenWidth defines to functions.

  • chasnged NULL to nullptr

  • changed TRUE to true and FALSE to false. Removed redefinition of true keyword.

  • changed define to constexpr. changes NULL to nullptr

  • changed defines to constexpr / const where applicable

  • changed define to constexpr, changed to safe printf

  • changed defines to constexpr/enum

  • Changed VEC_TO_ANGLES to function

  • updated define to constexpr int, change to inline.

  • inline commit

  • changed nulls to nullptrs

  • changed some NULL to nullptr

  • Changes null to nullptr. changed defines to enums. regroups some enums to door.h header file.
    Included door.h header into multiplay_gamerules.cpp

  • commended why this macro is needed

  • Added other enum entries to main enum. re-added missing button_use_only enum

  • changed some nulls to nullptr

  • changed nulls to nullptr

  • Changed null to nullptr

  • changes functions to _s variants to fix warning.

  • changed null to nullptr. changed define to enum

  • Changed defines to constexpr/enum. Changed null to nullptr

  • changes defines to enums/constexpr

  • changed define to constexpr changed null to nullptr

  • changes NULL to nullptr

  • changed some null to nullptr

  • changes define to enum. changes NULL pointers to nullptr

  • changed NULL to nullptr

  • changed define to constexpr

  • Groups defines into an enum in the header file.

  • changed defines to constexpr/enum

  • changed definest to enums. moved solitary enum to effects.h added effects.h as include

  • moved define to transtype enum. moved transtype enum to header file.

  • changed define to enum

  • changed define to constexpr

  • change define to constexpr

  • changed define to constexpr

  • Fixed float-enum comparison warning

  • changed some defines to enums

  • changed define to enum. group at top of file.

  • changed define to constexpr

  • moved SF to effects.h enum

  • Moves enum in triggers to effects.h added include

  • moved included and defines to top of file. added include guard.

  • fixed syntax error

  • fixed typo in var name. Changed REQPARAMS macro to function.

  • changed to constexpr

  • changed defines to constexpr

  • changed defines to enum. Added include for studio.h
    removed redefition of studio_looping

  • removed whitespace

  • moved define to enum in door.h

  • changed defines to enums. moved to door.h
    groups enums into more logical sections.

  • changed defines to enum,s

  • changed defines to enum

  • moved consts to header.

  • changed costexpr to enum

  • changed define to constexpr

  • changed define to const/enum

  • changes defines to functions/enums/constexpr most consts to header.

  • changed defs to enum

  • changed plat to enum

  • named some enums

  • changed defs to enum. moved enum to header

  • changed defines to enum

  • changed define to enum

  • changed some defines to constexpr

  • fixed unitialized memory warning

  • templated SWAP macro. Changed some defines to constexpr/enum

  • fix redef of param in templated swap.

  • removed unneded empty CONSTANT define

  • changed gib to to enum grouping

  • Removed macros

  • named enums

  • commented unused macros. Added extern to UTIL
    commented out unneeded include.

  • changed define to function. named some enums

  • commented out unused macros. changed MAX_ var names to fit more standard naming convention

  • changed macrodefine to constexpr

  • changed defines to enums

  • ensured RANDOM LONG/FLOAT templated functions were static casted to expected type.

  • changed define to enum. moved consts to header

  • removed header include

  • changed define to enum, moved to trains header changeg defines to const, moved to player header.
    added if guard to bodyparts_human_h

  • changed define to constexpr, moved to header

  • moved class defs to header. added include guard for global.h

  • changed variable name to follow MAX_ prefixing. Moved class/structs to header

  • moved comment back to class reference

  • made const prefixing more consistent. groups consts in header

  • changes from previod commit message

  • groups const at top of header file.

  • commented out unused macros

  • changed defines enums moved some enums to header files.
    grouped constexp

  • removed unneeded comma

  • removed if guard

  • changed define to constexpr. moved to header.

  • changed define to constexpr. moved to header.

  • removed whitespace

  • changed define to constexpr. moved to header.
    commented out pragma disable.

  • named enum moved include to of file.
    moved unneeded nested ifdef.

  • renamed constexpr to MAX_ prefixing. moved CHAR_TEXT snow constexpr to enum

  • renamed const to MAX_ prefixing. Moved to header

  • reverted last commit

  • remove doubled value

  • changed pitch yaw roll to enum

  • removed unneeded defines

  • Removed duplicate stuct defs. Added com_model.h include.

  • changed define to enum, moved to header

  • moved max clib speed to player.h. removed duplicate referenced, name to default CLIMB_ value

  • fixed typing. moved enum to headr

  • added breaks for variable groupings.

  • removed defined. changed referenze to constexpr Vector

  • changed define to constexpr moved to header

  • changed define to constexpr. removed unneeded define.

  • Removed redefinition of constexpr.

  • combined split enum using same flagset to same enum. renamed to follow other enums conventions.

  • Removed unneeded defines. Mvoed enum to player.h

  • changed define to constexpr

  • changed literal define to constexpr

  • added comment for keeping one as define

  • changed macro to function

  • changed function to static

  • moved constexpr to top of file

  • named enums

  • changed BACKUP_NAME macro to function.

  • named enum

  • changed defines to constexpr

  • changed defines to constexpr

  • removed unneeded macro. changed macros to class member functions.

  • Removed macro deifne and replaced with function call.

  • moved defines to header. changed defines to enum/constexpr.

  • named enum

  • changed macro to function. moved function to global.h header.

  • changed defines to constexpr

  • renamed consts for MAX_ prefixing

  • unrolled and removed SPEECH_ macros. changed final references of STAT_PROP to MAX_ prefix

  • changed define to reference pointer to array location. odd location in if else required multiple initializations.

  • removed TypeCheck Macros

  • removbed macro and changed to class memberfunction

  • unrolled and removed macro

  • moved defines as const char * as class member variables

  • removed / unrolled macro

  • changed int to unsigned int

  • Removed unused macros named some enums

  • named some enums changed define to constexpr

  • removed reference to _s functions preventing linux compile

  • removed reference to _s function preventing linux compile

  • removed reference to _s functions preventing linux compile.

  • removed _s from function preventing linux compile.

  • changed includes to match other include formats for vector.h in two files.

  • Added include to vector.h for cmath

  • changes TRUE to true for BOOL implicit conversion

  • removed _s compile preventing linux compilation

  • changed FALSE to false

  • added parenthesis around cast statement preventing linux compile

  • Reverted changes to all files in the src/[public folder. re-added typedef for vec3_t into vector.h

  • Revert "Reverted changes to all files in the src/[public folder."

This reverts commit b792854.

  • Reverted changeds to cdll_int.h

  • Reverting changes to shake.h

  • reverting changes to two files.

  • Reverted macro #define changes. Added using statement for vec3_t / Vector equivalence.

  • unsigned/signed mismatch error present in base types within src/public sdk files. 3 int in progdefs.h and 3 ints in studio.h changed to unsigned int.

  • changed files back to vanilla

  • fixed header include order causing issues with file. (should probably be ext_dll.h?)

  • changed define of vec3_t to c++ standard of using statement within Vector header.

  • Fixed error 4018 after changing SDK files back to base version

  • over wrote files with unchanged versions from repo.

  • Reverted changes to thirdparty files

  • Removed all changes from src/common files. Missing M_PI def for a few files.
    Re-added nanmask int.
    Added hard define for missing enums, 'unable to open header file' and it's commented out of another common file.

  • undid commend hash removal.

  • fixed unneeded case change on RETURN_TRUE and RETURN_FALSE functions.

* Removed static keyword

* Removed magic numbers in favor of defines for NULL/TRUE/FALSE

* Removed massive comment block from 2011.

* Removed some comments.
Addeec constexpr to defined constants.
FIxed warning C5055 after enum changes.

* Removed whitespace

* Removed multiple enum definitions, MS defines are in cbase.h

* Added missing enums in DMG types to to remove multiple declarations.

* Changes defines to enums and constexpr where appropriate

* Changes macro define to enum

* Changed macros to constexpr/enums

* Removed commented logic

* Fixed warninng on sign mismatch.
Fixed wasrning on unintialized variables.
Templated clrmem() macro

* Fixed pass by reference not in template

* changed define to constexpr.
moved include to top of file.

* Changed enum to reference enum name.

* removed unneded define with menu.h include.

* Converted macros to wrapper functions.

* templated clrmem macro into function.

* Reworked IS_NAN function. thanks copilot for type safety.

* Added nanmask to reworkedd IS_NAN

* Changed defines to enums/constexpr

* Fixed missing semi colon.

* Fixed missing equals.
Removed duplicate enum def.

* Changed vector.h class to allow for constexpr initialization.
Changes macros to constexpr/enums in util.h

* fixed accidental change to var in init.

* Reverted init change for member vars

* templated fabs and DotProduct functions

* Changed macros to templated functions.
Fixed / changed unneeded assignment.

* templated FDotProduct function

* consted var pass in

* changes header functions to be specified as inline

* removed fabs unneeded redefinition

* Moved VecMutiply definition to inline header function. Converted from macro.

* changes two defines to constexpr

* fixed ifndef syntax

* Revferted syntax change

* Removed macro

* Fixed warning 4018 signed/unsigned mismatches

* Fixed var references and set operations

* Changed defines to constexpr/enums.
Moved/deduplicated multiple defines for some constants.

* changed define to constexpr

* Changed macros to functions or constexpr where possible

* changed some var to constexpr

* removed unneeded define.
change some defines to constexpr

* Changed iscrript RETURN Macros to functions.
Fixed missing typedef in vector include for all builds

* fixed reference pass in for vector

* changes some defines to constexpr where applicable

* Fixed some magic number with enums.
Changes a few defines to const.

* Line end

* Rename STATPROP enums to STAT_PROP

* changed unsigned int to int with comment saying may return -1.

* removed HUDSCRIPT macro in favor of referencing gHUD struct directly

* changed defines to enum/constexpr.
changes PI Reference.
increased PI precision.

* reverting commit

* Revert "changed unsigned int to int with comment saying may return -1."

This reverts commit 9e3d972.

* Revert "changed defines to enum/constexpr."

This reverts commit d8069fe.

* Fixed broken jaw bone, fixed position return not working right.

* fixed removal of not operastions

* Reapply "changed unsigned int to int with comment saying may return -1."

This reverts commit ec7df61.

* changes defines to constexpr enums.
fixed enum/float equality comparison warnings.

* Fixed flot/int equality comparison warning.

* Changed RANDOM_LONG to template.
Fixed signed/unsigned warnings.

* turned random_float macro into template.

* changed macros to enums and/or constexpr.
functionalize ALLOC_STRING for client def.

* removed vec3_t define.
Changed references to Vector type.

* Removed extra space from replace

* changed some defines to constexpr/enum

* Removed macro.
Changed classes to have buffer/name hard mentioned on class object.

* Changed a few NULL to null ptr.
changes Screen values

* changed READ_BOOL to function

* Changed define to constexpr

* changed define to constexpr

* changed to safe versions of strcpy and strncpy.
ensured keyname was 0 terminated.
changed NULL to nullptr in a few places.

* fixed keyname not being zero terminated

* Revert "Changed a few NULL to null ptr."

This reverts commit 7111818.

* changed GAME_LEAP to function,
changed NULL to nullptr
changed defines to enum

* changed defines to costexpr or enums where applicable

* fixed tabbing

* changed define to constexpr

* Changed ScreenHeight/ScreenWidth defines to functions.

* chasnged NULL to nullptr

* changed TRUE to true and FALSE to false.
Removed redefinition of true keyword.

* changed define to constexpr.
changes NULL to nullptr

* changed defines to constexpr / const where applicable

* changed define to constexpr, changed to safe printf

* changed defines to constexpr/enum

* Changed VEC_TO_ANGLES to function

* updated define to constexpr int, change to inline.

* inline commit

* changed nulls to nullptrs

* changed some NULL to nullptr

* Changes null to nullptr. changed defines to enums.
regroups some enums to door.h header file.
Included door.h header into multiplay_gamerules.cpp

* commended why this macro is needed

* Added other enum entries to main enum. re-added missing button_use_only enum

* changed some nulls to nullptr

* changed nulls to nullptr

* Changed null to nullptr

* changes functions to _s variants to fix warning.

* changed null to nullptr.
changed define to enum

* Changed defines to constexpr/enum.
Changed null to nullptr

* changes defines to enums/constexpr

* changed define to constexpr
changed null to nullptr

* changes NULL to nullptr

* changed some null to nullptr

* changes define to enum.
changes NULL pointers to nullptr

* changed NULL to nullptr

* changed define to constexpr

* Groups defines into an enum in the header file.

* changed defines to constexpr/enum

* changed definest to enums. moved solitary enum to effects.h
added effects.h as include

* moved define to transtype enum.
moved transtype enum to header file.

* changed define to enum

* changed define to constexpr

* change define to constexpr

* changed define to constexpr

* Fixed float-enum comparison warning

* changed some defines to enums

* changed define to enum.
group at top of file.

* changed define to constexpr

* moved SF to effects.h enum

* Moves enum in triggers to effects.h
added include

* moved included and defines to top of file.
added include guard.

* fixed syntax error

* fixed typo in var name.
Changed REQPARAMS macro to function.

* changed to constexpr

* changed defines to constexpr

* changed defines to enum.
Added include for studio.h
removed redefition of studio_looping

* removed whitespace

* moved define to enum in door.h

* changed defines to enums.
moved to door.h
groups enums into more logical sections.

* changed defines to enum,s

* changed defines to enum

* moved consts to header.

* changed costexpr to enum

* changed define to constexpr

* changed define to const/enum

* changes defines to functions/enums/constexpr
most consts to header.

* changed defs to enum

* changed plat to enum

* named some enums

* changed defs to enum.
moved enum to header

* changed defines to enum

* changed define to enum

* changed some defines to constexpr

* fixed unitialized memory warning

* templated SWAP macro.
Changed some defines to constexpr/enum

* fix redef of param in templated swap.

* removed unneded empty CONSTANT define

* changed gib to to enum grouping

* Removed macros

* named enums

* commented unused macros.
Added extern to UTIL
commented out unneeded include.

* changed define to function. named some enums

* commented out unused macros.
changed MAX_ var names to fit more standard naming convention

* changed macrodefine to constexpr

* changed defines to enums

* ensured RANDOM LONG/FLOAT templated functions were static casted to expected type.

* changed define to enum.
moved consts to header

* removed header include

* changed define to enum, moved to trains header
changeg defines to const, moved to player header.
added if guard to bodyparts_human_h

* changed define to constexpr, moved to header

* moved class defs to header.
added include guard for global.h

* changed variable name to follow MAX_ prefixing.
Moved class/structs to header

* moved comment back to class reference

* made const prefixing more consistent.
groups consts in header

* changes from previod commit message

* groups const at top of header file.

* commented out unused macros

* changed defines enums
moved some enums to header files.
grouped constexp

* removed unneeded comma

* removed if guard

* changed define to constexpr.
moved to header.

* changed define to constexpr.
moved to header.

* removed whitespace

* changed define to constexpr.
moved to header.
commented out pragma disable.

* named enum
moved include to of file.
moved unneeded nested ifdef.

* renamed constexpr to MAX_ prefixing.
moved CHAR_TEXT snow constexpr to enum

* renamed const to MAX_ prefixing.
Moved to header

* reverted last commit

* remove doubled value

* changed pitch yaw roll to enum

* removed unneeded defines

* Removed duplicate stuct defs.
Added com_model.h include.

* changed define to enum, moved to header

* moved max clib speed to player.h.
removed duplicate referenced, name to default CLIMB_ value

* fixed typing.
moved enum to headr

* added breaks for variable groupings.

* removed defined.
changed referenze to constexpr Vector

* changed define to constexpr
moved to header

* changed define to constexpr.
removed unneeded define.

* Removed redefinition of constexpr.

* combined split enum using same flagset to same enum.
renamed to follow other enums conventions.

* Removed unneeded defines.
Mvoed enum to player.h

* changed define to constexpr

* changed  literal define to constexpr

* added comment for keeping one as define

* changed macro to function

* changed function to static

* moved constexpr to top of file

* named enums

* changed BACKUP_NAME macro to function.

* named enum

* changed defines to constexpr

* changed defines to constexpr

* removed unneeded macro.
changed macros to class member functions.

* Removed macro deifne and replaced with function call.

* moved defines to header.
changed defines to enum/constexpr.

* named enum

* changed macro to function.
moved function to global.h header.

* changed defines to constexpr

* renamed consts for MAX_ prefixing

* unrolled and removed SPEECH_ macros.
changed final references of STAT_PROP to MAX_ prefix

* changed define to reference pointer to array location.
odd location in if else required multiple initializations.

* removed TypeCheck Macros

* removbed macro and changed to class memberfunction

* unrolled and removed macro

* moved defines as const char * as class member variables

* removed / unrolled macro

* changed int to unsigned int

* Removed unused macros
named some enums

* named some enums
changed define to constexpr

* removed reference to _s functions preventing linux compile

* removed reference to _s function preventing linux compile

* removed reference to _s functions preventing linux compile.

* removed _s from function preventing linux compile.

* changed includes to match other include formats for vector.h in two files.

* Added include to vector.h for cmath

* changes TRUE to true for BOOL implicit conversion

* removed _s compile preventing linux compilation

* changed FALSE to false

* added parenthesis around cast statement preventing linux compile

* Reverted changes to all files in the src/[public folder.
re-added typedef for vec3_t into vector.h

* Revert "Reverted changes to all files in the src/[public folder."

This reverts commit b792854.

* Reverted changeds to cdll_int.h

* Reverting changes to shake.h

* reverting changes to two files.

* Reverted macro #define changes.
Added using statement for vec3_t / Vector equivalence.

* unsigned/signed mismatch error present in base types within src/public sdk files.
3 int in progdefs.h and 3 ints in studio.h changed to unsigned int.

* changed files back to vanilla

* fixed header include order causing issues with file.
(should probably be ext_dll.h?)

* changed define  of vec3_t to c++ standard of using statement within Vector header.

* Fixed error 4018 after changing SDK files back to base version

* over wrote files with unchanged versions from repo.

* Reverted changes to thirdparty files

* Removed all changes from src/common files.
Missing M_PI def for a few files.
Re-added nanmask int.
Added hard define for missing enums, 'unable to open header file' and it's commented out of another common file.

* undid commend hash removal.

* fixed unneeded case change on RETURN_TRUE and RETURN_FALSE functions.
@SaintWish SaintWish merged commit 289c4be into dev May 21, 2026
2 checks passed
@SaintWish SaintWish deleted the st branch May 21, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants