Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CI module build cppcheck #60

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sogladev
Copy link
Member

fixes module build errors due to failing cppcheck https://github.com/azerothcore/mod-zone-difficulty/actions/runs/12699226019/job/35399414259

�[1mmodules/mod-zone-difficulty/src/mod_zone_difficulty_handler.cpp:123:63: �[31merror:�[39m Uninitialized variables: data.HealingNerfPctHard, data.AbsorbNerfPctHard, data.SpellDamageBuffPctHard, data.MeleeDamageBuffPctHard [uninitvar]�[0m
                sZoneDifficulty->NerfInfo[mapId][phaseMask] = data;
                                                              ^
�[1mmodules/mod-zone-difficulty/src/mod_zone_difficulty_handler.cpp:242:69: �[31mwarning:�[39m Uninitialized variables: data.NormalOverride, data.MythicOverride [uninitvar]�[0m
                sZoneDifficulty->CreatureOverrides[creatureEntry] = data;
...

changes:
initialize variables by setting default values

default values from tables:

`HealingNerfValue` FLOAT NOT NULL DEFAULT 1,

Test

Run cppcheck from CI locally
https://github.com/azerothcore/reusable-workflows/blob/main/.github/workflows/core_build_modules.yml

cppcheck --force --inline-suppr --suppressions-list=cppchecksuppressions.txt --output-file=report.txt modules/

https://github.com/azerothcore/reusable-workflows/blob/4de2039354f9ac4565f6a079196f8b33f2e2a93e/cppchecksuppressions.txt#L2

initialize variables

set default values in struct
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.

1 participant