diff --git a/cmake/CMakeHeader.txt b/cmake/CMakeHeader.txt index db4cf40..3d74c5c 100644 --- a/cmake/CMakeHeader.txt +++ b/cmake/CMakeHeader.txt @@ -7,8 +7,9 @@ project(${PROJECT_ID}) set(PROJECT_NAME ${PROJECT_ID}) set(PROJECT_ROOT ${CMAKE_CURRENT_SOURCE_DIR}) -set(DEBUG_OPT "-D_DEBUG -DDEBUG -Wall -Wextra -Werror -Wno-unused-parameter -O0 -g3" ) -set(RELEASE_OPT "-Wall -Wextra -Werror -Wno-unused-parameter -O3" ) +#set(DEBUG_OPT "-D_DEBUG -DDEBUG -Wall -fmax-errors=3 -Werror -O0 -g3" ) +set(DEBUG_OPT "-D_DEBUG -DDEBUG -Wall -Wextra -Werror -O0 -g3" ) +set(RELEASE_OPT "-Wall -Wextra -Werror -O3" ) set(CMAKE_CXX_FLAGS_DEBUG "${DEBUG_OPT} ") -set(CMAKE_CXX_FLAGS_RELEASE "${RELEASE_OPT} ") +set(CMAKE_CXX_FLAGS_RELEASE "${RELEASE_OPT}") diff --git a/include/pal/baseapp.h b/include/pal/baseapp.h index eb4eb93..fe6ee54 100644 --- a/include/pal/baseapp.h +++ b/include/pal/baseapp.h @@ -89,8 +89,9 @@ class TQA_SignalHandler : public Poco::SignalHandler class CLASS : public POCOAPP_CLASS { private: +#ifndef NOT_TTY_SETUP struct termios oldSettings, newSettings; - +#endif void ResetTerminal(void); void SetTerminal(void); diff --git a/src/baseapp.cpp b/src/baseapp.cpp index 97da7ba..4b94e26 100644 --- a/src/baseapp.cpp +++ b/src/baseapp.cpp @@ -268,16 +268,22 @@ bool CLASS::InitApp(void) void CLASS::SetTerminal(void) { +#ifndef NO_TTY_SETUP tcgetattr( fileno( stdin ), &oldSettings ); memcpy(&newSettings, &oldSettings, sizeof(oldSettings)); newSettings.c_lflag &= (~ICANON & ~ECHO); tcsetattr( fileno( stdin ), TCSANOW, &newSettings ); +#else + memcpy(&newSettings, &oldSettings, sizeof(oldSettings)); + +#endif } void CLASS::ResetTerminal(void) { +#ifndef NO_TTY_SETUP tcsetattr( fileno( stdin ), TCSANOW, &oldSettings ); - +#endif } char CLASS::getKey(void) @@ -297,7 +303,7 @@ char CLASS::getKey(void) if ( r > 0 ) { char c; - int x = read( fileno( stdin ), &c, 1 ); + int x = (int)read( fileno( stdin ), &c, 1 ); if (x == 1) { res = c; @@ -469,4 +475,4 @@ int CLASS::runApp(void) return (res); } -} \ No newline at end of file +} diff --git a/src/eventtask.cpp b/src/eventtask.cpp index 7f75795..92e25db 100644 --- a/src/eventtask.cpp +++ b/src/eventtask.cpp @@ -215,7 +215,7 @@ void CLASS::SendMessage(Poco::Notification::Ptr ptr) uint32_t CLASS::setTimer(uint32_t ms) { - uint32_t res = timermax; + uint32_t res = (uint32_t)timermax; timermax = ms; timerval = 0; // reset the timer return (res); @@ -426,4 +426,4 @@ void CLASS::stopAll(void) } #undef CLASS -} \ No newline at end of file +} diff --git a/src/palutils.cpp b/src/palutils.cpp index 6891d84..5bd8276 100644 --- a/src/palutils.cpp +++ b/src/palutils.cpp @@ -169,7 +169,7 @@ std::string SubstEnvironment(std::string instr) res = ""; state = 0; - len = instr.length(); + len = (uint32_t)instr.length(); for (i = 0; i < len; i++) { ch = instr[i];