[svn:parrot] r43788 - in trunk: include/parrot lib/Parrot/Ops2c
cotto at svn.parrot.org
cotto at svn.parrot.org
Tue Feb 9 02:40:19 UTC 2010
Author: cotto
Date: Tue Feb 9 02:40:17 2010
New Revision: 43788
URL: https://trac.parrot.org/parrot/changeset/43788
Log:
[ops2c] fix the C++ build and use enums instead of chars
Modified:
trunk/include/parrot/op.h
trunk/lib/Parrot/Ops2c/Utils.pm
Modified: trunk/include/parrot/op.h
==============================================================================
--- trunk/include/parrot/op.h Mon Feb 8 16:25:48 2010 (r43787)
+++ trunk/include/parrot/op.h Tue Feb 9 02:40:17 2010 (r43788)
@@ -23,22 +23,22 @@
} op_type_t;
typedef enum {
- PARROT_ARG_IC = PARROT_ARG_INTVAL | PARROT_ARG_CONSTANT,
- PARROT_ARG_NC = PARROT_ARG_FLOATVAL | PARROT_ARG_CONSTANT,
- PARROT_ARG_PC = PARROT_ARG_PMC | PARROT_ARG_CONSTANT,
- PARROT_ARG_SC = PARROT_ARG_STRING | PARROT_ARG_CONSTANT,
- PARROT_ARG_NAME_SC = PARROT_ARG_NAME | PARROT_ARG_STRING | PARROT_ARG_CONSTANT,
-
- PARROT_ARG_KEYED = 0x20,
- PARROT_ARG_KC = PARROT_ARG_PC | PARROT_ARG_KEYED,
- PARROT_ARG_KIC= PARROT_ARG_IC | PARROT_ARG_KEYED,
-
- PARROT_ARG_I = PARROT_ARG_INTVAL,
- PARROT_ARG_N = PARROT_ARG_FLOATVAL,
- PARROT_ARG_P = PARROT_ARG_PMC,
- PARROT_ARG_S = PARROT_ARG_STRING,
- PARROT_ARG_K = PARROT_ARG_P | PARROT_ARG_KEYED,
- PARROT_ARG_KI= PARROT_ARG_I | PARROT_ARG_KEYED
+ PARROT_ARG_IC = PARROT_ARG_INTVAL | PARROT_ARG_CONSTANT,
+ PARROT_ARG_NC = PARROT_ARG_FLOATVAL | PARROT_ARG_CONSTANT,
+ PARROT_ARG_PC = PARROT_ARG_PMC | PARROT_ARG_CONSTANT,
+ PARROT_ARG_SC = PARROT_ARG_STRING | PARROT_ARG_CONSTANT,
+ PARROT_ARG_NAME_SC = PARROT_ARG_NAME | PARROT_ARG_STRING | PARROT_ARG_CONSTANT,
+
+ PARROT_ARG_KEYED = 0x20,
+ PARROT_ARG_KC = PARROT_ARG_PC | PARROT_ARG_KEYED,
+ PARROT_ARG_KIC = PARROT_ARG_IC | PARROT_ARG_KEYED,
+
+ PARROT_ARG_I = PARROT_ARG_INTVAL,
+ PARROT_ARG_N = PARROT_ARG_FLOATVAL,
+ PARROT_ARG_P = PARROT_ARG_PMC,
+ PARROT_ARG_S = PARROT_ARG_STRING,
+ PARROT_ARG_K = PARROT_ARG_P | PARROT_ARG_KEYED,
+ PARROT_ARG_KI = PARROT_ARG_I | PARROT_ARG_KEYED
} arg_type_t;
typedef enum {
@@ -74,17 +74,15 @@
*/
typedef struct op_info_t {
- /* op_type_t type; unused */
- const char *name;
- const char *full_name;
- const char *func_name;
- /* const char *body; unused */
- unsigned short jump; /* s. above */
- short op_count; /* Includes opcode as one arg */
- char types[PARROT_MAX_ARGS]; /* arg_type_t, 0 = 1st arg */
- char dirs[PARROT_MAX_ARGS]; /* arg_dir_t 0 = 1st arg */
- char labels[PARROT_MAX_ARGS]; /* 0/1 0 = 1st arg */
- unsigned int flags;
+ const char *name;
+ const char *full_name;
+ const char *func_name;
+ unsigned short jump;
+ short op_count; /* Includes opcode as one arg */
+ arg_type_t types[PARROT_MAX_ARGS]; /* arg_type_t, 0 = 1st arg */
+ arg_dir_t dirs[PARROT_MAX_ARGS]; /* arg_dir_t 0 = 1st arg */
+ char labels[PARROT_MAX_ARGS]; /* 0/1 0 = 1st arg */
+ unsigned int flags;
} op_info_t;
Modified: trunk/lib/Parrot/Ops2c/Utils.pm
==============================================================================
--- trunk/lib/Parrot/Ops2c/Utils.pm Mon Feb 8 16:25:48 2010 (r43787)
+++ trunk/lib/Parrot/Ops2c/Utils.pm Tue Feb 9 02:40:17 2010 (r43788)
@@ -814,13 +814,13 @@
. join( ", ",
scalar $op->arg_types
? map { sprintf( "PARROT_ARG_%s", uc $_ ) } $op->arg_types
- : 0 )
- . " }";
+ : '(arg_type_t) 0'
+ ) . " }";
my $arg_dirs = "{ "
. join(
", ", scalar $op->arg_dirs
? map { $arg_dir_mapping{$_} } $op->arg_dirs
- : 0
+ : '(arg_dir_t) 0'
) . " }";
my $labels = "{ "
. join(
More information about the parrot-commits
mailing list