Добавлена обработка ошибок и обновлен Cmake
This commit is contained in:
parent
0945cfd7a6
commit
e7a6463357
13
APP/main.c
13
APP/main.c
|
|
@ -141,18 +141,17 @@ int main(int argc, char *argv[]) {
|
|||
char tmp[1024] = {0};
|
||||
int len = 0;
|
||||
|
||||
for (int i = 0; i < strlen(coordinateJS->valuestring); ++i) {
|
||||
for (size_t i = 0; i < strlen(coordinateJS->valuestring); ++i) {
|
||||
|
||||
tmp[len] = coordinateJS->valuestring[i];
|
||||
++len;
|
||||
|
||||
if ((coordinateJS->valuestring[i + 1] == 'N') || (coordinateJS->valuestring[i + 1] == 'S') ||
|
||||
(coordinateJS->valuestring[i + 1] == 'W') || (coordinateJS->valuestring[i + 1] == 'E')) {
|
||||
tmp[len] = coordinateJS->valuestring[i];
|
||||
++len;
|
||||
tmp[len] = ' ';
|
||||
++len;
|
||||
} else {
|
||||
tmp[len] = coordinateJS->valuestring[i];
|
||||
++len;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
int result = sscanf(tmp,
|
||||
|
|
@ -186,7 +185,7 @@ int main(int argc, char *argv[]) {
|
|||
EraGlonassMsdSetPositionValue(&msd, msd.MSD_Data.pos.lon, msd.MSD_Data.pos.lat, 0, 2);
|
||||
|
||||
} else {
|
||||
printf("Parsing coordinate error (1)");
|
||||
printf("Parsing coordinate error");
|
||||
fflush(stdout);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
cmake_minimum_required(VERSION 3.17)
|
||||
project(simulink)
|
||||
project(conv)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_C_STANDARD 17)
|
||||
|
||||
include(modular.cmake)
|
||||
|
||||
#set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -funsigned-char -pipe -Wl,-O0 -std=gnu++2a -Wall -Wextra")
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CFLAGS_DEBUG} -Os")
|
||||
|
||||
add_executable(conv ${SOURCES})
|
||||
target_link_libraries(conv PRIVATE m)
|
||||
|
|
|
|||
Loading…
Reference in New Issue