]> git.sesse.net Git - narabu/commitdiff
Get -Wall clean.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 24 Sep 2017 17:28:07 +0000 (19:28 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sun, 24 Sep 2017 17:28:07 +0000 (19:28 +0200)
Makefile
ryg_rans/renormalize.cpp

index 5d167cf4fe2bbbee9392794b5873609fd53bf50f..cad417ad06e73b5d832c5779509da9c3c4f4ab6e 100644 (file)
--- 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
 
index f748de9e6ca395ffb75c03e1e4410c6b90ed8417..fc181029df701fa46e0944d4cb3c40c9fc6428a4 100644 (file)
@@ -66,7 +66,6 @@ using CacheMap = unordered_map<CacheKey, OptimalChoice, HashCacheKey>;
 // 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;
        }