From 16e9a2dbc09d6d4da8fbb05ce118caab0632d5f2 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Sat, 2 Nov 1996 02:19:55 +0000 Subject: [PATCH] removed gnu warnings --- src/util/ca_test.c | 45 +++++++++++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/src/util/ca_test.c b/src/util/ca_test.c index 1bd3e5b37..2479e0fed 100644 --- a/src/util/ca_test.c +++ b/src/util/ca_test.c @@ -61,12 +61,12 @@ #include -LOCAL int ca_test(char *pname, char *pvalue); +int ca_test(char *pname, char *pvalue); LOCAL int cagft(char *pname); LOCAL void printit(struct event_handler_args args); LOCAL int capft(char *pname, char *pvalue); LOCAL void verify_value(chid chan_id, chtype type); -LOCAL void print_returned(chtype type, void *pbuffer, unsigned count); +LOCAL void print_returned(chtype type, const void *pbuffer, unsigned count); static unsigned long outstanding; @@ -78,7 +78,7 @@ static unsigned long outstanding; * parse command line arguments */ #ifndef vxWorks -main( +int main( int argc, char **argv ) @@ -109,7 +109,7 @@ char **argv /* strip leading and trailing quotes*/ if(argv[2][1]=='"') argv[2]++; - if(pt=strchr(argv[2],'"')) *pt = 0; + if( (pt=strchr(argv[2],'"')) ) *pt = 0; return ca_test(argv[1], argv[2]); } else{ @@ -127,7 +127,7 @@ char **argv * read back the current value * */ -LOCAL int ca_test( +int ca_test( char *pname, char *pvalue ) @@ -405,7 +405,7 @@ LOCAL void verify_value(chid chan_id, chtype type) * * switches over the range of CA data types and reports the value */ -LOCAL void print_returned(chtype type, void *pbuffer, unsigned count) +LOCAL void print_returned(chtype type, const void *pbuffer, unsigned count) { unsigned i; @@ -549,7 +549,7 @@ LOCAL void print_returned(chtype type, void *pbuffer, unsigned count) if(count==1) printf("\tValue: "); for (i = 0; i < count; i++,plong++){ if(count!=1 && (i%10 == 0)) printf("\n"); - printf("0x%lx ",*plong); + printf("0x%lx ", (unsigned long) *plong); } break; } @@ -572,7 +572,8 @@ LOCAL void print_returned(chtype type, void *pbuffer, unsigned count) = (struct dbr_time_string *) pbuffer; printf("%2d %2d",pvalue->status,pvalue->severity); printf("\tTimeStamp: %lx %lx", - pvalue->stamp.secPastEpoch, pvalue->stamp.nsec); + (unsigned long) pvalue->stamp.secPastEpoch, + (unsigned long) pvalue->stamp.nsec); printf("\tValue: "); printf("%s",pvalue->value); break; @@ -584,7 +585,8 @@ LOCAL void print_returned(chtype type, void *pbuffer, unsigned count) dbr_enum_t *pshort = &pvalue->value; printf("%2d %2d",pvalue->status,pvalue->severity); printf("\tTimeStamp: %lx %lx", - pvalue->stamp.secPastEpoch, pvalue->stamp.nsec); + (unsigned long) pvalue->stamp.secPastEpoch, + (unsigned long) pvalue->stamp.nsec); if(count==1) printf("\tValue: "); for (i = 0; i < count; i++,pshort++){ if(count!=1 && (i%10 == 0)) printf("\n"); @@ -597,9 +599,12 @@ LOCAL void print_returned(chtype type, void *pbuffer, unsigned count) struct dbr_time_short *pvalue = (struct dbr_time_short *)pbuffer; dbr_short_t *pshort = &pvalue->value; - printf("%2d %2d",pvalue->status,pvalue->severity); + printf("%2d %2d", + pvalue->status, + pvalue->severity); printf("\tTimeStamp: %lx %lx", - pvalue->stamp.secPastEpoch, pvalue->stamp.nsec); + (unsigned long) pvalue->stamp.secPastEpoch, + (unsigned long) pvalue->stamp.nsec); if(count==1) printf("\tValue: "); for (i = 0; i < count; i++,pshort++){ if(count!=1 && (i%10 == 0)) printf("\n"); @@ -614,7 +619,8 @@ LOCAL void print_returned(chtype type, void *pbuffer, unsigned count) dbr_float_t *pfloat = &pvalue->value; printf("%2d %2d",pvalue->status,pvalue->severity); printf("\tTimeStamp: %lx %lx", - pvalue->stamp.secPastEpoch, pvalue->stamp.nsec); + (unsigned long) pvalue->stamp.secPastEpoch, + (unsigned long) pvalue->stamp.nsec); if(count==1) printf("\tValue: "); for (i = 0; i < count; i++,pfloat++){ if(count!=1 && (i%10 == 0)) printf("\n"); @@ -629,7 +635,8 @@ LOCAL void print_returned(chtype type, void *pbuffer, unsigned count) dbr_char_t *pchar = &pvalue->value; printf("%2d %2d",pvalue->status,pvalue->severity); printf("\tTimeStamp: %lx %lx", - pvalue->stamp.secPastEpoch, pvalue->stamp.nsec); + (unsigned long) pvalue->stamp.secPastEpoch, + (unsigned long) pvalue->stamp.nsec); if(count==1) printf("\tValue: "); for (i = 0; i < count; i++,pchar++){ if(count!=1 && (i%10 == 0)) printf("\n"); @@ -644,11 +651,12 @@ LOCAL void print_returned(chtype type, void *pbuffer, unsigned count) dbr_long_t *plong = &pvalue->value; printf("%2d %2d",pvalue->status,pvalue->severity); printf("\tTimeStamp: %lx %lx", - pvalue->stamp.secPastEpoch, pvalue->stamp.nsec); + (unsigned long) pvalue->stamp.secPastEpoch, + (unsigned long) pvalue->stamp.nsec); if(count==1) printf("\tValue: "); for (i = 0; i < count; i++,plong++){ if(count!=1 && (i%10 == 0)) printf("\n"); - printf("0x%lx ",*plong); + printf("0x%lx ", (unsigned long) *plong); } break; } @@ -659,7 +667,8 @@ LOCAL void print_returned(chtype type, void *pbuffer, unsigned count) dbr_double_t *pdouble = &pvalue->value; printf("%2d %2d",pvalue->status,pvalue->severity); printf("\tTimeStamp: %lx %lx", - pvalue->stamp.secPastEpoch, pvalue->stamp.nsec); + (unsigned long) pvalue->stamp.secPastEpoch, + (unsigned long) pvalue->stamp.nsec); if(count==1) printf("\tValue: "); for (i = 0; i < count; i++,pdouble++){ if(count!=1 && (i%10 == 0)) printf("\n"); @@ -751,7 +760,7 @@ LOCAL void print_returned(chtype type, void *pbuffer, unsigned count) if(count==1) printf("\tValue: "); for (i = 0; i < count; i++,plong++){ if(count!=1 && (i%10 == 0)) printf("\n"); - printf("0x%lx ",*plong); + printf("0x%lx ", (unsigned long) *plong); } break; } @@ -854,7 +863,7 @@ LOCAL void print_returned(chtype type, void *pbuffer, unsigned count) if(count==1) printf("\tValue: "); for (i = 0; i < count; i++,plong++){ if(count!=1 && (i%10 == 0)) printf("\n"); - printf("0x%lx ",*plong); + printf("0x%lx ", (unsigned long) *plong); } break; }