diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-05-29 15:49:30 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-05-29 15:49:30 +0000 |
| commit | a32658790aa9c7b69b0d6b03dab773d194ed2257 (patch) | |
| tree | b1d0a8a4cf3f802ea01a0d1c8340420c822c350e | |
| parent | 3915c1f7afe8575c4fd89c45523b490c0f1d67bd (diff) | |
* gc.c (rb_source_filename, obj_free): supress warnings.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | gc.c | 15 |
2 files changed, 12 insertions, 7 deletions
@@ -1,4 +1,6 @@ -Wed May 30 00:47:21 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> +Wed May 30 00:50:48 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * gc.c (rb_source_filename, obj_free): supress warnings. * gc.c (garbage_collect, yarv_machine_stack_mark): fixed typo. http://bugs.debian.org/426267 @@ -18,6 +18,7 @@ #include "node.h" #include "re.h" #include "yarvcore.h" +#include "gc.h" #include <stdio.h> #include <setjmp.h> #include <sys/types.h> @@ -611,17 +612,19 @@ static st_table *source_filenames; char * rb_source_filename(const char *f) { - char *name; + st_data_t name; - if (!st_lookup(source_filenames, (st_data_t)f, (st_data_t *)&name)) { + if (!st_lookup(source_filenames, (st_data_t)f, &name)) { long len = strlen(f) + 1; - char *ptr = name = ALLOC_N(char, len + 1); + char *ptr = ALLOC_N(char, len + 1); + + name = (st_data_t)ptr; *ptr++ = 0; MEMCPY(ptr, f, char, len); - st_add_direct(source_filenames, (st_data_t)ptr, (st_data_t)name); + st_add_direct(source_filenames, (st_data_t)ptr, name); return ptr; } - return name + 1; + return (char *)name + 1; } static void @@ -1281,7 +1284,7 @@ obj_free(VALUE obj) return; /* no need to free iv_tbl */ case T_STRUCT: - if (RBASIC(obj)->flags & RSTRUCT_EMBED_LEN_MASK == 0 && + if ((RBASIC(obj)->flags & RSTRUCT_EMBED_LEN_MASK) == 0 && RANY(obj)->as.rstruct.as.heap.ptr) { RUBY_CRITICAL(free(RANY(obj)->as.rstruct.as.heap.ptr)); } |
