summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-12 09:16:15 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-03-12 09:16:15 +0000
commitd1abc53721a15bd545b60c875b05f28dd7e01e57 (patch)
tree44da5708baceb68988497901e3915fbcece7c02d /string.c
parent080525aa68c68df1fd4c1484bea1de88e3c1f79f (diff)
* array.c, bignum.c, dln.c, error.c, gc.c, io.c, marshal.c,
numeric.c, pack.c, strftime.c, string.c, thread.c, transcode.c, transcode_data.h, util.c, variable.c, vm_dump.c, include/ruby/encoding.h, missing/crypt.c, missing/vsnprintf.c: suppress VC type warnings. [ruby-core:22726] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/string.c b/string.c
index 950a4315aa..063965ae03 100644
--- a/string.c
+++ b/string.c
@@ -1279,7 +1279,7 @@ rb_string_value_cstr(volatile VALUE *ptr)
VALUE str = rb_string_value(ptr);
char *s = RSTRING_PTR(str);
- if (!s || RSTRING_LEN(str) != strlen(s)) {
+ if (!s || RSTRING_LEN(str) != (long)strlen(s)) {
rb_raise(rb_eArgError, "string contains null byte");
}
return s;
@@ -4794,8 +4794,8 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag)
str_modify_keep_cr(str);
s = RSTRING_PTR(str); send = RSTRING_END(str);
if (sflag) {
- int clen, tlen, max = RSTRING_LEN(str);
- int offset, save = -1;
+ int offset, clen, tlen, max = RSTRING_LEN(str);
+ unsigned int save = -1;
char *buf = ALLOC_N(char, max), *t = buf;
while (s < send) {
@@ -5167,9 +5167,9 @@ rb_str_squeeze_bang(int argc, VALUE *argv, VALUE str)
rb_encoding *enc = 0;
VALUE del = 0, nodel = 0;
char *s, *send, *t;
- int save, modify = 0;
- int i;
+ int i, modify = 0;
int ascompat, singlebyte = single_byte_optimizable(str);
+ unsigned int save;
if (argc == 0) {
enc = STR_ENC_GET(str);
@@ -7013,11 +7013,11 @@ sym_inspect(VALUE sym)
str = rb_enc_str_new(0, RSTRING_LEN(sym)+1, enc);
RSTRING_PTR(str)[0] = ':';
memcpy(RSTRING_PTR(str)+1, RSTRING_PTR(sym), RSTRING_LEN(sym));
- if (RSTRING_LEN(sym) != strlen(RSTRING_PTR(sym)) ||
+ if (RSTRING_LEN(sym) != (long)strlen(RSTRING_PTR(sym)) ||
!rb_enc_symname_p(RSTRING_PTR(sym), enc) ||
!sym_printable(RSTRING_PTR(sym), RSTRING_END(sym), enc)) {
str = rb_str_inspect(str);
- strncpy(RSTRING_PTR(str), ":\"", 2);
+ memcpy(RSTRING_PTR(str), ":\"", 2);
}
return str;
}