Browse Source

core: fix a few build warnings and remove useless operators from the

"half" class. The build is now 3% faster.
legacy
Sam Hocevar sam 12 years ago
parent
commit
c035a1c2b7
5 changed files with 11 additions and 15 deletions
  1. +2
    -0
      src/entity.cpp
  2. +1
    -1
      src/layer.cpp
  3. +2
    -4
      src/lol/math/half.h
  4. +6
    -6
      src/ticker.cpp
  5. +0
    -4
      test/tutorial/01_triangle.cpp

+ 2
- 0
src/entity.cpp View File

@@ -52,6 +52,7 @@ char const *Entity::GetName()

void Entity::TickGame(float seconds)
{
(void)seconds;
#if !LOL_RELEASE
if (m_tickstate != STATE_PRETICK_GAME)
Log::Error("invalid entity game tick\n");
@@ -61,6 +62,7 @@ void Entity::TickGame(float seconds)

void Entity::TickDraw(float seconds)
{
(void)seconds;
#if !LOL_RELEASE
if (m_tickstate != STATE_PRETICK_DRAW)
Log::Error("invalid entity draw tick\n");


+ 1
- 1
src/layer.cpp View File

@@ -45,7 +45,7 @@ Layer::~Layer()
free(data);
}

void Layer::Render(int x, int y, int z)
void Layer::Render(int /* x */, int /* y */, int /* z */)
{
static int error = 1;
if (error && !(error = 0))


+ 2
- 4
src/lol/math/half.h View File

@@ -156,10 +156,8 @@ static inline half clamp(half x, half a, half b)
#define DECLARE_COERCE_FROM_HALF_OPS(type) \
DECLARE_COERCE_HALF_OPS(type, type, x, (type)h)

DECLARE_COERCE_TO_HALF_OPS(int8_t)
DECLARE_COERCE_TO_HALF_OPS(uint8_t)
DECLARE_COERCE_TO_HALF_OPS(int16_t)
DECLARE_COERCE_TO_HALF_OPS(uint16_t)
/* Only provide coercion rules above int32_t, since the standard says
* all smaller base types are coerced to int. */
DECLARE_COERCE_TO_HALF_OPS(int32_t)
DECLARE_COERCE_TO_HALF_OPS(uint32_t)
DECLARE_COERCE_TO_HALF_OPS(int64_t)


+ 6
- 6
src/ticker.cpp View File

@@ -151,7 +151,7 @@ int Ticker::Unref(Entity *entity)
return --entity->m_ref;
}

void *TickerData::GameThreadMain(void *p)
void *TickerData::GameThreadMain(void * /* p */)
{
for (;;)
{
@@ -296,7 +296,7 @@ void *TickerData::GameThreadMain(void *p)
return NULL;
}

void *TickerData::DrawThreadMain(void *p)
void *TickerData::DrawThreadMain(void * /* p */)
{
for (;;)
{
@@ -310,18 +310,18 @@ void *TickerData::DrawThreadMain(void *p)
return NULL;
}

void *TickerData::DiskThreadMain(void *p)
void *TickerData::DiskThreadMain(void * /* p */)
{
return NULL;
}

void Ticker::SetState(Entity *entity, uint32_t state)
void Ticker::SetState(Entity * /* entity */, uint32_t /* state */)
{

}

void Ticker::SetStateWhenMatch(Entity *entity, uint32_t state,
Entity *other_entity, uint32_t other_state)
void Ticker::SetStateWhenMatch(Entity * /* entity */, uint32_t /* state */,
Entity * /* other_entity */, uint32_t /* other_state */)
{

}


+ 0
- 4
test/tutorial/01_triangle.cpp View File

@@ -22,10 +22,6 @@ using namespace lol;
# include <SDL_main.h>
#endif

#if defined __native_client__
# define main old_main
#endif

#if defined _WIN32
# undef main /* FIXME: still needed? */
# include <direct.h>


Loading…
Cancel
Save