summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-29 15:49:30 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-05-29 15:49:30 +0000
commitfd9aee1ca39171e2f585ea7db7c401bf1d901468 (patch)
treeb1d0a8a4cf3f802ea01a0d1c8340420c822c350e /gc.c
parenta196c4ff5cce1e0544a4d27f1ceb6ef40bbc19b2 (diff)
* 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
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c15
1 files changed, 9 insertions, 6 deletions
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 <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));
}