From 5340978eac96245a9b4163bfd7cbdcd0e0c5da34 Mon Sep 17 00:00:00 2001 From: Sven Gestegard Robertz <sven.robertz@cs.lth.se> Date: Sun, 26 Oct 2014 18:42:03 +0100 Subject: [PATCH] small tweak of decoder_skip --- lib/c/labcomm_decoder.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/c/labcomm_decoder.c b/lib/c/labcomm_decoder.c index d5613be..c6ae216 100644 --- a/lib/c/labcomm_decoder.c +++ b/lib/c/labcomm_decoder.c @@ -230,7 +230,7 @@ out: return result; } -static int decoder_skip(struct labcomm_decoder *d, int len) +static int decoder_skip(struct labcomm_decoder *d, int len, int tag) { int i; printf("skipping %d bytes\n", len); @@ -240,7 +240,7 @@ static int decoder_skip(struct labcomm_decoder *d, int len) return d->reader->error; } } - return 0; + return tag; } static int decode_pragma(struct labcomm_decoder *d, int len) { @@ -280,7 +280,7 @@ static int decode_pragma(struct labcomm_decoder *d, int len) internal_labcomm_decoder_free(pd); result = 0; } else { - result = decoder_skip(d, psize); + result = decoder_skip(d, psize, LABCOMM_PRAGMA); } out: return result; @@ -311,8 +311,9 @@ int labcomm_decoder_decode_one(struct labcomm_decoder *d) } else if (remote_index == LABCOMM_PRAGMA ){ result = decode_pragma(d, length); } else if (remote_index < LABCOMM_USER) { - fprintf(stderr, "SKIP %d %d\n", remote_index, length); - result = remote_index; + //fprintf(stderr, "SKIP %d %d\n", remote_index, length); + //result = remote_index; + result = decoder_skip(d, length, remote_index); } else { int *local_index; struct call_handler_context wrap = { -- GitLab