From 708f09f86dad1aa067f77bdabbdad967bd870be9 Mon Sep 17 00:00:00 2001
From: Ron <ron@debian.org>
Date: Sun, 9 Jun 2013 10:41:09 +0930
Subject: [PATCH] Fix some compiler warnings

Implicit declaration of abs() in block_size_enc.c.
Variable assigned but not used when logging is disabled in encode.c.
Unused parameter when asserts are disabled in ent{dec,enc}.c.
---
 src/block_size_enc.c |    1 +
 src/encode.c         |    4 ++++
 src/entdec.c         |    2 ++
 src/entenc.c         |    2 ++
 4 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/block_size_enc.c b/src/block_size_enc.c
index 6157524..91a621e 100644
--- a/src/block_size_enc.c
+++ b/src/block_size_enc.c
@@ -29,6 +29,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
 #include "block_size.h"
 #include "block_size_enc.h"
 #include <string.h>
+#include <stdlib.h>
 
 /* Actual 2D coding gains of lapped transforms (the 32x32 one is made-up).
    We divide by 6 to get bits from dB. */
diff --git a/src/encode.c b/src/encode.c
index 2f67029..2f0d5e7 100644
--- a/src/encode.c
+++ b/src/encode.c
@@ -1044,7 +1044,9 @@ int daala_encode_img_in(daala_enc_ctx *enc, od_img *img, int duration) {
     unsigned char *data;
     ogg_int64_t mc_sqerr;
     ogg_int64_t enc_sqerr;
+#ifdef OD_LOGGING_ENABLED
     ogg_uint32_t npixels;
+#endif
     int ystride;
     int xdec;
     int ydec;
@@ -1064,7 +1066,9 @@ int daala_encode_img_in(daala_enc_ctx *enc, od_img *img, int duration) {
     ydec = enc->state.io_imgs[OD_FRAME_INPUT].planes[pli].ydec;
     w = frame_width >> xdec;
     h = frame_height >> ydec;
+#ifdef OD_LOGGING_ENABLED
     npixels = w*h;
+#endif
     for (y = 0; y < h; y++) {
       unsigned char *prev_rec_row;
       unsigned char *rec_row;
diff --git a/src/entdec.c b/src/entdec.c
index 76aee85..f3f3806 100644
--- a/src/entdec.c
+++ b/src/entdec.c
@@ -286,6 +286,7 @@ int od_ec_decode_cdf_q15(od_ec_dec *dec, const ogg_uint16_t *cdf, int nsyms) {
   unsigned fl;
   unsigned fh;
   int ret;
+  (void)nsyms;
   dif = dec->dif;
   r = dec->rng;
   OD_ASSERT(dif >> (OD_EC_WINDOW_SIZE - 16) < r);
@@ -383,6 +384,7 @@ int od_ec_decode_cdf_unscaled_dyadic(od_ec_dec *dec,
   unsigned fl;
   unsigned fh;
   int ret;
+  (void)nsyms;
   dif = dec->dif;
   r = dec->rng;
   OD_ASSERT(dif >> (OD_EC_WINDOW_SIZE - 16) < r);
diff --git a/src/entenc.c b/src/entenc.c
index 8a4ec44..8e3733f 100644
--- a/src/entenc.c
+++ b/src/entenc.c
@@ -308,6 +308,7 @@ void od_ec_encode_cdf(od_ec_enc *enc, int s,
          This should be at most 16.*/
 void od_ec_encode_cdf_q15(od_ec_enc *enc, int s,
  const ogg_uint16_t *cdf, int nsyms) {
+  (void)nsyms;
   OD_ASSERT(s >= 0);
   OD_ASSERT(s < nsyms);
   OD_ASSERT(cdf[nsyms - 1] == 32768U);
@@ -341,6 +342,7 @@ void od_ec_encode_cdf_unscaled(od_ec_enc *enc, int s,
        This must be no more than 15.*/
 void od_ec_encode_cdf_unscaled_dyadic(od_ec_enc *enc, int s,
  const ogg_uint16_t *cdf, int nsyms, unsigned ftb) {
+  (void)nsyms;
   OD_ASSERT(s >= 0);
   OD_ASSERT(s < nsyms);
   OD_ASSERT(ftb <= 15);
-- 
1.7.2.5

