From: Robin Barker Date: Mon, 18 Feb 2008 13:43:56 +0000 (+0000) Subject: consting for .c files in tests X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=473d7a83d65393ce327ccad2c8d257d8dbf6c6ae;p=p5sagit%2Fp5-mst-13.2.git consting for .c files in tests From: "Robin Barker" Message-ID: <46A0F33545E63740BC7563DE59CA9C6D093A3F@exchsvr2.npl.ad.local> p4raw-id: //depot/perl@33332 --- diff --git a/lib/ExtUtils/t/Embed.t b/lib/ExtUtils/t/Embed.t index e3321ec..d1edcbb 100644 --- a/lib/ExtUtils/t/Embed.t +++ b/lib/ExtUtils/t/Embed.t @@ -163,7 +163,7 @@ __END__ #define my_puts(a) if(puts(a) < 0) exit(666) -static char *cmds[] = { "perl","-e", "$|=1; print qq[ok 5\\n]", NULL }; +static const char * cmds [] = { "perl", "-e", "$|=1; print qq[ok 5\\n]", NULL }; #ifdef PERL_GLOBAL_STRUCT_PRIVATE static struct perl_vars *my_plvarsp; @@ -171,12 +171,11 @@ struct perl_vars* Perl_GetVarsPrivate(void) { return my_plvarsp; } #endif #ifdef NO_ENV_ARRAY_IN_MAIN -extern char **environ; -int main(int argc, char **argv) +int main(int argc, char **argv) { + char **env; #else -int main(int argc, char **argv, char **env) +int main(int argc, char **argv, char **env) { #endif -{ PerlInterpreter *my_perl; #ifdef PERL_GLOBAL_STRUCT dVAR; @@ -188,11 +187,7 @@ int main(int argc, char **argv, char **env) (void)argc; /* PERL_SYS_INIT3 may #define away their use */ (void)argv; -#ifdef NO_ENV_ARRAY_IN_MAIN - PERL_SYS_INIT3(&argc,&argv,&environ); -#else - PERL_SYS_INIT3(&argc,&argv,&env); -#endif + PERL_SYS_INIT3(&argc, &argv, &env); my_perl = perl_alloc(); @@ -202,11 +197,7 @@ int main(int argc, char **argv, char **env) my_puts("ok 3"); -#ifdef NO_ENV_ARRAY_IN_MAIN - perl_parse(my_perl, NULL, (sizeof(cmds)/sizeof(char *))-1, cmds, environ); -#else - perl_parse(my_perl, NULL, (sizeof(cmds)/sizeof(char *))-1, cmds, env); -#endif + perl_parse(my_perl, NULL, (sizeof(cmds)/sizeof(char *))-1, (char **)cmds, env); my_puts("ok 4"); diff --git a/lib/Module/Build/t/lib/DistGen.pm b/lib/Module/Build/t/lib/DistGen.pm index 91f7c33..380db1a 100644 --- a/lib/Module/Build/t/lib/DistGen.pm +++ b/lib/Module/Build/t/lib/DistGen.pm @@ -180,14 +180,14 @@ sub _gen_default_filedata { OUTPUT: RETVAL - char * + const char * xs_version() CODE: RETVAL = XS_VERSION; OUTPUT: RETVAL - char * + const char * version() CODE: RETVAL = VERSION;