diff --git a/genkeymap/genkeymap.c b/genkeymap/genkeymap.c index 32c9d6a1..d18aca93 100644 --- a/genkeymap/genkeymap.c +++ b/genkeymap/genkeymap.c @@ -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; diff --git a/scripts/run_cppcheck.sh b/scripts/run_cppcheck.sh index 1ed15547..2561d429 100755 --- a/scripts/run_cppcheck.sh +++ b/scripts/run_cppcheck.sh @@ -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 \ diff --git a/sesman/chansrv/clipboard_file.c b/sesman/chansrv/clipboard_file.c index 0be2f6e6..5d660fee 100644 --- a/sesman/chansrv/clipboard_file.c +++ b/sesman/chansrv/clipboard_file.c @@ -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; } diff --git a/tests/common/test_string_calls_unicode.c b/tests/common/test_string_calls_unicode.c index 83f0c55b..2074b3f3 100644 --- a/tests/common/test_string_calls_unicode.c +++ b/tests/common/test_string_calls_unicode.c @@ -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 diff --git a/tests/libipm/test_libipm_send_calls.c b/tests/libipm/test_libipm_send_calls.c index 8c225def..d87ca541 100644 --- a/tests/libipm/test_libipm_send_calls.c +++ b/tests/libipm/test_libipm_send_calls.c @@ -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) { diff --git a/tools/devel/gtcp_proxy/hexdump.c b/tools/devel/gtcp_proxy/hexdump.c index 5bb0d395..fa182331 100644 --- a/tools/devel/gtcp_proxy/hexdump.c +++ b/tools/devel/gtcp_proxy/hexdump.c @@ -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)) {