[svn:parrot] r40757 - in branches/context_pmc3: include/parrot src

bacek at svn.parrot.org bacek at svn.parrot.org
Mon Aug 24 11:15:00 UTC 2009


Author: bacek
Date: Mon Aug 24 11:15:00 2009
New Revision: 40757
URL: https://trac.parrot.org/parrot/changeset/40757

Log:
[core] Fix codestd failures in context.c which causes headerizer to fail

Modified:
   branches/context_pmc3/include/parrot/context.h
   branches/context_pmc3/src/context.c

Modified: branches/context_pmc3/include/parrot/context.h
==============================================================================
--- branches/context_pmc3/include/parrot/context.h	Mon Aug 24 11:14:29 2009	(r40756)
+++ branches/context_pmc3/include/parrot/context.h	Mon Aug 24 11:15:00 2009	(r40757)
@@ -64,12 +64,6 @@
 
 #define PMC_context(pmc) Parrot_cx_get_context(interp, (pmc))
 
-STRING*
-Parrot_cx_get_string_constant(PARROT_INTERP, ARGIN(PMC* ctx), INTVAL idx);
-
-PMC*
-Parrot_cx_get_pmc_constant(PARROT_INTERP, ARGIN(PMC* ctx), INTVAL idx);
-
 /* HEADERIZER BEGIN: src/context.c */
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 
@@ -82,7 +76,20 @@
 
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
-Parrot_Context* Parrot_cx_get_context(PARROT_INTERP, ARGIN(PMC *ctx))
+Parrot_Context* Parrot_cx_get_context(PARROT_INTERP, ARGIN_NULLOK(PMC *ctx))
+        __attribute__nonnull__(1);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+PMC* Parrot_cx_get_pmc_constant(PARROT_INTERP, ARGIN(PMC *ctx), INTVAL idx)
+        __attribute__nonnull__(1)
+        __attribute__nonnull__(2);
+
+PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
+STRING* Parrot_cx_get_string_constant(PARROT_INTERP,
+    ARGIN(PMC *ctx),
+    INTVAL idx)
         __attribute__nonnull__(1)
         __attribute__nonnull__(2);
 
@@ -90,6 +97,11 @@
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(ctx)
 #define ASSERT_ARGS_Parrot_cx_get_context __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp)
+#define ASSERT_ARGS_Parrot_cx_get_pmc_constant __attribute__unused__ int _ASSERT_ARGS_CHECK = \
+       PARROT_ASSERT_ARG(interp) \
+    || PARROT_ASSERT_ARG(ctx)
+#define ASSERT_ARGS_Parrot_cx_get_string_constant __attribute__unused__ int _ASSERT_ARGS_CHECK = \
        PARROT_ASSERT_ARG(interp) \
     || PARROT_ASSERT_ARG(ctx)
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */

Modified: branches/context_pmc3/src/context.c
==============================================================================
--- branches/context_pmc3/src/context.c	Mon Aug 24 11:14:29 2009	(r40756)
+++ branches/context_pmc3/src/context.c	Mon Aug 24 11:15:00 2009	(r40757)
@@ -28,9 +28,11 @@
 /* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */
 /* HEADERIZER END: static */
 
+
 /*
  
-=item C<Parrot_cx_get_string_constant()>
+=item C<STRING* Parrot_cx_get_string_constant(PARROT_INTERP, PMC *ctx, INTVAL
+idx)>
 
 Get string constant from context.
 
@@ -39,15 +41,19 @@
 */
 
 PARROT_EXPORT
+PARROT_CAN_RETURN_NULL
 STRING*
-Parrot_cx_get_string_constant(PARROT_INTERP, ARGIN(PMC* ctx), INTVAL idx) {
+Parrot_cx_get_string_constant(PARROT_INTERP, ARGIN(PMC *ctx), INTVAL idx)
+{
+    ASSERT_ARGS(Parrot_cx_get_string_constant)
     Parrot_Context const * c = Parrot_cx_get_context(interp, ctx);
     return c->constants[idx]->u.string;
 }
 
+
 /*
  
-=item C<Parrot_cx_get_pmc_constant()>
+=item C<PMC* Parrot_cx_get_pmc_constant(PARROT_INTERP, PMC *ctx, INTVAL idx)>
 
 Get PMC constant from context.
 
@@ -58,7 +64,9 @@
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
 PMC*
-Parrot_cx_get_pmc_constant(PARROT_INTERP, ARGIN(PMC* ctx), INTVAL idx) {
+Parrot_cx_get_pmc_constant(PARROT_INTERP, ARGIN(PMC *ctx), INTVAL idx)
+{
+    ASSERT_ARGS(Parrot_cx_get_pmc_constant)
     Parrot_Context const * c = Parrot_cx_get_context(interp, ctx);
     return c->constants[idx]->u.key;
 }
@@ -69,13 +77,16 @@
 =item C<struct PackFile_Constant ** Parrot_cx_constants(PARROT_INTERP, PMC
 *ctx)>
 
+Get reference to constants.
+
 =cut
 
 */
 PARROT_EXPORT
 PARROT_CANNOT_RETURN_NULL
 struct PackFile_Constant **
-Parrot_cx_constants(PARROT_INTERP, ARGIN(PMC *ctx)) {
+Parrot_cx_constants(PARROT_INTERP, ARGIN(PMC *ctx))
+{
     ASSERT_ARGS(Parrot_cx_constants)
     return ((Parrot_Context*)(VTABLE_get_pointer(interp, ctx)))->constants;
 }
@@ -94,10 +105,26 @@
 PARROT_EXPORT
 PARROT_CAN_RETURN_NULL
 Parrot_Context*
-Parrot_cx_get_context(PARROT_INTERP, ARGIN(PMC *ctx)) {
+Parrot_cx_get_context(PARROT_INTERP, ARGIN_NULLOK(PMC *ctx))
+{
+    ASSERT_ARGS(Parrot_cx_get_context)
     if (PMC_IS_NULL(ctx))
         return NULL;
 
     return (Parrot_Context*)(VTABLE_get_pointer(interp, ctx));
 }
 
+
+/*
+
+=back
+
+*/
+
+
+/*
+ * Local variables:
+ *   c-file-style: "parrot"
+ * End:
+ * vim: expandtab shiftwidth=4:
+ */


More information about the parrot-commits mailing list