]> O.S.I.I.S - jp/vkvg.git/commitdiff
SET(CMAKE_C_EXTENSIONS OFF), replace remainings M_PI by defined M_PIF
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 25 Mar 2022 12:26:48 +0000 (13:26 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Fri, 25 Mar 2022 12:26:48 +0000 (13:26 +0100)
CMakeLists.txt
src/vkvg_context.c
src/vkvg_context_internal.c

index 5c1f1ae552b501249bd9afdc58ca88aa0c5949ad..2a1a47d0bcd9c4df685aedef5387bb6832dd8802 100644 (file)
@@ -3,6 +3,7 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.16)
 SET(LANG "CXX")
 SET(CMAKE_C_STANDARD 11)
 SET(CMAKE_CXX_STANDARD 11)
+SET(CMAKE_C_EXTENSIONS OFF)
 
 OPTION (VKVG_BUILD_SHARED_LIB "Build using shared libraries" ON)
 
index 67e8b1de81448a79ec68d8ce42412fba58595ba8..ec18ffcdd00f065a3cf64ee3d9acf8234398e07a 100644 (file)
@@ -660,13 +660,13 @@ vkvg_status_t vkvg_rounded_rectangle (VkvgContext ctx, float x, float y, float w
                radius = fmin (w / 2.0f, h / 2.0f);
 
        vkvg_move_to(ctx, x, y + radius);
-       vkvg_arc(ctx, x + radius, y + radius, radius, (float)M_PI, (float)-M_PI_2);
+       vkvg_arc(ctx, x + radius, y + radius, radius, M_PIF, -M_PIF_2);
        vkvg_line_to(ctx, x + w - radius, y);
-       vkvg_arc(ctx, x + w - radius, y + radius, radius, (float)-M_PI_2, 0);
+       vkvg_arc(ctx, x + w - radius, y + radius, radius, -M_PIF_2, 0);
        vkvg_line_to(ctx, x + w, y + h - radius);
-       vkvg_arc(ctx, x + w - radius, y + h - radius, radius, 0, (float)M_PI_2);
+       vkvg_arc(ctx, x + w - radius, y + h - radius, radius, 0, M_PIF_2);
        vkvg_line_to(ctx, x + radius, y + h);
-       vkvg_arc(ctx, x + radius, y + h - radius, radius, (float)M_PI_2, (float)M_PI);
+       vkvg_arc(ctx, x + radius, y + h - radius, radius, M_PIF_2, M_PIF);
        vkvg_line_to(ctx, x, y + radius);
        vkvg_close_path(ctx);
 
index 1b0e301bb567bcd30dff7493797f85da6f175e7b..951e25419baf8353a0c5957104576b4631c3346c 100644 (file)
@@ -250,8 +250,8 @@ float _get_arc_step (VkvgContext ctx, float radius) {
        vkvg_matrix_get_scale (&ctx->pushConsts.mat, &sx, &sy);
        float r = radius * fabsf(fmaxf(sx,sy));
        if (r < 30.0f)
-               return fminf(M_PI / 3.f, M_PI / r);
-       return fminf(M_PI / 3.f,M_PI / (r * 0.4f));
+               return fminf(M_PIF / 3.f, M_PIF / r);
+       return fminf(M_PIF / 3.f,M_PIF / (r * 0.4f));
 }
 void _create_gradient_buff (VkvgContext ctx){
        vkvg_buffer_create (ctx->dev,
@@ -1542,7 +1542,7 @@ void _elliptic_arc (VkvgContext ctx, float x1, float y1, float x2, float y2, boo
        double theta = sa;
        double ea = sa + delta_theta;
 
-       float step = fmaxf(0.001f, fminf(M_PI, _get_arc_step(ctx, fminf (rx, ry))*0.1f));
+       float step = fmaxf(0.001f, fminf(M_PIF, _get_arc_step(ctx, fminf (rx, ry))*0.1f));
 
        p = (vec2) {
                rx * cosf (theta),