[vlc-commits] [Git][videolan/vlc][master] libplacebo: utils: fix comparison warnings

Jean-Baptiste Kempf (@jbk) gitlab at videolan.org
Thu Apr 28 16:28:01 UTC 2022



Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC


Commits:
409cde2f by Alexandre Janniaux at 2022-04-28T15:53:13+00:00
libplacebo: utils: fix comparison warnings

    ../../modules/video_output/libplacebo/utils.c: In function ‘vlc_placebo_DoviMetadata’:
    ../../modules/video_output/libplacebo/utils.c:472:23: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
      472 |     for (int c = 0; c < ARRAY_SIZE(dst->comp); c++) {
          |                       ^
    ../../modules/video_output/libplacebo/utils.c:486:35: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
      486 |                 for (int k = 0; k < ARRAY_SIZE(cdst->poly_coeffs[i]); k++) {
          |                                   ^
    ../../modules/video_output/libplacebo/utils.c:496:39: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
      496 |                     for (int k = 0; k < ARRAY_SIZE(cdst->mmr_coeffs[i][j]); k++)
          |                                       ^

- - - - -


1 changed file:

- modules/video_output/libplacebo/utils.c


Changes:

=====================================
modules/video_output/libplacebo/utils.c
=====================================
@@ -469,7 +469,7 @@ void vlc_placebo_DoviMetadata(struct pl_frame *frame, const picture_t *pic,
     memcpy(dst->nonlinear.m[0], src->nonlinear_matrix, sizeof(dst->nonlinear.m));
     memcpy(dst->linear.m[0], src->linear_matrix, sizeof(dst->linear.m));
 
-    for (int c = 0; c < ARRAY_SIZE(dst->comp); c++) {
+    for (size_t c = 0; c < ARRAY_SIZE(dst->comp); c++) {
         const struct vlc_dovi_reshape_t *csrc = &src->curves[c];
         struct pl_reshape_data *cdst = &dst->comp[c];
         cdst->num_pivots = csrc->num_pivots;
@@ -483,7 +483,7 @@ void vlc_placebo_DoviMetadata(struct pl_frame *frame, const picture_t *pic,
             cdst->method[i] = csrc->mapping_idc[i];
             switch (csrc->mapping_idc[i]) {
             case VLC_DOVI_RESHAPE_POLYNOMIAL:
-                for (int k = 0; k < ARRAY_SIZE(cdst->poly_coeffs[i]); k++) {
+                for (size_t k = 0; k < ARRAY_SIZE(cdst->poly_coeffs[i]); k++) {
                     cdst->poly_coeffs[i][k] = (k <= csrc->poly_order[i])
                         ? scale * csrc->poly_coef[i][k]
                         : 0.0f;
@@ -493,7 +493,7 @@ void vlc_placebo_DoviMetadata(struct pl_frame *frame, const picture_t *pic,
                 cdst->mmr_order[i] = csrc->mmr_order[i];
                 cdst->mmr_constant[i] = scale * csrc->mmr_constant[i];
                 for (int j = 0; j < csrc->mmr_order[i]; j++) {
-                    for (int k = 0; k < ARRAY_SIZE(cdst->mmr_coeffs[i][j]); k++)
+                    for (size_t k = 0; k < ARRAY_SIZE(cdst->mmr_coeffs[i][j]); k++)
                         cdst->mmr_coeffs[i][j][k] = scale * csrc->mmr_coef[i][j][k];
                 }
                 break;



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/409cde2f28b710272708c4b32630e90c03b7f049

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/409cde2f28b710272708c4b32630e90c03b7f049
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list