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
9f177f4e
Commit
9f177f4e
authored
Mar 07, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bmc: compare most-significant first
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
46f9cde3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
20 deletions
+16
-20
bmc.c
proto-standard/bmc.c
+16
-20
No files found.
proto-standard/bmc.c
View file @
9f177f4e
...
@@ -150,27 +150,23 @@ static int bmc_dataset_cmp(struct pp_instance *ppi,
...
@@ -150,27 +150,23 @@ static int bmc_dataset_cmp(struct pp_instance *ppi,
}
}
/* GrandMaster are not identical */
/* GrandMaster are not identical */
if
(
ann_a
->
grandmasterPriority1
==
ann_b
->
grandmasterPriority1
)
{
if
(
ann_a
->
grandmasterClockQuality
.
clockClass
==
if
(
ann_a
->
grandmasterPriority1
!=
ann_b
->
grandmasterPriority1
)
ann_b
->
grandmasterClockQuality
.
clockClass
)
{
return
ann_a
->
grandmasterPriority1
-
ann_b
->
grandmasterPriority1
;
if
(
ann_a
->
grandmasterClockQuality
.
clockAccuracy
==
ann_b
->
grandmasterClockQuality
.
clockAccuracy
)
{
if
(
ann_a
->
grandmasterClockQuality
.
offsetScaledLogVariance
==
ann_b
->
grandmasterClockQuality
.
offsetScaledLogVariance
)
{
if
(
ann_a
->
grandmasterClockQuality
.
clockClass
!=
ann_b
->
grandmasterClockQuality
.
clockClass
)
if
(
ann_a
->
grandmasterPriority2
==
ann_b
->
grandmasterPriority2
)
return
memcmp
(
&
ann_a
->
grandmasterIdentity
,
&
ann_b
->
grandmasterIdentity
,
PP_CLOCK_IDENTITY_LENGTH
);
/* Priority2 are not identical */
return
ann_a
->
grandmasterPriority2
-
ann_b
->
grandmasterPriority2
;
}
/* offsetScaledLogVariance are not identical */
return
ann_a
->
grandmasterClockQuality
.
clockClass
-
ann_b
->
grandmasterClockQuality
.
clockClass
;
}
/* Accuracy are not identitcal */
return
ann_a
->
grandmasterClockQuality
.
clockAccuracy
-
ann_b
->
grandmasterClockQuality
.
clockAccuracy
;
}
/* ClockClass are not identical */
return
ann_a
->
grandmasterClockQuality
.
clockClass
-
ann_b
->
grandmasterClockQuality
.
clockClass
;
return
ann_a
->
grandmasterClockQuality
.
clockClass
-
ann_b
->
grandmasterClockQuality
.
clockClass
;
}
/* Priority1 are not identical */
if
(
ann_a
->
grandmasterClockQuality
.
clockAccuracy
!=
ann_b
->
grandmasterClockQuality
.
clockAccuracy
)
return
ann_a
->
grandmasterPriority1
-
ann_b
->
grandmasterPriority1
;
return
ann_a
->
grandmasterClockQuality
.
clockAccuracy
-
ann_b
->
grandmasterClockQuality
.
clockAccuracy
;
if
(
ann_a
->
grandmasterClockQuality
.
offsetScaledLogVariance
!=
ann_b
->
grandmasterClockQuality
.
offsetScaledLogVariance
)
return
ann_a
->
grandmasterClockQuality
.
clockClass
-
ann_b
->
grandmasterClockQuality
.
clockClass
;
if
(
ann_a
->
grandmasterPriority2
!=
ann_b
->
grandmasterPriority2
)
return
ann_a
->
grandmasterPriority2
-
ann_b
->
grandmasterPriority2
;
return
memcmp
(
&
ann_a
->
grandmasterIdentity
,
&
ann_b
->
grandmasterIdentity
,
PP_CLOCK_IDENTITY_LENGTH
);
}
}
/* State decision algorithm 9.3.3 Fig 26 */
/* State decision algorithm 9.3.3 Fig 26 */
...
...
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