libgambatte: compilation and warning fixes for clang.

git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@276 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
This commit is contained in:
sinamas 2011-09-24 19:54:17 +00:00
parent 1270b96c6e
commit 226b539d9c
14 changed files with 16 additions and 16 deletions

View File

@ -1175,7 +1175,7 @@ void CPU::process(const unsigned long cycles) {
READ(A, HL());
break;
case 0x7F:
A = A;
// A = A;
break;
case 0x80:
add_a_u8(B);

View File

@ -64,7 +64,7 @@ long GB::runFor(gambatte::uint_least32_t *const videoBuf, const int pitch,
const long cyclesSinceBlit = p_->cpu.runFor(samples * 2);
samples = p_->cpu.fillSoundBuffer();
return cyclesSinceBlit < 0 ? cyclesSinceBlit : samples - (cyclesSinceBlit >> 1);
return cyclesSinceBlit < 0 ? cyclesSinceBlit : static_cast<long>(samples) - (cyclesSinceBlit >> 1);
}
void GB::reset() {

View File

@ -20,7 +20,7 @@
#define INITSTATE_H
namespace gambatte {
void setInitState(class SaveState &state, bool cgb, bool gbaCgbMode);
void setInitState(struct SaveState &state, bool cgb, bool gbaCgbMode);
}
#endif

View File

@ -65,11 +65,11 @@ class MinKeeper {
template<int id, int dummy> struct FillLut {
static void fillLut(MinKeeper<ids> *const s) {
s->updateValueLut[id] = updateValue<id>;
FillLut<id+1,dummy>::fillLut(s);
FillLut<id-1,dummy>::fillLut(s);
}
};
template<int dummy> struct FillLut<Num<LEVELS-1>::RESULT,dummy> {
template<int dummy> struct FillLut<-1,dummy> {
static void fillLut(MinKeeper<ids> *) {}
};
@ -128,7 +128,7 @@ MinKeeper<ids>::MinKeeper(const unsigned long initValue) {
minValue_ = values[a[0]];
FillLut<0,0>::fillLut(this);
FillLut<Num<LEVELS-1>::RESULT-1,0>::fillLut(this);
}
template<int ids>

View File

@ -28,7 +28,7 @@
namespace gambatte {
class SaveState;
struct SaveState;
class Channel1 {
class SweepUnit : public SoundUnit {

View File

@ -27,7 +27,7 @@
namespace gambatte {
class SaveState;
struct SaveState;
class Channel2 {
friend class StaticOutputTester<Channel2,DutyUnit>;

View File

@ -25,7 +25,7 @@
namespace gambatte {
class SaveState;
struct SaveState;
class Channel3 {
class Ch3MasterDisabler : public MasterDisabler {

View File

@ -27,7 +27,7 @@
namespace gambatte {
class SaveState;
struct SaveState;
class Channel4 {
class Lfsr : public SoundUnit {

View File

@ -438,7 +438,7 @@ bool StateSaver::loadState(SaveState &state, const std::string &filename) {
file.ignore(get24(file));
const Array<char> labelbuf(list.maxLabelsize());
const Saver labelbufSaver = { label: labelbuf, save: 0, load: 0, labelsize: list.maxLabelsize() };
const Saver labelbufSaver = { labelbuf, 0, 0, list.maxLabelsize() };
SaverList::const_iterator done = list.begin();

View File

@ -24,7 +24,7 @@
namespace gambatte {
class SaveState;
struct SaveState;
class StateSaver {
StateSaver();

View File

@ -21,7 +21,7 @@
namespace gambatte {
class SaveState;
struct SaveState;
class LyCounter {
unsigned long time_;

View File

@ -21,7 +21,7 @@
namespace gambatte {
class SaveState;
struct SaveState;
class LyCounter;
class LycIrq {

View File

@ -1,6 +1,6 @@
#include "next_m0_time.h"
#include "ppu.h"
void gambatte::NextM0Time::predictNextM0Time(const struct PPU &ppu) {
void gambatte::NextM0Time::predictNextM0Time(const PPU &ppu) {
predictedNextM0Time_ = ppu.predictedNextXposTime(167);
}

View File

@ -8,7 +8,7 @@ class NextM0Time {
public:
NextM0Time() : predictedNextM0Time_(0) {}
void predictNextM0Time(const struct PPU &v);
void predictNextM0Time(const class PPU &v);
void invalidatePredictedNextM0Time() { predictedNextM0Time_ = 0; }
unsigned predictedNextM0Time() const { return predictedNextM0Time_; }
};