Add a few explicit casts so less errors when compiling as C++

This commit is contained in:
UnknownShadow200 2019-10-06 13:58:10 +11:00
parent 97241ac63c
commit e0620c5887
3 changed files with 5 additions and 5 deletions

View File

@ -1218,7 +1218,7 @@ ReturnCode Gfx_TakeScreenshot(struct Stream* output) {
bmp.Width = vp[2];
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;
glReadPixels(0, 0, bmp.Width, bmp.Height, PIXEL_FORMAT, GL_UNSIGNED_BYTE, bmp.Scan0);

View File

@ -617,7 +617,7 @@ static void Http_SysFree(void) {
static CURL* curl;
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;
String_AppendConst(dst, err);

View File

@ -151,10 +151,10 @@ static bool InventoryScreen_KeyDown(void* screen, Key key) {
struct TableWidget* table = &s->table;
if (key == KeyBinds[KEYBIND_INVENTORY] && s->releasedInv) {
Gui_Remove(screen);
Gui_Remove((struct Screen*)s);
} else if (key == KEY_ENTER && table->selectedIndex != -1) {
Inventory_SetSelectedBlock(table->blocks[table->selectedIndex]);
Gui_Remove(screen);
Gui_Remove((struct Screen*)s);
} else if (Elem_HandlesKeyDown(table, key)) {
} else {
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) {
struct DisconnectScreen* s = (struct DisconnectScreen*)screen;
struct ButtonWidget* w = &s->reconnect;
struct ButtonWidget* w = &s->reconnect;
if (!w->disabled && Widget_Contains(w, x, y)) {
Gui_Remove((struct Screen*)s);