Skip to content

Commit fff040e

Browse files
committed
fix a few warnings
1 parent c8ee157 commit fff040e

File tree

7 files changed

+14
-15
lines changed

7 files changed

+14
-15
lines changed

source/blocks/Block.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ void Block_Deinit() { C3D_TexDelete(&textureMap.texture); }
4848
void* Block_GetTextureMap() { return &textureMap.texture; }
4949

5050
void Block_GetTexture(Block block, Direction direction, uint8_t metadata, int16_t* out_uv) {
51-
Texture_MapIcon i;
51+
Texture_MapIcon i = {0, 0, 0};
5252
switch (block) {
5353
case Block_Air:
5454
return;
@@ -109,6 +109,7 @@ void Block_GetTexture(Block block, Direction direction, uint8_t metadata, int16_
109109
case Block_Bedrock:
110110
i = icon.bedrock;
111111
break;
112+
default: break;
112113
}
113114
out_uv[0] = i.u;
114115
out_uv[1] = i.v;

source/gui/WorldSelect.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void WorldSelect_ScanWorlds() {
2929

3030
DIR* directory = opendir("sdmc:/craftus/saves");
3131

32-
char buffer[256];
32+
char buffer[512];
3333

3434
struct dirent* entry;
3535

@@ -270,7 +270,7 @@ bool WorldSelect_Update(char* out_worldpath, char* out_name, WorldGenType* world
270270
}
271271
if (confirmed_deletion) {
272272
confirmed_deletion = false;
273-
char buffer[256];
273+
char buffer[512];
274274
sprintf(buffer, "sdmc:/craftus/saves/%s", worlds.data[selectedWorld].path);
275275
delete_folder(buffer);
276276

source/misc/Collision.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ bool Collision_BoxIntersect(Box a, Box b, int ignore_faces,
1212
{
1313
// the normal of each face.
1414
static const float3 faces[6] = {
15-
{-1, 0, 0}, // 'left' face normal (-x direction)
16-
{1, 0, 0}, // 'right' face normal (+x direction)
17-
{0, -1, 0}, // 'bottom' face normal (-y direction)
18-
{0, 1, 0}, // 'top' face normal (+y direction)
19-
{0, 0, -1}, // 'far' face normal (-z direction)
20-
{0, 0, 1}, // 'near' face normal (+z direction)
15+
{{-1, 0, 0}}, // 'left' face normal (-x direction)
16+
{{1, 0, 0}}, // 'right' face normal (+x direction)
17+
{{0, -1, 0}}, // 'bottom' face normal (-y direction)
18+
{{0, 1, 0}}, // 'top' face normal (+y direction)
19+
{{0, 0, -1}}, // 'far' face normal (-z direction)
20+
{{0, 0, 1}}, // 'near' face normal (+z direction)
2121
};
2222

2323
// distance of collided box to the face.

source/rendering/Clouds.c

-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ static WorldVertex vertices[] = {{{-1, 0, -1}, {0, 0}, {255, 255, 255}, {0, 0, 0
1919
static C3D_Tex texture;
2020
static WorldVertex* cloudVBO;
2121

22-
static int wrap = 0;
23-
2422
#define TEXTURE_SIZE 64
2523

2624
void Clouds_Init() {

source/rendering/Hand.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ void Hand_Draw(int projUniform, C3D_Mtx* projection, ItemStack stack, Player* pl
6868

6969
if (i == Direction_East ||
7070
i == Direction_West) { // eines der dümmsten Dinge, die ich jemals in meinem Leben getan habe
71-
const uvRotationTable[2][2][2][2] = {
71+
const int16_t uvRotationTable[2][2][2][2] = {
7272
{{{0, 1}, {0, 0}}, {{1, 1}, {1, 0}}}, {{{1, 0}, {1, 1}}, {{0, 0}, {0, 1}}},
7373
};
7474
for (int j = 0; j < 6; j++) {
@@ -82,7 +82,7 @@ void Hand_Draw(int projUniform, C3D_Mtx* projection, ItemStack stack, Player* pl
8282
for (int j = 0; j < 6; j++) {
8383
int idx = i * 6 + j;
8484
#define toTexCoord(x, tw) (int16_t)(((float)(x) / (float)(tw)) * (float)(1 << 15))
85-
const uvLookUp[6][4] = {
85+
const int16_t uvLookUp[6][4] = {
8686
{toTexCoord(48, 64), toTexCoord(52, 64), toTexCoord(20, 64), toTexCoord(32, 64)}, // west = inside
8787
{toTexCoord(40, 64), toTexCoord(44, 64), toTexCoord(20, 64), toTexCoord(32, 64)}, // east = outside
8888
{toTexCoord(52, 64), toTexCoord(56, 64), toTexCoord(20, 64), toTexCoord(32, 64)}, // bottom = back

source/rendering/TextureMap.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void Texture_MapInit(Texture_Map* map, const char** files, int num_files) {
138138
for (int i = 0; i < maxSize; i++) buffer[i] = 0x000000FF;
139139

140140
int filei = 0;
141-
char* filename = files[filei];
141+
const char* filename = files[filei];
142142
int c = 0;
143143
while (filename != NULL && c < (TEXTURE_MAPTILES * TEXTURE_MAPTILES) && filei < num_files) {
144144
uint32_t *image, w, h;

source/world/ChunkWorker.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ void ChunkWorker_Init(ChunkWorker* chunkworker) {
1313

1414
for (int i = 0; i < WorkerItemTypes_Count; i++) vec_init(&chunkworker->handler[i]);
1515

16-
int prio;
16+
s32 prio;
1717
bool isNew3ds = false;
1818
APT_CheckNew3DS(&isNew3ds);
1919
svcGetThreadPriority(&prio, CUR_THREAD_HANDLE);

0 commit comments

Comments
 (0)