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
46f9cde3
Commit
46f9cde3
authored
Mar 07, 2013
by
Alessandro Rubini
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bmc: don't memcmp one byte, just subtract
Signed-off-by:
Alessandro Rubini
<
rubini@gnudd.com
>
parent
22d4a4af
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
bmc.c
proto-standard/bmc.c
+5
-5
No files found.
proto-standard/bmc.c
View file @
46f9cde3
...
...
@@ -158,19 +158,19 @@ static int bmc_dataset_cmp(struct pp_instance *ppi,
if
(
ann_a
->
grandmasterPriority2
==
ann_b
->
grandmasterPriority2
)
return
memcmp
(
&
ann_a
->
grandmasterIdentity
,
&
ann_b
->
grandmasterIdentity
,
PP_CLOCK_IDENTITY_LENGTH
);
/* Priority2 are not identical */
return
memcmp
(
&
ann_a
->
grandmasterPriority2
,
&
ann_b
->
grandmasterPriority2
,
1
)
;
return
ann_a
->
grandmasterPriority2
-
ann_b
->
grandmasterPriority2
;
}
/* offsetScaledLogVariance are not identical */
return
memcmp
(
&
ann_a
->
grandmasterClockQuality
.
clockClass
,
&
ann_b
->
grandmasterClockQuality
.
clockClass
,
1
)
;
return
ann_a
->
grandmasterClockQuality
.
clockClass
-
ann_b
->
grandmasterClockQuality
.
clockClass
;
}
/* Accuracy are not identitcal */
return
memcmp
(
&
ann_a
->
grandmasterClockQuality
.
clockAccuracy
,
&
ann_b
->
grandmasterClockQuality
.
clockAccuracy
,
1
)
;
return
ann_a
->
grandmasterClockQuality
.
clockAccuracy
-
ann_b
->
grandmasterClockQuality
.
clockAccuracy
;
}
/* ClockClass are not identical */
return
memcmp
(
&
ann_a
->
grandmasterClockQuality
.
clockClass
,
&
ann_b
->
grandmasterClockQuality
.
clockClass
,
1
)
;
return
ann_a
->
grandmasterClockQuality
.
clockClass
-
ann_b
->
grandmasterClockQuality
.
clockClass
;
}
/* Priority1 are not identical */
return
memcmp
(
&
ann_a
->
grandmasterPriority1
,
&
ann_b
->
grandmasterPriority1
,
1
)
;
return
ann_a
->
grandmasterPriority1
-
ann_b
->
grandmasterPriority1
;
}
/* 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