Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LabComm
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
LabComm
Commits
35db2e07
Commit
35db2e07
authored
10 years ago
by
Sven Gestegård Robertz
Browse files
Options
Downloads
Patches
Plain Diff
removed printfs from decoder.c
parent
086d1d02
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/c/2014/labcomm_decoder.c
+12
-0
12 additions, 0 deletions
lib/c/2014/labcomm_decoder.c
with
12 additions
and
0 deletions
lib/c/2014/labcomm_decoder.c
+
12
−
0
View file @
35db2e07
...
@@ -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
,
"
\n
error while skipping: %d
\n
"
,
d
->
reader
->
error
);
fprintf
(
stderr
,
"
\n
error 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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment