[svn:parrot] r40864 - in branches/context_pmc3: include/parrot src/call
bacek at svn.parrot.org
bacek at svn.parrot.org
Sun Aug 30 11:14:41 UTC 2009
Author: bacek
Date: Sun Aug 30 11:14:37 2009
New Revision: 40864
URL: https://trac.parrot.org/parrot/changeset/40864
Log:
[cage] Fix usage of param guards. Add Parrot_pcc_set_constants function.
Modified:
branches/context_pmc3/include/parrot/call.h
branches/context_pmc3/src/call/context.c
Modified: branches/context_pmc3/include/parrot/call.h
==============================================================================
--- branches/context_pmc3/include/parrot/call.h Sun Aug 30 09:54:25 2009 (r40863)
+++ branches/context_pmc3/include/parrot/call.h Sun Aug 30 11:14:37 2009 (r40864)
@@ -881,6 +881,15 @@
__attribute__nonnull__(3);
PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+void Parrot_pcc_set_constants(PARROT_INTERP,
+ ARGIN(PMC *ctx),
+ ARGIN(struct PackFile_Constant **constants))
+ __attribute__nonnull__(1)
+ __attribute__nonnull__(2)
+ __attribute__nonnull__(3);
+
+PARROT_EXPORT
void Parrot_pcc_set_continuation(PARROT_INTERP,
ARGIN(PMC *ctx),
ARGIN_NULLOK(PMC *_continuation))
@@ -1071,6 +1080,10 @@
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(ctx) \
|| PARROT_ASSERT_ARG(caller_ctx)
+#define ASSERT_ARGS_Parrot_pcc_set_constants __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+ PARROT_ASSERT_ARG(interp) \
+ || PARROT_ASSERT_ARG(ctx) \
+ || PARROT_ASSERT_ARG(constants)
#define ASSERT_ARGS_Parrot_pcc_set_continuation __attribute__unused__ int _ASSERT_ARGS_CHECK = \
PARROT_ASSERT_ARG(interp) \
|| PARROT_ASSERT_ARG(ctx)
Modified: branches/context_pmc3/src/call/context.c
==============================================================================
--- branches/context_pmc3/src/call/context.c Sun Aug 30 09:54:25 2009 (r40863)
+++ branches/context_pmc3/src/call/context.c Sun Aug 30 11:14:37 2009 (r40864)
@@ -28,6 +28,26 @@
/* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */
/* HEADERIZER END: static */
+/*
+
+=item C<void Parrot_pcc_set_constants(PARROT_INTERP, PMC *ctx, struct
+PackFile_Constant **constants)>
+
+Get string constant from context.
+
+=cut
+
+*/
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+void
+Parrot_pcc_set_constants(PARROT_INTERP, ARGIN(PMC *ctx), ARGIN(struct PackFile_Constant **constants))
+{
+ ASSERT_ARGS(Parrot_pcc_set_constants)
+ Parrot_Context const * c = Parrot_pcc_get_context(interp, ctx);
+ c->constants = constants;
+}
/*
@@ -659,7 +679,7 @@
UINTVAL
Parrot_pcc_warnings_on(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
{
- ASSERT_ARGS(Parrot_pcc_get_pred_offset)
+ ASSERT_ARGS(Parrot_pcc_warnings_on)
Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
c->warns |= flags;
return c->warns;
@@ -680,7 +700,7 @@
void
Parrot_pcc_warnings_off(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
{
- ASSERT_ARGS(Parrot_pcc_set_pred_offset)
+ ASSERT_ARGS(Parrot_pcc_warnings_off)
Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
c->warns &= ~flags;
return c->warns;
@@ -702,7 +722,7 @@
UINTVAL
Parrot_pcc_warnings_test(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
{
- ASSERT_ARGS(Parrot_pcc_set_pred_offset)
+ ASSERT_ARGS(Parrot_pcc_warnings_test)
Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
return c->warns & flags;
}
@@ -721,7 +741,7 @@
UINTVAL
Parrot_pcc_errors_on(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
{
- ASSERT_ARGS(Parrot_pcc_get_pred_offset)
+ ASSERT_ARGS(Parrot_pcc_errors_on)
Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
c->errors |= flags;
return c->errors;
@@ -742,7 +762,7 @@
void
Parrot_pcc_errors_off(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
{
- ASSERT_ARGS(Parrot_pcc_set_pred_offset)
+ ASSERT_ARGS(Parrot_pcc_errors_off)
Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
c->errors &= ~flags;
return c->errors;
@@ -763,7 +783,7 @@
UINTVAL
Parrot_pcc_errors_test(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
{
- ASSERT_ARGS(Parrot_pcc_set_pred_offset)
+ ASSERT_ARGS(Parrot_pcc_errors_test)
Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
return c->errors & flags;
}
@@ -783,7 +803,7 @@
UINTVAL
Parrot_pcc_trace_flags_on(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
{
- ASSERT_ARGS(Parrot_pcc_get_pred_offset)
+ ASSERT_ARGS(Parrot_pcc_trace_flags_on)
Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
c->trace_flags |= flags;
return c->trace_flags;
@@ -804,7 +824,7 @@
void
Parrot_pcc_trace_flags_off(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
{
- ASSERT_ARGS(Parrot_pcc_set_pred_offset)
+ ASSERT_ARGS(Parrot_pcc_trace_flags_off)
Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
c->trace_flags &= ~flags;
return c->trace_flags;
@@ -826,7 +846,7 @@
UINTVAL
Parrot_pcc_trace_flags_test(PARROT_INTERP, ARGIN(PMC *ctx), UINTVAL flags)
{
- ASSERT_ARGS(Parrot_pcc_set_pred_offset)
+ ASSERT_ARGS(Parrot_pcc_trace_flags_test)
Parrot_Context *c = Parrot_pcc_get_context(interp, ctx);
return c->trace_flags & flags;
}
More information about the parrot-commits
mailing list