mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 18:45:23 -04:00
Add a few explicit casts so less errors when compiling as C++
This commit is contained in:
parent
97241ac63c
commit
e0620c5887
@ -1218,7 +1218,7 @@ ReturnCode Gfx_TakeScreenshot(struct Stream* output) {
|
|||||||
bmp.Width = vp[2];
|
bmp.Width = vp[2];
|
||||||
bmp.Height = vp[3];
|
bmp.Height = vp[3];
|
||||||
|
|
||||||
bmp.Scan0 = Mem_TryAlloc(bmp.Width * bmp.Height, 4);
|
bmp.Scan0 = (cc_uint8*)Mem_TryAlloc(bmp.Width * bmp.Height, 4);
|
||||||
if (!bmp.Scan0) return ERR_OUT_OF_MEMORY;
|
if (!bmp.Scan0) return ERR_OUT_OF_MEMORY;
|
||||||
glReadPixels(0, 0, bmp.Width, bmp.Height, PIXEL_FORMAT, GL_UNSIGNED_BYTE, bmp.Scan0);
|
glReadPixels(0, 0, bmp.Width, bmp.Height, PIXEL_FORMAT, GL_UNSIGNED_BYTE, bmp.Scan0);
|
||||||
|
|
||||||
|
@ -617,7 +617,7 @@ static void Http_SysFree(void) {
|
|||||||
static CURL* curl;
|
static CURL* curl;
|
||||||
|
|
||||||
bool Http_DescribeError(ReturnCode res, String* dst) {
|
bool Http_DescribeError(ReturnCode res, String* dst) {
|
||||||
const char* err = curl_easy_strerror(res);
|
const char* err = curl_easy_strerror((CURLcode)res);
|
||||||
if (!err) return false;
|
if (!err) return false;
|
||||||
|
|
||||||
String_AppendConst(dst, err);
|
String_AppendConst(dst, err);
|
||||||
|
@ -151,10 +151,10 @@ static bool InventoryScreen_KeyDown(void* screen, Key key) {
|
|||||||
struct TableWidget* table = &s->table;
|
struct TableWidget* table = &s->table;
|
||||||
|
|
||||||
if (key == KeyBinds[KEYBIND_INVENTORY] && s->releasedInv) {
|
if (key == KeyBinds[KEYBIND_INVENTORY] && s->releasedInv) {
|
||||||
Gui_Remove(screen);
|
Gui_Remove((struct Screen*)s);
|
||||||
} else if (key == KEY_ENTER && table->selectedIndex != -1) {
|
} else if (key == KEY_ENTER && table->selectedIndex != -1) {
|
||||||
Inventory_SetSelectedBlock(table->blocks[table->selectedIndex]);
|
Inventory_SetSelectedBlock(table->blocks[table->selectedIndex]);
|
||||||
Gui_Remove(screen);
|
Gui_Remove((struct Screen*)s);
|
||||||
} else if (Elem_HandlesKeyDown(table, key)) {
|
} else if (Elem_HandlesKeyDown(table, key)) {
|
||||||
} else {
|
} else {
|
||||||
struct HUDScreen* hud = (struct HUDScreen*)Gui_HUD;
|
struct HUDScreen* hud = (struct HUDScreen*)Gui_HUD;
|
||||||
@ -1364,7 +1364,7 @@ static bool DisconnectScreen_KeyDown(void* s, Key key) { return key < KEY_F1 ||
|
|||||||
|
|
||||||
static bool DisconnectScreen_PointerDown(void* screen, int id, int x, int y) {
|
static bool DisconnectScreen_PointerDown(void* screen, int id, int x, int y) {
|
||||||
struct DisconnectScreen* s = (struct DisconnectScreen*)screen;
|
struct DisconnectScreen* s = (struct DisconnectScreen*)screen;
|
||||||
struct ButtonWidget* w = &s->reconnect;
|
struct ButtonWidget* w = &s->reconnect;
|
||||||
|
|
||||||
if (!w->disabled && Widget_Contains(w, x, y)) {
|
if (!w->disabled && Widget_Contains(w, x, y)) {
|
||||||
Gui_Remove((struct Screen*)s);
|
Gui_Remove((struct Screen*)s);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user