This website uses cookies and other technology to provide you a more personalized
experience. By
continuing the view of our web-pages you accept the terms of using these files. If you
don't
want your personal data to be processed, please, leave this site.
Learn More →
Examples of errors detected by the V1044 diagnostic
V1044. Loop break conditions do not depend on the number of iterations.
Mozilla Thunderbird
V1044 Loop break conditions do not depend on the number of iterations. mimemoz2.cpp 1795
void ResetChannelCharset(MimeObject *obj) {
....
if (cSet) {
char *ptr2 = cSet;
while ((*cSet) && (*cSet != ' ') && (*cSet != ';') &&
(*cSet != '\r') && (*cSet != '\n') && (*cSet != '"'))
ptr2++;
if (*cSet) {
PR_FREEIF(obj->options->default_charset);
obj->options->default_charset = strdup(cSet);
obj->options->override_charset = true;
}
PR_FREEIF(cSet);
}
....
}
Blend2D
V1044 Loop break conditions do not depend on the number of iterations. otcmap.cpp 59
#if defined(__GNUC__)
#define BL_LIKELY(...) __builtin_expect(!!(__VA_ARGS__), 1)
#define BL_UNLIKELY(...) __builtin_expect(!!(__VA_ARGS__), 0)
#else
#define BL_LIKELY(...) (__VA_ARGS__)
#define BL_UNLIKELY(...) (__VA_ARGS__)
#endif
....
static BLResult BL_CDECL mapTextToGlyphsFormat0(....) noexcept {
// ....
uint32_t* ptr = content;
uint32_t* end = content + count;
// ....
while (ptr != end) {
uint32_t codePoint = content[0];
uint32_t glyphId = codePoint < 256
? uint32_t(glyphIdArray[codePoint].value())
: uint32_t(0);
content[0] = glyphId;
if (BL_UNLIKELY(glyphId == 0)) {
if (!undefinedCount)
state->undefinedFirst = (size_t)(ptr - content);
undefinedCount++;
}
}
// ....
}