fixed compiler errors

This commit is contained in:
merlokk 2017-11-13 13:01:57 +02:00
commit eb906d6a7e
3 changed files with 3 additions and 13 deletions

View file

@ -19,6 +19,7 @@
#include "dump.h" #include "dump.h"
#include <stdio.h> #include <stdio.h>
#include <string.h>
#define PRINT_INDENT(level) {for (int i = 0; i < (level); i++) fprintf(f, "\t");} #define PRINT_INDENT(level) {for (int i = 0; i < (level); i++) fprintf(f, "\t");}
@ -36,8 +37,6 @@ void dump_buffer_simple(const unsigned char *ptr, size_t len, FILE *f)
void dump_buffer(const unsigned char *ptr, size_t len, FILE *f, int level) void dump_buffer(const unsigned char *ptr, size_t len, FILE *f, int level)
{ {
int i, j; int i, j;
char buf[64] = {0};
memset(buf, ' ', tabs > 64 ? 64 : tabs);
if (!f) if (!f)
f = stdout; f = stdout;
@ -59,7 +58,3 @@ void dump_buffer(const unsigned char *ptr, size_t len, FILE *f, int level)
} }
} }
void dump_buffer(const unsigned char *ptr, size_t len, FILE *f) {
dump_buffer_tab(ptr, len, f, 4);
}

View file

@ -107,7 +107,7 @@ void TLVPrintFromTLV(struct tlvdb *tlv) {
if (!tlv) if (!tlv)
return; return;
tlvdb_visit(tlv, print_cb, NULL); tlvdb_visit(tlv, print_cb, NULL, 0);
} }
void TLVPrintAIDlistFromSelectTLV(struct tlvdb *tlv) { void TLVPrintAIDlistFromSelectTLV(struct tlvdb *tlv) {

View file

@ -345,7 +345,6 @@ void tlvdb_add(struct tlvdb *tlvdb, struct tlvdb *other)
void tlvdb_visit(const struct tlvdb *tlvdb, tlv_cb cb, void *data, int level) void tlvdb_visit(const struct tlvdb *tlvdb, tlv_cb cb, void *data, int level)
{ {
struct tlvdb *next = NULL; struct tlvdb *next = NULL;
lvl++;
if (!tlvdb) if (!tlvdb)
return; return;
@ -353,14 +352,10 @@ void tlvdb_visit(const struct tlvdb *tlvdb, tlv_cb cb, void *data, int level)
for (; tlvdb; tlvdb = next) { for (; tlvdb; tlvdb = next) {
next = tlvdb->next; next = tlvdb->next;
cb(data, &tlvdb->tag, level, (tlvdb->children == NULL)); cb(data, &tlvdb->tag, level, (tlvdb->children == NULL));
tlvdb_visit(tlvdb->children, cb, data, level+1); tlvdb_visit(tlvdb->children, cb, data, level + 1);
} }
} }
void tlvdb_visit(const struct tlvdb *tlvdb, tlv_cb cb, void *data) {
tlvdb_visit_ex(tlvdb, cb, data, 0);
}
static const struct tlvdb *tlvdb_next(const struct tlvdb *tlvdb) static const struct tlvdb *tlvdb_next(const struct tlvdb *tlvdb)
{ {
if (tlvdb->children) if (tlvdb->children)