From 9d63d16911641ab101cde930da2324e300185a1e Mon Sep 17 00:00:00 2001 From: Mike Bordua Date: Tue, 12 Jul 1994 20:34:56 +0000 Subject: [PATCH] Added various Casts to stop compiler warnings. --- src/libCom/arAccessLib.c | 5 +++++ src/libCom/calc/calcPerform.c | 2 +- src/libCom/calcPerform.c | 2 +- src/libCom/errSymLib.c | 8 +++++--- src/libCom/error/errSymLib.c | 8 +++++--- src/libCom/sydSubr.c | 20 ++++++++++---------- src/libCom/sydSubrSSF.c | 14 +++++++------- 7 files changed, 34 insertions(+), 25 deletions(-) diff --git a/src/libCom/arAccessLib.c b/src/libCom/arAccessLib.c index 44a8d1607..8bec8398c 100644 --- a/src/libCom/arAccessLib.c +++ b/src/libCom/arAccessLib.c @@ -128,6 +128,11 @@ * AR_CHAN_DESC *arCF_mallocCHAN_DESC() void arCF_freeCHAN_DESC(pChanDesc) *---------------------------------------------------------------------------*/ + +/* Forward declarations */ +long arCFChanReadTs(); +long arCFReadMIBuffers(); + AR_CHAN_DESC * arCF_mallocCHAN_DESC() { diff --git a/src/libCom/calc/calcPerform.c b/src/libCom/calc/calcPerform.c index 27cd3830f..507102972 100644 --- a/src/libCom/calc/calcPerform.c +++ b/src/libCom/calc/calcPerform.c @@ -512,7 +512,7 @@ static double random() /* random number */ seed = (seed * multy) + addy; - randy = seed / 65535.0; + randy = (float) seed / 65535.0; /* between 0 - 1 */ return(randy); diff --git a/src/libCom/calcPerform.c b/src/libCom/calcPerform.c index 27cd3830f..507102972 100644 --- a/src/libCom/calcPerform.c +++ b/src/libCom/calcPerform.c @@ -512,7 +512,7 @@ static double random() /* random number */ seed = (seed * multy) + addy; - randy = seed / 65535.0; + randy = (float) seed / 65535.0; /* between 0 - 1 */ return(randy); diff --git a/src/libCom/errSymLib.c b/src/libCom/errSymLib.c index 891076bf3..7e2f3c366 100644 --- a/src/libCom/errSymLib.c +++ b/src/libCom/errSymLib.c @@ -243,7 +243,8 @@ va_dcl if(pFileName && errVerbose){ #ifdef vxWorks if(errToLogMsg) { - logMsg("filename=\"%s\" line number=%d\n", pFileName, lineno); + logMsg("filename=\"%s\" line number=%d\n", pFileName, lineno, + NULL, NULL, NULL, NULL); } else{ printf("filename=\"%s\" line number=%d\n", pFileName, lineno); @@ -273,7 +274,8 @@ va_dcl } else{ #ifdef vxWorks - logMsg("%s: calloc error\n", __FILE__); + logMsg("%s: calloc error\n", __FILE__, + NULL, NULL, NULL, NULL, NULL); #else printf("%s: calloc error\n", __FILE__); #endif @@ -426,7 +428,7 @@ char *name; ***************************************************************/ #ifndef vxWorks #ifdef __STDC__ -int UnixSymFind(long status, char *pname, long *pvalue); +int UnixSymFind(long status, char *pname, long *pvalue) #else int UnixSymFind(status, pname, pvalue) long status; diff --git a/src/libCom/error/errSymLib.c b/src/libCom/error/errSymLib.c index 891076bf3..7e2f3c366 100644 --- a/src/libCom/error/errSymLib.c +++ b/src/libCom/error/errSymLib.c @@ -243,7 +243,8 @@ va_dcl if(pFileName && errVerbose){ #ifdef vxWorks if(errToLogMsg) { - logMsg("filename=\"%s\" line number=%d\n", pFileName, lineno); + logMsg("filename=\"%s\" line number=%d\n", pFileName, lineno, + NULL, NULL, NULL, NULL); } else{ printf("filename=\"%s\" line number=%d\n", pFileName, lineno); @@ -273,7 +274,8 @@ va_dcl } else{ #ifdef vxWorks - logMsg("%s: calloc error\n", __FILE__); + logMsg("%s: calloc error\n", __FILE__, + NULL, NULL, NULL, NULL, NULL); #else printf("%s: calloc error\n", __FILE__); #endif @@ -426,7 +428,7 @@ char *name; ***************************************************************/ #ifndef vxWorks #ifdef __STDC__ -int UnixSymFind(long status, char *pname, long *pvalue); +int UnixSymFind(long status, char *pname, long *pvalue) #else int UnixSymFind(status, pname, pvalue) long status; diff --git a/src/libCom/sydSubr.c b/src/libCom/sydSubr.c index 0d1328407..d97dbb8eb 100644 --- a/src/libCom/sydSubr.c +++ b/src/libCom/sydSubr.c @@ -1953,7 +1953,7 @@ int ignorePartial; /* I 0,1 to store,ignore partial samples */ pSChan->maxDataVal = pSChan->minDataVal = (double)*pSrc; pSChan->minMaxNeedInit = 0; } - for (el=0; elelCount; el++) { + for (el=0; el<(int) pSChan->elCount; el++) { if (useVal) { if ((double)*pSrc > pSChan->maxDataVal) pSChan->maxDataVal = (double)*pSrc; @@ -1976,7 +1976,7 @@ int ignorePartial; /* I 0,1 to store,ignore partial samples */ pSChan->maxDataVal = pSChan->minDataVal = dbl; pSChan->minMaxNeedInit = 0; } - for (el=0; elelCount; el++) { + for (el=0; el<(int) pSChan->elCount; el++) { if (useVal) { if (pSChan->isRVAL) dbl = (double)(*(unsigned short *)pSrc); @@ -1998,7 +1998,7 @@ int ignorePartial; /* I 0,1 to store,ignore partial samples */ pSChan->maxDataVal = pSChan->minDataVal = *pSrc; pSChan->minMaxNeedInit = 0; } - for (el=0; elelCount; el++) { + for (el=0; el<(int) pSChan->elCount; el++) { if (useVal) { if (*pSrc > pSChan->maxDataVal) pSChan->maxDataVal = *pSrc; @@ -2021,7 +2021,7 @@ int ignorePartial; /* I 0,1 to store,ignore partial samples */ pSChan->maxDataVal = pSChan->minDataVal = (double)*pSrc; pSChan->minMaxNeedInit = 0; } - for (el=0; elelCount; el++) { + for (el=0; el<(int) pSChan->elCount; el++) { if (useVal) { if (pSChan->isRVAL) dbl = (double)(*(unsigned long *)pSrc); @@ -2040,7 +2040,7 @@ int ignorePartial; /* I 0,1 to store,ignore partial samples */ pSrc = pSChan->pInBuf[i]->tstrval.value; pDest = ((char *)pSChan->pData) + sub * db_strval_dim * pSChan->elCount; - for (el=0; elelCount; el++) { + for (el=0; el<(int) pSChan->elCount; el++) { strcpy(pDest, pSrc); pDest += db_strval_dim; pSrc += db_strval_dim; @@ -2055,7 +2055,7 @@ int ignorePartial; /* I 0,1 to store,ignore partial samples */ pSChan->maxDataVal = pSChan->minDataVal = (double)*pSrc; pSChan->minMaxNeedInit = 0; } - for (el=0; elelCount; el++) { + for (el=0; el<(int) pSChan->elCount; el++) { if (useVal) { if ((double)*pSrc > pSChan->maxDataVal) pSChan->maxDataVal = (double)*pSrc; @@ -2073,7 +2073,7 @@ int ignorePartial; /* I 0,1 to store,ignore partial samples */ pSChan->maxDataVal = pSChan->minDataVal = (double)*pSrc; pSChan->minMaxNeedInit = 0; } - for (el=0; elelCount; el++) { + for (el=0; el<(int) pSChan->elCount; el++) { if (useVal) { if ((double)*pSrc > pSChan->maxDataVal) pSChan->maxDataVal = (double)*pSrc; @@ -2650,7 +2650,7 @@ int samp; /* I sample number in synchronous set */ for (pSChan=pSspec->pChanHead; pSChan!=NULL; pSChan=pSChan->pNext) { if (pSChan->dataChan && pSChan->elCount > 1) { (void)fprintf(out, "%s", pSChan->name); - for (i=0; ielCount; i++) { + for (i=0; i<(int) pSChan->elCount; i++) { if (i%nCol == 0) (void)fprintf(out, "\n%5d", i); (void)fputc(' ', out); @@ -2743,7 +2743,7 @@ int sampNum; /* I sample number in sync set */ if (special == NULL) { if (flags&SHOW_AR) { (void)fprintf(out, "%d", pSChan->elCount); - for (i=0; ielCount; i++) { + for (i=0; i<(int) pSChan->elCount; i++) { (void)fputc(sep, out); sydSamplePrintVal(out, pSChan, sampNum, i, flags, colWidth); } @@ -3808,7 +3808,7 @@ SYD_SPEC *pSspec; /* I pointer to synchronous set spec */ if (lngVal < pTest->lngVal) change = -1; else if (lngVal > pTest->lngVal) change = 1; } -#define COND_IS(ty) pTest->cond == SYD_TSTC_/**/ty +#define COND_IS(ty) pTest->cond == SYD_TSTC_##ty if (change == 0) { if (COND_IS(EQ) || COND_IS(LE) || COND_IS(GE)) return 1; diff --git a/src/libCom/sydSubrSSF.c b/src/libCom/sydSubrSSF.c index c202ee5f1..960f5b95b 100644 --- a/src/libCom/sydSubrSSF.c +++ b/src/libCom/sydSubrSSF.c @@ -710,7 +710,7 @@ chtype type; bufStat = SYD_B_MISSING; break; } - else if (i < pSChan->elCount) + else if (i < (int) pSChan->elCount) *pFl++ = val; } } @@ -723,7 +723,7 @@ chtype type; bufStat = SYD_B_MISSING; break; } - else if (i < pSChan->elCount) + else if (i < (int) pSChan->elCount) *pSh++ = val; } } @@ -736,7 +736,7 @@ chtype type; bufStat = SYD_B_MISSING; break; } - else if (i < pSChan->elCount) + else if (i < (int) pSChan->elCount) *pDbl++ = val; } } @@ -749,7 +749,7 @@ chtype type; bufStat = SYD_B_MISSING; break; } - else if (i < pSChan->elCount) + else if (i < (int) pSChan->elCount) *pL++ = val; } } @@ -766,7 +766,7 @@ chtype type; assert(nChar > 0 && nChar < db_strval_dim); if (fgets(val, nChar, ssFile) == NULL) assertAlways(0); - if (i < pSChan->elCount) { + if (i < (int) pSChan->elCount) { strcpy(pC, val); pC += db_strval_dim; } @@ -781,7 +781,7 @@ chtype type; bufStat = SYD_B_MISSING; break; } - else if (i < pSChan->elCount) + else if (i < (int) pSChan->elCount) *pC++ = val; } } @@ -809,7 +809,7 @@ chtype type; iState++; assert(iState < db_state_dim); } - if (i < pSChan->elCount) + if (i < (int) pSChan->elCount) *pSh++ = iState; } }