diff options
author | Martijn Kaijser <machine.sanctum@gmail.com> | 2015-02-12 06:42:20 +0100 |
---|---|---|
committer | Martijn Kaijser <machine.sanctum@gmail.com> | 2015-02-12 06:42:20 +0100 |
commit | c096e7eed321a0c90073d73d35cec463cefc5a0e (patch) | |
tree | ad255d7a7a9236c8b6d70e6b4d160b9c04ae3a8b | |
parent | fd81a3e29b7f80cabf8f333c3bb867dc80c67d4b (diff) | |
parent | 57b32cebc1d9af03f06c3c1b29a7c1aeb838b5cc (diff) |
Merge pull request #6412 from Memphiz/c++11
Move to C++11; use as much std:: instead of boost:: as possible
281 files changed, 960 insertions, 580 deletions
diff --git a/configure.in b/configure.in index 121f41c9a6..0f9cda7001 100644 --- a/configure.in +++ b/configure.in @@ -7,6 +7,7 @@ AC_CONFIG_HEADERS([xbmc/config.h]) AH_TOP([#pragma once]) m4_include([m4/ax_prog_cc_for_build.m4]) m4_include([m4/ax_prog_cxx_for_build.m4]) +m4_include([m4/ax_cxx_compile_stdcxx_11.m4]) m4_include([m4/ax_python_devel.m4]) m4_include([m4/xbmc_arch.m4]) @@ -579,6 +580,7 @@ PASSED_CXXFLAGS=$CXXFLAGS # Hack to override autoconf default values AC_PROG_CXX AX_PROG_CXX_FOR_BUILD CXXFLAGS="$PASSED_CXXFLAGS $DEFAULT_COMPILE_FLAGS" +AX_CXX_COMPILE_STDCXX_11(,[optional]) AC_PROG_LIBTOOL AC_PROG_AWK AC_PROG_LN_S @@ -928,7 +930,7 @@ AC_CHECK_HEADER([sys/inotify.h], AC_DEFINE([HAVE_INOTIFY],[1],[Define if we have # Checks for boost headers using CXX instead of CC AC_LANG_PUSH([C++]) -AC_CHECK_HEADER([boost/shared_ptr.hpp],, AC_MSG_ERROR($missing_library)) +AC_CHECK_HEADER([boost/circular_buffer.hpp],, AC_MSG_ERROR($missing_library)) AC_LANG_POP([C++]) # Python diff --git a/lib/cximage-6.0/CxImage/ximadsp.cpp b/lib/cximage-6.0/CxImage/ximadsp.cpp index a21c0661a3..fd13446b0e 100644 --- a/lib/cximage-6.0/CxImage/ximadsp.cpp +++ b/lib/cximage-6.0/CxImage/ximadsp.cpp @@ -3531,7 +3531,7 @@ bool CxImage::FloodFill(const long xStart, const long yStart, const RGBQUAD cFil //------------------------------------- Begin of Flood Fill POINT offset[4] = {{-1,0},{0,-1},{1,0},{0,1}}; std::queue<POINT> q; - POINT point = {xStart,yStart}; + POINT point = {(int)xStart,(int)yStart}; q.push(point); if (IsIndexed()){ //--- Generic indexed image, no tolerance OR Grayscale image with tolerance diff --git a/lib/cximage-6.0/CxImage/ximaico.cpp b/lib/cximage-6.0/CxImage/ximaico.cpp index 1d0c697c6c..752d40c9e6 100644 --- a/lib/cximage-6.0/CxImage/ximaico.cpp +++ b/lib/cximage-6.0/CxImage/ximaico.cpp @@ -322,7 +322,7 @@ bool CxImageICO::Encode(CxFile * hFile, bool bAppend, int nPageCount) int nPages = nPageCount; if (nPages<1) nPages = 1; - ICONHEADER icon_header={0,1,nPages}; + ICONHEADER icon_header={0,1,(WORD)nPages}; if (!bAppend) m_dwImageOffset = sizeof(ICONHEADER) + nPages * sizeof(ICONDIRENTRY); @@ -345,7 +345,7 @@ bool CxImageICO::Encode(CxFile * hFile, bool bAppend, int nPageCount) 2*head.biHeight, 1, (WORD)bitcount, - 0, imagesize, + 0, (DWORD)imagesize, 0, 0, 0, 0 }; diff --git a/m4/ax_cxx_compile_stdcxx_11.m4 b/m4/ax_cxx_compile_stdcxx_11.m4 new file mode 100644 index 0000000000..2bc054d981 --- /dev/null +++ b/m4/ax_cxx_compile_stdcxx_11.m4 @@ -0,0 +1,142 @@ +# ============================================================================ +# http://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html +# ============================================================================ +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX_11([ext|noext],[mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the C++11 +# standard; if necessary, add switches to CXXFLAGS to enable support. +# +# The first argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for an extended mode. +# +# The second argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline C++11 support is required and that the macro +# should error out if no mode with that support is found. If specified +# 'optional', then configuration proceeds regardless, after defining +# HAVE_CXX11 if and only if a supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik <bkoz@redhat.com> +# Copyright (c) 2012 Zack Weinberg <zackw@panix.com> +# Copyright (c) 2013 Roy Stogner <roystgnr@ices.utexas.edu> +# Copyright (c) 2014 Alexey Sokolov <sokolov@google.com> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 4 + +m4_define([_AX_CXX_COMPILE_STDCXX_11_testbody], [[ + template <typename T> + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + struct Base { + virtual void f() {} + }; + struct Child : public Base { + virtual void f() {} + }; + + typedef check<check<bool>> right_angle_brackets; + + int a; + decltype(a) b; + + typedef check<int> check_type; + check_type c; + check_type&& cr = static_cast<check_type&&>(c); + + auto d = a; + auto l = [](){}; +]]) + +AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [dnl + m4_if([$1], [], [], + [$1], [ext], [], + [$1], [noext], [], + [m4_fatal([invalid argument `$1' to AX_CXX_COMPILE_STDCXX_11])])dnl + m4_if([$2], [], [ax_cxx_compile_cxx11_required=true], + [$2], [mandatory], [ax_cxx_compile_cxx11_required=true], + [$2], [optional], [ax_cxx_compile_cxx11_required=false], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX_11])]) + AC_LANG_PUSH([C++])dnl + ac_success=no + AC_CACHE_CHECK(whether $CXX supports C++11 features by default, + ax_cv_cxx_compile_cxx11, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [ax_cv_cxx_compile_cxx11=yes], + [ax_cv_cxx_compile_cxx11=no])]) + if test x$ax_cv_cxx_compile_cxx11 = xyes; then + ac_success=yes + fi + + m4_if([$1], [noext], [], [dnl + if test x$ac_success = xno; then + for switch in -std=gnu++11 -std=gnu++0x; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, + $cachevar, + [ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXXFLAGS="$ac_save_CXXFLAGS"]) + if eval test x\$$cachevar = xyes; then + CXXFLAGS="$CXXFLAGS $switch" + ac_success=yes + break + fi + done + fi]) + + m4_if([$1], [ext], [], [dnl + if test x$ac_success = xno; then + for switch in -std=c++11 -std=c++0x; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx11_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++11 features with $switch, + $cachevar, + [ac_save_CXXFLAGS="$CXXFLAGS" + CXXFLAGS="$CXXFLAGS $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_11_testbody])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXXFLAGS="$ac_save_CXXFLAGS"]) + if eval test x\$$cachevar = xyes; then + CXXFLAGS="$CXXFLAGS $switch" + ac_success=yes + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx11_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++11 language features is required.]) + fi + else + if test x$ac_success = xno; then + HAVE_CXX11=0 + AC_MSG_NOTICE([No compiler with C++11 support was found]) + else + HAVE_CXX11=1 + AC_DEFINE(HAVE_CXX11,1, + [define if the compiler supports basic C++11 syntax]) + fi + + AC_SUBST(HAVE_CXX11) + fi +]) diff --git a/tools/buildsteps/atv2/make-xbmc b/tools/buildsteps/atv2/make-xbmc index 5b8bb111f7..2368622cc3 100755 --- a/tools/buildsteps/atv2/make-xbmc +++ b/tools/buildsteps/atv2/make-xbmc @@ -4,5 +4,5 @@ XBMC_PLATFORM_DIR=atv2 cd $WORKSPACE;make -j$BUILDTHREADS xcode_depends cd $WORKSPACE;xcodebuild -project Kodi.xcodeproj -target Kodi-ATV2 -configuration $Configuration build \ - ONLY_ACTIVE_ARCH=YES ARCHS=armv7 VALID_ARCHS=armv7 IPHONEOS_DEPLOYMENT_TARGET=4.2 \ + ONLY_ACTIVE_ARCH=YES ARCHS=armv7 VALID_ARCHS=armv7 \ SDKROOT=iphoneos$SDK_VERSION XBMC_DEPENDS_ROOT=$XBMC_DEPENDS_ROOT CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO diff --git a/tools/buildsteps/ios/make-xbmc b/tools/buildsteps/ios/make-xbmc index 90003383bc..6f1e7dc242 100755 --- a/tools/buildsteps/ios/make-xbmc +++ b/tools/buildsteps/ios/make-xbmc @@ -4,6 +4,6 @@ XBMC_PLATFORM_DIR=ios cd $WORKSPACE;make -j$BUILDTHREADS xcode_depends cd $WORKSPACE;xcodebuild -project Kodi.xcodeproj -target Kodi-iOS -configuration $Configuration build \ - ONLY_ACTIVE_ARCH=YES ARCHS=armv7 VALID_ARCHS=armv7 IPHONEOS_DEPLOYMENT_TARGET=4.2 \ + ONLY_ACTIVE_ARCH=YES ARCHS=armv7 VALID_ARCHS=armv7 \ SDKROOT=iphoneos$SDK_VERSION XBMC_DEPENDS_ROOT=$XBMC_DEPENDS_ROOT CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO diff --git a/tools/darwin/Configurations/App-OSX.xcconfig b/tools/darwin/Configurations/App-OSX.xcconfig index 101454f460..29cc6f71d5 100644 --- a/tools/darwin/Configurations/App-OSX.xcconfig +++ b/tools/darwin/Configurations/App-OSX.xcconfig @@ -24,10 +24,10 @@ ARCHS = i386 x86_64 ONLY_ACTIVE_ARCH = YES SDKROOT = macosx -MACOSX_DEPLOYMENT_TARGET = 10.6 +MACOSX_DEPLOYMENT_TARGET = 10.7 OTHER_LDFLAGS = -Wl,-search_paths_first $(XBMC_OTHER_LDFLAGS_COMMON) -lcdio -lfontconfig -lGLEW -lSDL -GCC_PREPROCESSOR_DEFINITIONS = TARGET_DARWIN_OSX $(inherited)
\ No newline at end of file +GCC_PREPROCESSOR_DEFINITIONS = TARGET_DARWIN_OSX $(inherited) diff --git a/tools/darwin/Configurations/App-iOS.xcconfig b/tools/darwin/Configurations/App-iOS.xcconfig index 8a2cc41f50..ce7e788052 100644 --- a/tools/darwin/Configurations/App-iOS.xcconfig +++ b/tools/darwin/Configurations/App-iOS.xcconfig @@ -23,7 +23,7 @@ PRODUCT_NAME = $(APP_NAME) //build against latest SDKROOT = iphoneos -IPHONEOS_DEPLOYMENT_TARGET = 4.2 +IPHONEOS_DEPLOYMENT_TARGET = 5.1 ARCHS = armv7 VALID_ARCHS = armv7 diff --git a/tools/darwin/Configurations/App.xcconfig.in b/tools/darwin/Configurations/App.xcconfig.in index 94946d3daf..8453858dfc 100644 --- a/tools/darwin/Configurations/App.xcconfig.in +++ b/tools/darwin/Configurations/App.xcconfig.in @@ -27,4 +27,5 @@ FRAMEWORK_SEARCH_PATHS = $(inherited) "$(SDKROOT)/System/Library/PrivateFramewor XBMC_OTHER_LDFLAGS_COMMON = $(inherited) -Wl,-headerpad_max_install_names -Wl,-all_load -L$XBMC_DEPENDS/lib -lbz2 -lintl -lexpat -lssl -lgpg-error -lresolv -lffi -lssh -llzo2 -lpcre -lpcrecpp -lfribidi -lfreetype -lfontconfig -lsqlite3 -ltinyxml -lmicrohttpd -lsmbclient -lpython2.6 -lyajl -ljpeg -lcrypto -lgcrypt -lavdevice -lavfilter -lavcodec -lavformat -lpostproc -lavutil -lswresample -lswscale -ltag -L$XBMC_DEPENDS/lib/mysql -lmysqlclient -lxml2 -lxslt -lnettle -lgmp -lhogweed -lgnutls - +CLANG_CXX_LANGUAGE_STANDARD = c++0x +CLANG_CXX_LIBRARY = libc++ diff --git a/tools/depends/configure.in b/tools/depends/configure.in index 37be22712c..c0fdb59ea1 100644 --- a/tools/depends/configure.in +++ b/tools/depends/configure.in @@ -250,7 +250,7 @@ case $host in AC_MSG_ERROR(error in configure of --with-arch=$use_cpu) esac platform_os="osx" - platform_min_version=macosx-version-min=10.6 + platform_min_version=macosx-version-min=10.7 ;; arm-apple-darwin*) @@ -260,7 +260,7 @@ case $host in if test "$use_cpu" != "armv7"; then AC_MSG_ERROR(error in configure of --with-arch=$use_cpu) fi - platform_min_version="iphoneos-version-min=4.2" + platform_min_version="iphoneos-version-min=5.1" found_sdk_version=[`$use_xcodebuild -showsdks | grep iphoneos | sort | tail -n 1 | awk '{ print $2}'`] use_sdk="${use_sdk:-$found_sdk_version}" sdk_name=iphoneos$use_sdk @@ -293,7 +293,7 @@ case $host in esac platform_cflags+=" -arch $use_cpu -m$platform_min_version" platform_ldflags+=" -arch $use_cpu -m$platform_min_version -isysroot $use_sdk_path" - platform_cxxflags+=" -arch $use_cpu -m$platform_min_version" + platform_cxxflags+=" -arch $use_cpu -m$platform_min_version -std=c++11 -stdlib=libc++" platform_includes="-isysroot $use_sdk_path" deps_dir=$sdk_name"_"$use_cpu-target tool_dir=buildtools-native; diff --git a/tools/depends/target/config.site.in b/tools/depends/target/config.site.in index 252a4dcd04..529e8af179 100644 --- a/tools/depends/target/config.site.in +++ b/tools/depends/target/config.site.in @@ -70,6 +70,7 @@ jm_cv_func_gettimeofday_clobber=no mac_cv_pkg_ldflags=-lz if test "@platform_os@" = "osx"; then ac_cv_func_strnlen_working=no + ac_cv_header_stdbool_h=yes fi #gnutls diff --git a/tools/depends/target/libplist/0003-fixc++1.patch b/tools/depends/target/libplist/0003-fixc++1.patch new file mode 100644 index 0000000000..69fdbf0620 --- /dev/null +++ b/tools/depends/target/libplist/0003-fixc++1.patch @@ -0,0 +1,11 @@ +--- a/src/Dictionary.cpp.orig 2014-12-31 14:05:09.000000000 -0600 ++++ b/src/Dictionary.cpp 2014-12-31 14:09:58.000000000 -0600 +@@ -151,7 +151,7 @@ + _map[key] = clone; + return _map.find(key); + } +- return iterator(NULL); ++ return iterator(); + } + + void Dictionary::Remove(Node* node) diff --git a/tools/depends/target/libplist/Makefile b/tools/depends/target/libplist/Makefile index 3c69e5e49d..1159d3e800 100644 --- a/tools/depends/target/libplist/Makefile +++ b/tools/depends/target/libplist/Makefile @@ -23,6 +23,7 @@ $(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) cd $(PLATFORM); patch -p1 < ../0001-dontbuildswig.patch cd $(PLATFORM); patch -p1 < ../0002-fixclang.diff + cd $(PLATFORM); patch -p1 < ../0003-fixc++1.patch cd $(PLATFORM); sed -ie 's/TARGET_LINK_LIBRARIES( plist \(.*\))/TARGET_LINK_LIBRARIES( plist \1 z m) /' src/CMakeLists.txt cd $(PLATFORM); rm -rf build; mkdir -p build cd $(PLATFORM)/build; $(CMAKE) VERBOSE=1 -DCMAKE_C_FLAGS="$(CFLAGS)" -DCMAKE_LD_FLAGS="$(LDFLAGS)" .. diff --git a/xbmc/AppParamParser.cpp b/xbmc/AppParamParser.cpp index 491f7a8e70..064671e9f4 100644 --- a/xbmc/AppParamParser.cpp +++ b/xbmc/AppParamParser.cpp @@ -35,6 +35,7 @@ #ifndef TARGET_WINDOWS #include "linux/XTimeUtils.h" #endif +#include <stdlib.h> CAppParamParser::CAppParamParser() { diff --git a/xbmc/Application.cpp b/xbmc/Application.cpp index b66f739434..ade1e2388a 100644 --- a/xbmc/Application.cpp +++ b/xbmc/Application.cpp @@ -1696,7 +1696,7 @@ bool CApplication::LoadSkin(const std::string& skinID) AddonPtr addon; if (CAddonMgr::Get().GetAddon(skinID, addon, ADDON_SKIN)) { - if (LoadSkin(boost::dynamic_pointer_cast<ADDON::CSkinInfo>(addon))) + if (LoadSkin(std::dynamic_pointer_cast<ADDON::CSkinInfo>(addon))) return true; } CLog::Log(LOGERROR, "failed to load requested skin '%s'", skinID.c_str()); @@ -1852,7 +1852,7 @@ void CApplication::UnloadSkin(bool forReload /* = false */) g_infoManager.Clear(); -// The g_SkinInfo boost shared_ptr ought to be reset here +// The g_SkinInfo shared_ptr ought to be reset here // but there are too many places it's used without checking for NULL // and as a result a race condition on exit can cause a crash. } @@ -2983,7 +2983,7 @@ bool CApplication::PlayMedia(const CFileItem& item, int iPlaylist) CGUIDialogCache* dlgCache = new CGUIDialogCache(5000, g_localizeStrings.Get(10214), item.GetLabel()); //is or could be a playlist - auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(item)); + unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(item)); bool gotPlayList = (pPlayList.get() && pPlayList->Load(item.GetPath())); if (dlgCache) diff --git a/xbmc/Application.h b/xbmc/Application.h index b7d9308276..053f428c7a 100644 --- a/xbmc/Application.h +++ b/xbmc/Application.h @@ -37,7 +37,7 @@ namespace ADDON { class CSkinInfo; class IAddon; - typedef boost::shared_ptr<IAddon> AddonPtr; + typedef std::shared_ptr<IAddon> AddonPtr; } namespace MEDIA_DETECT @@ -408,7 +408,7 @@ protected: virtual bool OnSettingUpdate(CSetting* &setting, const char *oldSettingId, const TiXmlNode *oldSettingNode); bool LoadSkin(const std::string& skinID); - bool LoadSkin(const boost::shared_ptr<ADDON::CSkinInfo>& skin); + bool LoadSkin(const std::shared_ptr<ADDON::CSkinInfo>& skin); /*! \brief Delegates the action to all registered action handlers. diff --git a/xbmc/ApplicationMessenger.cpp b/xbmc/ApplicationMessenger.cpp index 344886b51f..d698b02a06 100644 --- a/xbmc/ApplicationMessenger.cpp +++ b/xbmc/ApplicationMessenger.cpp @@ -144,7 +144,7 @@ void CApplicationMessenger::Cleanup() void CApplicationMessenger::SendMessage(ThreadMessage& message, bool wait) { message.waitEvent.reset(); - boost::shared_ptr<CEvent> waitEvent; + std::shared_ptr<CEvent> waitEvent; if (wait) { // check that we're not being called from our application thread, else we'll be waiting // forever! @@ -212,7 +212,7 @@ void CApplicationMessenger::ProcessMessages() //Leave here as the message might make another //thread call processmessages or sendmessage - boost::shared_ptr<CEvent> waitEvent = pMsg->waitEvent; + std::shared_ptr<CEvent> waitEvent = pMsg->waitEvent; lock.Leave(); // <- see the large comment in SendMessage ^ ProcessMessage(pMsg); @@ -879,7 +879,7 @@ void CApplicationMessenger::ProcessWindowMessages() // leave here in case we make more thread messages from this one - boost::shared_ptr<CEvent> waitEvent = pMsg->waitEvent; + std::shared_ptr<CEvent> waitEvent = pMsg->waitEvent; lock.Leave(); // <- see the large comment in SendMessage ^ ProcessMessage(pMsg); diff --git a/xbmc/ApplicationMessenger.h b/xbmc/ApplicationMessenger.h index dc629b5052..36c90e403c 100644 --- a/xbmc/ApplicationMessenger.h +++ b/xbmc/ApplicationMessenger.h @@ -22,7 +22,7 @@ #include "guilib/WindowIDs.h" #include "threads/Thread.h" -#include <boost/shared_ptr.hpp> +#include <memory> #include <queue> #include "utils/GlobalsHandling.h" @@ -121,7 +121,7 @@ typedef struct int param2; std::string strParam; std::vector<std::string> params; - boost::shared_ptr<CEvent> waitEvent; + std::shared_ptr<CEvent> waitEvent; void* lpVoid; } ThreadMessage; diff --git a/xbmc/ApplicationPlayer.cpp b/xbmc/ApplicationPlayer.cpp index 5db9f17f01..15a3241713 100644 --- a/xbmc/ApplicationPlayer.cpp +++ b/xbmc/ApplicationPlayer.cpp @@ -29,7 +29,7 @@ CApplicationPlayer::CApplicationPlayer() m_eCurrentPlayer = EPC_NONE; } -boost::shared_ptr<IPlayer> CApplicationPlayer::GetInternal() const +std::shared_ptr<IPlayer> CApplicationPlayer::GetInternal() const { CSingleLock lock(m_player_lock); return m_pPlayer; @@ -37,7 +37,7 @@ boost::shared_ptr<IPlayer> CApplicationPlayer::GetInternal() const void CApplicationPlayer::ClosePlayer() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) { CloseFile(); @@ -49,7 +49,7 @@ void CApplicationPlayer::ClosePlayer() void CApplicationPlayer::CloseFile(bool reopen) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) { ++m_iPlayerOPSeq; @@ -59,7 +59,7 @@ void CApplicationPlayer::CloseFile(bool reopen) void CApplicationPlayer::ClosePlayerGapless(PLAYERCOREID newCore) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (!player) return; @@ -92,7 +92,7 @@ void CApplicationPlayer::CreatePlayer(PLAYERCOREID newCore, IPlayerCallback& cal PlayBackRet CApplicationPlayer::OpenFile(const CFileItem& item, const CPlayerOptions& options) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); PlayBackRet iResult = PLAYBACK_FAIL; if (player) { @@ -109,13 +109,13 @@ PlayBackRet CApplicationPlayer::OpenFile(const CFileItem& item, const CPlayerOpt bool CApplicationPlayer::HasPlayer() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return player != NULL; } int CApplicationPlayer::GetChapter() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->GetChapter(); else @@ -124,7 +124,7 @@ int CApplicationPlayer::GetChapter() int CApplicationPlayer::GetChapterCount() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->GetChapterCount(); else @@ -133,32 +133,32 @@ int CApplicationPlayer::GetChapterCount() void CApplicationPlayer::GetChapterName(std::string& strChapterName) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->GetChapterName(strChapterName); } bool CApplicationPlayer::HasAudio() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->HasAudio()); } bool CApplicationPlayer::HasVideo() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->HasVideo()); } bool CApplicationPlayer::IsPaused() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->IsPaused()); } bool CApplicationPlayer::IsPlaying() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->IsPlaying()); } @@ -179,73 +179,73 @@ bool CApplicationPlayer::IsPlayingVideo() const void CApplicationPlayer::Pause() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->Pause(); } bool CApplicationPlayer::ControlsVolume() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->ControlsVolume()); } void CApplicationPlayer::SetMute(bool bOnOff) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->SetMute(bOnOff); } void CApplicationPlayer::SetVolume(float volume) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->SetVolume(volume); } void CApplicationPlayer::Seek(bool bPlus, bool bLargeStep, bool bChapterOverride) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->Seek(bPlus, bLargeStep, bChapterOverride); } void CApplicationPlayer::SeekPercentage(float fPercent) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->SeekPercentage(fPercent); } bool CApplicationPlayer::IsPassthrough() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->IsPassthrough()); } bool CApplicationPlayer::CanSeek() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->CanSeek()); } bool CApplicationPlayer::SeekScene(bool bPlus) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->SeekScene(bPlus)); } void CApplicationPlayer::SeekTime(int64_t iTime) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->SeekTime(iTime); } std::string CApplicationPlayer::GetPlayingTitle() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->GetPlayingTitle(); else @@ -254,7 +254,7 @@ std::string CApplicationPlayer::GetPlayingTitle() int64_t CApplicationPlayer::GetTime() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->GetTime(); else @@ -263,25 +263,25 @@ int64_t CApplicationPlayer::GetTime() const bool CApplicationPlayer::IsCaching() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->IsCaching()); } bool CApplicationPlayer::IsInMenu() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->IsInMenu()); } bool CApplicationPlayer::HasMenu() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->HasMenu()); } int CApplicationPlayer::GetCacheLevel() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->GetCacheLevel(); else @@ -290,7 +290,7 @@ int CApplicationPlayer::GetCacheLevel() const int CApplicationPlayer::GetSubtitleCount() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->GetSubtitleCount(); else @@ -302,7 +302,7 @@ int CApplicationPlayer::GetAudioStream() if (!m_audioStreamUpdate.IsTimePast()) return m_iAudioStream; - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) { m_iAudioStream = player->GetAudioStream(); @@ -318,7 +318,7 @@ int CApplicationPlayer::GetSubtitle() if (!m_subtitleStreamUpdate.IsTimePast()) return m_iSubtitleStream; - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) { m_iSubtitleStream = player->GetSubtitle(); @@ -331,31 +331,31 @@ int CApplicationPlayer::GetSubtitle() bool CApplicationPlayer::GetSubtitleVisible() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->GetSubtitleVisible()); } bool CApplicationPlayer::CanRecord() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->CanRecord()); } bool CApplicationPlayer::CanPause() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->CanPause()); } bool CApplicationPlayer::IsRecording() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->IsRecording()); } TextCacheStruct_t* CApplicationPlayer::GetTeletextCache() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->GetTeletextCache(); else @@ -364,7 +364,7 @@ TextCacheStruct_t* CApplicationPlayer::GetTeletextCache() int64_t CApplicationPlayer::GetTotalTime() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->GetTotalTime(); else @@ -373,7 +373,7 @@ int64_t CApplicationPlayer::GetTotalTime() const float CApplicationPlayer::GetPercentage() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->GetPercentage(); else @@ -382,7 +382,7 @@ float CApplicationPlayer::GetPercentage() const float CApplicationPlayer::GetCachePercentage() const { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->GetCachePercentage(); else @@ -391,21 +391,21 @@ float CApplicationPlayer::GetCachePercentage() const void CApplicationPlayer::ToFFRW(int iSpeed) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->ToFFRW(iSpeed); } void CApplicationPlayer::DoAudioWork() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->DoAudioWork(); } std::string CApplicationPlayer::GetPlayerState() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->GetPlayerState(); else @@ -414,58 +414,58 @@ std::string CApplicationPlayer::GetPlayerState() bool CApplicationPlayer::QueueNextFile(const CFileItem &file) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->QueueNextFile(file)); } bool CApplicationPlayer::GetStreamDetails(CStreamDetails &details) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->GetStreamDetails(details)); } bool CApplicationPlayer::SetPlayerState(const std::string& state) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->SetPlayerState(state)); } void CApplicationPlayer::OnNothingToQueueNotify() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->OnNothingToQueueNotify(); } void CApplicationPlayer::GetVideoStreamInfo(SPlayerVideoStreamInfo &info) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->GetVideoStreamInfo(info); } void CApplicationPlayer::GetAudioStreamInfo(int index, SPlayerAudioStreamInfo &info) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->GetAudioStreamInfo(index, info); } bool CApplicationPlayer::OnAction(const CAction &action) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->OnAction(action)); } bool CApplicationPlayer::Record(bool bOnOff) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->Record(bOnOff)); } int CApplicationPlayer::GetAudioStreamCount() { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->GetAudioStreamCount(); else @@ -474,7 +474,7 @@ int CApplicationPlayer::GetAudioStreamCount() void CApplicationPlayer::SetAudioStream(int iStream) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) { player->SetAudioStream(iStream); @@ -486,14 +486,14 @@ void CApplicationPlayer::SetAudioStream(int iStream) void CApplicationPlayer::GetSubtitleStreamInfo(int index, SPlayerSubtitleStreamInfo &info) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->GetSubtitleStreamInfo(index, info); } void CApplicationPlayer::SetSubtitle(int iStream) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) { player->SetSubtitle(iStream); @@ -505,7 +505,7 @@ void CApplicationPlayer::SetSubtitle(int iStream) void CApplicationPlayer::SetSubtitleVisible(bool bVisible) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) { player->SetSubtitleVisible(bVisible); @@ -516,7 +516,7 @@ void CApplicationPlayer::SetSubtitleVisible(bool bVisible) int CApplicationPlayer::AddSubtitle(const std::string& strSubPath) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->AddSubtitle(strSubPath); else @@ -525,76 +525,76 @@ int CApplicationPlayer::AddSubtitle(const std::string& strSubPath) void CApplicationPlayer::SetSubTitleDelay(float fValue) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->SetSubTitleDelay(fValue); } void CApplicationPlayer::SetAVDelay(float fValue) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->SetAVDelay(fValue); } void CApplicationPlayer::SetDynamicRangeCompression(long drc) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->SetDynamicRangeCompression(drc); } bool CApplicationPlayer::SwitchChannel(PVR::CPVRChannel &channel) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); return (player && player->SwitchChannel(channel)); } void CApplicationPlayer::LoadPage(int p, int sp, unsigned char* buffer) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->LoadPage(p, sp, buffer); } void CApplicationPlayer::GetAudioCapabilities(std::vector<int> &audioCaps) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->GetAudioCapabilities(audioCaps); } void CApplicationPlayer::GetSubtitleCapabilities(std::vector<int> &subCaps) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->GetSubtitleCapabilities(subCaps); } void CApplicationPlayer::GetAudioInfo(std::string& strAudioInfo) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->GetAudioInfo(strAudioInfo); } void CApplicationPlayer::GetVideoInfo(std::string& strVideoInfo) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->GetVideoInfo(strVideoInfo); } void CApplicationPlayer::GetGeneralInfo(std::string& strVideoInfo) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->GetGeneralInfo(strVideoInfo); } int CApplicationPlayer::SeekChapter(int iChapter) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) return player->SeekChapter(iChapter); else @@ -603,35 +603,35 @@ int CApplicationPlayer::SeekChapter(int iChapter) void CApplicationPlayer::GetRenderFeatures(std::vector<int> &renderFeatures) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->OMXGetRenderFeatures(renderFeatures); } void CApplicationPlayer::GetDeinterlaceMethods(std::vector<int> &deinterlaceMethods) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->OMXGetDeinterlaceMethods(deinterlaceMethods); } void CApplicationPlayer::GetDeinterlaceModes(std::vector<int> &deinterlaceModes) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->OMXGetDeinterlaceModes(deinterlaceModes); } void CApplicationPlayer::GetScalingMethods(std::vector<int> &scalingMethods) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (player) player->OMXGetScalingMethods(scalingMethods); } void CApplicationPlayer::SetPlaySpeed(int iSpeed, bool bApplicationMuted) { - boost::shared_ptr<IPlayer> player = GetInternal(); + std::shared_ptr<IPlayer> player = GetInternal(); if (!player) return; diff --git a/xbmc/ApplicationPlayer.h b/xbmc/ApplicationPlayer.h index 4216636276..eea702ac21 100644 --- a/xbmc/ApplicationPlayer.h +++ b/xbmc/ApplicationPlayer.h @@ -20,7 +20,7 @@ * */ -#include <boost/shared_ptr.hpp> +#include <memory> #include "threads/SingleLock.h" #include "threads/SystemClock.h" #include "cores/playercorefactory/PlayerCoreFactory.h" @@ -48,7 +48,7 @@ struct TextCacheStruct_t; class CApplicationPlayer { - boost::shared_ptr<IPlayer> m_pPlayer; + std::shared_ptr<IPlayer> m_pPlayer; unsigned int m_iPlayerOPSeq; // used to detect whether an OpenFile request on player is canceled by us. PLAYERCOREID m_eCurrentPlayer; @@ -71,7 +71,7 @@ public: void ClosePlayerGapless(PLAYERCOREID newCore); void CreatePlayer(PLAYERCOREID newCore, IPlayerCallback& callback); PLAYERCOREID GetCurrentPlayer() const { return m_eCurrentPlayer; } - boost::shared_ptr<IPlayer> GetInternal() const; + std::shared_ptr<IPlayer> GetInternal() const; int GetPlaySpeed() const; bool HasPlayer() const; PlayBackRet OpenFile(const CFileItem& item, const CPlayerOptions& options); diff --git a/xbmc/Autorun.cpp b/xbmc/Autorun.cpp index b79aabbfcc..19b43a3624 100644 --- a/xbmc/Autorun.cpp +++ b/xbmc/Autorun.cpp @@ -21,6 +21,7 @@ #include "system.h" #ifdef HAS_DVD_DRIVE +#include <stdlib.h> #include "Autorun.h" #include "Application.h" @@ -46,7 +47,6 @@ #include "cdrip/CDDARipper.h" #endif -using namespace std; using namespace XFILE; using namespace PLAYLIST; using namespace MEDIA_DETECT; @@ -109,7 +109,7 @@ bool CAutorun::PlayDisc(const std::string& path, bool bypassSettings, bool start mediaPath = g_mediaManager.GetDiscPath(); const CURL pathToUrl(mediaPath); - auto_ptr<IDirectory> pDir ( CDirectoryFactory::Create( pathToUrl )); + std::unique_ptr<IDirectory> pDir ( CDirectoryFactory::Create( pathToUrl )); bool bPlaying = RunDisc(pDir.get(), mediaPath, nAddedToPlaylist, true, bypassSettings, startFromBeginning); if ( !bPlaying && nAddedToPlaylist > 0 ) diff --git a/xbmc/BackgroundInfoLoader.h b/xbmc/BackgroundInfoLoader.h index 5fad3f0605..6839d9e6f0 100644 --- a/xbmc/BackgroundInfoLoader.h +++ b/xbmc/BackgroundInfoLoader.h @@ -25,9 +25,9 @@ #include "threads/CriticalSection.h" #include <vector> -#include "boost/shared_ptr.hpp" +#include <memory> -class CFileItem; typedef boost::shared_ptr<CFileItem> CFileItemPtr; +class CFileItem; typedef std::shared_ptr<CFileItem> CFileItemPtr; class CFileItemList; class IBackgroundLoaderObserver diff --git a/xbmc/CueDocument.cpp b/xbmc/CueDocument.cpp index d22d317a29..c7afad718c 100644 --- a/xbmc/CueDocument.cpp +++ b/xbmc/CueDocument.cpp @@ -52,6 +52,8 @@ // //////////////////////////////////////////////////////////////////////////////////// +#include <cstdlib> + #include "CueDocument.h" #include "utils/log.h" #include "utils/URIUtils.h" diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cpp index 32c88249a6..755cf467f8 100644 --- a/xbmc/FileItem.cpp +++ b/xbmc/FileItem.cpp @@ -18,6 +18,8 @@ * */ +#include <cstdlib> + #include "FileItem.h" #include "guilib/LocalizeStrings.h" #include "utils/StringUtils.h" @@ -63,6 +65,7 @@ #endif #include <assert.h> +#include <algorithm> using namespace std; using namespace XFILE; @@ -1888,7 +1891,7 @@ void CFileItemList::Sort(SortDescription sortDescription) SortItems sortItems((size_t)Size()); for (int index = 0; index < Size(); index++) { - sortItems[index] = boost::shared_ptr<SortItem>(new SortItem); + sortItems[index] = std::shared_ptr<SortItem>(new SortItem); m_items[index]->ToSortable(*sortItems[index], fields); (*sortItems[index])[FieldId] = index; } @@ -2168,7 +2171,7 @@ void CFileItemList::FilterCueItems() itemstodelete.push_back(strMediaFile); // get the additional stuff (year, genre etc.) from the underlying media files tag. CMusicInfoTag tag; - auto_ptr<IMusicInfoTagLoader> pLoader (CMusicInfoTagLoaderFactory::CreateLoader(strMediaFile)); + unique_ptr<IMusicInfoTagLoader> pLoader (CMusicInfoTagLoaderFactory::CreateLoader(strMediaFile)); if (NULL != pLoader.get()) { // get id3tag @@ -2994,7 +2997,7 @@ bool CFileItem::LoadMusicTag() // load tag from file CLog::Log(LOGDEBUG, "%s: loading tag information for file: %s", __FUNCTION__, m_strPath.c_str()); CMusicInfoTagLoaderFactory factory; - auto_ptr<IMusicInfoTagLoader> pLoader (factory.CreateLoader(m_strPath)); + unique_ptr<IMusicInfoTagLoader> pLoader (factory.CreateLoader(m_strPath)); if (NULL != pLoader.get()) { if (pLoader->Load(m_strPath, *GetMusicInfoTag())) diff --git a/xbmc/FileItem.h b/xbmc/FileItem.h index 4f49b13868..e7066652df 100644 --- a/xbmc/FileItem.h +++ b/xbmc/FileItem.h @@ -34,7 +34,7 @@ #include "threads/CriticalSection.h" #include <vector> -#include "boost/shared_ptr.hpp" +#include <memory> namespace MUSIC_INFO { @@ -44,14 +44,14 @@ class CVideoInfoTag; namespace EPG { class CEpgInfoTag; - typedef boost::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; + typedef std::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; } namespace PVR { class CPVRChannel; class CPVRRecording; class CPVRTimerInfoTag; - typedef boost::shared_ptr<PVR::CPVRRecording> CPVRRecordingPtr; + typedef std::shared_ptr<PVR::CPVRRecording> CPVRRecordingPtr; } class CPictureInfoTag; @@ -495,7 +495,7 @@ private: \brief A shared pointer to CFileItem \sa CFileItem */ -typedef boost::shared_ptr<CFileItem> CFileItemPtr; +typedef std::shared_ptr<CFileItem> CFileItemPtr; /*! \brief A vector of pointer to CFileItem diff --git a/xbmc/GUIInfoManager.cpp b/xbmc/GUIInfoManager.cpp index dc7d32d04d..79c0186123 100644 --- a/xbmc/GUIInfoManager.cpp +++ b/xbmc/GUIInfoManager.cpp @@ -59,7 +59,8 @@ #include "utils/SeekHandler.h" #include "URL.h" #include "addons/Skin.h" -#include "boost/make_shared.hpp" +#include <memory> +#include <functional> #include "cores/DataCacheCore.h" // stuff for current song @@ -140,7 +141,7 @@ bool CGUIInfoManager::OnMessage(CGUIMessage &message) { if (message.GetParam1() == GUI_MSG_UPDATE_ITEM && message.GetItem()) { - CFileItemPtr item = boost::static_pointer_cast<CFileItem>(message.GetItem()); + CFileItemPtr item = std::static_pointer_cast<CFileItem>(message.GetItem()); if (m_currentFile->IsSamePath(item.get())) { m_currentFile->UpdateInfo(*item); @@ -2198,9 +2199,9 @@ INFO::InfoPtr CGUIInfoManager::Register(const std::string &expression, int conte return *i; if (condition.find_first_of("|+[]!") != condition.npos) - m_bools.push_back(boost::make_shared<InfoExpression>(condition, context)); + m_bools.push_back(std::make_shared<InfoExpression>(condition, context)); else - m_bools.push_back(boost::make_shared<InfoSingle>(condition, context)); + m_bools.push_back(std::make_shared<InfoSingle>(condition, context)); return m_bools.back(); } @@ -2986,7 +2987,7 @@ bool CGUIInfoManager::GetMultiInfoBool(const GUIInfo &info, int contextWindow, c const CGUIControl *control = window->GetControl(info.GetData1()); if (control && control->IsContainer()) { - CFileItemPtr item = boost::static_pointer_cast<CFileItem>(((IGUIContainer *)control)->GetListItem(0)); + CFileItemPtr item = std::static_pointer_cast<CFileItem>(((IGUIContainer *)control)->GetListItem(0)); if (item && item->m_iprogramCount == info.GetData2()) // programcount used to store item id bReturn = true; } @@ -3133,7 +3134,7 @@ bool CGUIInfoManager::GetMultiInfoInt(int &value, const GUIInfo &info, int conte { const CGUIControl *control = window->GetControl(data1); if (control && control->IsContainer()) - item = boost::static_pointer_cast<CFileItem>(((IGUIContainer *)control)->GetListItem(info.GetData2(), info.GetInfoFlag())); + item = std::static_pointer_cast<CFileItem>(((IGUIContainer *)control)->GetListItem(info.GetData2(), info.GetInfoFlag())); } if (item) // If we got a valid item, do the lookup @@ -3176,7 +3177,7 @@ std::string CGUIInfoManager::GetMultiInfoLabel(const GUIInfo &info, int contextW { const CGUIControl *control = window->GetControl(data1); if (control && control->IsContainer()) - item = boost::static_pointer_cast<CFileItem>(((IGUIContainer *)control)->GetListItem(info.GetData2(), info.GetInfoFlag())); + item = std::static_pointer_cast<CFileItem>(((IGUIContainer *)control)->GetListItem(info.GetData2(), info.GetInfoFlag())); } if (item) // If we got a valid item, do the lookup diff --git a/xbmc/GUIInfoManager.h b/xbmc/GUIInfoManager.h index 34744d395b..67e41bd67d 100644 --- a/xbmc/GUIInfoManager.h +++ b/xbmc/GUIInfoManager.h @@ -677,7 +677,7 @@ class CGUIWindow; namespace EPG { class CEpgInfoTag; - typedef boost::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; + typedef std::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; } // Info Flags diff --git a/xbmc/GUILargeTextureManager.cpp b/xbmc/GUILargeTextureManager.cpp index 4c965a5df4..d7255a66de 100644 --- a/xbmc/GUILargeTextureManager.cpp +++ b/xbmc/GUILargeTextureManager.cpp @@ -29,6 +29,8 @@ #include "utils/log.h" #include "TextureCache.h" +#include <cassert> + using namespace std; diff --git a/xbmc/LangInfo.cpp b/xbmc/LangInfo.cpp index 5831d8d729..208cd2ccd6 100644 --- a/xbmc/LangInfo.cpp +++ b/xbmc/LangInfo.cpp @@ -37,6 +37,8 @@ #include "utils/XBMCTinyXML.h" #include "utils/XMLUtils.h" +#include <algorithm> + using namespace std; using namespace PVR; diff --git a/xbmc/NfoFile.cpp b/xbmc/NfoFile.cpp index ead5f7d017..930796812e 100644 --- a/xbmc/NfoFile.cpp +++ b/xbmc/NfoFile.cpp @@ -50,7 +50,7 @@ CNfoFile::NFOResult CNfoFile::Create(const std::string& strPath, const ScraperPt AddonPtr addon; ScraperPtr defaultScraper; if (CAddonMgr::Get().GetDefault(m_type, addon)) - defaultScraper = boost::dynamic_pointer_cast<CScraper>(addon); + defaultScraper = std::dynamic_pointer_cast<CScraper>(addon); if (m_type == ADDON_SCRAPER_ALBUMS) { @@ -102,7 +102,7 @@ CNfoFile::NFOResult CNfoFile::Create(const std::string& strPath, const ScraperPt for (unsigned i = 0; i < addons.size(); ++i) { - ScraperPtr scraper = boost::dynamic_pointer_cast<CScraper>(addons[i]); + ScraperPtr scraper = std::dynamic_pointer_cast<CScraper>(addons[i]); // skip if scraper requires settings and there's nothing set yet if (scraper->RequiresSettings() && !scraper->HasUserSettings()) diff --git a/xbmc/PartyModeManager.h b/xbmc/PartyModeManager.h index b7ac7b9b13..0982679c41 100644 --- a/xbmc/PartyModeManager.h +++ b/xbmc/PartyModeManager.h @@ -22,9 +22,9 @@ #include <string> #include <vector> -#include <boost/shared_ptr.hpp> +#include <memory> -class CFileItem; typedef boost::shared_ptr<CFileItem> CFileItemPtr; +class CFileItem; typedef std::shared_ptr<CFileItem> CFileItemPtr; class CFileItemList; namespace PLAYLIST { diff --git a/xbmc/PlayListPlayer.cpp b/xbmc/PlayListPlayer.cpp index c6f210e9fb..9a1ddb9fc4 100644 --- a/xbmc/PlayListPlayer.cpp +++ b/xbmc/PlayListPlayer.cpp @@ -90,7 +90,7 @@ bool CPlayListPlayer::OnMessage(CGUIMessage &message) for (int i = PLAYLIST_MUSIC; i <= PLAYLIST_VIDEO; i++) { CPlayList &playlist = GetPlaylist(i); - CFileItemPtr item = boost::static_pointer_cast<CFileItem>(message.GetItem()); + CFileItemPtr item = std::static_pointer_cast<CFileItem>(message.GetItem()); playlist.UpdateItem(item.get()); } } diff --git a/xbmc/PlayListPlayer.h b/xbmc/PlayListPlayer.h index 6903f8242e..2167a7a01b 100644 --- a/xbmc/PlayListPlayer.h +++ b/xbmc/PlayListPlayer.h @@ -20,7 +20,7 @@ */ #include "guilib/IMsgTargetCallback.h" -#include <boost/shared_ptr.hpp> +#include <memory> #define PLAYLIST_NONE -1 #define PLAYLIST_MUSIC 0 @@ -28,7 +28,7 @@ #define PLAYLIST_PICTURE 2 class CAction; -class CFileItem; typedef boost::shared_ptr<CFileItem> CFileItemPtr; +class CFileItem; typedef std::shared_ptr<CFileItem> CFileItemPtr; class CFileItemList; class CVariant; diff --git a/xbmc/XBDateTime.cpp b/xbmc/XBDateTime.cpp index bc8175058f..7caf8d15d8 100644 --- a/xbmc/XBDateTime.cpp +++ b/xbmc/XBDateTime.cpp @@ -18,6 +18,8 @@ * */ +#include <cstdlib> + #include "XBDateTime.h" #include "LangInfo.h" #include "guilib/LocalizeStrings.h" diff --git a/xbmc/addons/AddonInstaller.cpp b/xbmc/addons/AddonInstaller.cpp index c61da1bf84..26a9763b75 100644 --- a/xbmc/addons/AddonInstaller.cpp +++ b/xbmc/addons/AddonInstaller.cpp @@ -40,6 +40,8 @@ #include "dialogs/GUIDialogProgress.h" #include "URL.h" +#include <functional> + using namespace std; using namespace XFILE; using namespace ADDON; @@ -231,7 +233,7 @@ bool CAddonInstaller::Install(const std::string &addonID, bool force, const std: database.GetRepoForAddon(addonID,repo); AddonPtr ptr; CAddonMgr::Get().GetAddon(repo,ptr); - RepositoryPtr therepo = boost::dynamic_pointer_cast<CRepository>(ptr); + RepositoryPtr therepo = std::dynamic_pointer_cast<CRepository>(ptr); std::string hash; if (therepo) hash = therepo->GetAddonHash(addon); @@ -767,7 +769,7 @@ bool CAddonUnInstallJob::DoWork() m_addon->OnPreUnInstall(); AddonPtr repoPtr = CAddonInstallJob::GetRepoForAddon(m_addon); - RepositoryPtr therepo = boost::dynamic_pointer_cast<CRepository>(repoPtr); + RepositoryPtr therepo = std::dynamic_pointer_cast<CRepository>(repoPtr); if (therepo && !therepo->Props().libname.empty()) { CFileItemList dummy; diff --git a/xbmc/addons/AddonManager.cpp b/xbmc/addons/AddonManager.cpp index 9c93c0d2ab..3423b4b506 100644 --- a/xbmc/addons/AddonManager.cpp +++ b/xbmc/addons/AddonManager.cpp @@ -888,7 +888,7 @@ bool CAddonMgr::StartServices(const bool beforelogin) bool ret = true; for (IVECADDONS it = services.begin(); it != services.end(); ++it) { - boost::shared_ptr<CService> service = boost::dynamic_pointer_cast<CService>(*it); + std::shared_ptr<CService> service = std::dynamic_pointer_cast<CService>(*it); if (service) { if ( (beforelogin && service->GetStartOption() == CService::STARTUP) @@ -910,7 +910,7 @@ void CAddonMgr::StopServices(const bool onlylogin) for (IVECADDONS it = services.begin(); it != services.end(); ++it) { - boost::shared_ptr<CService> service = boost::dynamic_pointer_cast<CService>(*it); + std::shared_ptr<CService> service = std::dynamic_pointer_cast<CService>(*it); if (service) { if ( (onlylogin && service->GetStartOption() == CService::LOGIN) diff --git a/xbmc/addons/GUIWindowAddonBrowser.cpp b/xbmc/addons/GUIWindowAddonBrowser.cpp index 8c62d8496b..b3b73d4c70 100644 --- a/xbmc/addons/GUIWindowAddonBrowser.cpp +++ b/xbmc/addons/GUIWindowAddonBrowser.cpp @@ -210,7 +210,7 @@ bool CGUIWindowAddonBrowser::OnContextButton(int itemNumber, if (button == CONTEXT_BUTTON_SCAN) { - RepositoryPtr repo = boost::dynamic_pointer_cast<CRepository>(addon); + RepositoryPtr repo = std::dynamic_pointer_cast<CRepository>(addon); CAddonInstaller::Get().UpdateRepos(true); return true; } diff --git a/xbmc/addons/IAddon.h b/xbmc/addons/IAddon.h index ea71126614..4da99ebd1c 100644 --- a/xbmc/addons/IAddon.h +++ b/xbmc/addons/IAddon.h @@ -18,9 +18,7 @@ * <http://www.gnu.org/licenses/>. * */ -#include "boost/shared_ptr.hpp" - -#include <boost/enable_shared_from_this.hpp> +#include <memory> #include <map> #include <set> @@ -64,13 +62,13 @@ namespace ADDON } TYPE; class IAddon; - typedef boost::shared_ptr<IAddon> AddonPtr; + typedef std::shared_ptr<IAddon> AddonPtr; class CVisualisation; - typedef boost::shared_ptr<CVisualisation> VizPtr; + typedef std::shared_ptr<CVisualisation> VizPtr; class CSkinInfo; - typedef boost::shared_ptr<CSkinInfo> SkinPtr; + typedef std::shared_ptr<CSkinInfo> SkinPtr; class CPluginSource; - typedef boost::shared_ptr<CPluginSource> PluginPtr; + typedef std::shared_ptr<CPluginSource> PluginPtr; class CAddonMgr; class AddonVersion; @@ -78,7 +76,7 @@ namespace ADDON typedef std::map<std::string, std::string> InfoMap; class AddonProps; - class IAddon : public boost::enable_shared_from_this<IAddon> + class IAddon : public std::enable_shared_from_this<IAddon> { public: virtual ~IAddon() {}; diff --git a/xbmc/addons/Repository.cpp b/xbmc/addons/Repository.cpp index 0d0b75a560..c7e8a5bc33 100644 --- a/xbmc/addons/Repository.cpp +++ b/xbmc/addons/Repository.cpp @@ -235,7 +235,7 @@ bool CRepositoryUpdateJob::DoWork() { if (ShouldCancel(0, 0)) return false; - const RepositoryPtr repo = boost::dynamic_pointer_cast<CRepository>(*i); + const RepositoryPtr repo = std::dynamic_pointer_cast<CRepository>(*i); VECADDONS newAddons; if (GrabAddons(repo, newAddons)) MergeAddons(addons, newAddons); diff --git a/xbmc/addons/Repository.h b/xbmc/addons/Repository.h index 8ac282c608..339dbf5f11 100644 --- a/xbmc/addons/Repository.h +++ b/xbmc/addons/Repository.h @@ -25,7 +25,7 @@ namespace ADDON { class CRepository; - typedef boost::shared_ptr<CRepository> RepositoryPtr; + typedef std::shared_ptr<CRepository> RepositoryPtr; class CRepository : public CAddon { public: diff --git a/xbmc/addons/Scraper.cpp b/xbmc/addons/Scraper.cpp index d6855853e6..7d327a0693 100644 --- a/xbmc/addons/Scraper.cpp +++ b/xbmc/addons/Scraper.cpp @@ -42,6 +42,7 @@ #include "URL.h" #include <sstream> +#include <algorithm> using namespace std; using namespace XFILE; diff --git a/xbmc/addons/Scraper.h b/xbmc/addons/Scraper.h index c7274f2844..7302972202 100644 --- a/xbmc/addons/Scraper.h +++ b/xbmc/addons/Scraper.h @@ -54,7 +54,7 @@ class CScraperUrl; namespace ADDON { class CScraper; -typedef boost::shared_ptr<CScraper> ScraperPtr; +typedef std::shared_ptr<CScraper> ScraperPtr; std::string TranslateContent(const CONTENT_TYPE &content, bool pretty=false); CONTENT_TYPE TranslateContent(const std::string &string); diff --git a/xbmc/addons/Service.cpp b/xbmc/addons/Service.cpp index c406b11272..2f5c38c8d3 100644 --- a/xbmc/addons/Service.cpp +++ b/xbmc/addons/Service.cpp @@ -129,7 +129,7 @@ bool CService::OnPreInstall() AddonPtr localAddon; // need to grab the local addon so we have the correct library path to stop if (CAddonMgr::Get().GetAddon(ID(), localAddon, ADDON_SERVICE, false)) { - boost::shared_ptr<CService> service = boost::dynamic_pointer_cast<CService>(localAddon); + std::shared_ptr<CService> service = std::dynamic_pointer_cast<CService>(localAddon); if (service) service->Stop(); } @@ -143,7 +143,7 @@ void CService::OnPostInstall(bool restart, bool update) AddonPtr localAddon; // need to grab the local addon so we have the correct library path to stop if (CAddonMgr::Get().GetAddon(ID(), localAddon, ADDON_SERVICE, false)) { - boost::shared_ptr<CService> service = boost::dynamic_pointer_cast<CService>(localAddon); + std::shared_ptr<CService> service = std::dynamic_pointer_cast<CService>(localAddon); if (service) service->Start(); } diff --git a/xbmc/addons/Skin.cpp b/xbmc/addons/Skin.cpp index 351a821663..0b343033ba 100644 --- a/xbmc/addons/Skin.cpp +++ b/xbmc/addons/Skin.cpp @@ -41,7 +41,7 @@ using namespace std; using namespace XFILE; -boost::shared_ptr<ADDON::CSkinInfo> g_SkinInfo; +std::shared_ptr<ADDON::CSkinInfo> g_SkinInfo; namespace ADDON { diff --git a/xbmc/addons/Skin.h b/xbmc/addons/Skin.h index dd7771a949..c57e9c4812 100644 --- a/xbmc/addons/Skin.h +++ b/xbmc/addons/Skin.h @@ -152,4 +152,4 @@ protected: } /*namespace ADDON*/ -extern boost::shared_ptr<ADDON::CSkinInfo> g_SkinInfo; +extern std::shared_ptr<ADDON::CSkinInfo> g_SkinInfo; diff --git a/xbmc/addons/Visualisation.cpp b/xbmc/addons/Visualisation.cpp index b28289bfae..a64ee597e5 100644 --- a/xbmc/addons/Visualisation.cpp +++ b/xbmc/addons/Visualisation.cpp @@ -266,13 +266,13 @@ void CVisualisation::OnAudioData(const float* pAudioData, int iAudioDataLength) return; // Save our audio data in the buffers - auto_ptr<CAudioBuffer> pBuffer ( new CAudioBuffer(AUDIO_BUFFER_SIZE) ); + unique_ptr<CAudioBuffer> pBuffer ( new CAudioBuffer(AUDIO_BUFFER_SIZE) ); pBuffer->Set(pAudioData, iAudioDataLength); m_vecBuffers.push_back( pBuffer.release() ); if ( (int)m_vecBuffers.size() < m_iNumBuffers) return ; - auto_ptr<CAudioBuffer> ptrAudioBuffer ( m_vecBuffers.front() ); + unique_ptr<CAudioBuffer> ptrAudioBuffer ( m_vecBuffers.front() ); m_vecBuffers.pop_front(); // Fourier transform the data if the vis wants it... if (m_bWantsFreq) diff --git a/xbmc/cdrip/CDDARipJob.cpp b/xbmc/cdrip/CDDARipJob.cpp index 8f404ee92e..be8ef3d52d 100644 --- a/xbmc/cdrip/CDDARipJob.cpp +++ b/xbmc/cdrip/CDDARipJob.cpp @@ -183,7 +183,7 @@ CEncoder* CCDDARipJob::SetupEncoder(CFile& reader) if (CSettings::Get().GetString("audiocds.encoder") == "audioencoder.xbmc.builtin.aac" || CSettings::Get().GetString("audiocds.encoder") == "audioencoder.xbmc.builtin.wma") { - boost::shared_ptr<IEncoder> enc(new CEncoderFFmpeg()); + std::shared_ptr<IEncoder> enc(new CEncoderFFmpeg()); encoder = new CEncoder(enc); } else @@ -192,9 +192,9 @@ CEncoder* CCDDARipJob::SetupEncoder(CFile& reader) CAddonMgr::Get().GetAddon(CSettings::Get().GetString("audiocds.encoder"), addon); if (addon) { - boost::shared_ptr<CAudioEncoder> aud = boost::static_pointer_cast<CAudioEncoder>(addon); + std::shared_ptr<CAudioEncoder> aud = std::static_pointer_cast<CAudioEncoder>(addon); aud->Create(); - boost::shared_ptr<IEncoder> enc = boost::static_pointer_cast<IEncoder>(aud); + std::shared_ptr<IEncoder> enc = std::static_pointer_cast<IEncoder>(aud); encoder = new CEncoder(enc); } } diff --git a/xbmc/cdrip/CDDARipper.cpp b/xbmc/cdrip/CDDARipper.cpp index 4486519a8e..a48448204c 100644 --- a/xbmc/cdrip/CDDARipper.cpp +++ b/xbmc/cdrip/CDDARipper.cpp @@ -116,7 +116,7 @@ bool CCDDARipper::RipCD() { CFileItemPtr pItem = vecItems[i]; CMusicInfoTagLoaderFactory factory; - auto_ptr<IMusicInfoTagLoader> pLoader (factory.CreateLoader(pItem->GetPath())); + unique_ptr<IMusicInfoTagLoader> pLoader (factory.CreateLoader(pItem->GetPath())); if (NULL != pLoader.get()) { pLoader->Load(pItem->GetPath(), *pItem->GetMusicInfoTag()); // get tag from file @@ -297,7 +297,7 @@ std::string CCDDARipper::GetTrackName(CFileItem *item) CAddonMgr::Get().GetAddon(CSettings::Get().GetString("audiocds.encoder"), addon); if (addon) { - boost::shared_ptr<CAudioEncoder> enc = boost::static_pointer_cast<CAudioEncoder>(addon); + std::shared_ptr<CAudioEncoder> enc = std::static_pointer_cast<CAudioEncoder>(addon); track += enc->extension; } diff --git a/xbmc/cdrip/Encoder.cpp b/xbmc/cdrip/Encoder.cpp index c8bf472a6a..a83898b001 100644 --- a/xbmc/cdrip/Encoder.cpp +++ b/xbmc/cdrip/Encoder.cpp @@ -22,7 +22,7 @@ #include "filesystem/File.h" #include "utils/log.h" -CEncoder::CEncoder(boost::shared_ptr<IEncoder> encoder) +CEncoder::CEncoder(std::shared_ptr<IEncoder> encoder) { m_file = NULL; m_dwWriteBufferPointer = 0; diff --git a/xbmc/cdrip/Encoder.h b/xbmc/cdrip/Encoder.h index 744f80785f..4e5324219b 100644 --- a/xbmc/cdrip/Encoder.h +++ b/xbmc/cdrip/Encoder.h @@ -21,11 +21,11 @@ * */ -#include <boost/shared_ptr.hpp> #include "IEncoder.h" #include <string> #include <stdint.h> #include <stdio.h> +#include <memory> #define WRITEBUFFER_SIZE 131072 // 128k buffer @@ -34,7 +34,7 @@ namespace XFILE { class CFile; } class CEncoder { public: - CEncoder(boost::shared_ptr<IEncoder> encoder); + CEncoder(std::shared_ptr<IEncoder> encoder); virtual ~CEncoder(); virtual bool Init(const char* strFile, int iInChannels, int iInRate, int iInBits); virtual int Encode(int nNumBytesRead, uint8_t* pbtStream); @@ -62,7 +62,7 @@ protected: static int WriteCallback(void *opaque, uint8_t *data, int size); static int64_t SeekCallback(void *opaque, int64_t offset, int whence); - boost::shared_ptr<IEncoder> m_impl; + std::shared_ptr<IEncoder> m_impl; XFILE::CFile *m_file; diff --git a/xbmc/commons/Buffer.h b/xbmc/commons/Buffer.h index f78a35e2fe..c406d6e04a 100644 --- a/xbmc/commons/Buffer.h +++ b/xbmc/commons/Buffer.h @@ -20,7 +20,7 @@ */ #include <string.h> #include <string> -#include <boost/shared_array.hpp> +#include <memory> namespace XbmcCommons { @@ -88,7 +88,7 @@ namespace XbmcCommons */ class Buffer { - boost::shared_array<unsigned char> bufferRef; + std::shared_ptr<unsigned char> bufferRef; unsigned char* buffer; size_t mposition; size_t mcapacity; @@ -132,7 +132,7 @@ namespace XbmcCommons inline Buffer(size_t bufferSize) : buffer(bufferSize ? new unsigned char[bufferSize] : NULL), mcapacity(bufferSize) { clear(); - bufferRef.reset(buffer); + bufferRef.reset(buffer, std::default_delete<unsigned char[]>()); } /** @@ -166,7 +166,7 @@ namespace XbmcCommons inline Buffer& allocate(size_t bufferSize) { buffer = bufferSize ? new unsigned char[bufferSize] : NULL; - bufferRef.reset(buffer); + bufferRef.reset(buffer, std::default_delete<unsigned char[]>()); mcapacity = bufferSize; clear(); return *this; diff --git a/xbmc/cores/AudioEngine/AESinkFactory.cpp b/xbmc/cores/AudioEngine/AESinkFactory.cpp index 619b417e5f..a094c2aaf4 100644 --- a/xbmc/cores/AudioEngine/AESinkFactory.cpp +++ b/xbmc/cores/AudioEngine/AESinkFactory.cpp @@ -49,6 +49,8 @@ #include "utils/SystemInfo.h" #include "utils/log.h" +#include <algorithm> + void CAESinkFactory::ParseDevice(std::string &device, std::string &driver) { int pos = device.find_first_of(':'); diff --git a/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp b/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp index fe7bbbb507..4bf3d04047 100644 --- a/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp +++ b/xbmc/cores/AudioEngine/Encoders/AEEncoderFFmpeg.cpp @@ -27,6 +27,7 @@ #include "settings/AdvancedSettings.h" #include "settings/Settings.h" #include <string.h> +#include <cassert> CAEEncoderFFmpeg::CAEEncoderFFmpeg(): m_BitRate (0 ), diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp index 96f79b7c8c..fee46e7528 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAEResamplePi.cpp @@ -19,6 +19,7 @@ */ #include "system.h" +#include <cassert> #if defined(TARGET_RASPBERRY_PI) diff --git a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp index b391ff3363..dcfca67c3b 100644 --- a/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp +++ b/xbmc/cores/AudioEngine/Engines/ActiveAE/ActiveAESink.cpp @@ -29,6 +29,7 @@ #include "settings/Settings.h" #include <new> // for std::bad_alloc +#include <algorithm> using namespace ActiveAE; diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp index df50940afc..e52d725348 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkALSA.cpp @@ -26,6 +26,7 @@ #include <set> #include <sstream> #include <string> +#include <algorithm> #include "AESinkALSA.h" #include "cores/AudioEngine/Utils/AEUtil.h" diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp index 9725d6ee3d..8b24703689 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkDirectSound.cpp @@ -20,6 +20,8 @@ #define INITGUID +#include <algorithm> + #include "AESinkDirectSound.h" #include "utils/log.h" #include <initguid.h> diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp index 89684e4074..318df3b9a4 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkPi.cpp @@ -24,6 +24,7 @@ #include <stdint.h> #include <limits.h> +#include <cassert> #include "AESinkPi.h" #include "cores/AudioEngine/Utils/AEUtil.h" diff --git a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp index 858b008cc4..87f50e84e8 100644 --- a/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp +++ b/xbmc/cores/AudioEngine/Sinks/AESinkWASAPI.cpp @@ -23,6 +23,7 @@ #include <avrt.h> #include <initguid.h> #include <stdint.h> +#include <algorithm> #include "cores/AudioEngine/Utils/AEUtil.h" #include "settings/AdvancedSettings.h" diff --git a/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioHelpers.cpp b/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioHelpers.cpp index e8355d7854..c541268300 100644 --- a/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioHelpers.cpp +++ b/xbmc/cores/AudioEngine/Sinks/osx/CoreAudioHelpers.cpp @@ -46,10 +46,10 @@ std::string GetError(OSStatus error) const char* StreamDescriptionToString(AudioStreamBasicDescription desc, std::string &str) { char fourCC[5] = { - (desc.mFormatID >> 24) & 0xFF, - (desc.mFormatID >> 16) & 0xFF, - (desc.mFormatID >> 8) & 0xFF, - desc.mFormatID & 0xFF, + (char)((desc.mFormatID >> 24) & 0xFF), + (char)((desc.mFormatID >> 16) & 0xFF), + (char)((desc.mFormatID >> 8) & 0xFF), + (char) (desc.mFormatID & 0xFF), 0 }; diff --git a/xbmc/cores/AudioEngine/Utils/AEChannelInfo.cpp b/xbmc/cores/AudioEngine/Utils/AEChannelInfo.cpp index afc085ee50..f45555695b 100644 --- a/xbmc/cores/AudioEngine/Utils/AEChannelInfo.cpp +++ b/xbmc/cores/AudioEngine/Utils/AEChannelInfo.cpp @@ -19,6 +19,7 @@ */ #include "AEChannelInfo.h" +#include <algorithm> #include <limits> #include <string.h> #include <assert.h> diff --git a/xbmc/cores/AudioEngine/Utils/AEStreamInfo.cpp b/xbmc/cores/AudioEngine/Utils/AEStreamInfo.cpp index 73b84f3208..cc68651f05 100644 --- a/xbmc/cores/AudioEngine/Utils/AEStreamInfo.cpp +++ b/xbmc/cores/AudioEngine/Utils/AEStreamInfo.cpp @@ -20,6 +20,7 @@ #include "AEStreamInfo.h" #include "utils/log.h" +#include <algorithm> #define IEC61937_PREAMBLE1 0xF872 #define IEC61937_PREAMBLE2 0x4E1F diff --git a/xbmc/cores/AudioEngine/Utils/AEUtil.cpp b/xbmc/cores/AudioEngine/Utils/AEUtil.cpp index f535512451..dd616b9665 100644 --- a/xbmc/cores/AudioEngine/Utils/AEUtil.cpp +++ b/xbmc/cores/AudioEngine/Utils/AEUtil.cpp @@ -25,6 +25,8 @@ #include "utils/log.h" #include "utils/TimeUtils.h" +#include <cassert> + extern "C" { #include "libavutil/channel_layout.h" } diff --git a/xbmc/cores/DllLoader/DllLoader.cpp b/xbmc/cores/DllLoader/DllLoader.cpp index 1798c2d174..01f8e9ad7b 100644 --- a/xbmc/cores/DllLoader/DllLoader.cpp +++ b/xbmc/cores/DllLoader/DllLoader.cpp @@ -18,6 +18,9 @@ * */ +#include <stdlib.h> +#include <algorithm> + #include "DllLoader.h" #include "DllLoaderContainer.h" #include "filesystem/SpecialProtocol.h" diff --git a/xbmc/cores/DllLoader/dll_tracker.cpp b/xbmc/cores/DllLoader/dll_tracker.cpp index 192ad5c035..182a88acf0 100644 --- a/xbmc/cores/DllLoader/dll_tracker.cpp +++ b/xbmc/cores/DllLoader/dll_tracker.cpp @@ -24,6 +24,7 @@ #include "DllLoader.h" #include "threads/SingleLock.h" #include "utils/log.h" +#include <stdlib.h> #ifdef _cplusplus extern "C" diff --git a/xbmc/cores/DllLoader/dll_tracker_file.cpp b/xbmc/cores/DllLoader/dll_tracker_file.cpp index b41788fe5f..2b5f574794 100644 --- a/xbmc/cores/DllLoader/dll_tracker_file.cpp +++ b/xbmc/cores/DllLoader/dll_tracker_file.cpp @@ -23,6 +23,7 @@ #include "DllLoader.h" #include "threads/SingleLock.h" #include "utils/log.h" +#include <stdlib.h> #ifdef TARGET_POSIX #define dll_open open diff --git a/xbmc/cores/DllLoader/exports/emu_kernel32.cpp b/xbmc/cores/DllLoader/exports/emu_kernel32.cpp index f3333a0e41..6cd8969da6 100644 --- a/xbmc/cores/DllLoader/exports/emu_kernel32.cpp +++ b/xbmc/cores/DllLoader/exports/emu_kernel32.cpp @@ -40,6 +40,7 @@ #include <string.h> #include <vector> +#include <stdlib.h> using namespace std; vector<string> m_vecAtoms; diff --git a/xbmc/cores/VideoRenderers/DXVA.cpp b/xbmc/cores/VideoRenderers/DXVA.cpp index 2f38ed0471..a5a6d33ada 100644 --- a/xbmc/cores/VideoRenderers/DXVA.cpp +++ b/xbmc/cores/VideoRenderers/DXVA.cpp @@ -31,7 +31,6 @@ #include "WinRenderer.h" #include "settings/Settings.h" #include "settings/MediaSettings.h" -#include "boost/shared_ptr.hpp" #include "utils/AutoPtrHandle.h" #include "utils/StringUtils.h" #include "settings/AdvancedSettings.h" @@ -40,6 +39,8 @@ #include "win32/WIN32Util.h" #include "utils/Log.h" +#include <memory> + using namespace DXVA; using namespace AUTOPTR; using namespace std; @@ -138,7 +139,7 @@ static const dxva2_deinterlacetech_t *dxva2_find_deinterlacetech(unsigned flags) return NULL; } -#define SCOPE(type, var) boost::shared_ptr<type> var##_holder(var, CoTaskMemFree); +#define SCOPE(type, var) std::shared_ptr<type> var##_holder(var, CoTaskMemFree); CCriticalSection CProcessor::m_dlSection; HMODULE CProcessor::m_dlHandle = NULL; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthrough.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthrough.cpp index 79b4e6ed73..4ba6ed9894 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthrough.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Audio/DVDAudioCodecPassthrough.cpp @@ -25,6 +25,8 @@ #include "settings/Settings.h" #include "utils/log.h" +#include <algorithm> + #include "cores/AudioEngine/AEFactory.h" CDVDAudioCodecPassthrough::CDVDAudioCodecPassthrough(void) : diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlay.h b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlay.h index 684460d61c..e9be084d97 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlay.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Overlay/DVDOverlay.h @@ -92,7 +92,7 @@ public: } /** - * static release function for use with boost shared ptr for example + * static release function for use with shared ptr for example */ static void Release(CDVDOverlay* ov) { diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp index 40a36f6bb2..015d4bf4b3 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.cpp @@ -50,6 +50,8 @@ #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> +#include <cassert> + static bool CanSurfaceRenderBlackList(const std::string &name) { // All devices 'should' be capiable of surface rendering @@ -123,7 +125,7 @@ protected: class CDVDMediaCodecOnFrameAvailable : public CEvent, CJNISurfaceTextureOnFrameAvailableListener { public: - CDVDMediaCodecOnFrameAvailable(boost::shared_ptr<CJNISurfaceTexture> &surfaceTexture) + CDVDMediaCodecOnFrameAvailable(std::shared_ptr<CJNISurfaceTexture> &surfaceTexture) : m_surfaceTexture(surfaceTexture) { m_surfaceTexture->setOnFrameAvailableListener(*this); @@ -143,7 +145,7 @@ protected: } private: - boost::shared_ptr<CJNISurfaceTexture> m_surfaceTexture; + std::shared_ptr<CJNISurfaceTexture> m_surfaceTexture; }; @@ -152,9 +154,9 @@ private: CDVDMediaCodecInfo::CDVDMediaCodecInfo( int index , unsigned int texture - , boost::shared_ptr<CJNIMediaCodec> &codec - , boost::shared_ptr<CJNISurfaceTexture> &surfacetexture - , boost::shared_ptr<CDVDMediaCodecOnFrameAvailable> &frameready + , std::shared_ptr<CJNIMediaCodec> &codec + , std::shared_ptr<CJNISurfaceTexture> &surfacetexture + , std::shared_ptr<CDVDMediaCodecOnFrameAvailable> &frameready ) : m_refs(1) , m_valid(true) @@ -421,7 +423,7 @@ bool CDVDVideoCodecAndroidMediaCodec::Open(CDVDStreamInfo &hints, CDVDCodecOptio { if (types[j] == m_mime) { - m_codec = boost::shared_ptr<CJNIMediaCodec>(new CJNIMediaCodec(CJNIMediaCodec::createByCodecName(m_codecname))); + m_codec = std::shared_ptr<CJNIMediaCodec>(new CJNIMediaCodec(CJNIMediaCodec::createByCodecName(m_codecname))); // clear any jni exceptions, jni gets upset if we do not. if (xbmc_jnienv()->ExceptionCheck()) @@ -1225,9 +1227,9 @@ void CDVDVideoCodecAndroidMediaCodec::InitSurfaceTexture(void) glBindTexture( GL_TEXTURE_EXTERNAL_OES, 0); m_textureId = texture_id; - m_surfaceTexture = boost::shared_ptr<CJNISurfaceTexture>(new CJNISurfaceTexture(m_textureId)); + m_surfaceTexture = std::shared_ptr<CJNISurfaceTexture>(new CJNISurfaceTexture(m_textureId)); // hook the surfaceTexture OnFrameAvailable callback - m_frameAvailable = boost::shared_ptr<CDVDMediaCodecOnFrameAvailable>(new CDVDMediaCodecOnFrameAvailable(m_surfaceTexture)); + m_frameAvailable = std::shared_ptr<CDVDMediaCodecOnFrameAvailable>(new CDVDMediaCodecOnFrameAvailable(m_surfaceTexture)); m_surface = new CJNISurface(*m_surfaceTexture); } else diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h index d93dd0a47d..b29471b8e2 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecAndroidMediaCodec.h @@ -22,7 +22,7 @@ #include <queue> #include <vector> -#include <boost/shared_ptr.hpp> +#include <memory> #include "DVDVideoCodec.h" #include "DVDStreamInfo.h" @@ -49,9 +49,9 @@ class CDVDMediaCodecInfo public: CDVDMediaCodecInfo( int index, unsigned int texture, - boost::shared_ptr<CJNIMediaCodec> &codec, - boost::shared_ptr<CJNISurfaceTexture> &surfacetexture, - boost::shared_ptr<CDVDMediaCodecOnFrameAvailable> &frameready); + std::shared_ptr<CJNIMediaCodec> &codec, + std::shared_ptr<CJNISurfaceTexture> &surfacetexture, + std::shared_ptr<CDVDMediaCodecOnFrameAvailable> &frameready); // reference counting CDVDMediaCodecInfo* Retain(); @@ -80,9 +80,9 @@ private: CCriticalSection m_section; // shared_ptr bits, shared between // CDVDVideoCodecAndroidMediaCodec and LinuxRenderGLES. - boost::shared_ptr<CJNIMediaCodec> m_codec; - boost::shared_ptr<CJNISurfaceTexture> m_surfacetexture; - boost::shared_ptr<CDVDMediaCodecOnFrameAvailable> m_frameready; + std::shared_ptr<CJNIMediaCodec> m_codec; + std::shared_ptr<CJNISurfaceTexture> m_surfacetexture; + std::shared_ptr<CDVDMediaCodecOnFrameAvailable> m_frameready; }; class CDVDVideoCodecAndroidMediaCodec : public CDVDVideoCodec @@ -128,9 +128,9 @@ protected: // we need these as shared_ptr because CDVDVideoCodecAndroidMediaCodec // will get deleted before CLinuxRendererGLES is shut down and // CLinuxRendererGLES refs them via CDVDMediaCodecInfo. - boost::shared_ptr<CJNIMediaCodec> m_codec; - boost::shared_ptr<CJNISurfaceTexture> m_surfaceTexture; - boost::shared_ptr<CDVDMediaCodecOnFrameAvailable> m_frameAvailable; + std::shared_ptr<CJNIMediaCodec> m_codec; + std::shared_ptr<CJNISurfaceTexture> m_surfaceTexture; + std::shared_ptr<CDVDMediaCodecOnFrameAvailable> m_frameAvailable; std::queue<amc_demux> m_demux; std::vector<CJNIByteBuffer> m_input; diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp index 5ec0e9ba76..1742994f62 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecFFmpeg.cpp @@ -36,7 +36,7 @@ #include "settings/Settings.h" #include "settings/VideoSettings.h" #include "utils/log.h" -#include "boost/shared_ptr.hpp" +#include <memory> #include "threads/Atomics.h" #ifndef TARGET_POSIX @@ -70,7 +70,7 @@ extern "C" { #include "libavfilter/buffersrc.h" } -using namespace boost; +using namespace std; enum PixelFormat CDVDVideoCodecFFmpeg::GetFormat( struct AVCodecContext * avctx , const PixelFormat * fmt ) @@ -298,7 +298,7 @@ bool CDVDVideoCodecFFmpeg::Open(CDVDStreamInfo &hints, CDVDCodecOptions &options for(std::vector<CDVDCodecOption>::iterator it = options.m_keys.begin(); it != options.m_keys.end(); ++it) { if (it->m_name == "surfaces") - m_uSurfacesCount = std::atoi(it->m_value.c_str()); + m_uSurfacesCount = atoi(it->m_value.c_str()); else av_opt_set(m_pCodecContext, it->m_name.c_str(), it->m_value.c_str(), 0); } diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp index ca0abcc000..eaab2b8fae 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DVDVideoCodecIMX.cpp @@ -32,6 +32,8 @@ #include "settings/AdvancedSettings.h" #include "threads/Atomics.h" +#include <cassert> + #define FRAME_ALIGN 16 #define MEDIAINFO 1 #define _4CC(c1,c2,c3,c4) (((uint32_t)(c4)<<24)|((uint32_t)(c3)<<16)|((uint32_t)(c2)<<8)|(uint32_t)(c1)) diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp index e3dc9dcae7..fc83287af9 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/DXVA.cpp @@ -37,7 +37,7 @@ #include "../../../VideoRenderers/WinRenderer.h" #include "settings/Settings.h" #include "settings/MediaSettings.h" -#include "boost/shared_ptr.hpp" +#include <memory> #include "utils/AutoPtrHandle.h" #include "utils/StringUtils.h" #include "settings/AdvancedSettings.h" diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h index b1b7c90ab4..4c04427dfd 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/MMALCodec.h @@ -35,14 +35,14 @@ #include <queue> #include <semaphore.h> -#include <boost/shared_ptr.hpp> +#include <memory> #include <string> #include "guilib/Geometry.h" #include "rendering/RenderSystem.h" #include "cores/VideoRenderers/BaseRenderer.h" class CMMALVideo; -typedef boost::shared_ptr<CMMALVideo> MMALVideoPtr; +typedef std::shared_ptr<CMMALVideo> MMALVideoPtr; // a mmal video frame class CMMALVideoBuffer diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h index f737edc43e..b2c12cf6d1 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/VAAPI.h @@ -35,6 +35,7 @@ #include "utils/ActorProtocol.h" #include <list> #include <map> +#include <memory> #include <va/va.h> #include "linux/sse4/DllLibSSE4.h" diff --git a/xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideoPrivate.h b/xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideoPrivate.h index ebd19ce45d..02a6dc42d9 100644 --- a/xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideoPrivate.h +++ b/xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideoPrivate.h @@ -33,6 +33,10 @@ #include <media/stagefright/MediaDefs.h> #include <media/stagefright/MediaSource.h> +#if __cplusplus >= 201103L +#define char16_t LIBRARY_char16_t +#define char32_t LIBRARY_char32_t +#endif #include <binder/ProcessState.h> #include <media/stagefright/OMXClient.h> #include <media/stagefright/OMXCodec.h> @@ -42,6 +46,10 @@ #include <ui/GraphicBuffer.h> #include <ui/PixelFormat.h> #include <gui/SurfaceTexture.h> +#if __cplusplus >= 201103L +#undef char16_t +#undef char32_t +#endif #include "system_gl.h" diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCC.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCC.cpp index 47dd89e9e8..24d56da6fd 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCC.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxCC.cpp @@ -24,6 +24,8 @@ #include "cores/dvdplayer/DVDCodecs/Overlay/contrib/cc_decoder708.h" #include "utils/log.h" +#include <algorithm> + class CBitstream { public: diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.h index 0dab33dbf1..2fc3c6309c 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.h +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxPVRClient.h @@ -108,7 +108,7 @@ protected: #define MAX_STREAMS 100 #endif CDemuxStream* m_streams[MAX_STREAMS]; // maximum number of streams that ffmpeg can handle - boost::shared_ptr<PVR::CPVRClient> m_pvrClient; + std::shared_ptr<PVR::CPVRClient> m_pvrClient; private: void RequestStreams(); diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp index 0f851c3d2a..9625a19232 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.cpp @@ -49,7 +49,7 @@ bool CDVDDemuxVobsub::Open(const string& filename, const string& subfilename) { m_Filename = filename; - auto_ptr<CDVDSubtitleStream> pStream(new CDVDSubtitleStream()); + unique_ptr<CDVDSubtitleStream> pStream(new CDVDSubtitleStream()); if(!pStream->Open(filename)) return false; @@ -195,7 +195,7 @@ bool CDVDDemuxVobsub::ParseDelay(SState& state, char* line) bool CDVDDemuxVobsub::ParseId(SState& state, char* line) { - auto_ptr<CStream> stream(new CStream(this)); + unique_ptr<CStream> stream(new CStream(this)); while(*line == ' ') line++; strncpy(stream->language, line, 2); diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.h b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.h index df9bfd2b43..0c75c4adbd 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.h +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDDemuxVobsub.h @@ -70,8 +70,8 @@ private: } STimestamp; std::string m_Filename; - std::auto_ptr<CDVDInputStream> m_Input; - std::auto_ptr<CDVDDemuxFFmpeg> m_Demuxer; + std::unique_ptr<CDVDInputStream> m_Input; + std::unique_ptr<CDVDDemuxFFmpeg> m_Demuxer; std::vector<STimestamp> m_Timestamps; std::vector<STimestamp>::iterator m_Timestamp; std::vector<CStream*> m_Streams; diff --git a/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp b/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp index 343651c6fd..f909c32886 100644 --- a/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp +++ b/xbmc/cores/dvdplayer/DVDDemuxers/DVDFactoryDemuxer.cpp @@ -49,7 +49,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool { // audio/x-xbmc-pcm this is the used codec for AirTunes // (apples audio only streaming) - auto_ptr<CDVDDemuxBXA> demuxer(new CDVDDemuxBXA()); + unique_ptr<CDVDDemuxBXA> demuxer(new CDVDDemuxBXA()); if(demuxer->Open(pInputStream)) return demuxer.release(); else @@ -64,7 +64,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool { CLog::Log(LOGDEBUG, "DVDFactoryDemuxer: Stream is probably CD audio. Creating CDDA demuxer."); - auto_ptr<CDVDDemuxCDDA> demuxer(new CDVDDemuxCDDA()); + unique_ptr<CDVDDemuxCDDA> demuxer(new CDVDDemuxCDDA()); if (demuxer->Open(pInputStream)) { return demuxer.release(); @@ -80,7 +80,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool /* check so we got the meta information as requested in our http header */ if( header->GetValue("icy-metaint").length() > 0 ) { - auto_ptr<CDVDDemuxShoutcast> demuxer(new CDVDDemuxShoutcast()); + unique_ptr<CDVDDemuxShoutcast> demuxer(new CDVDDemuxShoutcast()); if(demuxer->Open(pInputStream)) return demuxer.release(); else @@ -91,7 +91,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool #ifdef HAS_FILESYSTEM_HTSP if (pInputStream->IsStreamType(DVDSTREAM_TYPE_HTSP)) { - auto_ptr<CDVDDemuxHTSP> demuxer(new CDVDDemuxHTSP()); + unique_ptr<CDVDDemuxHTSP> demuxer(new CDVDDemuxHTSP()); if(demuxer->Open(pInputStream)) return demuxer.release(); else @@ -114,7 +114,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool /* Used for MediaPortal PVR addon (uses PVR otherstream for playback of rtsp streams) */ if (pOtherStream->IsStreamType(DVDSTREAM_TYPE_FFMPEG)) { - auto_ptr<CDVDDemuxFFmpeg> demuxer(new CDVDDemuxFFmpeg()); + unique_ptr<CDVDDemuxFFmpeg> demuxer(new CDVDDemuxFFmpeg()); if(demuxer->Open(pOtherStream, streaminfo)) return demuxer.release(); else @@ -125,11 +125,11 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool /* Use PVR demuxer only for live streams */ if (URIUtils::IsPVRChannel(pInputStream->GetFileName())) { - boost::shared_ptr<CPVRClient> client; + std::shared_ptr<CPVRClient> client; if (g_PVRClients->GetPlayingClient(client) && client->HandlesDemuxing()) { - auto_ptr<CDVDDemuxPVRClient> demuxer(new CDVDDemuxPVRClient()); + unique_ptr<CDVDDemuxPVRClient> demuxer(new CDVDDemuxPVRClient()); if(demuxer->Open(pInputStream)) return demuxer.release(); else @@ -144,7 +144,7 @@ CDVDDemux* CDVDFactoryDemuxer::CreateDemuxer(CDVDInputStream* pInputStream, bool streaminfo = !useFastswitch; } - auto_ptr<CDVDDemuxFFmpeg> demuxer(new CDVDDemuxFFmpeg()); + unique_ptr<CDVDDemuxFFmpeg> demuxer(new CDVDDemuxFFmpeg()); if(demuxer->Open(pInputStream, streaminfo, fileinfo)) return demuxer.release(); else diff --git a/xbmc/cores/dvdplayer/DVDFileInfo.cpp b/xbmc/cores/dvdplayer/DVDFileInfo.cpp index ef297bc2e0..e05b6470fd 100644 --- a/xbmc/cores/dvdplayer/DVDFileInfo.cpp +++ b/xbmc/cores/dvdplayer/DVDFileInfo.cpp @@ -18,6 +18,8 @@ * */ +#include <cstdlib> + #include "threads/SystemClock.h" #include "DVDFileInfo.h" #include "FileItem.h" @@ -57,8 +59,8 @@ bool CDVDFileInfo::GetFileDuration(const std::string &path, int& duration) { - std::auto_ptr<CDVDInputStream> input; - std::auto_ptr<CDVDDemux> demux; + std::unique_ptr<CDVDInputStream> input; + std::unique_ptr<CDVDDemux> demux; input.reset(CDVDFactoryInputStream::CreateInputStream(NULL, path, "")); if (!input.get()) diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h index 17006b6b7b..72af2ddeaf 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStream.h @@ -57,7 +57,7 @@ namespace XFILE namespace PVR { class CPVRChannel; - typedef boost::shared_ptr<PVR::CPVRChannel> CPVRChannelPtr; + typedef std::shared_ptr<PVR::CPVRChannel> CPVRChannelPtr; } class CDVDInputStream diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.cpp index 6056e51c8b..2ef5f95d7f 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.cpp +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.cpp @@ -20,6 +20,8 @@ #include "system.h" #ifdef HAVE_LIBBLURAY +#include <functional> + #include "DVDInputStreamBluray.h" #include "IDVDPlayer.h" #include "DVDCodecs/Overlay/DVDOverlay.h" diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h index 7c75d646cc..1f5f926652 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamBluray.h @@ -22,7 +22,7 @@ #include "DVDInputStream.h" #include <list> -#include <boost/shared_ptr.hpp> +#include <memory> extern "C" { @@ -133,7 +133,7 @@ protected: bool m_menu; bool m_navmode; - typedef boost::shared_ptr<CDVDOverlayImage> SOverlay; + typedef std::shared_ptr<CDVDOverlayImage> SOverlay; typedef std::list<SOverlay> SOverlays; struct SPlane diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.cpp b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.cpp index cfd5339ad5..fbe24b8136 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.cpp +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.cpp @@ -27,7 +27,6 @@ #include <limits.h> using namespace XFILE; -using namespace boost; using namespace std; CDVDInputStreamStack::CDVDInputStreamStack() : CDVDInputStream(DVDSTREAM_TYPE_FILE) diff --git a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.h b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.h index d837710392..de35a82606 100644 --- a/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.h +++ b/xbmc/cores/dvdplayer/DVDInputStreams/DVDInputStreamStack.h @@ -21,7 +21,7 @@ */ #include "DVDInputStream.h" -#include "boost/shared_ptr.hpp" +#include <memory> class CDVDInputStreamStack : public CDVDInputStream { @@ -39,7 +39,7 @@ public: protected: - typedef boost::shared_ptr<XFILE::CFile> TFile; + typedef std::shared_ptr<XFILE::CFile> TFile; struct TSeg { diff --git a/xbmc/cores/dvdplayer/DVDMessage.cpp b/xbmc/cores/dvdplayer/DVDMessage.cpp index 40411c4609..1e0867bbcc 100644 --- a/xbmc/cores/dvdplayer/DVDMessage.cpp +++ b/xbmc/cores/dvdplayer/DVDMessage.cpp @@ -18,6 +18,7 @@ * */ +#include <algorithm> #include "threads/SystemClock.h" #include "DVDMessage.h" #include "DVDDemuxers/DVDDemuxUtils.h" diff --git a/xbmc/cores/dvdplayer/DVDMessageQueue.h b/xbmc/cores/dvdplayer/DVDMessageQueue.h index 325b15f72f..6c6ba5034e 100644 --- a/xbmc/cores/dvdplayer/DVDMessageQueue.h +++ b/xbmc/cores/dvdplayer/DVDMessageQueue.h @@ -23,6 +23,7 @@ #include "DVDMessage.h" #include <string> #include <list> +#include <algorithm> #include "threads/CriticalSection.h" #include "threads/Event.h" diff --git a/xbmc/cores/dvdplayer/DVDPlayer.cpp b/xbmc/cores/dvdplayer/DVDPlayer.cpp index 8f7c8a1ce8..260dd9021d 100644 --- a/xbmc/cores/dvdplayer/DVDPlayer.cpp +++ b/xbmc/cores/dvdplayer/DVDPlayer.cpp @@ -3161,7 +3161,7 @@ bool CDVDPlayer::OpenStream(CCurrentStream& current, int iStream, int source, bo if(!m_pSubtitleDemuxer || m_pSubtitleDemuxer->GetFileName() != st.filename) { CLog::Log(LOGNOTICE, "Opening Subtitle file: %s", st.filename.c_str()); - auto_ptr<CDVDDemuxVobsub> demux(new CDVDDemuxVobsub()); + unique_ptr<CDVDDemuxVobsub> demux(new CDVDDemuxVobsub()); if(!demux->Open(st.filename, st.filename2)) return false; m_pSubtitleDemuxer = demux.release(); diff --git a/xbmc/cores/omxplayer/OMXAudio.cpp b/xbmc/cores/omxplayer/OMXAudio.cpp index 5475570688..06e45991dd 100644 --- a/xbmc/cores/omxplayer/OMXAudio.cpp +++ b/xbmc/cores/omxplayer/OMXAudio.cpp @@ -41,6 +41,7 @@ #include "guilib/LocalizeStrings.h" #include "cores/AudioEngine/AEFactory.h" #include "Util.h" +#include <cassert> extern "C" { #include "libavutil/crc.h" diff --git a/xbmc/cores/omxplayer/OMXImage.cpp b/xbmc/cores/omxplayer/OMXImage.cpp index aa413b95af..d5d94efc2e 100644 --- a/xbmc/cores/omxplayer/OMXImage.cpp +++ b/xbmc/cores/omxplayer/OMXImage.cpp @@ -39,6 +39,7 @@ #include "utils/URIUtils.h" #include "windowing/WindowingFactory.h" #include "Application.h" +#include <cassert> #ifdef _DEBUG #define CheckError() m_result = eglGetError(); if (m_result != EGL_SUCCESS) CLog::Log(LOGERROR, "EGL error in %s: %x",__FUNCTION__, m_result); diff --git a/xbmc/cores/paplayer/NSFCodec.cpp b/xbmc/cores/paplayer/NSFCodec.cpp index 9ced1f1b88..1438368c18 100644 --- a/xbmc/cores/paplayer/NSFCodec.cpp +++ b/xbmc/cores/paplayer/NSFCodec.cpp @@ -17,6 +17,7 @@ * <http://www.gnu.org/licenses/>. * */ +#include <cstdlib> #include "NSFCodec.h" #include "utils/log.h" diff --git a/xbmc/dbwrappers/Database.cpp b/xbmc/dbwrappers/Database.cpp index a3dbd2eed9..e450e6ad34 100644 --- a/xbmc/dbwrappers/Database.cpp +++ b/xbmc/dbwrappers/Database.cpp @@ -143,7 +143,7 @@ std::string CDatabase::PrepareSQL(std::string strStmt, ...) const return strResult; } -std::string CDatabase::GetSingleValue(const std::string &query, std::auto_ptr<Dataset> &ds) +std::string CDatabase::GetSingleValue(const std::string &query, std::unique_ptr<Dataset> &ds) { std::string ret; try diff --git a/xbmc/dbwrappers/Database.h b/xbmc/dbwrappers/Database.h index 5d19749f3e..0117ecdcf9 100644 --- a/xbmc/dbwrappers/Database.h +++ b/xbmc/dbwrappers/Database.h @@ -90,7 +90,7 @@ public: \param ds the dataset to use for the query. \return the value from the query, empty on failure. */ - std::string GetSingleValue(const std::string &query, std::auto_ptr<dbiplus::Dataset> &ds); + std::string GetSingleValue(const std::string &query, std::unique_ptr<dbiplus::Dataset> &ds); /*! * @brief Delete values from a table. @@ -206,9 +206,9 @@ protected: bool m_sqlite; ///< \brief whether we use sqlite (defaults to true) - std::auto_ptr<dbiplus::Database> m_pDB; - std::auto_ptr<dbiplus::Dataset> m_pDS; - std::auto_ptr<dbiplus::Dataset> m_pDS2; + std::unique_ptr<dbiplus::Database> m_pDB; + std::unique_ptr<dbiplus::Dataset> m_pDS; + std::unique_ptr<dbiplus::Dataset> m_pDS2; private: void InitSettings(DatabaseSettings &dbSettings); diff --git a/xbmc/dbwrappers/DatabaseQuery.cpp b/xbmc/dbwrappers/DatabaseQuery.cpp index 5e6fd443ab..e443d3dad9 100644 --- a/xbmc/dbwrappers/DatabaseQuery.cpp +++ b/xbmc/dbwrappers/DatabaseQuery.cpp @@ -483,13 +483,13 @@ bool CDatabaseQueryRuleCombination::Load(const CVariant &obj, const IDatabaseQue if (it->isMember("and") || it->isMember("or")) { - boost::shared_ptr<CDatabaseQueryRuleCombination> combo(factory->CreateCombination()); + std::shared_ptr<CDatabaseQueryRuleCombination> combo(factory->CreateCombination()); if (combo && combo->Load(*it, factory)) m_combinations.push_back(combo); } else { - boost::shared_ptr<CDatabaseQueryRule> rule(factory->CreateRule()); + std::shared_ptr<CDatabaseQueryRule> rule(factory->CreateRule()); if (rule && rule->Load(*it)) m_rules.push_back(rule); } diff --git a/xbmc/dbwrappers/DatabaseQuery.h b/xbmc/dbwrappers/DatabaseQuery.h index d3eec3274e..f17c22fea2 100644 --- a/xbmc/dbwrappers/DatabaseQuery.h +++ b/xbmc/dbwrappers/DatabaseQuery.h @@ -22,7 +22,7 @@ #include <set> #include <string> #include <vector> -#include <boost/shared_ptr.hpp> +#include <memory> #define DATABASEQUERY_RULE_VALUE_SEPARATOR " / " @@ -101,8 +101,8 @@ protected: class CDatabaseQueryRuleCombination; -typedef std::vector< boost::shared_ptr<CDatabaseQueryRule> > CDatabaseQueryRules; -typedef std::vector< boost::shared_ptr<CDatabaseQueryRuleCombination> > CDatabaseQueryRuleCombinations; +typedef std::vector< std::shared_ptr<CDatabaseQueryRule> > CDatabaseQueryRules; +typedef std::vector< std::shared_ptr<CDatabaseQueryRuleCombination> > CDatabaseQueryRuleCombinations; class IDatabaseQueryRuleFactory { diff --git a/xbmc/dbwrappers/mysqldataset.cpp b/xbmc/dbwrappers/mysqldataset.cpp index d8df89fb03..4b0a387083 100644 --- a/xbmc/dbwrappers/mysqldataset.cpp +++ b/xbmc/dbwrappers/mysqldataset.cpp @@ -21,6 +21,7 @@ #include <iostream> #include <string> #include <set> +#include <algorithm> #include "utils/log.h" #include "system.h" // for GetLastError() diff --git a/xbmc/dialogs/GUIDialogBusy.cpp b/xbmc/dialogs/GUIDialogBusy.cpp index e7cfcddc02..a0f6726ab7 100644 --- a/xbmc/dialogs/GUIDialogBusy.cpp +++ b/xbmc/dialogs/GUIDialogBusy.cpp @@ -27,13 +27,13 @@ class CBusyWaiter : public CThread { - boost::shared_ptr<CEvent> m_done; + std::shared_ptr<CEvent> m_done; public: CBusyWaiter(IRunnable *runnable) : CThread(runnable, "waiting"), m_done(new CEvent()) { } bool Wait() { - boost::shared_ptr<CEvent> e_done(m_done); + std::shared_ptr<CEvent> e_done(m_done); Create(); return CGUIDialogBusy::WaitOnEvent(*e_done); @@ -42,7 +42,7 @@ public: // 'this' is actually deleted from the thread where it's on the stack virtual void Process() { - boost::shared_ptr<CEvent> e_done(m_done); + std::shared_ptr<CEvent> e_done(m_done); CThread::Process(); (*e_done).Set(); diff --git a/xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp b/xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp index ada5f6f88b..dc5e86c6fb 100644 --- a/xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp +++ b/xbmc/dialogs/GUIDialogSmartPlaylistEditor.cpp @@ -150,7 +150,7 @@ void CGUIDialogSmartPlaylistEditor::OnRuleList(int item) { if (item < 0 || item >= (int)m_playlist.m_ruleCombination.m_rules.size()) return; - CSmartPlaylistRule rule = *boost::static_pointer_cast<CSmartPlaylistRule>(m_playlist.m_ruleCombination.m_rules[item]); + CSmartPlaylistRule rule = *std::static_pointer_cast<CSmartPlaylistRule>(m_playlist.m_ruleCombination.m_rules[item]); if (CGUIDialogSmartPlaylistRule::EditRule(rule,m_playlist.GetType())) *m_playlist.m_ruleCombination.m_rules[item] = rule; @@ -298,7 +298,7 @@ void CGUIDialogSmartPlaylistEditor::UpdateButtons() if (m_playlist.m_ruleCombination.m_rules[i]->m_field == FieldNone) item->SetLabel(g_localizeStrings.Get(21423)); else - item->SetLabel(boost::static_pointer_cast<CSmartPlaylistRule>(m_playlist.m_ruleCombination.m_rules[i])->GetLocalizedRule()); + item->SetLabel(std::static_pointer_cast<CSmartPlaylistRule>(m_playlist.m_ruleCombination.m_rules[i])->GetLocalizedRule()); m_ruleLabels->Add(item); } CGUIMessage msg(GUI_MSG_LABEL_BIND, GetID(), CONTROL_RULE_LIST, 0, 0, m_ruleLabels); diff --git a/xbmc/epg/EpgDatabase.cpp b/xbmc/epg/EpgDatabase.cpp index 8e21e5033b..3a8a186cd1 100644 --- a/xbmc/epg/EpgDatabase.cpp +++ b/xbmc/epg/EpgDatabase.cpp @@ -17,6 +17,7 @@ * <http://www.gnu.org/licenses/>. * */ +#include <cstdlib> #include "dbwrappers/dataset.h" #include "settings/AdvancedSettings.h" diff --git a/xbmc/epg/EpgInfoTag.h b/xbmc/epg/EpgInfoTag.h index de0162fb05..2fc6afb171 100644 --- a/xbmc/epg/EpgInfoTag.h +++ b/xbmc/epg/EpgInfoTag.h @@ -27,7 +27,7 @@ #include "pvr/timers/PVRTimerInfoTag.h" #include "pvr/recordings/PVRRecording.h" -#include <boost/shared_ptr.hpp> +#include <memory> #include <string> #define EPG_DEBUGGING 0 @@ -38,7 +38,7 @@ namespace EPG class CEpg; class CEpgInfoTag; - typedef boost::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; + typedef std::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; class CEpgInfoTag : public ISerializable { diff --git a/xbmc/epg/GUIEPGGridContainer.cpp b/xbmc/epg/GUIEPGGridContainer.cpp index 2c3d624b20..3cb997512a 100644 --- a/xbmc/epg/GUIEPGGridContainer.cpp +++ b/xbmc/epg/GUIEPGGridContainer.cpp @@ -1282,7 +1282,7 @@ CPVRChannel* CGUIEPGGridContainer::GetChannel(int iIndex) { if (iIndex >= 0 && (size_t) iIndex < m_channelItems.size()) { - CFileItemPtr fileItem = boost::static_pointer_cast<CFileItem>(m_channelItems[iIndex]); + CFileItemPtr fileItem = std::static_pointer_cast<CFileItem>(m_channelItems[iIndex]); if (fileItem->HasPVRChannelInfoTag()) return fileItem->GetPVRChannelInfoTag(); } diff --git a/xbmc/filesystem/AddonsDirectory.cpp b/xbmc/filesystem/AddonsDirectory.cpp index b9d4846280..1f044d300c 100644 --- a/xbmc/filesystem/AddonsDirectory.cpp +++ b/xbmc/filesystem/AddonsDirectory.cpp @@ -287,7 +287,7 @@ bool CAddonsDirectory::GetScriptsAndPlugins(const std::string &content, VECADDON CAddonMgr::Get().GetAddons(ADDON_PLUGIN, tempAddons); for (unsigned i=0; i<tempAddons.size(); i++) { - PluginPtr plugin = boost::dynamic_pointer_cast<CPluginSource>(tempAddons[i]); + PluginPtr plugin = std::dynamic_pointer_cast<CPluginSource>(tempAddons[i]); if (plugin && plugin->Provides(type)) addons.push_back(tempAddons[i]); } @@ -295,7 +295,7 @@ bool CAddonsDirectory::GetScriptsAndPlugins(const std::string &content, VECADDON CAddonMgr::Get().GetAddons(ADDON_SCRIPT, tempAddons); for (unsigned i=0; i<tempAddons.size(); i++) { - PluginPtr plugin = boost::dynamic_pointer_cast<CPluginSource>(tempAddons[i]); + PluginPtr plugin = std::dynamic_pointer_cast<CPluginSource>(tempAddons[i]); if (plugin && plugin->Provides(type)) addons.push_back(tempAddons[i]); } @@ -315,7 +315,7 @@ bool CAddonsDirectory::GetScriptsAndPlugins(const std::string &content, CFileIte CFileItemPtr item(FileItemFromAddon(addons[i], addons[i]->Type()==ADDON_PLUGIN?"plugin://":"script://", addons[i]->Type() == ADDON_PLUGIN)); - PluginPtr plugin = boost::dynamic_pointer_cast<CPluginSource>(addons[i]); + PluginPtr plugin = std::dynamic_pointer_cast<CPluginSource>(addons[i]); if (plugin->ProvidesSeveral()) { CURL url = item->GetURL(); diff --git a/xbmc/filesystem/AddonsDirectory.h b/xbmc/filesystem/AddonsDirectory.h index d4a23e8b84..5021aeca15 100644 --- a/xbmc/filesystem/AddonsDirectory.h +++ b/xbmc/filesystem/AddonsDirectory.h @@ -23,7 +23,7 @@ #include "addons/AddonManager.h" class CURL; -typedef boost::shared_ptr<CFileItem> CFileItemPtr; +typedef std::shared_ptr<CFileItem> CFileItemPtr; namespace XFILE { diff --git a/xbmc/filesystem/BlurayDirectory.cpp b/xbmc/filesystem/BlurayDirectory.cpp index 349469dbad..619ab4c339 100644 --- a/xbmc/filesystem/BlurayDirectory.cpp +++ b/xbmc/filesystem/BlurayDirectory.cpp @@ -29,6 +29,8 @@ #include "video/VideoInfoTag.h" #include "guilib/LocalizeStrings.h" +#include <cassert> + namespace XFILE { diff --git a/xbmc/filesystem/CDDAFile.cpp b/xbmc/filesystem/CDDAFile.cpp index b3405c49eb..16796f555c 100644 --- a/xbmc/filesystem/CDDAFile.cpp +++ b/xbmc/filesystem/CDDAFile.cpp @@ -30,6 +30,8 @@ #include "utils/log.h" #include "utils/URIUtils.h" +#include <algorithm> + using namespace MEDIA_DETECT; using namespace XFILE; diff --git a/xbmc/filesystem/CDDAFile.h b/xbmc/filesystem/CDDAFile.h index 801b02618c..0427af4534 100644 --- a/xbmc/filesystem/CDDAFile.h +++ b/xbmc/filesystem/CDDAFile.h @@ -54,7 +54,7 @@ protected: lsn_t m_lsnCurrent; // Position inside the track in logical sector number lsn_t m_lsnEnd; // End of m_iTrack in logical sector number int m_iSectorCount; // max number of sectors to read at once - boost::shared_ptr<MEDIA_DETECT::CLibcdio> m_cdio; + std::shared_ptr<MEDIA_DETECT::CLibcdio> m_cdio; }; } diff --git a/xbmc/filesystem/CacheStrategy.cpp b/xbmc/filesystem/CacheStrategy.cpp index f7b4f0a0e5..d9c8d53219 100644 --- a/xbmc/filesystem/CacheStrategy.cpp +++ b/xbmc/filesystem/CacheStrategy.cpp @@ -36,6 +36,9 @@ #define CacheLocalFile CWin32File #endif // TARGET_WINDOWS +#include <cassert> +#include <algorithm> + using namespace XFILE; CCacheStrategy::CCacheStrategy() : m_bEndOfInput(false) diff --git a/xbmc/filesystem/CircularCache.cpp b/xbmc/filesystem/CircularCache.cpp index eb8c044959..fc4e99a211 100644 --- a/xbmc/filesystem/CircularCache.cpp +++ b/xbmc/filesystem/CircularCache.cpp @@ -18,6 +18,7 @@ * */ +#include <algorithm> #include "threads/SystemClock.h" #include "system.h" #include "utils/log.h" diff --git a/xbmc/filesystem/CurlFile.cpp b/xbmc/filesystem/CurlFile.cpp index 7d68daba12..a376105e89 100644 --- a/xbmc/filesystem/CurlFile.cpp +++ b/xbmc/filesystem/CurlFile.cpp @@ -29,6 +29,7 @@ #include <vector> #include <climits> +#include <cassert> #ifdef TARGET_POSIX #include <errno.h> @@ -1562,7 +1563,7 @@ bool CCurlFile::CReadState::FillBuffer(unsigned int want) do { unsigned int time_left = endTime.MillisLeft(); - struct timeval t = { time_left / 1000, (time_left % 1000) * 1000 }; + struct timeval t = { (int)time_left / 1000, ((int)time_left % 1000) * 1000 }; // Wait until data is available or a timeout occurs. rc = select(maxfd + 1, &fdread, &fdwrite, &fdexcep, &t); diff --git a/xbmc/filesystem/Directory.cpp b/xbmc/filesystem/Directory.cpp index d1413d43e3..3edcc0077b 100644 --- a/xbmc/filesystem/Directory.cpp +++ b/xbmc/filesystem/Directory.cpp @@ -57,8 +57,8 @@ private: struct CGetJob : CJob { - CGetJob(boost::shared_ptr<IDirectory>& imp - , boost::shared_ptr<CResult>& result) + CGetJob(std::shared_ptr<IDirectory>& imp + , std::shared_ptr<CResult>& result) : m_result(result) , m_imp(imp) {} @@ -71,13 +71,13 @@ private: return m_result->m_result; } - boost::shared_ptr<CResult> m_result; - boost::shared_ptr<IDirectory> m_imp; + std::shared_ptr<CResult> m_result; + std::shared_ptr<IDirectory> m_imp; }; public: - CGetDirectory(boost::shared_ptr<IDirectory>& imp, const CURL& dir, const CURL& listDir) + CGetDirectory(std::shared_ptr<IDirectory>& imp, const CURL& dir, const CURL& listDir) : m_result(new CResult(dir, listDir)) { m_id = CJobManager::GetInstance().AddJob(new CGetJob(imp, m_result) @@ -106,7 +106,7 @@ public: list.Copy(m_result->m_list); return true; } - boost::shared_ptr<CResult> m_result; + std::shared_ptr<CResult> m_result; unsigned int m_id; }; @@ -144,7 +144,7 @@ bool CDirectory::GetDirectory(const CURL& url, CFileItemList &items, const CHint try { CURL realURL = URIUtils::SubstitutePath(url); - boost::shared_ptr<IDirectory> pDirectory(CDirectoryFactory::Create(realURL)); + std::shared_ptr<IDirectory> pDirectory(CDirectoryFactory::Create(realURL)); if (!pDirectory.get()) return false; @@ -285,7 +285,7 @@ bool CDirectory::Create(const CURL& url) try { CURL realURL = URIUtils::SubstitutePath(url); - auto_ptr<IDirectory> pDirectory(CDirectoryFactory::Create(realURL)); + unique_ptr<IDirectory> pDirectory(CDirectoryFactory::Create(realURL)); if (pDirectory.get()) if(pDirectory->Create(realURL)) return true; @@ -320,7 +320,7 @@ bool CDirectory::Exists(const CURL& url, bool bUseCache /* = true */) if (bPathInCache) return false; } - auto_ptr<IDirectory> pDirectory(CDirectoryFactory::Create(realURL)); + unique_ptr<IDirectory> pDirectory(CDirectoryFactory::Create(realURL)); if (pDirectory.get()) return pDirectory->Exists(realURL); } @@ -344,7 +344,7 @@ bool CDirectory::Remove(const CURL& url) try { CURL realURL = URIUtils::SubstitutePath(url); - auto_ptr<IDirectory> pDirectory(CDirectoryFactory::Create(realURL)); + unique_ptr<IDirectory> pDirectory(CDirectoryFactory::Create(realURL)); if (pDirectory.get()) if(pDirectory->Remove(realURL)) { @@ -368,7 +368,7 @@ void CDirectory::FilterFileDirectories(CFileItemList &items, const std::string & CFileItemPtr pItem=items[i]; if (!pItem->m_bIsFolder && pItem->IsFileFolder(EFILEFOLDER_TYPE_ALWAYS)) { - auto_ptr<IFileDirectory> pDirectory(CFileDirectoryFactory::Create(pItem->GetURL(),pItem.get(),mask)); + unique_ptr<IFileDirectory> pDirectory(CFileDirectoryFactory::Create(pItem->GetURL(),pItem.get(),mask)); if (pDirectory.get()) pItem->m_bIsFolder = true; else diff --git a/xbmc/filesystem/DirectoryCache.cpp b/xbmc/filesystem/DirectoryCache.cpp index 76ea5540fd..987760a5f4 100644 --- a/xbmc/filesystem/DirectoryCache.cpp +++ b/xbmc/filesystem/DirectoryCache.cpp @@ -26,6 +26,8 @@ #include "utils/StringUtils.h" #include "climits" +#include <algorithm> + using namespace std; using namespace XFILE; diff --git a/xbmc/filesystem/DirectoryHistory.cpp b/xbmc/filesystem/DirectoryHistory.cpp index 319e20bc09..fb04148de3 100644 --- a/xbmc/filesystem/DirectoryHistory.cpp +++ b/xbmc/filesystem/DirectoryHistory.cpp @@ -23,6 +23,8 @@ #include "utils/StringUtils.h" #include "utils/URIUtils.h" +#include <algorithm> + using namespace std; const std::string& CDirectoryHistory::CPathHistoryItem::GetPath(bool filter /* = false */) const diff --git a/xbmc/filesystem/File.cpp b/xbmc/filesystem/File.cpp index 0764bcc3d4..5c3844a998 100644 --- a/xbmc/filesystem/File.cpp +++ b/xbmc/filesystem/File.cpp @@ -269,7 +269,7 @@ bool CFile::Open(const CURL& file, const unsigned int flags) SAFE_DELETE(m_pFile); if (pRedirectEx && pRedirectEx->m_pNewFileImp) { - auto_ptr<CURL> pNewUrl(pRedirectEx->m_pNewUrl); + unique_ptr<CURL> pNewUrl(pRedirectEx->m_pNewUrl); m_pFile = pRedirectEx->m_pNewFileImp; delete pRedirectEx; @@ -372,7 +372,7 @@ bool CFile::Exists(const CURL& file, bool bUseCache /* = true */) return false; } - auto_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); + unique_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); if (!pFile.get()) return false; @@ -386,8 +386,8 @@ bool CFile::Exists(const CURL& file, bool bUseCache /* = true */) CLog::Log(LOGDEBUG,"File::Exists - redirecting implementation for %s", file.GetRedacted().c_str()); if (pRedirectEx && pRedirectEx->m_pNewFileImp) { - auto_ptr<IFile> pImp(pRedirectEx->m_pNewFileImp); - auto_ptr<CURL> pNewUrl(pRedirectEx->m_pNewUrl); + unique_ptr<IFile> pImp(pRedirectEx->m_pNewFileImp); + unique_ptr<CURL> pNewUrl(pRedirectEx->m_pNewUrl); delete pRedirectEx; if (pImp.get()) @@ -454,7 +454,7 @@ int CFile::Stat(const CURL& file, struct __stat64* buffer) try { - auto_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); + unique_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); if (!pFile.get()) return -1; return pFile->Stat(url, buffer); @@ -467,8 +467,8 @@ int CFile::Stat(const CURL& file, struct __stat64* buffer) CLog::Log(LOGDEBUG,"File::Stat - redirecting implementation for %s", file.GetRedacted().c_str()); if (pRedirectEx && pRedirectEx->m_pNewFileImp) { - auto_ptr<IFile> pImp(pRedirectEx->m_pNewFileImp); - auto_ptr<CURL> pNewUrl(pRedirectEx->m_pNewUrl); + unique_ptr<IFile> pImp(pRedirectEx->m_pNewFileImp); + unique_ptr<CURL> pNewUrl(pRedirectEx->m_pNewUrl); delete pRedirectEx; if (pNewUrl.get()) @@ -792,7 +792,7 @@ bool CFile::Delete(const CURL& file) { CURL url(URIUtils::SubstitutePath(file)); - auto_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); + unique_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); if (!pFile.get()) return false; @@ -826,7 +826,7 @@ bool CFile::Rename(const CURL& file, const CURL& newFile) CURL url(URIUtils::SubstitutePath(file)); CURL urlnew(URIUtils::SubstitutePath(newFile)); - auto_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); + unique_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); if (!pFile.get()) return false; @@ -858,7 +858,7 @@ bool CFile::SetHidden(const CURL& file, bool hidden) { CURL url(URIUtils::SubstitutePath(file)); - auto_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); + unique_ptr<IFile> pFile(CFileFactory::CreateLoader(url)); if (!pFile.get()) return false; diff --git a/xbmc/filesystem/FileCache.cpp b/xbmc/filesystem/FileCache.cpp index 3880c58d99..2152fefced 100644 --- a/xbmc/filesystem/FileCache.cpp +++ b/xbmc/filesystem/FileCache.cpp @@ -31,6 +31,9 @@ #include "utils/TimeUtils.h" #include "settings/AdvancedSettings.h" +#include <cassert> +#include <algorithm> + using namespace AUTOPTR; using namespace XFILE; diff --git a/xbmc/filesystem/HTSPDirectory.cpp b/xbmc/filesystem/HTSPDirectory.cpp index 95b58aec56..e15abd5f16 100644 --- a/xbmc/filesystem/HTSPDirectory.cpp +++ b/xbmc/filesystem/HTSPDirectory.cpp @@ -30,6 +30,8 @@ #include "utils/TimeUtils.h" #include "utils/StringUtils.h" +#include <cassert> + extern "C" { #include "libhts/htsmsg.h" #include "libhts/htsmsg_binary.h" diff --git a/xbmc/filesystem/HTSPDirectory.h b/xbmc/filesystem/HTSPDirectory.h index daf15a3b09..953883a9e2 100644 --- a/xbmc/filesystem/HTSPDirectory.h +++ b/xbmc/filesystem/HTSPDirectory.h @@ -24,10 +24,10 @@ #include "threads/CriticalSection.h" #include "threads/Event.h" #include "HTSPSession.h" -#include "boost/shared_ptr.hpp" +#include <memory> class CURL; -class CFileItem; typedef boost::shared_ptr<CFileItem> CFileItemPtr; +class CFileItem; typedef std::shared_ptr<CFileItem> CFileItemPtr; namespace HTSP { diff --git a/xbmc/filesystem/MusicDatabaseDirectory.cpp b/xbmc/filesystem/MusicDatabaseDirectory.cpp index 169dbf7915..859fd10e8e 100644 --- a/xbmc/filesystem/MusicDatabaseDirectory.cpp +++ b/xbmc/filesystem/MusicDatabaseDirectory.cpp @@ -47,7 +47,7 @@ bool CMusicDatabaseDirectory::GetDirectory(const CURL& url, CFileItemList &items { std::string path = CLegacyPathTranslation::TranslateMusicDbPath(url); items.SetPath(path); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; @@ -71,7 +71,7 @@ bool CMusicDatabaseDirectory::GetDirectory(const CURL& url, CFileItemList &items NODE_TYPE CMusicDatabaseDirectory::GetDirectoryChildType(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateMusicDbPath(strPath); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return NODE_TYPE_NONE; @@ -82,7 +82,7 @@ NODE_TYPE CMusicDatabaseDirectory::GetDirectoryChildType(const std::string& strP NODE_TYPE CMusicDatabaseDirectory::GetDirectoryType(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateMusicDbPath(strPath); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return NODE_TYPE_NONE; @@ -93,7 +93,7 @@ NODE_TYPE CMusicDatabaseDirectory::GetDirectoryType(const std::string& strPath) NODE_TYPE CMusicDatabaseDirectory::GetDirectoryParentType(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateMusicDbPath(strPath); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return NODE_TYPE_NONE; @@ -143,7 +143,7 @@ bool CMusicDatabaseDirectory::GetLabel(const std::string& strDirectory, std::str strLabel = ""; std::string path = CLegacyPathTranslation::TranslateMusicDbPath(strDirectory); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; @@ -249,7 +249,7 @@ bool CMusicDatabaseDirectory::ContainsSongs(const std::string &path) bool CMusicDatabaseDirectory::Exists(const CURL& url) { std::string path = CLegacyPathTranslation::TranslateMusicDbPath(url); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; @@ -263,7 +263,7 @@ bool CMusicDatabaseDirectory::Exists(const CURL& url) bool CMusicDatabaseDirectory::CanCache(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateMusicDbPath(strPath); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; return pNode->CanCache(); diff --git a/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.cpp b/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.cpp index bb288b0040..87eb1f3af4 100644 --- a/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.cpp +++ b/xbmc/filesystem/MusicDatabaseDirectory/DirectoryNode.cpp @@ -95,7 +95,7 @@ CDirectoryNode* CDirectoryNode::ParseURL(const std::string& strPath) // returns the database ids of the path, void CDirectoryNode::GetDatabaseInfo(const std::string& strPath, CQueryParams& params) { - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(strPath)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(strPath)); if (!pNode.get()) return; @@ -260,7 +260,7 @@ bool CDirectoryNode::GetChilds(CFileItemList& items) if (CanCache() && items.Load()) return true; - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::CreateNode(GetChildType(), "", this)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::CreateNode(GetChildType(), "", this)); bool bSuccess=false; if (pNode.get()) diff --git a/xbmc/filesystem/PlaylistFileDirectory.cpp b/xbmc/filesystem/PlaylistFileDirectory.cpp index 0756edb7c7..be2ad61448 100644 --- a/xbmc/filesystem/PlaylistFileDirectory.cpp +++ b/xbmc/filesystem/PlaylistFileDirectory.cpp @@ -41,7 +41,7 @@ namespace XFILE bool CPlaylistFileDirectory::GetDirectory(const CURL& url, CFileItemList& items) { const std::string pathToUrl = url.Get(); - auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(pathToUrl)); + unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(pathToUrl)); if ( NULL != pPlayList.get()) { // load it @@ -63,7 +63,7 @@ namespace XFILE bool CPlaylistFileDirectory::ContainsFiles(const CURL& url) { const std::string pathToUrl = url.Get(); - auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(pathToUrl)); + unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(pathToUrl)); if ( NULL != pPlayList.get()) { // load it diff --git a/xbmc/filesystem/SFTPFile.h b/xbmc/filesystem/SFTPFile.h index 4a057d173e..973b2df226 100644 --- a/xbmc/filesystem/SFTPFile.h +++ b/xbmc/filesystem/SFTPFile.h @@ -35,7 +35,7 @@ #endif // !TARGET_WINDOWS #include <string> #include <map> -#include <boost/shared_ptr.hpp> +#include <memory> class CURL; @@ -83,7 +83,7 @@ private: int m_LastActive; }; -typedef boost::shared_ptr<CSFTPSession> CSFTPSessionPtr; +typedef std::shared_ptr<CSFTPSession> CSFTPSessionPtr; class CSFTPSessionManager { diff --git a/xbmc/filesystem/SMBFile.cpp b/xbmc/filesystem/SMBFile.cpp index 603f99d2a5..1c18a8140c 100644 --- a/xbmc/filesystem/SMBFile.cpp +++ b/xbmc/filesystem/SMBFile.cpp @@ -489,12 +489,12 @@ ssize_t CSMBFile::Read(void *lpBuf, size_t uiBufSize) if ( bytesRead < 0 && errno == EINVAL ) { - CLog::Log(LOGERROR, "%s - Error( %"PRIdS", %d, %s ) - Retrying", __FUNCTION__, bytesRead, errno, strerror(errno)); + CLog::Log(LOGERROR, "%s - Error( %" PRIdS ", %d, %s ) - Retrying", __FUNCTION__, bytesRead, errno, strerror(errno)); bytesRead = smbc_read(m_fd, lpBuf, (int)uiBufSize); } if ( bytesRead < 0 ) - CLog::Log(LOGERROR, "%s - Error( %"PRIdS", %d, %s )", __FUNCTION__, bytesRead, errno, strerror(errno)); + CLog::Log(LOGERROR, "%s - Error( %" PRIdS ", %d, %s )", __FUNCTION__, bytesRead, errno, strerror(errno)); return bytesRead; } diff --git a/xbmc/filesystem/SpecialProtocol.cpp b/xbmc/filesystem/SpecialProtocol.cpp index 6ce42a0ba9..3e1ba022e9 100644 --- a/xbmc/filesystem/SpecialProtocol.cpp +++ b/xbmc/filesystem/SpecialProtocol.cpp @@ -29,6 +29,7 @@ #include "utils/URIUtils.h" #include "utils/StringUtils.h" +#include <cassert> #ifdef TARGET_POSIX #include <dirent.h> #endif diff --git a/xbmc/filesystem/VideoDatabaseDirectory.cpp b/xbmc/filesystem/VideoDatabaseDirectory.cpp index fb65f60dbc..ec15854608 100644 --- a/xbmc/filesystem/VideoDatabaseDirectory.cpp +++ b/xbmc/filesystem/VideoDatabaseDirectory.cpp @@ -48,7 +48,7 @@ bool CVideoDatabaseDirectory::GetDirectory(const CURL& url, CFileItemList &items { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(url); items.SetPath(path); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; @@ -72,7 +72,7 @@ bool CVideoDatabaseDirectory::GetDirectory(const CURL& url, CFileItemList &items NODE_TYPE CVideoDatabaseDirectory::GetDirectoryChildType(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(strPath); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return NODE_TYPE_NONE; @@ -83,7 +83,7 @@ NODE_TYPE CVideoDatabaseDirectory::GetDirectoryChildType(const std::string& strP NODE_TYPE CVideoDatabaseDirectory::GetDirectoryType(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(strPath); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return NODE_TYPE_NONE; @@ -94,7 +94,7 @@ NODE_TYPE CVideoDatabaseDirectory::GetDirectoryType(const std::string& strPath) NODE_TYPE CVideoDatabaseDirectory::GetDirectoryParentType(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(strPath); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return NODE_TYPE_NONE; @@ -110,7 +110,7 @@ NODE_TYPE CVideoDatabaseDirectory::GetDirectoryParentType(const std::string& str bool CVideoDatabaseDirectory::GetQueryParams(const std::string& strPath, CQueryParams& params) { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(strPath); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; @@ -143,7 +143,7 @@ bool CVideoDatabaseDirectory::GetLabel(const std::string& strDirectory, std::str strLabel = ""; std::string path = CLegacyPathTranslation::TranslateVideoDbPath(strDirectory); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get() || path.empty()) return false; @@ -304,7 +304,7 @@ bool CVideoDatabaseDirectory::ContainsMovies(const std::string &path) bool CVideoDatabaseDirectory::Exists(const CURL& url) { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(url); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; @@ -318,7 +318,7 @@ bool CVideoDatabaseDirectory::Exists(const CURL& url) bool CVideoDatabaseDirectory::CanCache(const std::string& strPath) { std::string path = CLegacyPathTranslation::TranslateVideoDbPath(strPath); - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(path)); if (!pNode.get()) return false; return pNode->CanCache(); diff --git a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp index 4b3d930f20..afcd11bfce 100644 --- a/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp +++ b/xbmc/filesystem/VideoDatabaseDirectory/DirectoryNode.cpp @@ -93,7 +93,7 @@ CDirectoryNode* CDirectoryNode::ParseURL(const std::string& strPath) // returns the database ids of the path, void CDirectoryNode::GetDatabaseInfo(const std::string& strPath, CQueryParams& params) { - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(strPath)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::ParseURL(strPath)); if (!pNode.get()) return; @@ -255,7 +255,7 @@ bool CDirectoryNode::GetChilds(CFileItemList& items) if (CanCache() && items.Load()) return true; - auto_ptr<CDirectoryNode> pNode(CDirectoryNode::CreateNode(GetChildType(), "", this)); + unique_ptr<CDirectoryNode> pNode(CDirectoryNode::CreateNode(GetChildType(), "", this)); bool bSuccess=false; if (pNode.get()) @@ -296,7 +296,7 @@ void CDirectoryNode::AddQueuingFolder(CFileItemList& items) const return; // hack - as the season node might return episodes - auto_ptr<CDirectoryNode> pNode(ParseURL(items.GetPath())); + unique_ptr<CDirectoryNode> pNode(ParseURL(items.GetPath())); switch (pNode->GetChildType()) { diff --git a/xbmc/filesystem/ZeroconfDirectory.cpp b/xbmc/filesystem/ZeroconfDirectory.cpp index c4789219d7..20f15de5c3 100644 --- a/xbmc/filesystem/ZeroconfDirectory.cpp +++ b/xbmc/filesystem/ZeroconfDirectory.cpp @@ -20,6 +20,7 @@ #include "ZeroconfDirectory.h" #include <stdexcept> +#include <cassert> #include "URL.h" #include "utils/URIUtils.h" diff --git a/xbmc/filesystem/iso9660.cpp b/xbmc/filesystem/iso9660.cpp index e3c9521f18..2b271e74fe 100644 --- a/xbmc/filesystem/iso9660.cpp +++ b/xbmc/filesystem/iso9660.cpp @@ -19,8 +19,10 @@ * */ +#include <algorithm> #include "system.h" #include "utils/log.h" +#include <stdlib.h> /* Redbook : CDDA diff --git a/xbmc/filesystem/win32/Win32Directory.cpp b/xbmc/filesystem/win32/Win32Directory.cpp index eb4c5aa395..377c5081cd 100644 --- a/xbmc/filesystem/win32/Win32Directory.cpp +++ b/xbmc/filesystem/win32/Win32Directory.cpp @@ -32,6 +32,8 @@ #endif // WIN32_LEAN_AND_MEAN #include <Windows.h> +#include <cassert> + using namespace XFILE; // check for empty string, remove trailing slash if any, convert to win32 form diff --git a/xbmc/filesystem/win32/Win32File.cpp b/xbmc/filesystem/win32/Win32File.cpp index 0c8b661bc8..11be7cdb6b 100644 --- a/xbmc/filesystem/win32/Win32File.cpp +++ b/xbmc/filesystem/win32/Win32File.cpp @@ -37,6 +37,7 @@ #include <intsafe.h> #include <wchar.h> #include <limits.h> +#include <cassert> using namespace XFILE; diff --git a/xbmc/filesystem/win32/Win32SMBDirectory.cpp b/xbmc/filesystem/win32/Win32SMBDirectory.cpp index e2000ef181..ed8cecdc1f 100644 --- a/xbmc/filesystem/win32/Win32SMBDirectory.cpp +++ b/xbmc/filesystem/win32/Win32SMBDirectory.cpp @@ -41,6 +41,8 @@ #include <lm.h> #pragma comment(lib, "Netapi32.lib") +#include <cassert> + using namespace XFILE; // local helper diff --git a/xbmc/filesystem/win32/Win32SMBFile.cpp b/xbmc/filesystem/win32/Win32SMBFile.cpp index b8f95d1b43..2282ce18e3 100644 --- a/xbmc/filesystem/win32/Win32SMBFile.cpp +++ b/xbmc/filesystem/win32/Win32SMBFile.cpp @@ -29,6 +29,7 @@ #endif // WIN32_LEAN_AND_MEAN #include <Windows.h> +#include <cassert> using namespace XFILE; diff --git a/xbmc/guilib/DDSImage.cpp b/xbmc/guilib/DDSImage.cpp index e9800a0e47..c5c3106eef 100644 --- a/xbmc/guilib/DDSImage.cpp +++ b/xbmc/guilib/DDSImage.cpp @@ -18,6 +18,7 @@ * */ +#include <algorithm> #include "DDSImage.h" #include "XBTF.h" #include <squish.h> diff --git a/xbmc/guilib/GUIBaseContainer.cpp b/xbmc/guilib/GUIBaseContainer.cpp index 8413d5c03e..651be06097 100644 --- a/xbmc/guilib/GUIBaseContainer.cpp +++ b/xbmc/guilib/GUIBaseContainer.cpp @@ -1227,7 +1227,7 @@ std::string CGUIBaseContainer::GetLabel(int info) const break; case CONTAINER_CURRENT_ITEM: { - if (m_items.size() && m_items[0]->IsFileItem() && (boost::static_pointer_cast<CFileItem>(m_items[0]))->IsParentFolder()) + if (m_items.size() && m_items[0]->IsFileItem() && (std::static_pointer_cast<CFileItem>(m_items[0]))->IsParentFolder()) label = StringUtils::Format("%i", GetSelectedItem()); else label = StringUtils::Format("%i", GetSelectedItem() + 1); @@ -1236,7 +1236,7 @@ std::string CGUIBaseContainer::GetLabel(int info) const case CONTAINER_NUM_ITEMS: { unsigned int numItems = GetNumItems(); - if (numItems && m_items[0]->IsFileItem() && (boost::static_pointer_cast<CFileItem>(m_items[0]))->IsParentFolder()) + if (numItems && m_items[0]->IsFileItem() && (std::static_pointer_cast<CFileItem>(m_items[0]))->IsParentFolder()) label = StringUtils::Format("%u", numItems-1); else label = StringUtils::Format("%u", numItems); diff --git a/xbmc/guilib/GUIControlGroup.cpp b/xbmc/guilib/GUIControlGroup.cpp index 5c8dd9fda8..69e9552df0 100644 --- a/xbmc/guilib/GUIControlGroup.cpp +++ b/xbmc/guilib/GUIControlGroup.cpp @@ -21,6 +21,8 @@ #include "GUIControlGroup.h" #include "GUIControlProfiler.h" +#include <cassert> + using namespace std; CGUIControlGroup::CGUIControlGroup() diff --git a/xbmc/guilib/GUIFontCache.cpp b/xbmc/guilib/GUIFontCache.cpp index 01a9303723..1359b2ba2c 100644 --- a/xbmc/guilib/GUIFontCache.cpp +++ b/xbmc/guilib/GUIFontCache.cpp @@ -23,6 +23,50 @@ #include "GUIFontTTF.h" #include "GraphicContext.h" +#include "boost/multi_index_container.hpp" +#include "boost/multi_index/sequenced_index.hpp" +#include "boost/multi_index/hashed_index.hpp" +#include "boost/multi_index/member.hpp" + +using namespace boost::multi_index; + +template<class Position, class Value> +class CGUIFontCacheImpl +{ + /* Empty structs used as tags to identify indexes */ + struct Age {}; + struct Hash {}; + + typedef multi_index_container < + CGUIFontCacheEntry<Position, Value>, + indexed_by< + sequenced<tag<Age> >, + hashed_unique<tag<Hash>, + member<CGUIFontCacheEntry<Position, Value>, + CGUIFontCacheKey<Position>, &CGUIFontCacheEntry<Position, Value>::m_key + >, + CGUIFontCacheHash<Position>, CGUIFontCacheKeysMatch < Position > + > + > + > EntryList; + + typedef typename EntryList::template index<Age>::type::iterator EntryAgeIterator; + typedef typename EntryList::template index<Hash>::type::iterator EntryHashIterator; + + EntryList m_list; + CGUIFontCache<Position, Value> *m_parent; + +public: + + CGUIFontCacheImpl(CGUIFontCache<Position, Value>* parent) : m_parent(parent) {} + Value &Lookup(Position &pos, + const vecColors &colors, const vecText &text, + uint32_t alignment, float maxPixelWidth, + bool scrolling, + unsigned int nowMillis, bool &dirtyCache); + void Flush(); +}; + template<class Position, class Value> void CGUIFontCacheEntry<Position, Value>::Reassign::operator()(CGUIFontCacheEntry<Position, Value> &entry) { @@ -49,18 +93,44 @@ CGUIFontCacheEntry<Position, Value>::~CGUIFontCacheEntry() } template<class Position, class Value> +CGUIFontCache<Position, Value>::CGUIFontCache(CGUIFontTTFBase &font) +: m_impl(new CGUIFontCacheImpl<Position, Value>(this)) +, m_font(font) +{ +} + +template<class Position, class Value> +CGUIFontCache<Position, Value>::~CGUIFontCache() +{ + delete m_impl; +} + +template<class Position, class Value> Value &CGUIFontCache<Position, Value>::Lookup(Position &pos, const vecColors &colors, const vecText &text, uint32_t alignment, float maxPixelWidth, bool scrolling, unsigned int nowMillis, bool &dirtyCache) { + if (m_impl == nullptr) + m_impl = new CGUIFontCacheImpl<Position, Value>(this); + + return m_impl->Lookup(pos, colors, text, alignment, maxPixelWidth, scrolling, nowMillis, dirtyCache); +} + +template<class Position, class Value> +Value &CGUIFontCacheImpl<Position, Value>::Lookup(Position &pos, + const vecColors &colors, const vecText &text, + uint32_t alignment, float maxPixelWidth, + bool scrolling, + unsigned int nowMillis, bool &dirtyCache) +{ const CGUIFontCacheKey<Position> key(pos, const_cast<vecColors &>(colors), const_cast<vecText &>(text), alignment, maxPixelWidth, scrolling, g_graphicsContext.GetGUIMatrix(), g_graphicsContext.GetGUIScaleX(), g_graphicsContext.GetGUIScaleY()); - EntryHashIterator i = m_list.template get<Hash>().find(key); + auto i = m_list.template get<Hash>().find(key); if (i == m_list.template get<Hash>().end()) { /* Cache miss */ @@ -76,7 +146,7 @@ Value &CGUIFontCache<Position, Value>::Lookup(Position &pos, /* We need a new entry instead */ /* Yes, this causes the creation an destruction of a temporary entry, but * this code ought to only be used infrequently, when the cache needs to grow */ - m_list.template get<Age>().push_back(CGUIFontCacheEntry<Position, Value>(*this, key, nowMillis)); + m_list.template get<Age>().push_back(CGUIFontCacheEntry<Position, Value>(*m_parent, key, nowMillis)); } dirtyCache = true; return (--m_list.template get<Age>().end())->m_value; @@ -98,14 +168,24 @@ Value &CGUIFontCache<Position, Value>::Lookup(Position &pos, template<class Position, class Value> void CGUIFontCache<Position, Value>::Flush() { + m_impl->Flush(); +} + +template<class Position, class Value> +void CGUIFontCacheImpl<Position, Value>::Flush() +{ m_list.template get<Age>().clear(); } +template CGUIFontCache<CGUIFontCacheStaticPosition, CGUIFontCacheStaticValue>::CGUIFontCache(CGUIFontTTFBase &font); +template CGUIFontCache<CGUIFontCacheStaticPosition, CGUIFontCacheStaticValue>::~CGUIFontCache(); template void CGUIFontCacheEntry<CGUIFontCacheStaticPosition, CGUIFontCacheStaticValue>::Reassign::operator()(CGUIFontCacheEntry<CGUIFontCacheStaticPosition, CGUIFontCacheStaticValue> &entry); template CGUIFontCacheEntry<CGUIFontCacheStaticPosition, CGUIFontCacheStaticValue>::~CGUIFontCacheEntry(); template CGUIFontCacheStaticValue &CGUIFontCache<CGUIFontCacheStaticPosition, CGUIFontCacheStaticValue>::Lookup(CGUIFontCacheStaticPosition &, const vecColors &, const vecText &, uint32_t, float, bool, unsigned int, bool &); template void CGUIFontCache<CGUIFontCacheStaticPosition, CGUIFontCacheStaticValue>::Flush(); +template CGUIFontCache<CGUIFontCacheDynamicPosition, CGUIFontCacheDynamicValue>::CGUIFontCache(CGUIFontTTFBase &font); +template CGUIFontCache<CGUIFontCacheDynamicPosition, CGUIFontCacheDynamicValue>::~CGUIFontCache(); template void CGUIFontCacheEntry<CGUIFontCacheDynamicPosition, CGUIFontCacheDynamicValue>::Reassign::operator()(CGUIFontCacheEntry<CGUIFontCacheDynamicPosition, CGUIFontCacheDynamicValue> &entry); template CGUIFontCacheEntry<CGUIFontCacheDynamicPosition, CGUIFontCacheDynamicValue>::~CGUIFontCacheEntry(); template CGUIFontCacheDynamicValue &CGUIFontCache<CGUIFontCacheDynamicPosition, CGUIFontCacheDynamicValue>::Lookup(CGUIFontCacheDynamicPosition &, const vecColors &, const vecText &, uint32_t, float, bool, unsigned int, bool &); diff --git a/xbmc/guilib/GUIFontCache.h b/xbmc/guilib/GUIFontCache.h index 575ee7d272..feb1fd3988 100644 --- a/xbmc/guilib/GUIFontCache.h +++ b/xbmc/guilib/GUIFontCache.h @@ -33,23 +33,20 @@ #include <algorithm> #include <vector> - -#include "boost/multi_index_container.hpp" -#include "boost/multi_index/sequenced_index.hpp" -#include "boost/multi_index/hashed_index.hpp" -#include "boost/multi_index/member.hpp" -#include "boost/shared_ptr.hpp" +#include <memory> +#include <cassert> #include "TransformMatrix.h" -using namespace boost::multi_index; - #define FONT_CACHE_TIME_LIMIT (1000) #define FONT_CACHE_DIST_LIMIT (0.01) template<class Position, class Value> class CGUIFontCache; class CGUIFontTTFBase; +template<class Position, class Value> +class CGUIFontCacheImpl; + template<class Position> struct CGUIFontCacheKey { @@ -162,30 +159,20 @@ struct CGUIFontCacheKeysMatch } }; + + template<class Position, class Value> class CGUIFontCache { - /* Empty structs used as tags to identify indexes */ - struct Age {}; - struct Hash {}; - - typedef multi_index_container< - CGUIFontCacheEntry<Position, Value>, - indexed_by< - sequenced<tag<Age> >, - hashed_unique<tag<Hash>, member<CGUIFontCacheEntry<Position, Value>, CGUIFontCacheKey<Position>, &CGUIFontCacheEntry<Position, Value>::m_key>, CGUIFontCacheHash<Position>, CGUIFontCacheKeysMatch<Position> > - > - > EntryList; - - typedef typename EntryList::template index<Age>::type::iterator EntryAgeIterator; - typedef typename EntryList::template index<Hash>::type::iterator EntryHashIterator; - - EntryList m_list; + CGUIFontCacheImpl<Position, Value>* m_impl; public: const CGUIFontTTFBase &m_font; - CGUIFontCache(CGUIFontTTFBase &font) : m_font(font) {} + CGUIFontCache(CGUIFontTTFBase &font); + + ~CGUIFontCache(); + Value &Lookup(Position &pos, const vecColors &colors, const vecText &text, uint32_t alignment, float maxPixelWidth, @@ -202,7 +189,7 @@ struct CGUIFontCacheStaticPosition void UpdateWithOffsets(const CGUIFontCacheStaticPosition &cached, bool scrolling) {} }; -struct CGUIFontCacheStaticValue : public boost::shared_ptr<std::vector<SVertex> > +struct CGUIFontCacheStaticValue : public std::shared_ptr<std::vector<SVertex> > { void clear() { diff --git a/xbmc/guilib/GUIFontTTF.cpp b/xbmc/guilib/GUIFontTTF.cpp index a16d3db162..e30367de6d 100644 --- a/xbmc/guilib/GUIFontTTF.cpp +++ b/xbmc/guilib/GUIFontTTF.cpp @@ -30,9 +30,9 @@ #include "URL.h" #include "filesystem/File.h" #include "threads/SystemClock.h" -#include "boost/make_shared.hpp" #include <math.h> +#include <memory> // stuff for freetype #include <ft2build.h> @@ -375,10 +375,10 @@ void CGUIFontTTFBase::DrawTextInternal(float x, float y, const vecColors &colors XbmcThreads::SystemClockMillis(), dirtyCache) : unusedVertexBuffer; - boost::shared_ptr<std::vector<SVertex> > tempVertices = boost::make_shared<std::vector<SVertex> >(); - boost::shared_ptr<std::vector<SVertex> > &vertices = hardwareClipping ? + std::shared_ptr<std::vector<SVertex> > tempVertices = std::make_shared<std::vector<SVertex> >(); + std::shared_ptr<std::vector<SVertex> > &vertices = hardwareClipping ? tempVertices : - static_cast<boost::shared_ptr<std::vector<SVertex> >&>(m_staticCache.Lookup(staticPos, + static_cast<std::shared_ptr<std::vector<SVertex> >&>(m_staticCache.Lookup(staticPos, colors, text, alignment, maxPixelWidth, scrolling, diff --git a/xbmc/guilib/GUIImage.cpp b/xbmc/guilib/GUIImage.cpp index 8438135f7f..f57a86337d 100644 --- a/xbmc/guilib/GUIImage.cpp +++ b/xbmc/guilib/GUIImage.cpp @@ -23,6 +23,8 @@ #include "utils/log.h" #include "utils/TimeUtils.h" +#include <cassert> + using namespace std; CGUIImage::CGUIImage(int parentID, int controlID, float posX, float posY, float width, float height, const CTextureInfo& texture) diff --git a/xbmc/guilib/GUIMessage.h b/xbmc/guilib/GUIMessage.h index 2198da6f5c..6dbbb02e88 100644 --- a/xbmc/guilib/GUIMessage.h +++ b/xbmc/guilib/GUIMessage.h @@ -327,10 +327,10 @@ do { \ #include <string> #include <vector> -#include <boost/shared_ptr.hpp> +#include <memory> // forwards -class CGUIListItem; typedef boost::shared_ptr<CGUIListItem> CGUIListItemPtr; +class CGUIListItem; typedef std::shared_ptr<CGUIListItem> CGUIListItemPtr; class CFileItemList; /*! diff --git a/xbmc/guilib/GUIPanelContainer.cpp b/xbmc/guilib/GUIPanelContainer.cpp index 3de3997b23..042c8d492b 100644 --- a/xbmc/guilib/GUIPanelContainer.cpp +++ b/xbmc/guilib/GUIPanelContainer.cpp @@ -23,6 +23,8 @@ #include "GUIInfoManager.h" #include "Key.h" +#include <cassert> + using namespace std; CGUIPanelContainer::CGUIPanelContainer(int parentID, int controlID, float posX, float posY, float width, float height, ORIENTATION orientation, const CScroller& scroller, int preloadItems) diff --git a/xbmc/guilib/GUIStaticItem.h b/xbmc/guilib/GUIStaticItem.h index 207bdb7144..57cf5f9194 100644 --- a/xbmc/guilib/GUIStaticItem.h +++ b/xbmc/guilib/GUIStaticItem.h @@ -94,4 +94,4 @@ private: CGUIAction m_clickActions; }; -typedef boost::shared_ptr<CGUIStaticItem> CGUIStaticItemPtr; +typedef std::shared_ptr<CGUIStaticItem> CGUIStaticItemPtr; diff --git a/xbmc/guilib/GUITextureGLES.cpp b/xbmc/guilib/GUITextureGLES.cpp index 7bc8a1d175..03ac9dc004 100644 --- a/xbmc/guilib/GUITextureGLES.cpp +++ b/xbmc/guilib/GUITextureGLES.cpp @@ -29,6 +29,8 @@ #include "windowing/WindowingFactory.h" #include "guilib/GraphicContext.h" +#include <cstddef> + #if defined(HAS_GLES) diff --git a/xbmc/guilib/GUIVisualisationControl.cpp b/xbmc/guilib/GUIVisualisationControl.cpp index c09284d96e..bcac34456a 100644 --- a/xbmc/guilib/GUIVisualisationControl.cpp +++ b/xbmc/guilib/GUIVisualisationControl.cpp @@ -104,7 +104,7 @@ void CGUIVisualisationControl::Process(unsigned int currentTime, CDirtyRegionLis AddonPtr addon; if (ADDON::CAddonMgr::Get().GetDefault(ADDON_VIZ, addon)) { - m_addon = boost::dynamic_pointer_cast<CVisualisation>(addon); + m_addon = std::dynamic_pointer_cast<CVisualisation>(addon); if (m_addon) if (!InitCallback(m_addon.get())) m_addon.reset(); diff --git a/xbmc/guilib/GUIWindow.h b/xbmc/guilib/GUIWindow.h index 2f4137e747..f3b96b3a2e 100644 --- a/xbmc/guilib/GUIWindow.h +++ b/xbmc/guilib/GUIWindow.h @@ -29,10 +29,10 @@ */ #include "GUIControlGroup.h" -#include "boost/shared_ptr.hpp" +#include <memory> #include "threads/CriticalSection.h" -class CFileItem; typedef boost::shared_ptr<CFileItem> CFileItemPtr; +class CFileItem; typedef std::shared_ptr<CFileItem> CFileItemPtr; #include "GUICallback.h" // for GUIEvent diff --git a/xbmc/guilib/IGUIContainer.h b/xbmc/guilib/IGUIContainer.h index 9e36ffa9bf..61a0bd6099 100644 --- a/xbmc/guilib/IGUIContainer.h +++ b/xbmc/guilib/IGUIContainer.h @@ -21,9 +21,9 @@ #pragma once #include "GUIControl.h" -#include "boost/shared_ptr.hpp" +#include <memory> -typedef boost::shared_ptr<CGUIListItem> CGUIListItemPtr; +typedef std::shared_ptr<CGUIListItem> CGUIListItemPtr; /*! \ingroup controls diff --git a/xbmc/guilib/TransformMatrix.h b/xbmc/guilib/TransformMatrix.h index bb5e8d7355..bf1650cb14 100644 --- a/xbmc/guilib/TransformMatrix.h +++ b/xbmc/guilib/TransformMatrix.h @@ -24,6 +24,7 @@ #include <memory> #include <string.h> #include <stdint.h> +#include <algorithm> #ifdef __GNUC__ // under gcc, inline will only take place if optimizations are applied (-O). this will force inline even whith optimizations. diff --git a/xbmc/guilib/VisibleEffect.cpp b/xbmc/guilib/VisibleEffect.cpp index a8fb55773a..89b98387a8 100644 --- a/xbmc/guilib/VisibleEffect.cpp +++ b/xbmc/guilib/VisibleEffect.cpp @@ -49,7 +49,7 @@ CAnimEffect::CAnimEffect(unsigned int delay, unsigned int length, EFFECT_TYPE ef m_delay = delay; m_length = length; m_effect = effect; - m_pTweener = boost::shared_ptr<Tweener>(new LinearTweener()); + m_pTweener = std::shared_ptr<Tweener>(new LinearTweener()); } CAnimEffect::~CAnimEffect() @@ -96,28 +96,28 @@ void CAnimEffect::ApplyState(ANIMATION_STATE state, const CPoint ¢er) ApplyEffect(offset, center); } -boost::shared_ptr<Tweener> CAnimEffect::GetTweener(const TiXmlElement *pAnimationNode) +std::shared_ptr<Tweener> CAnimEffect::GetTweener(const TiXmlElement *pAnimationNode) { - boost::shared_ptr<Tweener> m_pTweener; + std::shared_ptr<Tweener> m_pTweener; const char *tween = pAnimationNode->Attribute("tween"); if (tween) { if (strcmpi(tween, "linear")==0) - m_pTweener = boost::shared_ptr<Tweener>(new LinearTweener()); + m_pTweener = std::shared_ptr<Tweener>(new LinearTweener()); else if (strcmpi(tween, "quadratic")==0) - m_pTweener = boost::shared_ptr<Tweener>(new QuadTweener()); + m_pTweener = std::shared_ptr<Tweener>(new QuadTweener()); else if (strcmpi(tween, "cubic")==0) - m_pTweener = boost::shared_ptr<Tweener>(new CubicTweener()); + m_pTweener = std::shared_ptr<Tweener>(new CubicTweener()); else if (strcmpi(tween, "sine")==0) - m_pTweener = boost::shared_ptr<Tweener>(new SineTweener()); + m_pTweener = std::shared_ptr<Tweener>(new SineTweener()); else if (strcmpi(tween, "back")==0) - m_pTweener = boost::shared_ptr<Tweener>(new BackTweener()); + m_pTweener = std::shared_ptr<Tweener>(new BackTweener()); else if (strcmpi(tween, "circle")==0) - m_pTweener = boost::shared_ptr<Tweener>(new CircleTweener()); + m_pTweener = std::shared_ptr<Tweener>(new CircleTweener()); else if (strcmpi(tween, "bounce")==0) - m_pTweener = boost::shared_ptr<Tweener>(new BounceTweener()); + m_pTweener = std::shared_ptr<Tweener>(new BounceTweener()); else if (strcmpi(tween, "elastic")==0) - m_pTweener = boost::shared_ptr<Tweener>(new ElasticTweener()); + m_pTweener = std::shared_ptr<Tweener>(new ElasticTweener()); const char *easing = pAnimationNode->Attribute("easing"); if (m_pTweener && easing) @@ -139,11 +139,11 @@ boost::shared_ptr<Tweener> CAnimEffect::GetTweener(const TiXmlElement *pAnimatio // or quadratic if we have acceleration if (accel) { - m_pTweener = boost::shared_ptr<Tweener>(new QuadTweener(accel)); + m_pTweener = std::shared_ptr<Tweener>(new QuadTweener(accel)); m_pTweener->SetEasing(EASE_IN); } else - m_pTweener = boost::shared_ptr<Tweener>(new LinearTweener()); + m_pTweener = std::shared_ptr<Tweener>(new LinearTweener()); } return m_pTweener; @@ -701,7 +701,7 @@ void CAnimation::AddEffect(const std::string &type, const TiXmlElement *node, co m_effects.push_back(effect); } -CScroller::CScroller(unsigned int duration /* = 200 */, boost::shared_ptr<Tweener> tweener /* = NULL */) +CScroller::CScroller(unsigned int duration /* = 200 */, std::shared_ptr<Tweener> tweener /* = NULL */) { m_scrollValue = 0; m_delta = 0; diff --git a/xbmc/guilib/VisibleEffect.h b/xbmc/guilib/VisibleEffect.h index 22e781228d..0041160cfd 100644 --- a/xbmc/guilib/VisibleEffect.h +++ b/xbmc/guilib/VisibleEffect.h @@ -31,7 +31,7 @@ class CGUIListItem; #include "TransformMatrix.h" // needed for the TransformMatrix member #include "Geometry.h" // for CPoint, CRect -#include "boost/shared_ptr.hpp" +#include <memory> #include "interfaces/info/InfoBool.h" #include <string> @@ -69,7 +69,7 @@ public: const TransformMatrix &GetTransform() const { return m_matrix; }; EFFECT_TYPE GetType() const { return m_effect; }; - static boost::shared_ptr<Tweener> GetTweener(const TiXmlElement *pAnimationNode); + static std::shared_ptr<Tweener> GetTweener(const TiXmlElement *pAnimationNode); protected: TransformMatrix m_matrix; EFFECT_TYPE m_effect; @@ -81,7 +81,7 @@ private: unsigned int m_length; unsigned int m_delay; - boost::shared_ptr<Tweener> m_pTweener; + std::shared_ptr<Tweener> m_pTweener; }; class CFadeEffect : public CAnimEffect @@ -216,7 +216,7 @@ private: class CScroller { public: - CScroller(unsigned int duration = 200, boost::shared_ptr<Tweener> tweener = boost::shared_ptr<Tweener>()); + CScroller(unsigned int duration = 200, std::shared_ptr<Tweener> tweener = std::shared_ptr<Tweener>()); CScroller(const CScroller& right); CScroller& operator=(const CScroller &src); ~CScroller(); @@ -260,5 +260,5 @@ private: unsigned int m_lastTime; //!< Brief last remember time (updated each time Scroll() method is called) unsigned int m_duration; //!< Brief duration of scroll - boost::shared_ptr<Tweener> m_pTweener; + std::shared_ptr<Tweener> m_pTweener; }; diff --git a/xbmc/input/ButtonTranslator.cpp b/xbmc/input/ButtonTranslator.cpp index cbaee9f541..f3e2ad2103 100644 --- a/xbmc/input/ButtonTranslator.cpp +++ b/xbmc/input/ButtonTranslator.cpp @@ -36,7 +36,8 @@ #include "utils/RegExp.h" #include "XBIRRemote.h" #include "Util.h" -#include <boost/shared_ptr.hpp> + +#include <algorithm> #if defined(TARGET_WINDOWS) #include "input/windows/WINJoystick.h" @@ -775,7 +776,7 @@ void CButtonTranslator::MapJoystickFamily(TiXmlNode *pNode) { TiXmlNode* pName = pMember->FirstChild(); if (pName && pName->ValueStr() != "") { - boost::shared_ptr<CRegExp> re(new CRegExp(true, CRegExp::asciiOnly)); + std::shared_ptr<CRegExp> re(new CRegExp(true, CRegExp::asciiOnly)); std::string joyRe = JoynameToRegex(pName->ValueStr()); if (!re->RegComp(joyRe, CRegExp::StudyRegExp)) { @@ -809,7 +810,7 @@ void CButtonTranslator::MapJoystickActions(int windowID, TiXmlNode *pJoystick) joyFamilyName = joyName; JoystickFamily* joyFamily = &m_joystickFamilies[joyFamilyName]; - boost::shared_ptr<CRegExp> re(new CRegExp(true, CRegExp::asciiOnly)); + std::shared_ptr<CRegExp> re(new CRegExp(true, CRegExp::asciiOnly)); std::string joyRe = JoynameToRegex(joyname); if (!re->RegComp(joyRe, CRegExp::StudyRegExp)) { @@ -824,7 +825,7 @@ void CButtonTranslator::MapJoystickActions(int windowID, TiXmlNode *pJoystick) const std::string &type = pNode->ValueStr(); if (type == "altname") { std::string altName = pNode->FirstChild()->ValueStr(); - boost::shared_ptr<CRegExp> altRe(new CRegExp(true, CRegExp::asciiOnly)); + std::shared_ptr<CRegExp> altRe(new CRegExp(true, CRegExp::asciiOnly)); std::string altReStr = JoynameToRegex(altName); if (!altRe->RegComp(altReStr, CRegExp::StudyRegExp)) CLog::Log(LOGNOTICE, "Ignoring invalid joystick altname regex: '%s'", altReStr.c_str()); @@ -938,7 +939,7 @@ std::string CButtonTranslator::JoynameToRegex(const std::string& joyName) const return "\\Q" + joyName + "\\E"; } -bool CButtonTranslator::AddFamilyRegex(JoystickFamily* family, boost::shared_ptr<CRegExp> regex) +bool CButtonTranslator::AddFamilyRegex(JoystickFamily* family, std::shared_ptr<CRegExp> regex) { // even though family is a set, this does not prevent the same regex // from being added twice, so we manually match on pattern equality diff --git a/xbmc/input/ButtonTranslator.h b/xbmc/input/ButtonTranslator.h index 3bd47abc0e..97cafc41d0 100644 --- a/xbmc/input/ButtonTranslator.h +++ b/xbmc/input/ButtonTranslator.h @@ -27,6 +27,7 @@ #include <string> #include <vector> #include <set> +#include <memory> #include "system.h" // for HAS_EVENT_SERVER, HAS_SDL_JOYSTICK #ifdef HAS_EVENT_SERVER @@ -39,7 +40,6 @@ class TiXmlNode; struct AxisConfig; class CRegExp; typedef std::vector<AxisConfig> AxesConfig; // [<axis, isTrigger, rest state value>] -namespace boost { template <typename T> class shared_ptr; } struct CButtonAction { @@ -116,7 +116,7 @@ private: int GetActionCode(int window, int action); int GetActionCode(int window, const CKey &key, std::string &strAction) const; #if defined(HAS_SDL_JOYSTICK) || defined(HAS_EVENT_SERVER) - typedef std::set<boost::shared_ptr<CRegExp> > JoystickFamily; + typedef std::set<std::shared_ptr<CRegExp> > JoystickFamily; typedef std::map<std::string, JoystickFamily> JoystickFamilyMap; typedef std::map<int, std::string> ActionMap; // <button/axis, action> typedef std::map<int, ActionMap > WindowMap; // <window, actionMap> @@ -152,8 +152,8 @@ private: void MapJoystickFamily(TiXmlNode *pFamily); void MapJoystickActions(int windowID, TiXmlNode *pJoystick); std::string JoynameToRegex(const std::string& joyName) const; - bool AddFamilyRegex(JoystickFamily* family, boost::shared_ptr<CRegExp> regex); - void MergeMap(boost::shared_ptr<CRegExp> joyName, JoystickMap *joystick, int windowID, const ActionMap &actionMap); + bool AddFamilyRegex(JoystickFamily* family, std::shared_ptr<CRegExp> regex); + void MergeMap(std::shared_ptr<CRegExp> joyName, JoystickMap *joystick, int windowID, const ActionMap &actionMap); JoystickMap::const_iterator FindWindowMap(const std::string& joyName, const JoystickMap &maps) const; JoystickFamilyMap::const_iterator FindJoystickFamily(const std::string& joyName) const; JoystickFamilyMap m_joystickFamilies; diff --git a/xbmc/input/KeyboardLayout.cpp b/xbmc/input/KeyboardLayout.cpp index b930e65cf4..511c676b0e 100644 --- a/xbmc/input/KeyboardLayout.cpp +++ b/xbmc/input/KeyboardLayout.cpp @@ -24,6 +24,7 @@ #include "utils/StringUtils.h" #include "utils/XBMCTinyXML.h" #include <set> +#include <algorithm> #define KEYBOARD_LAYOUTS_XML "special://xbmc/system/keyboardlayouts.xml" diff --git a/xbmc/input/SDLJoystick.cpp b/xbmc/input/SDLJoystick.cpp index 9ccc78403c..306bc93356 100644 --- a/xbmc/input/SDLJoystick.cpp +++ b/xbmc/input/SDLJoystick.cpp @@ -29,7 +29,6 @@ #include "utils/RegExp.h" #include <math.h> -#include <boost/shared_ptr.hpp> #ifdef HAS_SDL_JOYSTICK #include <SDL2/SDL.h> diff --git a/xbmc/input/SDLJoystick.h b/xbmc/input/SDLJoystick.h index 17b479ff65..ee8488434d 100644 --- a/xbmc/input/SDLJoystick.h +++ b/xbmc/input/SDLJoystick.h @@ -26,6 +26,7 @@ #include <vector> #include <string> #include <map> +#include <memory> #define JACTIVE_BUTTON 0x00000001 #define JACTIVE_AXIS 0x00000002 @@ -62,7 +63,6 @@ struct AxisState { }; class CRegExp; -namespace boost { template <typename T> class shared_ptr; } // Class to manage all connected joysticks // Note: 'index' always refers to indices specific to this class, diff --git a/xbmc/input/windows/WINJoystick.cpp b/xbmc/input/windows/WINJoystick.cpp index e83b386bbe..7870c4cab9 100644 --- a/xbmc/input/windows/WINJoystick.cpp +++ b/xbmc/input/windows/WINJoystick.cpp @@ -27,7 +27,7 @@ #include "utils/RegExp.h" #include <math.h> -#include <boost/shared_ptr.hpp> +#include <memory> #include <dinput.h> #include <dinputd.h> diff --git a/xbmc/input/windows/WINJoystick.h b/xbmc/input/windows/WINJoystick.h index 1f6fcf2dde..dec177ac8e 100644 --- a/xbmc/input/windows/WINJoystick.h +++ b/xbmc/input/windows/WINJoystick.h @@ -22,6 +22,7 @@ #include <vector> #include <string> #include <map> +#include <memory> #include <stdint.h> #include "settings/lib/ISettingCallback.h" #include "threads/CriticalSection.h" @@ -52,7 +53,6 @@ struct AxisConfig { typedef std::vector<AxisConfig> AxesConfig; // [<axis, isTrigger, rest state value>] class CRegExp; -namespace boost { template <typename T> class shared_ptr; } // Class to manage all connected joysticks class CJoystick : public ISettingCallback diff --git a/xbmc/interfaces/Builtins.cpp b/xbmc/interfaces/Builtins.cpp index 339272d441..399460875a 100644 --- a/xbmc/interfaces/Builtins.cpp +++ b/xbmc/interfaces/Builtins.cpp @@ -624,7 +624,7 @@ int CBuiltins::Execute(const std::string& execString) AddonPtr addon; if (CAddonMgr::Get().GetAddon(params[0], addon, ADDON_PLUGIN)) { - PluginPtr plugin = boost::dynamic_pointer_cast<CPluginSource>(addon); + PluginPtr plugin = std::dynamic_pointer_cast<CPluginSource>(addon); std::string addonid = params[0]; std::string urlParameters; vector<string> parameters; @@ -761,7 +761,7 @@ int CBuiltins::Execute(const std::string& execString) break; } - auto_ptr<CGUIViewState> state(CGUIViewState::GetViewState(containsVideo ? WINDOW_VIDEO_NAV : WINDOW_MUSIC, items)); + unique_ptr<CGUIViewState> state(CGUIViewState::GetViewState(containsVideo ? WINDOW_VIDEO_NAV : WINDOW_MUSIC, items)); if (state.get()) items.Sort(state->GetSortMethod()); else diff --git a/xbmc/interfaces/generic/ScriptInvocationManager.h b/xbmc/interfaces/generic/ScriptInvocationManager.h index 4668bb3bae..1cbfbeb209 100644 --- a/xbmc/interfaces/generic/ScriptInvocationManager.h +++ b/xbmc/interfaces/generic/ScriptInvocationManager.h @@ -21,7 +21,7 @@ #include <map> #include <set> -#include <boost/shared_ptr.hpp> +#include <memory> #include "addons/IAddon.h" #include "threads/CriticalSection.h" @@ -29,7 +29,7 @@ class ILanguageInvocationHandler; class ILanguageInvoker; class CLanguageInvokerThread; -typedef boost::shared_ptr<CLanguageInvokerThread> CLanguageInvokerThreadPtr; +typedef std::shared_ptr<CLanguageInvokerThread> CLanguageInvokerThreadPtr; class CScriptInvocationManager { diff --git a/xbmc/interfaces/info/InfoBool.h b/xbmc/interfaces/info/InfoBool.h index a60e1678f4..1a6f9344ea 100644 --- a/xbmc/interfaces/info/InfoBool.h +++ b/xbmc/interfaces/info/InfoBool.h @@ -21,7 +21,7 @@ #pragma once #include <string> -#include "boost/shared_ptr.hpp" +#include <memory> class CGUIListItem; @@ -84,5 +84,5 @@ private: bool m_dirty; ///< whether we need an update }; -typedef boost::shared_ptr<InfoBool> InfoPtr; +typedef std::shared_ptr<InfoBool> InfoPtr; }; diff --git a/xbmc/interfaces/info/InfoExpression.cpp b/xbmc/interfaces/info/InfoExpression.cpp index f75eca89f3..da6fefdfc8 100644 --- a/xbmc/interfaces/info/InfoExpression.cpp +++ b/xbmc/interfaces/info/InfoExpression.cpp @@ -23,9 +23,7 @@ #include "utils/log.h" #include "GUIInfoManager.h" #include <list> -#include <boost/shared_ptr.hpp> -#include <boost/make_shared.hpp> -#include <boost/pointer_cast.hpp> +#include <memory> using namespace std; using namespace INFO; @@ -47,7 +45,7 @@ InfoExpression::InfoExpression(const std::string &expression, int context) if (!Parse(expression)) { CLog::Log(LOGERROR, "Error parsing boolean expression %s", expression.c_str()); - m_expression_tree = boost::make_shared<InfoLeaf>(g_infoManager.Register("false", 0), false); + m_expression_tree = std::make_shared<InfoLeaf>(g_infoManager.Register("false", 0), false); } } @@ -94,7 +92,7 @@ void InfoExpression::InfoAssociativeGroup::AddChild(const InfoSubexpressionPtr & m_children.push_front(child); // largely undoes the effect of parsing right-associative } -void InfoExpression::InfoAssociativeGroup::Merge(boost::shared_ptr<InfoAssociativeGroup> other) +void InfoExpression::InfoAssociativeGroup::Merge(std::shared_ptr<InfoAssociativeGroup> other) { m_children.splice(m_children.end(), other->m_children); } @@ -175,7 +173,7 @@ void InfoExpression::OperatorPop(std::stack<operator_t> &operator_stack, bool &i * / \ / \ leaf leaf leaf leaf * leaf leaf leaf leaf */ - boost::static_pointer_cast<InfoAssociativeGroup>(left)->Merge(boost::static_pointer_cast<InfoAssociativeGroup>(right)); + std::static_pointer_cast<InfoAssociativeGroup>(left)->Merge(std::static_pointer_cast<InfoAssociativeGroup>(right)); else if (left_type == new_type) /* For example: AND AND * / \ / | \ @@ -183,7 +181,7 @@ void InfoExpression::OperatorPop(std::stack<operator_t> &operator_stack, bool &i * / \ / \ / \ * leaf leaf leaf leaf leaf leaf */ - boost::static_pointer_cast<InfoAssociativeGroup>(left)->AddChild(right); + std::static_pointer_cast<InfoAssociativeGroup>(left)->AddChild(right); else { nodes.pop(); @@ -195,7 +193,7 @@ void InfoExpression::OperatorPop(std::stack<operator_t> &operator_stack, bool &i * / \ / \ / \ * leaf leaf leaf leaf leaf leaf */ - boost::static_pointer_cast<InfoAssociativeGroup>(right)->AddChild(left); + std::static_pointer_cast<InfoAssociativeGroup>(right)->AddChild(left); nodes.push(right); } else @@ -205,7 +203,7 @@ void InfoExpression::OperatorPop(std::stack<operator_t> &operator_stack, bool &i * / \ / \ as children * leaf leaf leaf leaf */ - nodes.push(boost::make_shared<InfoAssociativeGroup>(new_type, left, right)); + nodes.push(std::make_shared<InfoAssociativeGroup>(new_type, left, right)); } } } @@ -253,7 +251,7 @@ bool InfoExpression::Parse(const std::string &expression) } /* Propagate any listItem dependency from the operand to the expression */ m_listItemDependent |= info->ListItemDependent(); - nodes.push(boost::make_shared<InfoLeaf>(info, invert)); + nodes.push(std::make_shared<InfoLeaf>(info, invert)); /* Reuse operand string for next operand */ operand.clear(); } @@ -304,7 +302,7 @@ bool InfoExpression::Parse(const std::string &expression) } /* Propagate any listItem dependency from the operand to the expression */ m_listItemDependent |= info->ListItemDependent(); - nodes.push(boost::make_shared<InfoLeaf>(info, invert)); + nodes.push(std::make_shared<InfoLeaf>(info, invert)); } while (!operator_stack.empty()) OperatorPop(operator_stack, invert, nodes); diff --git a/xbmc/interfaces/info/InfoExpression.h b/xbmc/interfaces/info/InfoExpression.h index 70f23d3d44..8e35ca39a2 100644 --- a/xbmc/interfaces/info/InfoExpression.h +++ b/xbmc/interfaces/info/InfoExpression.h @@ -78,7 +78,7 @@ private: virtual node_type_t Type() const=0; }; - typedef boost::shared_ptr<InfoSubexpression> InfoSubexpressionPtr; + typedef std::shared_ptr<InfoSubexpression> InfoSubexpressionPtr; // A leaf node in the expression tree class InfoLeaf : public InfoSubexpression @@ -98,7 +98,7 @@ private: public: InfoAssociativeGroup(node_type_t type, const InfoSubexpressionPtr &left, const InfoSubexpressionPtr &right); void AddChild(const InfoSubexpressionPtr &child); - void Merge(boost::shared_ptr<InfoAssociativeGroup> other); + void Merge(std::shared_ptr<InfoAssociativeGroup> other); virtual bool Evaluate(const CGUIListItem *item); virtual node_type_t Type() const { return m_type; }; private: diff --git a/xbmc/interfaces/json-rpc/AddonsOperations.cpp b/xbmc/interfaces/json-rpc/AddonsOperations.cpp index bb3b0cea43..390351f6b7 100644 --- a/xbmc/interfaces/json-rpc/AddonsOperations.cpp +++ b/xbmc/interfaces/json-rpc/AddonsOperations.cpp @@ -106,7 +106,7 @@ JSONRPC_STATUS CAddonsOperations::GetAddons(const std::string &method, ITranspor { PluginPtr plugin; if (content != CPluginSource::UNKNOWN) - plugin = boost::dynamic_pointer_cast<CPluginSource>(addons.at(index)); + plugin = std::dynamic_pointer_cast<CPluginSource>(addons.at(index)); if ((addons.at(index)->Type() <= ADDON_UNKNOWN || addons.at(index)->Type() >= ADDON_MAX) || ((content != CPluginSource::UNKNOWN && plugin == NULL) || (plugin != NULL && !plugin->Provides(content)))) diff --git a/xbmc/interfaces/json-rpc/JSONServiceDescription.h b/xbmc/interfaces/json-rpc/JSONServiceDescription.h index b8e895c74c..c033fccf4e 100644 --- a/xbmc/interfaces/json-rpc/JSONServiceDescription.h +++ b/xbmc/interfaces/json-rpc/JSONServiceDescription.h @@ -22,14 +22,14 @@ #include <string> #include <vector> #include <limits> -#include <boost/shared_ptr.hpp> +#include <memory> #include "JSONUtils.h" namespace JSONRPC { class JSONSchemaTypeDefinition; - typedef boost::shared_ptr<JSONSchemaTypeDefinition> JSONSchemaTypeDefinitionPtr; + typedef std::shared_ptr<JSONSchemaTypeDefinition> JSONSchemaTypeDefinitionPtr; /*! \ingroup jsonrpc diff --git a/xbmc/interfaces/json-rpc/PlayerOperations.h b/xbmc/interfaces/json-rpc/PlayerOperations.h index b2c9274287..fcaf009faa 100644 --- a/xbmc/interfaces/json-rpc/PlayerOperations.h +++ b/xbmc/interfaces/json-rpc/PlayerOperations.h @@ -25,7 +25,7 @@ namespace EPG { class CEpgInfoTag; - typedef boost::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; + typedef std::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; } namespace JSONRPC diff --git a/xbmc/interfaces/legacy/ListItem.cpp b/xbmc/interfaces/legacy/ListItem.cpp index 88ebf0473e..30ebe9158c 100644 --- a/xbmc/interfaces/legacy/ListItem.cpp +++ b/xbmc/interfaces/legacy/ListItem.cpp @@ -18,6 +18,7 @@ * */ +#include <cstdlib> #include <sstream> #include "ListItem.h" diff --git a/xbmc/interfaces/legacy/Monitor.cpp b/xbmc/interfaces/legacy/Monitor.cpp index 5f992a568c..a1c9912d0c 100644 --- a/xbmc/interfaces/legacy/Monitor.cpp +++ b/xbmc/interfaces/legacy/Monitor.cpp @@ -18,6 +18,7 @@ * */ +#include <algorithm> #include "Monitor.h" #include <math.h> diff --git a/xbmc/interfaces/legacy/PlayList.cpp b/xbmc/interfaces/legacy/PlayList.cpp index c7ff80df4a..b23dcc17d4 100644 --- a/xbmc/interfaces/legacy/PlayList.cpp +++ b/xbmc/interfaces/legacy/PlayList.cpp @@ -80,7 +80,7 @@ namespace XBMCAddon // load a playlist like .m3u, .pls // first get correct factory to load playlist - std::auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(item)); + std::unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(item)); if ( NULL != pPlayList.get()) { // load it diff --git a/xbmc/interfaces/python/XBPython.h b/xbmc/interfaces/python/XBPython.h index 972281a4e9..f2ea909456 100644 --- a/xbmc/interfaces/python/XBPython.h +++ b/xbmc/interfaces/python/XBPython.h @@ -28,7 +28,7 @@ #include "interfaces/generic/ILanguageInvocationHandler.h" #include "addons/IAddon.h" -#include <boost/shared_ptr.hpp> +#include <memory> #include <vector> class CPythonInvoker; diff --git a/xbmc/linux/DBusReserve.cpp b/xbmc/linux/DBusReserve.cpp index d3a4c9a345..adc55bbb5a 100644 --- a/xbmc/linux/DBusReserve.cpp +++ b/xbmc/linux/DBusReserve.cpp @@ -23,6 +23,7 @@ #include <dbus/dbus.h> #include <climits> +#include <algorithm> #include "utils/log.h" diff --git a/xbmc/linux/LinuxTimezone.cpp b/xbmc/linux/LinuxTimezone.cpp index 7164d42d48..37130d86f5 100644 --- a/xbmc/linux/LinuxTimezone.cpp +++ b/xbmc/linux/LinuxTimezone.cpp @@ -38,6 +38,9 @@ #include "XBDateTime.h" #include "settings/lib/Setting.h" #include "settings/Settings.h" +#include <stdlib.h> + +#include <algorithm> using namespace std; diff --git a/xbmc/linux/OMXCore.cpp b/xbmc/linux/OMXCore.cpp index b13efcb982..4ba2e4bc4b 100644 --- a/xbmc/linux/OMXCore.cpp +++ b/xbmc/linux/OMXCore.cpp @@ -33,6 +33,7 @@ #include "OMXClock.h" #include "xbmc/linux/RBP.h" +#include <cassert> #ifdef TARGET_LINUX #include "XMemUtils.h" diff --git a/xbmc/linux/PosixMountProvider.cpp b/xbmc/linux/PosixMountProvider.cpp index 610d0d7ee1..218d10bee6 100644 --- a/xbmc/linux/PosixMountProvider.cpp +++ b/xbmc/linux/PosixMountProvider.cpp @@ -17,6 +17,9 @@ * <http://www.gnu.org/licenses/>. * */ + +#include <cstdlib> + #include "PosixMountProvider.h" #include "utils/RegExp.h" #include "utils/URIUtils.h" diff --git a/xbmc/linux/XFileUtils.cpp b/xbmc/linux/XFileUtils.cpp index b472ce2a45..ac5d9e1cfc 100644 --- a/xbmc/linux/XFileUtils.cpp +++ b/xbmc/linux/XFileUtils.cpp @@ -23,6 +23,7 @@ #include "XFileUtils.h" #include "XTimeUtils.h" #include "filesystem/SpecialProtocol.h" +#include "utils/StringUtils.h" #ifdef TARGET_POSIX #include "XHandle.h" @@ -50,7 +51,6 @@ #include "utils/log.h" #include "utils/RegExp.h" #include "utils/AliasShortcutUtils.h" -#include "utils/StringUtils.h" HANDLE FindFirstFile(LPCSTR szPath,LPWIN32_FIND_DATA lpFindData) { diff --git a/xbmc/linux/XHandle.cpp b/xbmc/linux/XHandle.cpp index 70ff8cd798..14fe45f1b8 100644 --- a/xbmc/linux/XHandle.cpp +++ b/xbmc/linux/XHandle.cpp @@ -22,6 +22,8 @@ #include "utils/log.h" #include "threads/SingleLock.h" +#include <cassert> + int CXHandle::m_objectTracker[10] = {0}; HANDLE WINAPI GetCurrentProcess(void) { diff --git a/xbmc/listproviders/DirectoryProvider.cpp b/xbmc/listproviders/DirectoryProvider.cpp index d410137a0b..8067691c6f 100644 --- a/xbmc/listproviders/DirectoryProvider.cpp +++ b/xbmc/listproviders/DirectoryProvider.cpp @@ -34,9 +34,10 @@ #include "video/VideoThumbLoader.h" #include "music/MusicThumbLoader.h" #include "pictures/PictureThumbLoader.h" -#include "boost/make_shared.hpp" #include "interfaces/AnnouncementManager.h" +#include <memory> + using namespace std; using namespace XFILE; using namespace ANNOUNCEMENT; @@ -84,7 +85,7 @@ public: return true; } - boost::shared_ptr<CThumbLoader> getThumbLoader(CGUIStaticItemPtr &item) + std::shared_ptr<CThumbLoader> getThumbLoader(CGUIStaticItemPtr &item) { if (item->IsVideo()) { @@ -110,7 +111,7 @@ public: { if (!m_thumbloaders.count(type)) { - boost::shared_ptr<CThumbLoader> thumbLoader = boost::make_shared<CThumbLoaderClass>(); + std::shared_ptr<CThumbLoader> thumbLoader = std::make_shared<CThumbLoaderClass>(); thumbLoader->OnLoaderStart(); m_thumbloaders.insert(make_pair(type, thumbLoader)); } @@ -121,7 +122,7 @@ public: std::vector<InfoTagType> GetItemTypes(std::vector<InfoTagType> &itemTypes) const { itemTypes.clear(); - for (std::map<InfoTagType, boost::shared_ptr<CThumbLoader> >::const_iterator + for (std::map<InfoTagType, std::shared_ptr<CThumbLoader> >::const_iterator i = m_thumbloaders.begin(); i != m_thumbloaders.end(); ++i) itemTypes.push_back(i->first); return itemTypes; @@ -132,7 +133,7 @@ private: unsigned int m_limit; int m_parentID; std::vector<CGUIStaticItemPtr> m_items; - std::map<InfoTagType, boost::shared_ptr<CThumbLoader> > m_thumbloaders; + std::map<InfoTagType, std::shared_ptr<CThumbLoader> > m_thumbloaders; }; CDirectoryProvider::CDirectoryProvider(const TiXmlElement *element, int parentID) @@ -262,7 +263,7 @@ void CDirectoryProvider::OnJobComplete(unsigned int jobID, bool success, CJob *j bool CDirectoryProvider::OnClick(const CGUIListItemPtr &item) { - CFileItem fileItem(*boost::static_pointer_cast<CFileItem>(item)); + CFileItem fileItem(*std::static_pointer_cast<CFileItem>(item)); string target = fileItem.GetProperty("node.target").asString(); if (target.empty()) target = m_currentTarget; diff --git a/xbmc/listproviders/IListProvider.h b/xbmc/listproviders/IListProvider.h index aa7b5be985..137a8a1252 100644 --- a/xbmc/listproviders/IListProvider.h +++ b/xbmc/listproviders/IListProvider.h @@ -21,11 +21,11 @@ #pragma once #include <vector> -#include "boost/shared_ptr.hpp" +#include <memory> class TiXmlNode; class CGUIListItem; -typedef boost::shared_ptr<CGUIListItem> CGUIListItemPtr; +typedef std::shared_ptr<CGUIListItem> CGUIListItemPtr; /*! \ingroup listproviders diff --git a/xbmc/listproviders/StaticProvider.cpp b/xbmc/listproviders/StaticProvider.cpp index 043d5e3298..17ba5eb315 100644 --- a/xbmc/listproviders/StaticProvider.cpp +++ b/xbmc/listproviders/StaticProvider.cpp @@ -121,6 +121,6 @@ bool CStaticListProvider::AlwaysFocusDefaultItem() const bool CStaticListProvider::OnClick(const CGUIListItemPtr &item) { - CGUIStaticItemPtr staticItem = boost::static_pointer_cast<CGUIStaticItem>(item); + CGUIStaticItemPtr staticItem = std::static_pointer_cast<CGUIStaticItem>(item); return staticItem->GetClickActions().ExecuteActions(0, m_parentID); } diff --git a/xbmc/main/main.cpp b/xbmc/main/main.cpp index ec86426a41..87fe2fd4c5 100644 --- a/xbmc/main/main.cpp +++ b/xbmc/main/main.cpp @@ -35,6 +35,7 @@ #ifdef HAS_SDL #include <SDL/SDL.h> #endif +#include <locale.h> #endif #ifdef HAS_LIRC #include "input/linux/LIRC.h" diff --git a/xbmc/music/Album.cpp b/xbmc/music/Album.cpp index 0307d91f45..447f6e05f5 100644 --- a/xbmc/music/Album.cpp +++ b/xbmc/music/Album.cpp @@ -25,6 +25,8 @@ #include "utils/MathUtils.h" #include "FileItem.h" +#include <algorithm> + using namespace std; using namespace MUSIC_INFO; diff --git a/xbmc/music/Artist.cpp b/xbmc/music/Artist.cpp index 89c5dc9932..c25f271258 100644 --- a/xbmc/music/Artist.cpp +++ b/xbmc/music/Artist.cpp @@ -22,6 +22,8 @@ #include "utils/XMLUtils.h" #include "settings/AdvancedSettings.h" +#include <algorithm> + using namespace std; void CArtist::MergeScrapedArtist(const CArtist& source, bool override /* = true */) diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp index 0647eafcf3..98d0ad9913 100644 --- a/xbmc/music/MusicDatabase.cpp +++ b/xbmc/music/MusicDatabase.cpp @@ -4579,7 +4579,7 @@ bool CMusicDatabase::GetScraperForPath(const std::string& strPath, ADDON::Scrape ADDON::AddonPtr addon; if (!scraperUUID.empty() && ADDON::CAddonMgr::Get().GetAddon(scraperUUID, addon) && addon) { - info = boost::dynamic_pointer_cast<ADDON::CScraper>(addon->Clone()); + info = std::dynamic_pointer_cast<ADDON::CScraper>(addon->Clone()); if (!info) return false; // store this path's settings @@ -4591,7 +4591,7 @@ bool CMusicDatabase::GetScraperForPath(const std::string& strPath, ADDON::Scrape ADDON::AddonPtr defaultScraper; if (ADDON::CAddonMgr::Get().GetDefault(type, defaultScraper)) { - info = boost::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper->Clone()); + info = std::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper->Clone()); } } } @@ -4602,7 +4602,7 @@ bool CMusicDatabase::GetScraperForPath(const std::string& strPath, ADDON::Scrape ADDON::AddonPtr addon; if(ADDON::CAddonMgr::Get().GetDefault(type, addon)) { - info = boost::dynamic_pointer_cast<ADDON::CScraper>(addon); + info = std::dynamic_pointer_cast<ADDON::CScraper>(addon); return info != NULL; } else diff --git a/xbmc/music/MusicInfoLoader.cpp b/xbmc/music/MusicInfoLoader.cpp index 00834c087f..7b51fd7c96 100644 --- a/xbmc/music/MusicInfoLoader.cpp +++ b/xbmc/music/MusicInfoLoader.cpp @@ -111,7 +111,7 @@ bool CMusicInfoLoader::LoadAdditionalTagInfo(CFileItem* pItem) CLog::Log(LOGDEBUG, "Loading additional tag info for file %s", path.c_str()); // we load up the actual tag for this file - auto_ptr<IMusicInfoTagLoader> pLoader (CMusicInfoTagLoaderFactory::CreateLoader(path)); + unique_ptr<IMusicInfoTagLoader> pLoader (CMusicInfoTagLoaderFactory::CreateLoader(path)); if (NULL != pLoader.get()) { CMusicInfoTag tag; @@ -196,7 +196,7 @@ bool CMusicInfoLoader::LoadItemLookup(CFileItem* pItem) { // Nothing found, load tag from file, // always try to load cddb info // get correct tag parser - auto_ptr<IMusicInfoTagLoader> pLoader (CMusicInfoTagLoaderFactory::CreateLoader(pItem->GetPath())); + unique_ptr<IMusicInfoTagLoader> pLoader (CMusicInfoTagLoaderFactory::CreateLoader(pItem->GetPath())); if (NULL != pLoader.get()) // get tag pLoader->Load(pItem->GetPath(), *pItem->GetMusicInfoTag()); diff --git a/xbmc/music/MusicThumbLoader.cpp b/xbmc/music/MusicThumbLoader.cpp index 8354497469..91aa6e25e6 100644 --- a/xbmc/music/MusicThumbLoader.cpp +++ b/xbmc/music/MusicThumbLoader.cpp @@ -239,7 +239,7 @@ bool CMusicThumbLoader::FillLibraryArt(CFileItem &item) bool CMusicThumbLoader::GetEmbeddedThumb(const std::string &path, EmbeddedArt &art) { - auto_ptr<IMusicInfoTagLoader> pLoader (CMusicInfoTagLoaderFactory::CreateLoader(path)); + unique_ptr<IMusicInfoTagLoader> pLoader (CMusicInfoTagLoaderFactory::CreateLoader(path)); CMusicInfoTag tag; if (NULL != pLoader.get()) pLoader->Load(path, tag, &art); diff --git a/xbmc/music/infoscanner/MusicInfoScanner.cpp b/xbmc/music/infoscanner/MusicInfoScanner.cpp index 0c1b305139..cb17456a6e 100644 --- a/xbmc/music/infoscanner/MusicInfoScanner.cpp +++ b/xbmc/music/infoscanner/MusicInfoScanner.cpp @@ -532,7 +532,7 @@ INFO_RET CMusicInfoScanner::ScanTags(const CFileItemList& items, CFileItemList& CMusicInfoTag& tag = *pItem->GetMusicInfoTag(); if (!tag.Loaded()) { - auto_ptr<IMusicInfoTagLoader> pLoader (CMusicInfoTagLoaderFactory::CreateLoader(pItem->GetPath())); + unique_ptr<IMusicInfoTagLoader> pLoader (CMusicInfoTagLoaderFactory::CreateLoader(pItem->GetPath())); if (NULL != pLoader.get()) pLoader->Load(pItem->GetPath(), tag); } @@ -745,10 +745,10 @@ int CMusicInfoScanner::RetrieveMusicInfo(const std::string& strDirectory, CFileI ADDON::ScraperPtr albumScraper; ADDON::ScraperPtr artistScraper; if(ADDON::CAddonMgr::Get().GetDefault(ADDON::ADDON_SCRAPER_ALBUMS, addon)) - albumScraper = boost::dynamic_pointer_cast<ADDON::CScraper>(addon); + albumScraper = std::dynamic_pointer_cast<ADDON::CScraper>(addon); if(ADDON::CAddonMgr::Get().GetDefault(ADDON::ADDON_SCRAPER_ARTISTS, addon)) - artistScraper = boost::dynamic_pointer_cast<ADDON::CScraper>(addon); + artistScraper = std::dynamic_pointer_cast<ADDON::CScraper>(addon); // Add each album for (VECALBUMS::iterator album = albums.begin(); album != albums.end(); ++album) diff --git a/xbmc/music/karaoke/karaokelyricstextustar.cpp b/xbmc/music/karaoke/karaokelyricstextustar.cpp index 15712c6692..7aba9eb8ed 100644 --- a/xbmc/music/karaoke/karaokelyricstextustar.cpp +++ b/xbmc/music/karaoke/karaokelyricstextustar.cpp @@ -20,6 +20,7 @@ // C++ Implementation: karaokelyricstextlrc +#include <cstdlib> #include <math.h> #include "filesystem/File.h" diff --git a/xbmc/music/tags/MusicInfoTagLoaderASAP.cpp b/xbmc/music/tags/MusicInfoTagLoaderASAP.cpp index 5bb44936d7..46f6a63ffb 100644 --- a/xbmc/music/tags/MusicInfoTagLoaderASAP.cpp +++ b/xbmc/music/tags/MusicInfoTagLoaderASAP.cpp @@ -17,6 +17,7 @@ * <http://www.gnu.org/licenses/>. * */ +#include <cstdlib> #include "MusicInfoTagLoaderASAP.h" #include "utils/URIUtils.h" diff --git a/xbmc/music/tags/MusicInfoTagLoaderSPC.cpp b/xbmc/music/tags/MusicInfoTagLoaderSPC.cpp index 11e9563095..50249e8d84 100644 --- a/xbmc/music/tags/MusicInfoTagLoaderSPC.cpp +++ b/xbmc/music/tags/MusicInfoTagLoaderSPC.cpp @@ -18,6 +18,7 @@ * */ +#include <cstdlib> #include "MusicInfoTagLoaderSPC.h" #include "snesapu/Types.h" diff --git a/xbmc/music/windows/GUIWindowMusicBase.cpp b/xbmc/music/windows/GUIWindowMusicBase.cpp index b635f746c6..2e6f6329d0 100644 --- a/xbmc/music/windows/GUIWindowMusicBase.cpp +++ b/xbmc/music/windows/GUIWindowMusicBase.cpp @@ -619,7 +619,7 @@ void CGUIWindowMusicBase::AddItemToPlayList(const CFileItemPtr &pItem, CFileItem { if (pItem->IsPlayList()) { - auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(*pItem)); + unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(*pItem)); if (pPlayList.get()) { // load it @@ -919,7 +919,7 @@ void CGUIWindowMusicBase::LoadPlayList(const std::string& strPlayList) // load a playlist like .m3u, .pls // first get correct factory to load playlist - auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList)); + unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList)); if (pPlayList.get()) { // load it diff --git a/xbmc/music/windows/GUIWindowMusicNav.cpp b/xbmc/music/windows/GUIWindowMusicNav.cpp index e9dd128483..58e7252ad9 100644 --- a/xbmc/music/windows/GUIWindowMusicNav.cpp +++ b/xbmc/music/windows/GUIWindowMusicNav.cpp @@ -714,7 +714,7 @@ bool CGUIWindowMusicNav::OnContextButton(int itemNumber, CONTEXT_BUTTON button) ADDON::AddonPtr defaultScraper; if (ADDON::CAddonMgr::Get().GetDefault(ADDON::ScraperTypeFromContent(content), defaultScraper)) { - scraper = boost::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper->Clone()); + scraper = std::dynamic_pointer_cast<ADDON::CScraper>(defaultScraper->Clone()); } } @@ -751,7 +751,7 @@ bool CGUIWindowMusicNav::GetSongsFromPlayList(const std::string& strPlayList, CF items.SetPath(strPlayList); CLog::Log(LOGDEBUG,"CGUIWindowMusicNav, opening playlist [%s]", strPlayList.c_str()); - auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList)); + unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList)); if ( NULL != pPlayList.get()) { // load it diff --git a/xbmc/network/AirPlayServer.cpp b/xbmc/network/AirPlayServer.cpp index 96aebfce74..48db9dd7ec 100644 --- a/xbmc/network/AirPlayServer.cpp +++ b/xbmc/network/AirPlayServer.cpp @@ -138,7 +138,7 @@ const char *eventStrings[] = {"playing", "paused", "loading", "stopped"}; "<key>protovers</key>\r\n"\ "<string>1.0</string>\r\n"\ "<key>srcvers</key>\r\n"\ -"<string>"AIRPLAY_SERVER_VERSION_STR"</string>\r\n"\ +"<string>" AIRPLAY_SERVER_VERSION_STR "</string>\r\n"\ "</dict>\r\n"\ "</plist>\r\n" diff --git a/xbmc/network/EventServer.cpp b/xbmc/network/EventServer.cpp index d76fbc4785..66646fe546 100644 --- a/xbmc/network/EventServer.cpp +++ b/xbmc/network/EventServer.cpp @@ -37,6 +37,7 @@ #include "guilib/Key.h" #include <map> #include <queue> +#include <cassert> using namespace EVENTSERVER; using namespace EVENTPACKET; diff --git a/xbmc/network/WebServer.cpp b/xbmc/network/WebServer.cpp index 05a8efc72b..86b80752fc 100644 --- a/xbmc/network/WebServer.cpp +++ b/xbmc/network/WebServer.cpp @@ -25,7 +25,8 @@ #include "WebServer.h" #ifdef HAS_WEB_SERVER -#include <boost/make_shared.hpp> +#include <memory> +#include <algorithm> #include "URL.h" #include "Util.h" @@ -65,7 +66,7 @@ typedef struct ConnectionHandler } ConnectionHandler; typedef struct { - boost::shared_ptr<XFILE::CFile> file; + std::shared_ptr<XFILE::CFile> file; CHttpRanges ranges; size_t rangeCountTotal; string boundary; @@ -729,7 +730,7 @@ int CWebServer::CreateFileDownloadResponse(IHTTPRequestHandler *handler, struct const HTTPResponseDetails &responseDetails = handler->GetResponseDetails(); HttpResponseRanges responseRanges = handler->GetResponseData(); - boost::shared_ptr<XFILE::CFile> file = boost::make_shared<XFILE::CFile>(); + std::shared_ptr<XFILE::CFile> file = std::make_shared<XFILE::CFile>(); std::string filePath = handler->GetResponseFile(); if (!file->Open(filePath, READ_NO_CACHE)) @@ -753,7 +754,7 @@ int CWebServer::CreateFileDownloadResponse(IHTTPRequestHandler *handler, struct if (request.method != HEAD) { uint64_t totalLength = 0; - std::auto_ptr<HttpFileDownloadContext> context(new HttpFileDownloadContext()); + std::unique_ptr<HttpFileDownloadContext> context(new HttpFileDownloadContext()); context->file = file; context->contentType = mimeType; context->boundaryWritten = false; diff --git a/xbmc/network/ZeroconfBrowser.cpp b/xbmc/network/ZeroconfBrowser.cpp index 2f37d01c55..effd056831 100644 --- a/xbmc/network/ZeroconfBrowser.cpp +++ b/xbmc/network/ZeroconfBrowser.cpp @@ -21,6 +21,7 @@ #include "ZeroconfBrowser.h" #include <stdexcept> #include "utils/log.h" +#include <cassert> #if defined (HAS_AVAHI) #include "linux/ZeroconfBrowserAvahi.h" diff --git a/xbmc/network/linux/NetworkLinux.cpp b/xbmc/network/linux/NetworkLinux.cpp index cea86e5ac0..a73d4d2143 100644 --- a/xbmc/network/linux/NetworkLinux.cpp +++ b/xbmc/network/linux/NetworkLinux.cpp @@ -18,6 +18,8 @@ * */ +#include <cstdlib> + #include <sys/ioctl.h> #include <sys/socket.h> #include <netinet/in.h> diff --git a/xbmc/network/linux/ZeroconfAvahi.h b/xbmc/network/linux/ZeroconfAvahi.h index e0b46b569c..c66e660965 100644 --- a/xbmc/network/linux/ZeroconfAvahi.h +++ b/xbmc/network/linux/ZeroconfAvahi.h @@ -29,7 +29,7 @@ #include <string> #include "network/Zeroconf.h" -#include <boost/shared_ptr.hpp> +#include <memory> #include <avahi-client/client.h> #include <avahi-client/publish.h> #include <avahi-common/defs.h> @@ -74,7 +74,7 @@ private: //helper struct for holding information about creating a service / AvahiEntryGroup //we have to hold that as it's needed to recreate the service class ServiceInfo; - typedef std::map<std::string, boost::shared_ptr<ServiceInfo> > tServiceMap; + typedef std::map<std::string, std::shared_ptr<ServiceInfo> > tServiceMap; //goes through a list of todos and publishs them (takes the client a param, as it might be called from // from the callbacks) diff --git a/xbmc/network/upnp/UPnPInternal.cpp b/xbmc/network/upnp/UPnPInternal.cpp index 95273c2e2d..d9522069c2 100644 --- a/xbmc/network/upnp/UPnPInternal.cpp +++ b/xbmc/network/upnp/UPnPInternal.cpp @@ -43,6 +43,8 @@ #include "settings/Settings.h" #include "utils/LangCodeExpander.h" +#include <algorithm> + using namespace MUSIC_INFO; using namespace XFILE; diff --git a/xbmc/osx/IOSExternalTouchController.mm b/xbmc/osx/IOSExternalTouchController.mm index 25475983f3..7049647e24 100644 --- a/xbmc/osx/IOSExternalTouchController.mm +++ b/xbmc/osx/IOSExternalTouchController.mm @@ -69,10 +69,10 @@ const CGFloat timeFadeSecs = 2.0; [descriptionLabel setTextColor:[UIColor grayColor]]; [descriptionLabel setBackgroundColor:[UIColor clearColor]]; //text is aligned left in its frame - [descriptionLabel setTextAlignment:UITextAlignmentCenter]; + [descriptionLabel setTextAlignment:NSTextAlignmentCenter]; [descriptionLabel setContentMode:UIViewContentModeCenter]; //setup multiline behaviour - [descriptionLabel setLineBreakMode:UILineBreakModeTailTruncation]; + [descriptionLabel setLineBreakMode:(NSLineBreakMode)UILineBreakModeTailTruncation]; [descriptionLabel setNumberOfLines:5]; std::string descText = g_localizeStrings.Get(34404) + "\n"; diff --git a/xbmc/pictures/GUIWindowPictures.cpp b/xbmc/pictures/GUIWindowPictures.cpp index fd2f0b69d2..c3e2f8616d 100644 --- a/xbmc/pictures/GUIWindowPictures.cpp +++ b/xbmc/pictures/GUIWindowPictures.cpp @@ -559,7 +559,7 @@ void CGUIWindowPictures::OnItemLoaded(CFileItem *pItem) void CGUIWindowPictures::LoadPlayList(const std::string& strPlayList) { CLog::Log(LOGDEBUG,"CGUIWindowPictures::LoadPlayList()... converting playlist into slideshow: %s", strPlayList.c_str()); - auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList)); + unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList)); if ( NULL != pPlayList.get()) { if (!pPlayList->Load(strPlayList)) diff --git a/xbmc/pictures/Picture.cpp b/xbmc/pictures/Picture.cpp index 5e9c23ece3..7682479f89 100644 --- a/xbmc/pictures/Picture.cpp +++ b/xbmc/pictures/Picture.cpp @@ -23,6 +23,8 @@ #include "config.h" #endif +#include <algorithm> + #include "Picture.h" #include "settings/AdvancedSettings.h" #include "settings/Settings.h" diff --git a/xbmc/pictures/PictureInfoTag.cpp b/xbmc/pictures/PictureInfoTag.cpp index 9704a4b77f..fce32213cc 100644 --- a/xbmc/pictures/PictureInfoTag.cpp +++ b/xbmc/pictures/PictureInfoTag.cpp @@ -18,6 +18,9 @@ * */ +#include <cstdlib> +#include <algorithm> + #include "PictureInfoTag.h" #include "XBDateTime.h" #include "Util.h" diff --git a/xbmc/playlists/PlayList.cpp b/xbmc/playlists/PlayList.cpp index 5aa96b8a93..2174fb0408 100644 --- a/xbmc/playlists/PlayList.cpp +++ b/xbmc/playlists/PlayList.cpp @@ -30,6 +30,9 @@ #include "utils/StringUtils.h" #include "interfaces/AnnouncementManager.h" +#include <cassert> +#include <algorithm> + //using namespace std; using namespace MUSIC_INFO; using namespace XFILE; @@ -458,7 +461,7 @@ bool CPlayList::LoadData(const std::string& strData) bool CPlayList::Expand(int position) { CFileItemPtr item = m_vecItems[position]; - std::auto_ptr<CPlayList> playlist (CPlayListFactory::Create(*item.get())); + std::unique_ptr<CPlayList> playlist (CPlayListFactory::Create(*item.get())); if ( NULL == playlist.get()) return false; diff --git a/xbmc/playlists/PlayList.h b/xbmc/playlists/PlayList.h index 09aabfe672..20fb964760 100644 --- a/xbmc/playlists/PlayList.h +++ b/xbmc/playlists/PlayList.h @@ -20,7 +20,7 @@ */ #include "FileItem.h" -#include <boost/shared_ptr.hpp> +#include <memory> #include <string> namespace PLAYLIST @@ -93,5 +93,5 @@ private: void AnnounceAdd(const CFileItemPtr& item, int pos); }; -typedef boost::shared_ptr<CPlayList> CPlayListPtr; +typedef std::shared_ptr<CPlayList> CPlayListPtr; } diff --git a/xbmc/playlists/PlayListPLS.cpp b/xbmc/playlists/PlayListPLS.cpp index 312af796df..f685b56b9b 100644 --- a/xbmc/playlists/PlayListPLS.cpp +++ b/xbmc/playlists/PlayListPLS.cpp @@ -379,7 +379,7 @@ bool CPlayListASX::LoadData(istream& stream) value = XMLUtils::GetAttribute(pElement, "href"); if (!value.empty()) { // found an entryref, let's try loading that url - auto_ptr<CPlayList> playlist(CPlayListFactory::Create(value)); + unique_ptr<CPlayList> playlist(CPlayListFactory::Create(value)); if (NULL != playlist.get()) if (playlist->Load(value)) Add(*playlist); diff --git a/xbmc/playlists/SmartPlayList.cpp b/xbmc/playlists/SmartPlayList.cpp index a0d86b4c4e..bbc51f2504 100644 --- a/xbmc/playlists/SmartPlayList.cpp +++ b/xbmc/playlists/SmartPlayList.cpp @@ -875,7 +875,7 @@ std::string CSmartPlaylistRuleCombination::GetWhereClause(const CDatabase &db, c { if (it != m_combinations.begin()) rule += m_type == CombinationAnd ? " AND " : " OR "; - boost::shared_ptr<CSmartPlaylistRuleCombination> combo = boost::static_pointer_cast<CSmartPlaylistRuleCombination>(*it); + std::shared_ptr<CSmartPlaylistRuleCombination> combo = std::static_pointer_cast<CSmartPlaylistRuleCombination>(*it); if (combo) rule += "(" + combo->GetWhereClause(db, strType, referencedPlaylists) + ")"; } @@ -934,7 +934,7 @@ void CSmartPlaylistRuleCombination::GetVirtualFolders(const std::string& strType { for (CDatabaseQueryRuleCombinations::const_iterator it = m_combinations.begin(); it != m_combinations.end(); ++it) { - boost::shared_ptr<CSmartPlaylistRuleCombination> combo = boost::static_pointer_cast<CSmartPlaylistRuleCombination>(*it); + std::shared_ptr<CSmartPlaylistRuleCombination> combo = std::static_pointer_cast<CSmartPlaylistRuleCombination>(*it); if (combo) combo->GetVirtualFolders(strType, virtualFolders); } @@ -965,7 +965,7 @@ void CSmartPlaylistRuleCombination::GetVirtualFolders(const std::string& strType void CSmartPlaylistRuleCombination::AddRule(const CSmartPlaylistRule &rule) { - boost::shared_ptr<CSmartPlaylistRule> ptr(new CSmartPlaylistRule(rule)); + std::shared_ptr<CSmartPlaylistRule> ptr(new CSmartPlaylistRule(rule)); m_rules.push_back(ptr); } diff --git a/xbmc/playlists/SmartPlayList.h b/xbmc/playlists/SmartPlayList.h index 5813b0ae87..abdfd35ee1 100644 --- a/xbmc/playlists/SmartPlayList.h +++ b/xbmc/playlists/SmartPlayList.h @@ -22,7 +22,7 @@ #include <set> #include <string> #include <vector> -#include <boost/shared_ptr.hpp> +#include <memory> #include "dbwrappers/DatabaseQuery.h" #include "utils/SortUtils.h" diff --git a/xbmc/pvr/PVRGUIInfo.h b/xbmc/pvr/PVRGUIInfo.h index 9e66e6d62e..e71cc9d18f 100644 --- a/xbmc/pvr/PVRGUIInfo.h +++ b/xbmc/pvr/PVRGUIInfo.h @@ -28,7 +28,7 @@ namespace EPG { class CEpgInfoTag; - typedef boost::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; + typedef std::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; } namespace PVR diff --git a/xbmc/pvr/PVRManager.h b/xbmc/pvr/PVRManager.h index bf0532cb42..b8b9e97536 100644 --- a/xbmc/pvr/PVRManager.h +++ b/xbmc/pvr/PVRManager.h @@ -44,7 +44,7 @@ namespace PVR { class CPVRClients; class CPVRChannel; - typedef boost::shared_ptr<PVR::CPVRChannel> CPVRChannelPtr; + typedef std::shared_ptr<PVR::CPVRChannel> CPVRChannelPtr; class CPVRChannelGroupsContainer; class CPVRChannelGroup; class CPVRRecordings; @@ -83,7 +83,7 @@ namespace PVR #define g_PVRRecordings g_PVRManager.Recordings() #define g_PVRClients g_PVRManager.Clients() - typedef boost::shared_ptr<PVR::CPVRChannelGroup> CPVRChannelGroupPtr; + typedef std::shared_ptr<PVR::CPVRChannelGroup> CPVRChannelGroupPtr; class CPVRManager : public ISettingCallback, private CThread, public Observable, public ANNOUNCEMENT::IAnnouncer { diff --git a/xbmc/pvr/addons/PVRClient.h b/xbmc/pvr/addons/PVRClient.h index 58695cdda0..b6f3eb5aba 100644 --- a/xbmc/pvr/addons/PVRClient.h +++ b/xbmc/pvr/addons/PVRClient.h @@ -42,7 +42,7 @@ namespace PVR class CPVRClient; typedef std::vector<PVR_MENUHOOK> PVR_MENUHOOKS; - typedef boost::shared_ptr<CPVRClient> PVR_CLIENT; + typedef std::shared_ptr<CPVRClient> PVR_CLIENT; #define PVR_INVALID_CLIENT_ID (-2) /*! diff --git a/xbmc/pvr/addons/PVRClients.cpp b/xbmc/pvr/addons/PVRClients.cpp index affe21638f..961373b36b 100644 --- a/xbmc/pvr/addons/PVRClients.cpp +++ b/xbmc/pvr/addons/PVRClients.cpp @@ -868,7 +868,7 @@ int CPVRClients::RegisterClient(AddonPtr client, bool* newRegistration/*=NULL*/) else { // create a new client instance - addon = boost::dynamic_pointer_cast<CPVRClient>(client); + addon = std::dynamic_pointer_cast<CPVRClient>(client); m_clientMap.insert(std::make_pair(iClientId, addon)); } } diff --git a/xbmc/pvr/addons/PVRClients.h b/xbmc/pvr/addons/PVRClients.h index 550244a928..23bb080a01 100644 --- a/xbmc/pvr/addons/PVRClients.h +++ b/xbmc/pvr/addons/PVRClients.h @@ -39,7 +39,7 @@ namespace PVR { class CPVRGUIInfo; - typedef boost::shared_ptr<CPVRClient> PVR_CLIENT; + typedef std::shared_ptr<CPVRClient> PVR_CLIENT; typedef std::map< int, PVR_CLIENT > PVR_CLIENTMAP; typedef std::map< int, PVR_CLIENT >::iterator PVR_CLIENTMAP_ITR; typedef std::map< int, PVR_CLIENT >::const_iterator PVR_CLIENTMAP_CITR; diff --git a/xbmc/pvr/channels/PVRChannel.h b/xbmc/pvr/channels/PVRChannel.h index 2ea41ed9be..7fd23596f5 100644 --- a/xbmc/pvr/channels/PVRChannel.h +++ b/xbmc/pvr/channels/PVRChannel.h @@ -27,7 +27,7 @@ #include "threads/CriticalSection.h" #include "utils/ISerializable.h" -#include <boost/shared_ptr.hpp> +#include <memory> #define PVR_INVALID_CHANNEL_UID -1 @@ -35,7 +35,7 @@ namespace EPG { class CEpg; class CEpgInfoTag; - typedef boost::shared_ptr<CEpgInfoTag> CEpgInfoTagPtr; + typedef std::shared_ptr<CEpgInfoTag> CEpgInfoTagPtr; } @@ -45,7 +45,7 @@ namespace PVR class CPVRChannelGroupInternal; class CPVRChannel; - typedef boost::shared_ptr<PVR::CPVRChannel> CPVRChannelPtr; + typedef std::shared_ptr<PVR::CPVRChannel> CPVRChannelPtr; typedef struct { diff --git a/xbmc/pvr/channels/PVRChannelGroup.h b/xbmc/pvr/channels/PVRChannelGroup.h index ab9dd2b52e..959a7a0a30 100644 --- a/xbmc/pvr/channels/PVRChannelGroup.h +++ b/xbmc/pvr/channels/PVRChannelGroup.h @@ -25,7 +25,7 @@ #include "settings/lib/ISettingCallback.h" #include "utils/JobManager.h" -#include <boost/shared_ptr.hpp> +#include <memory> namespace EPG { @@ -59,7 +59,7 @@ namespace PVR }; class CPVRChannelGroup; - typedef boost::shared_ptr<PVR::CPVRChannelGroup> CPVRChannelGroupPtr; + typedef std::shared_ptr<PVR::CPVRChannelGroup> CPVRChannelGroupPtr; /** A group of channels */ class CPVRChannelGroup : public Observable, diff --git a/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h b/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h index cf10a8dc2d..dc6ea703f0 100644 --- a/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h +++ b/xbmc/pvr/dialogs/GUIDialogPVRGuideInfo.h @@ -20,12 +20,12 @@ */ #include "guilib/GUIDialog.h" -#include <boost/shared_ptr.hpp> +#include <memory> namespace EPG { class CEpgInfoTag; - typedef boost::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; + typedef std::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; } namespace PVR diff --git a/xbmc/pvr/recordings/PVRRecording.h b/xbmc/pvr/recordings/PVRRecording.h index 0c14f6ed0b..c3a9adac87 100644 --- a/xbmc/pvr/recordings/PVRRecording.h +++ b/xbmc/pvr/recordings/PVRRecording.h @@ -45,7 +45,7 @@ namespace PVR { class CPVRRecording; - typedef boost::shared_ptr<PVR::CPVRRecording> CPVRRecordingPtr; + typedef std::shared_ptr<PVR::CPVRRecording> CPVRRecordingPtr; /*! * @brief Representation of a CPVRRecording unique ID. diff --git a/xbmc/pvr/timers/PVRTimerInfoTag.h b/xbmc/pvr/timers/PVRTimerInfoTag.h index 9643913860..8e07ad0e20 100644 --- a/xbmc/pvr/timers/PVRTimerInfoTag.h +++ b/xbmc/pvr/timers/PVRTimerInfoTag.h @@ -41,14 +41,14 @@ #include "addons/include/xbmc_pvr_types.h" #include "utils/ISerializable.h" -#include <boost/shared_ptr.hpp> +#include <memory> class CFileItem; namespace EPG { class CEpgInfoTag; - typedef boost::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; + typedef std::shared_ptr<EPG::CEpgInfoTag> CEpgInfoTagPtr; } namespace PVR @@ -58,10 +58,10 @@ namespace PVR class CPVRChannelGroupInternal; class CPVRChannel; - typedef boost::shared_ptr<PVR::CPVRChannel> CPVRChannelPtr; + typedef std::shared_ptr<PVR::CPVRChannel> CPVRChannelPtr; class CPVRTimerInfoTag; - typedef boost::shared_ptr<PVR::CPVRTimerInfoTag> CPVRTimerInfoTagPtr; + typedef std::shared_ptr<PVR::CPVRTimerInfoTag> CPVRTimerInfoTagPtr; class CPVRTimerInfoTag : public ISerializable { diff --git a/xbmc/settings/SettingUtils.cpp b/xbmc/settings/SettingUtils.cpp index bb17374a00..51f3877fe9 100644 --- a/xbmc/settings/SettingUtils.cpp +++ b/xbmc/settings/SettingUtils.cpp @@ -36,7 +36,7 @@ bool CSettingUtils::SetList(CSettingList *settingList, const std::vector<CVarian return settingList->SetValue(newValues); } -std::vector<CVariant> CSettingUtils::ListToValues(const CSettingList *setting, const std::vector< boost::shared_ptr<CSetting> > &values) +std::vector<CVariant> CSettingUtils::ListToValues(const CSettingList *setting, const std::vector< std::shared_ptr<CSetting> > &values) { std::vector<CVariant> realValues; @@ -72,7 +72,7 @@ std::vector<CVariant> CSettingUtils::ListToValues(const CSettingList *setting, c } bool CSettingUtils::ValuesToList(const CSettingList *setting, const std::vector<CVariant> &values, - std::vector< boost::shared_ptr<CSetting> > &newValues) + std::vector< std::shared_ptr<CSetting> > &newValues) { if (setting == NULL) return false; diff --git a/xbmc/settings/SettingUtils.h b/xbmc/settings/SettingUtils.h index 3f2dd55bb1..dba1281d61 100644 --- a/xbmc/settings/SettingUtils.h +++ b/xbmc/settings/SettingUtils.h @@ -19,7 +19,7 @@ * */ #include <vector> -#include <boost/shared_ptr.hpp> +#include <memory> #include "utils/Variant.h" @@ -45,6 +45,6 @@ public: */ static bool SetList(CSettingList *settingList, const std::vector<CVariant> &value); - static std::vector<CVariant> ListToValues(const CSettingList *setting, const std::vector< boost::shared_ptr<CSetting> > &values); - static bool ValuesToList(const CSettingList *setting, const std::vector<CVariant> &values, std::vector< boost::shared_ptr<CSetting> > &newValues); + static std::vector<CVariant> ListToValues(const CSettingList *setting, const std::vector< std::shared_ptr<CSetting> > &values); + static bool ValuesToList(const CSettingList *setting, const std::vector<CVariant> &values, std::vector< std::shared_ptr<CSetting> > &newValues); }; diff --git a/xbmc/settings/Settings.h b/xbmc/settings/Settings.h index f0c8b4abd5..936833eed2 100644 --- a/xbmc/settings/Settings.h +++ b/xbmc/settings/Settings.h @@ -23,7 +23,7 @@ #include <string> #include <vector> -#include <boost/shared_ptr.hpp> +#include <memory> #include "settings/SettingControl.h" #include "settings/SettingCreator.h" diff --git a/xbmc/settings/dialogs/GUIDialogContentSettings.cpp b/xbmc/settings/dialogs/GUIDialogContentSettings.cpp index 541cba74a4..d6d22f8140 100644 --- a/xbmc/settings/dialogs/GUIDialogContentSettings.cpp +++ b/xbmc/settings/dialogs/GUIDialogContentSettings.cpp @@ -115,7 +115,7 @@ bool CGUIDialogContentSettings::OnMessage(CGUIMessage &message) } AddonPtr last = m_scraper; - m_scraper = boost::dynamic_pointer_cast<CScraper>(m_scrapers[m_content][iSelected]); + m_scraper = std::dynamic_pointer_cast<CScraper>(m_scrapers[m_content][iSelected]); m_lastSelected[m_content] = m_scraper; if (m_scraper != last) @@ -498,12 +498,12 @@ void CGUIDialogContentSettings::FillScraperList() int selectedIndex = 0; if (m_lastSelected.find(m_content) != m_lastSelected.end()) - m_scraper = boost::dynamic_pointer_cast<CScraper>(m_lastSelected[m_content]); + m_scraper = std::dynamic_pointer_cast<CScraper>(m_lastSelected[m_content]); else { AddonPtr scraperAddon; CAddonMgr::Get().GetDefault(ADDON::ScraperTypeFromContent(m_content), scraperAddon); - m_scraper = boost::dynamic_pointer_cast<CScraper>(scraperAddon); + m_scraper = std::dynamic_pointer_cast<CScraper>(scraperAddon); } for (IVECADDONS iter = m_scrapers.find(m_content)->second.begin(); iter != m_scrapers.find(m_content)->second.end(); ++iter) diff --git a/xbmc/settings/dialogs/GUIDialogSettingsBase.h b/xbmc/settings/dialogs/GUIDialogSettingsBase.h index 024b6cfd66..bac9cecba9 100644 --- a/xbmc/settings/dialogs/GUIDialogSettingsBase.h +++ b/xbmc/settings/dialogs/GUIDialogSettingsBase.h @@ -55,7 +55,7 @@ class CSettingAction; class CSettingCategory; class CSettingSection; -typedef boost::shared_ptr<CGUIControlBaseSetting> BaseSettingControlPtr; +typedef std::shared_ptr<CGUIControlBaseSetting> BaseSettingControlPtr; class CGUIDialogSettingsBase : public CGUIDialog, diff --git a/xbmc/settings/lib/Setting.h b/xbmc/settings/lib/Setting.h index 7f89295904..c29e53996c 100644 --- a/xbmc/settings/lib/Setting.h +++ b/xbmc/settings/lib/Setting.h @@ -24,7 +24,7 @@ #include <string> #include <vector> -#include <boost/shared_ptr.hpp> +#include <memory> #include "ISetting.h" #include "ISettingCallback.h" @@ -136,7 +136,7 @@ protected: CSharedSection m_critical; }; -typedef boost::shared_ptr<CSetting> SettingPtr; +typedef std::shared_ptr<CSetting> SettingPtr; typedef std::vector<CSetting *> SettingList; typedef std::vector<SettingPtr> SettingPtrList; diff --git a/xbmc/settings/lib/SettingDependency.cpp b/xbmc/settings/lib/SettingDependency.cpp index e274e7f947..b9da7d5c25 100644 --- a/xbmc/settings/lib/SettingDependency.cpp +++ b/xbmc/settings/lib/SettingDependency.cpp @@ -322,7 +322,7 @@ CSettingDependencyConditionCombinationPtr CSettingDependency::And() m_operation->SetOperation(BooleanLogicOperationAnd); - return boost::dynamic_pointer_cast<CSettingDependencyConditionCombination>(m_operation); + return std::dynamic_pointer_cast<CSettingDependencyConditionCombination>(m_operation); } CSettingDependencyConditionCombinationPtr CSettingDependency::Or() @@ -332,7 +332,7 @@ CSettingDependencyConditionCombinationPtr CSettingDependency::Or() m_operation->SetOperation(BooleanLogicOperationOr); - return boost::dynamic_pointer_cast<CSettingDependencyConditionCombination>(m_operation); + return std::dynamic_pointer_cast<CSettingDependencyConditionCombination>(m_operation); } bool CSettingDependency::setType(const std::string &type) diff --git a/xbmc/settings/lib/SettingDependency.h b/xbmc/settings/lib/SettingDependency.h index 5f0d997b33..0cb551eee2 100644 --- a/xbmc/settings/lib/SettingDependency.h +++ b/xbmc/settings/lib/SettingDependency.h @@ -73,10 +73,10 @@ private: SettingDependencyOperator m_operator; }; -typedef boost::shared_ptr<CSettingDependencyCondition> CSettingDependencyConditionPtr; +typedef std::shared_ptr<CSettingDependencyCondition> CSettingDependencyConditionPtr; class CSettingDependencyConditionCombination; -typedef boost::shared_ptr<CSettingDependencyConditionCombination> CSettingDependencyConditionCombinationPtr; +typedef std::shared_ptr<CSettingDependencyConditionCombination> CSettingDependencyConditionCombinationPtr; class CSettingDependencyConditionCombination : public CSettingConditionCombination { diff --git a/xbmc/settings/lib/SettingsManager.cpp b/xbmc/settings/lib/SettingsManager.cpp index 40342b0a70..655e0809f6 100644 --- a/xbmc/settings/lib/SettingsManager.cpp +++ b/xbmc/settings/lib/SettingsManager.cpp @@ -26,6 +26,7 @@ #include "utils/StringUtils.h" #include "utils/XBMCTinyXML.h" +#include <algorithm> CSettingsManager::CSettingsManager() : m_initialized(false), m_loaded(false) @@ -607,17 +608,17 @@ bool CSettingsManager::SetString(const std::string &id, const std::string &value return ((CSettingString*)setting)->SetValue(value); } -std::vector< boost::shared_ptr<CSetting> > CSettingsManager::GetList(const std::string &id) const +std::vector< std::shared_ptr<CSetting> > CSettingsManager::GetList(const std::string &id) const { CSharedLock lock(m_settingsCritical); CSetting *setting = GetSetting(id); if (setting == NULL || setting->GetType() != SettingTypeList) - return std::vector< boost::shared_ptr<CSetting> >(); + return std::vector< std::shared_ptr<CSetting> >(); return ((CSettingList*)setting)->GetValue(); } -bool CSettingsManager::SetList(const std::string &id, const std::vector< boost::shared_ptr<CSetting> > &value) +bool CSettingsManager::SetList(const std::string &id, const std::vector< std::shared_ptr<CSetting> > &value) { CSharedLock lock(m_settingsCritical); CSetting *setting = GetSetting(id); diff --git a/xbmc/settings/lib/SettingsManager.h b/xbmc/settings/lib/SettingsManager.h index b2db46fbd7..ca895e95e7 100644 --- a/xbmc/settings/lib/SettingsManager.h +++ b/xbmc/settings/lib/SettingsManager.h @@ -318,7 +318,7 @@ public: \param id Setting identifier \return List of values of the setting with the given identifier */ - std::vector< boost::shared_ptr<CSetting> > GetList(const std::string &id) const; + std::vector< std::shared_ptr<CSetting> > GetList(const std::string &id) const; /*! \brief Sets the boolean value of the setting with the given identifier. @@ -366,7 +366,7 @@ public: \param value Values to set \return True if setting the values was successful, false otherwise */ - bool SetList(const std::string &id, const std::vector< boost::shared_ptr<CSetting> > &value); + bool SetList(const std::string &id, const std::vector< std::shared_ptr<CSetting> > &value); /*! \brief Gets the setting conditions manager used by the settings manager. diff --git a/xbmc/storage/DetectDVDType.h b/xbmc/storage/DetectDVDType.h index b1cfd9aa08..03446f9b5d 100644 --- a/xbmc/storage/DetectDVDType.h +++ b/xbmc/storage/DetectDVDType.h @@ -35,7 +35,7 @@ #include "threads/CriticalSection.h" #include "threads/Thread.h" -#include "boost/shared_ptr.hpp" +#include <memory> #include <string> namespace MEDIA_DETECT @@ -89,7 +89,7 @@ private: static std::string m_diskLabel; static std::string m_diskPath; - boost::shared_ptr<CLibcdio> m_cdio; + std::shared_ptr<CLibcdio> m_cdio; }; } #endif diff --git a/xbmc/storage/MediaManager.cpp b/xbmc/storage/MediaManager.cpp index 75f27247e8..bfcb17eccb 100644 --- a/xbmc/storage/MediaManager.cpp +++ b/xbmc/storage/MediaManager.cpp @@ -593,7 +593,7 @@ void CMediaManager::EjectTray( const bool bEject, const char cDriveLetter ) #ifdef TARGET_WINDOWS CWIN32Util::EjectTray(cDriveLetter); #else - boost::shared_ptr<CLibcdio> c_cdio = CLibcdio::GetInstance(); + std::shared_ptr<CLibcdio> c_cdio = CLibcdio::GetInstance(); char* dvdDevice = c_cdio->GetDeviceFileName(); m_isoReader.Reset(); int nRetries=3; diff --git a/xbmc/storage/android/AndroidStorageProvider.cpp b/xbmc/storage/android/AndroidStorageProvider.cpp index 076d7d2ae4..0cd4b42f60 100644 --- a/xbmc/storage/android/AndroidStorageProvider.cpp +++ b/xbmc/storage/android/AndroidStorageProvider.cpp @@ -18,6 +18,11 @@ * */ +#include <cstdlib> +#include <cstdio> +#include <cstring> +#include <map> + #include "AndroidStorageProvider.h" #include "android/activity/XBMCApp.h" #include "guilib/LocalizeStrings.h" @@ -28,10 +33,6 @@ #include "utils/RegExp.h" #include "utils/StringUtils.h" #include "utils/URIUtils.h" -#include <cstdio> -#include <cstring> -#include <cstdlib> -#include <map> CAndroidStorageProvider::CAndroidStorageProvider() { diff --git a/xbmc/storage/cdioSupport.cpp b/xbmc/storage/cdioSupport.cpp index 366ed9cc36..521262de76 100644 --- a/xbmc/storage/cdioSupport.cpp +++ b/xbmc/storage/cdioSupport.cpp @@ -37,7 +37,7 @@ using namespace MEDIA_DETECT; -boost::shared_ptr<CLibcdio> CLibcdio::m_pInstance; +std::shared_ptr<CLibcdio> CLibcdio::m_pInstance; /* Some interesting sector numbers stored in the above buffer. */ #define ISO_SUPERBLOCK_SECTOR 16 /* buffer[0] */ @@ -118,11 +118,11 @@ void CLibcdio::ReleaseInstance() m_pInstance.reset(); } -boost::shared_ptr<CLibcdio> CLibcdio::GetInstance() +std::shared_ptr<CLibcdio> CLibcdio::GetInstance() { if (!m_pInstance) { - m_pInstance = boost::shared_ptr<CLibcdio>(new CLibcdio()); + m_pInstance = std::shared_ptr<CLibcdio>(new CLibcdio()); } return m_pInstance; } diff --git a/xbmc/storage/cdioSupport.h b/xbmc/storage/cdioSupport.h index f5f6823dea..e6cde6a32c 100644 --- a/xbmc/storage/cdioSupport.h +++ b/xbmc/storage/cdioSupport.h @@ -36,7 +36,7 @@ #include <cdio/cdio.h> #include "threads/CriticalSection.h" -#include "boost/shared_ptr.hpp" +#include <memory> #include <map> #include <string> @@ -259,7 +259,7 @@ public: virtual ~CLibcdio(); static void ReleaseInstance(); - static boost::shared_ptr<CLibcdio> GetInstance(); + static std::shared_ptr<CLibcdio> GetInstance(); // libcdio is not thread safe so these are wrappers to libcdio routines CdIo_t* cdio_open(const char *psz_source, driver_id_t driver_id); @@ -278,7 +278,7 @@ public: private: char* s_defaultDevice; CCriticalSection m_critSection; - static boost::shared_ptr<CLibcdio> m_pInstance; + static std::shared_ptr<CLibcdio> m_pInstance; }; class CCdIoSupport @@ -341,7 +341,7 @@ private: int m_nFirstAudio; /* # of first audio track */ int m_nNumAudio; /* # of audio tracks */ - boost::shared_ptr<CLibcdio> m_cdio; + std::shared_ptr<CLibcdio> m_cdio; }; } diff --git a/xbmc/storage/osx/DarwinStorageProvider.cpp b/xbmc/storage/osx/DarwinStorageProvider.cpp index 9b7802a095..6be9ab13cd 100644 --- a/xbmc/storage/osx/DarwinStorageProvider.cpp +++ b/xbmc/storage/osx/DarwinStorageProvider.cpp @@ -18,6 +18,7 @@ * */ +#include <stdlib.h> #include "DarwinStorageProvider.h" #include "utils/RegExp.h" #include "Util.h" diff --git a/xbmc/threads/test/TestAtomics.cpp b/xbmc/threads/test/TestAtomics.cpp index 26403039da..e7453d4516 100644 --- a/xbmc/threads/test/TestAtomics.cpp +++ b/xbmc/threads/test/TestAtomics.cpp @@ -21,7 +21,7 @@ #include "TestHelpers.h" #include "threads/Atomics.h" -#include <boost/shared_array.hpp> +#include <memory> #include <iostream> #define TESTNUM 100000l @@ -85,8 +85,8 @@ public: TEST(TestMassAtomic, Increment) { long lNumber = 0; - boost::shared_array<thread> t; - t.reset(new thread[NUMTHREADS]); + std::shared_ptr<thread> t; + t.reset(new thread[NUMTHREADS], std::default_delete<thread[]>()); DoIncrement di(&lNumber); for(size_t i=0; i<NUMTHREADS; i++) t[i] = thread(di); @@ -100,8 +100,8 @@ TEST(TestMassAtomic, Increment) TEST(TestMassAtomic, Decrement) { long lNumber = (NUMTHREADS * TESTNUM); - boost::shared_array<thread> t; - t.reset(new thread[NUMTHREADS]); + std::shared_ptr<thread> t; + t.reset(new thread[NUMTHREADS], std::default_delete<thread[]>()); DoDecrement dd(&lNumber); for(size_t i=0; i<NUMTHREADS; i++) t[i] = thread(dd); @@ -116,8 +116,8 @@ TEST(TestMassAtomic, Add) { long lNumber = 0; long toAdd = 10; - boost::shared_array<thread> t; - t.reset(new thread[NUMTHREADS]); + std::shared_ptr<thread> t; + t.reset(new thread[NUMTHREADS], std::default_delete<thread[]>()); DoAdd da(&lNumber,toAdd); for(size_t i=0; i<NUMTHREADS; i++) t[i] = thread(da); @@ -132,8 +132,8 @@ TEST(TestMassAtomic, Subtract) { long toSubtract = 10; long lNumber = (NUMTHREADS * TESTNUM) * toSubtract; - boost::shared_array<thread> t; - t.reset(new thread[NUMTHREADS]); + std::shared_ptr<thread> t; + t.reset(new thread[NUMTHREADS], std::default_delete<thread[]>()); DoSubtract ds(&lNumber,toSubtract); for(size_t i=0; i<NUMTHREADS; i++) t[i] = thread(ds); diff --git a/xbmc/threads/test/TestEvent.cpp b/xbmc/threads/test/TestEvent.cpp index b183156f98..7c2111f628 100644 --- a/xbmc/threads/test/TestEvent.cpp +++ b/xbmc/threads/test/TestEvent.cpp @@ -23,7 +23,7 @@ #include "threads/test/TestHelpers.h" -#include <boost/shared_array.hpp> +#include <memory> #include <stdio.h> using namespace XbmcThreads; @@ -571,10 +571,10 @@ public: } }; -template <class W> void RunMassEventTest(boost::shared_array<W>& m, bool canWaitOnEvent) +template <class W> void RunMassEventTest(std::shared_ptr<W>& m, bool canWaitOnEvent) { - boost::shared_array<thread> t; - t.reset(new thread[NUMTHREADS]); + std::shared_ptr<thread> t; + t.reset(new thread[NUMTHREADS], std::default_delete<thread[]>()); for(size_t i=0; i<NUMTHREADS; i++) t[i] = thread(m[i]); @@ -610,8 +610,8 @@ TEST(TestMassEvent, General) { g_event = new CEvent(); - boost::shared_array<mass_waiter> m; - m.reset(new mass_waiter[NUMTHREADS]); + std::shared_ptr<mass_waiter> m; + m.reset(new mass_waiter[NUMTHREADS], std::default_delete<mass_waiter[]>()); RunMassEventTest(m,true); delete g_event; @@ -621,8 +621,8 @@ TEST(TestMassEvent, Polling) { g_event = new CEvent(true); // polling needs to avoid the auto-reset - boost::shared_array<poll_mass_waiter> m; - m.reset(new poll_mass_waiter[NUMTHREADS]); + std::shared_ptr<poll_mass_waiter> m; + m.reset(new poll_mass_waiter[NUMTHREADS], std::default_delete<poll_mass_waiter[]>()); RunMassEventTest(m,false); delete g_event; diff --git a/xbmc/utils/Archive.cpp b/xbmc/utils/Archive.cpp index 14cd61c404..62fe7874ea 100644 --- a/xbmc/utils/Archive.cpp +++ b/xbmc/utils/Archive.cpp @@ -18,6 +18,7 @@ * */ +#include <algorithm> #include <cstring> #include "Archive.h" #include "IArchivable.h" diff --git a/xbmc/utils/AutoPtrHandle.h b/xbmc/utils/AutoPtrHandle.h index cd72c3ae64..8a3b4dcf9e 100644 --- a/xbmc/utils/AutoPtrHandle.h +++ b/xbmc/utils/AutoPtrHandle.h @@ -66,7 +66,7 @@ protected: }; /* - * This template class is very similar to the standard "auto_ptr", but it is + * This template class is very similar to the standard "unique_ptr", but it is * used for *array* pointers rather than *object* pointers, i.e. the pointer * passed to it must have been allocated with "new[]", and "auto_aptr" will * delete it with "delete[]". diff --git a/xbmc/utils/BooleanLogic.h b/xbmc/utils/BooleanLogic.h index e1af268996..9b9bd1604b 100644 --- a/xbmc/utils/BooleanLogic.h +++ b/xbmc/utils/BooleanLogic.h @@ -22,7 +22,7 @@ #include <string> #include <vector> -#include <boost/shared_ptr.hpp> +#include <memory> #include "utils/IXmlDeserializable.h" @@ -53,11 +53,11 @@ protected: bool m_negated; }; -typedef boost::shared_ptr<CBooleanLogicValue> CBooleanLogicValuePtr; +typedef std::shared_ptr<CBooleanLogicValue> CBooleanLogicValuePtr; typedef std::vector<CBooleanLogicValuePtr> CBooleanLogicValues; class CBooleanLogicOperation; -typedef boost::shared_ptr<CBooleanLogicOperation> CBooleanLogicOperationPtr; +typedef std::shared_ptr<CBooleanLogicOperation> CBooleanLogicOperationPtr; typedef std::vector<CBooleanLogicOperationPtr> CBooleanLogicOperations; class CBooleanLogicOperation : public IXmlDeserializable diff --git a/xbmc/utils/CPUInfo.cpp b/xbmc/utils/CPUInfo.cpp index 95ddad9977..5f5bf80d66 100644 --- a/xbmc/utils/CPUInfo.cpp +++ b/xbmc/utils/CPUInfo.cpp @@ -18,6 +18,8 @@ * */ +#include <cstdlib> + #include "CPUInfo.h" #include "Temperature.h" #include <string> diff --git a/xbmc/utils/CharsetConverter.cpp b/xbmc/utils/CharsetConverter.cpp index 23bf0822f0..b1b257778b 100644 --- a/xbmc/utils/CharsetConverter.cpp +++ b/xbmc/utils/CharsetConverter.cpp @@ -32,6 +32,7 @@ #include <errno.h> #include <iconv.h> +#include <algorithm> #if !defined(TARGET_WINDOWS) && defined(HAVE_CONFIG_H) #include "config.h" diff --git a/xbmc/utils/DatabaseUtils.cpp b/xbmc/utils/DatabaseUtils.cpp index ae523055bb..d2fcb31074 100644 --- a/xbmc/utils/DatabaseUtils.cpp +++ b/xbmc/utils/DatabaseUtils.cpp @@ -352,7 +352,7 @@ bool DatabaseUtils::GetFieldValue(const dbiplus::field_value &fieldValue, CVaria return false; } -bool DatabaseUtils::GetDatabaseResults(const MediaType &mediaType, const FieldList &fields, const std::auto_ptr<dbiplus::Dataset> &dataset, DatabaseResults &results) +bool DatabaseUtils::GetDatabaseResults(const MediaType &mediaType, const FieldList &fields, const std::unique_ptr<dbiplus::Dataset> &dataset, DatabaseResults &results) { if (dataset->num_rows() == 0) return true; diff --git a/xbmc/utils/DatabaseUtils.h b/xbmc/utils/DatabaseUtils.h index 3ac9f36183..6ee0a7c7bd 100644 --- a/xbmc/utils/DatabaseUtils.h +++ b/xbmc/utils/DatabaseUtils.h @@ -152,7 +152,7 @@ public: static bool GetSelectFields(const Fields &fields, const MediaType &mediaType, FieldList &selectFields); static bool GetFieldValue(const dbiplus::field_value &fieldValue, CVariant &variantValue); - static bool GetDatabaseResults(const MediaType &mediaType, const FieldList &fields, const std::auto_ptr<dbiplus::Dataset> &dataset, DatabaseResults &results); + static bool GetDatabaseResults(const MediaType &mediaType, const FieldList &fields, const std::unique_ptr<dbiplus::Dataset> &dataset, DatabaseResults &results); static std::string BuildLimitClause(int end, int start = 0); diff --git a/xbmc/utils/Fanart.cpp b/xbmc/utils/Fanart.cpp index 9a86bd052a..c9aacdba4c 100644 --- a/xbmc/utils/Fanart.cpp +++ b/xbmc/utils/Fanart.cpp @@ -18,6 +18,9 @@ * */ +#include <algorithm> +#include <functional> + #include "Fanart.h" #include "utils/XBMCTinyXML.h" #include "utils/XMLUtils.h" diff --git a/xbmc/utils/GlobalsHandling.h b/xbmc/utils/GlobalsHandling.h index c27f76eb46..ab46c58538 100644 --- a/xbmc/utils/GlobalsHandling.h +++ b/xbmc/utils/GlobalsHandling.h @@ -20,7 +20,7 @@ #pragma once -#include <boost/shared_ptr.hpp> +#include <memory> /** * This file contains the pattern for moving "globals" from the BSS Segment to the heap. @@ -46,7 +46,7 @@ * * The (at least) two ways to do this: * - * 1) You can use the reference object boost::shared_ptr to access the global variable. + * 1) You can use the reference object std::shared_ptr to access the global variable. * * This would be the preferred means since it is (very slightly) more efficent than * the alternative. To use this pattern you replace standard static references to @@ -54,11 +54,11 @@ * do this for you can put the following code in the header file where the global's * class is declared: * - * static boost::shared_ptr<GlobalVariableClass> g_globalVariableRef(xbmcutil::GlobalsSingleton<GlobalVariableClass>::getInstance()); + * static std::shared_ptr<GlobalVariableClass> g_globalVariableRef(xbmcutil::GlobalsSingleton<GlobalVariableClass>::getInstance()); * #define g_globalVariable (*(g_globalVariableRef.get())) * * Note what this does. In every file that includes this header there will be a *static* - * instance of the boost::shared_ptr<GlobalVariableClass> smart pointer. This effectively + * instance of the std::shared_ptr<GlobalVariableClass> smart pointer. This effectively * reference counts the singleton from every compilation unit (ie, object code file that * results from a compilation of a .c/.cpp file) that references this global directly. * @@ -139,7 +139,7 @@ namespace xbmcutil * Deleter class above so that when the bss segment that this static is * sitting in is deinitialized, the shared_ptr pointer will be cleaned up. */ - static Deleter<boost::shared_ptr<T> > instance; + static Deleter<std::shared_ptr<T> > instance; /** * See 'getQuick' below. @@ -151,13 +151,13 @@ namespace xbmcutil * Retrieve an instance of the singleton using a shared pointer for * referenece counting. */ - inline static boost::shared_ptr<T> getInstance() + inline static std::shared_ptr<T> getInstance() { if (!instance.guarded) { if (!quick) quick = new T; - instance.guarded = new boost::shared_ptr<T>(quick); + instance.guarded = new std::shared_ptr<T>(quick); } return *(instance.guarded); } @@ -179,7 +179,7 @@ namespace xbmcutil }; - template <class T> typename GlobalsSingleton<T>::template Deleter<boost::shared_ptr<T> > GlobalsSingleton<T>::instance; + template <class T> typename GlobalsSingleton<T>::template Deleter<std::shared_ptr<T> > GlobalsSingleton<T>::instance; template <class T> T* GlobalsSingleton<T>::quick; /** @@ -203,7 +203,7 @@ namespace xbmcutil * */ #define XBMC_GLOBAL_REF(classname,g_variable) \ - static boost::shared_ptr<classname> g_variable##Ref(xbmcutil::GlobalsSingleton<classname>::getInstance()) + static std::shared_ptr<classname> g_variable##Ref(xbmcutil::GlobalsSingleton<classname>::getInstance()) /** * This declares the actual use of the variable. It needs to be used in another #define diff --git a/xbmc/utils/HttpRangeUtils.cpp b/xbmc/utils/HttpRangeUtils.cpp index 2df8d9f2b7..e09111e860 100644 --- a/xbmc/utils/HttpRangeUtils.cpp +++ b/xbmc/utils/HttpRangeUtils.cpp @@ -23,6 +23,8 @@ #include "network/httprequesthandler/IHTTPRequestHandler.h" #include "utils/Variant.h" +#include <algorithm> + #define HEADER_NEWLINE "\r\n" #define HEADER_SEPARATOR HEADER_NEWLINE HEADER_NEWLINE #define HEADER_BOUNDARY "--" diff --git a/xbmc/utils/JobManager.cpp b/xbmc/utils/JobManager.cpp index d2d2a13f7b..8f690fe636 100644 --- a/xbmc/utils/JobManager.cpp +++ b/xbmc/utils/JobManager.cpp @@ -20,13 +20,13 @@ #include "JobManager.h" #include <algorithm> +#include <functional> #include <stdexcept> #include "threads/SingleLock.h" #include "utils/log.h" #include "system.h" - using namespace std; bool CJob::ShouldCancel(unsigned int progress, unsigned int total) const diff --git a/xbmc/utils/LabelFormatter.cpp b/xbmc/utils/LabelFormatter.cpp index 163fe9de3a..39b471989f 100644 --- a/xbmc/utils/LabelFormatter.cpp +++ b/xbmc/utils/LabelFormatter.cpp @@ -18,6 +18,8 @@ * */ +#include <cstdlib> + #include "LabelFormatter.h" #include "settings/AdvancedSettings.h" #include "settings/Settings.h" @@ -31,6 +33,8 @@ #include "URIUtils.h" #include "guilib/LocalizeStrings.h" +#include <cassert> + using namespace MUSIC_INFO; /* LabelFormatter diff --git a/xbmc/utils/Observer.cpp b/xbmc/utils/Observer.cpp index 9d3ef14a99..f46bdbcb4a 100644 --- a/xbmc/utils/Observer.cpp +++ b/xbmc/utils/Observer.cpp @@ -23,6 +23,8 @@ #include "threads/SingleLock.h" #include "utils/JobManager.h" +#include <algorithm> + using namespace std; Observer::~Observer(void) diff --git a/xbmc/utils/SortUtils.cpp b/xbmc/utils/SortUtils.cpp index 3d1f347e3c..a9fa99aa16 100644 --- a/xbmc/utils/SortUtils.cpp +++ b/xbmc/utils/SortUtils.cpp @@ -27,6 +27,8 @@ #include "utils/StringUtils.h" #include "utils/Variant.h" +#include <algorithm> + using namespace std; string ArrayToString(SortAttribute attributes, const CVariant &variant, const string &seperator = " / ") @@ -723,7 +725,7 @@ void SortUtils::Sort(const SortDescription &sortDescription, SortItems& items) Sort(sortDescription.sortBy, sortDescription.sortOrder, sortDescription.sortAttributes, items, sortDescription.limitEnd, sortDescription.limitStart); } -bool SortUtils::SortFromDataset(const SortDescription &sortDescription, const MediaType &mediaType, const std::auto_ptr<dbiplus::Dataset> &dataset, DatabaseResults &results) +bool SortUtils::SortFromDataset(const SortDescription &sortDescription, const MediaType &mediaType, const std::unique_ptr<dbiplus::Dataset> &dataset, DatabaseResults &results) { FieldList fields; if (!DatabaseUtils::GetSelectFields(SortUtils::GetFieldsForSorting(sortDescription.sortBy), mediaType, fields)) diff --git a/xbmc/utils/SortUtils.h b/xbmc/utils/SortUtils.h index 5eda3c6fad..9faff876ba 100644 --- a/xbmc/utils/SortUtils.h +++ b/xbmc/utils/SortUtils.h @@ -21,7 +21,7 @@ #include <map> #include <string> -#include "boost/shared_ptr.hpp" +#include <memory> #include "DatabaseUtils.h" #include "SortFileItem.h" @@ -116,7 +116,7 @@ typedef struct GUIViewSortDetails } GUIViewSortDetails; typedef DatabaseResult SortItem; -typedef boost::shared_ptr<SortItem> SortItemPtr; +typedef std::shared_ptr<SortItem> SortItemPtr; typedef std::vector<SortItemPtr> SortItems; class SortUtils @@ -135,7 +135,7 @@ public: static void Sort(SortBy sortBy, SortOrder sortOrder, SortAttribute attributes, SortItems& items, int limitEnd = -1, int limitStart = 0); static void Sort(const SortDescription &sortDescription, DatabaseResults& items); static void Sort(const SortDescription &sortDescription, SortItems& items); - static bool SortFromDataset(const SortDescription &sortDescription, const MediaType &mediaType, const std::auto_ptr<dbiplus::Dataset> &dataset, DatabaseResults &results); + static bool SortFromDataset(const SortDescription &sortDescription, const MediaType &mediaType, const std::unique_ptr<dbiplus::Dataset> &dataset, DatabaseResults &results); static const Fields& GetFieldsForSorting(SortBy sortBy); static std::string RemoveArticles(const std::string &label); diff --git a/xbmc/utils/StringUtils.cpp b/xbmc/utils/StringUtils.cpp index 6d0f19ca75..5963bf3d1f 100644 --- a/xbmc/utils/StringUtils.cpp +++ b/xbmc/utils/StringUtils.cpp @@ -33,6 +33,7 @@ #include "utils/fstrcmp.h" #include "Util.h" #include <locale> +#include <functional> #include <assert.h> #include <math.h> diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp index 5caa91ef5b..bb3f95ca15 100644 --- a/xbmc/utils/URIUtils.cpp +++ b/xbmc/utils/URIUtils.cpp @@ -32,6 +32,7 @@ #include "URL.h" #include "StringUtils.h" +#include <cassert> #include <netinet/in.h> #include <arpa/inet.h> diff --git a/xbmc/utils/test/TestDatabaseUtils.cpp b/xbmc/utils/test/TestDatabaseUtils.cpp index c26e881ae0..2f213efeec 100644 --- a/xbmc/utils/test/TestDatabaseUtils.cpp +++ b/xbmc/utils/test/TestDatabaseUtils.cpp @@ -1293,7 +1293,7 @@ TEST(TestDatabaseUtils, GetFieldValue) // TEST(TestDatabaseUtils, GetDatabaseResults) // { // static bool GetDatabaseResults(MediaType mediaType, const FieldList &fields, -// const std::auto_ptr<dbiplus::Dataset> &dataset, +// const std::unique_ptr<dbiplus::Dataset> &dataset, // DatabaseResults &results); // } diff --git a/xbmc/utils/test/TestGlobalsHandling.cpp b/xbmc/utils/test/TestGlobalsHandling.cpp index fc00763fd2..50afc86ba1 100644 --- a/xbmc/utils/test/TestGlobalsHandling.cpp +++ b/xbmc/utils/test/TestGlobalsHandling.cpp @@ -32,6 +32,6 @@ TEST(TestGlobal, Pattern1) { EXPECT_TRUE(TestGlobalPattern1::ctorCalled); { - boost::shared_ptr<TestGlobalPattern1> ptr = g_testGlobalPattern1Ref; + std::shared_ptr<TestGlobalPattern1> ptr = g_testGlobalPattern1Ref; } } diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index 0a7816a1be..4346379f91 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -1169,7 +1169,7 @@ int CVideoDatabase::GetEpisodeId(const std::string& strFilenameAndPath, int idEp if (NULL == m_pDS.get()) return -1; // need this due to the nested GetEpisodeInfo query - auto_ptr<Dataset> pDS; + unique_ptr<Dataset> pDS; pDS.reset(m_pDB->CreateDataset()); if (NULL == pDS.get()) return -1; @@ -3220,7 +3220,7 @@ void CVideoDatabase::DeleteTag(int idTag, VIDEODB_CONTENT_TYPE mediaType) } } -void CVideoDatabase::GetDetailsFromDB(auto_ptr<Dataset> &pDS, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset) +void CVideoDatabase::GetDetailsFromDB(unique_ptr<Dataset> &pDS, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset) { GetDetailsFromDB(pDS->get_sql_record(), min, max, offsets, details, idxOffset); } @@ -3319,7 +3319,7 @@ bool CVideoDatabase::GetStreamDetails(CVideoInfoTag& tag) const CStreamDetails& details = tag.m_streamDetails; details.Reset(); - auto_ptr<Dataset> pDS(m_pDB->CreateDataset()); + unique_ptr<Dataset> pDS(m_pDB->CreateDataset()); try { std::string strSQL = PrepareSQL("SELECT * FROM streamdetails WHERE idFile = %i", tag.m_iFileId); @@ -3434,7 +3434,7 @@ bool CVideoDatabase::GetResumePoint(CVideoInfoTag& tag) return match; } -CVideoInfoTag CVideoDatabase::GetDetailsForMovie(auto_ptr<Dataset> &pDS, bool getDetails /* = false */) +CVideoInfoTag CVideoDatabase::GetDetailsForMovie(unique_ptr<Dataset> &pDS, bool getDetails /* = false */) { return GetDetailsForMovie(pDS->get_sql_record(), getDetails); } @@ -3496,7 +3496,7 @@ CVideoInfoTag CVideoDatabase::GetDetailsForMovie(const dbiplus::sql_record* cons return details; } -CVideoInfoTag CVideoDatabase::GetDetailsForTvShow(auto_ptr<Dataset> &pDS, bool getDetails /* = false */, CFileItem* item /* = NULL */) +CVideoInfoTag CVideoDatabase::GetDetailsForTvShow(unique_ptr<Dataset> &pDS, bool getDetails /* = false */, CFileItem* item /* = NULL */) { return GetDetailsForTvShow(pDS->get_sql_record(), getDetails, item); } @@ -3550,7 +3550,7 @@ CVideoInfoTag CVideoDatabase::GetDetailsForTvShow(const dbiplus::sql_record* con return details; } -CVideoInfoTag CVideoDatabase::GetDetailsForEpisode(auto_ptr<Dataset> &pDS, bool getDetails /* = false */) +CVideoInfoTag CVideoDatabase::GetDetailsForEpisode(unique_ptr<Dataset> &pDS, bool getDetails /* = false */) { return GetDetailsForEpisode(pDS->get_sql_record(), getDetails); } @@ -3607,7 +3607,7 @@ CVideoInfoTag CVideoDatabase::GetDetailsForEpisode(const dbiplus::sql_record* co return details; } -CVideoInfoTag CVideoDatabase::GetDetailsForMusicVideo(auto_ptr<Dataset> &pDS, bool getDetails /* = false */) +CVideoInfoTag CVideoDatabase::GetDetailsForMusicVideo(unique_ptr<Dataset> &pDS, bool getDetails /* = false */) { return GetDetailsForMusicVideo(pDS->get_sql_record(), getDetails); } @@ -6749,7 +6749,7 @@ ScraperPtr CVideoDatabase::GetScraperForPath(const std::string& strPath, SScanSe if (!scraperID.empty() && CAddonMgr::Get().GetAddon(scraperID, addon)) { - scraper = boost::dynamic_pointer_cast<CScraper>(addon->Clone()); + scraper = std::dynamic_pointer_cast<CScraper>(addon->Clone()); if (!scraper) return ScraperPtr(); @@ -6792,7 +6792,7 @@ ScraperPtr CVideoDatabase::GetScraperForPath(const std::string& strPath, SScanSe if (content != CONTENT_NONE && CAddonMgr::Get().GetAddon(m_pDS->fv("path.strScraper").get_asString(), addon)) { - scraper = boost::dynamic_pointer_cast<CScraper>(addon->Clone()); + scraper = std::dynamic_pointer_cast<CScraper>(addon->Clone()); scraper->SetPathSettings(content, m_pDS->fv("path.strSettings").get_asString()); settings.parent_name = m_pDS->fv("path.useFolderNames").get_asBool(); settings.recurse = m_pDS->fv("path.scanRecursive").get_asInt(); @@ -8330,11 +8330,11 @@ void CVideoDatabase::ExportToXML(const std::string &path, bool singleFiles /* = if (NULL == m_pDS2.get()) return; // create a 3rd dataset as well as GetEpisodeDetails() etc. uses m_pDS2, and we need to do 3 nested queries on tv shows - auto_ptr<Dataset> pDS; + unique_ptr<Dataset> pDS; pDS.reset(m_pDB->CreateDataset()); if (NULL == pDS.get()) return; - auto_ptr<Dataset> pDS2; + unique_ptr<Dataset> pDS2; pDS2.reset(m_pDB->CreateDataset()); if (NULL == pDS2.get()) return; @@ -8949,7 +8949,7 @@ void CVideoDatabase::ImportFromXML(const std::string &path) if (CAddonMgr::Get().GetAddon(id, addon)) { SScanSettings settings; - ScraperPtr scraper = boost::dynamic_pointer_cast<CScraper>(addon); + ScraperPtr scraper = std::dynamic_pointer_cast<CScraper>(addon); // FIXME: scraper settings are not exported? scraper->SetPathSettings(TranslateContent(content), ""); XMLUtils::GetInt(path,"scanrecursive",settings.recurse); diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h index 8012bd59c7..fcab0a865d 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h @@ -823,20 +823,20 @@ protected: void DeleteStreamDetails(int idFile); CVideoInfoTag GetDetailsByTypeAndId(VIDEODB_CONTENT_TYPE type, int id); - CVideoInfoTag GetDetailsForMovie(std::auto_ptr<dbiplus::Dataset> &pDS, bool getDetails = false); + CVideoInfoTag GetDetailsForMovie(std::unique_ptr<dbiplus::Dataset> &pDS, bool getDetails = false); CVideoInfoTag GetDetailsForMovie(const dbiplus::sql_record* const record, bool getDetails = false); - CVideoInfoTag GetDetailsForTvShow(std::auto_ptr<dbiplus::Dataset> &pDS, bool getDetails = false, CFileItem* item = NULL); + CVideoInfoTag GetDetailsForTvShow(std::unique_ptr<dbiplus::Dataset> &pDS, bool getDetails = false, CFileItem* item = NULL); CVideoInfoTag GetDetailsForTvShow(const dbiplus::sql_record* const record, bool getDetails = false, CFileItem* item = NULL); - CVideoInfoTag GetDetailsForEpisode(std::auto_ptr<dbiplus::Dataset> &pDS, bool getDetails = false); + CVideoInfoTag GetDetailsForEpisode(std::unique_ptr<dbiplus::Dataset> &pDS, bool getDetails = false); CVideoInfoTag GetDetailsForEpisode(const dbiplus::sql_record* const record, bool getDetails = false); - CVideoInfoTag GetDetailsForMusicVideo(std::auto_ptr<dbiplus::Dataset> &pDS, bool getDetails = false); + CVideoInfoTag GetDetailsForMusicVideo(std::unique_ptr<dbiplus::Dataset> &pDS, bool getDetails = false); CVideoInfoTag GetDetailsForMusicVideo(const dbiplus::sql_record* const record, bool getDetails = false); bool GetPeopleNav(const std::string& strBaseDir, CFileItemList& items, const char *type, int idContent = -1, const Filter &filter = Filter(), bool countOnly = false); bool GetNavCommon(const std::string& strBaseDir, CFileItemList& items, const char *type, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false); void GetCast(int media_id, const std::string &media_type, std::vector<SActorInfo> &cast); void GetTags(int media_id, const std::string &media_type, std::vector<std::string> &tags); - void GetDetailsFromDB(std::auto_ptr<dbiplus::Dataset> &pDS, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset = 2); + void GetDetailsFromDB(std::unique_ptr<dbiplus::Dataset> &pDS, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset = 2); void GetDetailsFromDB(const dbiplus::sql_record* const record, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset = 2); std::string GetValueString(const CVideoInfoTag &details, int min, int max, const SDbTableOffsets *offsets) const; diff --git a/xbmc/video/VideoInfoTag.cpp b/xbmc/video/VideoInfoTag.cpp index ad85cdda4d..6c87f3e980 100644 --- a/xbmc/video/VideoInfoTag.cpp +++ b/xbmc/video/VideoInfoTag.cpp @@ -30,6 +30,7 @@ #include "filesystem/File.h" #include <sstream> +#include <algorithm> using namespace std; diff --git a/xbmc/video/VideoThumbLoader.cpp b/xbmc/video/VideoThumbLoader.cpp index f517366cfa..583d9d015f 100644 --- a/xbmc/video/VideoThumbLoader.cpp +++ b/xbmc/video/VideoThumbLoader.cpp @@ -18,6 +18,8 @@ * */ +#include <cstdlib> + #include "VideoThumbLoader.h" #include "filesystem/StackDirectory.h" #include "utils/URIUtils.h" diff --git a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp index 707a11cf72..7ca6253c2b 100644 --- a/xbmc/video/dialogs/GUIDialogVideoInfo.cpp +++ b/xbmc/video/dialogs/GUIDialogVideoInfo.cpp @@ -186,7 +186,7 @@ bool CGUIDialogVideoInfo::OnMessage(CGUIMessage& message) { if (IsActive() && message.GetParam1() == GUI_MSG_UPDATE_ITEM && message.GetItem()) { - CFileItemPtr item = boost::static_pointer_cast<CFileItem>(message.GetItem()); + CFileItemPtr item = std::static_pointer_cast<CFileItem>(message.GetItem()); if (item && m_movieItem->IsPath(item->GetPath())) { // Just copy over the stream details and the thumb if we don't already have one if (!m_movieItem->HasArt("thumb")) diff --git a/xbmc/video/windows/GUIWindowVideoBase.cpp b/xbmc/video/windows/GUIWindowVideoBase.cpp index 6642fb3e7d..c78b5bdaf7 100644 --- a/xbmc/video/windows/GUIWindowVideoBase.cpp +++ b/xbmc/video/windows/GUIWindowVideoBase.cpp @@ -822,7 +822,7 @@ void CGUIWindowVideoBase::AddItemToPlayList(const CFileItemPtr &pItem, CFileItem // just an item if (pItem->IsPlayList()) { - auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(*pItem)); + unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(*pItem)); if (pPlayList.get()) { // load it @@ -1545,7 +1545,7 @@ void CGUIWindowVideoBase::LoadPlayList(const std::string& strPlayList, int iPlay // load a playlist like .m3u, .pls // first get correct factory to load playlist - auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList)); + unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList)); if (pPlayList.get()) { // load it diff --git a/xbmc/view/GUIViewState.cpp b/xbmc/view/GUIViewState.cpp index 78378dd92e..0b61778748 100644 --- a/xbmc/view/GUIViewState.cpp +++ b/xbmc/view/GUIViewState.cpp @@ -557,7 +557,7 @@ CGUIViewStateFromItems::CGUIViewStateFromItems(const CFileItemList &items) : CGU AddonPtr addon; if (CAddonMgr::Get().GetAddon(url.GetHostName(),addon) && addon) { - PluginPtr plugin = boost::static_pointer_cast<CPluginSource>(addon); + PluginPtr plugin = std::static_pointer_cast<CPluginSource>(addon); if (plugin->Provides(CPluginSource::AUDIO)) m_playlist = PLAYLIST_MUSIC; if (plugin->Provides(CPluginSource::VIDEO)) diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.cpp b/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.cpp index 83fc22dbfa..2b3d2adc38 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.cpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.cpp @@ -197,10 +197,10 @@ return out.str(); } -std::auto_ptr<Preset> IdlePreset::allocate( PresetInputs & presetInputs, PresetOutputs & presetOutputs) +std::unique_ptr<Preset> IdlePreset::allocate( PresetInputs & presetInputs, PresetOutputs & presetOutputs) { std::istringstream in(presetText()); - return std::auto_ptr<Preset>(new Preset(in, IDLE_PRESET_NAME, presetInputs, presetOutputs)); + return std::unique_ptr<Preset>(new Preset(in, IDLE_PRESET_NAME, presetInputs, presetOutputs)); } diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.hpp b/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.hpp index 15738ed22f..233aa8e205 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.hpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/IdlePreset.hpp @@ -13,7 +13,7 @@ class IdlePreset { /// \param presetInputs the preset inputs instance to associate with the preset /// \param presetOutputs the preset output instance to associate with the preset /// \returns a newly allocated auto pointer of an idle preset instance - static std::auto_ptr<Preset> allocate(PresetInputs & presetInputs, PresetOutputs & presetOutputs); + static std::unique_ptr<Preset> allocate(PresetInputs & presetInputs, PresetOutputs & presetOutputs); private: static std::string presetText(); static const std::string IDLE_PRESET_NAME; diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/Parser.cpp b/xbmc/visualizations/XBMCProjectM/libprojectM/Parser.cpp index f881c0ca0e..c6d106a166 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/Parser.cpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/Parser.cpp @@ -1471,8 +1471,6 @@ PerFrameEqn * Parser::parse_implicit_per_frame_eqn(std::istream & fs, char * pa PerFrameEqn * per_frame_eqn; GenExpr * gen_expr; - if (fs == NULL) - return NULL; if (param_string == NULL) return NULL; if (preset == NULL) @@ -1612,8 +1610,6 @@ InitCond * Parser::parse_per_frame_init_eqn(std::istream & fs, Preset * preset, if (preset == NULL) return NULL; - if (fs == NULL) - return NULL; if ((token = parseToken(fs, name)) != tEq) return NULL; @@ -1806,8 +1802,6 @@ int Parser::parse_shapecode(char * token, std::istream & fs, Preset * preset) /* Null argument checks */ if (preset == NULL) return PROJECTM_FAILURE; - if (fs == NULL) - return PROJECTM_FAILURE; if (token == NULL) return PROJECTM_FAILURE; @@ -2097,8 +2091,6 @@ int Parser::parse_wave(char * token, std::istream & fs, Preset * preset) if (token == NULL) return PROJECTM_FAILURE; - if (fs == NULL) - return PROJECTM_FAILURE; if (preset == NULL) return PROJECTM_FAILURE; @@ -2283,8 +2275,6 @@ int Parser::parse_shape(char * token, std::istream & fs, Preset * preset) if (token == NULL) return PROJECTM_FAILURE; - if (fs == NULL) - return PROJECTM_FAILURE; if (preset == NULL) return PROJECTM_FAILURE; diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/PresetChooser.hpp b/xbmc/visualizations/XBMCProjectM/libprojectM/PresetChooser.hpp index 3971beb60e..a82159620b 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/PresetChooser.hpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/PresetChooser.hpp @@ -43,7 +43,7 @@ public: /// \param presetInputs the preset inputs to associate with the preset upon construction /// \param presetOutputs the preset outputs to associate with the preset upon construction /// \returns an autopointer of the newly allocated preset - std::auto_ptr<Preset> allocate( PresetInputs & presetInputs, PresetOutputs & presetOutputs); + std::unique_ptr<Preset> allocate( PresetInputs & presetInputs, PresetOutputs & presetOutputs); /// Set the chooser asocciated with this iterator void setChooser(const PresetChooser & chooser); @@ -70,7 +70,7 @@ public: /// \param presetInputs the preset inputs to associate with the preset upon construction /// \param presetOutputs the preset outputs to associate with the preset upon construction /// \returns an auto pointer of the newly allocated preset - std::auto_ptr<Preset> directoryIndex(std::size_t index, PresetInputs & presetInputs, + std::unique_ptr<Preset> directoryIndex(std::size_t index, PresetInputs & presetInputs, PresetOutputs & presetOutputs) const; /// Gets the number of presets last believed to exist in the preset loader's filename collection @@ -142,7 +142,7 @@ inline bool PresetIterator::operator ==(const PresetIterator & presetPos) const return (*presetPos == **this); } -inline std::auto_ptr<Preset> PresetIterator::allocate( PresetInputs & presetInputs, PresetOutputs & presetOutputs) { +inline std::unique_ptr<Preset> PresetIterator::allocate( PresetInputs & presetInputs, PresetOutputs & presetOutputs) { return m_presetChooser->directoryIndex(m_currentIndex, presetInputs, presetOutputs); } @@ -188,7 +188,7 @@ inline bool PresetChooser::empty() const { return m_presetLoader->getNumPresets() == 0; } -inline std::auto_ptr<Preset> PresetChooser::directoryIndex(std::size_t index, PresetInputs & presetInputs, +inline std::unique_ptr<Preset> PresetChooser::directoryIndex(std::size_t index, PresetInputs & presetInputs, PresetOutputs & presetOutputs) const { return m_presetLoader->loadPreset(index, presetInputs, presetOutputs); diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.cpp b/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.cpp index d0a281ff64..a91a132f53 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.cpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.cpp @@ -130,7 +130,7 @@ void PresetLoader::rescan() } -std::auto_ptr<Preset> PresetLoader::loadPreset(unsigned int index, PresetInputs & presetInputs, PresetOutputs & presetOutputs) const +std::unique_ptr<Preset> PresetLoader::loadPreset(unsigned int index, PresetInputs & presetInputs, PresetOutputs & presetOutputs) const { // Check that index isn't insane @@ -138,7 +138,7 @@ std::auto_ptr<Preset> PresetLoader::loadPreset(unsigned int index, PresetInputs assert(index < m_entries.size()); // Return a new autopointer to a preset - return std::auto_ptr<Preset>(new Preset(m_entries[index], m_presetNames[index], presetInputs, presetOutputs)); + return std::unique_ptr<Preset>(new Preset(m_entries[index], m_presetNames[index], presetInputs, presetOutputs)); } void PresetLoader::handleDirectoryError() diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.hpp b/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.hpp index 663432f3d5..d13ce513f9 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.hpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/PresetLoader.hpp @@ -36,7 +36,7 @@ class PresetLoader { /** Load a preset by specifying a filename of the directory (that is, NOT full path) */ /** Autopointers: when you take it, I leave it */ - std::auto_ptr<Preset> loadPreset(unsigned int index, PresetInputs & presetInputs, + std::unique_ptr<Preset> loadPreset(unsigned int index, PresetInputs & presetInputs, PresetOutputs & presetOutputs) const; /// Add a preset to the loader's collection. diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/Renderer.cpp b/xbmc/visualizations/XBMCProjectM/libprojectM/Renderer.cpp index d96a3d8fb0..ef0c51d283 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/Renderer.cpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/Renderer.cpp @@ -1746,10 +1746,10 @@ void Renderer::render_texture_to_screen(PresetOutputs *presetOutputs) default: flipx=1;flipy=1; break; } - float pointsFlip[4][2] = {{-0.5*flipx, -0.5*flipy}, - {-0.5*flipx, 0.5*flipy}, - { 0.5*flipx, 0.5*flipy}, - { 0.5*flipx, -0.5*flipy}}; + float pointsFlip[4][2] = {{(float)-0.5*flipx, (float)-0.5*flipy}, + {(float)-0.5*flipx, (float)0.5*flipy}, + { (float)0.5*flipx, (float)0.5*flipy}, + { (float)0.5*flipx, (float)-0.5*flipy}}; glVertexPointer(2,GL_FLOAT,0,pointsFlip); glDrawArrays(GL_TRIANGLE_FAN,0,4); diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.cpp b/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.cpp index f764295c0f..a0cc01e080 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.cpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.cpp @@ -278,7 +278,7 @@ DLLEXPORT void projectM::renderFrame() if ( timeKeeper->IsSmoothing() && timeKeeper->SmoothRatio() > 1.0 ) { CSectionLock lock(&mutex); - m_activePreset = m_activePreset2; + m_activePreset = std::move(m_activePreset2); switchPreset(m_activePreset2, presetInputs2, presetOutputs2); timeKeeper->EndSmoothing(); } @@ -800,7 +800,7 @@ void projectM::selectPreset ( unsigned int index ) timeKeeper->StartPreset(); } -void projectM::switchPreset(std::auto_ptr<Preset> & targetPreset, PresetInputs & inputs, PresetOutputs & outputs) { +void projectM::switchPreset(std::unique_ptr<Preset> & targetPreset, PresetInputs & inputs, PresetOutputs & outputs) { if (_settings.shuffleEnabled) *m_presetPos = m_presetChooser->weightedRandom(); diff --git a/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.hpp b/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.hpp index c32921572a..796eaa8384 100644 --- a/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.hpp +++ b/xbmc/visualizations/XBMCProjectM/libprojectM/projectM.hpp @@ -262,7 +262,7 @@ private: int count; float fpsstart; - void switchPreset(std::auto_ptr<Preset> & targetPreset, PresetInputs & inputs, PresetOutputs & outputs); + void switchPreset(std::unique_ptr<Preset> & targetPreset, PresetInputs & inputs, PresetOutputs & outputs); void readConfig(const Settings configpm); void projectM_init(int gx, int gy, int fps, int texsize, int width, int height, int xpos, int ypos, bool useFBO); void projectM_reset(); @@ -287,10 +287,10 @@ private: PresetChooser * m_presetChooser; /// Currently loaded preset - std::auto_ptr<Preset> m_activePreset; + std::unique_ptr<Preset> m_activePreset; /// Destination preset when smooth preset switching - std::auto_ptr<Preset> m_activePreset2; + std::unique_ptr<Preset> m_activePreset2; /// All readonly variables which are passed as inputs to presets PresetInputs presetInputs; diff --git a/xbmc/visualizations/XBMCProjectM/projectm_1.2.0.patch b/xbmc/visualizations/XBMCProjectM/projectm_1.2.0.patch index 83741189bd..1500e5f766 100644 --- a/xbmc/visualizations/XBMCProjectM/projectm_1.2.0.patch +++ b/xbmc/visualizations/XBMCProjectM/projectm_1.2.0.patch @@ -109,7 +109,7 @@ Index: projectM.hpp std::string menuFontURL; @@ -265,7 +267,7 @@ - void switchPreset(std::auto_ptr<Preset> & targetPreset, PresetInputs & inputs, PresetOutputs & outputs); + void switchPreset(std::unique_ptr<Preset> & targetPreset, PresetInputs & inputs, PresetOutputs & outputs); void readConfig(const std::string & configFile); - void projectM_init(int gx, int gy, int fps, int texsize, int width, int height); + void projectM_init(int gx, int gy, int fps, int texsize, int width, int height, int xpos, int ypos); diff --git a/xbmc/win32/WIN32Util.cpp b/xbmc/win32/WIN32Util.cpp index e3630e3647..662b6663f1 100644 --- a/xbmc/win32/WIN32Util.cpp +++ b/xbmc/win32/WIN32Util.cpp @@ -43,6 +43,8 @@ #include "utils/URIUtils.h" #include "utils/StringUtils.h" +#include <cassert> + #define DLL_ENV_PATH "special://xbmc/system/;" \ "special://xbmc/system/players/dvdplayer/;" \ "special://xbmc/system/players/paplayer/;" \ diff --git a/xbmc/win32/pch.h b/xbmc/win32/pch.h index 5ab70b51aa..d853096b6f 100644 --- a/xbmc/win32/pch.h +++ b/xbmc/win32/pch.h @@ -41,7 +41,7 @@ #else #include <d3d9types.h> #endif -#include "boost/shared_ptr.hpp" +#include <memory> // anything below here should be headers that very rarely (hopefully never) // change yet are included almost everywhere. /* empty */ diff --git a/xbmc/windowing/android/WinEventsAndroid.cpp b/xbmc/windowing/android/WinEventsAndroid.cpp index cce9b0df3c..b6402434e8 100644 --- a/xbmc/windowing/android/WinEventsAndroid.cpp +++ b/xbmc/windowing/android/WinEventsAndroid.cpp @@ -58,7 +58,7 @@ static bool different_event(XBMC_Event &curEvent, XBMC_Event &newEvent) return true; // different axis direction (handles -1 vs 1) - if (signbit(curEvent.jaxis.fvalue) != signbit(newEvent.jaxis.fvalue)) + if (std::signbit(curEvent.jaxis.fvalue) != std::signbit(newEvent.jaxis.fvalue)) return true; // different axis value (handles 0 vs 1 or -1) diff --git a/xbmc/windowing/egl/EGLNativeTypeIMX.cpp b/xbmc/windowing/egl/EGLNativeTypeIMX.cpp index 061f6e60e7..111406cce1 100644 --- a/xbmc/windowing/egl/EGLNativeTypeIMX.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeIMX.cpp @@ -18,6 +18,8 @@ * */ +#include <cstdlib> + #include "system.h" #include <EGL/egl.h> diff --git a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp index c58c28a3f4..749de8df4b 100644 --- a/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp +++ b/xbmc/windowing/egl/EGLNativeTypeRaspberryPI.cpp @@ -28,6 +28,7 @@ #include "linux/RBP.h" #include "utils/StringUtils.h" #include "settings/Settings.h" +#include <cassert> #ifndef __VIDEOCORE4__ #define __VIDEOCORE4__ diff --git a/xbmc/windows/GUIMediaWindow.cpp b/xbmc/windows/GUIMediaWindow.cpp index 6e909f2fcd..c8ccc85dfc 100644 --- a/xbmc/windows/GUIMediaWindow.cpp +++ b/xbmc/windows/GUIMediaWindow.cpp @@ -385,7 +385,7 @@ bool CGUIMediaWindow::OnMessage(CGUIMessage& message) } else if (message.GetParam1()==GUI_MSG_UPDATE_ITEM && message.GetItem()) { - CFileItemPtr newItem = boost::static_pointer_cast<CFileItem>(message.GetItem()); + CFileItemPtr newItem = std::static_pointer_cast<CFileItem>(message.GetItem()); if (IsActive()) { if (m_vecItems->UpdateItem(newItem.get()) && message.GetParam2() == 1) @@ -566,7 +566,7 @@ void CGUIMediaWindow::ClearFileItems() // \brief Sorts Fileitems based on the sort method and sort oder provided by guiViewState void CGUIMediaWindow::SortItems(CFileItemList &items) { - auto_ptr<CGUIViewState> guiState(CGUIViewState::GetViewState(GetID(), items)); + unique_ptr<CGUIViewState> guiState(CGUIViewState::GetViewState(GetID(), items)); if (guiState.get()) { @@ -622,7 +622,7 @@ void CGUIMediaWindow::FormatItemLabels(CFileItemList &items, const LABEL_MASKS & // \brief Prepares and adds the fileitems list/thumb panel void CGUIMediaWindow::FormatAndSort(CFileItemList &items) { - auto_ptr<CGUIViewState> viewState(CGUIViewState::GetViewState(GetID(), items)); + unique_ptr<CGUIViewState> viewState(CGUIViewState::GetViewState(GetID(), items)); if (viewState.get()) { @@ -1034,11 +1034,11 @@ bool CGUIMediaWindow::OnClick(int iItem) AddonPtr addon; if (CAddonMgr::Get().GetAddon(url.GetHostName(),addon)) { - PluginPtr plugin = boost::dynamic_pointer_cast<CPluginSource>(addon); + PluginPtr plugin = std::dynamic_pointer_cast<CPluginSource>(addon); if (plugin && plugin->Provides(CPluginSource::AUDIO)) { CFileItemList items; - auto_ptr<CGUIViewState> state(CGUIViewState::GetViewState(GetID(), items)); + unique_ptr<CGUIViewState> state(CGUIViewState::GetViewState(GetID(), items)); autoplay = state.get() && state->AutoPlayNextItem(); } } diff --git a/xbmc/windows/GUIMediaWindow.h b/xbmc/windows/GUIMediaWindow.h index bca88e3661..f961efb76f 100644 --- a/xbmc/windows/GUIMediaWindow.h +++ b/xbmc/windows/GUIMediaWindow.h @@ -163,7 +163,7 @@ protected: CFileItemList* m_vecItems; CFileItemList* m_unfilteredItems; ///< \brief items prior to filtering using FilterItems() CDirectoryHistory m_history; - std::auto_ptr<CGUIViewState> m_guiState; + std::unique_ptr<CGUIViewState> m_guiState; // save control state on window exit int m_iLastControl; diff --git a/xbmc/windows/GUIWindowFileManager.cpp b/xbmc/windows/GUIWindowFileManager.cpp index 5c483772ac..1f7b88b31f 100644 --- a/xbmc/windows/GUIWindowFileManager.cpp +++ b/xbmc/windows/GUIWindowFileManager.cpp @@ -594,7 +594,7 @@ void CGUIWindowFileManager::OnStart(CFileItem *pItem) if (pItem->IsPlayList()) { std::string strPlayList = pItem->GetPath(); - auto_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList)); + unique_ptr<CPlayList> pPlayList (CPlayListFactory::Create(strPlayList)); if (NULL != pPlayList.get()) { if (!pPlayList->Load(strPlayList)) diff --git a/xbmc/windows/GUIWindowScreensaver.cpp b/xbmc/windows/GUIWindowScreensaver.cpp index 0aa4418fa1..9d4778321d 100644 --- a/xbmc/windows/GUIWindowScreensaver.cpp +++ b/xbmc/windows/GUIWindowScreensaver.cpp @@ -142,7 +142,7 @@ bool CGUIWindowScreensaver::OnMessage(CGUIMessage& message) if (!CAddonMgr::Get().GetAddon(CSettings::Get().GetString("screensaver.mode"), addon, ADDON_SCREENSAVER)) return false; - m_addon = boost::dynamic_pointer_cast<CScreenSaver>(addon); + m_addon = std::dynamic_pointer_cast<CScreenSaver>(addon); if (!m_addon) return false; diff --git a/xbmc/windows/GUIWindowScreensaver.h b/xbmc/windows/GUIWindowScreensaver.h index af2cb3cd1c..128527d050 100644 --- a/xbmc/windows/GUIWindowScreensaver.h +++ b/xbmc/windows/GUIWindowScreensaver.h @@ -49,6 +49,6 @@ private: bool m_bInitialized; CCriticalSection m_critSection; #ifdef HAS_SCREENSAVER - boost::shared_ptr<ADDON::CScreenSaver> m_addon; + std::shared_ptr<ADDON::CScreenSaver> m_addon; #endif }; |