From: Horst von Brand Date: Sun, 15 Nov 1998 20:57:05 +0000 (-0300) Subject: pp.c uses 'unsigned Quad_t' X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e862df63892174c464ca70c47921f99307066a25;p=p5sagit%2Fp5-mst-13.2.git pp.c uses 'unsigned Quad_t' To: perlbug@perl.com Message-Id: <199811152357.UAA12768@sleipnir.valparaiso.cl> p4raw-id: //depot/cfgperl@2250 --- diff --git a/perl.h b/perl.h index f5841e6..ca8973e 100644 --- a/perl.h +++ b/perl.h @@ -855,6 +855,7 @@ Free_t Perl_free _((Malloc_t where)); #ifndef Quad_t # if LONGSIZE == 8 # define Quad_t long +# define Uquad_t unsigned long # define PERL_QUAD_IS_LONG # endif #endif @@ -862,6 +863,7 @@ Free_t Perl_free _((Malloc_t where)); #ifndef Quad_t # if INTSIZE == 8 # define Quad_t int +# define Uquad_t unsigned int # define PERL_QUAD_IS_INT # endif #endif @@ -870,6 +872,7 @@ Free_t Perl_free _((Malloc_t where)); # ifdef USE_LONG_LONG /* See above note about LP32. --jhi */ # if defined(HAS_LONG_LONG) && LONGLONGSIZE == 8 # define Quad_t long long +# define Uquad_t unsigned long long # define PERL_QUAD_IS_LONG_LONG # endif # endif @@ -886,8 +889,9 @@ Free_t Perl_free _((Malloc_t where)); #ifdef Quad_t # define HAS_QUAD # ifndef Uquad_t - /* Note that if your Quad_t is a typedef you *must* have defined - * also Uquad_t yourself because 'unsigned type' is illegal. */ + /* Note that if your Quad_t is a typedef (not a #define) you *MUST* + * have defined by now Uquad_t yourself because 'unsigned type' + * is illegal. */ # define Uquad_t unsigned Quad_t # endif #endif diff --git a/pp.c b/pp.c index 6a308a8..2686116 100644 --- a/pp.c +++ b/pp.c @@ -3203,7 +3203,7 @@ PP(pp_unpack) unsigned int auint; U32 aulong; #ifdef HAS_QUAD - unsigned Quad_t auquad; + Uquad_t auquad; #endif char *aptr; float afloat; @@ -3760,11 +3760,11 @@ PP(pp_unpack) EXTEND(SP, len); EXTEND_MORTAL(len); while (len-- > 0) { - if (s + sizeof(unsigned Quad_t) > strend) + if (s + sizeof(Uquad_t) > strend) auquad = 0; else { - Copy(s, &auquad, 1, unsigned Quad_t); - s += sizeof(unsigned Quad_t); + Copy(s, &auquad, 1, Uquad_t); + s += sizeof(Uquad_t); } sv = NEWSV(43, 0); if (auquad <= UV_MAX) @@ -4051,7 +4051,7 @@ PP(pp_pack) U32 aulong; #ifdef HAS_QUAD Quad_t aquad; - unsigned Quad_t auquad; + Uquad_t auquad; #endif char *aptr; float afloat; @@ -4438,8 +4438,8 @@ PP(pp_pack) case 'Q': while (len-- > 0) { fromstr = NEXTFROM; - auquad = (unsigned Quad_t)SvIV(fromstr); - sv_catpvn(cat, (char*)&auquad, sizeof(unsigned Quad_t)); + auquad = (Uquad_t)SvIV(fromstr); + sv_catpvn(cat, (char*)&auquad, sizeof(Uquad_t)); } break; case 'q':