Commit ce9ab11f authored by Philip Trettner's avatar Philip Trettner

Fixed some new compiler warnings/errors

parent d1adbf84
Pipeline #1787 skipped
......@@ -49,4 +49,14 @@ target_include_directories(AntTweakBar PUBLIC include)
if (UNIX)
target_compile_definitions(AntTweakBar PUBLIC _UNIX)
target_link_libraries(AntTweakBar PRIVATE X11)
target_compile_options(AntTweakBar PRIVATE
-Wno-strict-aliasing
)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
target_compile_options(AntTweakBar PRIVATE
-Wno-unused-const-variable
)
endif()
endif()
......@@ -220,7 +220,7 @@ void ANT_CALL CColorExt::CopyVarFromExtCB(void *_VarValue, const void *_ExtValue
ext->m_HasAlpha = false;
// Synchronize HLS and RGB
if( _ExtMemberIndex>=0 && _ExtMemberIndex<=2 )
if( _ExtMemberIndex<=2 )
ext->RGB2HLS();
else if( _ExtMemberIndex>=3 && _ExtMemberIndex<=5 )
ext->HLS2RGB();
......@@ -4922,7 +4922,7 @@ void ANT_CALL CTwMgr::CStruct::DefaultSummary(char *_SummaryString, size_t _Summ
size_t structIndex = (size_t)(_ClientData);
if( g_TwMgr && _SummaryString && _SummaryMaxLength>2
&& varGroup && static_cast<const CTwVar *>(varGroup)->IsGroup()
&& structIndex>=0 && structIndex<=g_TwMgr->m_Structs.size() )
&& structIndex<=g_TwMgr->m_Structs.size() )
{
// return g_TwMgr->m_Structs[structIndex].m_Name.c_str();
CTwMgr::CStruct& s = g_TwMgr->m_Structs[structIndex];
......@@ -5110,14 +5110,12 @@ bool TwGetKeyCode(int *_Code, int *_Modif, const char *_String)
*_Modif = TW_KMOD_NONE;
*_Code = 0;
size_t Start = strlen(_String)-1;
if( Start<0 )
return false;
while( Start>0 && _String[Start-1]!='+' )
--Start;
while( _String[Start]==' ' || _String[Start]=='\t' )
++Start;
char *CodeStr = _strdup(_String+Start);
for( size_t i=strlen(CodeStr)-1; i>=0; ++i )
for( int i=(int)strlen(CodeStr)-1; i>=0; --i )
if( CodeStr[i]==' ' || CodeStr[i]=='\t' )
CodeStr[i] = '\0';
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment