From fd9aee1ca39171e2f585ea7db7c401bf1d901468 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 29 May 2007 15:49:30 +0000 Subject: [PATCH] * gc.c (rb_source_filename, obj_free): supress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12405 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 +++- gc.c | 15 +++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c86ab167c..57b5c56e05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -Wed May 30 00:47:21 2007 Nobuyoshi Nakada +Wed May 30 00:50:48 2007 Nobuyoshi Nakada + + * gc.c (rb_source_filename, obj_free): supress warnings. * gc.c (garbage_collect, yarv_machine_stack_mark): fixed typo. http://bugs.debian.org/426267 diff --git a/gc.c b/gc.c index eb98b809f7..91340475e1 100644 --- a/gc.c +++ b/gc.c @@ -18,6 +18,7 @@ #include "node.h" #include "re.h" #include "yarvcore.h" +#include "gc.h" #include #include #include @@ -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)); }