Fix some minor compilation warnings

This commit is contained in:
jvoisin 2015-10-14 23:50:16 +02:00
parent 80d654c053
commit 420a5c41e0
15 changed files with 24 additions and 9 deletions

View File

@ -5,6 +5,11 @@
#include <getopt.c> #include <getopt.c>
#include "../blob/version.c" #include "../blob/version.c"
#include <unistd.h>
#include <sys/types.h>
#include <string.h>
static int usage (int v) { static int usage (int v) {
printf ("Usage: ragg2 [-FOLsrxvh] [-a arch] [-b bits] [-k os] [-o file] [-I /] [-i sc]\n" printf ("Usage: ragg2 [-FOLsrxvh] [-a arch] [-b bits] [-k os] [-o file] [-I /] [-i sc]\n"
" [-e enc] [-B hex] [-c k=v] [-C file] [-dDw v] [-p pad] file|f.asm|-\n"); " [-e enc] [-B hex] [-c k=v] [-C file] [-dDw v] [-p pad] file|f.asm|-\n");

View File

@ -48,7 +48,7 @@ static bool popRN(RAnalEsil *esil, ut64 *n) {
/* R_ANAL_ESIL API */ /* R_ANAL_ESIL API */
R_API RAnalEsil *r_anal_esil_new(iotrap) { R_API RAnalEsil *r_anal_esil_new(int iotrap) {
RAnalEsil *esil = R_NEW0 (RAnalEsil); RAnalEsil *esil = R_NEW0 (RAnalEsil);
if (!esil) return NULL; if (!esil) return NULL;
esil->parse_goto_count = R_ANAL_ESIL_GOTO_LIMIT; esil->parse_goto_count = R_ANAL_ESIL_GOTO_LIMIT;

View File

@ -9,7 +9,7 @@
#define REIL_REG_PREFIX "R_" #define REIL_REG_PREFIX "R_"
void reil_flag_spew_inst(RAnalEsil *esil, const char *flag); void reil_flag_spew_inst(RAnalEsil *esil, const char *flag);
const static char *ops[] = { FOREACHOP(REIL_OP_STRING) }; static const char *ops[] = { FOREACHOP(REIL_OP_STRING) };
// Get size of a register. // Get size of a register.
static ut8 esil_internal_sizeof_reg(RAnalEsil *esil, const char *r) { static ut8 esil_internal_sizeof_reg(RAnalEsil *esil, const char *r) {

View File

@ -340,7 +340,7 @@ RAMPX, RAMPY, RAMPZ, RAMPD and EIND:
"gpr RAMPD .8 40 0\n" "gpr RAMPD .8 40 0\n"
"gpr EIND .8 41 0\n" "gpr EIND .8 41 0\n"
// status bit register stored in SREG // status bit register stored in SREG
#if 0 /*
C Carry flag. This is a borrow flag on subtracts. C Carry flag. This is a borrow flag on subtracts.
Z Zero flag. Set to 1 when an arithmetic result is zero. Z Zero flag. Set to 1 when an arithmetic result is zero.
N Negative flag. Set to a copy of the most significant bit of an arithmetic result. N Negative flag. Set to a copy of the most significant bit of an arithmetic result.
@ -349,7 +349,7 @@ S Sign flag. Unique to AVR, this is always N⊕V, and shows the true sign of a c
H Half carry. This is an internal carry from additions and is used to support BCD arithmetic. H Half carry. This is an internal carry from additions and is used to support BCD arithmetic.
T Bit copy. Special bit load and bit store instructions use this bit. T Bit copy. Special bit load and bit store instructions use this bit.
I Interrupt flag. Set when interrupts are enabled. I Interrupt flag. Set when interrupts are enabled.
#endif */
"gpr CF .1 288 0\n" // 288 = (offsetof(SREG))*8= 36 * 8 "gpr CF .1 288 0\n" // 288 = (offsetof(SREG))*8= 36 * 8
"gpr ZF .1 289 0\n" "gpr ZF .1 289 0\n"
"gpr NF .1 290 0\n" "gpr NF .1 290 0\n"

View File

@ -59,11 +59,11 @@ static ut8 get_ad(ut16 instr)
return (instr >> 7) & 1; return (instr >> 7) & 1;
} }
static int get_src(instr) { static int get_src(ut16 instr) {
return (instr >> 8) & 0xF; return (instr >> 8) & 0xF;
} }
static int get_dst(instr) { static int get_dst(ut16 instr) {
return instr & 0xF; return instr & 0xF;
} }

View File

@ -3,6 +3,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include <r_types.h> #include <r_types.h>
#include "ins.h" #include "ins.h"

View File

@ -3,6 +3,7 @@
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include "ins.h" #include "ins.h"
#include "utils.h" #include "utils.h"

View File

@ -5,6 +5,8 @@
#include <r_flags.h> #include <r_flags.h>
#include <r_core.h> #include <r_core.h>
#include <string.h>
//#define ANALBS 4096 //#define ANALBS 4096
#define ANALBS 1024 #define ANALBS 1024
#define HASNEXT_FOREVER 1 #define HASNEXT_FOREVER 1

View File

@ -2,6 +2,7 @@
#include <r_core.h> #include <r_core.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
static int r_core_file_do_load_for_debug (RCore *r, ut64 loadaddr, const char *filenameuri); static int r_core_file_do_load_for_debug (RCore *r, ut64 loadaddr, const char *filenameuri);

View File

@ -2,6 +2,8 @@
#include <r_core.h> #include <r_core.h>
#include <string.h>
#define NPF 7 #define NPF 7
static int obs = 0; static int obs = 0;
static int blocksize = 0; static int blocksize = 0;

View File

@ -2,6 +2,8 @@
#include "r_core.h" #include "r_core.h"
#include <string.h>
#define MAX_FORMAT 3 #define MAX_FORMAT 3
typedef struct { typedef struct {

View File

@ -80,7 +80,6 @@ static void print_debug_map_ascii_art(RList *maps, ut64 addr,
int bits) { int bits) {
ut64 mul, min = -1, max = 0; ut64 mul, min = -1, max = 0;
int width = r_cons_get_size (NULL) - 80; int width = r_cons_get_size (NULL) - 80;
const char *fmtstr;
RListIter *iter; RListIter *iter;
RDebugMap *map; RDebugMap *map;
if (width < 1) width = 30; if (width < 1) width = 30;

View File

@ -10,10 +10,10 @@
#include <r_util.h> #include <r_util.h>
#include <r_socket.h> #include <r_socket.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <sys/types.h>
#if __APPLE__ #if __APPLE__
#include <spawn.h> #include <spawn.h>
#include <sys/ptrace.h> #include <sys/ptrace.h>
#include <sys/types.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <mach/exception_types.h> #include <mach/exception_types.h>
#include <mach/mach_init.h> #include <mach/mach_init.h>

View File

@ -79,7 +79,7 @@ static int splitlines(const char *a, int len, struct line **lr) {
return i - 1; return i - 1;
} }
static int inline cmp(struct line *a, struct line *b) { inline static int cmp(struct line *a, struct line *b) {
return a->h != b->h || a->len != b->len || memcmp(a->l, b->l, a->len); return a->h != b->h || a->len != b->len || memcmp(a->l, b->l, a->len);
} }

View File

@ -1,6 +1,8 @@
/* radare - LGPL - Copyright 2009-2015 - pancake */ /* radare - LGPL - Copyright 2009-2015 - pancake */
#include <r_userconf.h> #include <r_userconf.h>
#include <stdlib.h>
#include <string.h>
#if defined(__NetBSD__) #if defined(__NetBSD__)
# include <sys/param.h> # include <sys/param.h>
# if __NetBSD_Prereq__(7,0,0) # if __NetBSD_Prereq__(7,0,0)