mruby/mruby — pull request #169 by mitchblank (2012-05-20 07:50:31+00:00)
Title: Part 1 of C++ compilability

This is a re-submit of some of the C++ changes I originally sent with pull request #144 last week. This time I've broken it up into individual commits so they're more reviewable. It also isn't complete yet; I still need to fix ~200 implicit "void *" conversions -- I'll probably add some macros to make that cleaner than my first attempt.

Anyway, these changes should be pretty non-controversial and they'll get my diff down to a more manageable size:

Included here:
* Have mrb_object() return a RObject* pointer to avoid void* troubles. Some users have to cast it's output now, but it's a little more explicit that way
* Don't define types inside others, i.e.

```C
struct foo {
struct bar { int a; } b;
int c;
};
```

That has different meanings in C and C++ so just avoid the construct
* st_foreach's callback functions return "enum st_retval" not "int"; make that explicit throughout
* avoid use of C++ keywords ("try", "new", and "not") as variable names
* fix mismatch between definition and declaration of mrb_gc_mark_ht_sze() and mrb_gc_free_ht()
* remove 'volatile' use in sprintf.c, as per Matz's comments on #144
* fix places where we 'goto'ed across a variable initialization since C++ is picky about that
* in parse.y change "node \*node" to "node \*nd" as per Matz's comments on #144