[svn:parrot] r47702 - trunk/include/parrot
NotFound at svn.parrot.org
NotFound at svn.parrot.org
Sat Jun 19 10:26:05 UTC 2010
Author: NotFound
Date: Sat Jun 19 10:26:04 2010
New Revision: 47702
URL: https://trac.parrot.org/parrot/changeset/47702
Log:
use explicit numbers for enum_fixup values, put together enums for important pbc magic numbers and add some comments with the rationale
Modified:
trunk/include/parrot/packfile.h
Modified: trunk/include/parrot/packfile.h
==============================================================================
--- trunk/include/parrot/packfile.h Sat Jun 19 09:36:29 2010 (r47701)
+++ trunk/include/parrot/packfile.h Sat Jun 19 10:26:04 2010 (r47702)
@@ -91,6 +91,42 @@
#endif
/*
+** Enumerated constants
+** Changes here require update PBC_COMPAT
+** The prefered way to eliminate a value is just to stop using it without
+** renumbering others, that helps to keep backward compatibility.
+*/
+
+/* Packfile segment types */
+
+/* &gen_from_enum(packfile_segments.pasm) */
+
+typedef enum {
+ PF_DIR_SEG = 0,
+ PF_UNKNOWN_SEG = 1,
+ PF_FIXUP_SEG = 2,
+ PF_CONST_SEG = 3,
+ PF_BYTEC_SEG = 4,
+ PF_DEBUG_SEG = 5,
+ PF_ANNOTATIONS_SEG = 6,
+
+ PF_MAX_SEG = 7
+} pack_file_types;
+
+/* &end_gen */
+
+#define PF_DIR_FORMAT 1
+
+/* Fixup types */
+
+typedef enum {
+ enum_fixup_none = 0,
+ enum_fixup_sub = 1,
+ enum_fixup_MAXUSEDVALUE = enum_fixup_sub
+} enum_fixup_t;
+
+
+/*
** Structure Definitions:
*/
@@ -174,24 +210,6 @@
PackFile_Segment_dump_func_t dump;
} PackFile_funcs;
-/* &gen_from_enum(packfile_segments.pasm) */
-
-typedef enum {
- PF_DIR_SEG = 0,
- PF_UNKNOWN_SEG = 1,
- PF_FIXUP_SEG = 2,
- PF_CONST_SEG = 3,
- PF_BYTEC_SEG = 4,
- PF_DEBUG_SEG = 5,
- PF_ANNOTATIONS_SEG = 6,
-
- PF_MAX_SEG = 7
-} pack_file_types;
-
-/* &end_gen */
-
-#define PF_DIR_FORMAT 1
-
typedef struct PackFile_Segment {
struct PackFile * pf;
struct PackFile_Directory * dir;
@@ -220,11 +238,6 @@
opcode_t offset; /* location of the item */
} PackFile_FixupEntry;
-typedef enum {
- enum_fixup_none,
- enum_fixup_sub
-} enum_fixup_t;
-
typedef struct PackFile_FixupTable {
PackFile_Segment base;
opcode_t fixup_count;
More information about the parrot-commits
mailing list