From 52208a6dbfb136cead3a443953798fe002200c50 Mon Sep 17 00:00:00 2001 From: John Winans Date: Fri, 6 Dec 1991 09:59:07 +0000 Subject: [PATCH] bad init for the command table, I changed it to code-based init --- src/devOpt/devGpibInteract.c | 28 ++++++++++++++++++---------- src/vxWorks/devOpt/devGpibInteract.c | 28 ++++++++++++++++++---------- 2 files changed, 36 insertions(+), 20 deletions(-) diff --git a/src/devOpt/devGpibInteract.c b/src/devOpt/devGpibInteract.c index e25bb78ac..ca3f1d99f 100644 --- a/src/devOpt/devGpibInteract.c +++ b/src/devOpt/devGpibInteract.c @@ -88,16 +88,8 @@ struct gpibIntCmd { char busy; /* used by timing routine */ }; -static struct gpibIntCmd gpibIntCmds[] = -{ - {NULL, NULL, gpibWork, 0, 0, NULL, 'R', "", "", 0, 0}, - {NULL, NULL, gpibWork, 0, 0, NULL, 'R', "", "", 0, 0}, - {NULL, NULL, gpibWork, 0, 0, NULL, 'R', "", "", 0, 0}, - {NULL, NULL, gpibWork, 0, 0, NULL, 'R', "", "", 0, 0}, - {NULL, NULL, gpibWork, 0, 0, NULL, 'R', "", "", 0, 0}, - {NULL, NULL, gpibWork, 0, 0, NULL, 'R', "", "", 0, 0} -}; -#define LIST_SIZE sizeof(gpibIntCmds)/sizeof(struct gpibIntCmd) +#define LIST_SIZE 10 +static struct gpibIntCmd gpibIntCmds[LIST_SIZE]; /* declare other required variables used by more than one routine */ @@ -129,6 +121,22 @@ GI() firstTime = 0; msgReply = semCreate(); + for (cnt=0; cnt < LIST_SIZE; cnt++) + { /* init the elements of the command table */ + + gpibIntCmds[cnt].head.header.list.list1 = NULL; + gpibIntCmds[cnt].head.header.list.list2 = NULL; + gpibIntCmds[cnt].head.workStart = gpibWork; + gpibIntCmds[cnt].head.link = 0; + gpibIntCmds[cnt].head.device = 0; + gpibIntCmds[cnt].head.bitBusDpvt= NULL; /* not supported yet */ + + gpibIntCmds[cnt].type = 'R'; + gpibIntCmds[cnt].cmd[0] = '\0'; + gpibIntCmds[cnt].resp[0] = '\0'; + gpibIntCmds[cnt].count = 0; + gpibIntCmds[cnt].busy = 0; + } } ans = 0; /* set loop not to exit */ diff --git a/src/vxWorks/devOpt/devGpibInteract.c b/src/vxWorks/devOpt/devGpibInteract.c index e25bb78ac..ca3f1d99f 100644 --- a/src/vxWorks/devOpt/devGpibInteract.c +++ b/src/vxWorks/devOpt/devGpibInteract.c @@ -88,16 +88,8 @@ struct gpibIntCmd { char busy; /* used by timing routine */ }; -static struct gpibIntCmd gpibIntCmds[] = -{ - {NULL, NULL, gpibWork, 0, 0, NULL, 'R', "", "", 0, 0}, - {NULL, NULL, gpibWork, 0, 0, NULL, 'R', "", "", 0, 0}, - {NULL, NULL, gpibWork, 0, 0, NULL, 'R', "", "", 0, 0}, - {NULL, NULL, gpibWork, 0, 0, NULL, 'R', "", "", 0, 0}, - {NULL, NULL, gpibWork, 0, 0, NULL, 'R', "", "", 0, 0}, - {NULL, NULL, gpibWork, 0, 0, NULL, 'R', "", "", 0, 0} -}; -#define LIST_SIZE sizeof(gpibIntCmds)/sizeof(struct gpibIntCmd) +#define LIST_SIZE 10 +static struct gpibIntCmd gpibIntCmds[LIST_SIZE]; /* declare other required variables used by more than one routine */ @@ -129,6 +121,22 @@ GI() firstTime = 0; msgReply = semCreate(); + for (cnt=0; cnt < LIST_SIZE; cnt++) + { /* init the elements of the command table */ + + gpibIntCmds[cnt].head.header.list.list1 = NULL; + gpibIntCmds[cnt].head.header.list.list2 = NULL; + gpibIntCmds[cnt].head.workStart = gpibWork; + gpibIntCmds[cnt].head.link = 0; + gpibIntCmds[cnt].head.device = 0; + gpibIntCmds[cnt].head.bitBusDpvt= NULL; /* not supported yet */ + + gpibIntCmds[cnt].type = 'R'; + gpibIntCmds[cnt].cmd[0] = '\0'; + gpibIntCmds[cnt].resp[0] = '\0'; + gpibIntCmds[cnt].count = 0; + gpibIntCmds[cnt].busy = 0; + } } ans = 0; /* set loop not to exit */