Skip to content

Commit

Permalink
Eliminate compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
gkv311 committed Jun 6, 2017
1 parent b687433 commit 48c6227
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 47 deletions.
6 changes: 3 additions & 3 deletions StMoviePlayer/StVideo/StAVPacketQueue.h
Expand Up @@ -229,9 +229,9 @@ class StAVPacketQueue {
/**
* Open stream.
*/
ST_LOCAL virtual bool init(AVFormatContext* theFormatCtx,
const unsigned int theStreamId,
const StString& theFileName);
ST_LOCAL bool init(AVFormatContext* theFormatCtx,
const unsigned int theStreamId,
const StString& theFileName);

protected: //! @name Fields should be full-controlled by heirs

Expand Down
6 changes: 3 additions & 3 deletions StMoviePlayer/StVideo/StAudioQueue.h
Expand Up @@ -68,9 +68,9 @@ class StAudioQueue : public StAVPacketQueue {
* @param theStreamId stream id in video format context
* @return true if no error
*/
ST_LOCAL virtual bool init(AVFormatContext* theFormatCtx,
const unsigned int theStreamId,
const StString& theFileName) ST_ATTR_OVERRIDE;
ST_LOCAL bool init(AVFormatContext* theFormatCtx,
const unsigned int theStreamId,
const StString& theFileName);

/**
* Clean function.
Expand Down
6 changes: 3 additions & 3 deletions StMoviePlayer/StVideo/StSubtitleQueue.h
Expand Up @@ -56,9 +56,9 @@ class StSubtitleQueue : public StAVPacketQueue {
* @param streamId stream id in video format context
* @return true if no error
*/
ST_LOCAL virtual bool init(AVFormatContext* theFormatCtx,
const unsigned int theStreamId,
const StString& theFileName) ST_ATTR_OVERRIDE;
ST_LOCAL bool init(AVFormatContext* theFormatCtx,
const unsigned int theStreamId,
const StString& theFileName);

/**
* Clean function.
Expand Down
2 changes: 2 additions & 0 deletions StMoviePlayer/StVideo/StVideo.cpp
Expand Up @@ -34,6 +34,7 @@ namespace {
return SV_THREAD_RETURN 0;
}

#ifdef ST_AV_NEWCODECPAR
/**
* Format framerate value.
*/
Expand All @@ -52,6 +53,7 @@ namespace {
}
return aBuff;
}
#endif

/**
* Format stream info.
Expand Down
36 changes: 4 additions & 32 deletions include/StStrings/StStringUnicode.inl
Expand Up @@ -181,14 +181,7 @@ StStringUnicode<Type>::StStringUnicode(const int64_t theInt64) {
this->Size = 0;
this->Length = 0;
char aBuff[32];
#if defined(_MSC_VER)
stsprintf(aBuff, 32, "%I64i", theInt64);
#elif (defined(_WIN64) || defined(__WIN64__)\
|| defined(_LP64) || defined(__LP64__))
stsprintf(aBuff, 32, "%li", theInt64);
#else
stsprintf(aBuff, 32, "%lli", theInt64);
#endif
stsprintf(aBuff, 32, "%" PRId64, theInt64);
fromUnicode(aBuff);
}

Expand All @@ -198,14 +191,7 @@ StStringUnicode<Type>::StStringUnicode(const uint64_t theUInt64) {
this->Size = 0;
this->Length = 0;
char aBuff[32];
#if defined(_MSC_VER)
stsprintf(aBuff, 32, "%I64u", theUInt64);
#elif (defined(_WIN64) || defined(__WIN64__)\
|| defined(_LP64) || defined(__LP64__))
stsprintf(aBuff, 32, "%lu", theUInt64);
#else
stsprintf(aBuff, 32, "%llu", theUInt64);
#endif
stsprintf(aBuff, 32, "%" PRIu64, theUInt64);
fromUnicode(aBuff);
}

Expand All @@ -216,14 +202,7 @@ StStringUnicode<Type>::StStringUnicode(const stInt64ext_t theInt64) {
this->Size = 0;
this->Length = 0;
char aBuff[32];
#if defined(_MSC_VER)
stsprintf(aBuff, 32, "%I64i", theInt64);
#elif (defined(_WIN64) || defined(__WIN64__)\
|| defined(_LP64) || defined(__LP64__))
stsprintf(aBuff, 32, "%li", theInt64);
#else
stsprintf(aBuff, 32, "%lli", theInt64);
#endif
stsprintf(aBuff, 32, "%" PRId64, (int64_t )theInt64);
fromUnicode(aBuff);
}

Expand All @@ -233,14 +212,7 @@ StStringUnicode<Type>::StStringUnicode(const stUInt64ext_t theUInt64) {
this->Size = 0;
this->Length = 0;
char aBuff[32];
#if defined(_MSC_VER)
stsprintf(aBuff, 32, "%I64u", theUInt64);
#elif (defined(_WIN64) || defined(__WIN64__)\
|| defined(_LP64) || defined(__LP64__))
stsprintf(aBuff, 32, "%lu", theUInt64);
#else
stsprintf(aBuff, 32, "%llu", theUInt64);
#endif
stsprintf(aBuff, 32, "%" PRIu64, (uint64_t )theUInt64);
fromUnicode(aBuff);
}
#endif
Expand Down
38 changes: 32 additions & 6 deletions include/stTypes.h
@@ -1,5 +1,5 @@
/**
* Copyright © 2009-2014 Kirill Gavrilov <kirill@sview.ru>
* Copyright © 2009-2017 Kirill Gavrilov <kirill@sview.ru>
*
* Distributed under the Boost Software License, Version 1.0.
* See accompanying file license-boost.txt or copy at
Expand Down Expand Up @@ -65,13 +65,13 @@
#endif

#if defined(__cplusplus) && (__cplusplus >= 201100L)
// part of C++11 standard
#define ST_ATTR_OVERRIDE override
// part of C++11 standard
#define ST_ATTR_OVERRIDE override
#elif defined(_MSC_VER) && (_MSC_VER >= 1700)
// versions before VS2012 emits warning as MSVC-specific extension
#define ST_ATTR_OVERRIDE override
// versions before VS2012 emits warning as MSVC-specific extension
#define ST_ATTR_OVERRIDE override
#else
#define ST_ATTR_OVERRIDE
#define ST_ATTR_OVERRIDE
#endif

#if defined(_MSC_VER)
Expand All @@ -84,6 +84,32 @@
#include <cstddef> // size_t, NULL
#include <cstdlib>
#include <cstring> // for memcpy

#if(defined(_MSC_VER) && (_MSC_VER < 1800))
// only Visual Studio 2013+ (vc12) provides <cinttypes> header
#define PRId64 "I64d"
#define PRIu64 "I64u"
#define SCNd64 "I64d"
#define SCNu64 "I64u"
#ifdef _WIN64
#define PRIdPTR "I64d"
#define PRIuPTR "I64u"
#define SCNdPTR "I64d"
#define SCNuPTR "I64u"
#else
#define PRIdPTR "d"
#define PRIuPTR "u"
#define SCNdPTR "d"
#define SCNuPTR "u"
#endif
#else
// use <inttypes.h< (C99) instead of <cinttypes> (C++11) for compatibility
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
#endif

#if defined(__i386) || defined(__x86_64) || defined(_M_IX86) || defined(_M_X64) || defined(_M_AMD64)
#include <xmmintrin.h> // for memory alignment
#endif
Expand Down

0 comments on commit 48c6227

Please sign in to comment.