Skip to content

Commit

Permalink
resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed May 31, 2012
1 parent 0d8adaa commit 64fc4ac
Show file tree
Hide file tree
Showing 11 changed files with 350 additions and 4,784 deletions.
23 changes: 2 additions & 21 deletions include/mruby/string.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -30,34 +30,15 @@ extern const char mrb_digitmap[];
struct RString { struct RString {
MRUBY_OBJECT_HEADER; MRUBY_OBJECT_HEADER;
int len; int len;
union { int capa;
int capa;
struct RString *shared;
} aux;
char *buf; char *buf;
}; };


extern struct SCOPE {
struct RBasic super;
mrb_sym *local_tbl;
mrb_value *local_vars;
int flags;
} *ruby_scope;

struct RVarmap {
struct RBasic super;
mrb_sym id;
mrb_value val;
struct RVarmap *next;
};
extern struct RVarmap *ruby_dyna_vars;

#define mrb_str_ptr(s) ((struct RString*)((s).value.p)) #define mrb_str_ptr(s) ((struct RString*)((s).value.p))
#define RSTRING(s) ((struct RString*)((s).value.p)) #define RSTRING(s) ((struct RString*)((s).value.p))
#define RSTRING_PTR(s) (RSTRING(s)->buf) #define RSTRING_PTR(s) (RSTRING(s)->buf)
#define RSTRING_LEN(s) (RSTRING(s)->len) #define RSTRING_LEN(s) (RSTRING(s)->len)
#define RSTRING_CAPA(s) (RSTRING(s)->aux.capa) #define RSTRING_CAPA(s) (RSTRING(s)->capa)
#define RSTRING_SHARED(s) (RSTRING(s)->aux.shared)
#define RSTRING_END(s) (RSTRING(s)->buf + RSTRING(s)->len) #define RSTRING_END(s) (RSTRING(s)->buf + RSTRING(s)->len)


#define MRB_STR_SHARED 256 #define MRB_STR_SHARED 256
Expand Down
8 changes: 1 addition & 7 deletions src/class.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -17,12 +17,6 @@


#include "mruby/khash.h" #include "mruby/khash.h"


#ifdef INCLUDE_REGEXP
#define mrb_usascii_str_new2 mrb_usascii_str_new_cstr
#else
#define mrb_usascii_str_new2 mrb_str_new_cstr
#endif

KHASH_MAP_INIT_INT(mt, struct RProc*); KHASH_MAP_INIT_INT(mt, struct RProc*);
KHASH_MAP_INIT_INT(iv, mrb_value); KHASH_MAP_INIT_INT(iv, mrb_value);


Expand Down Expand Up @@ -1052,7 +1046,7 @@ mrb_mod_to_s(mrb_state *mrb, mrb_value klass)
{ {
//if (FL_TEST(klass, FL_SINGLETON)) { //if (FL_TEST(klass, FL_SINGLETON)) {
if (mrb_type(klass) == MRB_TT_SCLASS) { if (mrb_type(klass) == MRB_TT_SCLASS) {
mrb_value s = mrb_usascii_str_new2(mrb, "#<"); mrb_value s = mrb_str_new_cstr(mrb, "#<");
mrb_value v = mrb_iv_get(mrb, klass, mrb_intern(mrb, "__attached__")); mrb_value v = mrb_iv_get(mrb, klass, mrb_intern(mrb, "__attached__"));


mrb_str_cat2(mrb, s, "Class:"); mrb_str_cat2(mrb, s, "Class:");
Expand Down
Loading

0 comments on commit 64fc4ac

Please sign in to comment.