[svn:parrot] r36176 - in trunk: . config/auto config/auto/env config/auto/inline config/auto/jit config/auto/memalign config/auto/signal config/auto/snprintf
fperrad at svn.parrot.org
fperrad at svn.parrot.org
Fri Jan 30 17:53:14 UTC 2009
Author: fperrad
Date: Fri Jan 30 17:53:12 2009
New Revision: 36176
URL: https://trac.parrot.org/parrot/changeset/36176
Log:
[configure] rename some C templates & fix coding standard
Added:
trunk/config/auto/env/test_setenv_c.in
- copied, changed from r36168, trunk/config/auto/env/test_setenv.in
trunk/config/auto/env/test_unsetenv_c.in
- copied, changed from r36168, trunk/config/auto/env/test_unsetenv.in
trunk/config/auto/inline/test1_c.in
- copied, changed from r36168, trunk/config/auto/inline/test_1.in
trunk/config/auto/inline/test2_c.in
- copied, changed from r36168, trunk/config/auto/inline/test_2.in
trunk/config/auto/jit/test_exec_cygwin_c.in
- copied, changed from r36168, trunk/config/auto/jit/test_exec_cygwin.in
trunk/config/auto/jit/test_exec_linux_c.in
- copied, changed from r36168, trunk/config/auto/jit/test_exec_linux.in
trunk/config/auto/jit/test_exec_openbsd_c.in
- copied, changed from r36168, trunk/config/auto/jit/test_exec_openbsd.in
trunk/config/auto/memalign/test2_c.in
- copied, changed from r36168, trunk/config/auto/memalign/test_c2.in
trunk/config/auto/signal/test1_c.in
- copied, changed from r36168, trunk/config/auto/signal/test_1.in
trunk/config/auto/signal/test2_c.in
- copied, changed from r36168, trunk/config/auto/signal/test_2.in
trunk/config/auto/signal/test_itimer_c.in
- copied, changed from r36168, trunk/config/auto/signal/test_itimer.in
trunk/config/auto/snprintf/test_c.in
- copied, changed from r36168, trunk/config/auto/snprintf/test.in
Deleted:
trunk/config/auto/env/test_setenv.in
trunk/config/auto/env/test_unsetenv.in
trunk/config/auto/inline/test_1.in
trunk/config/auto/inline/test_2.in
trunk/config/auto/jit/test_exec_cygwin.in
trunk/config/auto/jit/test_exec_linux.in
trunk/config/auto/jit/test_exec_openbsd.in
trunk/config/auto/memalign/test_c2.in
trunk/config/auto/signal/test_1.in
trunk/config/auto/signal/test_2.in
trunk/config/auto/signal/test_itimer.in
trunk/config/auto/snprintf/test.in
Modified:
trunk/MANIFEST
trunk/MANIFEST.SKIP
trunk/config/auto/env.pm
trunk/config/auto/inline.pm
trunk/config/auto/jit.pm
trunk/config/auto/memalign.pm
trunk/config/auto/signal.pm
trunk/config/auto/snprintf.pm
Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST Fri Jan 30 17:15:19 2009 (r36175)
+++ trunk/MANIFEST Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,7 +1,7 @@
# ex: set ro:
# $Id$
#
-# generated by tools/dev/mk_manifest_and_skip.pl Thu Jan 29 01:00:00 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Jan 30 14:36:00 2009 UT
#
# See tools/dev/install_files.pl for documentation on the
# format of this file.
@@ -234,8 +234,8 @@
config/auto/crypto/crypto.in []
config/auto/ctags.pm []
config/auto/env.pm []
-config/auto/env/test_setenv.in []
-config/auto/env/test_unsetenv.in []
+config/auto/env/test_setenv_c.in []
+config/auto/env/test_unsetenv_c.in []
config/auto/fink.pm []
config/auto/format.pm []
config/auto/format/floatval_maxmin.in []
@@ -258,19 +258,19 @@
config/auto/headers/test_c.in []
config/auto/icu.pm []
config/auto/inline.pm []
-config/auto/inline/test_1.in []
-config/auto/inline/test_2.in []
+config/auto/inline/test1_c.in []
+config/auto/inline/test2_c.in []
config/auto/isreg.pm []
config/auto/isreg/test_c.in []
config/auto/jit.pm []
config/auto/jit/test_c.in []
-config/auto/jit/test_exec_cygwin.in []
-config/auto/jit/test_exec_linux.in []
-config/auto/jit/test_exec_openbsd.in []
+config/auto/jit/test_exec_cygwin_c.in []
+config/auto/jit/test_exec_linux_c.in []
+config/auto/jit/test_exec_openbsd_c.in []
config/auto/macports.pm []
config/auto/memalign.pm []
+config/auto/memalign/test2_c.in []
config/auto/memalign/test_c.in []
-config/auto/memalign/test_c2.in []
config/auto/msvc.pm []
config/auto/msvc/test_c.in []
config/auto/opengl.pm []
@@ -285,15 +285,15 @@
config/auto/readline/readline.in []
config/auto/revision.pm []
config/auto/signal.pm []
-config/auto/signal/test_1.in []
-config/auto/signal/test_2.in []
-config/auto/signal/test_itimer.in []
+config/auto/signal/test1_c.in []
+config/auto/signal/test2_c.in []
+config/auto/signal/test_itimer_c.in []
config/auto/sizes.pm []
config/auto/sizes/test2_c.in []
config/auto/sizes/test3_c.in []
config/auto/sizes/test_c.in []
config/auto/snprintf.pm []
-config/auto/snprintf/test.in []
+config/auto/snprintf/test_c.in []
config/auto/socklen_t.pm []
config/auto/va_ptr.pm []
config/auto/va_ptr/test_c.in []
@@ -2971,6 +2971,7 @@
t/codingstd/fixme.t []
t/codingstd/gmt_utc.t []
t/codingstd/linelength.t []
+t/codingstd/make_code_coda.t []
t/codingstd/pccmethod_deps.t []
t/codingstd/pdd_format.t []
t/codingstd/perlcritic.t []
Modified: trunk/MANIFEST.SKIP
==============================================================================
--- trunk/MANIFEST.SKIP Fri Jan 30 17:15:19 2009 (r36175)
+++ trunk/MANIFEST.SKIP Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,6 +1,6 @@
# ex: set ro:
-# $Id: MANIFEST.SKIP 36083 2009-01-28 08:13:34Z fperrad $
-# generated by tools/dev/mk_manifest_and_skip.pl Wed Jan 28 08:02:55 2009 UT
+# $Id$
+# generated by tools/dev/mk_manifest_and_skip.pl Fri Jan 30 14:36:00 2009 UT
#
# This file should contain a transcript of the svn:ignore properties
# of the directories in the Parrot subversion repository. (Needed for
@@ -403,6 +403,8 @@
^languages/gil/
^languages/hq9plus$
^languages/hq9plus/
+^languages/kea-cl$
+^languages/kea-cl/
^languages/languages_smoke\.html$
^languages/languages_smoke\.html/
^languages/lazy-k$
@@ -411,6 +413,8 @@
^languages/m4/
^languages/markdown$
^languages/markdown/
+^languages/perk$
+^languages/perk/
^languages/pjs$
^languages/pjs/
^languages/primitivearc$
Modified: trunk/config/auto/env.pm
==============================================================================
--- trunk/config/auto/env.pm Fri Jan 30 17:15:19 2009 (r36175)
+++ trunk/config/auto/env.pm Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2003, The Perl Foundation.
+# Copyright (C) 2001-2009, The Perl Foundation.
# $Id$
=head1 NAME
@@ -37,13 +37,13 @@
my ( $setenv, $unsetenv ) = ( 0, 0 );
- $conf->cc_gen('config/auto/env/test_setenv.in');
+ $conf->cc_gen('config/auto/env/test_setenv_c.in');
eval { $conf->cc_build(); };
unless ( $@ || $conf->cc_run() !~ /ok/ ) {
$setenv = 1;
}
$conf->cc_clean();
- $conf->cc_gen('config/auto/env/test_unsetenv.in');
+ $conf->cc_gen('config/auto/env/test_unsetenv_c.in');
eval { $conf->cc_build(); };
unless ( $@ || $conf->cc_run() !~ /ok/ ) {
$unsetenv = 1;
Deleted: trunk/config/auto/env/test_setenv.in
==============================================================================
--- trunk/config/auto/env/test_setenv.in Fri Jan 30 17:53:12 2009 (r36175)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,17 +0,0 @@
-/*
- * test for setenv
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int main(int argc, char **argv) {
- if (setenv("PARROT_TEST", "flaf", 1)) {
- puts("borken");
- } else {
- puts("ok");
- }
-
- return 0;
-}
Copied and modified: trunk/config/auto/env/test_setenv_c.in (from r36168, trunk/config/auto/env/test_setenv.in)
==============================================================================
--- trunk/config/auto/env/test_setenv.in Fri Jan 30 09:18:12 2009 (r36168, copy source)
+++ trunk/config/auto/env/test_setenv_c.in Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,17 +1,28 @@
/*
- * test for setenv
- *
- */
+Copyright (C) 2003-2009, The Perl Foundation.
+$Id$
+
+test for setenv
+*/
#include <stdio.h>
#include <stdlib.h>
-int main(int argc, char **argv) {
+int main(int argc, char **argv)
+{
if (setenv("PARROT_TEST", "flaf", 1)) {
puts("borken");
- } else {
+ }
+ else {
puts("ok");
}
return 0;
}
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Deleted: trunk/config/auto/env/test_unsetenv.in
==============================================================================
--- trunk/config/auto/env/test_unsetenv.in Fri Jan 30 17:53:12 2009 (r36175)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,16 +0,0 @@
-/*
- * test for unsetenv
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-
-int main(int argc, char **argv) {
-/* we have an hand-rolled unsetenv */
-#ifndef WIN32
- unsetenv("PARROT_TEST");
-#endif
- puts("ok");
- return 0;
-}
Copied and modified: trunk/config/auto/env/test_unsetenv_c.in (from r36168, trunk/config/auto/env/test_unsetenv.in)
==============================================================================
--- trunk/config/auto/env/test_unsetenv.in Fri Jan 30 09:18:12 2009 (r36168, copy source)
+++ trunk/config/auto/env/test_unsetenv_c.in Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,12 +1,16 @@
/*
- * test for unsetenv
- *
- */
+Copyright (C) 2003-2009, The Perl Foundation.
+$Id$
+
+test for unsetenv
+
+*/
#include <stdio.h>
#include <stdlib.h>
-int main(int argc, char **argv) {
+int main(int argc, char **argv)
+{
/* we have an hand-rolled unsetenv */
#ifndef WIN32
unsetenv("PARROT_TEST");
@@ -14,3 +18,10 @@
puts("ok");
return 0;
}
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Modified: trunk/config/auto/inline.pm
==============================================================================
--- trunk/config/auto/inline.pm Fri Jan 30 17:15:19 2009 (r36175)
+++ trunk/config/auto/inline.pm Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2003, The Perl Foundation.
+# Copyright (C) 2001-2009, The Perl Foundation.
# $Id$
=head1 NAME
@@ -51,7 +51,7 @@
my $self = shift;
my $conf = shift;
my $test;
- $conf->cc_gen('config/auto/inline/test_1.in');
+ $conf->cc_gen('config/auto/inline/test1_c.in');
eval { $conf->cc_build(); };
if ( !$@ ) {
$test = $conf->cc_run();
@@ -66,7 +66,7 @@
my $conf = shift;
my $test = shift;
if ( !$test ) {
- $conf->cc_gen('config/auto/inline/test_2.in');
+ $conf->cc_gen('config/auto/inline/test2_c.in');
eval { $conf->cc_build(); };
if ( !$@ ) {
$test = $conf->cc_run();
Copied and modified: trunk/config/auto/inline/test1_c.in (from r36168, trunk/config/auto/inline/test_1.in)
==============================================================================
--- trunk/config/auto/inline/test_1.in Fri Jan 30 09:18:12 2009 (r36168, copy source)
+++ trunk/config/auto/inline/test1_c.in Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,14 +1,25 @@
/*
- * test to check if compiler supports inline
- */
+Copyright (C) 2003-2009, The Perl Foundation.
+$Id$
+
+test to check if compiler supports inline
+*/
#include <stdio.h>
+
inline f(void) {
- puts("inline");
+ puts("inline");
}
-int main() {
- f();
- return 0;
+int
+main() {
+ f();
+ return 0;
}
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Copied and modified: trunk/config/auto/inline/test2_c.in (from r36168, trunk/config/auto/inline/test_2.in)
==============================================================================
--- trunk/config/auto/inline/test_2.in Fri Jan 30 09:18:12 2009 (r36168, copy source)
+++ trunk/config/auto/inline/test2_c.in Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,14 +1,25 @@
/*
- * test to check if compiler supports __inline
- */
+Copyright (C) 2003-2009, The Perl Foundation.
+$Id$
+
+test to check if compiler supports __inline
+*/
#include <stdio.h>
+
__inline f(void) {
- puts("__inline");
+ puts("__inline");
}
-int main() {
- f();
- return 0;
+int
+main() {
+ f();
+ return 0;
}
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Deleted: trunk/config/auto/inline/test_1.in
==============================================================================
--- trunk/config/auto/inline/test_1.in Fri Jan 30 17:53:12 2009 (r36175)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,14 +0,0 @@
-/*
- * test to check if compiler supports inline
- */
-
-#include <stdio.h>
-inline f(void) {
- puts("inline");
-}
-
-int main() {
- f();
- return 0;
-}
-
Deleted: trunk/config/auto/inline/test_2.in
==============================================================================
--- trunk/config/auto/inline/test_2.in Fri Jan 30 17:53:12 2009 (r36175)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,14 +0,0 @@
-/*
- * test to check if compiler supports __inline
- */
-
-#include <stdio.h>
-__inline f(void) {
- puts("__inline");
-}
-
-int main() {
- f();
- return 0;
-}
-
Modified: trunk/config/auto/jit.pm
==============================================================================
--- trunk/config/auto/jit.pm Fri Jan 30 17:15:19 2009 (r36175)
+++ trunk/config/auto/jit.pm Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2008, The Perl Foundation.
+# Copyright (C) 2001-2009, The Perl Foundation.
# $Id$
=head1 NAME
@@ -115,7 +115,7 @@
# test for executable malloced memory
if ( -e "config/auto/jit/test_exec_$osname.in" ) {
print " (has_exec_protect " if $verbose;
- $conf->cc_gen("config/auto/jit/test_exec_$osname.in");
+ $conf->cc_gen("config/auto/jit/test_exec_${osname}_c.in");
eval { $conf->cc_build(); };
if ($@) {
print " $@) " if $verbose;
Deleted: trunk/config/auto/jit/test_exec_cygwin.in
==============================================================================
--- trunk/config/auto/jit/test_exec_cygwin.in Fri Jan 30 17:53:12 2009 (r36175)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,63 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <limits.h>
-#include <errno.h>
-#include <malloc.h>
-#include <unistd.h>
-#include <string.h>
-#ifndef PAGE_SIZE
-# define PAGE_SIZE getpagesize()
-#endif
-#
-/* test for exec privs */
-
-/*
- * c equiv:
- int t() {
- return 1;
-}
-*/
-
-char code[] = {
- 0xB8,0x01,0,0,0, /* movl $1, %eax */
- 0xC3 /* ret */
-};
-
-typedef int (*pf)(void);
-
-int main(int argc, char *argv[])
-{
- pf t;
- char *p;
- int rc;
- int prot = PROT_READ;
-
- if (argc != 2) {
- fprintf(stderr, "usage: test 0 | 1\n");
- exit(1);
- }
-
- if (atoi(argv[1]))
- prot |= PROT_EXEC;
-
- p = memalign(PAGE_SIZE, PAGE_SIZE);
- memcpy(p, code, sizeof(code));
-
- t = (pf) p;
- rc = mprotect(p, PAGE_SIZE, prot);
-
- if (rc) {
- fprintf(stderr, "p = %p PAGE_SIZE = %d (0x%x)\n", p,
- PAGE_SIZE, PAGE_SIZE);
- perror("failure");
- }
-
- if (t() == 1)
- puts("ok");
-
- else
- return 1;
-
- return 0;
-}
Copied and modified: trunk/config/auto/jit/test_exec_cygwin_c.in (from r36168, trunk/config/auto/jit/test_exec_cygwin.in)
==============================================================================
--- trunk/config/auto/jit/test_exec_cygwin.in Fri Jan 30 09:18:12 2009 (r36168, copy source)
+++ trunk/config/auto/jit/test_exec_cygwin_c.in Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,3 +1,10 @@
+/*
+Copyright (C) 2008-2009, The Perl Foundation.
+$Id$
+
+test for exec privs
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
@@ -10,7 +17,6 @@
# define PAGE_SIZE getpagesize()
#endif
#
-/* test for exec privs */
/*
* c equiv:
@@ -20,13 +26,14 @@
*/
char code[] = {
- 0xB8,0x01,0,0,0, /* movl $1, %eax */
- 0xC3 /* ret */
+ 0xB8, 0x01, 0, 0, 0, /* movl $1, %eax */
+ 0xC3 /* ret */
};
typedef int (*pf)(void);
-int main(int argc, char *argv[])
+int
+main(int argc, char *argv[])
{
pf t;
char *p;
@@ -42,7 +49,7 @@
prot |= PROT_EXEC;
p = memalign(PAGE_SIZE, PAGE_SIZE);
- memcpy(p, code, sizeof(code));
+ memcpy(p, code, sizeof (code));
t = (pf) p;
rc = mprotect(p, PAGE_SIZE, prot);
@@ -55,9 +62,15 @@
if (t() == 1)
puts("ok");
-
else
return 1;
return 0;
}
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Deleted: trunk/config/auto/jit/test_exec_linux.in
==============================================================================
--- trunk/config/auto/jit/test_exec_linux.in Fri Jan 30 17:53:12 2009 (r36175)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,60 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <limits.h>
-#include <errno.h>
-#include <malloc.h>
-#include <unistd.h>
-#ifndef PAGE_SIZE
-# define PAGE_SIZE getpagesize()
-#endif
-/*
- * test for exec privs
- */
-
-/*
- * c equiv:
- int t() {
- return 1;
-}
-*/
-
-char code[] = {
- 0xB8,0x01,0,0,0, /* movl $1, %eax */
- 0xC3 /* ret */
-};
-
-typedef int (*pf)(void);
-
-int main(int argc, char *argv[])
-{
- pf t;
- char *p;
- int rc;
- int prot = PROT_READ;
-
- if (argc != 2) {
- fprintf(stderr, "usage: test 0 | 1\n");
- exit(1);
- }
- if (atoi(argv[1]))
- prot |= PROT_EXEC;
-
- p = memalign(PAGE_SIZE, sizeof(code));
- memcpy(p, code, sizeof(code));
- t = (pf) p;
- rc = mprotect(p, PAGE_SIZE, prot);
- if (rc) {
- fprintf(stderr, "p = %p PAGE_SIZE = %d (0x%x)\n", p,
- PAGE_SIZE, PAGE_SIZE);
- perror("failure");
- }
-
- if (t() == 1)
- puts("ok");
- else
- return 1;
- return 0;
-}
-
-
Copied and modified: trunk/config/auto/jit/test_exec_linux_c.in (from r36168, trunk/config/auto/jit/test_exec_linux.in)
==============================================================================
--- trunk/config/auto/jit/test_exec_linux.in Fri Jan 30 09:18:12 2009 (r36168, copy source)
+++ trunk/config/auto/jit/test_exec_linux_c.in Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,3 +1,10 @@
+/*
+Copyright (C) 2004-2009, The Perl Foundation.
+$Id$
+
+test for exec privs
+ */
+
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
@@ -8,9 +15,6 @@
#ifndef PAGE_SIZE
# define PAGE_SIZE getpagesize()
#endif
-/*
- * test for exec privs
- */
/*
* c equiv:
@@ -20,13 +24,14 @@
*/
char code[] = {
- 0xB8,0x01,0,0,0, /* movl $1, %eax */
- 0xC3 /* ret */
+ 0xB8, 0x01, 0, 0, 0, /* movl $1, %eax */
+ 0xC3 /* ret */
};
typedef int (*pf)(void);
-int main(int argc, char *argv[])
+int
+main(int argc, char *argv[])
{
pf t;
char *p;
@@ -34,27 +39,33 @@
int prot = PROT_READ;
if (argc != 2) {
- fprintf(stderr, "usage: test 0 | 1\n");
- exit(1);
+ fprintf(stderr, "usage: test 0 | 1\n");
+ exit(1);
}
if (atoi(argv[1]))
- prot |= PROT_EXEC;
+ prot |= PROT_EXEC;
- p = memalign(PAGE_SIZE, sizeof(code));
- memcpy(p, code, sizeof(code));
+ p = memalign(PAGE_SIZE, sizeof (code));
+ memcpy(p, code, sizeof (code));
t = (pf) p;
rc = mprotect(p, PAGE_SIZE, prot);
if (rc) {
- fprintf(stderr, "p = %p PAGE_SIZE = %d (0x%x)\n", p,
- PAGE_SIZE, PAGE_SIZE);
- perror("failure");
+ fprintf(stderr, "p = %p PAGE_SIZE = %d (0x%x)\n", p,
+ PAGE_SIZE, PAGE_SIZE);
+ perror("failure");
}
if (t() == 1)
- puts("ok");
+ puts("ok");
else
- return 1;
+ return 1;
+
return 0;
}
-
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Deleted: trunk/config/auto/jit/test_exec_openbsd.in
==============================================================================
--- trunk/config/auto/jit/test_exec_openbsd.in Fri Jan 30 17:53:12 2009 (r36175)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,60 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/mman.h>
-#include <limits.h>
-#include <errno.h>
-#include <malloc.h>
-#include <unistd.h>
-#ifndef PAGE_SIZE
-# define PAGE_SIZE sysconf(_SC_PAGESIZE)
-#endif
-/*
- * test for exec privs
- */
-
-/*
- * c equiv:
- int t() {
- return 1;
-}
-*/
-
-char code[] = {
- 0xB8,0x01,0,0,0, /* movl $1, %eax */
- 0xC3 /* ret */
-};
-
-typedef int (*pf)(void);
-
-int main(int argc, char *argv[])
-{
- pf t;
- char *p;
- int rc;
- int prot = PROT_READ;
-
- if (argc != 2) {
- fprintf(stderr, "usage: test 0 | 1\n");
- exit(1);
- }
- if (atoi(argv[1]))
- prot |= PROT_EXEC;
-
- p = malloc(PAGE_SIZE);
- memcpy(p, code, sizeof(code));
- t = (pf) p;
- rc = mprotect(p, PAGE_SIZE, prot);
- if (rc) {
- fprintf(stderr, "p = %p PAGE_SIZE = %d (0x%x)\n", p,
- PAGE_SIZE, PAGE_SIZE);
- perror("failure");
- }
-
- if (t() == 1)
- puts("ok");
- else
- return 1;
- return 0;
-}
-
-
Copied and modified: trunk/config/auto/jit/test_exec_openbsd_c.in (from r36168, trunk/config/auto/jit/test_exec_openbsd.in)
==============================================================================
--- trunk/config/auto/jit/test_exec_openbsd.in Fri Jan 30 09:18:12 2009 (r36168, copy source)
+++ trunk/config/auto/jit/test_exec_openbsd_c.in Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,3 +1,10 @@
+/*
+Copyright (C) 2004-2009, The Perl Foundation.
+$Id$
+
+test for exec privs
+*/
+
#include <stdio.h>
#include <stdlib.h>
#include <sys/mman.h>
@@ -8,9 +15,6 @@
#ifndef PAGE_SIZE
# define PAGE_SIZE sysconf(_SC_PAGESIZE)
#endif
-/*
- * test for exec privs
- */
/*
* c equiv:
@@ -20,13 +24,14 @@
*/
char code[] = {
- 0xB8,0x01,0,0,0, /* movl $1, %eax */
- 0xC3 /* ret */
+ 0xB8, 0x01, 0, 0, 0, /* movl $1, %eax */
+ 0xC3 /* ret */
};
typedef int (*pf)(void);
-int main(int argc, char *argv[])
+int
+main(int argc, char *argv[])
{
pf t;
char *p;
@@ -34,27 +39,33 @@
int prot = PROT_READ;
if (argc != 2) {
- fprintf(stderr, "usage: test 0 | 1\n");
- exit(1);
+ fprintf(stderr, "usage: test 0 | 1\n");
+ exit(1);
}
if (atoi(argv[1]))
- prot |= PROT_EXEC;
+ prot |= PROT_EXEC;
p = malloc(PAGE_SIZE);
- memcpy(p, code, sizeof(code));
+ memcpy(p, code, sizeof (code));
t = (pf) p;
rc = mprotect(p, PAGE_SIZE, prot);
if (rc) {
- fprintf(stderr, "p = %p PAGE_SIZE = %d (0x%x)\n", p,
- PAGE_SIZE, PAGE_SIZE);
- perror("failure");
+ fprintf(stderr, "p = %p PAGE_SIZE = %d (0x%x)\n", p,
+ PAGE_SIZE, PAGE_SIZE);
+ perror("failure");
}
if (t() == 1)
- puts("ok");
+ puts("ok");
else
- return 1;
+ return 1;
+
return 0;
}
-
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Modified: trunk/config/auto/memalign.pm
==============================================================================
--- trunk/config/auto/memalign.pm Fri Jan 30 17:15:19 2009 (r36175)
+++ trunk/config/auto/memalign.pm Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2003, The Perl Foundation.
+# Copyright (C) 2001-2009, The Perl Foundation.
# $Id$
=head1 NAME
@@ -53,7 +53,7 @@
my $test2 = 0;
- $conf->cc_gen('config/auto/memalign/test_c2.in');
+ $conf->cc_gen('config/auto/memalign/test2_c.in');
eval { $conf->cc_build(); };
unless ( $@ || $conf->cc_run_capture() !~ /ok/ ) {
$test2 = 1;
Copied and modified: trunk/config/auto/memalign/test2_c.in (from r36168, trunk/config/auto/memalign/test_c2.in)
==============================================================================
--- trunk/config/auto/memalign/test_c2.in Fri Jan 30 09:18:12 2009 (r36168, copy source)
+++ trunk/config/auto/memalign/test2_c.in Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,25 +1,34 @@
/*
- * test for posix_memalign function
- *
- * This file is automatically generated by Configure
- * from test_c.in.
- */
+Copyright (C) 2003-2009, The Perl Foundation.
+$Id$
+
+test for posix_memalign function
+*/
+
#include <@malloc_header@>
#include <stdlib.h>
#include <stdio.h>
-int main(int argc, char *argv[])
+int
+main(int argc, char *argv[])
{
- void * p;
- size_t s = 256;
- /*
- * at least glibc 2.2.4's posix_memalign is broken
- * (it checks size for being a power of 2 instead of alignment)
- *
- * TODO only disable memalign_if_possible (which may have
- * arbitrary allocation size)
- */
- int i = posix_memalign(&p, s, 177);
- puts(((@ptrcast@)p & 0xff) == 0 && i == 0 ? "ok" : "nix");
- return i;
+ void * p;
+ size_t s = 256;
+ /*
+ * at least glibc 2.2.4's posix_memalign is broken
+ * (it checks size for being a power of 2 instead of alignment)
+ *
+ * TODO only disable memalign_if_possible (which may have
+ * arbitrary allocation size)
+ */
+ int i = posix_memalign(&p, s, 177);
+ puts(((@ptrcast@)p & 0xff) == 0 && i == 0 ? "ok" : "nix");
+ return i;
}
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Deleted: trunk/config/auto/memalign/test_c2.in
==============================================================================
--- trunk/config/auto/memalign/test_c2.in Fri Jan 30 17:53:12 2009 (r36175)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,25 +0,0 @@
-/*
- * test for posix_memalign function
- *
- * This file is automatically generated by Configure
- * from test_c.in.
- */
-#include <@malloc_header@>
-#include <stdlib.h>
-#include <stdio.h>
-
-int main(int argc, char *argv[])
-{
- void * p;
- size_t s = 256;
- /*
- * at least glibc 2.2.4's posix_memalign is broken
- * (it checks size for being a power of 2 instead of alignment)
- *
- * TODO only disable memalign_if_possible (which may have
- * arbitrary allocation size)
- */
- int i = posix_memalign(&p, s, 177);
- puts(((@ptrcast@)p & 0xff) == 0 && i == 0 ? "ok" : "nix");
- return i;
-}
Modified: trunk/config/auto/signal.pm
==============================================================================
--- trunk/config/auto/signal.pm Fri Jan 30 17:15:19 2009 (r36175)
+++ trunk/config/auto/signal.pm Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2006, The Perl Foundation.
+# Copyright (C) 2001-2009, The Perl Foundation.
# $Id$
=head1 NAME
@@ -41,21 +41,21 @@
my $verbose = $conf->options->get('verbose');
- $conf->cc_gen('config/auto/signal/test_1.in');
+ $conf->cc_gen('config/auto/signal/test1_c.in');
eval { $conf->cc_build(); };
unless ( $@ || $conf->cc_run() !~ /ok/ ) {
_handle__sighandler_t($conf, $verbose);
}
$conf->cc_clean();
- $conf->cc_gen('config/auto/signal/test_2.in');
+ $conf->cc_gen('config/auto/signal/test2_c.in');
eval { $conf->cc_build(); };
unless ( $@ || $conf->cc_run() !~ /ok/ ) {
_handle_sigaction($conf, $verbose);
}
$conf->cc_clean();
- $conf->cc_gen('config/auto/signal/test_itimer.in');
+ $conf->cc_gen('config/auto/signal/test_itimer_c.in');
eval { $conf->cc_build(); };
unless ( $@ || $conf->cc_run() !~ /ok/ ) {
_handle_setitimer($conf, $verbose);
Copied and modified: trunk/config/auto/signal/test1_c.in (from r36168, trunk/config/auto/signal/test_1.in)
==============================================================================
--- trunk/config/auto/signal/test_1.in Fri Jan 30 09:18:12 2009 (r36168, copy source)
+++ trunk/config/auto/signal/test1_c.in Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,21 +1,28 @@
/*
- * test for __sighandler_t type
- *
- * This file is automatically generated by Configure
- * from test_1.in.
- */
+Copyright (C) 2003-2009, The Perl Foundation.
+$Id$
+
+test for __sighandler_t type
+*/
#include <stdio.h>
#include <signal.h>
-
-__sighandler_t set_handler(int sig, __sighandler_t act) {
- return (__sighandler_t) 0;
+__sighandler_t set_handler(int sig, __sighandler_t act)
+{
+ return (__sighandler_t) 0;
}
-int main(int argc, char **argv) {
-
- puts("ok");
- return 0;
+int
+main(int argc, char **argv)
+{
+ puts("ok");
+ return 0;
}
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Copied and modified: trunk/config/auto/signal/test2_c.in (from r36168, trunk/config/auto/signal/test_2.in)
==============================================================================
--- trunk/config/auto/signal/test_2.in Fri Jan 30 09:18:12 2009 (r36168, copy source)
+++ trunk/config/auto/signal/test2_c.in Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,20 +1,27 @@
/*
- * test for sigaction function
- *
- * This file is automatically generated by Configure
- * from test_2.in.
- */
+Copyright (C) 2003-2009, The Perl Foundation.
+$Id$
+
+test for sigaction function
+*/
#include <stdio.h>
#include <signal.h>
+int
+main(int argc, char **argv)
+{
+ struct sigaction old_sa, new_sa;
-int main(int argc, char **argv) {
- struct sigaction old_sa, new_sa;
-
- sigemptyset (&new_sa.sa_mask);
- sigaction(SIGFPE, NULL, &old_sa);
- puts("ok");
- return 0;
+ sigemptyset(&new_sa.sa_mask);
+ sigaction(SIGFPE, NULL, &old_sa);
+ puts("ok");
+ return 0;
}
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Deleted: trunk/config/auto/signal/test_1.in
==============================================================================
--- trunk/config/auto/signal/test_1.in Fri Jan 30 17:53:12 2009 (r36175)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,21 +0,0 @@
-/*
- * test for __sighandler_t type
- *
- * This file is automatically generated by Configure
- * from test_1.in.
- */
-
-#include <stdio.h>
-#include <signal.h>
-
-
-__sighandler_t set_handler(int sig, __sighandler_t act) {
- return (__sighandler_t) 0;
-}
-
-int main(int argc, char **argv) {
-
- puts("ok");
- return 0;
-}
-
Deleted: trunk/config/auto/signal/test_2.in
==============================================================================
--- trunk/config/auto/signal/test_2.in Fri Jan 30 17:53:12 2009 (r36175)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,20 +0,0 @@
-/*
- * test for sigaction function
- *
- * This file is automatically generated by Configure
- * from test_2.in.
- */
-
-#include <stdio.h>
-#include <signal.h>
-
-
-int main(int argc, char **argv) {
- struct sigaction old_sa, new_sa;
-
- sigemptyset (&new_sa.sa_mask);
- sigaction(SIGFPE, NULL, &old_sa);
- puts("ok");
- return 0;
-}
-
Deleted: trunk/config/auto/signal/test_itimer.in
==============================================================================
--- trunk/config/auto/signal/test_itimer.in Fri Jan 30 17:53:12 2009 (r36175)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,31 +0,0 @@
-/*
- * setitimer test
- */
-
-#include <sys/time.h>
-#include <signal.h>
-#include <stdio.h>
-#include <string.h>
-
-volatile sig_atomic_t got_alarm = 0;
-
-void
-alarm_handler(int i) {
- got_alarm = 1;
-}
-
-int main(int argc, char **argv) {
- struct itimerval its, ots;
- int ret;
-
- signal(SIGALRM, alarm_handler);
- memset(&its, 0, sizeof(its));
- its.it_interval.tv_sec = 0;
- its.it_value.tv_sec = 10;
- ret = setitimer(ITIMER_REAL, &its, &ots);
- if (ret)
- puts("err");
- else
- puts("ok");
- return 0;
-}
Copied and modified: trunk/config/auto/signal/test_itimer_c.in (from r36168, trunk/config/auto/signal/test_itimer.in)
==============================================================================
--- trunk/config/auto/signal/test_itimer.in Fri Jan 30 09:18:12 2009 (r36168, copy source)
+++ trunk/config/auto/signal/test_itimer_c.in Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,6 +1,9 @@
/*
- * setitimer test
- */
+Copyright (C) 2003-2009, The Perl Foundation.
+$Id$
+
+setitimer test
+*/
#include <sys/time.h>
#include <signal.h>
@@ -10,22 +13,32 @@
volatile sig_atomic_t got_alarm = 0;
void
-alarm_handler(int i) {
+alarm_handler(int i)
+{
got_alarm = 1;
}
-int main(int argc, char **argv) {
+int
+main(int argc, char **argv)
+{
struct itimerval its, ots;
int ret;
signal(SIGALRM, alarm_handler);
- memset(&its, 0, sizeof(its));
+ memset(&its, 0, sizeof (its));
its.it_interval.tv_sec = 0;
its.it_value.tv_sec = 10;
ret = setitimer(ITIMER_REAL, &its, &ots);
if (ret)
- puts("err");
+ puts("err");
else
- puts("ok");
+ puts("ok");
return 0;
}
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
Modified: trunk/config/auto/snprintf.pm
==============================================================================
--- trunk/config/auto/snprintf.pm Fri Jan 30 17:15:19 2009 (r36175)
+++ trunk/config/auto/snprintf.pm Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,4 +1,4 @@
-# Copyright (C) 2001-2003, The Perl Foundation.
+# Copyright (C) 2001-2009, The Perl Foundation.
# $Id$
=head1 NAME
@@ -38,7 +38,7 @@
sub _probe_for_snprintf {
my $conf = shift;
- $conf->cc_gen('config/auto/snprintf/test.in');
+ $conf->cc_gen('config/auto/snprintf/test_c.in');
$conf->cc_build();
my $res = $conf->cc_run() or die "Can't run the snprintf testing program: $!";
$conf->cc_clean();
Deleted: trunk/config/auto/snprintf/test.in
==============================================================================
--- trunk/config/auto/snprintf/test.in Fri Jan 30 17:53:12 2009 (r36175)
+++ /dev/null 00:00:00 1970 (deleted)
@@ -1,20 +0,0 @@
-#include <stdio.h>
-#ifdef _WIN32
-# define snprintf _snprintf
-#endif
-
-int
-main(int argc, char* argv[])
-{
- char buf[10];
- int n;
-
- n = snprintf(buf, 2, "%s", "01234");
- if (n == -1)
- puts("old snprintf");
- else if (n == 5)
- puts("C99 snprintf");
- else
- printf("borken snprintf: n = %d\n", n);
- return 0;
-}
Copied and modified: trunk/config/auto/snprintf/test_c.in (from r36168, trunk/config/auto/snprintf/test.in)
==============================================================================
--- trunk/config/auto/snprintf/test.in Fri Jan 30 09:18:12 2009 (r36168, copy source)
+++ trunk/config/auto/snprintf/test_c.in Fri Jan 30 17:53:12 2009 (r36176)
@@ -1,3 +1,9 @@
+/*
+Copyright (C) 2004-2009, The Perl Foundation.
+$Id$
+
+*/
+
#include <stdio.h>
#ifdef _WIN32
# define snprintf _snprintf
@@ -11,10 +17,17 @@
n = snprintf(buf, 2, "%s", "01234");
if (n == -1)
- puts("old snprintf");
+ puts("old snprintf");
else if (n == 5)
- puts("C99 snprintf");
+ puts("C99 snprintf");
else
- printf("borken snprintf: n = %d\n", n);
+ printf("borken snprintf: n = %d\n", n);
return 0;
}
+
+/*
+ * Local variables:
+ * c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */
More information about the parrot-commits
mailing list