Remove superfluous trailing white space from C files

This commit is contained in:
Douglas Clowes
2014-05-16 15:48:41 +10:00
parent 1881907e00
commit 4c65f82116
91 changed files with 1313 additions and 1313 deletions

View File

@@ -40,12 +40,12 @@ int OrdHVPSWriteStart(Ascon *a) {
char cmd[MAXARGLEN];
int cmd_len, ci,cj,bi;
char *wrBArray, ch;
// strcpy(wrBArray, GetCharArray(a->wrBuffer));
wrBArray = GetCharArray(a->wrBuffer);
cmd_len = GetDynStringLength(a->wrBuffer);
for (ci=2, cj=0, bi=0; ci<MAXARGS && bi<cmd_len && cj < MAXARGLEN; ci++) {
for (cj=0; (ch = wrBArray[bi]) != ' ' && bi<cmd_len; bi++, cj++)
for (cj=0; (ch = wrBArray[bi]) != ' ' && bi<cmd_len; bi++, cj++)
cmdArgv[ci][cj] = ch;
cmdArgv[ci][cj] = '\0';
while (wrBArray[bi] == ' ' && bi < cmd_len)
@@ -63,7 +63,7 @@ int OrdHVPSWriteStart(Ascon *a) {
// we also allow the third argument to be an explicit command/response format.
// This is in format "<cmd>-<resp>" where the command and response fields
// are format specifiers containing the required/expected ASCII letters
// in the command, and the format specifiers '%s' (string),
// in the command, and the format specifiers '%s' (string),
// '%d' (integer 0-255), , '%B' (a board name e.g. x0-y15),
// '%P' (a pot name e.g. x0-y191), or '%A' (ack code as 'ACK'/'NAK').
// Formats '%c' (a character) and '%x' (char as 2 hex digits) could be
@@ -94,7 +94,7 @@ int OrdHVPSWriteStart(Ascon *a) {
return 0;
break;
}
// Prepare the command string
// Prepare the command string
char *pcmd=cmd;
int nfmtspec=0;
while(*pcmdrspfmt!='-')
@@ -120,7 +120,7 @@ int OrdHVPSWriteStart(Ascon *a) {
{
case 's': // probably never used
pcmd+=sprintf(pcmd,"%s",cmdArgv[nfmtspec+2]);
break;
break;
case 'd':
sscanf(cmdArgv[nfmtspec+2],"%d",&v1);
pcmd+=sprintf(pcmd,"%c",(char)v1);
@@ -179,7 +179,7 @@ int OrdFmtReply(char *rdBArray, int rsp_len, char *response, char *errmsg) {
/*
ffr If AsconStdHandler doesn't see a '\r' or '\n' and there are no more
chars to read, it leaves state=AsconReading and the rdBuffer char array
without a null terminator. So we assume that higher level code can tell
without a null terminator. So we assume that higher level code can tell
if the response is OK and set the state and terminator.
*/
DynStringConcatChar(a->rdBuffer, '\0');
@@ -245,7 +245,7 @@ int OrdFmtReply(char *rdBArray, int rsp_len, char *response, char *errmsg) {
idx=0;
idx=sprintf(errmsg,"Bad response format: ");
for (i = 0; i < rsp_len && idx < 31; ++i) {
if (response[i] < 32 || response[i] > 126)
if (response[i] < 32 || response[i] > 126)
idx+=sprintf(&errmsg[idx], "%02Xh", response[i]);
else
errmsg[idx++] = response[i];
@@ -267,7 +267,7 @@ int OrdHVPSReading(Ascon *a) {
int ret, rsp_len;
static int retries = MAXRETRY;
char chr, errmsg[ERRMSGLEN], response[MAXARGLEN];
ret = AsconReadChar(a->fd, &chr);
if (ret > 0 && chr == NAK && retries > 0) {
AsconReadGarbage(a->fd);