summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2012-10-22 05:02:49 +0200
committerTreeki <treeki@gmail.com>2012-10-22 05:02:49 +0200
commit9fa22baae0d44278cd73a54c1c4a11eac9255bff (patch)
tree124897f7b1b7d6384383aa18f98f53e93767c48a
parent96911438b1f4bf525c38bb548349d75f82e5fd3f (diff)
downloadkamek-9fa22baae0d44278cd73a54c1c4a11eac9255bff.tar.gz
kamek-9fa22baae0d44278cd73a54c1c4a11eac9255bff.zip
fixes to make Newer compile with Clang... kinda
Diffstat (limited to '')
-rw-r--r--include/common.h12
-rwxr-xr-xinclude/game.h4
-rw-r--r--kamek_pal.x2
-rw-r--r--src/bossCaptainBowser.cpp2
-rw-r--r--src/bossFuzzyBear.cpp2
-rw-r--r--src/bossThwompaDomp.cpp2
-rw-r--r--src/koopatlas/core.h3
-rw-r--r--src/koopatlas/player.h2
-rw-r--r--src/levelinfo.h2
-rw-r--r--src/magicplatform.cpp8
-rw-r--r--src/newer.cpp2
11 files changed, 23 insertions, 18 deletions
diff --git a/include/common.h b/include/common.h
index a070a56..5b85824 100644
--- a/include/common.h
+++ b/include/common.h
@@ -23,6 +23,8 @@ typedef unsigned int uint;
typedef unsigned short ushort;
typedef unsigned char uchar;
+typedef unsigned long size_t;
+
typedef char* Ptr; // DUMB
typedef int BOOL;
@@ -52,7 +54,7 @@ extern "C" int strcmp ( const char * str1, const char * str2 );
#include "rvl/mtx.h"
-inline void *operator new(unsigned long size, void *ptr) { return ptr; }
+inline void *operator new(size_t size, void *ptr) { return ptr; }
@@ -78,10 +80,10 @@ struct tree_node {
void OSReport(const char *format, ...);
int sprintf(char *buffer, const char *format, ...);
-int snprintf(char *buffer, int buff_size, const char *format, ...);
-char *strcat(const char *destination, const char *source);
-void *memset(void *ptr, int value, unsigned int num);
-int memcmp(const void *ptr1, const void *ptr2, unsigned int num);
+int snprintf(char *buffer, size_t buff_size, const char *format, ...);
+char *strcat(char *destination, const char *source);
+void *memset(void *ptr, int value, size_t num);
+int memcmp(const void *ptr1, const void *ptr2, size_t num);
void *AllocFromGameHeap1(u32 size);
void FreeFromGameHeap1(void *block);
diff --git a/include/game.h b/include/game.h
index 63a076c..2e49ac4 100755
--- a/include/game.h
+++ b/include/game.h
@@ -1521,10 +1521,10 @@ template <class TOwner>
class dStateWrapper_c : public dStateWrapperBase_c<TOwner> {
public:
dStateWrapper_c(TOwner *pOwner) :
- dStateWrapperBase_c(pOwner) { }
+ dStateWrapperBase_c<TOwner>(pOwner) { }
dStateWrapper_c(TOwner *pOwner, dState_c<TOwner> *pInitState) :
- dStateWrapperBase_c(pOwner, pInitState) { }
+ dStateWrapperBase_c<TOwner>(pOwner, pInitState) { }
~dStateWrapper_c() { }
};
diff --git a/kamek_pal.x b/kamek_pal.x
index a00b9e9..77303ad 100644
--- a/kamek_pal.x
+++ b/kamek_pal.x
@@ -1170,7 +1170,7 @@ SECTIONS {
_Z6memsetPvij = 0x800046B4;
sprintf__FPcPCce = 0x802E1ACC;
- snprintf__FPciPCce = 0x802E19D8;
+ snprintf__FPcUlPCce = 0x802E19D8;
memcmp__FPCvPCvUi = 0x802DF388;
_Z6strcatPKcS0_ = 0x802E1D2C;
diff --git a/src/bossCaptainBowser.cpp b/src/bossCaptainBowser.cpp
index 119779f..2c397da 100644
--- a/src/bossCaptainBowser.cpp
+++ b/src/bossCaptainBowser.cpp
@@ -220,7 +220,7 @@ int daCaptainBowser::onCreate() {
// Normal rects are { left, top, right, bottom }
// Callbacks are Touching upwards, Touching Downwards, and unknown
- ShipPhysics.baseSetup(this, &ShipPhysicsCallback, 0, 0, 1, 0);
+ ShipPhysics.baseSetup(this, (void*)&ShipPhysicsCallback, 0, 0, 1, 0);
ShipPhysics.x = 8.0;
ShipPhysics.y = 20.0;
diff --git a/src/bossFuzzyBear.cpp b/src/bossFuzzyBear.cpp
index b9312a8..1f4fab4 100644
--- a/src/bossFuzzyBear.cpp
+++ b/src/bossFuzzyBear.cpp
@@ -328,7 +328,7 @@ void daFuzzyBear_c::endState_Grow() {
void daFuzzyBear_c::beginState_Bounce() {
- if (this->direction = 0) { this->speed.x = 1.0; }
+ if (this->direction == 0) { this->speed.x = 1.0; }
else { this->speed.x = -1.0; }
if (this->storeSpeed != 0) { this->speed.x = this->storeSpeed; }
diff --git a/src/bossThwompaDomp.cpp b/src/bossThwompaDomp.cpp
index 4bce47c..860fb90 100644
--- a/src/bossThwompaDomp.cpp
+++ b/src/bossThwompaDomp.cpp
@@ -317,7 +317,7 @@ int daEnMegaDosun_c::onDelete() {
}
this->puruMoveCounter--;
- if(this->puruMoveCounter & 2 == 0)
+ if((this->puruMoveCounter & 2) == 0)
return;
float _array[] = {2.0, 0.0};
diff --git a/src/koopatlas/core.h b/src/koopatlas/core.h
index 88efdba..ee8cf8f 100644
--- a/src/koopatlas/core.h
+++ b/src/koopatlas/core.h
@@ -41,6 +41,9 @@ void NewerMapDrawFunc();
class daWMPlayer_c;
class dWMMap_c;
+class dWMHud_c;
+class dWMShop_c;
+class dWMStarCoin_c;
class dWorldCamera_c;
class dScKoopatlas_c : public dScene_c {
diff --git a/src/koopatlas/player.h b/src/koopatlas/player.h
index d553afb..7b60f60 100644
--- a/src/koopatlas/player.h
+++ b/src/koopatlas/player.h
@@ -3,7 +3,7 @@
#include "koopatlas/core.h"
#include "poweruphax.h"
-#include <playeranim.h>
+#include <playerAnim.h>
class daWMPlayer_c : public dActor_c {
diff --git a/src/levelinfo.h b/src/levelinfo.h
index 1e9ee6c..d0eee1a 100644
--- a/src/levelinfo.h
+++ b/src/levelinfo.h
@@ -1,7 +1,7 @@
#ifndef __NEWER_LEVELINFO_H
#define __NEWER_LEVELINFO_H
-#include <common.h>
+#include <game.h>
class dLevelInfo_c {
public:
diff --git a/src/magicplatform.cpp b/src/magicplatform.cpp
index e4f3dc0..420aefa 100644
--- a/src/magicplatform.cpp
+++ b/src/magicplatform.cpp
@@ -158,11 +158,11 @@ int daEnMagicPlatform_c::onCreate() {
case Solid:
physics.setup(this,
0.0f, 0.0f, fWidth, -fHeight,
- &PhysCB1, &PhysCB2, &PhysCB3, 1, 0, 0);
+ (void*)&PhysCB1, (void*)&PhysCB2, (void*)&PhysCB3, 1, 0, 0);
- physics.callback1 = &PhysCB4;
- physics.callback2 = &PhysCB5;
- physics.callback3 = &PhysCB6;
+ physics.callback1 = (void*)&PhysCB4;
+ physics.callback2 = (void*)&PhysCB5;
+ physics.callback3 = (void*)&PhysCB6;
physics.addToList();
break;
diff --git a/src/newer.cpp b/src/newer.cpp
index dd0dc2c..7c4ce11 100644
--- a/src/newer.cpp
+++ b/src/newer.cpp
@@ -1,5 +1,5 @@
-#include <newer.h>
#include <game.h>
+#include <newer.h>
void WriteAsciiToTextBox(nw4r::lyt::TextBox *tb, const char *source) {
int i = 0;