From: Rafael Garcia-Suarez Date: Mon, 8 Jan 2007 11:09:10 +0000 (+0000) Subject: Change the API doc for some of the SvXXX testing macros. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fbf9f98379663b1157bb1fda639aa04bc8781c89;p=p5sagit%2Fp5-mst-13.2.git Change the API doc for some of the SvXXX testing macros. Often, those macros simply test a bit in sv_flags, so the return value should be assigned to a U32 instead of a bool to avoid truncation. (bug perl #32884) p4raw-id: //depot/perl@29718 --- diff --git a/pod/perlapi.pod b/pod/perlapi.pod index 9acb5f9..4cec94a 100644 --- a/pod/perlapi.pod +++ b/pod/perlapi.pod @@ -3756,9 +3756,9 @@ Found in file sv.h =item SvIOK X -Returns a boolean indicating whether the SV contains an integer. +Returns a U32 value indicating whether the SV contains an integer. - bool SvIOK(SV* sv) + U32 SvIOK(SV* sv) =for hackers Found in file sv.h @@ -3766,10 +3766,10 @@ Found in file sv.h =item SvIOKp X -Returns a boolean indicating whether the SV contains an integer. Checks +Returns a U32 value indicating whether the SV contains an integer. Checks the B setting. Use C. - bool SvIOKp(SV* sv) + U32 SvIOKp(SV* sv) =for hackers Found in file sv.h @@ -3947,10 +3947,10 @@ Found in file sv.h =item SvNIOK X -Returns a boolean indicating whether the SV contains a number, integer or +Returns a U32 value indicating whether the SV contains a number, integer or double. - bool SvNIOK(SV* sv) + U32 SvNIOK(SV* sv) =for hackers Found in file sv.h @@ -3958,10 +3958,10 @@ Found in file sv.h =item SvNIOKp X -Returns a boolean indicating whether the SV contains a number, integer or +Returns a U32 value indicating whether the SV contains a number, integer or double. Checks the B setting. Use C. - bool SvNIOKp(SV* sv) + U32 SvNIOKp(SV* sv) =for hackers Found in file sv.h @@ -3979,9 +3979,9 @@ Found in file sv.h =item SvNOK X -Returns a boolean indicating whether the SV contains a double. +Returns a U32 value indicating whether the SV contains a double. - bool SvNOK(SV* sv) + U32 SvNOK(SV* sv) =for hackers Found in file sv.h @@ -3989,10 +3989,10 @@ Found in file sv.h =item SvNOKp X -Returns a boolean indicating whether the SV contains a double. Checks the +Returns a U32 value indicating whether the SV contains a double. Checks the B setting. Use C. - bool SvNOKp(SV* sv) + U32 SvNOKp(SV* sv) =for hackers Found in file sv.h @@ -4073,10 +4073,10 @@ Found in file sv.h =item SvOK X -Returns a boolean indicating whether the value is an SV. It also tells +Returns a U32 value indicating whether the value is an SV. It also tells whether the value is defined or not. - bool SvOK(SV* sv) + U32 SvOK(SV* sv) =for hackers Found in file sv.h @@ -4084,12 +4084,12 @@ Found in file sv.h =item SvOOK X -Returns a boolean indicating whether the SvIVX is a valid offset value for +Returns a U32 indicating whether the SvIVX is a valid offset value for the SvPVX. This hack is used internally to speed up removal of characters from the beginning of a SvPV. When SvOOK is true, then the start of the allocated string buffer is really (SvPVX - SvIVX). - bool SvOOK(SV* sv) + U32 SvOOK(SV* sv) =for hackers Found in file sv.h @@ -4097,10 +4097,10 @@ Found in file sv.h =item SvPOK X -Returns a boolean indicating whether the SV contains a character +Returns a U32 value indicating whether the SV contains a character string. - bool SvPOK(SV* sv) + U32 SvPOK(SV* sv) =for hackers Found in file sv.h @@ -4108,10 +4108,10 @@ Found in file sv.h =item SvPOKp X -Returns a boolean indicating whether the SV contains a character string. +Returns a U32 value indicating whether the SV contains a character string. Checks the B setting. Use C. - bool SvPOKp(SV* sv) + U32 SvPOKp(SV* sv) =for hackers Found in file sv.h @@ -4478,7 +4478,7 @@ X Tests if the SV is an RV. - bool SvROK(SV* sv) + U32 SvROK(SV* sv) =for hackers Found in file sv.h @@ -4615,7 +4615,7 @@ X Returns a boolean indicating whether the SV contains an unsigned integer. - void SvUOK(SV* sv) + bool SvUOK(SV* sv) =for hackers Found in file sv.h @@ -4634,11 +4634,11 @@ Found in file sv.h =item SvUTF8 X -Returns a boolean indicating whether the SV contains UTF-8 encoded data. +Returns a U32 value indicating whether the SV contains UTF-8 encoded data. Call this after SvPV() in case any call to string overloading updates the internal flag. - bool SvUTF8(SV* sv) + U32 SvUTF8(SV* sv) =for hackers Found in file sv.h diff --git a/sv.h b/sv.h index b2cc8f4..276144d 100644 --- a/sv.h +++ b/sv.h @@ -759,35 +759,35 @@ struct xpvio { /* The following macros define implementation-independent predicates on SVs. */ /* -=for apidoc Am|bool|SvNIOK|SV* sv -Returns a boolean indicating whether the SV contains a number, integer or +=for apidoc Am|U32|SvNIOK|SV* sv +Returns a U32 value indicating whether the SV contains a number, integer or double. -=for apidoc Am|bool|SvNIOKp|SV* sv -Returns a boolean indicating whether the SV contains a number, integer or +=for apidoc Am|U32|SvNIOKp|SV* sv +Returns a U32 value indicating whether the SV contains a number, integer or double. Checks the B setting. Use C. =for apidoc Am|void|SvNIOK_off|SV* sv Unsets the NV/IV status of an SV. -=for apidoc Am|bool|SvOK|SV* sv -Returns a boolean indicating whether the value is an SV. It also tells +=for apidoc Am|U32|SvOK|SV* sv +Returns a U32 value indicating whether the value is an SV. It also tells whether the value is defined or not. -=for apidoc Am|bool|SvIOKp|SV* sv -Returns a boolean indicating whether the SV contains an integer. Checks +=for apidoc Am|U32|SvIOKp|SV* sv +Returns a U32 value indicating whether the SV contains an integer. Checks the B setting. Use C. -=for apidoc Am|bool|SvNOKp|SV* sv -Returns a boolean indicating whether the SV contains a double. Checks the +=for apidoc Am|U32|SvNOKp|SV* sv +Returns a U32 value indicating whether the SV contains a double. Checks the B setting. Use C. -=for apidoc Am|bool|SvPOKp|SV* sv -Returns a boolean indicating whether the SV contains a character string. +=for apidoc Am|U32|SvPOKp|SV* sv +Returns a U32 value indicating whether the SV contains a character string. Checks the B setting. Use C. -=for apidoc Am|bool|SvIOK|SV* sv -Returns a boolean indicating whether the SV contains an integer. +=for apidoc Am|U32|SvIOK|SV* sv +Returns a U32 value indicating whether the SV contains an integer. =for apidoc Am|void|SvIOK_on|SV* sv Tells an SV that it is an integer. @@ -804,14 +804,14 @@ Tells and SV that it is an unsigned integer and disables all other OK bits. =for apidoc Am|bool|SvIOK_UV|SV* sv Returns a boolean indicating whether the SV contains an unsigned integer. -=for apidoc Am|void|SvUOK|SV* sv +=for apidoc Am|bool|SvUOK|SV* sv Returns a boolean indicating whether the SV contains an unsigned integer. =for apidoc Am|bool|SvIOK_notUV|SV* sv Returns a boolean indicating whether the SV contains a signed integer. -=for apidoc Am|bool|SvNOK|SV* sv -Returns a boolean indicating whether the SV contains a double. +=for apidoc Am|U32|SvNOK|SV* sv +Returns a U32 value indicating whether the SV contains a double. =for apidoc Am|void|SvNOK_on|SV* sv Tells an SV that it is a double. @@ -822,8 +822,8 @@ Unsets the NV status of an SV. =for apidoc Am|void|SvNOK_only|SV* sv Tells an SV that it is a double and disables all other OK bits. -=for apidoc Am|bool|SvPOK|SV* sv -Returns a boolean indicating whether the SV contains a character +=for apidoc Am|U32|SvPOK|SV* sv +Returns a U32 value indicating whether the SV contains a character string. =for apidoc Am|void|SvPOK_on|SV* sv @@ -839,13 +839,13 @@ Will also turn off the UTF-8 status. =for apidoc Am|bool|SvVOK|SV* sv Returns a boolean indicating whether the SV contains a v-string. -=for apidoc Am|bool|SvOOK|SV* sv -Returns a boolean indicating whether the SvIVX is a valid offset value for +=for apidoc Am|U32|SvOOK|SV* sv +Returns a U32 indicating whether the SvIVX is a valid offset value for the SvPVX. This hack is used internally to speed up removal of characters from the beginning of a SvPV. When SvOOK is true, then the start of the allocated string buffer is really (SvPVX - SvIVX). -=for apidoc Am|bool|SvROK|SV* sv +=for apidoc Am|U32|SvROK|SV* sv Tests if the SV is an RV. =for apidoc Am|void|SvROK_on|SV* sv @@ -983,8 +983,8 @@ Set the actual length of the string which is in the SV. See C. SvFLAGS(sv) |= (SVf_NOK|SVp_NOK)) /* -=for apidoc Am|bool|SvUTF8|SV* sv -Returns a boolean indicating whether the SV contains UTF-8 encoded data. +=for apidoc Am|U32|SvUTF8|SV* sv +Returns a U32 value indicating whether the SV contains UTF-8 encoded data. Call this after SvPV() in case any call to string overloading updates the internal flag.