shithub: dav1d

Download patch

ref: 9444e6923954f0b4308c0564a1107572e66c4dda
parent: 7efdb714020ad37211336ca02b48c38e41afe359
author: Jean-Baptiste Kempf <[email protected]>
date: Sat Sep 29 16:27:28 EDT 2018

Change n_fc to unsigned

This is, de facto, an unsigned counter and this fixes a warning

--- a/src/internal.h
+++ b/src/internal.h
@@ -66,7 +66,7 @@
 
 struct Dav1dContext {
     Dav1dFrameContext *fc;
-    int n_fc;
+    unsigned n_fc;
 
     // cache of OBUs that make up a single frame before we submit them
     // to a frame worker to be decoded
--- a/src/lib.c
+++ b/src/lib.c
@@ -139,7 +139,7 @@
 error:
     if (c) {
         if (c->fc) {
-            for (int n = 0; n < c->n_fc; n++)
+            for (unsigned n = 0; n < c->n_fc; n++)
                 if (c->fc[n].tc)
                     dav1d_free_aligned(c->fc[n].tc);
             dav1d_free_aligned(c->fc);
@@ -162,7 +162,7 @@
         if (c->n_fc == 1) return -EAGAIN;
 
         // flush
-        int flush_count = 0;
+        unsigned flush_count = 0;
         do {
             const unsigned next = c->frame_thread.next;
             Dav1dFrameContext *const f = &c->fc[next];
@@ -217,7 +217,7 @@
 void dav1d_flush(Dav1dContext *const c) {
     if (c->n_fc == 1) return;
 
-    for (int n = 0; n < c->n_fc; n++)
+    for (unsigned n = 0; n < c->n_fc; n++)
         c->frame_thread.out_delayed[n].flushed = 1;
 }
 
@@ -227,7 +227,7 @@
     Dav1dContext *const c = *c_out;
     if (!c) return;
 
-    for (int n = 0; n < c->n_fc; n++) {
+    for (unsigned n = 0; n < c->n_fc; n++) {
         Dav1dFrameContext *const f = &c->fc[n];
 
         // clean-up threading stuff
@@ -293,7 +293,7 @@
     }
     dav1d_free_aligned(c->fc);
     if (c->n_fc > 1) {
-        for (int n = 0; n < c->n_fc; n++)
+        for (unsigned n = 0; n < c->n_fc; n++)
             if (c->frame_thread.out_delayed[n].p.data[0])
                 dav1d_thread_picture_unref(&c->frame_thread.out_delayed[n]);
         free(c->frame_thread.out_delayed);