This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix various compiler warnings from XS code
[perl5.git] / dist / ExtUtils-ParseXS / t / XSMore.xs
CommitLineData
28892255
DG
1#include "EXTERN.h"
2#include "perl.h"
3#include "XSUB.h"
4
5=for testing
6
7This parts are ignored.
8
9=cut
10
11STATIC void
12outlist(int* a, int* b){
13 *a = 'a';
14 *b = 'b';
15}
16
17STATIC int
18len(const char* const s, int const l){
c33e8be1 19 PERL_UNUSED_ARG(s);
28892255
DG
20 return l;
21}
22
23MODULE = XSMore PACKAGE = XSMore
24
25=for testing
26
27This parts are also ignored.
28
29=cut
30
31PROTOTYPES: ENABLE
32
33VERSIONCHECK: DISABLE
34
35REQUIRE: 2.20
36
37SCOPE: DISABLE
38
39FALLBACK: TRUE
40
41BOOT:
42 sv_setiv(get_sv("XSMore::boot_ok", TRUE), 100);
43
44
45void
46prototype_ssa()
47PROTOTYPE: $$@
48CODE:
49 NOOP;
50
51void
52attr_method(self, ...)
53ATTRS: method
54CODE:
55 NOOP;
56
57#define RET_1 1
58#define RET_2 2
59
60int
61return_1()
62CASE: ix == 1
63 ALIAS:
64 return_1 = RET_1
65 return_2 = RET_2
66 CODE:
67 RETVAL = ix;
68 OUTPUT:
69 RETVAL
70CASE: ix == 2
71 CODE:
72 RETVAL = ix;
73 OUTPUT:
74 RETVAL
75
76int
77arg_init(x)
78 int x = SvIV($arg);
79CODE:
80 RETVAL = x;
81OUTPUT:
82 RETVAL
83
84int
85myabs(...)
86OVERLOAD: abs
87CODE:
c33e8be1 88 PERL_UNUSED_VAR(items);
28892255
DG
89 RETVAL = 42;
90OUTPUT:
91 RETVAL
92
93void
94hook(IN AV* av)
95INIT:
96 av_push(av, newSVpv("INIT", 0));
97CODE:
98 av_push(av, newSVpv("CODE", 0));
99POSTCALL:
100 av_push(av, newSVpv("POSTCALL", 0));
101CLEANUP:
102 av_push(av, newSVpv("CLEANUP", 0));
103
104
105void
106outlist(OUTLIST int a, OUTLIST int b)
107
108int
109len(char* s, int length(s))
110
387b6f8d
SM
111INCLUDE_COMMAND: $^X -Ilib -It/lib -MIncludeTester -e IncludeTester::print_xs
112
28892255
DG
113#if 1
114
115INCLUDE: XSInclude.xsh
116
117#else
118
119# for testing #else directive
120
121#endif