From b6337f25bf7a7a8a042925edb9ac6bbee0cb4bc2 Mon Sep 17 00:00:00 2001 From: Harald Sitter Date: Wed, 27 May 2020 14:18:11 +0200 Subject: [PATCH] make bounded() unambiguous ``` std::size_t is the unsigned integer type of the result of the sizeof operator ``` this can make the bounded call ambiguous as it either sports an int(int,int) signature or an quint32(quint32,quint32) signature. with size_t being unsigned and 0 being int it's not necessarily clear to the compiler which overload to use, so make it clear by using usigned everywhere. this specifically fixes arm32 compatibility on ubuntu 20.04 --- kcms/users/src/user.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kcms/users/src/user.cpp b/kcms/users/src/user.cpp index 92a0fa665..8c8427ce4 100644 --- a/kcms/users/src/user.cpp +++ b/kcms/users/src/user.cpp @@ -179,7 +179,8 @@ saltCharacter() { "abcdefghijklmnopqrstuvxyz" "./0123456789"; - int index = QRandomGenerator::system()->bounded(0, (sizeof(saltCharacters)/sizeof(*saltCharacters))); + const quint32 index = + QRandomGenerator::system()->bounded(0u, (sizeof(saltCharacters)/sizeof(*saltCharacters))); return saltCharacters[index]; }