Silence some pedantic format warnings from Clang.

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.
This commit is contained in:
Arthur O'Dwyer 2020-02-22 22:49:26 -05:00
parent 364c33b1d8
commit e59d22e399
1 changed files with 2 additions and 1 deletions

View File

@ -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<color_t> hues;
color_t difh = mh - minh;