Skip to content
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

nanosvg.h line 805: warning C4702: unreachable code #263

Open
dbcbt opened this issue Jan 27, 2025 · 0 comments
Open

nanosvg.h line 805: warning C4702: unreachable code #263

dbcbt opened this issue Jan 27, 2025 · 0 comments

Comments

@dbcbt
Copy link

dbcbt commented Jan 27, 2025

static float nsvg__convertToPixels(NSVGparser* p, NSVGcoordinate c, float orig, float length)
{
NSVGattrib* attr = nsvg__getAttr(p);
switch (c.units) {
case NSVG_UNITS_USER: return c.value;
case NSVG_UNITS_PX: return c.value;
case NSVG_UNITS_PT: return c.value / 72.0f * p->dpi;
case NSVG_UNITS_PC: return c.value / 6.0f * p->dpi;
case NSVG_UNITS_MM: return c.value / 25.4f * p->dpi;
case NSVG_UNITS_CM: return c.value / 2.54f * p->dpi;
case NSVG_UNITS_IN: return c.value * p->dpi;
case NSVG_UNITS_EM: return c.value * attr->fontSize;
case NSVG_UNITS_EX: return c.value * attr->fontSize * 0.52f; // x-height of Helvetica.
case NSVG_UNITS_PERCENT: return orig + c.value / 100.0f * length;
default: return c.value; // <<< suggest change from return c.value; to break;
}
return c.value; // line 805
}

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

No branches or pull requests

1 participant