From 1ae05bab719de74d7d0c13f2344016bf2283ad2e Mon Sep 17 00:00:00 2001 From: kiritow <1362050620@qq.com> Date: Sat, 15 Jul 2017 00:12:48 +0800 Subject: [PATCH] Remove exception specification Exception Specification is deprecated in C++11. --- SDLWrapper/ErrorViewer.cpp | 2 +- SDLWrapper/ErrorViewer.h | 2 +- SDLWrapper/Font.cpp | 2 +- SDLWrapper/Font.h | 2 +- SDLWrapper/Renderer.cpp | 8 ++++---- SDLWrapper/Renderer.h | 8 ++++---- SDLWrapper/Sound.cpp | 4 ++-- SDLWrapper/Sound.h | 4 ++-- SDLWrapper/Surface.cpp | 10 +++++----- SDLWrapper/Surface.h | 10 +++++----- SDLWrapper/Window.cpp | 2 +- SDLWrapper/Window.h | 2 +- 12 files changed, 28 insertions(+), 28 deletions(-) diff --git a/SDLWrapper/ErrorViewer.cpp b/SDLWrapper/ErrorViewer.cpp index 5a20006..8d48fe5 100644 --- a/SDLWrapper/ErrorViewer.cpp +++ b/SDLWrapper/ErrorViewer.cpp @@ -11,7 +11,7 @@ std::string ErrorViewer::getError() const return str; } -const char * ErrorViewer::what() const throw() +const char * ErrorViewer::what() const noexcept { return str.c_str(); } diff --git a/SDLWrapper/ErrorViewer.h b/SDLWrapper/ErrorViewer.h index 465f6a2..88c7fcc 100644 --- a/SDLWrapper/ErrorViewer.h +++ b/SDLWrapper/ErrorViewer.h @@ -7,7 +7,7 @@ class ErrorViewer : public std::exception public: void fetch(); std::string getError() const; - const char* what() const throw() override; + const char* what() const noexcept override; private: std::string str; }; diff --git a/SDLWrapper/Font.cpp b/SDLWrapper/Font.cpp index 55682ac..9929f45 100644 --- a/SDLWrapper/Font.cpp +++ b/SDLWrapper/Font.cpp @@ -17,7 +17,7 @@ TTF_Font* Font::_get() const return _font.get(); } -Font::Font(const std::string& FontFileName, size_t size) throw(ErrorViewer) +Font::Font(const std::string& FontFileName, size_t size) { if (use(FontFileName, size) != 0) { diff --git a/SDLWrapper/Font.h b/SDLWrapper/Font.h index 1587746..43a317e 100644 --- a/SDLWrapper/Font.h +++ b/SDLWrapper/Font.h @@ -13,7 +13,7 @@ class Font { public: Font() = default; - Font(const std::string& FontFileName, size_t size) throw(ErrorViewer); + Font(const std::string& FontFileName, size_t size); int use(const std::string& FontFileName, size_t size); bool isReady() const; diff --git a/SDLWrapper/Renderer.cpp b/SDLWrapper/Renderer.cpp index 00664e0..1c72aaf 100644 --- a/SDLWrapper/Renderer.cpp +++ b/SDLWrapper/Renderer.cpp @@ -439,7 +439,7 @@ int Renderer::supercopy(const Texture& t, return SDL_RenderCopyEx(_get(),t._get(),pR1,pR2,angle,pPoint,flip); } -Texture Renderer::render(const Surface& surf) const throw(ErrorViewer) +Texture Renderer::render(const Surface& surf) const { Texture t; SDL_Texture* temp = SDL_CreateTextureFromSurface(_get(), surf._get()); @@ -453,7 +453,7 @@ Texture Renderer::render(const Surface& surf) const throw(ErrorViewer) return t; } -Texture Renderer::loadTexture(const std::string& FileName) const throw(ErrorViewer) +Texture Renderer::loadTexture(const std::string& FileName) const { Texture t; SDL_Texture* temp = IMG_LoadTexture(_get(), FileName.c_str()); @@ -467,7 +467,7 @@ Texture Renderer::loadTexture(const std::string& FileName) const throw(ErrorView return t; } -Texture Renderer::loadTextureRW(const RWOP& rwop) const throw (ErrorViewer) +Texture Renderer::loadTextureRW(const RWOP& rwop) const { Texture t; SDL_Texture* temp=IMG_LoadTexture_RW(_get(),rwop._get(),0); @@ -481,7 +481,7 @@ Texture Renderer::loadTextureRW(const RWOP& rwop) const throw (ErrorViewer) return t; } -Texture Renderer::createTexture(int Width, int Height) const throw(ErrorViewer) +Texture Renderer::createTexture(int Width, int Height) const { SDL_Texture* temp = SDL_CreateTexture(_get(), SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_TARGET, Width, Height); if (temp == NULL) diff --git a/SDLWrapper/Renderer.h b/SDLWrapper/Renderer.h index be95dfc..74b924e 100644 --- a/SDLWrapper/Renderer.h +++ b/SDLWrapper/Renderer.h @@ -111,10 +111,10 @@ public: double angle, bool haspoint,const Point& center,FlipMode mode); - Texture render(const Surface& surf) const throw (ErrorViewer); - Texture loadTexture(const std::string& FileName) const throw(ErrorViewer); - Texture loadTextureRW(const RWOP& rwop) const throw(ErrorViewer); - Texture createTexture(int Width, int Height) const throw(ErrorViewer); + Texture render(const Surface& surf) const; + Texture loadTexture(const std::string& FileName) const; + Texture loadTextureRW(const RWOP& rwop) const; + Texture createTexture(int Width, int Height) const; bool isRenderTargetSupported() const; bool isReady() const; diff --git a/SDLWrapper/Sound.cpp b/SDLWrapper/Sound.cpp index 768f7bd..1197ffa 100644 --- a/SDLWrapper/Sound.cpp +++ b/SDLWrapper/Sound.cpp @@ -157,14 +157,14 @@ SoundPlayer::SoundPlayer(int Channels) Mix_AllocateChannels(Channels); } -Channel SoundPlayer::playSound(Sound sound, int loops) throw(ErrorViewer) +Channel SoundPlayer::playSound(Sound sound, int loops) { Channel c; c.playSound(sound,loops); return c; } -Channel SoundPlayer::fadeIn(Sound sound, int loops, int ms) throw(ErrorViewer) +Channel SoundPlayer::fadeIn(Sound sound, int loops, int ms) { Channel c; c.fadeIn(sound,loops,ms); diff --git a/SDLWrapper/Sound.h b/SDLWrapper/Sound.h index 9cb9043..be8da1a 100644 --- a/SDLWrapper/Sound.h +++ b/SDLWrapper/Sound.h @@ -64,7 +64,7 @@ public: static std::string GetDecoderName(int index); SoundPlayer(int NumChannels = 16); - Channel playSound(Sound sound, int loops) throw (ErrorViewer); - Channel fadeIn(Sound sound, int loops, int ms) throw (ErrorViewer); + Channel playSound(Sound sound, int loops); + Channel fadeIn(Sound sound, int loops, int ms); }; #include "end_code.h" diff --git a/SDLWrapper/Surface.cpp b/SDLWrapper/Surface.cpp index 50b8e4a..d215bbd 100644 --- a/SDLWrapper/Surface.cpp +++ b/SDLWrapper/Surface.cpp @@ -25,7 +25,7 @@ void Surface::_set_no_delete(SDL_Surface* p) _surf.reset(p,[](SDL_Surface*) {}); } -Surface::Surface(int width,int height,int depth,int Rmask,int Gmask,int Bmask,int Amask) throw(ErrorViewer) +Surface::Surface(int width,int height,int depth,int Rmask,int Gmask,int Bmask,int Amask) { if(createAs(width,height,depth,Rmask,Gmask,Bmask,Amask)!=0) { @@ -35,13 +35,13 @@ Surface::Surface(int width,int height,int depth,int Rmask,int Gmask,int Bmask,in } } -Surface::Surface(int width,int height,int depth,RGBA maskPack) throw (ErrorViewer) +Surface::Surface(int width,int height,int depth,RGBA maskPack) : Surface(width,height,depth,maskPack.r,maskPack.g,maskPack.b,maskPack.a) { } -Surface::Surface(int width,int height,int depth,Uint32 surfaceFormat) throw(ErrorViewer) +Surface::Surface(int width,int height,int depth,Uint32 surfaceFormat) { if(createAs(width,height,depth,surfaceFormat)!=0) { @@ -51,7 +51,7 @@ Surface::Surface(int width,int height,int depth,Uint32 surfaceFormat) throw(Erro } } -Surface::Surface(const std::string& filename) throw(ErrorViewer) +Surface::Surface(const std::string& filename) { if(loadAs(filename)!=0) { @@ -61,7 +61,7 @@ Surface::Surface(const std::string& filename) throw(ErrorViewer) } } -Surface::Surface(const RWOP& rwop) throw (ErrorViewer) +Surface::Surface(const RWOP& rwop) { if(loadAs(rwop)!=0) { diff --git a/SDLWrapper/Surface.h b/SDLWrapper/Surface.h index 3fce1dc..0d53988 100644 --- a/SDLWrapper/Surface.h +++ b/SDLWrapper/Surface.h @@ -11,11 +11,11 @@ class Surface { public: Surface()=default; - Surface(int width,int height,int depth,int Rmask,int Gmask,int Bmask,int Amask) throw(ErrorViewer); - Surface(int width,int height,int depth,RGBA colorPack) throw(ErrorViewer); - Surface(int width,int height,int depth,Uint32 surfaceFormat) throw(ErrorViewer); - Surface(const std::string& filename) throw(ErrorViewer); - Surface(const RWOP& rwop) throw(ErrorViewer); + Surface(int width,int height,int depth,int Rmask,int Gmask,int Bmask,int Amask); + Surface(int width,int height,int depth,RGBA colorPack); + Surface(int width,int height,int depth,Uint32 surfaceFormat); + Surface(const std::string& filename); + Surface(const RWOP& rwop); ~Surface() = default; /// static functions diff --git a/SDLWrapper/Window.cpp b/SDLWrapper/Window.cpp index d005824..0ffd1e1 100644 --- a/SDLWrapper/Window.cpp +++ b/SDLWrapper/Window.cpp @@ -20,7 +20,7 @@ SDL_Window* Window::_get() const } Window::Window(std::string Title, int Width, int Height, - std::initializer_list WindowFlags, int WindowPositionX, int WindowPositionY) throw(ErrorViewer) + std::initializer_list WindowFlags, int WindowPositionX, int WindowPositionY) { /// Calculate Window Flags Uint32 windowFlag=0; diff --git a/SDLWrapper/Window.h b/SDLWrapper/Window.h index 644bd0f..70ac461 100644 --- a/SDLWrapper/Window.h +++ b/SDLWrapper/Window.h @@ -13,7 +13,7 @@ public: Window()=default; Window(std::string Title, int Width, int Height, std::initializer_list WindowFlags = {WindowType::Shown}, - int WindowPositionX=SDL_WINDOWPOS_CENTERED, int WindowPositionY=SDL_WINDOWPOS_CENTERED) throw(ErrorViewer); + int WindowPositionX=SDL_WINDOWPOS_CENTERED, int WindowPositionY=SDL_WINDOWPOS_CENTERED); Rect getSize() const; void setSize(const Rect& sizeRect);