diff --git a/libr/cons/t/Makefile b/libr/cons/t/Makefile new file mode 100644 index 0000000000..86c91d7674 --- /dev/null +++ b/libr/cons/t/Makefile @@ -0,0 +1,2 @@ +all: + gcc test-rgb.c -I../../include -lr_cons -L../../libr/cons -L../../libr/util -lr_util diff --git a/libr/cons/test-rgb.c b/libr/cons/t/test-rgb.c similarity index 100% rename from libr/cons/test-rgb.c rename to libr/cons/t/test-rgb.c diff --git a/libr/core/cmd_debug.c b/libr/core/cmd_debug.c index 23a96c62c2..99a0b3e5ce 100644 --- a/libr/core/cmd_debug.c +++ b/libr/core/cmd_debug.c @@ -111,12 +111,12 @@ static void cmd_debug_pid(RCore *core, const char *input) { } else eprintf ("cmd_debug_pid: Invalid arguments (%s)\n", input); break; case 'n': - eprintf ("TODO: debug_fork: %d\n", r_debug_fork (core->dbg)); + eprintf ("TODO: debug_fork: %d\n", r_debug_child_fork (core->dbg)); break; case 't': switch (input[2]) { case 'n': - eprintf ("TODO: debug_clone: %d\n", r_debug_clone (core->dbg)); + eprintf ("TODO: debug_clone: %d\n", r_debug_child_clone (core->dbg)); break; case '=': case ' ': diff --git a/libr/db/Makefile b/libr/db/Makefile index c87a9d68ad..6f2fb558ea 100644 --- a/libr/db/Makefile +++ b/libr/db/Makefile @@ -13,9 +13,6 @@ SDB_OBJS+=buffer.o SDB_OBJS+=cdb.o SDB_OBJS+=cdb_make.o SDB_OBJS+=ht.o -SDB_OBJS+=json/js0n.o -SDB_OBJS+=json/json.o -SDB_OBJS+=json/rangstr.o SDB_OBJS+=json.o SDB_OBJS+=lock.o SDB_OBJS+=ls.o diff --git a/libr/debug/debug.c b/libr/debug/debug.c index c88829c483..f23ab0337f 100644 --- a/libr/debug/debug.c +++ b/libr/debug/debug.c @@ -481,13 +481,13 @@ R_API RList *r_debug_frames (RDebug *dbg, ut64 at) { } /* TODO: Implement fork and clone */ -R_API int r_debug_fork (RDebug *dbg) { +R_API int r_debug_child_fork (RDebug *dbg) { //if (dbg && dbg->h && dbg->h->frames) //return dbg->h->frames (dbg); return 0; } -R_API int r_debug_clone (RDebug *dbg) { +R_API int r_debug_child_clone (RDebug *dbg) { //if (dbg && dbg->h && dbg->h->frames) //return dbg->h->frames (dbg); return 0; diff --git a/libr/hash/Makefile b/libr/hash/Makefile index 3eabd6f7eb..4d5c5056dc 100644 --- a/libr/hash/Makefile +++ b/libr/hash/Makefile @@ -9,7 +9,7 @@ LINK=-lm endif endif -OBJS=state.o md5c.o crc16.o crc32.o sha1.o hash.o +OBJS=state.o md5c.o crc16.o crc32.o sha1.o hash.o md4.o OBJS+=hamdist.o entropy.o sha2.o calc.o xxhash.o adler32.o include ../rules.mk diff --git a/libr/hash/md4.c b/libr/hash/md4.c index 740fc9bf42..604813bc8f 100644 --- a/libr/hash/md4.c +++ b/libr/hash/md4.c @@ -53,7 +53,6 @@ static void mdfour64(ut32 * M, ut32 * A, ut32 *B, ut32 * C, ut32 *D) { ut32 AA, BB, CC, DD; ut32 X[16]; - for (j = 0; j < 16; j++) X[j] = M[j]; @@ -143,7 +142,7 @@ static void copy4(ut8 *out, ut32 x) { /* produce a md4 message digest from data of length n bytes */ // XXX : rename as a static method -void mdfour(ut8 *out, const ut8 *in, int n) { +R_API void mdfour(ut8 *out, const ut8 *in, int n) { unsigned char buf[128]; ut32 M[16]; ut32 b = n * 8; diff --git a/libr/hash/state.c b/libr/hash/state.c index 2e5bab2784..15ccc92b40 100644 --- a/libr/hash/state.c +++ b/libr/hash/state.c @@ -1,11 +1,11 @@ -/* radare - LGPL - Copyright 2009-2011 pancake */ +/* radare - LGPL - Copyright 2009-2013 pancake */ // TODO: use ptr tablez here #include "r_hash.h" #include "md5.h" #include "sha1.h" #include "sha2.h" -#include "md4.c" // included directly +R_API void mdfour(ut8 *out, const ut8 *in, int n); #define CHKFLAG(f,x) if (f==0||f&x) diff --git a/libr/include/r_debug.h b/libr/include/r_debug.h index 6cbbb438e7..8e40eb71fb 100644 --- a/libr/include/r_debug.h +++ b/libr/include/r_debug.h @@ -308,8 +308,8 @@ R_API RDebugTracepoint *r_debug_trace_add (RDebug *dbg, ut64 addr, int size); R_API RDebugTrace *r_debug_trace_new (); R_API void r_debug_trace_free (RDebug *dbg); R_API int r_debug_trace_tag (RDebug *dbg, int tag); -R_API int r_debug_fork (RDebug *dbg); -R_API int r_debug_clone (RDebug *dbg); +R_API int r_debug_child_fork (RDebug *dbg); +R_API int r_debug_child_clone (RDebug *dbg); /* plugin pointers */ extern RDebugPlugin r_debug_plugin_native; diff --git a/libr/util/constr.c b/libr/util/constr.c index 3a2a9be26f..07a419ceb7 100644 --- a/libr/util/constr.c +++ b/libr/util/constr.c @@ -34,7 +34,7 @@ R_API const char *r_constr_append (RConstr *c, const char *str) { } R_API const char *r_constr_add (RConstr *c, const char *str) { - char *p = r_constr_get (c, str); + char *p = (char *)r_constr_get (c, str); return p? p: r_constr_append (c, str); } diff --git a/libr/util/iconv.c b/libr/util/iconv.c index d1c30e61ae..8c9b777594 100644 --- a/libr/util/iconv.c +++ b/libr/util/iconv.c @@ -1,9 +1,12 @@ +/* radare - LGPL - Copyright 2013 - pancake */ + #include #include +#include char *r_str_iconv (const char *str, int *len) { iconv_t cd; - char *inbuf = str; + char *inbuf = (char*)str; // XXX dangerous cast size_t inbytesleft = strlen (str); char data[1024]; char *outbuf = (char*)&data; diff --git a/libr/util/sys.c b/libr/util/sys.c index 0aa0443fbd..e4b9d99fad 100644 --- a/libr/util/sys.c +++ b/libr/util/sys.c @@ -85,7 +85,7 @@ R_API void r_sys_backtrace(void) { #if (__linux__ && __GNU_LIBRARY__) || (__APPLE__ && APPLE_WITH_BACKTRACE) void *array[10]; size_t i, size = backtrace (array, 10); - char **strings = backtrace_symbols (array, size); + char **strings = (char **)(size_t)backtrace_symbols (array, size); printf ("Backtrace %zd stack frames.\n", size); for (i = 0; i < size; i++) printf ("%s\n", strings[i]); diff --git a/shlr/sdb/Makefile b/shlr/sdb/Makefile index b9f3721cd9..eac6f18aaa 100644 --- a/shlr/sdb/Makefile +++ b/shlr/sdb/Makefile @@ -20,7 +20,8 @@ src/sdb-version.h: EMCCFLAGS=-O2 -s ASM_JS=1 #EMCCFLAGS+=--embed-file sdb.data sdb.js: src/sdb-version.h - cd src ; emcc ${EMCCFLAGS} -I. -o ../sdb.js *.c json/api.c json/js0n.c json/json.c json/rangstr.c + cd src ; emcc ${EMCCFLAGS} -I. -o ../sdb.js *.c +#json/api.c json/js0n.c json/json.c json/rangstr.c clean: rm -f src/sdb-version.h diff --git a/shlr/sdb/src/Makefile b/shlr/sdb/src/Makefile index fdf8d705d4..6706829033 100644 --- a/shlr/sdb/src/Makefile +++ b/shlr/sdb/src/Makefile @@ -3,7 +3,8 @@ include ../config.mk CFLAGS+= -g -ggdb #CFLAGS+=-DOLDFMT=1 OBJ=cdb.o buffer.o cdb_make.o ls.o ht.o sdb.o sdbn.o sdba.o query.o -OBJ+=json.o json/js0n.o json/json.o json/rangstr.o ns.o lock.o util.o +OBJ+=json.o ns.o lock.o util.o +#json/js0n.o json/json.o json/rangstr.o SOBJ=$(subst .o,._o,${OBJ}) diff --git a/shlr/sdb/src/json.c b/shlr/sdb/src/json.c index 6a46a90866..8e153173b0 100644 --- a/shlr/sdb/src/json.c +++ b/shlr/sdb/src/json.c @@ -2,7 +2,11 @@ #include #include "sdb.h" -#include "json/json.h" +//#include "json/json.h" +#include "json/api.c" +#include "json/js0n.c" +#include "json/json.c" +#include "json/rangstr.c" static void __itoa(int value, char *string) { int i, sign, count = 0; diff --git a/shlr/sdb/src/json/Makefile b/shlr/sdb/src/json/Makefile index 98d4a73bf2..8820844e7a 100644 --- a/shlr/sdb/src/json/Makefile +++ b/shlr/sdb/src/json/Makefile @@ -1,4 +1,5 @@ include ../../config.mk + CFLAGS+=-Wall -g -ggdb BIN=a.out OBJ=rangstr.o json.o js0n.o api.o main.o @@ -7,7 +8,7 @@ OBJ+=../libsdb.a all: ${BIN} ${BIN}: ${OBJ} - ${CC} -o ${BIN} ${OBJ} + ${CC} main.c -DMAIN=1 -o ${BIN} ../libsdb.a clean: rm -f ${OBJ} ${BIN} diff --git a/shlr/sdb/src/sdb-version.h b/shlr/sdb/src/sdb-version.h new file mode 100644 index 0000000000..876c971528 --- /dev/null +++ b/shlr/sdb/src/sdb-version.h @@ -0,0 +1 @@ +#define SDB_VERSION "0.6.4"