@@ -605,7 +605,7 @@ void epicsShareAPI ca_signal_formated ( long ca_status, const char *pfilenm,
|
||||
}
|
||||
else {
|
||||
fprintf ( stderr, "CA exception in thread w/o CA ctx: status=%s file=%s line=%d: \n",
|
||||
ca_message ( ca_status ), pfilenm, lineno );
|
||||
ca_message ( ca_status ), pfilenm ? pfilenm : "<null>", lineno );
|
||||
if ( pFormat ) {
|
||||
vfprintf ( stderr, pFormat, theArgs );
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ int main (int argc, char *argv[])
|
||||
}
|
||||
break;
|
||||
case 's': /* ca_client_status interest level */
|
||||
if (sscanf(optarg,"%du", &statLevel) != 1)
|
||||
if (sscanf(optarg,"%u", &statLevel) != 1)
|
||||
{
|
||||
fprintf(stderr, "'%s' is not a valid interest level "
|
||||
"- ignored. ('cainfo -h' for help.)\n", optarg);
|
||||
|
||||
@@ -258,7 +258,7 @@ int main (int argc, char *argv[])
|
||||
}
|
||||
break;
|
||||
case '#': /* Array count */
|
||||
if (sscanf(optarg,"%ld", &reqElems) != 1)
|
||||
if (sscanf(optarg,"%lu", &reqElems) != 1)
|
||||
{
|
||||
fprintf(stderr, "'%s' is not a valid array element count "
|
||||
"- ignored. ('camonitor -h' for help.)\n", optarg);
|
||||
|
||||
@@ -437,6 +437,7 @@ int main (int argc, char *argv[])
|
||||
dbuf = calloc (count, sizeof(double));
|
||||
if(!sbuf || !dbuf) {
|
||||
fprintf(stderr, "Memory allocation failed\n");
|
||||
free(sbuf); free(dbuf);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -450,6 +451,7 @@ int main (int argc, char *argv[])
|
||||
result = ca_pend_io(caTimeout);
|
||||
if (result == ECA_TIMEOUT) {
|
||||
fprintf(stderr, "Read operation timed out: ENUM data was not read.\n");
|
||||
free(sbuf); free(dbuf);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -460,6 +462,7 @@ int main (int argc, char *argv[])
|
||||
if (*(argv+optind+i) == pend) { /* Conversion didn't work */
|
||||
fprintf(stderr, "Enum index value '%s' is not a number.\n",
|
||||
*(argv+optind+i));
|
||||
free(sbuf); free(dbuf);
|
||||
return 1;
|
||||
}
|
||||
if (dbuf[i] >= bufGrEnum.no_str) {
|
||||
@@ -486,6 +489,7 @@ int main (int argc, char *argv[])
|
||||
dbuf[i] = epicsStrtod(sbuf[i], &pend);
|
||||
if (sbuf[i] == pend || enumAsString) {
|
||||
fprintf(stderr, "Enum string value '%s' invalid.\n", sbuf[i]);
|
||||
free(sbuf); free(dbuf);
|
||||
return 1;
|
||||
}
|
||||
if (dbuf[i] >= bufGrEnum.no_str) {
|
||||
@@ -503,6 +507,7 @@ int main (int argc, char *argv[])
|
||||
ebuf = calloc(len, sizeof(char));
|
||||
if(!ebuf) {
|
||||
fprintf(stderr, "Memory allocation failed\n");
|
||||
free(sbuf); free(dbuf); free(ebuf);
|
||||
return 1;
|
||||
}
|
||||
count = epicsStrnRawFromEscaped(ebuf, len, cbuf, len-1) + 1;
|
||||
@@ -537,12 +542,14 @@ int main (int argc, char *argv[])
|
||||
}
|
||||
if (result != ECA_NORMAL) {
|
||||
fprintf(stderr, "Error from put operation: %s\n", ca_message(result));
|
||||
free(sbuf); free(dbuf); free(ebuf);
|
||||
return 1;
|
||||
}
|
||||
|
||||
result = ca_pend_io(caTimeout);
|
||||
if (result == ECA_TIMEOUT) {
|
||||
fprintf(stderr, "Write operation timed out: Data was not written.\n");
|
||||
free(sbuf); free(dbuf); free(ebuf);
|
||||
return 1;
|
||||
}
|
||||
if (request == callback) { /* Also wait for callbacks */
|
||||
@@ -556,6 +563,7 @@ int main (int argc, char *argv[])
|
||||
|
||||
if (result != ECA_NORMAL) {
|
||||
fprintf(stderr, "Error occured writing data: %s\n", ca_message(result));
|
||||
free(sbuf); free(dbuf); free(ebuf);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -567,6 +575,7 @@ int main (int argc, char *argv[])
|
||||
|
||||
/* Shut down Channel Access */
|
||||
ca_context_destroy();
|
||||
free(sbuf); free(dbuf); free(ebuf);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "link.h"
|
||||
#include "recSup.h"
|
||||
#include "special.h"
|
||||
#include "alarm.h"
|
||||
|
||||
typedef struct parseContext {
|
||||
dbChannel *chan;
|
||||
@@ -619,6 +620,11 @@ long dbChannelOpen(dbChannel *chan)
|
||||
probe.field_type = dbChannelExportType(chan);
|
||||
probe.no_elements = dbChannelElements(chan);
|
||||
probe.field_size = dbChannelFieldSize(chan);
|
||||
probe.sevr = NO_ALARM;
|
||||
probe.stat = NO_ALARM;
|
||||
probe.time.secPastEpoch = 0;
|
||||
probe.time.nsec = 0;
|
||||
|
||||
p = probe;
|
||||
|
||||
/*
|
||||
|
||||
@@ -67,7 +67,7 @@ void recGblDbaddrError(long status, const struct dbAddr *paddr,
|
||||
errPrintf(status,0,0,
|
||||
"PV: %s.%s "
|
||||
"error detected in routine: %s\n",
|
||||
(paddr ? precord->name : "Unknown"),
|
||||
(precord ? precord->name : "Unknown"),
|
||||
(pdbFldDes ? pdbFldDes->name : ""),
|
||||
(pmessage ? pmessage : "Unknown"));
|
||||
return;
|
||||
@@ -104,7 +104,7 @@ void recGblRecSupError(long status, const struct dbAddr *paddr,
|
||||
" %s\n",
|
||||
(psupport_name ? psupport_name : "Unknown"),
|
||||
(pdbRecordType ? pdbRecordType->name : "Unknown"),
|
||||
(paddr ? precord->name : "Unknown"),
|
||||
(precord ? precord->name : "Unknown"),
|
||||
(pdbFldDes ? pdbFldDes->name : ""),
|
||||
(pmessage ? pmessage : ""));
|
||||
return;
|
||||
|
||||
@@ -46,6 +46,10 @@ int main ()
|
||||
tsSLIter<fred> iter1 = list.firstIter ();
|
||||
tsSLIter<fred> iter2 = iter1;
|
||||
tsSLIter<fred> iter3 = iter1;
|
||||
tsSLIter<fred> itert = iter3++
|
||||
assert ( iter1 == itert );
|
||||
itert = ++iter2;
|
||||
assert ( iter3 == itert );
|
||||
assert ( iter1 == iter3++ );
|
||||
assert ( iter3 == ++iter2 );
|
||||
list.remove ( *pFredII ); // removes pFred
|
||||
|
||||
@@ -438,7 +438,7 @@ int htoi(unsigned char *str)
|
||||
{
|
||||
int result;
|
||||
|
||||
(void) sscanf( (char *) str, "%x", &result );
|
||||
(void) sscanf( (char *) str, "%x", (unsigned *) &result );
|
||||
|
||||
return ( result );
|
||||
}
|
||||
@@ -653,7 +653,7 @@ int otoi(Char *str)
|
||||
{
|
||||
int result;
|
||||
|
||||
(void) sscanf( (char *) str, "%o", &result );
|
||||
(void) sscanf( (char *) str, "%o", (unsigned *) &result );
|
||||
|
||||
return ( result );
|
||||
}
|
||||
|
||||
@@ -64,10 +64,10 @@ epicsShareFunc int epicsShareAPI osiSockAttach()
|
||||
DWORD titleLength = GetConsoleTitle(title, sizeof(title));
|
||||
if (titleLength) {
|
||||
titleLength = strlen (title);
|
||||
strncat (title, " " EPICS_VERSION_STRING, sizeof(title));
|
||||
strncat (title, " " EPICS_VERSION_STRING, sizeof(title)-1);
|
||||
}
|
||||
else {
|
||||
strncpy(title, EPICS_VERSION_STRING, sizeof(title));
|
||||
strncpy(title, EPICS_VERSION_STRING, sizeof(title)-1);
|
||||
}
|
||||
title[sizeof(title)-1]= '\0';
|
||||
SetConsoleTitle(title);
|
||||
|
||||
@@ -207,7 +207,7 @@ epicsShareFunc void epicsShareAPI osiSockDiscoverBroadcastAddresses
|
||||
pNewNode->addr.sa = pIfreqList->ifr_broadaddr;
|
||||
ifDepenDebugPrintf ( ( "found broadcast addr = %x\n", ntohl ( baddr.ia.sin_addr.s_addr ) ) );
|
||||
} else {
|
||||
ifDepenDebugPrintf ( ( "Ignoring broadcast addr = \n", ntohl ( baddr.ia.sin_addr.s_addr ) ) );
|
||||
ifDepenDebugPrintf ( ( "Ignoring broadcast addr = %x\n", ntohl ( baddr.ia.sin_addr.s_addr ) ) );
|
||||
free ( pNewNode );
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ epicsShareFunc int epicsThreadHookAdd(EPICS_THREAD_HOOK_ROUTINE hook)
|
||||
return 0;
|
||||
}
|
||||
fprintf(stderr, "epicsThreadHookAdd: Locking problem\n");
|
||||
free(pHook);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -348,8 +348,9 @@ epicsShareFunc void epicsThreadMap ( EPICS_THREAD_HOOK_ROUTINE func )
|
||||
while (noTasks == 0) {
|
||||
noTasks = taskIdListGet(taskIdList, taskIdListSize);
|
||||
if (noTasks == taskIdListSize) {
|
||||
taskIdList = realloc(taskIdList, (taskIdListSize+ID_LIST_CHUNK)*sizeof(int));
|
||||
assert(taskIdList);
|
||||
int *newlist = realloc(taskIdList, (taskIdListSize+ID_LIST_CHUNK)*sizeof(int));
|
||||
assert(newlist);
|
||||
taskIdList = newlist;
|
||||
taskIdListSize += ID_LIST_CHUNK;
|
||||
noTasks = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user