Skip to content

Fix unused variable build error in nanosvg.cpp#829

Merged
chris1111 merged 2 commits into
masterfrom
copilot/fix-action-job-build-clover-release
Jun 23, 2026
Merged

Fix unused variable build error in nanosvg.cpp#829
chris1111 merged 2 commits into
masterfrom
copilot/fix-action-job-build-clover-release

Conversation

Copilot AI commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

The "Build Clover Release" CI job was failing because nsvg__dumpFloat declared variables b and sign that are only referenced inside DBG(...). In release builds, DEBUG_SVG == 0 collapses DBG(...) to a no-op, leaving both variables unused — fatal under -Werror=unused-variable.

Change

Wrapped the debug-only variable declarations and DBG call in nsvg__dumpFloat with #if DEBUG_SVG != 0:

// Before
for(int i=0; i<N;i++)
{
    float a = t[i];
    int b = (int)a;
    int sign = (a < 0.f);
    DBG("%c%d.%06d ", ((b == 0) && sign)?'-':' ', b, (int)(fabsf((a-(float)b)*1.0e6f)));
}

// After
for(int i=0; i<N;i++)
{
#if DEBUG_SVG != 0
    float a = t[i];
    int b = (int)a;
    int sign = (a < 0.f);
    DBG("%c%d.%06d ", ((b == 0) && sign)?'-':' ', b, (int)(fabsf((a-(float)b)*1.0e6f)));
#endif
}

This mirrors the existing DBG macro guard pattern already present in the file and keeps the debug path fully intact.

Copilot AI changed the title [WIP] Fix failing GitHub Actions job Build Clover Release Fix unused variable build error in nanosvg.cpp Jun 23, 2026
Copilot AI requested a review from chris1111 June 23, 2026 13:09
@chris1111 chris1111 marked this pull request as ready for review June 23, 2026 14:14
@chris1111 chris1111 merged commit 79c169e into master Jun 23, 2026
2 checks passed
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.

2 participants