Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Get dynamic repr registration to return the ID given to the represent…
…ation.
  • Loading branch information
jnthn committed Nov 8, 2011
1 parent 006974d commit 6d52f98
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/6model/repr_registry.c
Expand Up @@ -40,9 +40,10 @@ static void register_repr(PARROT_INTERP, STRING *name, REPROps *repr) {

/* Dynamically registers a representation (that is, one defined outside of
* the 6model core). */
void REPR_register_dynamic(PARROT_INTERP, STRING *name, REPROps * (*reg) (PARROT_INTERP, void *, void *)) {
INTVAL REPR_register_dynamic(PARROT_INTERP, STRING *name, REPROps * (*reg) (PARROT_INTERP, void *, void *)) {
REPROps *repr = reg(interp, wrap_object, create_stable);
register_repr(interp, name, repr);
return repr->ID;
}

/* Initializes the representations registry, building up all of the various
Expand Down
2 changes: 1 addition & 1 deletion src/6model/sixmodelobject.h
Expand Up @@ -288,7 +288,7 @@ PMC * create_stable(PARROT_INTERP, REPROps *REPR, PMC *HOW);
PMC * decontainerize(PARROT_INTERP, PMC *var);

/* Dynamic representation registration. */
typedef void (* rf) (PARROT_INTERP, STRING *name, REPROps * (*reg) (PARROT_INTERP, void *, void *));
typedef INTVAL (* rf) (PARROT_INTERP, STRING *name, REPROps * (*reg) (PARROT_INTERP, void *, void *));
#define REGISTER_DYNAMIC_REPR(interp, name, reg_func) \
((rf) \
VTABLE_get_pointer(interp, \
Expand Down

0 comments on commit 6d52f98

Please sign in to comment.