Skip to content

Commit aa3b8d9

Browse files
authored
Code cleanup: Use c++ type std::uintptr_t (danmar#6681)
1 parent 17d2cef commit aa3b8d9

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

cppcheckpremium-suppressions

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ premium-misra-cpp-2023-7.11.3
127127
# too picky about operator precedence.
128128
premium-misra-cpp-2023-8.0.1
129129

130-
# TODO use std::uintptr_t
130+
# TODO review lambda captures
131131
premium-misra-cpp-2023-8.1.1
132132

133133
# TODO should we use this rule?
@@ -139,9 +139,6 @@ premium-misra-cpp-2023-8.2.6
139139
# intentional pointer to int conversion in lib/utils.h to output dump files
140140
premium-misra-cpp-2023-8.2.7:lib/utils.h
141141

142-
# TODO: use std::uintptr_t
143-
premium-misra-cpp-2023-8.2.8
144-
145142
# TODO check ellipsis usage
146143
premium-misra-cpp-2023-8.2.11
147144

lib/utils.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ static inline std::string id_string_i(std::uintptr_t l)
322322
while (l != 0)
323323
{
324324
char c;
325-
const uintptr_t temp = l % 16; // get the remainder
325+
const std::uintptr_t temp = l % 16; // get the remainder
326326
if (temp < 10) {
327327
// 0-9
328328
c = '0' + temp;
@@ -340,7 +340,7 @@ static inline std::string id_string_i(std::uintptr_t l)
340340

341341
static inline std::string id_string(const void* p)
342342
{
343-
return id_string_i(reinterpret_cast<uintptr_t>(p));
343+
return id_string_i(reinterpret_cast<std::uintptr_t>(p));
344344
}
345345

346346
static inline const char* bool_to_string(bool b)

0 commit comments

Comments
 (0)