Skip to content
Snippets Groups Projects
Commit 74f4348c authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Fix some obvious MSVC warnings (unused variables, narrowing conversions)

parent 20f24ccc
No related branches found
No related tags found
No related merge requests found
...@@ -147,7 +147,7 @@ gdi_add_key(uint16_t key) ...@@ -147,7 +147,7 @@ gdi_add_key(uint16_t key)
if (key == 0xe0) if (key == 0xe0)
key = CIO_KEY_LITERAL_E0; key = CIO_KEY_LITERAL_E0;
if (key < 256) { if (key < 256) {
buf[0] = key; buf[0] = (uint8_t)key;
remain = 1; remain = 1;
} }
else { else {
...@@ -200,7 +200,6 @@ static LRESULT ...@@ -200,7 +200,6 @@ static LRESULT
gdi_handle_wm_size(WPARAM wParam, LPARAM lParam) gdi_handle_wm_size(WPARAM wParam, LPARAM lParam)
{ {
int w, h; int w, h;
int ww, wh;
switch (wParam) { switch (wParam) {
case SIZE_MAXIMIZED: case SIZE_MAXIMIZED:
...@@ -442,13 +441,13 @@ win_to_pos(LPARAM lParam, struct gdi_mouse_pos *p) ...@@ -442,13 +441,13 @@ win_to_pos(LPARAM lParam, struct gdi_mouse_pos *p)
cx -= xoff; cx -= xoff;
cy -= yoff; cy -= yoff;
p->tx = cx / (((float)dwidth) / cols) + 1; p->tx = (int)(cx / (((float)dwidth) / cols) + 1);
if (p->tx > cols) if (p->tx > cols)
ret = false; ret = false;
p->px = cx * (scrnwidth) / dwidth; p->px = cx * (scrnwidth) / dwidth;
p->ty = cy / (((float)dheight) / rows) + 1; p->ty = (int)(cy / (((float)dheight) / rows) + 1);
if (p->ty > rows) if (p->ty > rows)
ret = false; ret = false;
...@@ -679,8 +678,6 @@ magic_message(MSG msg) ...@@ -679,8 +678,6 @@ magic_message(MSG msg)
static uint8_t mods = 0; static uint8_t mods = 0;
size_t i; size_t i;
uint8_t set = 0; uint8_t set = 0;
int *hack;
RECT r;
/* Note that some messages go directly to gdi_WndProc(), so we can't /* Note that some messages go directly to gdi_WndProc(), so we can't
* put generic stuff in here. * put generic stuff in here.
...@@ -745,7 +742,7 @@ magic_message(MSG msg) ...@@ -745,7 +742,7 @@ magic_message(MSG msg)
window_top = wi.rcWindow.top; window_top = wi.rcWindow.top;
} }
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
window_scaling = vstat.scaling; window_scaling = (float)vstat.scaling;
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
SetWindowLongPtr(win, GWL_STYLE, STYLE); SetWindowLongPtr(win, GWL_STYLE, STYLE);
PostMessageW(win, WM_USER_SETPOS, mi.rcMonitor.left, mi.rcMonitor.top); PostMessageW(win, WM_USER_SETPOS, mi.rcMonitor.left, mi.rcMonitor.top);
...@@ -1066,8 +1063,6 @@ gdi_getcliptext(void) ...@@ -1066,8 +1063,6 @@ gdi_getcliptext(void)
int int
gdi_get_window_info(int *width, int *height, int *xpos, int *ypos) gdi_get_window_info(int *width, int *height, int *xpos, int *ypos)
{ {
WINDOWPLACEMENT wp;
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
if(width) if(width)
*width=vstat.winwidth; *width=vstat.winwidth;
...@@ -1221,7 +1216,7 @@ void ...@@ -1221,7 +1216,7 @@ void
gdi_setwinsize(int w, int h) gdi_setwinsize(int w, int h)
{ {
if (fullscreen) if (fullscreen)
window_scaling = bitmap_double_mult_inside(w, h); window_scaling = (float)bitmap_double_mult_inside(w, h);
else else
PostMessageW(win, WM_USER_SETSIZE, w, h); PostMessageW(win, WM_USER_SETSIZE, w, h);
} }
...@@ -1232,7 +1227,7 @@ gdi_getscaling(void) ...@@ -1232,7 +1227,7 @@ gdi_getscaling(void)
int ret; int ret;
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
ret = bitmap_double_mult_inside(vstat.winwidth, vstat.winheight); ret = (int)bitmap_double_mult_inside(vstat.winwidth, vstat.winheight);
pthread_mutex_unlock(&vstatlock); pthread_mutex_unlock(&vstatlock);
return ret; return ret;
} }
...@@ -1243,7 +1238,7 @@ gdi_setscaling(double newval) ...@@ -1243,7 +1238,7 @@ gdi_setscaling(double newval)
int w, h; int w, h;
if (fullscreen) { if (fullscreen) {
window_scaling = newval; window_scaling = (float)newval;
} }
else { else {
pthread_mutex_lock(&vstatlock); pthread_mutex_lock(&vstatlock);
...@@ -1267,8 +1262,6 @@ gdi_getscaling_type(void) ...@@ -1267,8 +1262,6 @@ gdi_getscaling_type(void)
void void
gdi_setscaling_type(enum ciolib_scaling newtype) gdi_setscaling_type(enum ciolib_scaling newtype)
{ {
int w, h;
pthread_mutex_lock(&stypelock); pthread_mutex_lock(&stypelock);
stype = newtype; stype = newtype;
pthread_mutex_unlock(&stypelock); pthread_mutex_unlock(&stypelock);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment