Remove -Wno-unused and fix resulting errors

This commit is contained in:
Jeffrey Pfau 2013-05-02 00:35:32 -07:00
parent a635f4de4d
commit 13a46429e2
5 changed files with 8 additions and 10 deletions

View File

@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 2.6)
project(GBAc)
set(CMAKE_C_FLAGS_DEBUG "-g -Wall -Wextra -Wno-unused -Werror --std=gnu99")
set(CMAKE_C_FLAGS_RELEASE "-O3 -Wall -Wextra -Wno-unused -Werror --std=gnu99")
set(CMAKE_C_FLAGS_DEBUG "-g -Wall -Wextra -Werror --std=gnu99")
set(CMAKE_C_FLAGS_RELEASE "-O3 -Wall -Wextra -Werror --std=gnu99")
file(GLOB ARM_SRC ${CMAKE_SOURCE_DIR}/src/arm/*.c)
file(GLOB GBA_SRC ${CMAKE_SOURCE_DIR}/src/gba/*.c)
file(GLOB RENDERER_SRC ${CMAKE_SOURCE_DIR}/src/gba/renderers/*.c)

View File

@ -342,6 +342,7 @@ DEFINE_LOAD_STORE_WITH_REGISTER_THUMB(STRH2, cpu->memory->store16(cpu->memory, c
#define DEFINE_LOAD_STORE_MULTIPLE_EX_THUMB(NAME, RN, ADDRESS, LOOP, BODY, OP, PRE_BODY, POST_BODY, WRITEBACK) \
DEFINE_INSTRUCTION_THUMB(NAME, \
int rn = RN; \
UNUSED(rn); \
int rs = opcode & 0xFF; \
int32_t address = ADDRESS; \
int m; \

View File

@ -435,6 +435,7 @@ void GBAAdjustWaitstates(struct GBAMemory* memory, uint16_t parameters) {
int ws2 = (parameters & 0x0300) >> 8;
int ws2seq = (parameters & 0x0400) >> 10;
int prefetch = parameters & 0x4000;
(void)(prefetch);
memory->waitstates16[REGION_CART_SRAM] = GBA_ROM_WAITSTATES[sram];
memory->waitstatesSeq16[REGION_CART_SRAM] = GBA_ROM_WAITSTATES[sram];

View File

@ -304,8 +304,6 @@ static void GBAVideoSoftwareRendererWriteBLDCNT(struct GBAVideoSoftwareRenderer*
}
static void _drawScanline(struct GBAVideoSoftwareRenderer* renderer, int y) {
uint32_t* row = renderer->row;
int i;
if (renderer->dispcnt.objEnable) {
for (i = 0; i < 128; ++i) {
@ -399,7 +397,7 @@ static void _composite(struct GBAVideoSoftwareRenderer* renderer, int offset, ui
}
#define BACKGROUND_MODE_0_TILE_16_LOOP(TYPE) \
for (tileX; tileX < 30; ++tileX) { \
for (; tileX < 30; ++tileX) { \
BACKGROUND_TEXT_SELECT_CHARACTER; \
charBase = ((background->charBase + (mapData.tile << 5)) >> 2) + localY; \
uint32_t tileData = ((uint32_t*)renderer->d.vram)[charBase]; \
@ -446,7 +444,7 @@ static void _composite(struct GBAVideoSoftwareRenderer* renderer, int offset, ui
}
#define BACKGROUND_MODE_0_TILE_256_LOOP(TYPE) \
for (tileX; tileX < 30; ++tileX) { \
for (; tileX < 30; ++tileX) { \
BACKGROUND_TEXT_SELECT_CHARACTER; \
charBase = ((background->charBase + (mapData.tile << 6)) >> 2) + (localY << 1); \
if (!mapData.hflip) { \
@ -509,9 +507,7 @@ static void _composite(struct GBAVideoSoftwareRenderer* renderer, int offset, ui
}
static void _drawBackgroundMode0(struct GBAVideoSoftwareRenderer* renderer, struct GBAVideoSoftwareBackground* background, int y) {
int start = renderer->start;
int end = renderer->end;
int inX = start + background->x;
int inX = background->x;
int inY = y + background->y;
union GBATextMapData mapData;

View File

@ -137,7 +137,7 @@ static void _GBASDLRunloop(struct GBAThread* context, struct GLSoftwareRenderer*
gettimeofday(&tv, 0);
ts.tv_sec = tv.tv_sec;
ts.tv_nsec = tv.tv_usec * 1000 + 800000;
int err = pthread_cond_timedwait(&renderer->d.upCond, &renderer->d.mutex, &ts);
err = pthread_cond_timedwait(&renderer->d.upCond, &renderer->d.mutex, &ts);
if (err == ETIMEDOUT) {
break;
}