Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix build warnings in src/embed/api.c

  • Loading branch information...
commit d74cf45358fa6b8365da04f43d1480c6e7643a01 1 parent 2ae8f5a
@Whiteknight Whiteknight authored
Showing with 25 additions and 42 deletions.
  1. +11 −25 include/parrot/api.h
  2. +14 −17 src/embed/api.c
View
36 include/parrot/api.h
@@ -115,11 +115,9 @@ Parrot_Int Parrot_api_flag(
PARROT_API
Parrot_Int Parrot_api_get_compiler(
- ARGIN(Parrot_PMC interp_pmc),
- ARGIN(Parrot_String *type),
- ARGOUT(PMC **compiler))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
+ Parrot_PMC interp_pmc,
+ Parrot_String type,
+ ARGOUT(Parrot_PMC *compiler))
__attribute__nonnull__(3)
FUNC_MODIFIES(*compiler);
@@ -175,10 +173,8 @@ Parrot_Int Parrot_api_load_bytecode_file(
PARROT_API
Parrot_Int Parrot_api_load_language(
- ARGIN(Parrot_PMC interp_pmc),
- ARGIN(Parrot_String *lang))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2);
+ Parrot_PMC interp_pmc,
+ Parrot_String lang);
PARROT_API
Parrot_Int Parrot_api_make_interpreter(
@@ -205,12 +201,9 @@ Parrot_Int Parrot_api_run_bytecode(
PARROT_API
Parrot_Int Parrot_api_set_compiler(
- ARGIN(Parrot_PMC interp_pmc),
- ARGIN(Parrot_String *type),
- ARGIN(PMC *compiler))
- __attribute__nonnull__(1)
- __attribute__nonnull__(2)
- __attribute__nonnull__(3);
+ Parrot_PMC interp_pmc,
+ Parrot_String type,
+ Parrot_PMC compiler);
PARROT_API
Parrot_Int Parrot_api_set_configuration_hash(
@@ -275,9 +268,7 @@ Parrot_Int Parrot_api_wrap_imcc_hack(
PARROT_ASSERT_ARG(outfile))
#define ASSERT_ARGS_Parrot_api_flag __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_Parrot_api_get_compiler __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp_pmc) \
- , PARROT_ASSERT_ARG(type) \
- , PARROT_ASSERT_ARG(compiler))
+ PARROT_ASSERT_ARG(compiler))
#define ASSERT_ARGS_Parrot_api_get_exception_backtrace \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(bt))
@@ -295,18 +286,13 @@ Parrot_Int Parrot_api_wrap_imcc_hack(
#define ASSERT_ARGS_Parrot_api_load_bytecode_file __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(filename) \
, PARROT_ASSERT_ARG(pbc))
-#define ASSERT_ARGS_Parrot_api_load_language __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp_pmc) \
- , PARROT_ASSERT_ARG(lang))
+#define ASSERT_ARGS_Parrot_api_load_language __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_Parrot_api_make_interpreter __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(interp))
#define ASSERT_ARGS_Parrot_api_ready_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
PARROT_ASSERT_ARG(main_sub))
#define ASSERT_ARGS_Parrot_api_run_bytecode __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
-#define ASSERT_ARGS_Parrot_api_set_compiler __attribute__unused__ int _ASSERT_ARGS_CHECK = (\
- PARROT_ASSERT_ARG(interp_pmc) \
- , PARROT_ASSERT_ARG(type) \
- , PARROT_ASSERT_ARG(compiler))
+#define ASSERT_ARGS_Parrot_api_set_compiler __attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_Parrot_api_set_configuration_hash \
__attribute__unused__ int _ASSERT_ARGS_CHECK = (0)
#define ASSERT_ARGS_Parrot_api_set_executable_name \
View
31 src/embed/api.c
@@ -463,7 +463,7 @@ Parrot_api_wrap_imcc_hack(Parrot_PMC interp_pmc, const char * sourcefile,
/*
=item C<Parrot_Int Parrot_api_load_language(Parrot_PMC interp_pmc, Parrot_String
-*lang)>
+lang)>
Load the compiler libraries for a given high-level language into the
interpreter.
@@ -474,20 +474,19 @@ interpreter.
PARROT_API
Parrot_Int
-Parrot_api_load_language(ARGIN(Parrot_PMC interp_pmc), ARGIN(Parrot_String *lang))
+Parrot_api_load_language(Parrot_PMC interp_pmc, Parrot_String lang)
{
ASSERT_ARGS(Parrot_api_load_language)
EMBED_API_CALLIN(interp_pmc, interp)
- STRING * const lang_pmc = Parrot_str_new(interp, lang, strlen((char*)lang));
- Parrot_load_language(interp, lang_pmc);
- EMBED_API_CALLOUT(interp_pmc, interp);
+ Parrot_load_language(interp, lang);
+ EMBED_API_CALLOUT(interp_pmc, interp);
}
/*
=item C<Parrot_Int Parrot_api_get_compiler(Parrot_PMC interp_pmc, Parrot_String
-*type, PMC **compiler)>
+type, Parrot_PMC *compiler)>
=cut
@@ -495,21 +494,20 @@ Parrot_api_load_language(ARGIN(Parrot_PMC interp_pmc), ARGIN(Parrot_String *lang
PARROT_API
Parrot_Int
-Parrot_api_get_compiler(ARGIN(Parrot_PMC interp_pmc), ARGIN(Parrot_String *type),
- ARGOUT(PMC **compiler))
+Parrot_api_get_compiler(Parrot_PMC interp_pmc, Parrot_String type,
+ ARGOUT(Parrot_PMC *compiler))
{
ASSERT_ARGS(Parrot_api_get_compiler)
EMBED_API_CALLIN(interp_pmc, interp)
- STRING * const type_pmc = Parrot_str_new(interp, type, strlen(type));
- *compiler = Parrot_get_compiler(interp, type_pmc);
- EMBED_API_CALLOUT(interp_pmc, interp);
+ *compiler = Parrot_get_compiler(interp, type);
+ EMBED_API_CALLOUT(interp_pmc, interp);
}
/*
=item C<Parrot_Int Parrot_api_set_compiler(Parrot_PMC interp_pmc, Parrot_String
-*type, PMC *compiler)>
+type, Parrot_PMC compiler)>
=cut
@@ -517,14 +515,13 @@ Parrot_api_get_compiler(ARGIN(Parrot_PMC interp_pmc), ARGIN(Parrot_String *type)
PARROT_API
Parrot_Int
-Parrot_api_set_compiler(ARGIN(Parrot_PMC interp_pmc), ARGIN(Parrot_String *type),
- ARGIN(PMC *compiler))
+Parrot_api_set_compiler(Parrot_PMC interp_pmc, Parrot_String type,
+ Parrot_PMC compiler)
{
ASSERT_ARGS(Parrot_api_set_compiler)
EMBED_API_CALLIN(interp_pmc, interp)
- STRING * const type_pmc = Parrot_str_new(interp, type, strlen((char*)type));
- Parrot_set_compiler(interp, type_pmc, compiler);
- EMBED_API_CALLOUT(interp_pmc, interp);
+ Parrot_set_compiler(interp, type, compiler);
+ EMBED_API_CALLOUT(interp_pmc, interp);
}
/*
Please sign in to comment.
Something went wrong with that request. Please try again.