-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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 missing declarations #30739
Merged
kevingranade
merged 2 commits into
CleverRaven:master
from
jbytheway:fix_missing_declarations
May 22, 2019
Merged
Fix missing declarations #30739
kevingranade
merged 2 commits into
CleverRaven:master
from
jbytheway:fix_missing_declarations
May 22, 2019
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mark functions with no prior declarations as static, and remove the unused ones.
ZhilkinSerg
added
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
labels
May 21, 2019
Great! That is one of the things I wanted to do long time ago, but didn't for no reasons. |
On mingw builds:
|
Put it inside !WIN32 since it's only used there.
Mooses2k
added a commit
to Mooses2k/Cataclysm-DDA
that referenced
this pull request
May 23, 2019
mlangsdorf suggestion on saving ally_rule remove redunancy comma mlangsdorf suggested scope fix rules. This makes it work, but text is backwards fixes so lines up with text in dialogue CHANGES THE DEFAULT FOLLOW DISTANCE TO 2 Rock as a spare part Switch build configurations away from trusty For clang-4 we use the Trusty source on Xenial. For clang-5 that trick doesn't work, so we retain the Trusty host. Fix coverage CXXFLAGS code This was setting CXXFLAGS and LDFLAGS, when it should have been appending to them. Without this, Travis builds will fail because they can't disable warnings on old compilers. Improve .travis.yml comments Try trimming down build somewhat Add clang-7, clang-8 Travis builds Disable clang-6 and -7 builds on PRs Don't install unnecessary 32-bit libraries These two Travis builds were installing 32-bit libraries, for which there should be no need. add fire barrels Update data/json/recipes/recipe_others.json update per review Co-Authored-By: Alexey Mostovoy <amurkin1988@yandex.ru> Update data/json/recipes/recipe_others.json update per review Co-Authored-By: Alexey Mostovoy <amurkin1988@yandex.ru> Update furniture.json update per review Update furniture.json Add description to furniture.json Update data/json/furniture.json Co-Authored-By: matskuman5 <selinmatias5@gmail.com> Update data/json/items/tool/deployable.json Co-Authored-By: matskuman5 <selinmatias5@gmail.com> Update data/json/furniture.json Co-Authored-By: matskuman5 <selinmatias5@gmail.com> Update data/json/items/tool/deployable.json Co-Authored-By: matskuman5 <selinmatias5@gmail.com> avatar::memorial moved memorial out of player into the new avatar class added NPC text Fix missing declarations (CleverRaven#30739) * Fix missing declarations Mark functions with no prior declarations as static, and remove the unused ones. * Move debug_is_safe_string definition Put it inside !WIN32 since it's only used there. fixed typo in NR-031 description typo! acorn_roasted: remove duplicate entry for itype acorn_roasted There are two acorn_roasted entries in this file. The one removed is defined prior to the itype it copies from (acorns). The remaining entry is immediately following the definition of acorns, and can be loaded without being deferred. Change to variable name and logic requested by mlangsdorf Avoid undefined shift Avoid uninitialized value in jmapgen_int NOLINT undefined shifts in legacy hash code Enable clang-analyzer-core.UndefinedBinaryOperatorResult Have fixed all warnings for this check. Remove legacy hash code This was only present in the tests, contained undefined behaviour, and was obsolete. Add a --user-dir option to the tests This gives control over where the tests write files, which allows parallel test runs to be performed without stepping on each other's toes. Use separate user_dir for modded tests Now the tests can run in parallel, have one of them write to a different location to avoid failures due to filesystem race conditions. Changed weight and volume values to be more realistic. Fixed silly JSON error. Linted JSON. Added empty newline at the end of the file to satisfy the JSON linting gods. Move hydroponics mod folders out of a subfolder Replaced battery spawn with full pocket batteries Moved Brawling martial art autolearn code to json Logic that determines if a martial arts style is learned each turn is controlled by json instead of hardcoded. Astyle typo fixes Update MARTIALART_JSON.md Saving some future person a bunch of time Add clean water to makeshift steam engine recipe Allows the player to use clean water to make makeshift steam engines. Fix copy-from for overmap specials Restore minimap enemy blink/fade functionality (CleverRaven#30745) * start conditional panel update infrastructure * Revert "Remove unnecessary `draw_panels()` calls" This reverts commit 2db3b84. * Revert "Only draw panels on first entry into game::get_player_input()" This reverts commit d629d93. * commit include file change * preserve panel spacing (so minimap draws in right location) * comments are fun. * adjust draw_panels invocations to force redraw when appropriate * cleanup of things that shouldn't have been reverted Fixes cell phone and talking doll weirdness (CleverRaven#30742) * Added charged phone group. * Removed initial_charges from cell phone * Began the work Added a proper item template to everyone who needs a charged cell phone starting out. This is gonna suck... * First pass on professions.json * Fixed professions.json * Fixed the mods too! * Removed initial_charges from creepy_doll and talking_doll * Update data/json/professions.json Co-Authored-By: ZhilkinSerg <ZhilkinSerg@users.noreply.github.com> * Update data/json/professions.json Co-Authored-By: ZhilkinSerg <ZhilkinSerg@users.noreply.github.com> * Modified home_mechanic to have a charged phone They didn't really need it, but I did it for consistency. Game report: add precise version and name for systems. (CleverRaven#30729) * Add precise versions for Windows systems. * Add Android system version retrieval. * Simplify formatting for Windows version. * Add Linux system version. * make operating_system_version() return '<unknown>' if the version can't be determined. - Invert condition on Linux version function; * Simplify Android version retrieval. * Extract shell execution function. - will be reused by Linux, Mac and BSD. * Add MacOS system version. * Sort methods alphabetically. * Add BSD version retrieval. * Fix structure init. Fix error in macos function. * Fix typo in output... Robot salvage system (CleverRaven#30456) * nervous sytem modules * motor system * structural system * tank tread * ai core * more AI cores * Uncraft Robots * gun fix * uncraft nursebot * uncraft turret * inactive turrets recipe * manhack recipe * uncraft hazmatbot * Add schematics for bots * schematics item group * item_groups fro schematics * recipe for every bot * uncraft modules * add self_monitoring_module to nurse and cleaner bots * Damage overflow from a robot is transfered to its corpse * sane crafting time * flavor on robot death * can't repair broken robot items * electronics is used skill, mechanics is required mall miscellanious files pallet, overmap_terrain, item_groups, multitile_city_buildings entries 2nd story, roof enhancements Adds 2nd story and more work on the roof move item_group per feedback Add AT4 (CleverRaven#30734) * Added AT4 to guns_launcher_rocket itemgroup * Add AT4 disp_name and skin_name stomach and guts Fix some typos in uninstall bionic (CleverRaven#30763) * fix uninstall typos
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
SUMMARY: None
Purpose of change
Mark functions
static
when they are local to a single file. This has various advantages:Describe the solution
Mark functions with no prior declarations as static, and remove the unused ones. 17 functions deleted, by my count.
Additional context
This can be enforced with
-Wmissing-declarations
(that's how I found all of these), but I'm not turning on that warning in this PR, because the chances are high that more functions like this are being added, and it would start triggering warnings before it was merged. Will be easier to do that separately along with any (relatively minor) cleanup due to recent changes.