More warnings fixed

This commit is contained in:
pancake 2018-07-14 10:58:19 +02:00
parent 2c85194e7a
commit 4eec87cdf6
6 changed files with 15 additions and 11 deletions

View File

@ -2766,10 +2766,13 @@ static bool get_rsds(ut8* dbg_data, int dbg_data_len, SCV_RSDS_HEADER* res) {
return true;
}
static void get_nb10(ut8* dbg_data, SCV_NB10_HEADER* res) {
static void get_nb10(ut8* dbg_data, int dbg_data_len, SCV_NB10_HEADER* res) {
const int nb10sz = 16;
// memcpy (res, dbg_data, nb10sz);
// res->file_name = (ut8*) strdup ((const char*) dbg_data + nb10sz);
if (dbg_data_len < nb10sz) {
return;
}
memcpy (res, dbg_data, nb10sz);
res->file_name = (ut8*) strdup ((const char*) dbg_data + nb10sz);
}
static int get_debug_info(struct PE_(r_bin_pe_obj_t)* bin, PE_(image_debug_directory_entry)* dbg_dir_entry, ut8* dbg_data, int dbg_data_len, SDebugInfo* res) {
@ -2814,7 +2817,7 @@ static int get_debug_info(struct PE_(r_bin_pe_obj_t)* bin, PE_(image_debug_direc
}
SCV_NB10_HEADER nb10_hdr = {{0}};
init_cv_nb10_header (&nb10_hdr);
get_nb10 (dbg_data, &nb10_hdr);
get_nb10 (dbg_data, dbg_data_len, &nb10_hdr);
snprintf (res->guidstr, sizeof (res->guidstr),
"%x%x", nb10_hdr.timestamp, nb10_hdr.age);
res->file_name[0] = 0;

View File

@ -497,8 +497,8 @@ static int cmd_help(void *data, const char *input) {
/* binary and floating point */
r_str_bits64 (out, n);
f = d = core->num->fvalue;
memcpy (&f, &n, sizeof(f));
memcpy (&d, &n, sizeof(d));
memcpy (&f, &n, sizeof (f));
memcpy (&d, &n, sizeof (d));
/* adjust sign for nan floats, different libcs are confused */
if (isnan (f) && signbit (f)) {
f = -f;

View File

@ -3674,13 +3674,13 @@ R_API void r_print_code(RPrint *p, ut64 addr, ut8 *buf, int len, char lang) {
static int cmd_print(void *data, const char *input) {
RCore *core = (RCore *) data;
int w, p, i, l, len, ret;
int i, l, len, ret;
ut8* block;
ut32 tbs = core->blocksize;
ut64 n, off, from, to, at, ate, piece;
ut64 tmpseek = UT64_MAX;
const int addrbytes = core->io->addrbytes;
w = p = i = l = len = ret = 0;
i = l = len = ret = 0;
n = off = from = to = at = ate = piece = 0;
r_print_init_rowoffsets (core->print);

View File

@ -125,7 +125,7 @@ int linux_handle_signals (RDebug *dbg) {
eprintf ("[+] SIGNAL %d errno=%d addr=0x%08"PFMT64x
" code=%d ret=%d\n",
siginfo.si_signo, siginfo.si_errno,
(ut64)siginfo.si_addr, siginfo.si_code, ret);
(ut64)(size_t)siginfo.si_addr, siginfo.si_code, ret);
}
return true;
}

View File

@ -1175,7 +1175,7 @@ grub_hfs_uuid (grub_device_t device, char **uuid)
data = grub_hfs_mount (device->disk);
if (data && data->sblock.num_serial != 0)
{
*uuid = grub_xasprintf ("%016llx",
*uuid = grub_xasprintf ("%016"PFMT64x,
(unsigned long long)
grub_be_to_cpu64 (data->sblock.num_serial));
}

View File

@ -29,6 +29,7 @@
#include <grub/fshelp.h>
#include <grub/hfs.h>
#include <grub/charset.h>
#include <r_util.h>
#define GRUB_HFSPLUS_MAGIC 0x482B
#define GRUB_HFSPLUSX_MAGIC 0x4858
@ -1039,7 +1040,7 @@ grub_hfsplus_uuid (grub_device_t device, char **uuid)
data = grub_hfsplus_mount (disk);
if (data)
{
*uuid = grub_xasprintf ("%016llx",
*uuid = grub_xasprintf ("%016"PFMT64x,
(unsigned long long)
grub_be_to_cpu64 (data->volheader.num_serial));
}