Skip to content

Commit 607856e

Browse files
committed
Set unit tests to C++14
Adjust some non-C++11-compatible code that failed as a result.
1 parent f0ec856 commit 607856e

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

UNITTESTS/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ project(${PROJECT_NAME})
99
macro(use_cxx14)
1010
if (CMAKE_VERSION VERSION_LESS 3.1)
1111
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
12-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98")
12+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
1313
endif()
1414
else()
15-
set(CMAKE_CXX_STANDARD 98)
15+
set(CMAKE_CXX_STANDARD 14)
1616
set(CMAKE_CXX_STANDARD_REQUIRED ON)
1717
endif()
1818
endmacro()

UNITTESTS/stubs/ATHandler_stub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int ATHandler_stub::int_count = kRead_int_table_size;
5555
bool ATHandler_stub::process_oob_urc = false;
5656

5757
int ATHandler_stub::read_string_index = kRead_string_table_size;
58-
const char *ATHandler_stub::read_string_table[kRead_string_table_size] = {'\0'};
58+
const char *ATHandler_stub::read_string_table[kRead_string_table_size];
5959
int ATHandler_stub::resp_stop_success_count = kResp_stop_count_default;
6060

6161
bool ATHandler_stub::get_debug_flag = false;

features/cellular/framework/AT/AT_CellularSMS.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const uint8_t SMS_MAX_GSM7_CONCATENATED_SINGLE_SMS_SIZE = 153;
4141
#define NVAM '?' // Not Valid ascii, ISO-8859-1 mark
4242

4343
// mapping table from 7-bit GSM to ascii (ISO-8859-1)
44-
static const char gsm_to_ascii[] = {
44+
static const unsigned char gsm_to_ascii[] = {
4545
64, // 0
4646
163, // 1
4747
36, // 2
@@ -1153,7 +1153,7 @@ uint16_t AT_CellularSMS::pack_7_bit_gsm_and_hex(const char *str, uint16_t len, c
11531153
char *gsm_str = new char[len];
11541154
for (uint16_t y = 0; y < len; y++) {
11551155
for (int x = 0; x < GSM_TO_ASCII_TABLE_SIZE; x++) {
1156-
if (gsm_to_ascii[x] == str[y]) {
1156+
if (gsm_to_ascii[x] == static_cast<unsigned char>(str[y])) {
11571157
gsm_str[y] = x;
11581158
}
11591159
}

0 commit comments

Comments
 (0)