From b95644e9d7dae4f061db49677c8e806243f9e9f3 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Fri, 30 May 1997 13:16:18 +0000 Subject: [PATCH] Get rid of warning messages for LONG_MIN --- src/libCom/cvtFast.c | 12 ++++++------ src/libCom/cvtFast/cvtFast.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/libCom/cvtFast.c b/src/libCom/cvtFast.c index 515062b81..1665bd5e6 100644 --- a/src/libCom/cvtFast.c +++ b/src/libCom/cvtFast.c @@ -441,8 +441,8 @@ int epicsShareAPI cvtLongToString( return((int)(pdest-startAddr)); } if(source<0) { - if(source == LONG_MIN) { - sprintf(pdest,"%d",LONG_MIN); + if((unsigned long)source == (unsigned long)LONG_MIN) { + sprintf(pdest,"%lu",(unsigned long)LONG_MIN); return((int)strlen(pdest)); } *pdest++ = '-'; @@ -511,8 +511,8 @@ int epicsShareAPI cvtLongToHexString( return((int)(pdest-startAddr)); } if(source<0) { - if(source == LONG_MIN) { - sprintf(pdest,"%x",LONG_MIN); + if((unsigned long)source == (unsigned long)LONG_MIN) { + sprintf(pdest,"%x",(unsigned long)LONG_MIN); return((int)strlen(pdest)); } *pdest++ = '-'; @@ -547,8 +547,8 @@ int epicsShareAPI cvtLongToOctalString( return((int)(pdest-startAddr)); } if(source<0) { - if(source == LONG_MIN) { - sprintf(pdest,"%o",LONG_MIN); + if((unsigned long)source == (unsigned long)LONG_MIN) { + sprintf(pdest,"%o",(unsigned long)LONG_MIN); return((int)strlen(pdest)); } *pdest++ = '-'; diff --git a/src/libCom/cvtFast/cvtFast.c b/src/libCom/cvtFast/cvtFast.c index 515062b81..1665bd5e6 100644 --- a/src/libCom/cvtFast/cvtFast.c +++ b/src/libCom/cvtFast/cvtFast.c @@ -441,8 +441,8 @@ int epicsShareAPI cvtLongToString( return((int)(pdest-startAddr)); } if(source<0) { - if(source == LONG_MIN) { - sprintf(pdest,"%d",LONG_MIN); + if((unsigned long)source == (unsigned long)LONG_MIN) { + sprintf(pdest,"%lu",(unsigned long)LONG_MIN); return((int)strlen(pdest)); } *pdest++ = '-'; @@ -511,8 +511,8 @@ int epicsShareAPI cvtLongToHexString( return((int)(pdest-startAddr)); } if(source<0) { - if(source == LONG_MIN) { - sprintf(pdest,"%x",LONG_MIN); + if((unsigned long)source == (unsigned long)LONG_MIN) { + sprintf(pdest,"%x",(unsigned long)LONG_MIN); return((int)strlen(pdest)); } *pdest++ = '-'; @@ -547,8 +547,8 @@ int epicsShareAPI cvtLongToOctalString( return((int)(pdest-startAddr)); } if(source<0) { - if(source == LONG_MIN) { - sprintf(pdest,"%o",LONG_MIN); + if((unsigned long)source == (unsigned long)LONG_MIN) { + sprintf(pdest,"%o",(unsigned long)LONG_MIN); return((int)strlen(pdest)); } *pdest++ = '-';