Skip to content

Commit

Permalink
ptpd: Fix reserved word 'class'
Browse files Browse the repository at this point in the history
When ptpd.h is included in C++ code, the use of identifier 'class'
caused a compilation error. Changed to "clockclass".
  • Loading branch information
PetteriAimonen committed Dec 7, 2023
1 parent f57cd2c commit bbbfbe5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/netutils/ptpd.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct ptpd_status_s
uint8_t id[8]; /* Clock identity */
int utcoffset; /* Offset between clock time and UTC time (seconds) */
int priority1; /* Main priority field */
int class; /* Clock class (IEEE-1588, lower is better) */
int clockclass; /* Clock class (IEEE-1588, lower is better) */
int accuracy; /* Clock accuracy (IEEE-1588, lower is better) */
int variance; /* Clock variance (IEEE-1588, lower is better) */
int priority2; /* Secondary priority field */
Expand Down
2 changes: 1 addition & 1 deletion netutils/ptpd/ptpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1342,7 +1342,7 @@ static void ptp_process_statusreq(FAR struct ptp_state_s *state)
status->clock_source_info.utcoffset =
(int16_t)(((uint16_t)s->utcoffset[0] << 8) | s->utcoffset[1]);
status->clock_source_info.priority1 = s->gm_priority1;
status->clock_source_info.class = s->gm_quality[0];
status->clock_source_info.clockclass = s->gm_quality[0];
status->clock_source_info.accuracy = s->gm_quality[1];
status->clock_source_info.priority2 = s->gm_priority2;
status->clock_source_info.variance =
Expand Down

0 comments on commit bbbfbe5

Please sign in to comment.