Skip to content

Commit

Permalink
c++11: Remove compat header base/functional.h
Browse files Browse the repository at this point in the history
We want a proper C++11, not tr1. We don't target those compilers anyway.
  • Loading branch information
Orphis committed Oct 12, 2016
1 parent 4f655f8 commit e0ff68b
Show file tree
Hide file tree
Showing 46 changed files with 104 additions and 131 deletions.
1 change: 0 additions & 1 deletion CMakeLists.txt
Expand Up @@ -896,7 +896,6 @@ add_library(native STATIC
ext/native/base/colorutil.h
ext/native/base/display.cpp
ext/native/base/display.h
ext/native/base/functional.h
ext/native/base/linked_ptr.h
ext/native/base/logging.h
ext/native/base/mutex.h
Expand Down
10 changes: 0 additions & 10 deletions Common/ChunkFile.h
Expand Up @@ -32,11 +32,7 @@
#include <deque>
#include <list>
#include <set>
#if defined(MACGNUSTD)
#include <tr1/type_traits>
#else
#include <type_traits>
#endif

#include "Common.h"
#include "FileUtil.h"
Expand All @@ -46,12 +42,6 @@
#include "../ext/snappy/snappy-c.h"
#endif

#if defined(MACGNUSTD)
namespace std {
using tr1::is_pointer;
}
#endif

template <class T>
struct LinkedListItem : public T
{
Expand Down
4 changes: 2 additions & 2 deletions Core/Config.cpp
Expand Up @@ -15,12 +15,12 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.

#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <functional>

#include "base/display.h"
#include "base/functional.h"
#include "base/NativeApp.h"
#include "ext/vjson/json.h"
#include "file/ini_file.h"
Expand Down
3 changes: 2 additions & 1 deletion Core/HLE/sceSas.cpp
Expand Up @@ -27,8 +27,9 @@
// https://github.com/hrydgard/ppsspp/issues/1078

#include <cstdlib>
#include <functional>

#include "base/basictypes.h"
#include "base/functional.h"
#include "base/mutex.h"
#include "profiler/profiler.h"
#include "thread/thread.h"
Expand Down
2 changes: 1 addition & 1 deletion Core/SaveState.h
Expand Up @@ -15,10 +15,10 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.

#include <functional>
#include <string>
#include <vector>

#include "base/functional.h"
#include "Common/ChunkFile.h"

namespace SaveState
Expand Down
24 changes: 12 additions & 12 deletions GPU/Common/TextureScalerCommon.cpp
Expand Up @@ -607,22 +607,22 @@ bool TextureScaler::Scale(u32* &data, u32 &dstFmt, int &width, int &height, int

void TextureScaler::ScaleXBRZ(int factor, u32* source, u32* dest, int width, int height) {
xbrz::ScalerCfg cfg;
GlobalThreadPool::Loop(std::bind(&xbrz::scale, factor, source, dest, width, height, xbrz::ColorFormat::ARGB, cfg, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&xbrz::scale, factor, source, dest, width, height, xbrz::ColorFormat::ARGB, cfg, std::placeholders::_1, std::placeholders::_2), 0, height);
}

void TextureScaler::ScaleBilinear(int factor, u32* source, u32* dest, int width, int height) {
bufTmp1.resize(width*height*factor);
u32 *tmpBuf = bufTmp1.data();
GlobalThreadPool::Loop(std::bind(&bilinearH, factor, source, tmpBuf, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&bilinearV, factor, tmpBuf, dest, width, 0, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&bilinearH, factor, source, tmpBuf, width, std::placeholders::_1, std::placeholders::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&bilinearV, factor, tmpBuf, dest, width, 0, height, std::placeholders::_1, std::placeholders::_2), 0, height);
}

void TextureScaler::ScaleBicubicBSpline(int factor, u32* source, u32* dest, int width, int height) {
GlobalThreadPool::Loop(std::bind(&scaleBicubicBSpline, factor, source, dest, width, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&scaleBicubicBSpline, factor, source, dest, width, height, std::placeholders::_1, std::placeholders::_2), 0, height);
}

void TextureScaler::ScaleBicubicMitchell(int factor, u32* source, u32* dest, int width, int height) {
GlobalThreadPool::Loop(std::bind(&scaleBicubicMitchell, factor, source, dest, width, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&scaleBicubicMitchell, factor, source, dest, width, height, std::placeholders::_1, std::placeholders::_2), 0, height);
}

void TextureScaler::ScaleHybrid(int factor, u32* source, u32* dest, int width, int height, bool bicubic) {
Expand All @@ -638,8 +638,8 @@ void TextureScaler::ScaleHybrid(int factor, u32* source, u32* dest, int width, i
bufTmp1.resize(width*height);
bufTmp2.resize(width*height*factor*factor);
bufTmp3.resize(width*height*factor*factor);
GlobalThreadPool::Loop(std::bind(&generateDistanceMask, source, bufTmp1.data(), width, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convolve3x3, bufTmp1.data(), bufTmp2.data(), KERNEL_SPLAT, width, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&generateDistanceMask, source, bufTmp1.data(), width, height, std::placeholders::_1, std::placeholders::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convolve3x3, bufTmp1.data(), bufTmp2.data(), KERNEL_SPLAT, width, height, std::placeholders::_1, std::placeholders::_2), 0, height);
ScaleBilinear(factor, bufTmp2.data(), bufTmp3.data(), width, height);
// mask C is now in bufTmp3

Expand All @@ -652,13 +652,13 @@ void TextureScaler::ScaleHybrid(int factor, u32* source, u32* dest, int width, i

// Now we can mix it all together
// The factor 8192 was found through practical testing on a variety of textures
GlobalThreadPool::Loop(std::bind(&mix, dest, bufTmp2.data(), bufTmp3.data(), 8192, width*factor, placeholder::_1, placeholder::_2), 0, height*factor);
GlobalThreadPool::Loop(std::bind(&mix, dest, bufTmp2.data(), bufTmp3.data(), 8192, width*factor, std::placeholders::_1, std::placeholders::_2), 0, height*factor);
}

void TextureScaler::DePosterize(u32* source, u32* dest, int width, int height) {
bufTmp3.resize(width*height);
GlobalThreadPool::Loop(std::bind(&deposterizeH, source, bufTmp3.data(), width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeV, bufTmp3.data(), dest, width, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeH, dest, bufTmp3.data(), width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeV, bufTmp3.data(), dest, width, height, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeH, source, bufTmp3.data(), width, std::placeholders::_1, std::placeholders::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeV, bufTmp3.data(), dest, width, height, std::placeholders::_1, std::placeholders::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeH, dest, bufTmp3.data(), width, std::placeholders::_1, std::placeholders::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&deposterizeV, bufTmp3.data(), dest, width, height, std::placeholders::_1, std::placeholders::_2), 0, height);
}
3 changes: 2 additions & 1 deletion GPU/Debugger/Stepping.h
Expand Up @@ -17,7 +17,8 @@

#pragma once

#include "base/functional.h"
#include <functional>

#include "Common/CommonTypes.h"
#include "GPU/Common/GPUDebugInterface.h"

Expand Down
8 changes: 4 additions & 4 deletions GPU/Directx9/TextureScalerDX9.cpp
Expand Up @@ -47,15 +47,15 @@ void TextureScalerDX9::ConvertTo8888(u32 format, u32* source, u32* &dest, int wi
break;

case D3DFMT_A4R4G4B4:
GlobalThreadPool::Loop(std::bind(&convert4444_dx9, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert4444_dx9, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;

case D3DFMT_R5G6B5:
GlobalThreadPool::Loop(std::bind(&convert565_dx9, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert565_dx9, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;

case D3DFMT_A1R5G5B5:
GlobalThreadPool::Loop(std::bind(&convert5551_dx9, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert5551_dx9, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;

default:
Expand All @@ -64,4 +64,4 @@ void TextureScalerDX9::ConvertTo8888(u32 format, u32* source, u32* &dest, int wi
}
}

} // namespace
} // namespace
6 changes: 3 additions & 3 deletions GPU/GLES/TextureScaler.cpp
Expand Up @@ -44,15 +44,15 @@ void TextureScalerGL::ConvertTo8888(u32 format, u32* source, u32* &dest, int wid
break;

case GL_UNSIGNED_SHORT_4_4_4_4:
GlobalThreadPool::Loop(std::bind(&convert4444_gl, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert4444_gl, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;

case GL_UNSIGNED_SHORT_5_6_5:
GlobalThreadPool::Loop(std::bind(&convert565_gl, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert565_gl, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;

case GL_UNSIGNED_SHORT_5_5_5_1:
GlobalThreadPool::Loop(std::bind(&convert5551_gl, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert5551_gl, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;

default:
Expand Down
6 changes: 3 additions & 3 deletions GPU/Vulkan/TextureScalerVulkan.cpp
Expand Up @@ -51,15 +51,15 @@ void TextureScalerVulkan::ConvertTo8888(u32 format, u32* source, u32* &dest, int
break;

case VULKAN_4444_FORMAT:
GlobalThreadPool::Loop(std::bind(&convert4444_dx9, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert4444_dx9, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;

case VULKAN_565_FORMAT:
GlobalThreadPool::Loop(std::bind(&convert565_dx9, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert565_dx9, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;

case VULKAN_1555_FORMAT:
GlobalThreadPool::Loop(std::bind(&convert5551_dx9, (u16*)source, dest, width, placeholder::_1, placeholder::_2), 0, height);
GlobalThreadPool::Loop(std::bind(&convert5551_dx9, (u16*)source, dest, width, std::placeholders::_1, std::placeholders::_2), 0, height);
break;

default:
Expand Down
6 changes: 3 additions & 3 deletions UI/ControlMappingScreen.cpp
Expand Up @@ -176,19 +176,19 @@ void ControlMapper::MappedCallback(KeyDef kdf) {
UI::EventReturn ControlMapper::OnReplace(UI::EventParams &params) {
actionIndex_ = atoi(params.v->Tag().c_str());
action_ = REPLACEONE;
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, placeholder::_1)));
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1)));
return UI::EVENT_DONE;
}

UI::EventReturn ControlMapper::OnReplaceAll(UI::EventParams &params) {
action_ = REPLACEALL;
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, placeholder::_1)));
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1)));
return UI::EVENT_DONE;
}

UI::EventReturn ControlMapper::OnAdd(UI::EventParams &params) {
action_ = ADD;
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, placeholder::_1)));
scrm_->push(new KeyMappingNewKeyDialog(pspKey_, true, std::bind(&ControlMapper::MappedCallback, this, std::placeholders::_1)));
return UI::EVENT_DONE;
}

Expand Down
3 changes: 2 additions & 1 deletion UI/ControlMappingScreen.h
Expand Up @@ -17,8 +17,9 @@

#pragma once

#include <functional>
#include <vector>
#include "base/functional.h"

#include "base/mutex.h"
#include "ui/view.h"
#include "ui/ui_screen.h"
Expand Down
3 changes: 2 additions & 1 deletion UI/CwCheatScreen.h
Expand Up @@ -15,7 +15,8 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.

#include "base/functional.h"
#include <functional>

#include "ui/view.h"
#include "ui/ui_screen.h"
#include "ui/ui_context.h"
Expand Down
4 changes: 2 additions & 2 deletions UI/DevScreens.h
Expand Up @@ -17,11 +17,11 @@

#pragma once

#include <vector>
#include <functional>
#include <map>
#include <string>
#include <vector>

#include "base/functional.h"
#include "file/file_util.h"
#include "ui/ui_screen.h"

Expand Down
6 changes: 3 additions & 3 deletions UI/GameScreen.cpp
Expand Up @@ -175,7 +175,7 @@ UI::EventReturn GameScreen::OnDeleteConfig(UI::EventParams &e)
I18NCategory *ga = GetI18NCategory("Game");
screenManager()->push(
new PromptScreen(di->T("DeleteConfirmGameConfig", "Do you really want to delete the settings for this game?"), ga->T("ConfirmDelete"), di->T("Cancel"),
std::bind(&GameScreen::CallbackDeleteConfig, this, placeholder::_1)));
std::bind(&GameScreen::CallbackDeleteConfig, this, std::placeholders::_1)));

return UI::EVENT_DONE;
}
Expand Down Expand Up @@ -289,7 +289,7 @@ UI::EventReturn GameScreen::OnDeleteSaveData(UI::EventParams &e) {
if (saveDirs.size()) {
screenManager()->push(
new PromptScreen(di->T("DeleteConfirmAll", "Do you really want to delete all\nyour save data for this game?"), ga->T("ConfirmDelete"), di->T("Cancel"),
std::bind(&GameScreen::CallbackDeleteSaveData, this, placeholder::_1)));
std::bind(&GameScreen::CallbackDeleteSaveData, this, std::placeholders::_1)));
}
}

Expand All @@ -313,7 +313,7 @@ UI::EventReturn GameScreen::OnDeleteGame(UI::EventParams &e) {
if (info) {
screenManager()->push(
new PromptScreen(di->T("DeleteConfirmGame", "Do you really want to delete this game\nfrom your device? You can't undo this."), ga->T("ConfirmDelete"), di->T("Cancel"),
std::bind(&GameScreen::CallbackDeleteGame, this, placeholder::_1)));
std::bind(&GameScreen::CallbackDeleteGame, this, std::placeholders::_1)));
}

return UI::EVENT_DONE;
Expand Down
3 changes: 2 additions & 1 deletion UI/GameScreen.h
Expand Up @@ -17,8 +17,9 @@

#pragma once

#include <functional>

#include "UI/MiscScreens.h"
#include "base/functional.h"
#include "ui/ui_screen.h"

// Game screen: Allows you to start a game, delete saves, delete the game,
Expand Down
6 changes: 3 additions & 3 deletions UI/GameSettingsScreen.cpp
Expand Up @@ -961,7 +961,7 @@ UI::EventReturn GameSettingsScreen::OnRenderingBackend(UI::EventParams &e) {
// It only makes sense to show the restart prompt if the backend was actually changed.
if (g_Config.iGPUBackend != (int)GetGPUBackend()) {
screenManager()->push(new PromptScreen(di->T("ChangingGPUBackends", "Changing GPU backends requires PPSSPP to restart. Restart now?"), di->T("Yes"), di->T("No"),
std::bind(&GameSettingsScreen::CallbackRenderingBackend, this, placeholder::_1)));
std::bind(&GameSettingsScreen::CallbackRenderingBackend, this, std::placeholders::_1)));
}
#endif
return UI::EVENT_DONE;
Expand Down Expand Up @@ -1165,13 +1165,13 @@ UI::EventReturn GameSettingsScreen::OnRestoreDefaultSettings(UI::EventParams &e)
{
screenManager()->push(
new PromptScreen(dev->T("RestoreGameDefaultSettings", "Are you sure you want to restore the game-specific settings back to the ppsspp defaults?\n"), di->T("OK"), di->T("Cancel"),
std::bind(&GameSettingsScreen::CallbackRestoreDefaults, this, placeholder::_1)));
std::bind(&GameSettingsScreen::CallbackRestoreDefaults, this, std::placeholders::_1)));
}
else
{
screenManager()->push(
new PromptScreen(dev->T("RestoreDefaultSettings", "Are you sure you want to restore all settings(except control mapping)\nback to their defaults?\nYou can't undo this.\nPlease restart PPSSPP after restoring settings."), di->T("OK"), di->T("Cancel"),
std::bind(&GameSettingsScreen::CallbackRestoreDefaults, this, placeholder::_1)));
std::bind(&GameSettingsScreen::CallbackRestoreDefaults, this, std::placeholders::_1)));
}

return UI::EVENT_DONE;
Expand Down
3 changes: 2 additions & 1 deletion UI/InstallZipScreen.h
Expand Up @@ -17,7 +17,8 @@

#pragma once

#include "base/functional.h"
#include <functional>

#include "ui/view.h"
#include "ui/ui_screen.h"

Expand Down
3 changes: 2 additions & 1 deletion UI/MainScreen.h
Expand Up @@ -17,7 +17,8 @@

#pragma once

#include "base/functional.h"
#include <functional>

#include "file/path.h"
#include "ui/ui_screen.h"
#include "ui/viewgroup.h"
Expand Down
2 changes: 1 addition & 1 deletion UI/MiscScreens.cpp
Expand Up @@ -16,8 +16,8 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.

#include <algorithm>
#include <functional>

#include "base/functional.h"
#include "base/colorutil.h"
#include "base/display.h"
#include "base/timeutil.h"
Expand Down
4 changes: 2 additions & 2 deletions UI/MiscScreens.h
Expand Up @@ -17,12 +17,12 @@

#pragma once

#include <vector>
#include <functional>
#include <map>
#include <string>
#include <vector>

#include "file/file_util.h"
#include "base/functional.h"
#include "ui/ui_screen.h"

struct ShaderInfo;
Expand Down
2 changes: 1 addition & 1 deletion UI/PauseScreen.cpp
Expand Up @@ -445,7 +445,7 @@ UI::EventReturn GamePauseScreen::OnDeleteConfig(UI::EventParams &e)
I18NCategory *ga = GetI18NCategory("Game");
screenManager()->push(
new PromptScreen(di->T("DeleteConfirmGameConfig", "Do you really want to delete the settings for this game?"), ga->T("ConfirmDelete"), di->T("Cancel"),
std::bind(&GamePauseScreen::CallbackDeleteConfig, this, placeholder::_1)));
std::bind(&GamePauseScreen::CallbackDeleteConfig, this, std::placeholders::_1)));

return UI::EVENT_DONE;
}
Expand Down
3 changes: 2 additions & 1 deletion UI/PauseScreen.h
Expand Up @@ -17,7 +17,8 @@

#pragma once

#include "base/functional.h"
#include <functional>

#include "ui/ui_screen.h"
#include "ui/viewgroup.h"
#include "UI/MiscScreens.h"
Expand Down
3 changes: 2 additions & 1 deletion UI/RemoteISOScreen.h
Expand Up @@ -17,7 +17,8 @@

#pragma once

#include "base/functional.h"
#include <functional>

#include "ui/ui_screen.h"
#include "ui/viewgroup.h"
#include "UI/MiscScreens.h"
Expand Down

0 comments on commit e0ff68b

Please sign in to comment.