summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-01 20:28:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-01 20:28:01 +0000
commit4940cff399c8c350f43d9151a8c23295e9a6f9d4 (patch)
tree1e9a08f7eae3d31b345674277cc253eb443085fd
parent9ed3d64d1d3e0fd60c9a65d621efdf66c59b0d9d (diff)
* io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique),
(path2class, path2module): constified. * pack.c (pack_unpack), process.c (rb_syswait): suppress warnings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--io.c2
-rw-r--r--marshal.c10
-rw-r--r--pack.c10
-rw-r--r--process.c6
5 files changed, 18 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 55bdb7387b..6694cfac46 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Mon Jun 2 05:27:58 2008 Nobuyoshi Nakada <[email protected]>
+
+ * io.c (rscheck), marshal.c (w_nbyte, w_bytes, w_unique),
+ (path2class, path2module): constified.
+
+ * pack.c (pack_unpack), process.c (rb_syswait): suppress warnings.
+
Mon Jun 2 04:55:05 2008 Nobuyoshi Nakada <[email protected]>
* suppress warnings on cygwin, mingw and mswin.
diff --git a/io.c b/io.c
index 2c31212e5b..50f4756ba3 100644
--- a/io.c
+++ b/io.c
@@ -1681,7 +1681,7 @@ rb_io_getline_fast(fptr, delim)
static int
rscheck(rsptr, rslen, rs)
- char *rsptr;
+ const char *rsptr;
long rslen;
VALUE rs;
{
diff --git a/marshal.c b/marshal.c
index a7735eff53..978079e000 100644
--- a/marshal.c
+++ b/marshal.c
@@ -130,7 +130,7 @@ static void w_long _((long, struct dump_arg*));
static void
w_nbyte(s, n, arg)
- char *s;
+ const char *s;
int n;
struct dump_arg *arg;
{
@@ -153,7 +153,7 @@ w_byte(c, arg)
static void
w_bytes(s, n, arg)
- char *s;
+ const char *s;
int n;
struct dump_arg *arg;
{
@@ -354,7 +354,7 @@ w_symbol(id, arg)
static void
w_unique(s, arg)
- char *s;
+ const char *s;
struct dump_arg *arg;
{
if (s[0] == '#') {
@@ -991,7 +991,7 @@ r_ivar(obj, arg)
static VALUE
path2class(path)
- char *path;
+ const char *path;
{
VALUE v = rb_path2class(path);
@@ -1003,7 +1003,7 @@ path2class(path)
static VALUE
path2module(path)
- char *path;
+ const char *path;
{
VALUE v = rb_path2class(path);
diff --git a/pack.c b/pack.c
index cf348947f1..b22a8348b2 100644
--- a/pack.c
+++ b/pack.c
@@ -1884,8 +1884,8 @@ pack_unpack(str, fmt)
case 'P':
if (sizeof(char *) <= send - s) {
+ VALUE tmp = Qnil;
char *t;
- VALUE tmp;
memcpy(&t, s, sizeof(char *));
s += sizeof(char *);
@@ -1915,9 +1915,6 @@ pack_unpack(str, fmt)
rb_raise(rb_eArgError, "non associated pointer");
}
}
- else {
- tmp = Qnil;
- }
rb_ary_push(ary, tmp);
}
break;
@@ -1929,7 +1926,7 @@ pack_unpack(str, fmt)
if (send - s < sizeof(char *))
break;
else {
- VALUE tmp;
+ VALUE tmp = Qnil;
char *t;
memcpy(&t, s, sizeof(char *));
@@ -1954,9 +1951,6 @@ pack_unpack(str, fmt)
rb_raise(rb_eArgError, "non associated pointer");
}
}
- else {
- tmp = Qnil;
- }
rb_ary_push(ary, tmp);
}
}
diff --git a/process.c b/process.c
index 02d82940c4..c41924dbbf 100644
--- a/process.c
+++ b/process.c
@@ -1409,12 +1409,12 @@ rb_syswait(pid)
{
static int overriding;
#ifdef SIGHUP
- RETSIGTYPE (*hfunc)_((int));
+ RETSIGTYPE (*hfunc)_((int)) = 0;
#endif
#ifdef SIGQUIT
- RETSIGTYPE (*qfunc)_((int));
+ RETSIGTYPE (*qfunc)_((int)) = 0;
#endif
- RETSIGTYPE (*ifunc)_((int));
+ RETSIGTYPE (*ifunc)_((int)) = 0;
int status;
int i, hooked = Qfalse;