A few more optimizations. It looks to be close to the end of the conversion.

git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3058 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-11-08 23:50:23 +00:00
parent b89dfa7436
commit 4f91fd96ed
4 changed files with 8 additions and 9 deletions

View File

@ -156,5 +156,5 @@ uInt32 FilesystemNodeZIP::read(uInt8*& image) const
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
AbstractFSNode* FilesystemNodeZIP::getParent() const
{
return _realNode ? _realNode->getParent() : 0;
return _realNode ? _realNode->getParent() : nullptr;
}

View File

@ -30,14 +30,14 @@
*/
namespace Common {
template <class T, int MAX_SIZE = 10>
template <class T, int MAX_SIZE = 50>
class FixedStack
{
public:
FixedStack<T, MAX_SIZE>() : _size(0) {}
bool empty() const { return _size <= 0; }
bool full() const {return _size >= MAX_SIZE; }
bool full() const { return _size >= MAX_SIZE; }
void clear() { _size = 0; }
void push(const T& x)
{
@ -53,10 +53,8 @@ class FixedStack
}
T pop()
{
T tmp;
assert(_size > 0);
tmp = _stack[--_size];
return tmp;
return std::move(_stack[--_size]);
}
int size() const { return _size; }
T operator [](int i) const

View File

@ -72,6 +72,7 @@
#include <cstring>
#include <cctype>
#include <cstdio>
#include <utility>
#include <vector>
using namespace std;
@ -128,7 +129,7 @@ std::unique_ptr<Value> make_ptr(Arguments && ... arguments_for_constructor)
);
}
template<typename T> inline void BSPF_swap(T& a, T& b) { T tmp = a; a = b; b = tmp; }
template<typename T> inline void BSPF_swap(T& a, T& b) { std::swap(a, b); }
template<typename T> inline T BSPF_abs (T x) { return (x>=0) ? x : -x; }
template<typename T> inline T BSPF_min (T a, T b) { return (a<b) ? a : b; }
template<typename T> inline T BSPF_max (T a, T b) { return (a>b) ? a : b; }

View File

@ -737,7 +737,7 @@ void FrameBuffer::setAvailableVidModes(uInt32 baseWidth, uInt32 baseHeight)
for(auto& mode: myFullscreenModeLists)
mode.clear();
for(int i = (int)myFullscreenModeLists.size(); i < myDisplays.size(); ++i)
for(size_t i = myFullscreenModeLists.size(); i < myDisplays.size(); ++i)
myFullscreenModeLists.push_back(VideoModeList());
// Check if zooming is allowed for this state (currently only allowed