Ticket #892 (closed RFC: fixed)

Opened 5 years ago

Last modified 4 years ago

PARROT_IN_OBJECTS_C used only in one file

Reported by: NotFound Owned by:
Priority: normal Milestone:
Component: none Version: 1.4.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform:

Description

In include/parrot/vtable.h there is conditional block undef #ifdef PARROT_IN_OBJECTS_C

PARROT_IN_OBJECTS_C is defined only in src/oo.c, and also in src/pmc/class.pmc, but that last usage is wrong. Looking at the generated class.c code, the define is done longer after vtable.h has been included. Deleting it has no effect.

The only real usage is in src/oo.c, then. The definitions inside the vtable.h block are the PARROT_VTABLE_LOW and NUM_VTABLE_FUNCTIONS macros, and the array Parrot_vtable_slot_names. ack'ing for these symbols, they are used only in oo.c, and mentioned in few comments elsewhere. The other practical usages of the PARROT_VTABLE_LOW value ( 9 ) are handled by the code generators and C doesn't see it.

So I suggest to move that definitions to another file, to avoid having that confusing conditional in such an important header.

Change History

Changed 4 years ago by cotto

  • status changed from new to closed
  • resolution set to fixed

I'm not sure why we had this macro in the first place. I removed it and an unused one in 6acd7b and 6702284. There appear to be no ill effects.

Note: See TracTickets for help on using tickets.