Repository navigation
fix(warnings): rename the browser-app locals that hide a parameter and a local - #15
Conversation
…d a local
MSVC /W4 reports C4457 ("frame" hides the function parameter) and C4456
("args" hides the previous local) in browser-app.cpp; both are shadowing only,
so the inner names change and the outer ones keep their meaning.
Refs obs-rust/obs-studio#2626.
|
Reviewed the diff and the surrounding function body ( Correctness. Why it is worth landing. These are exactly the C4458/C4456 shadowing diagnostics the Not verified here. The archive-side claim in obs-studio#2626 (that the app still compiles under MSVC |
…2626) Run 40628508954 compiled past configure and reported the next class, all first-party: - aja-output-ui: three `OBSData data` locals hid QWidget::data (C4458) and three `cardManager` declarations hid the file-static global (C4459); inner names only. - graphics-hook/gl-capture: the blacklist lookup's `process_name` hid the global (C4459). - obs-ffmpeg-mpegts: `to_join` is assigned under `have_to_join` and only read under it, but MSVC cannot correlate the flag across the mutex unlock (C4701); it is now `= {0}`. - obs-nvenc: `enableLookahead` is a uint32_t assigned to a bool (C4244) - now `!= 0`, which is exactly what the implicit conversion did; `lookaheadDepth` gets the explicit uint16_t cast its NVENC field already required. Two findings in this wave are submodule code and are fixed there instead: obs-browser (obs-rust/obs-browser#15) and obs-websocket's onMessage (obs-rust/obs-websocket#24). The vendored librtmp class stays with the maintainer (part 1 of the escalation on #2626). Refs #2626.
…2626) Run 40628508954 compiled past configure and reported the next class, all first-party: - aja-output-ui: three `OBSData data` locals hid QWidget::data (C4458) and three `cardManager` declarations hid the file-static global (C4459); inner names only. - graphics-hook/gl-capture: the blacklist lookup's `process_name` hid the global (C4459). - obs-ffmpeg-mpegts: `to_join` is assigned under `have_to_join` and only read under it, but MSVC cannot correlate the flag across the mutex unlock (C4701); it is now `= {0}`. - obs-nvenc: `enableLookahead` is a uint32_t assigned to a bool (C4244) - now `!= 0`, which is exactly what the implicit conversion did; `lookaheadDepth` gets the explicit uint16_t cast its NVENC field already required. Two findings in this wave are submodule code and are fixed there instead: obs-browser (obs-rust/obs-browser#15) and obs-websocket's onMessage (obs-rust/obs-websocket#24). The vendored librtmp class stays with the maintainer (part 1 of the escalation on #2626). Refs #2626.
…names (#2626) The app lane's remaining expected reds were the two submodule targets. Their fixes are merged in obs-rust/obs-browser#15 (C4457 frame, C4456 args) and obs-rust/obs-websocket#24 (C4456 errorCode x2); this pins each pointer at or above those commits so a later pointer move cannot silently reintroduce the findings.
obs-browser b9c5db13 (obs-rust/obs-browser#15) and obs-websocket 960b99e7 (obs-rust/obs-websocket#24) both descend from master's pointers, so these bumps are fast-forwards of the submodule history, not rebases of it.
…2626) Run 40628508954 compiled past configure and reported the next class, all first-party: - aja-output-ui: three `OBSData data` locals hid QWidget::data (C4458) and three `cardManager` declarations hid the file-static global (C4459); inner names only. - graphics-hook/gl-capture: the blacklist lookup's `process_name` hid the global (C4459). - obs-ffmpeg-mpegts: `to_join` is assigned under `have_to_join` and only read under it, but MSVC cannot correlate the flag across the mutex unlock (C4701); it is now `= {0}`. - obs-nvenc: `enableLookahead` is a uint32_t assigned to a bool (C4244) - now `!= 0`, which is exactly what the implicit conversion did; `lookaheadDepth` gets the explicit uint16_t cast its NVENC field already required. Two findings in this wave are submodule code and are fixed there instead: obs-browser (obs-rust/obs-browser#15) and obs-websocket's onMessage (obs-rust/obs-websocket#24). The vendored librtmp class stays with the maintainer (part 1 of the escalation on #2626). Refs #2626.
…names (#2626) The app lane's remaining expected reds were the two submodule targets. Their fixes are merged in obs-rust/obs-browser#15 (C4457 frame, C4456 args) and obs-rust/obs-websocket#24 (C4456 errorCode x2); this pins each pointer at or above those commits so a later pointer move cannot silently reintroduce the findings.
obs-browser b9c5db13 (obs-rust/obs-browser#15) and obs-websocket 960b99e7 (obs-rust/obs-websocket#24) both descend from master's pointers, so these bumps are fast-forwards of the submodule history, not rebases of it.
…2626) Run 40628508954 compiled past configure and reported the next class, all first-party: - aja-output-ui: three `OBSData data` locals hid QWidget::data (C4458) and three `cardManager` declarations hid the file-static global (C4459); inner names only. - graphics-hook/gl-capture: the blacklist lookup's `process_name` hid the global (C4459). - obs-ffmpeg-mpegts: `to_join` is assigned under `have_to_join` and only read under it, but MSVC cannot correlate the flag across the mutex unlock (C4701); it is now `= {0}`. - obs-nvenc: `enableLookahead` is a uint32_t assigned to a bool (C4244) - now `!= 0`, which is exactly what the implicit conversion did; `lookaheadDepth` gets the explicit uint16_t cast its NVENC field already required. Two findings in this wave are submodule code and are fixed there instead: obs-browser (obs-rust/obs-browser#15) and obs-websocket's onMessage (obs-rust/obs-websocket#24). The vendored librtmp class stays with the maintainer (part 1 of the escalation on #2626). Refs #2626.
…names (#2626) The app lane's remaining expected reds were the two submodule targets. Their fixes are merged in obs-rust/obs-browser#15 (C4457 frame, C4456 args) and obs-rust/obs-websocket#24 (C4456 errorCode x2); this pins each pointer at or above those commits so a later pointer move cannot silently reintroduce the findings.
obs-browser b9c5db13 (obs-rust/obs-browser#15) and obs-websocket 960b99e7 (obs-rust/obs-websocket#24) both descend from master's pointers, so these bumps are fast-forwards of the submodule history, not rebases of it.
…2626) Run 40628508954 compiled past configure and reported the next class, all first-party: - aja-output-ui: three `OBSData data` locals hid QWidget::data (C4458) and three `cardManager` declarations hid the file-static global (C4459); inner names only. - graphics-hook/gl-capture: the blacklist lookup's `process_name` hid the global (C4459). - obs-ffmpeg-mpegts: `to_join` is assigned under `have_to_join` and only read under it, but MSVC cannot correlate the flag across the mutex unlock (C4701); it is now `= {0}`. - obs-nvenc: `enableLookahead` is a uint32_t assigned to a bool (C4244) - now `!= 0`, which is exactly what the implicit conversion did; `lookaheadDepth` gets the explicit uint16_t cast its NVENC field already required. Two findings in this wave are submodule code and are fixed there instead: obs-browser (obs-rust/obs-browser#15) and obs-websocket's onMessage (obs-rust/obs-websocket#24). The vendored librtmp class stays with the maintainer (part 1 of the escalation on #2626). Refs #2626.
…names (#2626) The app lane's remaining expected reds were the two submodule targets. Their fixes are merged in obs-rust/obs-browser#15 (C4457 frame, C4456 args) and obs-rust/obs-websocket#24 (C4456 errorCode x2); this pins each pointer at or above those commits so a later pointer move cannot silently reintroduce the findings.
obs-browser b9c5db13 (obs-rust/obs-browser#15) and obs-websocket 960b99e7 (obs-rust/obs-websocket#24) both descend from master's pointers, so these bumps are fast-forwards of the submodule history, not rebases of it.
…2626) Run 40628508954 compiled past configure and reported the next class, all first-party: - aja-output-ui: three `OBSData data` locals hid QWidget::data (C4458) and three `cardManager` declarations hid the file-static global (C4459); inner names only. - graphics-hook/gl-capture: the blacklist lookup's `process_name` hid the global (C4459). - obs-ffmpeg-mpegts: `to_join` is assigned under `have_to_join` and only read under it, but MSVC cannot correlate the flag across the mutex unlock (C4701); it is now `= {0}`. - obs-nvenc: `enableLookahead` is a uint32_t assigned to a bool (C4244) - now `!= 0`, which is exactly what the implicit conversion did; `lookaheadDepth` gets the explicit uint16_t cast its NVENC field already required. Two findings in this wave are submodule code and are fixed there instead: obs-browser (obs-rust/obs-browser#15) and obs-websocket's onMessage (obs-rust/obs-websocket#24). The vendored librtmp class stays with the maintainer (part 1 of the escalation on #2626). Refs #2626.
…names (#2626) The app lane's remaining expected reds were the two submodule targets. Their fixes are merged in obs-rust/obs-browser#15 (C4457 frame, C4456 args) and obs-rust/obs-websocket#24 (C4456 errorCode x2); this pins each pointer at or above those commits so a later pointer move cannot silently reintroduce the findings.
obs-browser b9c5db13 (obs-rust/obs-browser#15) and obs-websocket 960b99e7 (obs-rust/obs-websocket#24) both descend from master's pointers, so these bumps are fast-forwards of the submodule history, not rebases of it.
…2626) Run 40628508954 compiled past configure and reported the next class, all first-party: - aja-output-ui: three `OBSData data` locals hid QWidget::data (C4458) and three `cardManager` declarations hid the file-static global (C4459); inner names only. - graphics-hook/gl-capture: the blacklist lookup's `process_name` hid the global (C4459). - obs-ffmpeg-mpegts: `to_join` is assigned under `have_to_join` and only read under it, but MSVC cannot correlate the flag across the mutex unlock (C4701); it is now `= {0}`. - obs-nvenc: `enableLookahead` is a uint32_t assigned to a bool (C4244) - now `!= 0`, which is exactly what the implicit conversion did; `lookaheadDepth` gets the explicit uint16_t cast its NVENC field already required. Two findings in this wave are submodule code and are fixed there instead: obs-browser (obs-rust/obs-browser#15) and obs-websocket's onMessage (obs-rust/obs-websocket#24). The vendored librtmp class stays with the maintainer (part 1 of the escalation on #2626). Refs #2626.
…names (#2626) The app lane's remaining expected reds were the two submodule targets. Their fixes are merged in obs-rust/obs-browser#15 (C4457 frame, C4456 args) and obs-rust/obs-websocket#24 (C4456 errorCode x2); this pins each pointer at or above those commits so a later pointer move cannot silently reintroduce the findings.
obs-browser b9c5db13 (obs-rust/obs-browser#15) and obs-websocket 960b99e7 (obs-rust/obs-websocket#24) both descend from master's pointers, so these bumps are fast-forwards of the submodule history, not rebases of it.
…bs-rust#2626) (obs-rust#2691) * build(msvc): RED: pin /W4 and no /WX in link options (obs-rust#2626) * build(msvc): compile at /W4 and drop the dead /WX link option (obs-rust#2626) * build(msvc): exempt the vendored deps from the /W4-only warnings (obs-rust#2626) * build(msvc): extend the vendored /W4 exemptions to C4701-C4703 (obs-rust#2626) * build(msvc): fix the first-party libobs /W4 findings at the site (obs-rust#2626) Fixes the five findings the Windows Tier 2 run reported after the vendored exemptions landed, without adding a /wd or a #pragma: - wasapi-output.c.h: drop the initialized-but-unused source local (C4189). - util/windows/window-helpers.c.h: rename the loop-local that hid the val parameter (C4457). - obs-win-crash-handler.c.h, obs-windows.c.h: GetProcAddress returns a FARPROC, and the (void *) cast into a typed function-pointer member is itself C4152. Copy the address through its storage with memcpy instead (get_proc and WINRT_IMPORT do the same for os_dlsym, which returns void *). * build(msvc): name the graphics-hook unions and rename the hidden parameter (obs-rust#2626) The Windows x64 app build's next /W4 findings after the libobs fixes are all in plugins/win-capture/graphics-hook: - d3d11-capture.cpp.hpp: name the two views (`shtex`, `shmem`) and the union (`u`) instead of relying on nameless struct/union (C4201 x3). Call sites become data.u.shtex.* / data.u.shmem.*; the overlay layout is unchanged. - d3d12-capture.cpp.hpp: the union wrapped a single anonymous struct, so the wrapper is deleted and the fields sit directly in d3d12_data (C4201), with no call-site change. - d3d9-patches.hpp: the `patch` parameter hid a global of that name (C4459); renamed to `index`. No pragma and no /wd: each warning is fixed at the site. * build(msvc): fix the DbgHelp unions and the crash-handler /W4 findings (obs-rust#2626) The Windows Rust Tier 2 lane compiles the libobs C groups with MSVC, and at /W4 /WX it failed on three findings left by the previous commits on this branch: - obs-windows.c.h: `sym_initialize_w` and `sym_set_search_path_w` have different prototypes, so one union declared with `__typeof__(sym_initialize_w)` made the second assignment C4113 - and a hard `-Wincompatible-function-pointer-types` error in the Windows cross lane. One union per member instead. - obs-win-crash-handler.c.h `walk_stack`: `func_offset` is filled through a pointer, so MSVC's flow analysis cannot see that the read is guarded by the call's return value: C4701. Initialize it to 0; it is only printed when that call succeeded. - obs-win-crash-handler.c.h `exception_handler`: `bcrash` is OBS_NORETURN, so the free, the `inside_handler` reset and the return after it were dead statements: C4702. Delete them. No pragma and no per-file /wd: each warning is fixed at the site. * build(msvc): fix the next libobs /W4 findings (obs-rust#2626) The Windows Tier 2 lane's next MSVC /W4 /WX pass reported eight findings in the libobs unity TU: - obs-scene.c.h: `group_info` was a tentative definition without an initializer (the definition is at the bottom of the file): C4132 "const object should be initialized". Declare it `extern` instead. - obs-output.c.h: `size` is only set on the caption paths and read only under the matching codec guard, which MSVC's flow analysis cannot see across the branches: C4701 "potentially uninitialized". Start it at zero; no behavior change. - obs.c.h and obs-hotkey.c.h: C4702 "unreachable code" at every HASH_ADD and HASH_ITER use. The macros end in uthash_fatal -> exit(-1), and MSVC reports the non-returning path as unreachable. This is the vendored uthash false positive the Rust oracle already suppresses with /wd4702 (rust/obs-c-oracle/build.rs), so libobs-objects gets the same exemption for MSVC instead of editing uthash (obs-rust#516 vendored-code exemption). No pragma in first-party sources; the one new /wd is the existing oracle exemption applied to the same macros. * build(msvc): zero-init the pending audio actions (obs-rust#2626) The Windows Tier 2 lane's next /W4 pass reports C4701 on the two apply-audio-* helpers: `action` is only assigned when an action is pending and only read under that same guard, which MSVC's flow analysis cannot correlate across the unlock. Zero-initialize the struct in both; the value is never read on the path where it would be the initializer. * build(msvc): keep crate names out of the C4702 exemption comment (obs-rust#2626) ci/test_tier2_proof_inputs.py treats any crate name mentioned in a cmake or CMakeLists.txt file as a Tier 2 root (tier2_roots() regexes the crate names over CMAKE_INPUTS). The previous commit's comment named the C oracle's build script by its path, which pulled that crate into the Tier 2 closure and failed two assertions in that test: "Format 🔍 / checks" went red on f7c71c5. Reword the comment without the crate name and leave a note so the next edit does not reintroduce it. Verified: cd ci && uv run python -m unittest test_tier2_proof_inputs -> Ran 5 tests, OK; ./lint -> lane lint: ok. * build(msvc): zero-init the proc call copy (obs-rust#2626) libobs-c-reference's /W4 pass reports C4701 on `info_copy` in proc_handler_call: it is copied under the mutex only when `info` is non-NULL and read only after the `!info` early return, which MSVC's flow analysis cannot correlate. Zero-initialize it; the value is unreachable when no procedure was found. * build(msvc): apply the C4702 uthash exemption to every C target (obs-rust#2626) The C-reference library compiles the ported groups with its own compile options, so the uthash C4702 false positive reappears there (obs-data.c.h:304 and :871, both HASH_ADD_STR). Apply the exemption to libobs-objects and every target in OBS_LIBOBS_C_TARGETS instead of only the object library. * build(msvc): exempt vendored libnsgif from C4701/C4703 (obs-rust#2626) The C-reference build's /W4 pass reaches libnsgif's gif-frame.c and reports C4701/C4703 on its `uncompressed` pointer, whose LZW path sets it before every read. Vendored code keeps its own suppressions rather than source edits (the obs-rust#516 vendored-code exemption, as deps/libcaption and w32-pthreads already do), so the four ported nsgif unity groups get /wd4701;/wd4703 for MSVC. * build(msvc): apply gersemi formatting to the libobs CMake exemption (obs-rust#2626) The libnsgif exemption block failed the lint lane's gersemi check ("libobs/CMakeLists.txt would be reformatted"). Reformat with the pinned gersemi 0.25.0; no logic change. * build(msvc): initialize libnsgif's decompressed pointer (obs-rust#2626) The per-source COMPILE_OPTIONS exemption from the previous commit did not take effect under the Visual Studio generator, so the C-reference /W4 pass still reported C4701/C4703 on `uncompressed` in gif-frame.c. Drop that block and fix the site instead: lzw_decode() writes the pointer through its address before the first read, so the initializer is never observed - it only tells MSVC what it cannot infer. * build(msvc): load RtlGetVersion through a union (obs-rust#2626) platform-windows.c.h assigned GetProcAddress's FARPROC to the typed get_ver through a `void *` cast, which MSVC reports as C4152 at /W4. Copy the address through a union of the two types instead, as the symbol loaders elsewhere in this PR do. * build(msvc): exempt the C tests from the /W4-only classes (obs-rust#2626) The cmocka tests are existing C tests, which this repo never edits to satisfy a new warning (obs-rust#516), and several of them compile libobs / libobs-rust sources into their own executable, so the /W4 level reports those classes against them instead of against product code. This is the MSVC analogue of the -Wno-* list the same file already carries for clang: C4132, C4201 (the nameless unions in libobs/graphics/vec*.h and util/profiler.h, an API change), C4244/C4245, C4310, C4456/C4459 and C4702 (uthash's non-returning uthash_fatal path). * build(msvc): fix the next first-party /W4 findings at the site (obs-rust#2626) Windows Tier 2 at /W4 (/WX on) reported these after the libobs wave: - shared/ipc-util: the server thread's inner WAIT result shadowed the outer one (C4456); it is a separate wait, so name it wait_result. - shared/bpm: 'size' is only assigned on the avc||hevc path (C4701); initialize it, no value changes. - shared/media-playback: 'v'/'a' are set by the frame loops but MSVC cannot see that the loop runs before the use (C4701/C4703); initialize to NULL - the branch that dereferences them requires num > 0, which means the loop ran. - shared/media-playback: (uint16_t) on get_max_luminance's return and (uint8_t) on the channel count handed to convert_speaker_layout; both are the conversion the compiler already performed (C4244). - plugins/obs-filters: initialize the LUT entry colour (C4701). - plugins/obs-outputs: explicit (uint8_t)/(uint16_t) casts where the bitstream readers return unsigned int into a narrower field, and 0xFFFF for the two bit-exact -1 descriptor fields (C4244/C4245). Every change is the conversion the compiler already applied; no values, ranges or control flow change. * build(msvc): clear the wave 4 /W4 findings in obs-outputs and the tests Windows Tier 2 on a92e9af reached the obs-outputs TUs and reported four classes. The two first-party ones are fixed at the site by initializing the locals MSVC cannot prove are written: mp4-mux's parsed_packet (no parse arm matches an unknown video codec) and rtmp-av1's seq_params (written in the OB1 sequence-header case that the !nb_seq guard makes mandatory). The other two are the test executables' own build: C4201 arrives through C++ TUs (test executables compile frontend *.cpp against libobs headers, where the nameless structs in vec{2,3,4}.h and profiler.h are a nonstandard C++ extension), and C4206/C4706 are the vendored librtmp sources those tests compile. Both join the existing MSVC block in test/cmocka/CMakeLists.txt, which is the /W4 analogue of the clang -Wno-* list that file already carries (existing C tests are not edited for a new warning, obs-rust#516). Refs obs-rust#2626 * build(msvc): fix the wave 5 /W4 findings in libobs-opengl and libobs-d3d11 Windows Tier 2 on 243a50f reached the renderer targets and reported three classes, all first-party: - C4100: gl-windows' init_default_swap never used its gs_device_t and device_is_monitor_hdr used neither argument. Both now call UNUSED_PARAMETER(), which is exactly what the gl-nix sibling does for the same two functions. - C4245: sp_getsampler's not-found sentinel was a plain -1 returned as size_t. Return (size_t)-1, the value its only caller already compares against. - C4458: thirteen locals/parameters in the d3d11 backend shadowed class members (data/format/srd/numVerts/adapter). Renamed to plane_data, tex_format, subresource_data, num_verts and dxgi_adapter; no behaviour change, and the this->member = local lines stay explicit. Refs obs-rust#2626 * fix(msvc): fix the /W4 findings the Windows app lane reports in the plugins (obs-rust#2626) PR CI builds no app, so the /W4 findings in the plugin and frontend C/C++ TUs only appear in a release-lane run. This is that wave, all fixed at the site: - shadowed locals/parameters renamed (C4456/C4457/C4458/C4459) in decklink, decklink-captions, decklink-output-ui, frontend-tools, obs-qsv11, obs-text, shared/properties-view, win-wasapi and text-freetype2 - unreferenced parameters silenced with UNUSED_PARAMETER (C4100) in captions-mssapi-stream, nv-filters, obs-nvenc and obs-outputs/net-if-host-windows - dead locals that exist only for their side effect keep the call and cast the result to void (C4189, nv-filters sliders and parent_flags) - explicit narrowing casts where the value is already bounded (C4244/C4245) in obs-ffmpeg-srt, obs-qsv11, obs-qsv11.c.h and decklink's video_trc assignment - remove the unreachable duplicate return after convert_ffmpeg_sample_format's switch default (C4702, obs-ffmpeg-formats.h) Refs obs-rust#2626. * test(msvc): require the product C++ targets to carry the C4201 exemption (obs-rust#2626) RED: on the previous commit this test fails three ways - the obs_msvc_exempt_c4201 helper does not exist, none of the nine product C++ targets opt in, and the decklink/swig exemptions are absent. It pins the obs-rust#2626 decision for C4201: a per-target /wd4201 for the C++ targets that include libobs/graphics/vec{2,3,4}.h, libobs/util/profiler.h or frontend/api/obs-frontend-api.h, never a blanket /wd4201 in the MSVC config. Refs obs-rust#2626. * build(msvc): exempt C4201 per product C++ target and pin the app-lane classes (obs-rust#2626) GREEN for the test in the previous commit. /W4 reports C4201 for the nameless unions in libobs/graphics/vec{2,3,4}.h, libobs/util/profiler.h and frontend/api/obs-frontend-api.h in every C++ TU that includes them. Those unions are legal C11 (6.7.2.1p13) and consumed from C, so naming them is an API break; the decision on obs-rust#2626 is a per-target exemption, not a blanket one. - obs_msvc_exempt_c4201() in cmake/common/helpers_common.cmake: one /wd4201 under $<COMPILE_LANG_AND_ID:CXX,MSVC>, so it is inert everywhere else. - opt in from aja-output-ui, coreaudio-encoder, decklink, decklink-output-ui, frontend-tools, libobs-d3d11, the frontend (obs-studio), obs-vst, win-capture/graphics-hook (its own anonymous union), and - because the targets are defined by submodules - obs-browser and obs-websocket from plugins/CMakeLists.txt. - two more app-lane classes, both intentional: /wd4324 on decklink (FrameQueue pads to a cache line) and /wd4100 + /wd4189 on obslua, whose only source is the SWIG-generated wrapper. Refs obs-rust#2626. * test(msvc): pin the C4201 helper as a no-op without a target (obs-rust#2626) ENABLE_BROWSER=OFF and ENABLE_WEBSOCKET=OFF make the submodule's CMakeLists return before add_library, so obs_msvc_exempt_c4201() is called on a target that does not exist and configure dies with "Cannot specify compile options for target ... which is not built by this project" (Qt Frontend Linux lane). RED: the guard is absent, so this fails with AssertionError: -1 == -1. * build(msvc): make the C4201 helper a no-op when the module is disabled (obs-rust#2626) ENABLE_BROWSER=OFF and ENABLE_WEBSOCKET=OFF return from the submodule's CMakeLists before add_library, so obs_msvc_exempt_c4201() was called on a target the config never created and configure died with "Cannot specify compile options for target ... which is not built by this project". GREEN for e647e45: ci/test_msvc_warning_level.py -> OK (9 tests), gersemi clean. Reproduced standalone with CMake 4.1.6: without the guard configure exits 1 on the same message, with it both ENABLE_* states configure. * fix(msvc): write the graphics-hook C4201 exemption inline (obs-rust#2626) Run 40626724707 failed configuration on the previous commit: CMake Error at plugins/win-capture/graphics-hook/CMakeLists.txt:28 (obs_msvc_exempt_c4201): Unknown CMake command "obs_msvc_exempt_c4201". graphics-hook is configured by the child architecture build (cmake/windows/architecture.cmake) as well as by the main tree, and the child build adds only libobs and the win-capture/win-dshow module directories - it never includes cmake/common/helpers_common.cmake, where the helper is defined. The exemption is now an inline target_compile_options on that target, and the test pins both halves: the hook file must not name the helper, and architecture.cmake must still add the hook's directory. Refs obs-rust#2626. * fix(msvc): clear the wave 7 /W4 findings from the Windows app lane (obs-rust#2626) Run 40628508954 compiled past configure and reported the next class, all first-party: - aja-output-ui: three `OBSData data` locals hid QWidget::data (C4458) and three `cardManager` declarations hid the file-static global (C4459); inner names only. - graphics-hook/gl-capture: the blacklist lookup's `process_name` hid the global (C4459). - obs-ffmpeg-mpegts: `to_join` is assigned under `have_to_join` and only read under it, but MSVC cannot correlate the flag across the mutex unlock (C4701); it is now `= {0}`. - obs-nvenc: `enableLookahead` is a uint32_t assigned to a bool (C4244) - now `!= 0`, which is exactly what the implicit conversion did; `lookaheadDepth` gets the explicit uint16_t cast its NVENC field already required. Two findings in this wave are submodule code and are fixed there instead: obs-browser (obs-rust/obs-browser#15) and obs-websocket's onMessage (obs-rust/obs-websocket#24). The vendored librtmp class stays with the maintainer (part 1 of the escalation on obs-rust#2626). Refs obs-rust#2626. * test(msvc): pin the submodule pointers that carry the wave 6-7 /W4 renames (obs-rust#2626) The app lane's remaining expected reds were the two submodule targets. Their fixes are merged in obs-rust/obs-browser#15 (C4457 frame, C4456 args) and obs-rust/obs-websocket#24 (C4456 errorCode x2); this pins each pointer at or above those commits so a later pointer move cannot silently reintroduce the findings. * build(msvc): bump the submodules to the wave 6-7 /W4 renames (obs-rust#2626) obs-browser b9c5db13 (obs-rust/obs-browser#15) and obs-websocket 960b99e7 (obs-rust/obs-websocket#24) both descend from master's pointers, so these bumps are fast-forwards of the submodule history, not rebases of it. * fix(msvc): clear the wave 8 /W4 findings from the Windows app lane (obs-rust#2626) New classes only the app build compiles: - inject-helper C4152: the obfuscated open_process lookup assigned a void* to a function pointer without a cast; the sibling call sites (game-capture, window-helpers, obs-inject-library) already cast at the site. - obs-ffmpeg/texture-amf.cpp.hpp: C4459 caps x4 (rename the local to amf_caps, the file-static std::map stays), C4245 x2 (the AMF_SURFACE_USAGE / AMF_MEMORY_CPU_ACCESS bit-or arguments), C4100 x4 (UNUSED_PARAMETER on the unused param/encoder), C4189 x2 (a dead last_ts; convert_to_amf_ts is pure), C4244 x2 (the HDR nominal peak level into an amf_uint16, bounded at 10000). * fix(msvc): clear the wave 9 first-party /W4 findings (obs-rust#2626) From the x64 app-lane log of run 40633515355: - obs-ffmpeg/texture-amf.cpp.hpp:559 C4701/C4703: get_output_type is only assigned in the three codec arms of the switch; initialize it to NULL so an unknown codec reaches GetProperty() and the existing throw instead of an uninitialized read. - obs-outputs/rtmp-windows.c.h:8 C4245: libobs's sb_socket is a SOCKET, so the reset is INVALID_SOCKET rather than a plain -1. - obs-outputs/rtmp-windows.c.h:92 C4100: ideal_send_backlog_event never touched its can_write out-parameter; the parameter and its only argument are dropped. - shared/obs-inject-library/inject-library-windows.c.h:46 C4057: written_size is handed to a SIZE_T * by write_process_memory_t; declare it SIZE_T. * test(msvc): pin the submodule pointers that carry the wave 9 /W4 renames (obs-rust#2626) obs-rust/obs-browser#16 (browser-client's shadowing `name` and `channels` locals) and obs-rust/obs-websocket#25 (Json.cpp's structured binding hiding the `key` parameter) are merged; both pointers must reach those commits. * build(msvc): bump the submodules to the wave 9 /W4 renames (obs-rust#2626) * fix(msvc): clear the wave 10 win-capture C4457 findings (obs-rust#2626) game-capture.c.h:1764 and window-capture.c.h:596,617,682,726,764 each declare a calldata_t local named data inside a callback that already has a data parameter. Renamed the locals to cd (the name upstream OBS uses for the same pattern); every use in the block follows. * test(msvc): pin the obs-browser pointer at the panel renames (obs-rust#2626) * build(msvc): bump obs-browser to the panel renames (obs-rust#2626) * build(msvc): exempt the /W4 findings left in the vendored deps (obs-rust#2626) The first Windows app-lane build at /W4 (release-rust.yaml verify_only on fix/2626-msvc-w4, run 40709658465) failed in both the x64 and the arm64 build with C2220, from four warnings that are all in vendored code: plugins/obs-outputs/librtmp/rtmp.c C4245 int -> SOCKET / uint8_t C4456 shadowed loop counter `i` C4706 `while ((s = ...))` condition deps/libdshowcapture/src/source/device.cpp:483 C4456 shadowed `defaultMT` librtmp already carries per-source suppressions for the clang/gcc classes (obs-rust#516, obs-rust#2623); this adds the MSVC ones to the same source property, scoped to COMPILE_LANG_AND_ID:C,MSVC. libdshowcapture is a vendored submodule whose sources are compiled into its consumers (win-dshow, obs-virtualcam-module) through an INTERFACE target that already carries /wd4005 and /wd4018, so the C4456 exemption joins that line, scoped to CXX+MSVC. ci/test_msvc_warning_level.py pins both exemptions. Every other target built at /W4 in that run -- libobs, frontend, obs-ffmpeg, obs-nvenc, obs-qsv11, win-capture, the graphics hook, shared/ -- so this is the last class the Windows lane reports. * build(msvc): clear the wave 11 /W4 findings in the vendored trees (obs-rust#2626) The app-lane run at 312015a (release-rust.yaml verify_only, run 40744279457) confirms the first two exemptions work -- librtmp no longer reports C4245/C4456/C4706 and device.cpp no longer reports C4456, so per-source COMPILE_OPTIONS do reach cl.exe through the Visual Studio generator. It then stopped on the next class per translation unit: plugins/obs-outputs/librtmp/{rtmp,amf}.c C4702 unreachable code deps/libdshowcapture/src/source/encoder.cpp C4458 `config` deps/libdshowcapture/src/source/output-filter.cpp C4458 `pin` Those are vendored, so they join the exemptions already in place: /wd4702 for librtmp, /wd4458 for libdshowcapture. ci/test_msvc_warning_level.py pins both extended lists. The same run also reported C4701 `err_code` in plugins/obs-outputs/ rtmp-windows.c.h, which is first-party. master's obs-rust#2220 socket-loop rewrite (the code this branch now sits on) already initializes both leaves, so no change is needed here. * fix(msvc): give the disabled module a provably-set declaration (obs-rust#2626) The Windows app lane at /W4 reports, in libobs-objects.vcxproj: libobs/obs-module.c.h(528,1): warning C4701: potentially uninitialized local variable 'disabled_module' used libobs/obs-module.c.h(528,1): warning C4703: potentially uninitialized local pointer variable 'disabled_module' used C2220 turns both into errors. This is first-party libobs code, so it is fixed at the site rather than suppressed. `obs_module_load_rules_open_route()` only returns CORE_CONTINUES together with DISABLE (and `obs_module_load_rules_init_route()` only returns KEEP_TYPE together with DISABLE), so the dereference at :528 was safe by invariant -- but that invariant lives in another translation unit, and /W4 cannot see it. Move the two dereferences into the `DISABLE` branch that creates the module, so the assignment is dominated by the creation in the same scope. Behaviour is unchanged: the same route bits reach the same code, the comment names the invariant that makes the nesting exact. * build(msvc): exempt ElgatoUVCDevice's C4244 at /W4 (obs-rust#2626) The app-lane run 40750374851 (release-rust.yaml verify_only on 69b8f19) cleared every class the previous wave fixed and stopped on two new ones. One is first-party (`obs-module.c.h`, previous commit); the other is vendored: deps/libdshowcapture/src/external/capture-device-support/Library/ ElgatoUVCDevice.cpp(218,27): warning C4244: '+=': conversion from 'int' to 'uint8_t', possible loss of data That tree is a submodule this branch does not edit, so C4244 joins the CXX/MSVC list the INTERFACE target already carries (/wd4005 /wd4018 /wd4456 /wd4458). ci/test_msvc_warning_level.py pins the extended list, which is the RED/GREEN for the exemption. * build(msvc): exempt librtmp md5's C4244 and win-dshow's C4201 at /W4 (obs-rust#2626) Wave 13 of the /W4 app-lane ratchet, from the x64/arm64 logs of the verify-only run on the previous head: - plugins/obs-outputs/librtmp/md5.c: 18x C4244 (`MD5_u32plus` -> `unsigned char` in the digest stores). Vendored C89, never edited here, so /wd4244 joins the existing per-source MSVC list for the librtmp sources. - plugins/win-dshow/win-dshow-encoder.cpp.hpp:17,18: C4201 nameless struct/union, i.e. the libobs header unions again. win-dshow was missing from the per-target C4201 exemption list; it now calls obs_msvc_exempt_c4201(), the shape obs-rust#2626 decided on. ci/test_msvc_warning_level.py pins both (win-dshow joins C4201_TARGETS and the librtmp regex covers /wd4244). * build(msvc): clear the wave 14 /W4 findings in the hardware test tools (obs-rust#2626) From the x64 app-lane log of the verify-only run on the previous head: - plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c.h:744 C4701 `next_seek_position`: cl.exe cannot see that `want_seek` is only raised next to the assignment, across the chunk-flush branch, so the declaration carries the zero. - plugins/obs-qsv11/obs-qsv-test:171 C4189 `sts` and :183 C4456 `idx`, and plugins/obs-ffmpeg/obs-amf-test:154 C4456 `idx`: the MFX session status is not used (a failed session is null, handled below) and the adapter print loop's structured binding shadowed the probe's counter. - plugins/obs-nvenc/obs-nvenc-test:380 C4456 `res`: renamed to `preset_status`, the preset-config query is a different status from the caps query above it. Local: `./lint --fix` ok (65.5 s), `ci/test_msvc_warning_level.py` 12 tests OK. * build(msvc): exempt obs-browser's dead static at /W4 (obs-rust#2626) The wave 14 x64 app-lane log also stopped on C4505 in the submodule: plugins/obs-browser/obs-browser-page/obs-browser-page-main.cpp(44,13): warning C4505: 'SetHighDPIv2Scaling': unreferenced function with internal linkage has been removed The function is dead in obs-browser, not in this tree, so the obs-browser-helper target opts into a new obs_msvc_exempt_c4505() helper beside the C4201 one (properties-view already carries the same per-target /wd4505). Deleting the function stays an obs-rust/obs-browser change; ci/test_msvc_warning_level.py pins the helper, its no-op guard, the single opt-in and the absence of a blanket /wd4505 in the MSVC config. Local: ci/test_msvc_warning_level.py 15 tests OK, ./lint ok (57.6 s). Refs obs-rust#2626 * build(msvc): name the adapter print binding after the caps, not the adapter (obs-rust#2626) Wave 15: `adapter_index` hides a *global* of that name from a VPL header in the qsv-test unity TU (C4459), the wave-14 rename having only avoided the function-local `idx`. `caps_index` names what the binding actually iterates (adapter_info's caps map) and collides with nothing; the amf-test twin gets the same name so the two tools stay identical. Refs obs-rust#2626 * build(msvc): clear the wave 16 /W4 findings in the Qt frontend (obs-rust#2626) Windows Tier 2 on 8befb40 reached frontend/obs-studio.vcxproj and stopped on 24 C4458/C4456 name-hiding findings, all first-party and all in parameter/local declarations: - SourceTreeItem.cpp.hpp (13): the seven signal-handler lambda parameters named `data`, the two `lock` guards in enterEvent/leaveEvent, the two undo/redo `data` arguments and the two `OBSDataAutoRelease data` locals. Renamed to handler_data, select_lock, uuid and privData (the constructor already used privData for the same object). - OBSBasicSourceSelect.cpp.hpp (4): the local `newSource` hiding the class member (-> createdSource), the two undo/redo `data` (-> uuid) and one scene-enumeration callback parameter (-> handler_data). - OBSBasicFilters.cpp.hpp (4) and OBSBasicTransform.cpp.hpp (1): the undo/redo JSON arguments named `data` (-> json). - OBSBasicVCamConfig.cpp.hpp (1): an obs_enum_sources callback parameter (-> handler_data). - OBSBasicAdvAudio.cpp.hpp (1, C4456): the range-for binding `control` hid the preceding local of the same name (-> ctrl). Renames only: no behaviour change, no new exemptions, and ci/test_msvc_warning_level.py needs no change (these are source fixes, not flags). Local: ci.test_msvc_warning_level 15 tests OK, ./lint ok (44.4 s). Refs obs-rust#2626 * build(msvc): name the properties undo/redo blob after its content, not the member (obs-rust#2626) Wave 17: the /W4 x64 and arm64 log of 40771676539 reports exactly one finding left in the Qt frontend -- C4458 at OBSBasicProperties.cpp.hpp:270, where the undo/redo lambda's 'data' parameter hides a class member. Name it 'json', the serialized blob it is. * build(msvc): name the importer locals after what they hold (obs-rust#2626) Wave 18: the /W4 x64 log of 40776407182 reports five findings left in the Streamlabs/XSplit importers, all name-hiding in loop bodies: sl.cpp.hpp:275,328,375 C4457 'name' hides the attempt_import parameter xsplit.cpp.hpp:332 C4456 'name' hides the loop's previous local xsplit.cpp.hpp:356 C4456 'source' hides the loop's Json source Renames only, at the declaration: source_name / imported_scene_name / imported_transition_name / window_name / linked_source. The goto-skip path and the window_capture "::" concatenation keep their existing behaviour. * build(msvc): name the settings locals and handler params after their role (obs-rust#2626) Wave 19: the /W4 x64 log of 40778602578 reaches the settings tabs and reports 28 findings across four files, all name-hiding at the declaration: OBSBasicSettings.cpp.hpp (18) 'data' lambda/callback params -> handler_data, with data/local variants named for content (saved_settings, bindings_data, hotkey_enum_data), 'preset' -> preset_value / selected_preset / preset_name, 'protocol' -> service_protocol, 'hotkeys' -> hotkeys_widget OBSBasicSettings_Stream.cpp.hpp (9) member params 'protocol' -> protocol_name, 'idx' -> encoder_idx, shadowed 'settings' -> probe_settings OBSHotkeyWidget.cpp.hpp (1) enum callback param -> handler_data AuthListener.cpp.hpp (1) SetState param 'state' -> newState Renames only; behaviour is unchanged at every site. The header declarations that name these parameters follow. * build(msvc): name the frontend utility locals after what they hold (obs-rust#2626) Wave 20: the /W4 log of 40780896312 reaches the Qt frontend's utility layer and reports five findings in four files, identical on x64 (123143264750) and arm64 (123143264828), all name-hiding at the declaration: OBSBasicSettings.cpp.hpp(3088) C4458 hotkey-enum lambda param 'data' -> handler_data AdvancedOutput.cpp.hpp(570) C4457 local 'service' (the service name string) -> service_name AdvancedOutput.cpp.hpp(712) C4458 local copy of the streaming output 'streamOutput' -> streamOutputRef CrashHandler.cpp.hpp(128, 271) C4459 locals 'crashSentinelPath' (the sentinel directory) -> sentinel_dir Renames only; behaviour is unchanged at every site. The 'shadowing is sort of bad' comment on the output alias goes with the shadowing. * build(msvc): name the thumbnail and simple-output locals after their role (obs-rust#2626) Wave 21: the /W4 x64 log of 40782858353 gets past the settings tabs and reports seven findings in the frontend utility layer, all name-hiding at the declaration: SimpleOutput.cpp.hpp:720 'streamOutput' local -> streamOutputRef ThumbnailItem.cpp.hpp:90,167 'pixmap' param/local -> newPixmap / blank_pixmap ThumbnailManager.cpp.hpp:254 'uuid' hides the param -> item_uuid ThumbnailView.cpp.hpp:42,60 'enabled'/'pixmap' params -> newEnabled / newPixmap audio-encoders.cpp.hpp:167 'ss' hides an outer local -> bitrate_list Renames only, and the setters' header declarations follow. The stale "shadowing is sort of bad" comment on the simple output alias goes too. * build(msvc): keep the member streamOutput in UpdateRecording (obs-rust#2626) Wave 21's SimpleOutput rename reached one use it should not have: line 781 in UpdateRecording reads the inherited BasicOutputHandler::streamOutput member, not the StartStreaming alias, so the Qt Frontend Linux lane of run 40785707601 failed with "'streamOutputRef' was not declared in this scope". RED: the Qt Frontend Linux job 123159022296 at 494090f (SimpleOutput.cpp.hpp:781:39: error: 'streamOutputRef' was not declared in this scope; did you mean 'streamOutput'?). GREEN: this restores the member read; the only alias that keeps its new name is the local in StartStreaming. * build(msvc): name the widget-layer locals after what they hold (obs-rust#2626) Wave 22 (part 1), the 14 findings in the small widget files from the /W4 x64 log of 40785697992, all name-hiding at the declaration: three signal lambdas in InitOBSCallbacks and the rest shadowed locals/params. frontend/widgets/OBSBasic.cpp.hpp data x3 -> handler_data OBSBasicStatusBar.cpp.hpp seconds x2 -> secondsPart OBSBasicStatusBar.cpp.hpp/.hpp seconds -> timeoutSeconds OBSBasic_ContextToolbar.cpp.hpp toolbar -> mediaControls OBSBasic_DeviceBusy.cpp.hpp box -> messageBox OBSBasic_Dropfiles.cpp.hpp data -> droppedValue OBSBasic_Projectors.cpp.hpp data -> projectorData OBSBasic_Recording.cpp.hpp remux -> remuxDialog OBSBasic_Service.cpp.hpp data x2 -> serviceData OBSBasic_Streaming.cpp.hpp auth -> currentAuth Renames only; the Dropfiles lambda that receives the saved scene JSON keeps its own name (jsonText) so it does not hide the renamed parameter. The remaining 47 findings of this wave (OBSBasic_Hotkeys 22, OBSBasic_Scenes 12, OBSBasicPreview 7, OBSBasic_SceneCollections 6) come in the next commit. * build(msvc): name the hotkey and undo params at their declarations (obs-rust#2626) Wave 22 (part 2): the remaining 47 name-hiding findings from the wave-21 x64 app build (run 40789602679, "Build windows x64"), all at the declaration. Every rename is local to one lambda/local scope; no behaviour changes. frontend/widgets/OBSBasic_Hotkeys.cpp.hpp MAKE_CALLBACK macro parameter + six hotkey lambdas data x22 -> handler_data frontend/widgets/OBSBasic_Scenes.cpp.hpp SaveSceneListOrder / LoadSceneListOrder data -> orderData / itemData AddScene: hotkey lambda data -> handler_data AddScene: scene source local source -> sceneSource DuplicateSelectedScene: existing source source -> existingSource DuplicateSelectedScene: undo/redo params data -> sceneName RemoveSelectedScene: undo payload data -> undoData context menu: private settings data -> privateSettings on_actionAddScene_triggered source -> existingSource, data x2 -> sceneName frontend/widgets/OBSBasicPreview.cpp.hpp GetStretchHandleData / mousePressEvent / BoxItems / DrawSpacingHelpers data x11 -> findData mouseReleaseEvent: undo payload data -> jsonStr BoxItems parameter (hides the member) startPos -> boxStart mouseMoveEvent: OBSBasic pointer main -> obsBasic frontend/widgets/OBSBasic_SceneCollections.cpp.hpp two obs_data_array_enum callbacks data -> sourceData obs_save_sources_filtered / obs_enum_all_sources callback data -> handler_data Load: collection file data data -> collectionData LoadData: the whole parameter data -> collectionData frontend/widgets/OBSBasic.hpp, OBSBasicPreview.hpp parameter names kept in step with the definitions above. Refs obs-rust#2626, Refs obs-rust#516. * build(msvc): name the transition, studio-mode and projector locals (obs-rust#2626) Wave 23: the 23 name-hiding findings left in the wave-22 arm64 app build (run 40793642430, job "Build windows arm64", head 5090b8d), all at the declaration. Every rename is local to one lambda/local scope; no behaviour changes. frontend/widgets/OBSBasic_Transitions.cpp.hpp AddQuickTransitionHotkey / InitTransition lambdas data -> handler_data (4) LoadQuickTransitions data -> itemData SaveQuickTransitions data -> entryData TransitionToProgram: previous program scene lastScene -> previousScene on_transitionProps_clicked: menu lambda properties -> openSourceProperties CreatePerSceneTransitionMenu: private settings data -> privateSettings (3) two undo/redo payload parameters data -> undoJson four programOptions layout locals programLayout -> optionsLayout GetTransitionOverride* private settings data -> privateSettings (2) frontend/widgets/OBSBasic_StudioMode.cpp.hpp SetPreviewProgramMode: scene at exit currentScene -> currentSceneSource UpdatePreviewProgramIndicators: label text program -> programText ProgramViewContextMenuRequested: projector menu studioProgramProjector -> programProjectorMenu frontend/widgets/OBSProjector.cpp.hpp / .hpp AlwaysOnTopToggled / SetIsAlwaysOnTop parameter isAlwaysOnTop -> alwaysOnTop frontend/widgets/OBSBasic_Scenes.cpp.hpp showInMultiview hotkey payload data -> settingsData Refs obs-rust#2626, Refs obs-rust#516. * build(msvc): lead HandleFindData with its over-aligned member (obs-rust#2626) The arm64 Windows app lane reports C4324 on the struct: `matrix4` carries a 16-byte-aligned SIMD member (a vec4), and it sat after `const vec2 &pos` and `const float radius`, so the compiler inserted padding. x64 does not report it, which is why the wave loop had not seen it before (arm64 job 123184945877, head 5090b8d). Move `parent_xform` first and group the remaining members so each lands at its natural offset: 64 + 8 + 8 + 8 + 8 + 4 + 4 + 4 + 4 = 112 bytes, an exact multiple of the 16-byte alignment, so no padding is inserted anywhere. The second constructor's init list follows the new declaration order. No behaviour change; the struct is internal to the preview widget and only ever passed by pointer to obs_scene_enum_items. Refs obs-rust#2626, Refs obs-rust#516. * build(msvc): initialize the popup menu's source and flags (obs-rust#2626) Wave 24, read from the x64 log of the 8ed8fde app build (job 123195796173): /W4 flags C4701/C4703 at CreateSourcePopupMenu, where obs_source_t *source and uint32_t flags are declared before the sourceSelected branch and used after it. Both now start at nullptr/0, so the no-selection path can no longer read an indeterminate local (behaviour is unchanged: every use is already behind sourceSelected or hasVideo/hasAudio). * fix(shared): spell the address length conversion in the socket platform layer (obs-rust#2626) The Windows Tier 2 lane now compiles shared/ at /W4, and it is the first lane to reach happy-eyeballs there: the x64 PR run failed with happy-eyeballs.c.h(317,65): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data => error C2220: the following warning is treated as an error connect()/bind() take the address length as an int in Winsock and as a socklen_t in BSD sockets, while the resolved length is a size_t. The call sites had a bare (int) cast on connect() and none on bind(), so the narrowing was invisible to the portability layer. Both now go through a host-layer helper, he_platform_addr_len(), which returns the type the platform's call expects: an int on Windows, a socklen_t elsewhere. No value changes - the same narrowing happens, spelled where the platform knows its own signature. * build(msvc): name the wizard and app locals after what they hold (obs-rust#2626) Wave 24, part 2: the frontend findings the arm64 /W4 log of the 40798517408 verify run reported after the popup-menu pair. - AutoConfig.cpp.hpp: the hardware-preference local becomes preferHardwareEncoding (the member it hid is preferHardware), and CanTestServer's parameter becomes serverAddress (it hid the member server). - AutoConfigStreamPage.cpp.hpp: the multitrack service settings blob becomes multitrack_service_settings, and the per-endpoint bitrate becomes endpoint_bitrate (both hid an earlier local in SaveStreamSettings). - AutoConfigTestPage.cpp.hpp: the two signal-handler lambdas take handler_data, and the two local result vectors become testResults (they hid the QFormLayout member results). - OBSApp.cpp.hpp: InitUserConfig's parameter becomes configLocation (it hid the userConfigLocation member) and obs-main.cpp.hpp's inner nextLine becomes lineEnd. Source-only renames; no test or flag change. ci/test_msvc_warning_level.py 15 tests OK and ./lint ok. * build(msvc): make ParseMath's variable type chain exhaustive (obs-rust#2626) Wave 25: the /W4 finding in the next frontend unity TU after the wave-24 renames. ParseMath() enters its calc/max/min branch only when one of the three tokens matched, but the third test was a redundant cf_token_is() that MSVC could not use to prove the variable was assigned (C4701 'varType' potentially uninitialized, used at 250). The trailing test becomes the else arm and says why it is exhaustive; no behaviour change. * build(msvc): drop the unused path and cast the detour hook (obs-rust#2626) Wave 26: the two /W4 findings in frontend/utility after the wave-25 fix. - platform-windows.cpp.hpp: SaveJxrImage() never used its path argument (the caller's stream is already initialized from the filename), so the parameter and its one call-site argument are gone (C4100). - win-dll-blocklist.c.h: DetourAttach() takes the hook as a data pointer; the implicit function-to-data conversion is a nonstandard extension (C4152). Spell the conversion as an explicit (PVOID) cast, which is what Detours' own C examples do, rather than suppressing the class the way shared/obs-scripting does for SWIG. No behaviour change; ./lint ok and ci/test_msvc_warning_level.py OK. * build(msvc): copy the detour hook address through a union, not a cast An explicit function-to-data pointer cast is still C4152 at /W4; MSVC warns on the conversion, not on its implicitness. Copy the address through a union the way GET_DBGHELP_IMPORT does for GetProcAddress, which the repo already relies on to keep this class quiet without a per-file /wd. Refs obs-rust#2626 * build(msvc): rename Multiview::Update's parameters off the members (obs-rust#2626) /W4 reports C4458 three times at Multiview::Update's signature: `multiviewLayout`, `drawLabel` and `drawSafeArea` each redeclare a class member. The body only uses the names to assign the members, so the parameters take the names of what they carry and every later read keeps resolving to the member. Behaviour is identical; no flag, test or exemption change. * build(msvc): rename the audio-control parameters that shadow their members (obs-rust#2626) Wave 28 of the /W4 app lane: the mixer widget family reports C4458 at each parameter or local that redeclares a member, and C4456 at the group-insert loop variable in SourceTreeModel. | site | diagnostic | fix | | --- | --- | --- | | `OBSAdvAudioCtrl::percentChanged(int percent)` | C4458 (`QPointer<QSpinBox> percent`) | `newPercent`, header updated | | `SourceToolbar` undo lambda `const std::string &data` | C4458 (member `data`) | `settingsJson` | | `SourceTree` private settings `obs_data_t *data` | C4458 (member `data`) | `privateSettings` | | `SourceTree` `preUpdateScene`'s `void *data` | C4458 (member `data`) | `updateFn` | | `SourceTreeModel` group-insert loop `item` | C4456 (earlier `item`) | `groupItem` | | `VolumeControl::setLayoutVertical(bool vertical)` | C4458 (member `vertical`) | `verticalLayout` | | `VolumeControl::renameSource`'s `std::string uuid` | C4458 (member `uuid`) | `sourceUuid`, capture and `add_action` updated | | `VolumeControl` inner `prevName`, undo/redo `data` | C4456, C4458 ×2 | `nameToRestore`, `undoUuid`/`redoUuid` | | `VolumeControl` accessible name `sourceName` | C4458 (member `sourceName`) | `sourceLabel` | | `VolumeName::paintEvent`'s `indicatorWidth` | C4458 (member `indicatorWidth`) | `arrowWidth` | | `VolumeSlider::paintEvent`'s `tickColor` | C4458 (member `tickColor`) | `tickMarkColor` | Source-only renames: no test, flag or exemption change. `./lint` ok and `ci/test_msvc_warning_level.py` 15 tests OK. --------- Co-authored-by: zackees <zackees@users.noreply.github.com>
obs-rust/obs-studionow compiles at MSVC/W4with warnings-as-errors (obs-rust/obs-studio#2626). The Windows app build, which is the only lane that compiles this plugin, reports two findings inbrowser-app.cpp:browser-app.cpp:447C4457framehides the function parameterbrowser-app.cpp:487C4456argshides a previous local in the same functionBoth are shadowing only: the inner
CefFrameloop variable becomestarget_frameand theCefV8ValueListbecomescallback_args, with every use in their own scope updated. No behavioural change, no signature change.Verified with
clang-format --style=file --dry-run --Werror browser-app.cpp(clean); this repo has no compiler lane, so the build check is theobs-studio/W4 lane after the pointer bump.Refs obs-rust/obs-studio#2626