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.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);

View File

@ -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);

View File

@ -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;