Skip to content

Commit

Permalink
Fix a bunch of warnings in p5interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
sorear committed Apr 4, 2010
1 parent e7d4b67 commit 1f52187
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/pmc/p5interpreter.pmc
Expand Up @@ -15,7 +15,10 @@ These are the vtable functions for the P5Interpreter class.

#include "blizkost.h"

/* slightly evil */
#define char const char
#include "init_with_xs.h"
#undef char

/* Tracking of whether we've initialized or not. */
static int inited = 0;
Expand Down Expand Up @@ -55,7 +58,9 @@ Set up P5Interpreter PMC.

VTABLE void init() {
struct interpreter *my_perl;
char *embedding[] = { "", "-e", "0" };
char embedding_s[][3] = { "", "-e", "0" };
char *embedding[] = { embedding_s[0], embedding_s[1],
embedding_s[2] };

/* Set up the underlying structure. */
PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_P5Interpreter_attributes);
Expand All @@ -64,9 +69,11 @@ Set up P5Interpreter PMC.
/* Inited before? */
if (!inited) {
int fake_argc = 1;
char *fake_argv[] = { "" };
char *fake_argv[] = { embedding_s[0] };
char *fake_env[] = { NULL };
PERL_SYS_INIT3(&fake_argc, &fake_argv, &fake_env);
char **fake_argv_p = fake_argv;
char **fake_env_p = fake_env;
PERL_SYS_INIT3(&fake_argc, &fake_argv_p, &fake_env_p);
inited = 1;
}

Expand Down Expand Up @@ -123,7 +130,7 @@ Run the Perl 5 code.

*/

VTABLE opcode_t *invoke(opcode_t *next) {
VTABLE opcode_t *invoke(void *next) {
struct interpreter *my_perl;
PMC *result;
STRING *source;
Expand Down Expand Up @@ -166,7 +173,7 @@ Acquire a namespace handle.
SETATTR_P5Namespace_p5i(interp, pmc, SELF);
SETATTR_P5Namespace_ns_name(interp, pmc, name);

return pmc;
RETURN(PMC *pmc);
}
}

Expand Down

0 comments on commit 1f52187

Please sign in to comment.