From 94b61d708a882ef3022f913e28d6fbc4dc7de9f1 Mon Sep 17 00:00:00 2001 From: John Winans Date: Fri, 6 Dec 1991 09:58:29 +0000 Subject: [PATCH] missing initializers fir status & bbnode in the work function --- src/dev/devCommonGpib.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/src/dev/devCommonGpib.c b/src/dev/devCommonGpib.c index 7a2cc802e..e3fd60cda 100644 --- a/src/dev/devCommonGpib.c +++ b/src/dev/devCommonGpib.c @@ -2055,9 +2055,9 @@ struct gpibDpvt *pdpvt; int cmdType; unsigned short val; { - int status; /* for GPIBREAD, contains ERROR or # of bytes read */ + int status = OK; short ibnode = pdpvt->head.device; - short bbnode; /* In case is a bitbus->gpib type link */ + short bbnode = -1; /* In case is a bitbus->gpib type link */ struct gpibCmd *pCmd; struct devGpibParmBlock *parmBlock; @@ -2078,8 +2078,7 @@ unsigned short val; return(ERROR); } - switch (cmdType) - { + switch (cmdType) { case GPIBWRITE: /* write the message to the GPIB listen adrs */ if(*parmBlock->debugFlag) @@ -2165,21 +2164,23 @@ unsigned short val; break; case GPIBEFASTO: /* write the enumerated cmd from the P3 array */ if (pCmd->P3[val] != NULL) + { status = (*(drvGpib.writeIb))(pdpvt->linkType, pdpvt->head.link, bbnode, ibnode, pCmd->P3[val], strlen(pCmd->P3[val])); - if ((status != ERROR) && parmBlock->respond2Writes) - { /* device responds to write commands, read the response */ - - status = (*(drvGpib.readIb))(pdpvt->linkType, pdpvt->head.link, - bbnode, ibnode, pdpvt->rsp, pCmd->rspLen); - - /* if user specified a secondary convert routine, call it */ - - if (parmBlock->wrConversion != NULL) - status = (*(parmBlock->wrConversion))(status, pdpvt); + if ((status != ERROR) && parmBlock->respond2Writes) + { /* device responds to write commands, read the response */ + + status = (*(drvGpib.readIb))(pdpvt->linkType, pdpvt->head.link, + bbnode, ibnode, pdpvt->rsp, pCmd->rspLen); + + /* if user specified a secondary convert routine, call it */ + + if (parmBlock->wrConversion != NULL) + status = (*(parmBlock->wrConversion))(status, pdpvt); + } } - break; + break; } if(*parmBlock->debugFlag) logMsg("devGpibLib_xxGpibWork : done, status = %d\n",status);