| 1 |
Description: Use INT2PTR to map objects to Cyrus SASL pointers |
| 2 |
Author: Russ Allbery <[email protected]> |
| 3 |
Reviewed-by: gregor herrmann <[email protected]> |
| 4 |
Last-Update: 2023-10-25 |
| 5 |
|
| 6 |
Rather than directly casting the IV to the target pointer, use |
| 7 |
Perl's standard INT2PTR macro. This shouldn't change the resulting |
| 8 |
code, but it will suppress build warnings and make it easier to |
| 9 |
spot real build issues. |
| 10 |
|
| 11 |
Note: |
| 12 |
(libauthen-sasl-xs-perl is the successor of libauthen-sasl-cyrus-perl) |
| 13 |
[gregor 2023-10-25] |
| 14 |
|
| 15 |
--- a/typemap |
| 16 |
+++ b/typemap |
| 17 |
@@ -6,7 +6,7 @@ |
| 18 |
T_PTROBJ_SPECIAL |
| 19 |
if (sv_derived_from($arg, \"${(my $ntt=$ntype)=~s/_/::/g; \$ntt}\")) { |
| 20 |
IV tmp = SvIV((SV*)SvRV($arg)); |
| 21 |
- $var = ($type) tmp; |
| 22 |
+ $var = INT2PTR($type, tmp); |
| 23 |
} |
| 24 |
else |
| 25 |
croak(\"$var is not of type ${(my $ntt=$ntype)=~s /_/::/g;\$ntt}\") |