Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
M
Mock Turtle
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
Mock Turtle
Commits
79bf1f72
Commit
79bf1f72
authored
May 03, 2019
by
Federico Vaga
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sw:tools: reduce variable scope
Signed-off-by:
Federico Vaga
<
federico.vaga@cern.ch
>
parent
67988e8f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
mockturtle-messages.c
software/tools/mockturtle-messages.c
+10
-5
No files found.
software/tools/mockturtle-messages.c
View file @
79bf1f72
...
...
@@ -63,12 +63,13 @@ static void help()
static
int
dump_message
(
struct
polltrtl
*
p
)
{
struct
trtl_msg
wmsg
;
time_t
tm
;
char
stime
[
64
];
struct
tm
*
gm
;
int
i
,
ret
;
int
ret
;
if
(
timestamp
)
{
time_t
tm
;
struct
tm
*
gm
;
char
stime
[
64
];
tm
=
time
(
NULL
);
gm
=
gmtime
(
&
tm
);
strftime
(
stime
,
64
,
"%T"
,
gm
);
...
...
@@ -88,6 +89,8 @@ static int dump_message(struct polltrtl *p)
if
(
protocol
)
{
trtl_print_message
(
&
wmsg
);
}
else
{
int
i
;
for
(
i
=
0
;
i
<
wmsg
.
hdr
.
len
;
++
i
)
{
if
(
i
%
4
==
0
)
fprintf
(
stdout
,
"
\n
%04d :"
,
i
);
...
...
@@ -111,7 +114,7 @@ void *message_thread(void *arg)
unsigned
int
cnt
;
struct
polltrtl
p
[
1
];
struct
trtl_dev
*
trtl
;
int
ret
,
err
;
int
err
;
/* Open the device */
trtl
=
trtl_open_by_id
(
th
->
devid
);
...
...
@@ -129,6 +132,8 @@ void *message_thread(void *arg)
/* Start dumping messages */
while
(
th
->
n
==
0
||
th
->
n
>
cnt
)
{
int
ret
;
/* Polling slots */
ret
=
trtl_msg_poll
(
p
,
1
,
1000
);
switch
(
ret
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment