Fix some warns and enhace GIT_TAP in makefiles

This commit is contained in:
pancake 2013-08-26 01:07:21 +02:00
parent c27838a59c
commit 9850c0a3c3
9 changed files with 16 additions and 14 deletions

View File

@ -5,7 +5,7 @@ BINDEPS+=r_sign r_lang r_asm r_syscall r_db r_hash
BINDEPS+=r_magic r_socket r_flags r_util r_egg r_crypto BINDEPS+=r_magic r_socket r_flags r_util r_egg r_crypto
include ../rules.mk include ../rules.mk
CFLAGS+=-DGIT_TAP=\"$(shell git describe --tags)\" CFLAGS+=-DGIT_TAP=\"$(GIT_TAP)\"
sign: sign:
ldid -Sradare2.xml radare2 ldid -Sradare2.xml radare2

View File

@ -53,8 +53,8 @@ USE_LIB_MAGIC=@USE_LIB_MAGIC@
SSL_CFLAGS=@SSL_CFLAGS@ SSL_CFLAGS=@SSL_CFLAGS@
SSL_LDFLAGS=@SSL_LDFLAGS@ SSL_LDFLAGS=@SSL_LDFLAGS@
GIT_TIP=$(shell git log HEAD^..HEAD|head -n1|cut -d ' ' -f2) GIT_TIP=$(shell (git log HEAD^..HEAD 2>&1 || echo HEAD) |head -n1|cut -d ' ' -f2)
GIT_TAP=$(shell git describe --tags) GIT_TAP=$(shell (git describe --tags 2>/dev/null || echo ${VERSION} ))
# cache compiler flags at configure time # # cache compiler flags at configure time #
CFLAGS+=@CFLAGS@ CFLAGS+=@CFLAGS@

View File

@ -150,3 +150,4 @@ Use 'ec' to choose the colors for your disassembly palette
Here be dragons Here be dragons
Trust no one, either a zero. Both lie. Trust no one, either a zero. Both lie.
EIP = 0x41414141 EIP = 0x41414141
/dev/brain: No such file or directory

View File

@ -40,7 +40,7 @@ static inline int is_valid_char (unsigned char ch) {
#endif #endif
static int inithist() { static int inithist() {
ZERO_FILL (&I.history); ZERO_FILL (I.history);
I.history.data = (char **)malloc ((I.history.size+1024)*sizeof(char *)); I.history.data = (char **)malloc ((I.history.size+1024)*sizeof(char *));
if (I.history.data==NULL) if (I.history.data==NULL)
return R_FALSE; return R_FALSE;
@ -51,7 +51,7 @@ static int inithist() {
/* initialize history stuff */ /* initialize history stuff */
R_API int r_line_dietline_init() { R_API int r_line_dietline_init() {
ZERO_FILL (&I.completion); ZERO_FILL (I.completion);
if (!inithist ()) if (!inithist ())
return R_FALSE; return R_FALSE;
I.echo = R_TRUE; I.echo = R_TRUE;

View File

@ -670,7 +670,7 @@ toro:
} }
if (show_flags) { if (show_flags) {
flag = r_flag_get_i (core->flags, at); flag = r_flag_get_i (core->flags, at);
if (flag && (!f || (f && strcmp (f->name, flag)))) { if (flag && (!f || (f && strcmp (f->name, flag->name)))) {
if (show_lines && refline) { if (show_lines && refline) {
if (show_color) { if (show_color) {
r_cons_strcat (color_flow); r_cons_strcat (color_flow);

View File

@ -121,7 +121,7 @@ typedef void (*PrintfCallback)(const char *str, ...);
#endif #endif
#define BITS2BYTES(x) ((x/8)+((x%8)?1:0)) #define BITS2BYTES(x) ((x/8)+((x%8)?1:0))
#define ZERO_FILL(x) memset (x, 0, sizeof (x)) #define ZERO_FILL(x) memset (&x, 0, sizeof (x))
#define R_NEWS0(x,y) (x*)memset (malloc(sizeof(x)*y), 0, sizeof(x)*y); #define R_NEWS0(x,y) (x*)memset (malloc(sizeof(x)*y), 0, sizeof(x)*y);
#define R_NEWS(x,y) (x*)malloc(sizeof(x)*y) #define R_NEWS(x,y) (x*)malloc(sizeof(x)*y)
#define R_NEW(x) (x*)malloc(sizeof(x)) #define R_NEW(x) (x*)malloc(sizeof(x))
@ -133,10 +133,10 @@ typedef void (*PrintfCallback)(const char *str, ...);
#define R_MEM_ALIGN(x) ((void *)(size_t)(((ut64)(size_t)x) & 0xfffffffffffff000LL)) #define R_MEM_ALIGN(x) ((void *)(size_t)(((ut64)(size_t)x) & 0xfffffffffffff000LL))
#define R_PTR_ALIGN(v,t) \ #define R_PTR_ALIGN(v,t) \
((char *)(((ut64)(v) ) \ ((char *)(((size_t)(v) ) \
& ~(t - 1))) & ~(t - 1)))
#define R_PTR_ALIGN_NEXT(v,t) \ #define R_PTR_ALIGN_NEXT(v,t) \
((char *)(((ut64)(v) + (t - 1)) \ ((char *)(((size_t)(v) + (t - 1)) \
& ~(t - 1))) & ~(t - 1)))
#define R_BIT_SET(x,y) (x[y>>4] |= (1<<(y&0xf))) #define R_BIT_SET(x,y) (x[y>>4] |= (1<<(y&0xf)))

View File

@ -342,7 +342,7 @@ R_API int r_io_write(struct r_io_t *io, const ut8 *buf, int len) {
} }
R_API int r_io_write_at(RIO *io, ut64 addr, const ut8 *buf, int len) { R_API int r_io_write_at(RIO *io, ut64 addr, const ut8 *buf, int len) {
if (r_io_seek (io, addr, R_IO_SEEK_SET)<0) if (r_io_seek (io, addr, R_IO_SEEK_SET) == UT64_MAX)
return -1; return -1;
return r_io_write (io, buf, len); return r_io_write (io, buf, len);
} }

View File

@ -33,10 +33,11 @@ static void haret_wait_until_prompt(RSocket *s) {
} }
} }
static int haret__read(struct r_io_t *io, RIODesc *fd, ut8 *buf, int count) { static int haret__read(RIO *io, RIODesc *fd, ut8 *buf, int count) {
char tmp[1024]; char tmp[1024];
int i = 0; int i = 0;
ut64 off, j; ut64 off;
st64 j;
RSocket *s = HARET_FD (fd); RSocket *s = HARET_FD (fd);
off = io->off & -4; off = io->off & -4;
@ -55,7 +56,7 @@ static int haret__read(struct r_io_t *io, RIODesc *fd, ut8 *buf, int count) {
tmp[(io->off - off)*2] = 0; tmp[(io->off - off)*2] = 0;
i += r_hex_str2bin (tmp+j, buf+i); i += r_hex_str2bin (tmp+j, buf+i);
} }
j=0; j = 0;
} }
haret_wait_until_prompt (s); haret_wait_until_prompt (s);
return i; return i;

View File

@ -35,7 +35,7 @@
#define FLDSIZE_X (FLDBASE * 2 + 1) #define FLDSIZE_X (FLDBASE * 2 + 1)
//static char * key_fingerprint_randomart(ut8 *dgst_raw, ut32 dgst_raw_len) { //static char * key_fingerprint_randomart(ut8 *dgst_raw, ut32 dgst_raw_len) {
R_API char * r_print_randomart(const ut8 *dgst_raw, ut32 dgst_raw_len, ut64 addr) { R_API char *r_print_randomart(const ut8 *dgst_raw, ut32 dgst_raw_len, ut64 addr) {
/* /*
* Chars to be used after each other every time the worm * Chars to be used after each other every time the worm
* intersects with itself. Matter of taste. * intersects with itself. Matter of taste.