diff --git a/sample.cpp b/sample.cpp index b68764e..7cbc8a8 100644 --- a/sample.cpp +++ b/sample.cpp @@ -6,20 +6,16 @@ // in the file PATENTS. All contributing project authors may // be found in the AUTHORS file in the root of the source tree. // -// This sample application demonstrates how to use the matroska parser -// library, which allows clients to handle a matroska format file. +// This sample application demonstrates how to use the Matroska parser +// library, which allows clients to handle a Matroska format file. + +#include #include "mkvreader.hpp" #include "mkvparser.hpp" -#include #ifdef _MSC_VER -// Silences these warnings: -// warning C4996: 'mbstowcs': This function or variable may be unsafe. Consider -// using mbstowcs_s instead. To disable deprecation, use -// _CRT_SECURE_NO_WARNINGS. See online help for details. -// Fixing this warning requires use of a function available only on Windows, -// and this sample code must support non-windows platforms. +// Disable MSVC warnings that suggest making code non-portable. #pragma warning(disable:4996) #endif diff --git a/sample_muxer.cpp b/sample_muxer.cpp index 51d9856..f367492 100644 --- a/sample_muxer.cpp +++ b/sample_muxer.cpp @@ -26,6 +26,7 @@ using mkvmuxer::uint64; #ifdef _MSC_VER +// Disable MSVC warnings that suggest making code non-portable. #pragma warning(disable:4996) #endif diff --git a/vttreader.cc b/vttreader.cc index e1b1476..e498b50 100644 --- a/vttreader.cc +++ b/vttreader.cc @@ -8,6 +8,11 @@ #include "./vttreader.h" // NOLINT +#ifdef _MSC_VER +// Disable MSVC warnings that suggest making code non-portable. +#pragma warning(disable:4996) +#endif + namespace libwebvtt { VttReader::VttReader() : file_(NULL) { diff --git a/webvttparser.cc b/webvttparser.cc index c26cd26..43d40c0 100644 --- a/webvttparser.cc +++ b/webvttparser.cc @@ -686,8 +686,8 @@ Time& Time::presentation(presentation_t d) { return *this; } - seconds = d / 1000; - milliseconds = d - 1000 * seconds; + seconds = static_cast(d / 1000); + milliseconds = static_cast(d - 1000 * seconds); minutes = seconds / 60; seconds -= 60 * minutes;