Fix few windows warnings

This commit is contained in:
pancake 2022-10-24 17:55:34 +02:00
parent 84d659656d
commit 0d3618414a
4 changed files with 6 additions and 8 deletions
libr
shlr/bochs/src

@ -26,7 +26,7 @@ R_API double r_reg_get_double(RReg *reg, RRegItem *item) {
} }
R_API bool r_reg_set_double(RReg *reg, RRegItem *item, double value) { R_API bool r_reg_set_double(RReg *reg, RRegItem *item, double value) {
r_return_val_if_fail (reg && item, 0.0f); r_return_val_if_fail (reg && item, false);
ut8 *src; ut8 *src;
switch (item->size) { switch (item->size) {
case 64: case 64:

@ -2550,9 +2550,6 @@ R_API char *r_print_code_tocolor(const char *o) {
const char *st = strstr (p, " str."); const char *st = strstr (p, " str.");
const char *w = r_str_trim_head_ro (p); const char *w = r_str_trim_head_ro (p);
if (w == nl) { if (w == nl) {
eprintf ("EMPTY LINE\n");
sleep (1);
// empty line
p = w; p = w;
continue; continue;
} }

@ -4,7 +4,7 @@
#include <r_cons.h> #include <r_cons.h>
#include <r_util/pj.h> #include <r_util/pj.h>
typedef float ft32; typedef float ft32;
typedef double ft64; typedef double ft64;
#define WIRE_VARINT 0 // int32, int64, uint32, uint64, sint32, sint64, bool, enum #define WIRE_VARINT 0 // int32, int64, uint32, uint64, sint32, sint64, bool, enum
@ -137,7 +137,8 @@ static char *decode_buffer(PJ *pj, const ut8* start, const ut8* end, int padcnt,
pj_o (pj); pj_o (pj);
pj_ks (pj, "type", "64bit"); pj_ks (pj, "type", "64bit");
pj_kn (pj, "value", *i); pj_kn (pj, "value", *i);
pj_kn (pj, "fvalue", *f); double d = *f;
pj_kd (pj, "fvalue", d);
pj_end (pj); pj_end (pj);
} else if (mode == 'j') { } else if (mode == 'j') {
pj_n (pj, *i); pj_n (pj, *i);
@ -231,7 +232,7 @@ static char *decode_buffer(PJ *pj, const ut8* start, const ut8* end, int padcnt,
pj_o (pj); pj_o (pj);
pj_ks (pj, "type", "32bit"); pj_ks (pj, "type", "32bit");
pj_kn (pj, "value", *i); pj_kn (pj, "value", *i);
pj_kn (pj, "fvalue", *f); pj_kd (pj, "fvalue", *f);
pj_end (pj); pj_end (pj);
} else if (mode == 'j') { } else if (mode == 'j') {
pj_n (pj, *i); pj_n (pj, *i);

@ -60,7 +60,7 @@ bool bochs_cmd_stop(libbochs_t * b) {
}; };
hKernel = GetModuleHandle (TEXT ("kernel32")); hKernel = GetModuleHandle (TEXT ("kernel32"));
FARPROC apiOffset = (FARPROC)GetProcAddress (hKernel, "GenerateConsoleCtrlEvent"); FARPROC apiOffset = (FARPROC)GetProcAddress (hKernel, "GenerateConsoleCtrlEvent");
*((DWORD *)&buffer[20]) = (DWORD)apiOffset; *((DWORD *)&buffer[20]) = (DWORD *)(size_t)apiOffset; // XXX
ExitCode = RunRemoteThread_(b, (const ut8*)&buffer, 0x1Eu, 0, &ExitCode) && ExitCode; ExitCode = RunRemoteThread_(b, (const ut8*)&buffer, 0x1Eu, 0, &ExitCode) && ExitCode;
return ExitCode; return ExitCode;
#else #else