diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cdump.c | 2 | ||||
| -rw-r--r-- | src/dump.c | 8 | ||||
| -rw-r--r-- | src/range.c | 6 | ||||
| -rw-r--r-- | src/string.c | 22 | ||||
| -rw-r--r-- | src/struct.c | 4 |
5 files changed, 10 insertions, 32 deletions
diff --git a/src/cdump.c b/src/cdump.c index 247511f5a..7beb3544f 100644 --- a/src/cdump.c +++ b/src/cdump.c @@ -145,7 +145,7 @@ make_cdump_irep(mrb_state *mrb, int irep_no, FILE *f) case MRB_TT_FLOAT: SOURCE_CODE(" irep->pool[%d] = mrb_float_value(%.16e);", n, mrb_float(irep->pool[n])); break; case MRB_TT_FIXNUM: - SOURCE_CODE(" irep->pool[%d] = mrb_fixnum_value(%d);", n, mrb_fixnum(irep->pool[n])); break; + SOURCE_CODE(" irep->pool[%d] = mrb_fixnum_value(%" MRB_INT_FORMAT ");", n, mrb_fixnum(irep->pool[n])); break; case MRB_TT_STRING: str_len = str_format_len(irep->pool[n]) + 1; if ( str_len > buf_len ) { diff --git a/src/dump.c b/src/dump.c index 884a9141f..e0d755c8c 100644 --- a/src/dump.c +++ b/src/dump.c @@ -59,7 +59,7 @@ static inline int uint16_dump(uint16_t,char*,int); static inline int uint32_dump(uint32_t,char*,int); static char* str_dump(char*,char*,uint16_t,int); static uint16_t str_dump_len(char*,uint16_t, int); -static uint32_t get_irep_header_size(mrb_state*,mrb_irep*,int); +static uint32_t get_irep_header_size(mrb_state*,int); static uint32_t get_iseq_block_size(mrb_state*,mrb_irep*,int); static uint32_t get_pool_block_size(mrb_state*,mrb_irep*,int); static uint32_t get_syms_block_size(mrb_state*,mrb_irep*,int); @@ -202,7 +202,7 @@ str_dump_len(char *str, uint16_t len, int type) } static uint32_t -get_irep_header_size(mrb_state *mrb, mrb_irep *irep, int type) +get_irep_header_size(mrb_state *mrb, int type) { uint32_t size = 0; @@ -305,7 +305,7 @@ get_irep_record_size(mrb_state *mrb, int irep_no, int type) mrb_irep *irep = mrb->irep[irep_no]; size += DUMP_SIZE(MRB_DUMP_SIZE_OF_LONG, type); /* rlen */ - size += get_irep_header_size(mrb, irep, type); + size += get_irep_header_size(mrb, type); size += get_iseq_block_size(mrb, irep, type); size += get_pool_block_size(mrb, irep, type); size += get_syms_block_size(mrb, irep, type); @@ -480,7 +480,7 @@ calc_crc_section(mrb_state *mrb, mrb_irep *irep, uint16_t *crc, int section) int result; switch (section) { - case DUMP_IREP_HEADER: buf_size = get_irep_header_size(mrb, irep, type); break; + case DUMP_IREP_HEADER: buf_size = get_irep_header_size(mrb, type); break; case DUMP_ISEQ_BLOCK: buf_size = get_iseq_block_size(mrb, irep, type); break; case DUMP_POOL_BLOCK: buf_size = get_pool_block_size(mrb, irep, type); break; case DUMP_SYMS_BLOCK: buf_size = get_syms_block_size(mrb, irep, type); break; diff --git a/src/range.c b/src/range.c index ef92ed822..2cdc34f5c 100644 --- a/src/range.c +++ b/src/range.c @@ -43,8 +43,8 @@ mrb_range_new(mrb_state *mrb, mrb_value beg, mrb_value end, int excl) struct RRange *r; r = (struct RRange*)mrb_obj_alloc(mrb, MRB_TT_RANGE, RANGE_CLASS); - r->edges = (struct mrb_range_edges *)mrb_malloc(mrb, sizeof(struct mrb_range_edges)); range_check(mrb, beg, end); + r->edges = (struct mrb_range_edges *)mrb_malloc(mrb, sizeof(struct mrb_range_edges)); r->edges->beg = beg; r->edges->end = end; r->excl = excl; @@ -333,7 +333,7 @@ range_to_s(mrb_state *mrb, mrb_value range) } static mrb_value -inspect_range(mrb_state *mrb, mrb_value range, mrb_value dummy, int recur) +inspect_range(mrb_state *mrb, mrb_value range, int recur) { mrb_value str, str2; struct RRange *r = mrb_range_ptr(range); @@ -368,7 +368,7 @@ inspect_range(mrb_state *mrb, mrb_value range, mrb_value dummy, int recur) static mrb_value range_inspect(mrb_state *mrb, mrb_value range) { - return inspect_range(mrb, range, range, 0); + return inspect_range(mrb, range, 0); } /* 15.2.14.4.14(x) */ diff --git a/src/string.c b/src/string.c index 144c4bd2a..df74bb3c8 100644 --- a/src/string.c +++ b/src/string.c @@ -6,7 +6,6 @@ #include "mruby.h" -#include <stdarg.h> #include <string.h> #include "mruby/string.h" #include <ctype.h> @@ -2854,27 +2853,6 @@ mrb_str_cat2(mrb_state *mrb, mrb_value str, const char *ptr) return mrb_str_cat(mrb, str, ptr, strlen(ptr)); } -static mrb_value -mrb_str_vcatf(mrb_state *mrb, mrb_value str, const char *fmt, va_list ap) -{ - mrb_string_value(mrb, &str); - mrb_str_resize(mrb, str, (char*)RSTRING_END(str) - RSTRING_PTR(str)); - - return str; -} - -mrb_value -mrb_str_catf(mrb_state *mrb, mrb_value str, const char *format, ...) -{ - va_list ap; - - va_start(ap, format); - str = mrb_str_vcatf(mrb, str, format, ap); - va_end(ap); - - return str; -} - mrb_value mrb_str_append(mrb_state *mrb, mrb_value str, mrb_value str2) { diff --git a/src/struct.c b/src/struct.c index 85d0fa094..1396cd728 100644 --- a/src/struct.c +++ b/src/struct.c @@ -463,7 +463,7 @@ mrb_struct_initialize(mrb_state *mrb, mrb_value self, mrb_value values) } static mrb_value -inspect_struct(mrb_state *mrb, mrb_value s, mrb_value dummy, int recur) +inspect_struct(mrb_state *mrb, mrb_value s, int recur) { const char *cn = mrb_class_name(mrb, mrb_obj_class(mrb, s)); mrb_value members, str = mrb_str_new(mrb, "#<struct ", 9); @@ -521,7 +521,7 @@ inspect_struct(mrb_state *mrb, mrb_value s, mrb_value dummy, int recur) static mrb_value mrb_struct_inspect(mrb_state *mrb, mrb_value s) { - return inspect_struct(mrb, s, s, 0); + return inspect_struct(mrb, s, 0); } /* 15.2.18.4.9 */ |
