Skip to content

Commit

Permalink
Merge 84db64e into 90c0f5c
Browse files Browse the repository at this point in the history
  • Loading branch information
pheest committed Feb 17, 2020
2 parents 90c0f5c + 84db64e commit 13d361f
Show file tree
Hide file tree
Showing 24 changed files with 2,225 additions and 2,217 deletions.
6 changes: 3 additions & 3 deletions modules/ca/src/client/acctst.c
Expand Up @@ -3036,7 +3036,7 @@ void verifyMultithreadSubscr ( const char * pName, unsigned interestLevel )
epicsEventMustCreate ( epicsEventEmpty );
verify ( pMultiThreadSubscrTest->m_threadExitEvent );
strncpy ( pMultiThreadSubscrTest->m_chanName, pName,
sizeof ( pMultiThreadSubscrTest->m_chanName ) );
sizeof ( pMultiThreadSubscrTest->m_chanName )-1);
pMultiThreadSubscrTest->m_chanName
[ sizeof ( pMultiThreadSubscrTest->m_chanName ) - 1u ] = '\0';
pMultiThreadSubscrTest->m_nUpdatesRequired = nSubscr;
Expand Down Expand Up @@ -3396,7 +3396,7 @@ void verifyContextRundownChanStillExist (
}

int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
unsigned repetitionCount, enum ca_preemptive_callback_select select )
unsigned repetitionCount, enum ca_preemptive_callback_select select )
{
chid chan;
int status;
Expand Down Expand Up @@ -3507,7 +3507,7 @@ int acctst ( const char * pName, unsigned interestLevel, unsigned channelCount,
verify ( pChans );

for ( i = 0; i < channelCount; i++ ) {
strncpy ( pChans[ i ].name, pName, sizeof ( pChans[ i ].name ) );
strncpy ( pChans[ i ].name, pName, sizeof ( pChans[ i ].name ) - 1 );
pChans[ i ].name[ sizeof ( pChans[i].name ) - 1 ] = '\0';
}

Expand Down
6 changes: 3 additions & 3 deletions modules/ca/src/client/caEventRate.cpp
Expand Up @@ -55,7 +55,7 @@ void caEventRate ( const char *pName, unsigned count )
}
epicsTime end = epicsTime::getCurrent ();

printf ( " done(%f sec).\n", end - begin );
printf ( " done(%f sec).\n", double(end - begin) );
}

{
Expand All @@ -74,7 +74,7 @@ void caEventRate ( const char *pName, unsigned count )

epicsTime end = epicsTime::getCurrent ();

printf ( " done(%f sec).\n", end - begin );
printf ( " done(%f sec).\n", double(end - begin) );
}

{
Expand All @@ -91,7 +91,7 @@ void caEventRate ( const char *pName, unsigned count )
}
epicsTime end = epicsTime::getCurrent ();

printf ( " done(%f sec).\n", end - begin );
printf ( " done(%f sec).\n", double(end - begin) );
}

double samplePeriod = initialSamplePeriod;
Expand Down
6 changes: 3 additions & 3 deletions modules/ca/src/client/casw.cpp
Expand Up @@ -40,8 +40,8 @@ class bheFreeStoreMgr : public bheMemoryManager {
void release ( void * );
private:
tsFreeList < class bhe, 0x100 > freeList;
bheFreeStoreMgr ( const bheFreeStoreMgr & );
bheFreeStoreMgr & operator = ( const bheFreeStoreMgr & );
bheFreeStoreMgr ( const bheFreeStoreMgr & );
bheFreeStoreMgr & operator = ( const bheFreeStoreMgr & );
};

void * bheFreeStoreMgr::allocate ( size_t size )
Expand Down Expand Up @@ -293,7 +293,7 @@ int main ( int argc, char ** argv )
if ( anomaly && interest > 0 ) {
printf ( "\testimate=%f current=%f\n",
pBHE->period ( guard ),
currentTime - previousTime );
double(currentTime - previousTime) );
}
fflush(stdout);
}
Expand Down
60 changes: 30 additions & 30 deletions modules/ca/src/client/test_event.cpp
Expand Up @@ -87,7 +87,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
dbr_enum_t *pvalue = (dbr_enum_t *)pbuffer;
for (i = 0; i < count; i++,pvalue++){
if(count!=1 && (i%10 == 0)) printf("\n");
printf("%d ",*pvalue);
printf("%hd ",*pvalue);
}
break;
}
Expand Down Expand Up @@ -134,7 +134,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
{
struct dbr_sts_string *pvalue
= (struct dbr_sts_string *) pbuffer;
printf("%2d %2d",pvalue->status,pvalue->severity);
printf("%2hd %2hd",pvalue->status,pvalue->severity);
printf("\tValue: %s",pvalue->value);
break;
}
Expand All @@ -143,7 +143,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
struct dbr_sts_enum *pvalue
= (struct dbr_sts_enum *)pbuffer;
dbr_enum_t *pEnum = &pvalue->value;
printf("%2d %2d",pvalue->status,pvalue->severity);
printf("%2hd %2hd",pvalue->status,pvalue->severity);
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,pEnum++){
if(count!=1 && (i%10 == 0)) printf("\n");
Expand All @@ -156,11 +156,11 @@ extern "C" void epicsShareAPI ca_dump_dbr (
struct dbr_sts_short *pvalue
= (struct dbr_sts_short *)pbuffer;
dbr_short_t *pshort = &pvalue->value;
printf("%2d %2d",pvalue->status,pvalue->severity);
printf("%2hd %2hd",pvalue->status,pvalue->severity);
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,pshort++){
if(count!=1 && (i%10 == 0)) printf("\n");
printf("%u ",*pshort);
printf("%hu ",*pshort);
}
break;
}
Expand All @@ -169,7 +169,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
struct dbr_sts_float *pvalue
= (struct dbr_sts_float *)pbuffer;
dbr_float_t *pfloat = &pvalue->value;
printf("%2d %2d",pvalue->status,pvalue->severity);
printf("%2hd %2hd",pvalue->status,pvalue->severity);
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,pfloat++){
if(count!=1 && (i%10 == 0)) printf("\n");
Expand All @@ -183,7 +183,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
= (struct dbr_sts_char *)pbuffer;
dbr_char_t *pchar = &pvalue->value;

printf("%2d %2d",pvalue->status,pvalue->severity);
printf("%2hd %2hd",pvalue->status,pvalue->severity);
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,pchar++){
if(count!=1 && (i%10 == 0)) printf("\n");
Expand All @@ -196,7 +196,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
struct dbr_sts_long *pvalue
= (struct dbr_sts_long *)pbuffer;
dbr_long_t *plong = &pvalue->value;
printf("%2d %2d",pvalue->status,pvalue->severity);
printf("%2hd %2hd",pvalue->status,pvalue->severity);
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,plong++){
if(count!=1 && (i%10 == 0)) printf("\n");
Expand All @@ -209,7 +209,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
struct dbr_sts_double *pvalue
= (struct dbr_sts_double *)pbuffer;
dbr_double_t *pdouble = &pvalue->value;
printf("%2d %2d",pvalue->status,pvalue->severity);
printf("%2hd %2hd",pvalue->status,pvalue->severity);
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,pdouble++){
if(count!=1 && (i%10 == 0)) printf("\n");
Expand Down Expand Up @@ -254,14 +254,14 @@ extern "C" void epicsShareAPI ca_dump_dbr (
dbr_short_t *pshort = &pvalue->value;
epicsTimeToStrftime(tsString,sizeof(tsString),
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
printf("%2d %2d",
printf("%2hd %2hd",
pvalue->status,
pvalue->severity);
printf("\tTimeStamp: %s",tsString);
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,pshort++){
if(count!=1 && (i%10 == 0)) printf("\n");
printf("%d ",*pshort);
printf("%hd ",*pshort);
}
break;
}
Expand All @@ -273,7 +273,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (

epicsTimeToStrftime(tsString,sizeof(tsString),
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
printf("%2d %2d",pvalue->status,pvalue->severity);
printf("%2hd %2hd",pvalue->status,pvalue->severity);
printf("\tTimeStamp: %s",tsString);
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,pfloat++){
Expand All @@ -290,7 +290,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (

epicsTimeToStrftime(tsString,sizeof(tsString),
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
printf("%2d %2d",pvalue->status,pvalue->severity);
printf("%2hd %2hd",pvalue->status,pvalue->severity);
printf("\tTimeStamp: %s",tsString);
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,pchar++){
Expand All @@ -307,7 +307,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (

epicsTimeToStrftime(tsString,sizeof(tsString),
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
printf("%2d %2d",pvalue->status,pvalue->severity);
printf("%2hd %2hd",pvalue->status,pvalue->severity);
printf("\tTimeStamp: %s",tsString);
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,plong++){
Expand All @@ -324,7 +324,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (

epicsTimeToStrftime(tsString,sizeof(tsString),
"%Y/%m/%d %H:%M:%S.%06f",&pvalue->stamp);
printf("%2d %2d",pvalue->status,pvalue->severity);
printf("%2hd %2hd",pvalue->status,pvalue->severity);
printf("\tTimeStamp: %s",tsString);
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,pdouble++){
Expand All @@ -338,7 +338,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
struct dbr_gr_short *pvalue
= (struct dbr_gr_short *)pbuffer;
dbr_short_t *pshort = &pvalue->value;
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
printf("%2hd %2hd %.8s",pvalue->status,pvalue->severity,
pvalue->units);
printf("\n\t%8d %8d %8d %8d %8d %8d",
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
Expand All @@ -347,7 +347,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,pshort++){
if(count!=1 && (i%10 == 0)) printf("\n");
printf("%d ",*pshort);
printf("%hd ",*pshort);
}
break;
}
Expand All @@ -356,7 +356,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
struct dbr_gr_float *pvalue
= (struct dbr_gr_float *)pbuffer;
dbr_float_t *pfloat = &pvalue->value;
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
printf("%2hd %2hd %.8s",pvalue->status,pvalue->severity,
pvalue->units);
printf(" %3d\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
pvalue->precision,
Expand All @@ -374,11 +374,11 @@ extern "C" void epicsShareAPI ca_dump_dbr (
{
struct dbr_gr_enum *pvalue
= (struct dbr_gr_enum *)pbuffer;
printf("%2d %2d",pvalue->status,
printf("%2hd %2hd",pvalue->status,
pvalue->severity);
printf("\tValue: %d",pvalue->value);
printf("\tValue: %hd",pvalue->value);
if(pvalue->no_str>0) {
printf("\n\t%3d",pvalue->no_str);
printf("\n\t%3hd",pvalue->no_str);
for (i = 0; i < (unsigned) pvalue->no_str; i++)
printf("\n\t%.26s",pvalue->strs[i]);
}
Expand All @@ -388,7 +388,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
{
struct dbr_ctrl_enum *pvalue
= (struct dbr_ctrl_enum *)pbuffer;
printf("%2d %2d",pvalue->status,
printf("%2hd %2hd",pvalue->status,
pvalue->severity);
printf("\tValue: %d",pvalue->value);
if(pvalue->no_str>0) {
Expand Down Expand Up @@ -441,7 +441,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
dbr_double_t *pdouble = &pvalue->value;
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
pvalue->units);
printf(" %3d\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
printf(" %3hd\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
pvalue->precision,
(float)(pvalue->upper_disp_limit),
(float)(pvalue->lower_disp_limit),
Expand All @@ -461,13 +461,13 @@ extern "C" void epicsShareAPI ca_dump_dbr (
struct dbr_ctrl_short *pvalue
= (struct dbr_ctrl_short *)pbuffer;
dbr_short_t *pshort = &pvalue->value;
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
printf("%2hd %2hd %.8s",pvalue->status,pvalue->severity,
pvalue->units);
printf("\n\t%8d %8d %8d %8d %8d %8d",
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
pvalue->upper_alarm_limit,pvalue->upper_warning_limit,
pvalue->lower_warning_limit,pvalue->lower_alarm_limit);
printf(" %8d %8d",
printf(" %8hd %8hd",
pvalue->upper_ctrl_limit,pvalue->lower_ctrl_limit);
if(count==1) printf("\tValue: ");
for (i = 0; i < count; i++,pshort++){
Expand All @@ -481,7 +481,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
struct dbr_ctrl_float *pvalue
= (struct dbr_ctrl_float *)pbuffer;
dbr_float_t *pfloat = &pvalue->value;
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
printf("%2hd %2hd %.8s",pvalue->status,pvalue->severity,
pvalue->units);
printf(" %3d\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
pvalue->precision,
Expand All @@ -502,7 +502,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
struct dbr_ctrl_char *pvalue
= (struct dbr_ctrl_char *)pbuffer;
dbr_char_t *pchar = &pvalue->value;
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
printf("%2hd %2hd %.8s",pvalue->status,pvalue->severity,
pvalue->units);
printf("\n\t%8d %8d %8d %8d %8d %8d",
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
Expand All @@ -522,7 +522,7 @@ extern "C" void epicsShareAPI ca_dump_dbr (
struct dbr_ctrl_long *pvalue
= (struct dbr_ctrl_long *)pbuffer;
dbr_long_t *plong = &pvalue->value;
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
printf("%2hd %2hd %.8s",pvalue->status,pvalue->severity,
pvalue->units);
printf("\n\t%8d %8d %8d %8d %8d %8d",
pvalue->upper_disp_limit,pvalue->lower_disp_limit,
Expand All @@ -542,9 +542,9 @@ extern "C" void epicsShareAPI ca_dump_dbr (
struct dbr_ctrl_double *pvalue
= (struct dbr_ctrl_double *)pbuffer;
dbr_double_t *pdouble = &pvalue->value;
printf("%2d %2d %.8s",pvalue->status,pvalue->severity,
printf("%2hd %2hd %.8s",pvalue->status,pvalue->severity,
pvalue->units);
printf(" %3d\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
printf(" %3hd\n\t%8.3f %8.3f %8.3f %8.3f %8.3f %8.3f",
pvalue->precision,
(float)(pvalue->upper_disp_limit),
(float)(pvalue->lower_disp_limit),
Expand Down
2 changes: 1 addition & 1 deletion modules/ca/src/tools/camonitor.c
Expand Up @@ -251,7 +251,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);
Expand Down

0 comments on commit 13d361f

Please sign in to comment.