@@ -573,9 +573,15 @@ static int test_compact_prepared_edges_are_integer_exact(void)
573573 uint32_t random_state = UINT32_C (0x91e10da5 );
574574 size_t edge_index ;
575575
576- CHECK (sizeof (soc_raster_prepared_edge ) == 24u );
577- CHECK (sizeof (soc_raster_prepared_triangle ) == 108u ||
578- sizeof (soc_raster_prepared_triangle ) == 112u );
576+ _Static_assert (
577+ sizeof (soc_raster_prepared_edge ) == 24u ,
578+ "unexpected prepared edge size"
579+ );
580+ _Static_assert (
581+ sizeof (soc_raster_prepared_triangle ) == 108u ||
582+ sizeof (soc_raster_prepared_triangle ) == 112u ,
583+ "unexpected prepared triangle size"
584+ );
579585 for (edge_index = 0u ;
580586 edge_index < ARRAY_COUNT (boundary_edges );
581587 ++ edge_index ) {
@@ -815,7 +821,7 @@ static int test_q8_snapped_coverage_and_depth_match_f32_math(void)
815821 {
816822 const double point_x = (double )x + 0.5 ;
817823 const double point_y = (double )y + 0.5 ;
818- const double area = continuous_edge_value (
824+ const double triangle_area = continuous_edge_value (
819825 & reconstructed [0 ],
820826 & reconstructed [1 ],
821827 reconstructed [2 ].x ,
@@ -843,7 +849,7 @@ static int test_q8_snapped_coverage_and_depth_match_f32_math(void)
843849 (float )weight0 * reconstructed [0 ].depth +
844850 (float )weight1 * reconstructed [1 ].depth +
845851 (float )weight2 * reconstructed [2 ].depth
846- ) / (float )area ;
852+ ) / (float )triangle_area ;
847853
848854 CHECK (stored_depth >= 0.0f );
849855 CHECK (stored_depth <= 1.0f );
@@ -2111,9 +2117,15 @@ static int test_prepared_list_and_invalid_state_semantics(void)
21112117 uint64_t clipped_count ;
21122118 uint64_t rasterized_count ;
21132119
2114- CHECK (sizeof (soc_raster_prepared_edge ) == 24u );
2115- CHECK (sizeof (soc_raster_prepared_triangle ) == 108u ||
2116- sizeof (soc_raster_prepared_triangle ) == 112u );
2120+ _Static_assert (
2121+ sizeof (soc_raster_prepared_edge ) == 24u ,
2122+ "unexpected prepared edge size"
2123+ );
2124+ _Static_assert (
2125+ sizeof (soc_raster_prepared_triangle ) == 108u ||
2126+ sizeof (soc_raster_prepared_triangle ) == 112u ,
2127+ "unexpected prepared triangle size"
2128+ );
21172129 CHECK (soc_raster_prepared_list_reserve (NULL , 1u ) ==
21182130 SOC_RESULT_INVALID_ARGUMENT );
21192131 CHECK (soc_raster_prepared_list_reserve (& list , 2u ) == SOC_RESULT_OK );
0 commit comments