mirror of https://github.com/ARMmbed/mbed-os.git
Set unit tests to C++14
Adjust some non-C++11-compatible code that failed as a result.pull/10274/head
parent
f0ec856020
commit
607856ee9a
|
@ -9,10 +9,10 @@ project(${PROJECT_NAME})
|
|||
macro(use_cxx14)
|
||||
if (CMAKE_VERSION VERSION_LESS 3.1)
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++98")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++14")
|
||||
endif()
|
||||
else()
|
||||
set(CMAKE_CXX_STANDARD 98)
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
endif()
|
||||
endmacro()
|
||||
|
|
|
@ -55,7 +55,7 @@ int ATHandler_stub::int_count = kRead_int_table_size;
|
|||
bool ATHandler_stub::process_oob_urc = false;
|
||||
|
||||
int ATHandler_stub::read_string_index = kRead_string_table_size;
|
||||
const char *ATHandler_stub::read_string_table[kRead_string_table_size] = {'\0'};
|
||||
const char *ATHandler_stub::read_string_table[kRead_string_table_size];
|
||||
int ATHandler_stub::resp_stop_success_count = kResp_stop_count_default;
|
||||
|
||||
bool ATHandler_stub::get_debug_flag = false;
|
||||
|
|
|
@ -41,7 +41,7 @@ const uint8_t SMS_MAX_GSM7_CONCATENATED_SINGLE_SMS_SIZE = 153;
|
|||
#define NVAM '?' // Not Valid ascii, ISO-8859-1 mark
|
||||
|
||||
// mapping table from 7-bit GSM to ascii (ISO-8859-1)
|
||||
static const char gsm_to_ascii[] = {
|
||||
static const unsigned char gsm_to_ascii[] = {
|
||||
64, // 0
|
||||
163, // 1
|
||||
36, // 2
|
||||
|
@ -1153,7 +1153,7 @@ uint16_t AT_CellularSMS::pack_7_bit_gsm_and_hex(const char *str, uint16_t len, c
|
|||
char *gsm_str = new char[len];
|
||||
for (uint16_t y = 0; y < len; y++) {
|
||||
for (int x = 0; x < GSM_TO_ASCII_TABLE_SIZE; x++) {
|
||||
if (gsm_to_ascii[x] == str[y]) {
|
||||
if (gsm_to_ascii[x] == static_cast<unsigned char>(str[y])) {
|
||||
gsm_str[y] = x;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue