Skip to content

Commit

Permalink
Merge pull request #87 from epics-modules/gcc-fix
Browse files Browse the repository at this point in the history
After testing these changes in MotorSrc and several drivers, this looks good to me.
  • Loading branch information
rsluiter authored Nov 30, 2017
2 parents 5245991 + a62c5e4 commit 691d375
Show file tree
Hide file tree
Showing 32 changed files with 172 additions and 172 deletions.
2 changes: 1 addition & 1 deletion motorApp/AcsSrc/drvMCB4B.cc
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ STATIC int set_status(int card, int signal)
/* Test for post-move string. */
if ((status.Bits.RA_DONE || ls_active == true) && nodeptr != 0 && nodeptr->postmsgptr != 0)
{
send_mess(card, nodeptr->postmsgptr, (char) NULL);
send_mess(card, nodeptr->postmsgptr, (char*) NULL);
/* The MCB4B always sends back a response, read it and discard */
recv_mess(card, buff, WAIT);
nodeptr->postmsgptr = NULL;
Expand Down
2 changes: 1 addition & 1 deletion motorApp/AcsTech80Src/drvSPiiPlus.cc
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ static int set_status(int card, int signal)
nodeptr->postmsgptr != 0)
{
strncpy(send_buff, nodeptr->postmsgptr, 80);
send_mess(card, send_buff, (char) NULL);
send_mess(card, send_buff, (char*) NULL);
nodeptr->postmsgptr = NULL;
}

Expand Down
30 changes: 15 additions & 15 deletions motorApp/AerotechSrc/drvSoloist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ static int set_status(int card, int signal)

// get the axis status
sprintf(buff, "AXISSTATUS()");
send_mess(card, buff, (char) NULL);
send_mess(card, buff, (char*) NULL);
comm_status = recv_mess(card, buff, 1);
if (comm_status > 0 && buff[0] == ASCII_ACK_CHAR)
{
Expand Down Expand Up @@ -271,7 +271,7 @@ static int set_status(int card, int signal)

/* get the axis fault status */
sprintf(buff, "AXISFAULT()");
send_mess(card, buff, (char) NULL);
send_mess(card, buff, (char*) NULL);
comm_status = recv_mess(card, buff, 1);
axis_status = atoi(&buff[1]);
status.Bits.RA_PLUS_LS = axis_status & CW_FAULT_BIT ? 1 : 0;
Expand All @@ -285,7 +285,7 @@ static int set_status(int card, int signal)

// get the position
sprintf(buff, "PFBKPROG()");
send_mess(card, buff, (char) NULL);
send_mess(card, buff, (char*) NULL);
recv_mess(card, buff, 1);
if (buff[0] == ASCII_ACK_CHAR)
{
Expand Down Expand Up @@ -337,7 +337,7 @@ static int set_status(int card, int signal)
if ((status.Bits.RA_DONE || ls_active) && nodeptr != 0 && nodeptr->postmsgptr != 0)
{
strcpy(buff, nodeptr->postmsgptr);
send_mess(card, buff, (char) NULL);
send_mess(card, buff, (char*) NULL);
nodeptr->postmsgptr = NULL;
}

Expand Down Expand Up @@ -591,7 +591,7 @@ static int motor_init()
// we only care if we get a response
// so we don't need to send a valid command
strcpy(buff, "NONE");
send_mess(card_index, buff, (char) NULL);
send_mess(card_index, buff, (char*) NULL);
status = recv_mess(card_index, buff, 1);

retry++;
Expand All @@ -603,7 +603,7 @@ static int motor_init()
brdptr->motor_in_motion = 0;
// Read controller ID string
strcpy(buff, "GETPARM(265)"); //UserString1
send_mess(card_index, buff, (char) NULL);
send_mess(card_index, buff, (char*) NULL);
recv_mess(card_index, buff, 1);
if (buff[0] == ASCII_ACK_CHAR)
{
Expand All @@ -620,7 +620,7 @@ static int motor_init()
{
// Does this axis actually exist?
sprintf(buff, "GETPARM(257)"); //AxisName
send_mess(card_index, buff, (char) NULL);
send_mess(card_index, buff, (char*) NULL);
recv_mess(card_index, buff, 1);

// We know the axis exists if we got an ACK response
Expand All @@ -645,7 +645,7 @@ static int motor_init()

// Determine if encoder present based on open/closed loop mode.
sprintf(buff, "GETPARM(58)"); //CfgFbkPosType
send_mess(card_index, buff, (char) NULL);
send_mess(card_index, buff, (char*) NULL);
recv_mess(card_index, buff, 1);
if (buff[0] == ASCII_ACK_CHAR)
{
Expand All @@ -658,7 +658,7 @@ static int motor_init()

// Determine if gains are supported based on the motor type.
sprintf(buff, "GETPARM(33)"); //CfgMotType
send_mess(card_index, buff, (char) NULL);
send_mess(card_index, buff, (char*) NULL);
recv_mess(card_index, buff, 1);
if (buff[0] == ASCII_ACK_CHAR)
{
Expand All @@ -671,12 +671,12 @@ static int motor_init()

// Stop all motors
sprintf(buff, "ABORT");
send_mess(card_index, buff, (char) NULL);
send_mess(card_index, buff, (char*) NULL);
recv_mess(card_index, buff, 1);

// Determine drive resolution
sprintf(buff, "GETPARM(3)"); //PosScaleFactor
send_mess(card_index, buff, (char) NULL);
send_mess(card_index, buff, (char*) NULL);
recv_mess(card_index, buff, 1);
if (buff[0] == ASCII_ACK_CHAR)
{
Expand All @@ -696,7 +696,7 @@ static int motor_init()

// Save home preset position
sprintf(buff, "GETPARM(108)"); //HomeOffset
send_mess(card_index, buff, (char) NULL);
send_mess(card_index, buff, (char*) NULL);
recv_mess(card_index, buff, 1);
if (buff[0] == ASCII_ACK_CHAR)
{
Expand All @@ -705,7 +705,7 @@ static int motor_init()

// Determine low limit
sprintf(buff, "GETPARM(47)"); //ThresholdSoftCCW
send_mess(card_index, buff, (char) NULL);
send_mess(card_index, buff, (char*) NULL);
recv_mess(card_index, buff, 1);
if (buff[0] == ASCII_ACK_CHAR)
{
Expand All @@ -714,7 +714,7 @@ static int motor_init()

// Determine high limit
sprintf(buff, "GETPARM(48)"); //ThresholdSoftCW
send_mess(card_index, buff, (char) NULL);
send_mess(card_index, buff, (char*) NULL);
recv_mess(card_index, buff, 1);
if (buff[0] == ASCII_ACK_CHAR)
{
Expand All @@ -723,7 +723,7 @@ static int motor_init()

// Save the HomeDirection parameter
sprintf(buff, "GETPARM(106)"); //HomeDirection
send_mess(card_index, buff, (char) NULL);
send_mess(card_index, buff, (char*) NULL);
recv_mess(card_index, buff, 1);
if (buff[0] == ASCII_ACK_CHAR)
{
Expand Down
18 changes: 9 additions & 9 deletions motorApp/DeltaTauSrc/drvPmac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static int set_status(int card, int signal)
status.Bits.EA_POSITION = (motorstat.word1.Bits.amp_enabled == YES) ? 1 : 0;

sprintf(outbuf, "M%.2d61", (signal + 1)); // Get Commanded Position.
send_mess(card, outbuf, (char) NULL);
send_mess(card, outbuf, (char*) NULL);
recv_mess(card, buff, 1);

motorData = atof(buff);
Expand Down Expand Up @@ -269,7 +269,7 @@ static int set_status(int card, int signal)
status.Bits.EA_HOME = 0;

sprintf(outbuf, "M%.2d62", (signal + 1));
send_mess(card, outbuf, (char) NULL); // Get Actual Position.
send_mess(card, outbuf, (char*) NULL); // Get Actual Position.
recv_mess(card, buff, 1);
motorData = atof(buff);
motor_info->encoder_position = (int32_t) motorData;
Expand All @@ -292,7 +292,7 @@ static int set_status(int card, int signal)
nodeptr->postmsgptr != 0)
{
strcpy(buff, nodeptr->postmsgptr);
send_mess(card, buff, (char) NULL);
send_mess(card, buff, (char*) NULL);
nodeptr->postmsgptr = NULL;
}

Expand Down Expand Up @@ -833,10 +833,10 @@ static int motor_init()
count = pmotor->response[0];
}

send_mess(card_index, "TYPE", (char) NULL);
send_mess(card_index, "TYPE", (char*) NULL);
recv_mess(card_index, (char *) pmotorState->ident, 1);

send_mess(card_index, "VERSION", (char) NULL);
send_mess(card_index, "VERSION", (char*) NULL);
recv_mess(card_index, axis_pos, 1);
strcat((char *) &pmotorState->ident, ", ");
strcat((char *) &pmotorState->ident, axis_pos);
Expand All @@ -849,7 +849,7 @@ static int motor_init()
char outbuf[10];

sprintf(outbuf, "I%.2d00", (total_axis + 1));
send_mess(card_index, outbuf, (char) NULL);
send_mess(card_index, outbuf, (char*) NULL);
recv_mess(card_index, axis_pos, 1);
if (strcmp(axis_pos, "0") == 0)
errind = true;
Expand All @@ -860,12 +860,12 @@ static int motor_init()

// Set Ixx20=1 and Ixx21=0; control acceleration via Ixx19.
sprintf(outbuf, "I%.2d20=1", (total_axis + 1));
send_mess(card_index, outbuf, (char) NULL);
send_mess(card_index, outbuf, (char*) NULL);
sprintf(outbuf, "I%.2d21=0", (total_axis + 1));
send_mess(card_index, outbuf, (char) NULL);
send_mess(card_index, outbuf, (char*) NULL);

sprintf(outbuf, "I%.2d08", (total_axis + 1));
send_mess(card_index, outbuf, (char) NULL);
send_mess(card_index, outbuf, (char*) NULL);
recv_mess(card_index, axis_pos, 1);
cntrl->pos_scaleFac[total_axis] = atof(axis_pos) * 32.0;
}
Expand Down
16 changes: 8 additions & 8 deletions motorApp/ImsSrc/drvIM483SM.cc
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static int set_status(int card, int signal)
nodeptr = motor_info->motor_motion;
status.All = motor_info->status.All;

send_mess(card, "^", (char) NULL);
send_mess(card, "^", (char*) NULL);
rtn_state = recv_mess(card, buff, 1);
if (rtn_state > 0)
{
Expand Down Expand Up @@ -273,7 +273,7 @@ static int set_status(int card, int signal)
* Skip to substring for this motor, convert to double
*/

send_mess(card, "Z 0", (char) NULL);
send_mess(card, "Z 0", (char*) NULL);
recv_mess(card, buff, 1);

motorData = atof(&buff[5]);
Expand All @@ -295,7 +295,7 @@ static int set_status(int card, int signal)

plusdir = (status.Bits.RA_DIRECTION) ? true : false;

send_mess(card, "] 0", (char) NULL);
send_mess(card, "] 0", (char*) NULL);
recv_mess(card, buff, 1);
rtnval = atoi(&buff[5]);

Expand All @@ -318,7 +318,7 @@ static int set_status(int card, int signal)
else
status.Bits.RA_MINUS_LS = 0;

send_mess(card, "] 1", (char) NULL);
send_mess(card, "] 1", (char*) NULL);
recv_mess(card, buff, 1);
rtnval = buff[5];

Expand All @@ -336,7 +336,7 @@ static int set_status(int card, int signal)
motor_info->encoder_position = 0;
else
{
send_mess(card, "z 0", (char) NULL);
send_mess(card, "z 0", (char*) NULL);
recv_mess(card, buff, 1);
motorData = atof(&buff[5]);
motor_info->encoder_position = (epicsInt32) motorData;
Expand All @@ -359,7 +359,7 @@ static int set_status(int card, int signal)
nodeptr->postmsgptr != 0)
{
strcpy(buff, nodeptr->postmsgptr);
send_mess(card, buff, (char) NULL);
send_mess(card, buff, (char*) NULL);
nodeptr->postmsgptr = NULL;
}

Expand Down Expand Up @@ -551,9 +551,9 @@ static int motor_init()
/* flush any junk at input port - should not be any data available */
pasynOctetSyncIO->flush(cntrl->pasynUser);

send_mess(card_index, "\003", (char) NULL); /* Reset device. */
send_mess(card_index, "\003", (char*) NULL); /* Reset device. */
epicsThreadSleep(1.0);
send_mess(card_index, " ", (char) NULL);
send_mess(card_index, " ", (char*) NULL);

/* Save controller identification message. */
src = buff;
Expand Down
8 changes: 4 additions & 4 deletions motorApp/KohzuSrc/drvSC800.cc
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static int set_status(int card, int signal)
charcnt = recv_mess(card, buff, FLUSH);

sprintf(buff,"STR1/%d",(signal + 1));
send_mess(card, buff, (char) NULL); /* Tell Status */
send_mess(card, buff, (char*) NULL); /* Tell Status */
charcnt = recv_mess(card, buff, 1);
convert_cnt = sscanf(buff, "C\tSTR%d\t1\t%d\t%d\t%d\t%d\t%d\t%d\t%d",
&str_axis, &str_move, &str_norg, &str_orgg,
Expand Down Expand Up @@ -256,7 +256,7 @@ static int set_status(int card, int signal)

/* Parse motor position */
sprintf(buff,"RDP%d/0", (signal + 1));
send_mess(card, buff, (char) NULL); /* Tell Position */
send_mess(card, buff, (char*) NULL); /* Tell Position */
recv_mess(card, buff, 1);
convert_cnt = sscanf(buff, "C\tRDP%d\t%d", &str_axis, &motorData);

Expand Down Expand Up @@ -285,7 +285,7 @@ static int set_status(int card, int signal)

/* Torque enabled? */
sprintf(buff,"RSY%d/21", (signal + 1));
send_mess(card, buff, (char) NULL); /* Tell Position */
send_mess(card, buff, (char*) NULL); /* Tell Position */
recv_mess(card, buff, 1);
convert_cnt = sscanf(buff, "C\tRSY%d\t21\t%d", &str_axis, &str_move);
status.Bits.EA_POSITION = (str_move == 0) ? 1 : 0;
Expand Down Expand Up @@ -327,7 +327,7 @@ static int set_status(int card, int signal)
nodeptr->postmsgptr != 0)
{
strcpy(buff, nodeptr->postmsgptr);
send_mess(card, buff, (char) NULL);
send_mess(card, buff, (char*) NULL);
nodeptr->postmsgptr = NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion motorApp/MclennanSrc/drvPM304.cc
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ STATIC int set_status(int card, int signal)
{
strcpy(buff, nodeptr->postmsgptr);
strcat(buff, "\r");
send_mess(card, buff, (char) NULL);
send_mess(card, buff, (char*) NULL);
nodeptr->postmsgptr = NULL;
}

Expand Down
2 changes: 1 addition & 1 deletion motorApp/MicosSrc/drvMicos.cc
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ static int set_status(int card, int signal)
nodeptr->postmsgptr != 0)
{
strcpy(buff, nodeptr->postmsgptr);
send_mess(card, buff, (char) NULL);
send_mess(card, buff, (char*) NULL);
/* The Micos will not send back a response for a 'set' command, don't need next line */
/* recv_mess(card, buff, WAIT); */
nodeptr->postmsgptr = NULL;
Expand Down
Loading

0 comments on commit 691d375

Please sign in to comment.