Skip to content

Remove unused getParentFolderName() call (C4189) in GetPluginFactoryEntryPoint - #653

Open
cloph-dsp wants to merge 1 commit into
free-audio:mainfrom
cloph-dsp:fix/436-remove-dead-getParentFolderName
Open

cloph-dsp wants to merge 1 commit into
free-audio:mainfrom
cloph-dsp:fix/436-remove-dead-getParentFolderName

Conversation

@cloph-dsp

Copy link
Copy Markdown

What

Deletes one dead statement in src/wrapasvst3_entry.cpp (GetPluginFactoryEntryPoint):

       // try to find a clap which filename stem matches our own
-      auto kx = os::getParentFolderName();
       auto plugname = os::getBinaryName();
       plugname.append(".clap");

Why

kx is never referenced, so MSVC emits:

src\wrapasvst3_entry.cpp(210): warning C4189: 'kx': local variable is initialized but not referenced

The call has no other purpose here: the plugin name to search for is derived from os::getBinaryName() on the following lines. Removing the line clears the warning and changes no behaviour.

The same dead line exists on both main and next (same line number, 210), so the issue's "solved in next" label is not accurate. This PR targets main (the upstream default). os::getParentFolderName() itself is untouched and still used elsewhere in the file (line 118), so no symbol becomes unused.

Verification

  • git diff --check → exit 0, no whitespace errors.
  • grep getParentFolderName src/wrapasvst3_entry.cpp → only the legitimate use at line 118 remains; no reference to kx anywhere in the file or repo.
  • Diff is a single deletion in a single file — no braces/parens/brackets added or removed (verified balanced: {} 58/58, () 214/214, [] 20/20).
  • No behaviour change: the deleted expression only computed a value that was discarded.

Not verified

A compile was not run: this shallow clone has no SDK headers (clap/clap.h is fetched by CMake FetchContent) and this machine has no MSVC toolchain installed, so C4189 cannot be re-confirmed locally before/after. CI on this PR will do the real build.

Fixes #436.

The local variable assigned in GetPluginFactoryEntryPoint was never
referenced, triggering MSVC warning C4189 (local variable initialized
but not referenced). Deleting it changes no behaviour.
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.

Unused variable/function call in GetPluginFactoryEntryPoint

1 participant