fixed warnings

This commit is contained in:
Jeff Hill
1997-06-25 06:17:38 +00:00
parent 8fdfb8738a
commit 13a13ed914
10 changed files with 220 additions and 233 deletions
+10 -7
View File
@@ -7,6 +7,9 @@ static char *sccsId = "@(#) $Id$";
/*
* $Log$
* Revision 1.46 1997/06/13 09:14:09 jhill
* connect/search proto changes
*
* Revision 1.45 1997/04/29 06:07:16 jhill
* local host connect compatible
*
@@ -490,7 +493,7 @@ int doacctst(char *pname)
iter = (unsigned long) (FLT_MAX/fabs(incr));
}
else {
iter = 10.0;
iter = 10ul;
}
floatTest(chix1, base, incr, epsil, iter);
}
@@ -501,7 +504,7 @@ int doacctst(char *pname)
iter = (unsigned long) (FLT_MAX/fabs(incr));
}
else {
iter = 10.0;
iter = 10ul;
}
floatTest(chix1, base, incr, epsil, iter);
}
@@ -512,7 +515,7 @@ int doacctst(char *pname)
iter = (unsigned long) (FLT_MAX/fabs(incr));
}
else {
iter = 10.0;
iter = 10ul;
}
floatTest(chix1, base, incr, epsil, iter);
}
@@ -542,7 +545,7 @@ int doacctst(char *pname)
iter = (unsigned long) (DBL_MAX/fabs(incr));
}
else {
iter = 10.0;
iter = 10ul;
}
doubleTest(chix1, base, incr, epsil, iter);
}
@@ -553,7 +556,7 @@ int doacctst(char *pname)
iter = (unsigned long) (DBL_MAX/fabs(incr));
}
else {
iter = 10.0;
iter = 10ul;
}
doubleTest(chix1, base, incr, epsil, iter);
}
@@ -564,7 +567,7 @@ int doacctst(char *pname)
iter = (unsigned long) (DBL_MAX/fabs(incr));
}
else {
iter = 10.0;
iter = 10ul;
}
doubleTest(chix1, base, incr, epsil, iter);
}
@@ -856,7 +859,7 @@ int doacctst(char *pname)
pT1 = pWF;
pEF = &pWF[ca_element_count(chix1)];
while(pT1<pEF) {
*pT1++ = rand();
*pT1++ = (float) rand();
}
status = ca_array_put(
DBR_FLOAT,
+5 -5
View File
@@ -3,11 +3,11 @@
#define dbAddrh
#ifdef __cplusplus
//
// for brain dead C++ compilers
//
struct dbCommon;
struct putNotify;
//
// for brain dead C++ compilers
//
struct dbCommon;
struct putNotify;
#endif
typedef struct dbAddr{
-1
View File
@@ -23,7 +23,6 @@ INC += aitHelpers.h
INC += dbMapper.h
INC += gddAppTable.h
INC += gddAppFuncTable.h
INC += gddAppFuncTable.cc
INC += gddApps.h
LIBSRCS := gdd.cc gddTest.cc gddAppTable.cc gddNewDel.cc \
+5 -2
View File
@@ -5,6 +5,9 @@
// $Id$
//
// $Log$
// Revision 1.6 1997/04/23 17:12:54 jhill
// fixed export of symbols from WIN32 DLL
//
// Revision 1.5 1996/08/23 20:29:34 jbk
// completed fixes for the aitString and fixed string management
//
@@ -42,8 +45,8 @@ void aitString::dump(const char* p) const
void aitString::dump(void) const
{
fprintf(stderr,"this=%8.8x ",(int)this);
if(str) fprintf(stderr,"string=%8.8x<%s>, ",(int)str,str);
fprintf(stderr,"this=%p ", this);
if(str) fprintf(stderr,"string=%p<%s>, ",str,str);
else fprintf(stderr,"no string present, ");
fprintf(stderr,"length=%d, ",(int)len);
if(type==aitStrConst) fprintf(stderr,"type=Constant\n");
+6 -3
View File
@@ -4,6 +4,9 @@
// $Id$
//
// $Log$
// Revision 1.21 1997/04/23 17:12:57 jhill
// fixed export of symbols from WIN32 DLL
//
// Revision 1.20 1997/03/21 01:56:01 jbk
// *** empty log message ***
//
@@ -834,8 +837,8 @@ int gdd::flattenDDs(gddContainer* dd, void* buf, size_t size)
gddStatus gdd::convertOffsetsToAddress(void)
{
aitUint8* pdd = (aitUint8*)this;
aitUint32 bnds = (aitUint32)(bounds);
aitUint32 dp = (aitUint32)(dataPointer());
unsigned long bnds = (unsigned long)(bounds);
unsigned long dp = (unsigned long)(dataPointer());
gdd* tdd;
gddContainer* cdd;
gddCursor cur;
@@ -853,7 +856,7 @@ gddStatus gdd::convertOffsetsToAddress(void)
for(tdd=cur.first();tdd;tdd=cur.next())
{
if(tdd->next()) tdd->setNext((gdd*)(pdd+(aitUint32)tdd->next()));
if(tdd->next()) tdd->setNext((gdd*)(pdd+(unsigned long)tdd->next()));
tdd->convertOffsetsToAddress();
}
}
-211
View File
@@ -1,211 +0,0 @@
/*
* $Id$
*
* Author Jeffrey O. Hill
* johill@lanl.gov
* 505 665 1831
*
* Experimental Physics and Industrial Control System (EPICS)
*
* Copyright 1991, the Regents of the University of California,
* and the University of Chicago Board of Governors.
*
* This software was produced under U.S. Government contracts:
* (W-7405-ENG-36) at the Los Alamos National Laboratory,
* and (W-31-109-ENG-38) at Argonne National Laboratory.
*
* Initial development by:
* The Controls and Automation Group (AT-8)
* Ground Test Accelerator
* Accelerator Technology Division
* Los Alamos National Laboratory
*
* Co-developed with
* The Controls and Computing Group
* Accelerator Systems Division
* Advanced Photon Source
* Argonne National Laboratory
*
*
* History
* $Log$
*
*/
#include <gddAppFuncTable.h>
//
// gddAppFuncTable::installReadFunc()
//
// The 2nd parameter has type "gddAppReadFunc" which is
// a ptr to member function. The member function should
// be declared as follows:
//
// gddAppFuncTableStatus PV::memberFunction(gdd &value);
//
// The typedef is not used here because of portability
// problems resulting from compiler weaknesses
//
template <class PV>
gddAppFuncTableStatus gddAppFuncTable<PV>::installReadFunc(
const unsigned type,
gddAppFuncTableStatus (PV::*pMFuncIn)(gdd &value))
{
//
// Attempt to expand the table if the app type will not fit
//
if (type>=this->appTableNElem) {
this->newTbl(type);
if (type>=this->appTableNElem) {
return S_gddAppFuncTable_noMemory;
}
}
this->pMFuncRead[type]=pMFuncIn;
return S_gddAppFuncTable_Success;
}
//
// installReadFunc()
//
// The 2nd parameter has type "gddAppReadFunc" which is
// a ptr to member function. The member function should
// be declared as follows:
//
// gddAppFuncTableStatus PV::memberFunction(gdd &value);
//
template <class PV>
gddAppFuncTableStatus gddAppFuncTable<PV>::installReadFunc(
const char * const pName,
gddAppFuncTableStatus (PV::*pMFuncIn)(gdd &value))
{
aitUint32 type;
gddStatus rc;
rc = gddApplicationTypeTable::
app_table.registerApplicationType (pName, type);
if (rc!=0 && rc!=gddErrorAlreadyDefined) {
printf(
"at gdd lib limit => read of PV attribute \"%s\" will fail\n", pName);
return S_gddAppFuncTable_gddLimit;
}
# ifdef DEBUG
printf("installing PV attribute %s = %d\n", pName, type);
# endif
return this->installReadFunc(type, pMFuncIn);
}
//
// gddAppFuncTable<PV>::newTbl()
//
// The total number of application tags to manage should be
// hidden from the application
//
// The typedef is not used here because of portability
// problems resulting from compiler weaknesses
//
template <class PV>
void gddAppFuncTable<PV>::newTbl(unsigned newApplTypeMax)
{
gddAppReadFunc *pMNewFuncTbl;
unsigned maxApp;
unsigned i;
if (this->appTableNElem>newApplTypeMax) {
return;
}
maxApp = newApplTypeMax+(1u<<6u);
# ifdef _MSC_VER
//
// Right now all MS Visual C++ compilers allocate the
// wrong amount of memory (i.e. too little)
// for member function pointers,
// only explicit calculation via sizeof() works.
// For future versions this may become "if _MSC_VER < ???"...
//
pMNewFuncTbl = (gddAppReadFunc *)
new char[sizeof(gddAppReadFunc) * maxApp];
# else
pMNewFuncTbl = new gddAppReadFunc[maxApp];
# endif
if (pMNewFuncTbl) {
for (i=0u; i<maxApp; i++) {
if (i<this->appTableNElem) {
pMNewFuncTbl[i] = this->pMFuncRead[i];
}
else {
//
// some versions of NULL include (void *) cast
// (so I am using vanilla zero here)
//
pMNewFuncTbl[i] = 0;
}
}
if (this->pMFuncRead) {
delete [] this->pMFuncRead;
}
this->pMFuncRead = pMNewFuncTbl;
this->appTableNElem = maxApp;
}
}
//
// gddAppFuncTable<PV>::read()
//
template <class PV>
gddAppFuncTableStatus gddAppFuncTable<PV>::read(PV &pv, gdd &value)
{
gddAppFuncTableStatus status;
//
// if this gdd is a container then step through it
// and fetch all of the values inside
//
if (value.isContainer()) {
gddContainer *pCont = (gddContainer *) &value;
gddCursor curs = pCont->getCursor();
gdd *pItem;
status = S_gddAppFuncTable_Success;
for (pItem=curs.first(); pItem; pItem=curs.next())
{
status = this->read(pv, *pItem);
if (status) {
break;
}
}
return status;
}
return callReadFunc(pv, value);
}
//
// gddAppFuncTable<PV>::callReadFunc()
//
template <class PV>
gddAppFuncTableStatus gddAppFuncTable<PV>::callReadFunc (PV &pv, gdd &value)
{
unsigned type = value.applicationType();
gddAppReadFunc pFunc;
//
// otherwise call the function associated
// with this application type
//
type = value.applicationType();
if (type>=this->appTableNElem) {
errPrintf (S_gddAppFuncTable_badType, __FILE__,
__LINE__, "- large appl type code = %u\n",
type);
return S_gddAppFuncTable_badType;
}
pFunc = this->pMFuncRead[type];
if (pFunc==NULL) {
errPrintf (S_gddAppFuncTable_badType, __FILE__,
__LINE__, "- ukn appl type code = %u\n",
type);
return S_gddAppFuncTable_badType;
}
return (pv.*pFunc)(value);
}
+179
View File
@@ -29,6 +29,9 @@
*
* History
* $Log$
* Revision 1.4 1996/11/22 20:37:19 jhill
* converted large inline templ funcs
*
* Revision 1.3 1996/09/04 20:58:18 jhill
* changes for MS VISC++
*
@@ -137,5 +140,181 @@ private:
void newTbl(unsigned neMaxType);
};
//
// gddAppFuncTable::installReadFunc()
//
// The 2nd parameter has type "gddAppReadFunc" which is
// a ptr to member function. The member function should
// be declared as follows:
//
// gddAppFuncTableStatus PV::memberFunction(gdd &value);
//
// The typedef is not used here because of portability
// problems resulting from compiler weaknesses
//
template <class PV>
gddAppFuncTableStatus gddAppFuncTable<PV>::installReadFunc(
const unsigned type,
gddAppFuncTableStatus (PV::*pMFuncIn)(gdd &value))
{
//
// Attempt to expand the table if the app type will not fit
//
if (type>=this->appTableNElem) {
this->newTbl(type);
if (type>=this->appTableNElem) {
return S_gddAppFuncTable_noMemory;
}
}
this->pMFuncRead[type]=pMFuncIn;
return S_gddAppFuncTable_Success;
}
//
// installReadFunc()
//
// The 2nd parameter has type "gddAppReadFunc" which is
// a ptr to member function. The member function should
// be declared as follows:
//
// gddAppFuncTableStatus PV::memberFunction(gdd &value);
//
template <class PV>
gddAppFuncTableStatus gddAppFuncTable<PV>::installReadFunc(
const char * const pName,
gddAppFuncTableStatus (PV::*pMFuncIn)(gdd &value))
{
aitUint32 type;
gddStatus rc;
rc = gddApplicationTypeTable::
app_table.registerApplicationType (pName, type);
if (rc!=0 && rc!=gddErrorAlreadyDefined) {
printf(
"at gdd lib limit => read of PV attribute \"%s\" will fail\n", pName);
return S_gddAppFuncTable_gddLimit;
}
# ifdef DEBUG
printf("installing PV attribute %s = %d\n", pName, type);
# endif
return this->installReadFunc(type, pMFuncIn);
}
//
// gddAppFuncTable<PV>::newTbl()
//
// The total number of application tags to manage should be
// hidden from the application
//
// The typedef is not used here because of portability
// problems resulting from compiler weaknesses
//
template <class PV>
void gddAppFuncTable<PV>::newTbl(unsigned newApplTypeMax)
{
gddAppReadFunc *pMNewFuncTbl;
unsigned maxApp;
unsigned i;
if (this->appTableNElem>newApplTypeMax) {
return;
}
maxApp = newApplTypeMax+(1u<<6u);
# ifdef _MSC_VER
//
// Right now all MS Visual C++ compilers allocate the
// wrong amount of memory (i.e. too little)
// for member function pointers,
// only explicit calculation via sizeof() works.
// For future versions this may become "if _MSC_VER < ???"...
//
pMNewFuncTbl = (gddAppReadFunc *)
new char[sizeof(gddAppReadFunc) * maxApp];
# else
pMNewFuncTbl = new gddAppReadFunc[maxApp];
# endif
if (pMNewFuncTbl) {
for (i=0u; i<maxApp; i++) {
if (i<this->appTableNElem) {
pMNewFuncTbl[i] = this->pMFuncRead[i];
}
else {
//
// some versions of NULL include (void *) cast
// (so I am using vanilla zero here)
//
pMNewFuncTbl[i] = 0;
}
}
if (this->pMFuncRead) {
delete [] this->pMFuncRead;
}
this->pMFuncRead = pMNewFuncTbl;
this->appTableNElem = maxApp;
}
}
//
// gddAppFuncTable<PV>::read()
//
template <class PV>
gddAppFuncTableStatus gddAppFuncTable<PV>::read(PV &pv, gdd &value)
{
gddAppFuncTableStatus status;
//
// if this gdd is a container then step through it
// and fetch all of the values inside
//
if (value.isContainer()) {
gddContainer *pCont = (gddContainer *) &value;
gddCursor curs = pCont->getCursor();
gdd *pItem;
status = S_gddAppFuncTable_Success;
for (pItem=curs.first(); pItem; pItem=curs.next())
{
status = this->read(pv, *pItem);
if (status) {
break;
}
}
return status;
}
return callReadFunc(pv, value);
}
//
// gddAppFuncTable<PV>::callReadFunc()
//
template <class PV>
gddAppFuncTableStatus gddAppFuncTable<PV>::callReadFunc (PV &pv, gdd &value)
{
unsigned type = value.applicationType();
gddAppReadFunc pFunc;
//
// otherwise call the function associated
// with this application type
//
type = value.applicationType();
if (type>=this->appTableNElem) {
errPrintf (S_gddAppFuncTable_badType, __FILE__,
__LINE__, "- large appl type code = %u\n",
type);
return S_gddAppFuncTable_badType;
}
pFunc = this->pMFuncRead[type];
if (pFunc==NULL) {
errPrintf (S_gddAppFuncTable_badType, __FILE__,
__LINE__, "- ukn appl type code = %u\n",
type);
return S_gddAppFuncTable_badType;
}
return (pv.*pFunc)(value);
}
#endif // gddAppFuncTableH
+4
View File
@@ -4,6 +4,9 @@
// $Id$
//
// $Log$
// Revision 1.1 1996/06/25 19:11:45 jbk
// new in EPICS base
//
//
// *Revision 1.2 1996/06/24 03:15:37 jbk
@@ -11,6 +14,7 @@
// *Revision 1.1 1996/05/31 13:15:31 jbk
// *add new stuff
#define epicsExportSharedSymbols
#include "gddNewDel.h"
#include <stdio.h>
+5 -1
View File
@@ -7,10 +7,14 @@
*
* $Id$
* $Log$
* Revision 1.1 1997/03/21 01:56:10 jbk
* *** empty log message ***
*
*
*/
#include "aitTypes.h"
#include "shareLib.h"
// ------------------------- semaphores ---------------------------
@@ -25,7 +29,7 @@ typedef enum { gddSemEmpty, gddSemFull } gddSemType;
// Semaphores default to "Full"
class gddSemaphore
class epicsShareClass gddSemaphore
{
public:
gddSemaphore(void);
+6 -3
View File
@@ -4,6 +4,9 @@
// $Id$
//
// $Log$
// Revision 1.7 1997/04/23 17:13:05 jhill
// fixed export of symbols from WIN32 DLL
//
// Revision 1.6 1996/12/20 13:11:42 jbk
// More strings yet printed now
//
@@ -74,7 +77,7 @@ void gdd::dumpInfo(void)
prt_tot=sz_elem>max?max:sz_elem;
fprintf(stderr,"----------dump This=%8.8x---------\n",(unsigned int)this);
fprintf(stderr,"----------dump This=%p---------\n", this);
fprintf(stderr," dimension=%d ",(int)dimension());
fprintf(stderr,"app-type=%d ",(int)applicationType());
@@ -235,9 +238,9 @@ void gdd::dumpInfo(void)
if(!isScalar())
{
if(destruct)
fprintf(stderr," destructor=%8.8x\n",(int)destruct);
fprintf(stderr," destructor=%p\n", destruct);
else
fprintf(stderr," destructor=NULL\n",(int)destruct);
fprintf(stderr," destructor=NULL\n");
}
for(i=0;i<dimension();i++)