[svn:parrot] r40150 - trunk/src/call

petdance at svn.parrot.org petdance at svn.parrot.org
Sun Jul 19 04:48:07 UTC 2009


Author: petdance
Date: Sun Jul 19 04:48:07 2009
New Revision: 40150
URL: https://trac.parrot.org/parrot/changeset/40150

Log:
consting

Modified:
   trunk/src/call/ops.c

Modified: trunk/src/call/ops.c
==============================================================================
--- trunk/src/call/ops.c	Sun Jul 19 04:35:03 2009	(r40149)
+++ trunk/src/call/ops.c	Sun Jul 19 04:48:07 2009	(r40150)
@@ -571,10 +571,9 @@
         ARGIN(const char *sig), va_list args)
 {
     ASSERT_ARGS(Parrot_runops_fromc_arglist)
-    void* retval;
     Parrot_Context * const ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
+    void * const retval = set_retval(interp, *sig, ctx);
 
-    retval = set_retval(interp, *sig, ctx);
     Parrot_free_context(interp, ctx, 1);
     return retval;
 }
@@ -599,10 +598,9 @@
         ARGIN(const char *sig), va_list args)
 {
     ASSERT_ARGS(Parrot_runops_fromc_arglist_reti)
-    INTVAL retval;
     Parrot_Context * const ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
+    const INTVAL retval = set_retval_i(interp, *sig, ctx);
 
-    retval = set_retval_i(interp, *sig, ctx);
     Parrot_free_context(interp, ctx, 1);
     return retval;
 }
@@ -627,10 +625,9 @@
         ARGIN(const char *sig), va_list args)
 {
     ASSERT_ARGS(Parrot_runops_fromc_arglist_retf)
-    FLOATVAL retval;
     Parrot_Context * const ctx = runops_args(interp, sub, PMCNULL, NULL, sig, args);
+    const FLOATVAL retval = set_retval_f(interp, *sig, ctx);
 
-    retval = set_retval_f(interp, *sig, ctx);
     Parrot_free_context(interp, ctx, 1);
     return retval;
 }
@@ -656,11 +653,9 @@
         ARGIN(STRING *meth), ARGIN(const char *sig), va_list args)
 {
     ASSERT_ARGS(Parrot_run_meth_fromc_arglist)
-    Parrot_Context *ctx;
-    void* retval;
+    Parrot_Context * const ctx = runops_args(interp, sub, obj, meth, sig, args);
+    void * const retval = set_retval(interp, *sig, ctx);
 
-    ctx = runops_args(interp, sub, obj, meth, sig, args);
-    retval = set_retval(interp, *sig, ctx);
     Parrot_free_context(interp, ctx, 1);
     return retval;
 }
@@ -687,10 +682,9 @@
         ARGIN(STRING *meth), ARGIN(const char *sig), va_list args)
 {
     ASSERT_ARGS(Parrot_run_meth_fromc_arglist_reti)
-    INTVAL retval;
     Parrot_Context * const ctx = runops_args(interp, sub, obj, meth, sig, args);
+    const INTVAL retval = set_retval_i(interp, *sig, ctx);
 
-    retval = set_retval_i(interp, *sig, ctx);
     Parrot_free_context(interp, ctx, 1);
     return retval;
 }
@@ -716,10 +710,9 @@
         ARGIN(STRING *meth), ARGIN(const char *sig), va_list args)
 {
     ASSERT_ARGS(Parrot_run_meth_fromc_arglist_retf)
-    FLOATVAL retval;
     Parrot_Context * const ctx = runops_args(interp, sub, obj, meth, sig, args);
+    const FLOATVAL retval = set_retval_f(interp, *sig, ctx);
 
-    retval = set_retval_f(interp, *sig, ctx);
     Parrot_free_context(interp, ctx, 1);
     return retval;
 }


More information about the parrot-commits mailing list