Skip to content

Commit

Permalink
Fix compile warnings, be more verbose and enable debug builds
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelm committed Jun 9, 2018
1 parent 4804c1e commit 45ac9a9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Expand Up @@ -76,6 +76,10 @@ if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Windows")
unset(CMAKE_REQUIRED_FLAGS)
endif()

if(NOT MSVC)
add_options(ALL_LANGUAGES DEBUG "-g" "-D_DEBUG" "-Wall")
endif()

build_addon(pvr.dvbviewer DVBVIEWER DEPLIBS)

include(CPack)
4 changes: 2 additions & 2 deletions appveyor.yml
Expand Up @@ -2,7 +2,7 @@ matrix:
fast_finish: true

environment:
CONFIG: Release
CONFIG: Debug
KODI_BRANCH: master # usually synced with APPVEYOR_REPO_BRANCH
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
Expand Down Expand Up @@ -123,7 +123,7 @@ build_script:
& cmd /c 'cmake --build . --config %CONFIG% -- package-addons 2>&1'
}
Else {
& cmake --build . --config $env:CONFIG -- package-addons VERBOSE=1
& cmake --build . --config $env:CONFIG -- package-addons
}
after_build:
Expand Down
11 changes: 7 additions & 4 deletions src/DvbData.cpp
Expand Up @@ -640,9 +640,10 @@ bool Dvb::GetRecordingEdl(const PVR_RECORDING &recinfo, PVR_EDL_ENTRY edl[],
break;

float start = 0.0f, stop = 0.0f;
PVR_EDL_TYPE type = PVR_EDL_TYPE_CUT;
unsigned int type = PVR_EDL_TYPE_CUT;
++lineNumber;
if (sscanf(buffer, "%f %f %u", &start, &stop, &type) < 2)
if (sscanf(buffer, "%f %f %u", &start, &stop, &type) < 2
|| type > PVR_EDL_TYPE_COMBREAK)
{
XBMC->Log(LOG_NOTICE, "Unable to parse EDL entry at line %zu. Skipping.",
lineNumber);
Expand All @@ -657,12 +658,12 @@ bool Dvb::GetRecordingEdl(const PVR_RECORDING &recinfo, PVR_EDL_ENTRY edl[],
start = std::min(start, stop);
stop = std::max(start, stop);

XBMC->Log(LOG_DEBUG, "edl line=%zu start=%f stop=%f type=%d", lineNumber,
XBMC->Log(LOG_DEBUG, "edl line=%zu start=%f stop=%f type=%u", lineNumber,
start, stop, type);

edl[idx].start = static_cast<int64_t>(start * 1000.0f);
edl[idx].end = static_cast<int64_t>(stop * 1000.0f);
edl[idx].type = type;
edl[idx].type = static_cast<PVR_EDL_TYPE>(type);
++idx;
}

Expand Down Expand Up @@ -712,6 +713,8 @@ const std::string Dvb::GetLiveStreamURL(const PVR_CHANNEL &channelinfo)
return BuildURL("flashstream/stream.flv?chid=%" PRIu64 "&%s",
backendId, g_transcodingParams.c_str());
break;
default:
break;
}
return BuildURL("upnp/channelstream/%" PRIu64 ".ts", backendId);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Timers.cpp
Expand Up @@ -434,7 +434,7 @@ Timers::Error Timers::ParseTimerFrom(const TiXmlElement *xml, Timer &timer)
auto recfolders = m_cli.GetRecordingFolders();
auto pos = std::distance(recfolders.begin(),
std::find(recfolders.begin(), recfolders.end(), recfolder));
if (pos < recfolders.size())
if (pos >= 0 && pos < static_cast<std::ptrdiff_t>(recfolders.size()))
timer.recfolder = pos;
}

Expand Down
2 changes: 1 addition & 1 deletion src/TimeshiftBuffer.cpp
Expand Up @@ -11,7 +11,7 @@ using namespace ADDON;

TimeshiftBuffer::TimeshiftBuffer(IStreamReader *strReader,
const std::string &bufferPath)
: m_strReader(strReader), m_bufferPath(bufferPath + "/tsbuffer.ts")
: m_bufferPath(bufferPath + "/tsbuffer.ts"), m_strReader(strReader)
{
m_readTimeout = (g_readTimeout) ? g_readTimeout : DEFAULT_READ_TIMEOUT;

Expand Down

0 comments on commit 45ac9a9

Please sign in to comment.