File: use-int2ptr

package info (click to toggle)
libauthen-sasl-cyrus-perl 0.13-server-10
  • links: PTS, VCS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, stretch
  • size: 348 kB
  • ctags: 43
  • sloc: perl: 241; makefile: 13
file content (19 lines) | stat: -rw-r--r-- 681 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
Author: Russ Allbery <rra@debian.org>
Description: Use INT2PTR to map objects to Cyrus SASL pointers

Rather than directly casting the IV to the target pointer, use
Perl's standard INT2PTR macro.  This shouldn't change the resulting
code, but it will suppress build warnings and make it easier to
spot real build issues.

--- libauthen-sasl-cyrus-perl.orig/typemap
+++ libauthen-sasl-cyrus-perl/typemap
@@ -6,7 +6,7 @@
 T_PTROBJ_SPECIAL
 	if (sv_derived_from($arg, \"${(my $ntt=$ntype)=~s/_/::/g; \$ntt}\")) {
 		IV tmp = SvIV((SV*)SvRV($arg));
-		$var = ($type) tmp;
+		$var = INT2PTR($type, tmp);
 	}
 	else
 		croak(\"$var is not of type ${(my $ntt=$ntype)=~s /_/::/g;\$ntt}\")