FIx warnings with latest GCC on GNU/Linux

This commit is contained in:
pancake 2019-10-08 17:42:39 +02:00
parent 881814575e
commit 94ed5c2c7d
5 changed files with 3 additions and 30 deletions

View file

@ -181,7 +181,6 @@ static RList *symbols(RBinFile *bf) {
int i;
RList *ret = NULL;
RBinSymbol *ptr = NULL;
struct coff_symbol *s;
struct r_bin_coff_obj *obj = (struct r_bin_coff_obj*)bf->o->bin_obj;
if (!(ret = r_list_new ())) {
return ret;
@ -189,7 +188,6 @@ static RList *symbols(RBinFile *bf) {
ret->free = free;
if (obj->symbols) {
for (i = 0; i < obj->hdr.f_nsyms; i++) {
s = &obj->symbols[i];
if (!(ptr = R_NEW0 (RBinSymbol))) {
break;
}

View file

@ -325,7 +325,7 @@ static RList *trycatch(RBinFile *bf) {
return NULL;
}
RList *tclist = r_list_newf (r_bin_trycatch_free);
RList *tclist = r_list_newf ((RListFree)r_bin_trycatch_free);
if (!tclist) {
return NULL;
}
@ -390,9 +390,6 @@ static RList *trycatch(RBinFile *bf) {
}
}
return tclist;
err:
r_list_free (tclist);
return NULL;
}
RBinPlugin r_bin_plugin_pe64 = {

View file

@ -51,7 +51,7 @@ R_API int r_cons_controlz(int ch) {
static int __parseMouseEvent() {
char xpos[32];
char ypos[32];
int ch = r_cons_readchar ();
(void)r_cons_readchar (); // skip first char
int ch2 = r_cons_readchar ();
// [32M - mousedown
@ -76,7 +76,7 @@ static int __parseMouseEvent() {
}
ypos[i] = 0;
r_cons_set_click (atoi (xpos), atoi (ypos));
ch = r_cons_readchar ();
(void) r_cons_readchar ();
// ignored
int ch = r_cons_readchar ();
if (ch == 27) {

View file

@ -156,7 +156,6 @@ R_API char* r_print_json_human(const char* s) {
const char *tab = " ";
const int indentSize = strlen (tab);
int instr = 0;
bool isValue = false;
char *o, *OE, *tmp;
if (!s) {
return NULL;
@ -218,16 +217,13 @@ R_API char* r_print_json_human(const char* s) {
case ':':
*o++ = *s;
*o++ = ' ';
isValue = true;
break;
case ',':
*o++ = '\n';
isValue = false;
doIndent (indent - 1, &o, tab);
break;
case '{':
case '[':
isValue = false;
if (indent > 0) {
*o++ = (indent != -1)? '\n': ' ';
}
@ -241,7 +237,6 @@ R_API char* r_print_json_human(const char* s) {
break;
case '}':
case ']':
isValue = false;
indent--;
doIndent (indent - 1, &o, tab);
break;

View file

@ -701,26 +701,9 @@ R_API void r_table_visual_list(RTable *table, RList *list, ut64 seek, ut64 len,
}
mul = (max - min) / width;
if (min != -1 && mul > 0) {
const char * color = "", *color_end = "";
i = 0;
r_list_foreach (list, iter, info) {
RStrBuf *buf = r_strbuf_new ("");
if (cons->context->color_mode && info->perm != -1) {
color_end = Color_RESET;
if ((info->perm & R_PERM_X) && (info->perm & R_PERM_W)) { // exec & write bits
color = cons->context->pal.graph_trufae;
} else if ((info->perm & R_PERM_X)) { // exec bit
color = cons->context->pal.graph_true;
} else if ((info->perm & R_PERM_W)) { // write bit
color = cons->context->pal.graph_false;
} else {
color = "";
color_end = "";
}
} else {
color = "";
color_end = "";
}
for (j = 0; j < width; j++) {
ut64 pos = min + j * mul;
ut64 npos = min + (j + 1) * mul;