[svn:parrot] r43989 - in trunk: examples/c t/codingstd

cotto at svn.parrot.org cotto at svn.parrot.org
Tue Feb 16 08:26:43 UTC 2010


Author: cotto
Date: Tue Feb 16 08:26:43 2010
New Revision: 43989
URL: https://trac.parrot.org/parrot/changeset/43989

Log:
[docs] make nanoparrot build and add some missing function docs
This changes some code, but it's been broken for a while and doesn't have a
makefile target, so it won't mess with the release.

Modified:
   trunk/examples/c/nanoparrot.c
   trunk/t/codingstd/c_function_docs.t

Modified: trunk/examples/c/nanoparrot.c
==============================================================================
--- trunk/examples/c/nanoparrot.c	Tue Feb 16 08:18:32 2010	(r43988)
+++ trunk/examples/c/nanoparrot.c	Tue Feb 16 08:26:43 2010	(r43989)
@@ -94,7 +94,7 @@
  * or for the curious: look at the preprocessor output
  */
 
-#define OP(x) OP_ ## (x)
+#define OP(x) OP_##x
 typedef enum { OPCODES } opcodes;
 #undef OP
 
@@ -148,6 +148,8 @@
 
 =item C<static void run(Interp *interp, opcode_t *pc)>
 
+Execute a single opcode.
+
 =cut
 
 */
@@ -167,7 +169,7 @@
         switch (*pc) {
 #    endif
 
-#    define CASE(x)         case OP_ ## (x):
+#    define CASE(x)         case OP_##x:
 #    define NEXT            continue;
 #    define DONE            return;
 #    define ENDDISPATCH     default : printf("illegal instruction"); \
@@ -228,11 +230,11 @@
 
 #ifdef FUNC_CORE
 #  define DEF_OP(op) \
-    interp->op_func[OP_ ## op] = (op); \
-    interp->op_info[OP_ ## op] = #op
+    interp->op_func[OP_##op] = (op); \
+    interp->op_info[OP_##op] = #op
 #else
 #  define DEF_OP(op) \
-    interp->op_info[OP_ ## op] = #op
+    interp->op_info[OP_##op] = #op
 #endif
 
 /*
@@ -287,6 +289,8 @@
 
 =item C<int main(int argc, char *argv[])>
 
+Initialize a minimal Parrotesque interpreter and run some hard-coded bytecode.
+
 =cut
 
 */

Modified: trunk/t/codingstd/c_function_docs.t
==============================================================================
--- trunk/t/codingstd/c_function_docs.t	Tue Feb 16 08:18:32 2010	(r43988)
+++ trunk/t/codingstd/c_function_docs.t	Tue Feb 16 08:26:43 2010	(r43989)
@@ -117,7 +117,6 @@
 config/gen/platform/openbsd/memexec.c
 config/gen/platform/solaris/math.c
 config/gen/platform/solaris/time.c
-examples/c/nanoparrot.c
 examples/c/pbc_info.c
 examples/compilers/japhc.c
 src/atomic/gcc_x86.c


More information about the parrot-commits mailing list