Remove unused includes
I used unused includes diagnostic from clangd in combination with a script that:
- Requests the diagnostic from clangd for a file.
- Removes unused includes includes from the file.
- Tries to build the project.
- Rollbacks the change from the file if build is failed.
Also there are some manual changes when it didn't work with other complier versions.
Change in preprocessed code size:
| file | size, bytes | diff, bytes | diff, % |
|---|---|---|---|
| apps/openmw/mwphysics/deepestnotmecontacttestresultcallback.cpp | 2779949 | -1335933 | -48.056025488237374 |
| apps/openmw/mwphysics/closestnotmerayresultcallback.cpp | 2779163 | -1332006 | -47.92831510782203 |
| apps/openmw/mwsound/loudness.cpp | 2906799 | -1357612 | -46.7047085126973 |
| apps/launcher/utils/cellnameloader.cpp | 4534128 | -1212635 | -26.744613297198494 |
| components/esm/format.cpp | 1940913 | -516985 | -26.63617586156618 |
| apps/openmw/mwscript/animationextensions.cpp | 3030847 | -619842 | -20.451114820378592 |
| apps/openmw/mwworld/actionapply.cpp | 2777507 | -487065 | -17.536049414096887 |
| components/misc/rng.cpp | 2166507 | -362843 | -16.747834186550058 |
| apps/essimporter/importplayer.cpp | 2126505 | -331115 | -15.570854524207556 |
| apps/essimporter/importsplm.cpp | 2114978 | -321772 | -15.21396440057533 |
| components/esm3/loadtes3.cpp | 2170443 | -328850 | -15.151284783797593 |
| apps/openmw/mwworld/actionrepair.cpp | 2822799 | -362604 | -12.845547982693773 |
| apps/openmw/mwworld/actioneat.cpp | 2624395 | -322496 | -12.288394087018151 |
| components/misc/resourcehelpers.cpp | 2757304 | -327454 | -11.875875855545848 |
| components/detournavigator/recastmeshobject.cpp | 2830607 | -328339 | -11.599596835590386 |
| apps/openmw/mwsound/movieaudiofactory.cpp | 2835930 | -311692 | -10.99082135313636 |
| apps/openmw/mwmechanics/aicast.cpp | 3463783 | -338347 | -9.76813501307674 |
| components/terrain/terraingrid.cpp | 3191852 | -290622 | -9.105121415403971 |
| apps/openmw/mwphysics/physicssystem.cpp | 5359749 | -486505 | -9.077010882412594 |
| components/detournavigator/findrandompointaroundcircle.cpp | 2705285 | -240566 | -8.892445712743758 |
| components/detournavigator/recastmeshbuilder.cpp | 2939658 | -259838 | -8.839055427536124 |
| components/sceneutil/osgacontroller.cpp | 3444588 | -289526 | -8.405243239539828 |
| apps/openmw/mwrender/bulletdebugdraw.cpp | 4666126 | -367324 | -7.872140615148416 |
| apps/openmw_test_suite/detournavigator/recastmeshobject.cpp | 3608592 | -281910 | -7.812188244057516 |
| apps/opencs/view/render/cameracontroller.cpp | 5321958 | -415094 | -7.799648174600405 |
| apps/openmw/mwgui/scrollwindow.cpp | 3737479 | -269445 | -7.209271276173057 |
| apps/openmw/mwgui/bookwindow.cpp | 3742278 | -269443 | -7.1999728507609495 |
| apps/openmw_test_suite/detournavigator/settingsutils.cpp | 3622599 | -217282 | -5.997958923965918 |
| apps/openmw/mwrender/creatureanimation.cpp | 4568775 | -273041 | -5.976240896082652 |
| apps/openmw/mwrender/postprocessor.cpp | 5696760 | -267880 | -4.70232202164037 |
| components/detournavigator/makenavmesh.cpp | 3135064 | -131178 | -4.184220800596094 |
| apps/openmw/mwrender/skyutil.cpp | 4632942 | -191401 | -4.131305766400706 |
| apps/openmw_test_suite/detournavigator/gettilespositions.cpp | 3790134 | -140804 | -3.7150137699616947 |
| components/config/launchersettings.cpp | 3716499 | -129651 | -3.488525087723693 |
| apps/launcher/settingspage.cpp | 4684990 | -163228 | -3.4840629328984685 |
| apps/openmw_test_suite/detournavigator/navmeshtilescache.cpp | 3978506 | -125244 | -3.148015863241127 |
| apps/openmw/mwinput/keyboardmanager.cpp | 3316180 | -93547 | -2.8209264877057327 |
| apps/openmw/mwgui/messagebox.cpp | 3405234 | -90166 | -2.6478650219045163 |
| apps/openmw/mwrender/camera.cpp | 4740937 | -123087 | -2.596258925187156 |
| apps/openmw/mwrender/characterpreview.cpp | 4636942 | -112267 | -2.4211430723092953 |
| apps/launcher/advancedpage.cpp | 4731482 | -109400 | -2.312171957961584 |
| components/detournavigator/navmeshcacheitem.cpp | 2405066 | -51849 | -2.1558244139661897 |
| apps/openmw_test_suite/detournavigator/recastmeshbuilder.cpp | 4140959 | -89048 | -2.1504197457642094 |
| apps/opencs/view/world/startscriptcreator.cpp | 4851747 | -85232 | -1.75672804043574 |
| apps/opencs/view/world/util.cpp | 5260516 | -90914 | -1.7282335040897157 |
| apps/opencs/view/world/dialoguesubview.cpp | 5485404 | -90100 | -1.642540822881966 |
| apps/opencs/view/widget/scenetoolshapebrush.cpp | 5223479 | -85639 | -1.639501183023806 |
| apps/opencs/view/render/pathgridselectionmode.cpp | 6334341 | -92890 | -1.4664508904714824 |
| apps/openmw_test_suite/esm/variant.cpp | 3977118 | -56011 | -1.4083313595422586 |
| apps/opencs/view/render/terrainselection.cpp | 6313629 | -85197 | -1.3494141008285387 |
| apps/openmw/mwgui/itemview.cpp | 3245714 | -43578 | -1.3426321604429692 |
| apps/opencs/view/render/pathgridmode.cpp | 6408055 | -85018 | -1.326736427824038 |
| apps/openmw/mwscript/globalscripts.cpp | 3406045 | -43624 | -1.2807816690619145 |
| apps/openmw/mwrender/weaponanimation.cpp | 4612805 | -56473 | -1.2242659292989844 |
| apps/openmw/mwmechanics/spellcasting.cpp | 4820968 | -58777 | -1.219194983248173 |
| apps/openmw/mwgui/statswatcher.cpp | 3656429 | -42192 | -1.1539127383575654 |
| components/resource/stats.cpp | 4693059 | -50732 | -1.0810006863327337 |
| components/esm3/fogstate.cpp | 4118257 | -42110 | -1.0225199641498817 |
| apps/openmw/mwworld/cells.cpp | 3406615 | -33622 | -0.9869621310303667 |
| apps/opencs/model/world/commands.cpp | 4032293 | -38310 | -0.9500797685088824 |
| components/nifosg/particle.cpp | 4314509 | -39975 | -0.9265248954168359 |
| components/nifosg/controller.cpp | 4013555 | -35096 | -0.8744367524551211 |
| apps/openmw/mwrender/npcanimation.cpp | 5618571 | -48691 | -0.8666082532373443 |
| apps/openmw/mwrender/water.cpp | 4679312 | -40168 | -0.8584167928960551 |
| apps/openmw/mwgui/spellicons.cpp | 3916774 | -32202 | -0.8221561928260401 |
| apps/openmw/mwrender/ripplesimulation.cpp | 4650662 | -35129 | -0.7553548290544443 |
| components/nifosg/nifloader.cpp | 4594611 | -34417 | -0.7490732077209628 |
| components/stereo/frustum.cpp | 4482804 | -33358 | -0.7441324670897975 |
| components/resource/scenemanager.cpp | 4607615 | -34222 | -0.7427269856530971 |
| apps/openmw/mwrender/sky.cpp | 4860810 | -35904 | -0.7386423250445917 |
| apps/openmw/mwphysics/object.cpp | 4755945 | -34530 | -0.7260386737020674 |
| apps/openmw/mwworld/projectilemanager.cpp | 5161447 | -37334 | -0.7233242925869465 |
| apps/openmw/mwgui/recharge.cpp | 3900629 | -27983 | -0.7173971172341642 |
| apps/opencs/view/doc/subview.cpp | 3681294 | -26401 | -0.7171663007627171 |
| apps/openmw/mwmechanics/summoning.cpp | 4619218 | -32138 | -0.6957454703371835 |
| apps/openmw/mwscript/compilercontext.cpp | 3439510 | -21446 | -0.623519047771337 |
| apps/openmw/mwmechanics/spellpriority.cpp | 3525128 | -18537 | -0.5258532456126397 |
| apps/openmw/mwgui/mapwindow.cpp | 4882761 | -22393 | -0.45861347708806566 |
| apps/openmw/mwgui/dialogue.cpp | 4016626 | -18416 | -0.4584942685726734 |
| components/lua_ui/widget.cpp | 4378514 | -19846 | -0.4532587996749604 |
| apps/openmw/mwworld/actionequip.cpp | 2856491 | -12083 | -0.42300150779400747 |
| apps/opencs/model/world/landtexturetableproxymodel.cpp | 3314609 | -13468 | -0.40632243501420584 |
| apps/openmw/mwmechanics/enchanting.cpp | 3516711 | -13965 | -0.39710399859413936 |
| apps/openmw/mwworld/inventorystore.cpp | 3508787 | -13470 | -0.3838933511780551 |
| apps/openmw/mwmechanics/aitravel.cpp | 3447525 | -12669 | -0.3674810189918887 |
| components/stereo/stereomanager.cpp | 4467625 | -15138 | -0.3388377493634742 |
| apps/openmw/mwscript/interpretercontext.cpp | 3708796 | -12358 | -0.33320786584110085 |
| components/detournavigator/tilecachedrecastmeshmanager.cpp | 16205151 | -51917 | -0.3203734417531856 |
| apps/openmw/mwrender/localmap.cpp | 4965922 | -14279 | -0.28753975596073067 |
| components/resource/foreachbulletobject.cpp | 3891789 | -11028 | -0.28336582481732764 |
| apps/openmw/mwmechanics/alchemy.cpp | 3500896 | -9891 | -0.28252767291573333 |
| apps/openmw/mwworld/refdata.cpp | 5269704 | -12173 | -0.23099969182329705 |
| components/nifbullet/bulletnifloader.cpp | 3285757 | -7522 | -0.22892745872564735 |
| apps/openmw/mwrender/pathgrid.cpp | 4618983 | -10448 | -0.22619697885876144 |
| apps/opencs/view/render/pagedworldspacewidget.cpp | 6410190 | -9706 | -0.1514151686611509 |
| apps/openmw/mwscript/containerextensions.cpp | 3913421 | -4488 | -0.11468226904286505 |
| apps/openmw/mwgui/journalbooks.cpp | 3309033 | -3585 | -0.10833980803455212 |
| apps/mwiniimporter/importer.cpp | 2590161 | -2598 | -0.10030264527958188 |
| apps/openmw/mwworld/actionread.cpp | 3611450 | -3509 | -0.09716318930069745 |
| apps/openmw/mwgui/travelwindow.cpp | 3915097 | -3675 | -0.09386740609491628 |
| apps/opencs/view/render/unpagedworldspacewidget.cpp | 6273502 | -5821 | -0.09278709084654668 |
| apps/openmw/mwrender/renderingmanager.cpp | 6089908 | -5468 | -0.08978789170542845 |
| apps/openmw/mwscript/userextensions.cpp | 2364303 | -2081 | -0.08801748337671222 |
| apps/openmw_test_suite/detournavigator/tilecachedrecastmeshmanager.cpp | 13531398 | -10738 | -0.07935617591028343 |
| components/fontloader/fontloader.cpp | 4504903 | -3274 | -0.07267637061220134 |
| components/sceneutil/extradata.cpp | 4226082 | -3064 | -0.07250214264654664 |
| apps/openmw/mwstate/statemanagerimp.cpp | 5079703 | -3556 | -0.07000409275896846 |
| apps/bulletobjecttool/main.cpp | 5575994 | -3739 | -0.06705530888304612 |
| apps/openmw/mwlua/userdataserializer.cpp | 3820950 | -2501 | -0.06545492613093673 |
| components/esm3/loaddial.cpp | 2360686 | -1426 | -0.06040617007090354 |
| apps/openmw/mwscript/statsextensions.cpp | 3725634 | -2184 | -0.058620895128180806 |
| apps/openmw/mwlua/object.cpp | 3823564 | -2099 | -0.054896426475403715 |
| apps/launcher/datafilespage.cpp | 5164530 | -2740 | -0.053054198542756836 |
| apps/opencs/view/world/scenesubview.cpp | 6318048 | -3218 | -0.05093345286392159 |
| apps/openmw/mwworld/livecellref.cpp | 3539131 | -1766 | -0.04989925493009695 |
| apps/essimporter/importnpcc.cpp | 2197433 | -1010 | -0.04596272104769872 |
| components/config/gamesettings.cpp | 3619565 | -1640 | -0.04530931203059474 |
| apps/openmw/mwgui/widgets.cpp | 3798125 | -1680 | -0.04423235148922622 |
| apps/essimporter/convertnpcc.cpp | 2384486 | -1010 | -0.04235713692594123 |
| components/sceneutil/attach.cpp | 4049424 | -1696 | -0.04188249983207992 |
| components/fx/stateupdater.cpp | 3560826 | -1419 | -0.03985030439566106 |
| apps/openmw/mwmechanics/obstacle.cpp | 3856694 | -1464 | -0.03795997297166842 |
| apps/openmw/mwworld/cellstore.cpp | 3750808 | -1344 | -0.03583227933821043 |
| components/resource/resourcesystem.cpp | 3904641 | -1296 | -0.033191271617549756 |
| apps/openmw/mwmechanics/spelleffects.cpp | 4863212 | -1568 | -0.03224206553199549 |
| apps/openmw/mwworld/cellpreloader.cpp | 4300641 | -1296 | -0.030135042659917843 |
| apps/openmw/mwmechanics/activespells.cpp | 4786018 | -1288 | -0.02691172494545535 |
| apps/openmw/mwrender/animation.cpp | 4828241 | -1237 | -0.02562009642849139 |
| components/fx/technique.cpp | 4574264 | -1127 | -0.024637843377639523 |
| components/detournavigator/recastmesh.cpp | 2166277 | -531 | -0.024512100714724205 |
| apps/openmw/mwinput/mousemanager.cpp | 3668832 | -880 | -0.02398583527400966 |
| components/esm4/loaddial.cpp | 1931697 | -451 | -0.023347346918278777 |
| components/esm4/loadinfo.cpp | 1946325 | -451 | -0.02317187520070041 |
| components/detournavigator/navmeshtilescache.cpp | 2346591 | -531 | -0.022628570551919136 |
| apps/openmw/mwrender/objectpaging.cpp | 4906587 | -1087 | -0.02215389230844078 |
| components/detournavigator/navigatorutils.cpp | 3441328 | -723 | -0.021009331281407473 |
| components/detournavigator/navmeshdbutils.cpp | 2553591 | -531 | -0.020794246220323664 |
| apps/openmw/mwgui/windowmanagerimp.cpp | 6160324 | -1280 | -0.02077812790366451 |
| apps/opencs/view/render/editmode.cpp | 6208667 | -1289 | -0.020761300291993745 |
| apps/openmw_test_suite/detournavigator/navmeshdb.cpp | 3718817 | -727 | -0.019549227617277065 |
| apps/opencs/view/render/cell.cpp | 5354843 | -1030 | -0.019234924347921734 |
| apps/esmtool/tes4.cpp | 2463433 | -463 | -0.018794909380526192 |
| components/detournavigator/generatenavmeshtile.cpp | 12728697 | -2384 | -0.018729332625322392 |
| apps/openmw/mwmechanics/aifollow.cpp | 3455500 | -643 | -0.018608016206045352 |
| apps/openmw/mwlua/nearbybindings.cpp | 5181173 | -930 | -0.01794960330411266 |
| apps/openmw/mwmechanics/aipursue.cpp | 3605931 | -643 | -0.017831733330453403 |
| components/detournavigator/serialization.cpp | 2989561 | -531 | -0.01776180516136483 |
| apps/openmw/mwmechanics/aiwander.cpp | 4027654 | -709 | -0.017603299588297983 |
| apps/openmw/mwrender/globalmap.cpp | 4874327 | -852 | -0.017479336121684064 |
| apps/openmw/mwphysics/mtphysics.cpp | 4655773 | -809 | -0.017376276721392525 |
| apps/opencs/view/world/referencecreator.cpp | 4852622 | -836 | -0.01722779973383215 |
| components/detournavigator/debug.cpp | 3133582 | -533 | -0.01700928841179561 |
| apps/benchmarks/detournavigator/navmeshtilescache.cpp | 3216585 | -532 | -0.016539280012806135 |
| apps/openmw_test_suite/files/hash.cpp | 3500218 | -513 | -0.014656229983389668 |
| apps/openmw/mwmechanics/objects.cpp | 4524205 | -642 | -0.014190338413044845 |
| apps/openmw/mwmechanics/aicombat.cpp | 5048257 | -709 | -0.014044451381933776 |
| components/sceneutil/recastmesh.cpp | 3929799 | -532 | -0.013537588054757244 |
| apps/openmw/mwmechanics/pathfinding.cpp | 3978961 | -533 | -0.01339545675366205 |
| apps/openmw/mwrender/recastmesh.cpp | 4158810 | -532 | -0.012792120823024167 |
| components/detournavigator/navigatorimpl.cpp | 12779729 | -1617 | -0.01265285046341269 |
| apps/openmw/mwrender/navmesh.cpp | 4471822 | -532 | -0.011896716819226327 |
| apps/openmw/mwlua/cellbindings.cpp | 4355030 | -410 | -0.009414401278518003 |
| apps/openmw/mwlua/inputbindings.cpp | 4047119 | -353 | -0.008722254028115106 |
| apps/openmw/mwworld/worldimp.cpp | 15597405 | -1357 | -0.008700165187736086 |
| apps/openmw/mwlua/asyncbindings.cpp | 4224896 | -353 | -0.00835523525313242 |
| apps/openmw/mwworld/containerstore.cpp | 4335238 | -288 | -0.0066432338893474 |
| apps/openmw_test_suite/esm4/includes.cpp | 2026151 | -131 | -0.00646546086644495 |
| apps/openmw/mwlua/camerabindings.cpp | 5475434 | -353 | -0.006446977536389564 |
| apps/openmw/mwlua/types/door.cpp | 4325958 | -278 | -0.0064263222157912026 |
| apps/openmw/mwlua/objectbindings.cpp | 4845140 | -280 | -0.0057789867785040805 |
| components/detournavigator/navigator.cpp | 12763665 | -725 | -0.005680186686185529 |
| apps/openmw_test_suite/detournavigator/navigator.cpp | 13822992 | -784 | -0.005671709858467988 |
| apps/openmw/mwlua/luabindings.cpp | 4795306 | -226 | -0.004712942198059622 |
| apps/openmw/mwworld/scene.cpp | 15322195 | -709 | -0.004627274355928357 |
| components/detournavigator/navmeshmanager.cpp | 12893663 | -533 | -0.0041338136416269045 |
| components/esmloader/load.cpp | 3000064 | -124 | -0.004133245157433851 |
| components/detournavigator/asyncnavmeshupdater.cpp | 12939519 | -533 | -0.00411916393492362 |
| apps/openmw_test_suite/detournavigator/asyncnavmeshupdater.cpp | 13068866 | -534 | -0.004086046945461774 |
| apps/opencs/model/filter/parser.cpp | 4121178 | -150 | -0.0036397360172246707 |
| apps/openmw/mwlua/postprocessingbindings.cpp | 6637822 | -224 | -0.0033746008856527787 |
| apps/navmeshtool/worldspacedata.cpp | 13427861 | -427 | -0.0031799554672140573 |
| apps/navmeshtool/navmesh.cpp | 12860211 | -391 | -0.003040385573771509 |
| apps/essimporter/converter.cpp | 4512445 | -131 | -0.0029030824752473983 |
| apps/essimporter/importer.cpp | 4534499 | -130 | -0.0028669098835365503 |
| apps/openmw/mwlua/luamanagerimp.cpp | 6747061 | -192 | -0.00284568347610481 |
| apps/navmeshtool/main.cpp | 14262855 | -391 | -0.002741386629812048 |
| apps/essimporter/convertplayer.cpp | 2404162 | -62 | -0.002578861158275547 |
| apps/openmw/mwmechanics/aipackage.cpp | 3715114 | -66 | -0.0017765269114233817 |
| apps/openmw/mwlua/types/types.cpp | 3835526 | -61 | -0.0015903946420925408 |
| apps/openmw/mwgui/container.cpp | 4744641 | -70 | -0.0014753487144747446 |
| apps/openmw/mwlua/types/ingredient.cpp | 4305270 | -57 | -0.0013239587761004756 |
| apps/openmw/mwlua/types/activator.cpp | 4306299 | -57 | -0.0013236424131202185 |
| apps/openmw/mwlua/types/probe.cpp | 4306964 | -57 | -0.0013234380412785463 |
| apps/openmw/mwlua/types/repair.cpp | 4307012 | -57 | -0.0013234232920655842 |
| apps/openmw/mwlua/types/lockpick.cpp | 4307129 | -57 | -0.0013233873422446862 |
| apps/openmw/mwlua/types/misc.cpp | 4307169 | -57 | -0.0013233750521535192 |
| apps/openmw/mwlua/types/potion.cpp | 4307413 | -57 | -0.0013233000875412237 |
| apps/openmw/mwlua/types/apparatus.cpp | 4307655 | -57 | -0.0013232257457973517 |
| apps/openmw/mwlua/types/book.cpp | 4309801 | -57 | -0.0013225668656136058 |
| apps/openmw/mwlua/types/creature.cpp | 4311185 | -57 | -0.0013221422880294043 |
| apps/openmw/mwlua/types/npc.cpp | 4311677 | -57 | -0.0013219914200446325 |
| apps/openmw/mwlua/types/weapon.cpp | 4313787 | -57 | -0.0013213447951909707 |
| apps/openmw/mwlua/types/container.cpp | 4351129 | -57 | -0.001310004828636302 |
| apps/openmw/mwmechanics/actors.cpp | 4979813 | -61 | -0.0012249455953461386 |
| apps/openmw/mwlua/types/actor.cpp | 4828843 | -57 | -0.0011804069836141018 |
| components/fx/pass.cpp | 4565579 | -19 | -0.00041615751255053013 |
| apps/launcher/utils/openalutil.cpp | 859310 | -1 | -0.00011637243835238564 |
| components/esm3/loadmgef.cpp | 2856203 | -2 | -7.002303408221167e-05 |
| components/esm3/loadskil.cpp | 2184713 | -1 | -4.5772602630389514e-05 |
| apps/openmw/mwmechanics/aisequence.cpp | 3101274 | -1 | -3.2244812941950585e-05 |
| apps/openmw/mwsound/openal_output.cpp | 3183477 | -1 | -3.141219490077063e-05 |
| apps/openmw/mwsound/soundmanagerimp.cpp | 3734171 | -1 | -2.6779705586399416e-05 |
| components/sceneutil/util.cpp | 4074892 | -1 | -2.4540527698846404e-05 |
| apps/openmw/mwrender/pingpongcull.cpp | 4964493 | -1 | -2.0143043810705308e-05 |
| apps/openmw/mwrender/pingpongcanvas.cpp | 4977100 | -1 | -2.0092021457696063e-05 |
| components/resource/keyframemanager.cpp | 3970471 | +5 | +0.00012592964411251018 |
| apps/openmw/mwmechanics/spells.cpp | 3445798 | +8 | +0.00023216683044946507 |
| components/terrain/cellborder.cpp | 3732392 | +11 | +0.0002947171679812399 |
| components/terrain/chunkmanager.cpp | 3721502 | +11 | +0.00029557958050041577 |
| apps/openmw/mwgui/spellbuyingwindow.cpp | 3894451 | +18 | +0.0004621960836059813 |
| components/terrain/world.cpp | 3675521 | +32 | +0.000870624871951442 |
| components/terrain/quadtreeworld.cpp | 3750590 | +162 | +0.0043193204269265095 |
| apps/openmw/mwgui/statswindow.cpp | 3942282 | +300 | +0.007609805691211058 |
| total | 3890263447 | -17731854 | -0.45580085363303713 |