Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions cmake/CMakeHeader.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
3 changes: 2 additions & 1 deletion include/pal/baseapp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
12 changes: 9 additions & 3 deletions src/baseapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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;
Expand Down Expand Up @@ -469,4 +475,4 @@ int CLASS::runApp(void)
return (res);
}

}
}
4 changes: 2 additions & 2 deletions src/eventtask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -426,4 +426,4 @@ void CLASS::stopAll(void)
}

#undef CLASS
}
}
2 changes: 1 addition & 1 deletion src/palutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down