lib, lscpu: fix const qualifier discarded warnings in bsearch
Fix compilation warnings from newer compilers with stricter
const-correctness checks. When bsearch() searches in const arrays,
the result pointer must also be const to avoid discarding the
const qualifier.
Fixed in:
- lib/color-names.c: searching in static const basic_schemes[]
- sys-utils/lscpu-cputype.c: searching in const pattern arrays
The warnings were:
lib/color-names.c:62:13: error: assignment discards 'const'
qualifier from pointer target type
[-Werror=discarded-qualifiers]
Signed-off-by: Karel Zak <kzak@redhat.com>
(cherry picked from commit
0cef3e4f5aac19bc3623883ca64c66538aa9b442)