From 87b2b3b1e639ccc5d836868b04428d14f4721603 Mon Sep 17 00:00:00 2001 From: Jeff Hill Date: Wed, 26 Jun 1996 00:19:40 +0000 Subject: [PATCH] added CHAR_BIT to max bound calc for the "ref_cnt" member of class gdd --- src/gdd/gdd.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gdd/gdd.h b/src/gdd/gdd.h index 26f8e542c..cbd2484e4 100644 --- a/src/gdd/gdd.h +++ b/src/gdd/gdd.h @@ -8,6 +8,9 @@ * $Id$ * * $Log$ + * Revision 1.1 1996/06/25 19:11:38 jbk + * new in EPICS base + * * * *Revision 1.4 1996/06/24 03:15:33 jbk * *name changes and fixes for aitString and fixed string functions @@ -30,6 +33,7 @@ #include #include +#include #include #ifndef vxWorks #include @@ -653,9 +657,9 @@ inline gddStatus gdd::reference(void) if(isNoRef()) rc=gddErrorNotAllowed; else ref_cnt++; - if(ref_cnt>((1<((1u<<(sizeof(ref_cnt)*CHAR_BIT))-2u)) { - fprintf(stderr,"gdd reference count underflow!!\n"); + fprintf(stderr,"gdd reference count overflow!!\n"); rc=gddErrorOverflow; } return rc; @@ -665,13 +669,13 @@ inline gddStatus gdd::unreference(void) { int rc=0; - if(ref_cnt==0) + if(ref_cnt==0u) { fprintf(stderr,"gdd reference count underflow!!\n"); return gddErrorUnderflow; } - if(--ref_cnt<=0) + if(--ref_cnt<=0u) { if(isManaged()) {