@@ -723,7 +723,6 @@ void ImDrawList::PrimQuadUV(const ImVec2& a, const ImVec2& b, const ImVec2& c, c
723
723
// - Those macros expects l-values and need to be used as their own statement.
724
724
// - Those macros are intentionally not surrounded by the 'do {} while (0)' idiom because even that translates to runtime with debug compilers.
725
725
#define IM_NORMALIZE2F_OVER_ZERO (VX,VY ) { float d2 = VX*VX + VY*VY; if (d2 > 0 .0f ) { float inv_len = ImRsqrt (d2); VX *= inv_len; VY *= inv_len; } } (void )0
726
- #define IM_NORMALIZE2F_OVER_ZERO_PRECISE (VX,VY ) { float d2 = VX*VX + VY*VY; if (d2 > 0 .0f ) { float inv_len = ImRsqrtPrecise (d2); VX *= inv_len; VY *= inv_len; } } (void )0
727
726
#define IM_FIXNORMAL2F_MAX_INVLEN2 100 .0f // 500.0f (see #4053, #3366)
728
727
#define IM_FIXNORMAL2F (VX,VY ) { float d2 = VX*VX + VY*VY; if (d2 > 0 .000001f ) { float inv_len2 = 1 .0f / d2; if (inv_len2 > IM_FIXNORMAL2F_MAX_INVLEN2) inv_len2 = IM_FIXNORMAL2F_MAX_INVLEN2; VX *= inv_len2; VY *= inv_len2; } } (void )0
729
728
@@ -877,17 +876,20 @@ IM_STATIC_ASSERT(2 * sizeof(ImDrawIdx) == sizeof(ImU64)); // assumption: ImU64 m
877
876
878
877
#define IM_POLYLINE_MITER_ANGLE_LIMIT -0 .9999619f // cos(179.5)
879
878
879
+ #if defined(__clang__)
880
+ // Make macros call site look nicer, without needing us to add do { } while (0) statements
881
+ #pragma clang diagnostic ignored "-Wextra-semi-stmt" // warning: empty expression statement has no effect; remove unnecessary ';' to silence this
882
+ // #pragma clang diagnostic ignored "-Wcast-align" //// warning: empty expression statement has no effect; remove unnecessary ';' to silence this
883
+ #endif
884
+
880
885
void ImDrawList::_PolylineEmitArcs (const ImDrawListPolyline& polyline, const int arc_count, const float core_radius, const float fringe_radius)
881
886
{
882
887
if (arc_count == 0 ) IM_UNLIKELY
883
888
return ;
884
889
885
890
const float max_radius = ImMax (core_radius, fringe_radius);
886
891
const int max_arc_segment_count = ImMax ((_CalcCircleAutoSegmentCount (max_radius) + 1 ) / 2 , 2 );
887
- const int arc_arm_point_count = (core_radius > 0 .0f ? 1 : 0 ) + (fringe_radius > 0 .0f ? 1 : 0 );
888
-
889
- if (arc_arm_point_count < 0 || arc_arm_point_count > 2 ) IM_UNLIKELY
890
- return ;
892
+ const int arc_arm_point_count = (core_radius > 0 .0f ? 1 : 0 ) + (fringe_radius > 0 .0f ? 1 : 0 ); // Output 0..2
891
893
892
894
const int max_arc_vtx_count = arc_arm_point_count * (max_arc_segment_count + 2 ) + 1 ; // 1 for the center vertex
893
895
const int max_arc_idx_count = max_arc_segment_count * (1 + (arc_arm_point_count - 1 ) * 2 ) * 3 ;
@@ -3583,7 +3585,7 @@ void ImDrawList::_RoundedRect(const ImVec2& a, const ImVec2& b, ImU32 col, floa
3583
3585
col = (col & ~IM_COL32_A_MASK) | (alpha << IM_COL32_A_SHIFT);
3584
3586
}
3585
3587
3586
- if (screen_thickness <= 1 .0f ) IM_LIKELY // thin
3588
+ if (screen_thickness <= 1 .0f ) IM_UNLIKELY // thin
3587
3589
{
3588
3590
path_offsets[0 ].x = thickness; path_offsets[0 ].y = thickness;
3589
3591
path_offsets[1 ].x = 0 .0f ; path_offsets[1 ].y = 0 .0f ;
0 commit comments