Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaned up several clang/llvm warnings. #49

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/datatypes.h
Expand Up @@ -165,7 +165,7 @@ typedef struct {
Boolean requestable; /* is this mesage type even requestable? */
Boolean requested; /* slave: we have requested this */
Boolean canceled; /* this has been canceled (awaiting ack) */
Boolean cancelCount; /* how many times we sent the cancel message while waiting for ack */
UInteger8 cancelCount; /* how many times we sent the cancel message while waiting for ack */
Integer8 logInterval; /* interval we granted or got granted */
Integer8 logMinInterval; /* minimum interval we're going to request */
Integer8 logMaxInterval; /* maximum interval we're going to request */
Expand Down
2 changes: 1 addition & 1 deletion src/dep/net.c
Expand Up @@ -2017,7 +2017,7 @@ netSendEvent(Octet * buf, UInteger16 length, NetPath * netPath,

ssize_t
netSendGeneral(Octet * buf, UInteger16 length, NetPath * netPath,
const const RunTimeOpts *rtOpts, Integer32 destinationAddress)
const RunTimeOpts *rtOpts, Integer32 destinationAddress)
{
ssize_t ret;
struct sockaddr_in addr;
Expand Down
2 changes: 1 addition & 1 deletion src/dep/servo.c
Expand Up @@ -1035,7 +1035,7 @@ updateClock(const RunTimeOpts * rtOpts, PtpClock * ptpClock)
}

void
setupPIservo(PIservo* servo, const const RunTimeOpts* rtOpts)
setupPIservo(PIservo* servo, const RunTimeOpts* rtOpts)
{
servo->maxOutput = rtOpts->servoMaxPpb;
servo->kP = rtOpts->servoKP;
Expand Down
11 changes: 5 additions & 6 deletions src/signaling.c
Expand Up @@ -37,7 +37,7 @@

#include "ptpd.h"

/* how many times we send a cancel before we stop waiting for ack */
/* how many times we send a cancel before we stop waiting for ack. 8 bit unsigned. */
#define GRANT_CANCEL_ACK_TIMEOUT 3
/* every N grant refreshes, we re-request messages we don't seem to be receiving */
#define GRANT_KEEPALIVE_INTERVAL 5
Expand All @@ -56,7 +56,7 @@ static void handleSMAcknowledgeCancelUnicastTransmission(MsgSignaling* incoming,
static Boolean prepareSMRequestUnicastTransmission(MsgSignaling* outgoing, UnicastGrantData *grant, PtpClock* ptpClock);
static Boolean prepareSMCancelUnicastTransmission(MsgSignaling* outgoing, UnicastGrantData* grant, PtpClock* ptpClock);
static void requestUnicastTransmission(UnicastGrantData *grant, UInteger32 duration, const RunTimeOpts* rtOpts, PtpClock* ptpClock);
static void issueSignaling(MsgSignaling *outgoing, Integer32 destination, const const RunTimeOpts *rtOpts, PtpClock *ptpclock);
static void issueSignaling(MsgSignaling *outgoing, Integer32 destination, const RunTimeOpts *rtOpts, PtpClock *ptpclock);
static void cancelNodeGrants(UnicastGrantTable *nodeTable, const RunTimeOpts *rtOpts, PtpClock *ptpClock);

/* Return unicast grant array index for given message type */
Expand Down Expand Up @@ -658,7 +658,6 @@ handleSMAcknowledgeCancelUnicastTransmission(MsgSignaling* incoming, Integer32 s
myGrant->granted = FALSE;
myGrant->requested = FALSE;
myGrant->sentSeqId = 0;
myGrant->cancelCount = 0;
myGrant->timeLeft = 0;
myGrant->duration = 0;
myGrant->canceled = FALSE;
Expand Down Expand Up @@ -959,7 +958,7 @@ requestUnicastTransmission(UnicastGrantData *grant, UInteger32 duration, const R
}

void
cancelUnicastTransmission(UnicastGrantData* grant, const const RunTimeOpts* rtOpts, PtpClock* ptpClock)
cancelUnicastTransmission(UnicastGrantData* grant, const RunTimeOpts* rtOpts, PtpClock* ptpClock)
{

/* todo: dbg sending */
Expand All @@ -979,7 +978,7 @@ cancelUnicastTransmission(UnicastGrantData* grant, const const RunTimeOpts* rtOp
}

static void
issueSignaling(MsgSignaling *outgoing, Integer32 destination, const const RunTimeOpts *rtOpts,
issueSignaling(MsgSignaling *outgoing, Integer32 destination, const RunTimeOpts *rtOpts,
PtpClock *ptpClock)
{

Expand Down Expand Up @@ -1259,7 +1258,7 @@ refreshUnicastGrants(UnicastGrantTable *grantTable, int nodeCount, const RunTime

}

if(grantData->canceled && grantData->cancelCount >= GRANT_CANCEL_ACK_TIMEOUT) {
if((grantData->canceled > 0) && (grantData->cancelCount >= GRANT_CANCEL_ACK_TIMEOUT)) {
grantData->cancelCount = 0;
grantData->canceled = FALSE;
grantData->granted = FALSE;
Expand Down