1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2007-05-29 15:49:30 +00:00
parent a196c4ff5c
commit fd9aee1ca3
2 changed files with 12 additions and 7 deletions

View file

@ -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

15
gc.c
View file

@ -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));
}