remove all "using namespace" from header files
authorSam Stenvall <neggelandia@gmail.com>
Mon, 7 Apr 2014 13:48:23 +0000 (16:48 +0300)
committerSam Stenvall <neggelandia@gmail.com>
Sun, 13 Jul 2014 08:30:18 +0000 (11:30 +0300)
35 files changed:
xbmc/Util.cpp
xbmc/addons/AddonDll.h
xbmc/addons/AddonManager.cpp
xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.cpp
xbmc/cores/dvdplayer/DVDCodecs/Video/VDPAU.h
xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideoPrivate.cpp
xbmc/cores/dvdplayer/DVDCodecs/Video/libstagefrightICS/StageFrightVideoPrivate.h
xbmc/cores/omxplayer/OMXImage.cpp
xbmc/cores/omxplayer/OMXImage.h
xbmc/cores/omxplayer/OMXPlayerAudio.cpp
xbmc/cores/omxplayer/OMXPlayerAudio.h
xbmc/cores/omxplayer/OMXPlayerVideo.cpp
xbmc/cores/omxplayer/OMXPlayerVideo.h
xbmc/filesystem/FTPParse.cpp
xbmc/filesystem/FTPParse.h
xbmc/guilib/GUIShader.cpp
xbmc/guilib/GUIShader.h
xbmc/music/MusicDatabase.cpp
xbmc/music/windows/GUIWindowMusicSongs.cpp
xbmc/pvr/channels/PVRChannel.cpp
xbmc/pvr/channels/PVRChannelGroup.cpp
xbmc/pvr/recordings/PVRRecordings.cpp
xbmc/pvr/windows/GUIWindowPVRCommon.cpp
xbmc/storage/IoSupport.cpp
xbmc/storage/MediaManager.cpp
xbmc/storage/MediaManager.h
xbmc/utils/WindowsShortcut.cpp
xbmc/utils/WindowsShortcut.h
xbmc/visualizations/Vortex/VortexVis/Core/Mesh.cpp
xbmc/visualizations/Vortex/VortexVis/Core/Mesh.h
xbmc/visualizations/Vortex/VortexVis/Core/Texture.cpp
xbmc/visualizations/Vortex/VortexVis/Core/Texture.h
xbmc/visualizations/Vortex/VortexVis/Effects/VoicePrint.cpp
xbmc/visualizations/Vortex/VortexVis/Effects/VoicePrint.h
xbmc/windowing/osx/WinSystemIOS.mm

index 8836fde..d562f8c 100644 (file)
@@ -99,6 +99,9 @@
 
 using namespace std;
 
+#ifdef HAS_DVD_DRIVE
+using namespace MEDIA_DETECT;
+#endif
 
 #define clamp(x) (x) > 255.f ? 255 : ((x) < 0 ? 0 : (BYTE)(x+0.5f)) // Valid ranges: brightness[-1 -> 1 (0 is default)] contrast[0 -> 2 (1 is default)]  gamma[0.5 -> 3.5 (1 is default)] default[ramp is linear]
 static const int64_t SECS_BETWEEN_EPOCHS = 11644473600LL;
index 5b082f3..b48fd1e 100644 (file)
@@ -34,8 +34,6 @@
 #include "interfaces/AnnouncementManager.h"
 #include "utils/XMLUtils.h"
 
-using namespace XFILE;
-
 namespace ADDON
 {
   template<class TheDll, typename TheStruct, typename TheProps>
@@ -172,8 +170,8 @@ bool CAddonDll<TheDll, TheStruct, TheProps>::LoadDll()
     URIUtils::RemoveExtension(strFileName);
     strFileName += "-" + ID() + extension;
 
-    if (!CFile::Exists(strFileName))
-      CFile::Copy(LibPath(), strFileName);
+    if (!XFILE::CFile::Exists(strFileName))
+      XFILE::CFile::Copy(LibPath(), strFileName);
 
     CLog::Log(LOGNOTICE, "ADDON: Loaded virtual child addon %s", strFileName.c_str());
   }
@@ -182,19 +180,19 @@ bool CAddonDll<TheDll, TheStruct, TheProps>::LoadDll()
 #if defined(TARGET_ANDROID)
   // Android libs MUST live in this path, else multi-arch will break.
   // The usual soname requirements apply. no subdirs, and filename is ^lib.*\.so$
-  if (!CFile::Exists(strFileName))
+  if (!XFILE::CFile::Exists(strFileName))
   {
     CStdString tempbin = getenv("XBMC_ANDROID_LIBS");
     strFileName = tempbin + "/" + m_strLibName;
   }
 #endif
-  if (!CFile::Exists(strFileName))
+  if (!XFILE::CFile::Exists(strFileName))
   {
     CStdString temp = CSpecialProtocol::TranslatePath("special://xbmc/");
     CStdString tempbin = CSpecialProtocol::TranslatePath("special://xbmcbin/");
     strFileName.erase(0, temp.size());
     strFileName = tempbin + strFileName;
-    if (!CFile::Exists(strFileName))
+    if (!XFILE::CFile::Exists(strFileName))
     {
       CLog::Log(LOGERROR, "ADDON: Could not locate %s", m_strLibName.c_str());
       return false;
index 34b170c..a4daf38 100644 (file)
@@ -53,6 +53,7 @@
 
 using namespace std;
 using namespace PVR;
+using namespace XFILE;
 
 namespace ADDON
 {
index e58681b..3085c43 100644 (file)
@@ -37,6 +37,7 @@
 #include "DVDCodecs/DVDCodecUtils.h"
 #include "cores/VideoRenderers/RenderFlags.h"
 
+using namespace Actor;
 using namespace VDPAU;
 #define NUM_RENDER_PICS 7
 #define NUM_CROP_PIX 3
index 8efadc1..d3cef69 100644 (file)
@@ -64,9 +64,6 @@ extern "C" {
 #include "libavcodec/vdpau.h"
 }
 
-using namespace Actor;
-
-
 #define FULLHD_WIDTH                       1920
 #define MAX_PIC_Q_LENGTH                   20 //for non-interop_yuv this controls the max length of the decoded pic to render completion Q
 
@@ -240,7 +237,7 @@ private:
 // Mixer
 //-----------------------------------------------------------------------------
 
-class CMixerControlProtocol : public Protocol
+class CMixerControlProtocol : public Actor::Protocol
 {
 public:
   CMixerControlProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Protocol(name, inEvent, outEvent) {};
@@ -257,7 +254,7 @@ public:
   };
 };
 
-class CMixerDataProtocol : public Protocol
+class CMixerDataProtocol : public Actor::Protocol
 {
 public:
   CMixerDataProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Protocol(name, inEvent, outEvent) {};
@@ -291,7 +288,7 @@ protected:
   void OnStartup();
   void OnExit();
   void Process();
-  void StateMachine(int signal, Protocol *port, Message *msg);
+  void StateMachine(int signal, Actor::Protocol *port, Actor::Message *msg);
   void Init();
   void Uninit();
   void Flush();
@@ -377,10 +374,10 @@ struct VdpauBufferPool
   CCriticalSection renderPicSec;
 };
 
-class COutputControlProtocol : public Protocol
+class COutputControlProtocol : public Actor::Protocol
 {
 public:
-  COutputControlProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Protocol(name, inEvent, outEvent) {};
+  COutputControlProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Actor::Protocol(name, inEvent, outEvent) {};
   enum OutSignal
   {
     INIT,
@@ -396,10 +393,10 @@ public:
   };
 };
 
-class COutputDataProtocol : public Protocol
+class COutputDataProtocol : public Actor::Protocol
 {
 public:
-  COutputDataProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Protocol(name, inEvent, outEvent) {};
+  COutputDataProtocol(std::string name, CEvent* inEvent, CEvent *outEvent) : Actor::Protocol(name, inEvent, outEvent) {};
   enum OutSignal
   {
     NEWFRAME = 0,
@@ -430,7 +427,7 @@ protected:
   void OnStartup();
   void OnExit();
   void Process();
-  void StateMachine(int signal, Protocol *port, Message *msg);
+  void StateMachine(int signal, Actor::Protocol *port, Actor::Message *msg);
   bool HasWork();
   CVdpauRenderPicture *ProcessMixerPicture();
   void QueueReturnPicture(CVdpauRenderPicture *pic);
index 5031df8..36f226a 100644 (file)
@@ -59,6 +59,8 @@ int NP2( unsigned x ) {
   return ++x;
 }
 
+using namespace android;
+
 CStageFrightVideoPrivate::CStageFrightVideoPrivate()
     : decode_thread(NULL), source(NULL)
     , eglDisplay(EGL_NO_DISPLAY), eglSurface(EGL_NO_SURFACE), eglContext(EGL_NO_CONTEXT)
index 34e9c50..ebd19ce 100644 (file)
@@ -59,8 +59,6 @@ class CAdvancedSettings;
 class CApplication;
 class CApplicationMessenger;
 
-using namespace android;
-
 struct stSlot
 {
   GLuint texid;
@@ -70,12 +68,12 @@ struct stSlot
 
 struct Frame
 {
-  status_t status;
+  android::status_t status;
   int32_t width, height;
   int64_t pts;
   ERenderFormat format;
   EGLImageKHR eglimg;
-  MediaBuffer* medbuf;
+  android::MediaBuffer* medbuf;
 };
 
 enum StageFrightQuirks
@@ -84,14 +82,14 @@ enum StageFrightQuirks
   QuirkSWRender = 0x01,
 };
 
-class CStageFrightVideoPrivate : public MediaBufferObserver
+class CStageFrightVideoPrivate : public android::MediaBufferObserver
 {
 public:
   CStageFrightVideoPrivate();
 
-  virtual void signalBufferReturned(MediaBuffer *buffer);
+  virtual void signalBufferReturned(android::MediaBuffer *buffer);
 
-  MediaBuffer* getBuffer(size_t size);
+  android::MediaBuffer* getBuffer(size_t size);
   bool inputBufferAvailable();
 
   stSlot* getSlot(EGLImageKHR eglimg);
@@ -106,9 +104,9 @@ public:
 public:
   CStageFrightDecodeThread* decode_thread;
 
-  sp<MediaSource> source;
+  android::sp<android::MediaSource> source;
 
-  MediaBuffer* inbuf[INBUFCOUNT];
+  android::MediaBuffer* inbuf[INBUFCOUNT];
 
   GLuint mPgm;
   GLint mPositionHandle;
@@ -128,7 +126,7 @@ public:
 
   stSlot texslots[NUMFBOTEX];
 
-  sp<MetaData> meta;
+  android::sp<android::MetaData> meta;
   int64_t framecount;
   std::list<Frame*> in_queue;
   std::map<int64_t, Frame*> out_queue;
@@ -146,8 +144,8 @@ public:
   int width, height;
   int texwidth, texheight;
 
-  OMXClient *client;
-  sp<MediaSource> decoder;
+  android::OMXClient *client;
+  android::sp<android::MediaSource> decoder;
   const char *decoder_component;
   int videoColorFormat;
   int videoStride;
@@ -162,7 +160,7 @@ public:
   unsigned int mVideoTextureId;
   CJNISurfaceTexture* mSurfTexture;
   CJNISurface* mSurface;
-  sp<ANativeWindow> mVideoNativeWindow;
+  android::sp<ANativeWindow> mVideoNativeWindow;
 
   static void  CallbackInitSurfaceTexture(void*);
   bool InitSurfaceTexture();
index 262a004..6e20ead 100644 (file)
@@ -54,6 +54,9 @@
 #endif
 #define CLASSNAME "COMXImage"
 
+using namespace std;
+using namespace XFILE;
+
 COMXImage::COMXImage()
 : CThread("CRBPWorker")
 {
index ec7a229..3b30741 100644 (file)
@@ -39,9 +39,6 @@
 #include <EGL/eglext.h>
 #include "threads/Thread.h"
 
-using namespace XFILE;
-using namespace std;
-
 class COMXImageFile;
 
 class COMXImage : public CThread
index d3348ec..4ed8d17 100644 (file)
@@ -47,6 +47,8 @@
 #include <iostream>
 #include <sstream>
 
+using namespace std;
+
 class COMXMsgAudioCodecChange : public CDVDMsg
 {
 public:
index 685a686..57af63c 100644 (file)
@@ -37,8 +37,6 @@
 #include "utils/BitstreamStats.h"
 #include "xbmc/linux/DllBCM.h"
 
-using namespace std;
-
 class OMXPlayerAudio : public CThread
 {
 protected:
index 2fdbe18..af439e7 100644 (file)
@@ -51,6 +51,7 @@
 #include "linux/RBP.h"
 
 using namespace RenderManager;
+using namespace std;
 
 class COMXMsgVideoCodecChange : public CDVDMsg
 {
index 6f19395..0e5d488 100644 (file)
@@ -39,8 +39,6 @@
 #include "linux/DllBCM.h"
 #include "cores/VideoRenderers/RenderManager.h"
 
-using namespace std;
-
 class OMXPlayerVideo : public CThread
 {
 protected:
index 1de9db9..0ce4e08 100644 (file)
@@ -30,6 +30,8 @@
 #include <cmath>
 #include "FTPParse.h"
 
+using namespace std;
+
 CFTPParse::CFTPParse()
 {
   m_name = "";
index 52a8b64..2a2912f 100644 (file)
 #include <ctime>
 #include <stdint.h>
 
-using namespace std;
-
 class CFTPParse
 {
 public:
   CFTPParse();
-  int FTPParse(string str);
-  string getName();
+  int FTPParse(std::string str);
+  std::string getName();
   int getFlagtrycwd();
   int getFlagtryretr();
   uint64_t getSize();
   time_t getTime();
 private:
-  string m_name;            // not necessarily 0-terminated
+  std::string m_name;            // not necessarily 0-terminated
   int m_flagtrycwd;         // 0 if cwd is definitely pointless, 1 otherwise
   int m_flagtryretr;        // 0 if retr is definitely pointless, 1 otherwise
   uint64_t m_size;              // number of octets
   time_t m_time;            // modification time
-  void setTime(string str); // Method used to set m_time from a string
+  void setTime(std::string str); // Method used to set m_time from a string
   int getDayOfWeek(int month, int date, int year); // Method to get day of week
 };
index 11089b8..23cb84f 100644 (file)
@@ -27,6 +27,8 @@
 #include "MatrixGLES.h"
 #include "utils/log.h"
 
+using namespace Shaders;
+
 CGUIShader::CGUIShader( const char *shader ) : CGLSLShaderProgram("guishader_vert.glsl", shader)
 {
   // Initialise values
index c7e95aa..f7b5d9a 100644 (file)
@@ -25,9 +25,7 @@
 
 #include "Shader.h"
 
-using namespace Shaders;
-
-class CGUIShader : public CGLSLShaderProgram
+class CGUIShader : public Shaders::CGLSLShaderProgram
 {
 public:
   CGUIShader( const char *shader = 0 );
index e2dde83..a430ce3 100644 (file)
@@ -78,6 +78,7 @@ using ADDON::AddonPtr;
 
 #ifdef HAS_DVD_DRIVE
 using namespace CDDB;
+using namespace MEDIA_DETECT;
 #endif
 
 static void AnnounceRemove(const std::string& content, int id)
index 00d66a4..865dbcf 100644 (file)
@@ -54,6 +54,9 @@
 #define CONTROL_BTNREC            10
 #define CONTROL_BTNRIP            11
 
+#ifdef HAS_DVD_DRIVE
+using namespace MEDIA_DETECT;
+#endif
 
 CGUIWindowMusicSongs::CGUIWindowMusicSongs(void)
     : CGUIWindowMusicBase(WINDOW_MUSIC_FILES, "MyMusicSongs.xml")
index e0954db..88a9e91 100644 (file)
@@ -766,7 +766,7 @@ bool CPVRChannel::IsUserSetIcon(void) const
 
 bool CPVRChannel::IsIconExists() const
 {
-  return  CFile::Exists(IconPath());
+  return XFILE::CFile::Exists(IconPath());
 }
 
 bool CPVRChannel::IsUserSetName() const
index 20eb9be..d52c0be 100644 (file)
@@ -247,7 +247,7 @@ void CPVRChannelGroup::SearchAndSetChannelIcons(bool bUpdateDb /* = false */)
 
   /* fetch files in icon path for fast lookup */
   CFileItemList fileItemList;
-  CDirectory::GetDirectory(iconPath, fileItemList, ".jpg|.png|.tbn");
+  XFILE::CDirectory::GetDirectory(iconPath, fileItemList, ".jpg|.png|.tbn");
 
   if (fileItemList.IsEmpty())
     return;
index a574bc1..5805c69 100644 (file)
@@ -383,7 +383,7 @@ bool CPVRRecordings::SetRecordingsPlayCount(const CFileItemPtr &item, int count)
     if (item->m_bIsFolder)
     {
       CStdString strPath = item->GetPath();
-      CDirectory::GetDirectory(strPath, items);
+      XFILE::CDirectory::GetDirectory(strPath, items);
     }
     else
       items.Add(item);
index 0f87b14..00473eb 100644 (file)
@@ -671,7 +671,7 @@ bool CGUIWindowPVRCommon::PlayRecording(CFileItem *item, bool bPlayMinimized /*
       CStdString dir = stream.substr(0, found).c_str();
 
       CFileItemList items;
-      CDirectory::GetDirectory(dir, items);
+      XFILE::CDirectory::GetDirectory(dir, items);
       items.Sort(SortByFile, SortOrderAscending);
 
       vector<int> stack;
@@ -684,7 +684,7 @@ bool CGUIWindowPVRCommon::PlayRecording(CFileItem *item, bool bPlayMinimized /*
       if (stack.size() > 0)
       {
         /* If we have a stack change the path of the item to it */
-        CStackDirectory dir;
+        XFILE::CStackDirectory dir;
         CStdString stackPath = dir.ConstructStackPath(items, stack);
         item->SetPath(stackPath);
       }
index 4ac2991..85e9391 100644 (file)
@@ -66,6 +66,9 @@
 #include "XHandle.h"
 #endif
 
+#ifdef HAS_DVD_DRIVE
+using namespace MEDIA_DETECT;
+#endif
 
 PVOID CIoSupport::m_rawXferBuffer;
 
index 5d08030..9cd68e6 100644 (file)
 using namespace std;
 using namespace XFILE;
 
+#ifdef HAS_DVD_DRIVE
+using namespace MEDIA_DETECT;
+#endif
+
 const char MEDIA_SOURCES_XML[] = { "special://profile/mediasources.xml" };
 
 class CMediaManager g_mediaManager;
index ddab4d1..8bafd4f 100644 (file)
 #include "IStorageProvider.h"
 #include "threads/CriticalSection.h"
 
-#ifdef HAS_DVD_DRIVE
-using namespace MEDIA_DETECT;
-#endif
-
 #define TRAY_OPEN     16
 #define TRAY_CLOSED_NO_MEDIA  64
 #define TRAY_CLOSED_MEDIA_PRESENT 96
@@ -76,7 +72,7 @@ public:
   CStdString TranslateDevicePath(const CStdString& devicePath, bool bReturnAsDevice=false);
   DWORD GetDriveStatus(const CStdString& devicePath="");
 #ifdef HAS_DVD_DRIVE
-  CCdInfo* GetCdInfo(const CStdString& devicePath="");
+  MEDIA_DETECT::CCdInfo* GetCdInfo(const CStdString& devicePath="");
   bool RemoveCdInfo(const CStdString& devicePath="");
   CStdString GetDiskLabel(const CStdString& devicePath="");
   CStdString GetDiskUniqueId(const CStdString& devicePath="");
@@ -103,7 +99,7 @@ protected:
 
   CCriticalSection m_muAutoSource, m_CritSecStorageProvider;
 #ifdef HAS_DVD_DRIVE
-  std::map<CStdString,CCdInfo*> m_mapCdInfo;
+  std::map<CStdString,MEDIA_DETECT::CCdInfo*> m_mapCdInfo;
 #endif
   bool m_bhasoptical;
   CStdString m_strFirstAvailDrive;
index 8905b14..1ba6325 100644 (file)
@@ -42,6 +42,9 @@ static char THIS_FILE[] = __FILE__;
 
 #define VOLUME_LOCAL        1
 #define VOLUME_NETWORK      2
+
+using namespace std;
+
 //////////////////////////////////////////////////////////////////////
 // Construction/Destruction
 //////////////////////////////////////////////////////////////////////
index 18e3bb0..a79e95f 100644 (file)
@@ -30,7 +30,7 @@
  */
 
 #include <string>
-using namespace std;
+
 class CWindowsShortcut
 {
 public:
index cf46f25..411851e 100644 (file)
@@ -21,6 +21,8 @@
 #include <new>
 #include <stdio.h>
 
+using namespace std;
+
 Mesh::Mesh()
 {
        m_iRefCount = 1;
index e13f595..ff63266 100644 (file)
 #include "Renderer.h"
 #include <string>
 
-using namespace std;
-
 class Mesh
 {
 public:
                Mesh();
-               void CreateTextMesh( string& InString, bool bCentered = true );
+               void CreateTextMesh( std::string& InString, bool bCentered = true );
 
                void AddRef();
                void Release();
index 9630d17..0090b64 100644 (file)
@@ -22,6 +22,8 @@
 #include <new>
 #include <stdio.h>
 
+using namespace std;
+
 Texture::Texture()
 {
        m_iRefCount = 1;
index c512800..44c88b1 100644 (file)
 #include "Renderer.h"
 #include <string>
 
-using namespace std;
-
 class Texture
 {
 public:
        Texture();
        void CreateTexture();
-       void LoadTexture( string& filename );
+       void LoadTexture( std::string& filename );
 
        void AddRef();
        void Release();
index b7b966e..6b6b19a 100644 (file)
@@ -22,6 +22,8 @@
 #include "Shader.h"
 #include "angelscript.h"
 
+using namespace std;
+
 char ColourRemapPixelShaderSrc[] =
 {
        " sampler2D SpectrumTexture : tex0;                                                                             \n"
index 6f316e2..4a13546 100644 (file)
@@ -25,8 +25,6 @@
 #include "EffectBase.h"
 #include <string>
 
-using namespace std;
-
 class VoicePrint : public EffectBase
 {
 public:
@@ -35,7 +33,7 @@ public:
        ~VoicePrint();
        void Init();
        void Render();
-       void LoadColourMap( string& filename );
+       void LoadColourMap( std::string& filename );
        void SetRect(float minX, float minY, float maxX, float maxY);
        void SetSpeed(float speed);
 
index 97918ae..4968f16 100644 (file)
@@ -300,7 +300,7 @@ bool CWinSystemIOS::IsExtSupported(const char* extension)
   name += extension;
   name += " ";
 
-  return m_eglext.find(name) != string::npos;
+  return m_eglext.find(name) != std::string::npos;
 }
 
 bool CWinSystemIOS::BeginRender()