From: Steinar H. Gunderson Date: Sun, 24 Sep 2017 17:28:07 +0000 (+0200) Subject: Get -Wall clean. X-Git-Url: https://git.sesse.net/?p=narabu;a=commitdiff_plain;h=167d6248d003d76bd05db0e0c9a96c907f803381 Get -Wall clean. --- diff --git a/Makefile b/Makefile index 5d167cf..cad417a 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ all: narabu qdc qdd psnr -CFLAGS=-O2 -g -std=gnu++17 $(shell pkg-config --cflags movit) +CFLAGS=-O2 -g -Wall -std=gnu++17 $(shell pkg-config --cflags movit) CXXFLAGS=$(CFLAGS) LDFLAGS=$(shell pkg-config --libs movit) -lepoxy -lSDL2 diff --git a/ryg_rans/renormalize.cpp b/ryg_rans/renormalize.cpp index f748de9..fc18102 100644 --- a/ryg_rans/renormalize.cpp +++ b/ryg_rans/renormalize.cpp @@ -66,7 +66,6 @@ using CacheMap = unordered_map; // Returns HUGE_VAL if there's no legal mapping. double FindOptimalCost(uint32_t *cum_freqs, int num_syms, int available_slots, const double *log2cache, CacheMap *cache) { - static int k = 0; if (num_syms == 0) { // Encoding zero symbols needs zero bits. return 0.0; @@ -195,7 +194,7 @@ void OptimalRenormalize(uint32_t *cum_freqs, uint32_t num_syms, uint32_t target_ freq = cache[cache_key].chosen_freq; } cum_freqs[mapping[symbol_idx]] = freq; - assert(available_slots >= freq); + assert(available_slots >= 0 && unsigned(available_slots) >= freq); available_slots -= freq; }