mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 01:26:50 -04:00
Fix a few warnings when compiled with more warnings enabled
This commit is contained in:
parent
1c0dcb03d7
commit
34e0d636ac
@ -255,7 +255,6 @@ static ALenum Audio_FreeSource(struct AudioContext* ctx) {
|
||||
}
|
||||
|
||||
void Audio_Open(AudioHandle* handle, int buffers) {
|
||||
ALenum err;
|
||||
int i, j;
|
||||
|
||||
Mutex_Lock(&audio_lock);
|
||||
|
@ -54,7 +54,6 @@ IMapImporter Map_FindImporter(const String* path) {
|
||||
}
|
||||
|
||||
void Map_LoadFrom(const String* path) {
|
||||
struct LocalPlayer* p = &LocalPlayer_Instance;
|
||||
IMapImporter importer;
|
||||
struct Stream stream;
|
||||
cc_result res;
|
||||
|
@ -80,7 +80,7 @@ static void CommonInit(void) {
|
||||
|
||||
static void LimitFPS(void) {
|
||||
/* Can't use Thread_Sleep on the web. (spinwaits instead of sleeping) */
|
||||
/* However this is not a problem, because GLContext_SetVsync
|
||||
/* However this is not a problem, because GLContext_SetVsync */
|
||||
/* gets the browser to automatically handle the timing instead. */
|
||||
#ifndef CC_BUILD_WEB
|
||||
cc_uint64 frameEnd = Stopwatch_Measure();
|
||||
|
@ -229,7 +229,7 @@ void HeldBlockRenderer_Render(double delta) {
|
||||
Gfx_LoadMatrix(MATRIX_PROJECTION, &Gfx.Projection);
|
||||
}
|
||||
|
||||
const static struct EntityVTABLE heldEntity_VTABLE = {
|
||||
static const struct EntityVTABLE heldEntity_VTABLE = {
|
||||
NULL, NULL, NULL, HeldBlockRenderer_GetCol,
|
||||
NULL, NULL
|
||||
};
|
||||
|
@ -217,7 +217,7 @@ static cc_bool ClipBlock(struct RayTracer* t) {
|
||||
return true;
|
||||
}
|
||||
|
||||
const static Vec3 picking_adjust = { 0.1f, 0.1f, 0.1f };
|
||||
static const Vec3 picking_adjust = { 0.1f, 0.1f, 0.1f };
|
||||
static cc_bool ClipCamera(struct RayTracer* t) {
|
||||
Vec3 intersect;
|
||||
float t0, t1;
|
||||
|
@ -363,12 +363,12 @@ static void MPConnection_CheckDisconnection(void) {
|
||||
}
|
||||
|
||||
static void DisconnectInvalidOpcode(cc_uint8 opcode) {
|
||||
static const String title_disc = String_FromConst("Disconnected");
|
||||
static const String title = String_FromConst("Disconnected");
|
||||
String tmp; char tmpBuffer[STRING_SIZE];
|
||||
String_InitArray(tmp, tmpBuffer);
|
||||
|
||||
String_Format1(&tmp, "Server sent invalid packet %b!", &opcode);
|
||||
Game_Disconnect(&title_disc, &tmp); return;
|
||||
Game_Disconnect(&title, &tmp); return;
|
||||
}
|
||||
|
||||
static void MPConnection_Tick(struct ScheduledTask* task) {
|
||||
|
@ -2650,9 +2650,8 @@ static void SpecialInputWidget_DrawTitles(struct SpecialInputWidget* w, Bitmap*
|
||||
static int SpecialInputWidget_MeasureContent(struct SpecialInputWidget* w, struct SpecialInputTab* tab) {
|
||||
struct DrawTextArgs args;
|
||||
int textWidth, textHeight;
|
||||
int i, rows;
|
||||
|
||||
int maxWidth = 0;
|
||||
int i, maxWidth = 0;
|
||||
|
||||
DrawTextArgs_MakeEmpty(&args, w->font, false);
|
||||
args.text.length = tab->charsPerItem;
|
||||
textHeight = Drawer2D_TextHeight(&args);
|
||||
@ -2665,7 +2664,6 @@ static int SpecialInputWidget_MeasureContent(struct SpecialInputWidget* w, struc
|
||||
|
||||
w->elementWidth = maxWidth + SPECIAL_CONTENT_SPACING;
|
||||
w->elementHeight = textHeight + SPECIAL_CONTENT_SPACING;
|
||||
rows = Math_CeilDiv(tab->contents.length / tab->charsPerItem, tab->itemsPerRow);
|
||||
return w->elementWidth * tab->itemsPerRow;
|
||||
}
|
||||
|
||||
|
@ -997,7 +997,7 @@ static int MapNativeKey(KeySym key, unsigned int state) {
|
||||
/* tilde - "Unknown key press: (8000060, 800007E) */
|
||||
/* quote - "Unknown key press: (8000027, 8000022) */
|
||||
/* Note if 8000 is stripped, you get '0060' (XK_grave) and 0027 (XK_apostrophe) */
|
||||
/* ChromeOS seems to also mask to 0xFFFF, so I also do so here
|
||||
/* ChromeOS seems to also mask to 0xFFFF, so I also do so here */
|
||||
/* https://chromium.googlesource.com/chromium/src/+/lkgr/ui/events/keycodes/keyboard_code_conversion_x.cc */
|
||||
key &= 0xFFFF;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user