net: lib: ptp: fix cpp compilation errors
Compilation errors in ptp library when using C++ compiler. First error is due to 'class' keyword being reserved in C++ and 'class' is used as a variable name in ptp library. Second error is due to a flexible array member in a struct is not placed at the end. Signed-off-by: Tomas Choat <trc@ixys.no>
This commit is contained in:
parent
7541742002
commit
bc3748ce60
4 changed files with 6 additions and 6 deletions
|
@ -100,7 +100,7 @@ int ptp_btca_ds_cmp(const struct ptp_dataset *a, const struct ptp_dataset *b)
|
|||
if (a->priority1 > b->priority1) {
|
||||
return B_BETTER;
|
||||
}
|
||||
if (a->clk_quality.class > b->clk_quality.class) {
|
||||
if (a->clk_quality.cls > b->clk_quality.cls) {
|
||||
return B_BETTER;
|
||||
}
|
||||
if (a->clk_quality.accuracy > b->clk_quality.accuracy) {
|
||||
|
@ -129,7 +129,7 @@ enum ptp_port_state ptp_btca_state_decision(struct ptp_port *port)
|
|||
return PTP_PS_LISTENING;
|
||||
}
|
||||
|
||||
if (clk_default->clk_quality.class <= 127) {
|
||||
if (clk_default->clk_quality.cls <= 127) {
|
||||
if (ptp_btca_ds_cmp(clk_default, port_best) > 0) {
|
||||
/* M1 */
|
||||
return PTP_PS_GRAND_MASTER;
|
||||
|
|
|
@ -262,7 +262,7 @@ const struct ptp_clock *ptp_clock_init(void)
|
|||
dds->n_ports = 0;
|
||||
dds->time_receiver_only = IS_ENABLED(CONFIG_PTP_TIME_RECEIVER_ONLY) ? true : false;
|
||||
|
||||
dds->clk_quality.class = dds->time_receiver_only ? 255 : 248;
|
||||
dds->clk_quality.cls = dds->time_receiver_only ? 255 : 248;
|
||||
dds->clk_quality.accuracy = CONFIG_PTP_CLOCK_ACCURACY;
|
||||
/* 0xFFFF means that value has not been computed - IEEE 1588-2019 7.6.3.3 */
|
||||
dds->clk_quality.offset_scaled_log_variance = 0xFFFF;
|
||||
|
|
|
@ -79,7 +79,7 @@ struct ptp_port_addr {
|
|||
*/
|
||||
struct ptp_clk_quality {
|
||||
/** PTP Clock's class */
|
||||
uint8_t class;
|
||||
uint8_t cls;
|
||||
/** Accuracy of the PTP Clock. */
|
||||
uint8_t accuracy;
|
||||
/** Value representing stability of the Local PTP Clock. */
|
||||
|
|
|
@ -101,10 +101,10 @@ struct ptp_parent_ds {
|
|||
uint8_t gm_priority1;
|
||||
/** Value of Grandmaster's priority2 attribute. */
|
||||
uint8_t gm_priority2;
|
||||
/** Address of the PTP Port issuing sync messages used to synchronize this PTP Instance. */
|
||||
struct ptp_port_addr protocol_addr;
|
||||
/** Flag inticating use of sync_uncertain flag in Announce message. */
|
||||
bool sync_uncertain;
|
||||
/** Address of the PTP Port issuing sync messages used to synchronize this PTP Instance. */
|
||||
struct ptp_port_addr protocol_addr;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue