Transition from QtCore to stdc++ / STL / boost

This looks like a pretty major change, but in reality,
80% of it is just renames of types and corresponding
methods.

The config parsing code has been completely replaced
with a boost::program_options based version. This
means that the config file format slightly changed
(checkout the updated README).

I still expect there to be bugs / unforseen events.
Those should be fixed in follow up commits.

Also, finally reverted back to using pkg-config to
locate and link libruby. Yay for less hacks!
This commit is contained in:
Jonas Kulla 2013-12-11 20:46:54 +01:00
parent 01529c5741
commit 2adf8ab265
40 changed files with 722 additions and 456 deletions

View file

@ -38,14 +38,11 @@
#include "file.h"
#include "rwmem.h"
#include "exception.h"
#include "boost-hash.h"
#include "debugwriter.h"
#include <SDL_timer.h>
#include <QHash>
#include <QByteArray>
#include <QDebug>
#define MARSHAL_MAJOR 4
#define MARSHAL_MINOR 8
@ -76,9 +73,9 @@
// FIXME make these dynamically allocatd, per MarshalContext
static char gpbuffer[512];
inline uint qHash(mrb_value key)
inline size_t hash_value(mrb_value key)
{
return qHash(key.value.p);
return boost::hash_value(key.value.p);
}
inline bool operator==(mrb_value v1, mrb_value v2)
@ -109,7 +106,7 @@ template<typename T>
struct LinkBuffer
{
/* Key: val, Value: idx in vec */
QHash<T, int> hash;
BoostHash<T, int> hash;
std::vector<T> vec;
bool contains(T value)
@ -551,9 +548,8 @@ read_value(MarshalContext *ctx)
break;
default :
qDebug() << "Value type" << (char)type << "not supported!";
throw Exception(Exception::MKXPError, "Marshal.load: unsupported value type '%s'",
QByteArray(1, (char)type));
std::string(1, (char)type));
}
mrb_gc_arena_restore(mrb, arena);
@ -973,7 +969,7 @@ MRB_FUNCTION(marshalLoad)
}
else
{
qDebug() << "FIXME: Marshal.load: generic IO port not implemented";
Debug() << "FIXME: Marshal.load: generic IO port not implemented";
return mrb_nil_value();
}