Merge pull request #3747 from firewave/cppcheck-cv

enabled and fixed `constVariable` Cppcheck warnings
This commit is contained in:
matt335672
2026-03-06 11:01:56 +00:00
committed by GitHub
6 changed files with 12 additions and 12 deletions
+1 -1
View File
@@ -364,7 +364,7 @@ int main(int argc, char **argv)
"capslock", "capslockaltgr", "shiftcapslock", "shiftcapslockaltgr",
"numlock"
};
int states[NUM_STATES] = {0, 1, 0x80, 0x81, 2, 0x82, 3, 0x83, 0x10};
const int states[NUM_STATES] = {0, 1, 0x80, 0x81, 2, 0x82, 3, 0x83, 0x10};
int idx;
Display *dpy = NULL;
FILE *outf = NULL;
+1 -1
View File
@@ -87,7 +87,7 @@ if [ -z "$CPPCHECK_FLAGS" ]; then
--enable=warning,missingInclude,style,portability --disable=performance --error-exitcode=1 \
-i third_party \
-i vrplayer \
--suppress=constParameterCallback --suppress=variableScope --suppress=constParameterPointer --suppress=constVariablePointer --suppress=duplicateCondition --suppress=redundantAssignment --suppress=knownConditionTrueFalse --suppress=unreadVariable --suppress=constParameter --suppress=constVariable --suppress=shadowFunction --suppress=unusedStructMember --suppress=duplicateExpression --suppress=unsignedLessThanZero --suppress=shadowVariable --suppress=unreachableCode --suppress=noExplicitConstructor --suppress=constParameterReference --suppress=functionStatic --suppress=shadowArgument --suppress=truncLongCastAssignment --suppress=cstyleCast --suppress=constVariableReference --suppress=badBitmaskCheck \
--suppress=constParameterCallback --suppress=variableScope --suppress=constParameterPointer --suppress=constVariablePointer --suppress=duplicateCondition --suppress=redundantAssignment --suppress=knownConditionTrueFalse --suppress=unreadVariable --suppress=constParameter --suppress=shadowFunction --suppress=unusedStructMember --suppress=duplicateExpression --suppress=unsignedLessThanZero --suppress=shadowVariable --suppress=unreachableCode --suppress=noExplicitConstructor --suppress=constParameterReference --suppress=functionStatic --suppress=shadowArgument --suppress=truncLongCastAssignment --suppress=cstyleCast --suppress=constVariableReference --suppress=badBitmaskCheck \
--suppress=missingIncludeSystem \
--suppress=uninitMemberVar:ulalaca/ulalaca.cpp \
--suppress=dangerousTypeCast:ulalaca/XrdpStream.template.cpp \
+1 -1
View File
@@ -108,7 +108,7 @@ decode_rfc3986(const char *rfc3986, int len)
if (rfc3986[i] == '%' && (len - i) > 2 &&
isxdigit(rfc3986[i + 1]) && isxdigit(rfc3986[i + 2]))
{
char jchr[] = { rfc3986[i + 1], rfc3986[i + 2], '\0' };
const char jchr[] = { rfc3986[i + 1], rfc3986[i + 2], '\0' };
result[j++] = g_htoi(jchr);
i += 3;
}
+5 -5
View File
@@ -160,7 +160,7 @@ END_TEST
/******************************************************************************/
START_TEST(test_get_next_char__section_2)
{
struct utf8_decode_sub_test tests[] =
const struct utf8_decode_sub_test tests[] =
{
// 2.1 First possible sequence of a certain length
//
@@ -209,7 +209,7 @@ END_TEST
/******************************************************************************/
START_TEST(test_get_next_char__section_3)
{
struct utf8_decode_sub_test tests[] =
const struct utf8_decode_sub_test tests[] =
{
// 3.1 Unexpected continuation bytes
//
@@ -349,7 +349,7 @@ END_TEST
/******************************************************************************/
START_TEST(test_get_next_char__section_4)
{
struct utf8_decode_sub_test tests[] =
const struct utf8_decode_sub_test tests[] =
{
// 4.1 Examples of an overlong ASCII character
//
@@ -399,7 +399,7 @@ END_TEST
/******************************************************************************/
START_TEST(test_get_next_char__section_5)
{
struct utf8_decode_sub_test tests[] =
const struct utf8_decode_sub_test tests[] =
{
// 5 Illegal code positions
@@ -515,7 +515,7 @@ END_TEST
/******************************************************************************/
START_TEST(test_utf_char32_to_utf8)
{
struct utf8_encode_sub_test tests[] =
const struct utf8_encode_sub_test tests[] =
{
// E2.1 First possible sequence of a certain length
+1 -1
View File
@@ -99,7 +99,7 @@ test_small_type_values(char typechar,
{
unsigned int i;
enum libipm_status status;
char format[] = { typechar, '\0'};
const char format[] = { typechar, '\0'};
for (i = 0 ; i < count; ++i)
{
+3 -3
View File
@@ -46,9 +46,9 @@ void hexdump(int address, char *buf, int len)
unsigned char c;
char cvt[] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
};
const char cvt[] = {'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f'
};
if ((buf == NULL) || (len <= 0))
{