Skip to content

Commit dbffe00

Browse files
committed
perlapi: Combine all forms of Sv[INU] into one entry each
This makes perlapi more compact, and at the same time, easier for readers to compare them and decide which is best suited for their purposes.
1 parent ea3c376 commit dbffe00

File tree

2 files changed

+62
-57
lines changed

2 files changed

+62
-57
lines changed

sv.h

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -886,21 +886,6 @@ Unsets the RV status of an SV.
886886
=for apidoc Am|SV*|SvRV|SV* sv
887887
Dereferences an RV to return the SV.
888888
889-
=for apidoc Am|IV|SvIVX|SV* sv
890-
Returns the raw value in the SV's IV slot, without checks or conversions.
891-
Only use when you are sure C<SvIOK> is true. See also C<L</SvIV>>.
892-
893-
=for apidoc Am|UV|SvUVX|SV* sv
894-
Returns the raw value in the SV's UV slot, without checks or conversions.
895-
Only use when you are sure C<SvUOK> is true. See also C<L</SvUV>>.
896-
897-
=for apidoc AmD|UV|SvUVXx|SV* sv
898-
This is an unnecessary synonym for L</SvUVX>
899-
900-
=for apidoc Am|NV|SvNVX|SV* sv
901-
Returns the raw value in the SV's NV slot, without checks or conversions.
902-
Only use when you are sure C<SvNOK> is true. See also C<L</SvNV>>.
903-
904889
=for apidoc Am |char* |SvPVX|SV* sv
905890
=for apidoc_item |const char*|SvPVX_const|SV* sv
906891
=for apidoc_item |char* |SvPVX_mutable|SV* sv

sv_inline.h

Lines changed: 62 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -770,48 +770,68 @@ Perl_SvPADSTALE_off(SV *sv)
770770

771771
/*
772772
=for apidoc_section $SV
773-
=for apidoc SvIV
774-
=for apidoc_item SvIV_nomg
775-
=for apidoc_item m||SvIVx
776-
777-
These each coerce the given SV to IV and return it. The returned value in many
778-
circumstances will get stored in C<sv>'s IV slot, but not in all cases. (Use
779-
C<L</sv_setiv>> to make sure it does).
780-
781-
As of 5.37.1, all are guaranteed to evaluate C<sv> only once.
782-
783-
C<SvIVx> is now identical to C<SvIV>, but prior to 5.37.1, it was the only form
784-
guaranteed to evaluate C<sv> only once.
785-
786-
C<SvIV_nomg> is the same as C<SvIV>, but does not perform 'get' magic.
787-
788-
=for apidoc SvNV
789-
=for apidoc_item SvNV_nomg
790-
=for apidoc_item m||SvNVx
791-
792-
These each coerce the given SV to NV and return it. The returned value in many
793-
circumstances will get stored in C<sv>'s NV slot, but not in all cases. (Use
794-
C<L</sv_setnv>> to make sure it does).
795-
796-
As of 5.37.1, all are guaranteed to evaluate C<sv> only once.
797-
798-
C<SvNVx> is now identical to C<SvNV>, but prior to 5.37.1, it was the only form
799-
guaranteed to evaluate C<sv> only once.
800-
801-
C<SvNV_nomg> is the same as C<SvNV>, but does not perform 'get' magic.
802-
803-
=for apidoc SvUV
804-
=for apidoc_item SvUV_nomg
805-
=for apidoc_item m||SvUVx
806-
807-
These each coerce the given SV to UV and return it. The returned value in many
808-
circumstances will get stored in C<sv>'s UV slot, but not in all cases. (Use
809-
C<L</sv_setuv>> to make sure it does).
810-
811-
As of 5.37.1, all are guaranteed to evaluate C<sv> only once.
812-
813-
C<SvUVx> is now identical to C<SvUV>, but prior to 5.37.1, it was the only form
814-
guaranteed to evaluate C<sv> only once.
773+
=for apidoc SvIV
774+
=for apidoc_item SvIV_nomg
775+
=for apidoc_item m||SvIVx
776+
=for apidoc_item m||SvIVX
777+
=for apidoc_item mD||SvIVXx
778+
779+
These each return the IV contained in the given SV.
780+
781+
C<SvIVX> returns the raw value in the SV's IV slot, without checks or
782+
conversions. Only use when you are sure C<SvIOK> is true.
783+
C<SvIVXx> is a deprecated synonym for C<SvIVX>.
784+
785+
In the other forms, conversions may be performed to yield a IV. The returned
786+
value in many circumstances will get stored in C<sv>'s IV slot, but not in all
787+
cases. (Use C<L</sv_setiv>> to make sure it does).
788+
All forms except C<SvIVX> now behave identically, except C<SvIV_nomg> does not
789+
perform 'get_magic'.
790+
791+
As of 5.37.1, all are guaranteed to evaluate C<sv> only once. (Prior to
792+
5.37.1, C<SvIVx> was the only form guaranteed to evaluate C<sv> only once.)
793+
794+
=for apidoc SvNV
795+
=for apidoc_item SvNV_nomg
796+
=for apidoc_item m ||SvNVx
797+
=for apidoc_item m ||SvNVX
798+
=for apidoc_item mD||SvNVXx
799+
800+
These each return the NV contained in the given SV.
801+
802+
C<SvNVX> returns the raw value in the SV's NV slot, without checks or
803+
conversions. Only use when you are sure C<SvNOK> is true.
804+
C<SvNVXx> is a deprecated synonym for C<SvNVX>.
805+
806+
In the other forms, conversions may be performed to yield a NV. The returned
807+
value in many circumstances will get stored in C<sv>'s NV slot, but not in all
808+
cases. (Use C<L</sv_setnv>> to make sure it does).
809+
All forms except C<SvNVX> now behave identically, except C<SvNV_nomg> does not
810+
perform 'get_magic'.
811+
812+
As of 5.37.1, all are guaranteed to evaluate C<sv> only once. (Prior to
813+
5.37.1, C<SvNVx> was the only form guaranteed to evaluate C<sv> only once.)
814+
815+
=for apidoc SvUV
816+
=for apidoc_item SvUV_nomg
817+
=for apidoc_item m||SvUVx
818+
=for apidoc_item m||SvUVX
819+
=for apidoc_item mD||SvUVXx
820+
821+
These each return the UV contained in the given SV.
822+
823+
C<SvUVX> returns the raw value in the SV's UV slot, without checks or
824+
conversions. Only use when you are sure C<SvIOK> is true.
825+
C<SvUVXx> is a deprecated synonym for C<SvUVX>.
826+
827+
In the other forms, conversions may be performed to yield a UV. The returned
828+
value in many circumstances will get stored in C<sv>'s UV slot, but not in all
829+
cases. (Use C<L</sv_setuv>> to make sure it does).
830+
All forms except C<SvUVX> now behave identically, except C<SvUV_nomg> does not
831+
perform 'get_magic'.
832+
833+
As of 5.37.1, all are guaranteed to evaluate C<sv> only once. (Prior to
834+
5.37.1, C<SvUVx> was the only form guaranteed to evaluate C<sv> only once.)
815835
816836
=cut
817837
*/

0 commit comments

Comments
 (0)