Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
PPSi
Commits
16cabad8
Commit
16cabad8
authored
Mar 08, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bmc: use better local variables ti simplify
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
b553a0fd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
bmc.c
proto-standard/bmc.c
+8
-10
No files found.
proto-standard/bmc.c
View file @
16cabad8
...
...
@@ -102,11 +102,11 @@ static int bmc_dataset_cmp(struct pp_instance *ppi,
struct
pp_frgn_master
*
b
)
{
struct
ClockQuality
*
qa
,
*
qb
;
struct
MsgHeader
*
ha
=
&
a
->
hdr
;
struct
MsgHeader
*
hb
=
&
b
->
hdr
;
struct
MsgAnnounce
*
aa
=
&
a
->
ann
;
struct
MsgAnnounce
*
ab
=
&
b
->
ann
;
struct
ClockIdentity
*
ppci
;
struct
ClockIdentity
*
ida
=
&
a
->
hdr
.
sourcePortIdentity
.
clockIdentity
;
struct
ClockIdentity
*
idb
=
&
b
->
hdr
.
sourcePortIdentity
.
clockIdentity
;
struct
ClockIdentity
*
idparent
;
PP_VPRINTF
(
"BMC: in bmc_dataset_cmp
\n
"
);
...
...
@@ -120,10 +120,10 @@ static int bmc_dataset_cmp(struct pp_instance *ppi,
if
(
ab
->
stepsRemoved
>
aa
->
stepsRemoved
+
1
)
return
-
1
;
ppci
=
&
DSPAR
(
ppi
)
->
parentPortIdentity
.
clockIdentity
;
idparent
=
&
DSPAR
(
ppi
)
->
parentPortIdentity
.
clockIdentity
;
if
(
aa
->
stepsRemoved
>
ab
->
stepsRemoved
)
{
if
(
!
idcmp
(
&
ha
->
sourcePortIdentity
.
clockIdentity
,
ppci
))
{
if
(
!
idcmp
(
ida
,
idparent
))
{
PP_PRINTF
(
"Sender=Receiver: Error -1"
);
return
0
;
}
...
...
@@ -131,20 +131,18 @@ static int bmc_dataset_cmp(struct pp_instance *ppi,
}
if
(
ab
->
stepsRemoved
>
aa
->
stepsRemoved
)
{
if
(
!
idcmp
(
&
hb
->
sourcePortIdentity
.
clockIdentity
,
ppci
))
{
if
(
!
idcmp
(
idb
,
idparent
))
{
PP_PRINTF
(
"Sender=Receiver: Error -3"
);
return
0
;
}
return
-
1
;
}
if
(
!
idcmp
(
&
ha
->
sourcePortIdentity
.
clockIdentity
,
&
hb
->
sourcePortIdentity
.
clockIdentity
))
{
if
(
!
idcmp
(
ida
,
idb
))
{
PP_PRINTF
(
"Sender=Receiver: Error -2"
);
return
0
;
}
if
(
idcmp
(
&
ha
->
sourcePortIdentity
.
clockIdentity
,
&
hb
->
sourcePortIdentity
.
clockIdentity
)
<
0
)
if
(
idcmp
(
ida
,
idb
)
<
0
)
return
-
1
;
return
1
;
}
...
...
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