Skip to content
Snippets Groups Projects
Commit 35db2e07 authored by Sven Gestegård Robertz's avatar Sven Gestegård Robertz
Browse files

removed printfs from decoder.c

parent 086d1d02
No related branches found
No related tags found
No related merge requests found
...@@ -169,16 +169,22 @@ static int handle_sample_ref(struct labcomm_decoder *d, int remote_index, ...@@ -169,16 +169,22 @@ static int handle_sample_ref(struct labcomm_decoder *d, int remote_index,
static int decoder_skip(struct labcomm_decoder *d, int len, int tag) static int decoder_skip(struct labcomm_decoder *d, int len, int tag)
{ {
int i; int i;
#ifdef LABCOMM_DECODER_DEBUG
printf("got tag 0x%x, skipping %d bytes\n", tag, len); printf("got tag 0x%x, skipping %d bytes\n", tag, len);
#endif
for(i = 0; i <len; i++){ for(i = 0; i <len; i++){
fprintf(stderr,"."); fprintf(stderr,".");
labcomm_read_byte(d->reader); labcomm_read_byte(d->reader);
if (d->reader->error < 0) { if (d->reader->error < 0) {
#ifdef LABCOMM_DECODER_DEBUG
fprintf(stderr, "\nerror while skipping: %d\n", d->reader->error); fprintf(stderr, "\nerror while skipping: %d\n", d->reader->error);
#endif
return d->reader->error; return d->reader->error;
} }
} }
#ifdef LABCOMM_DECODER_DEBUG
fprintf(stderr, "\n"); fprintf(stderr, "\n");
#endif
return tag; return tag;
} }
...@@ -196,7 +202,9 @@ static int decode_type_binding(struct labcomm_decoder *d, int kind) ...@@ -196,7 +202,9 @@ static int decode_type_binding(struct labcomm_decoder *d, int kind)
result = d->reader->error; result = d->reader->error;
goto out; goto out;
} }
#ifdef LABCOMM_DECODER_DEBUG
printf("type_binding: 0x%x -> 0x%x\n", sample_index, type_def_index); printf("type_binding: 0x%x -> 0x%x\n", sample_index, type_def_index);
#endif
out: out:
return result; return result;
} }
...@@ -439,7 +447,9 @@ int labcomm_decoder_decode_one(struct labcomm_decoder *d) ...@@ -439,7 +447,9 @@ int labcomm_decoder_decode_one(struct labcomm_decoder *d)
} }
labcomm_memory_free(d->memory, 1, version); labcomm_memory_free(d->memory, 1, version);
} else if (! d->version_ok) { } else if (! d->version_ok) {
#ifdef LABCOMM_DECODER_DEBUG
fprintf(stderr, "No VERSION %d %d\n", remote_index, length); fprintf(stderr, "No VERSION %d %d\n", remote_index, length);
#endif
result = -ECONNRESET; result = -ECONNRESET;
} else if (remote_index == LABCOMM_SAMPLE_DEF) { } else if (remote_index == LABCOMM_SAMPLE_DEF) {
result = decode_sample_def_or_ref(d, LABCOMM_SAMPLE_DEF); result = decode_sample_def_or_ref(d, LABCOMM_SAMPLE_DEF);
...@@ -468,7 +478,9 @@ int labcomm_decoder_decode_one(struct labcomm_decoder *d) ...@@ -468,7 +478,9 @@ int labcomm_decoder_decode_one(struct labcomm_decoder *d)
} else if (remote_index == LABCOMM_PRAGMA) { } else if (remote_index == LABCOMM_PRAGMA) {
result = decode_pragma(d, d, length); result = decode_pragma(d, d, length);
} else if (remote_index < LABCOMM_USER) { } else if (remote_index < LABCOMM_USER) {
#ifdef LABCOMM_DECODER_DEBUG
fprintf(stderr, "SKIP %d %d\n", remote_index, length); fprintf(stderr, "SKIP %d %d\n", remote_index, length);
#endif
result = decoder_skip(d, length, remote_index); result = decoder_skip(d, length, remote_index);
} else { } else {
result = decode_and_handle(d, d, remote_index); result = decode_and_handle(d, d, remote_index);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment