From e59d22e3993c9c855e616cc03fd5bd86ed6b5992 Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Sat, 22 Feb 2020 22:49:26 -0500 Subject: [PATCH] Silence some pedantic format warnings from Clang. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rogueviz/rogueviz.cpp: In function ‘hr::color_t rogueviz::parse1(const string&)’: rogueviz/rogueviz.cpp:76:75: error: format ‘%x’ expects argument of type ‘unsigned int*’, but argument 3 has type ‘int*’ [-Werror=format=] sscanf(s.c_str(), "R%x,%x,%x,%d,%d", &mh, &minh, &alpha, &step, &start); ^ I believe these three variables should have been `color_t` all along. I think this fix doesn't change any of the arithmetic, but I could be wrong. --- rogueviz/rogueviz.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rogueviz/rogueviz.cpp b/rogueviz/rogueviz.cpp index 5cb963d3..03bc13b1 100644 --- a/rogueviz/rogueviz.cpp +++ b/rogueviz/rogueviz.cpp @@ -72,7 +72,8 @@ color_t parse1(const string& s) { // color can be given as RRGGBB // or as 'Rmax,min,alpha,step,start', for rainbow Collatz if(s[0] == 'R') { - int mh = 192, minh = 0, alpha = 255, step = 50, start = 0; + color_t mh = 192, minh = 0, alpha = 255; + int step = 50, start = 0; sscanf(s.c_str(), "R%x,%x,%x,%d,%d", &mh, &minh, &alpha, &step, &start); vector hues; color_t difh = mh - minh;