develooper Front page | perl.perl6.internals | Postings from August 2002

[perl #16025] [PATCH] enum nits

Thread Next
From:
Jarkko Hietaniemi
Date:
August 6, 2002 18:30
Subject:
[perl #16025] [PATCH] enum nits
Message ID:
rt-16025-32991.4.60087778958908@bugs6.perl.org
# New Ticket Created by  Jarkko Hietaniemi 
# Please include the string:  [perl #16025]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=16025 >


The IRIX compiler is again grumpy about mixing enums with ints.

The stacks.c change is funny, looks like my earlier patch was
hand-applied and the (essentially) same line of code got duplicated.

--- core.ops.dist	2002-08-07 04:24:04.000000000 +0300
+++ core.ops	2002-08-07 04:00:01.000000000 +0300
@@ -3672,7 +3672,7 @@
 op store_lex(in STR, in PMC) {
     PMC * hash = NULL;
     KEY key;
-    Stack_entry_type type = NO_STACK_ENTRY_TYPE;
+    Stack_entry_type type = 0;
     MAKE_KEY(key, $1, enum_key_string, struct_val);
     hash = (PMC *)stack_peek(interpreter, interpreter->ctx.pad_stack, &type);
     hash->vtable->set_pmc_keyed(interpreter, hash, NULL, $2, &key);
@@ -3682,7 +3682,7 @@
 op find_lex(out PMC, in STR) {
     PMC * hash = NULL;
     KEY key;
-    Stack_entry_type type = NO_STACK_ENTRY_TYPE;
+    Stack_entry_type type = 0;
     MAKE_KEY(key, $2, enum_key_string, struct_val);
     hash = (PMC *)stack_peek(interpreter, interpreter->ctx.pad_stack, &type);
     $1 = hash->vtable->get_pmc_keyed(interpreter, hash, &key);
--- stacks.c.dist	2002-08-07 04:23:24.000000000 +0300
+++ stacks.c	2002-08-07 04:24:36.000000000 +0300
@@ -90,8 +90,8 @@
             last = new_chunk;
         }
         new_chunk->used = old_chunk->used;
-        new_chunk->flags = old_chunk->flags & ~STACK_CHUNK_COW_FLAG;
-        /* Can't do bit arithmetic on enums. */
+
+        /* Can't do bit arithmetic directly on enums, must cast via ints. */
         new_chunk->flags = (Stack_chunk_flags)((int)old_chunk->flags
                 & ~(int)STACK_CHUNK_COW_FLAG);
 


-- 
$jhi++; # http://www.iki.fi/jhi/
        # There is this special biologist word we use for 'stable'.
        # It is 'dead'. -- Jack Cohen



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About