Skip to content
Permalink
Browse files

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

  • Loading branch information...
UnknownShadow200 committed Oct 6, 2019
1 parent 97241ac commit e0620c5887a1cd7b390bb72cf9fa9a76c6dcaa63
Showing with 5 additions and 5 deletions.
  1. +1 −1 src/Graphics.c
  2. +1 −1 src/Http.c
  3. +3 −3 src/Screens.c
@@ -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);

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

0 comments on commit e0620c5

Please sign in to comment.
You can’t perform that action at this time.