From 3e1d60ae0b36b02e20b90d6cba95e8742671dd69 Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Mon, 25 Sep 2017 16:11:33 +0200 Subject: fix: src\hash.c(27): warning C4244: '=': conversion from 'mrb_int' to 'khint_t', possible loss of data --- src/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index 01d706fa3..f50468cca 100644 --- a/src/string.c +++ b/src/string.c @@ -1467,7 +1467,7 @@ mrb_str_substr(mrb_state *mrb, mrb_value str, mrb_int beg, mrb_int len) return str_substr(mrb, str, beg, len); } -mrb_int +uint32_t mrb_str_hash(mrb_state *mrb, mrb_value str) { /* 1-8-7 */ @@ -1480,7 +1480,7 @@ mrb_str_hash(mrb_state *mrb, mrb_value str) key = key*65599 + *p; p++; } - return (mrb_int)(key + (key>>5)); + return (uint32_t)(key + (key>>5)); } /* 15.2.10.5.20 */ -- cgit v1.2.3 From 46ccabacf0a7c45e3e2fab1484545536ae5464d5 Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Mon, 25 Sep 2017 16:28:43 +0200 Subject: fix: src\string.c(497): warning C4244: '=': conversion from 'mrb_int' to 'long', possible loss of data --- src/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index f50468cca..54987ca64 100644 --- a/src/string.c +++ b/src/string.c @@ -488,7 +488,7 @@ check_frozen(mrb_state *mrb, struct RString *s) static mrb_value str_replace(mrb_state *mrb, struct RString *s1, struct RString *s2) { - long len; + mrb_int len; check_frozen(mrb, s1); if (s1 == s2) return mrb_obj_value(s1); -- cgit v1.2.3 From 027b8d83774245fe5af4334993995d450bc911ef Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Mon, 25 Sep 2017 16:30:36 +0200 Subject: fix: src\string.c(1130): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data --- src/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index 54987ca64..e455540f3 100644 --- a/src/string.c +++ b/src/string.c @@ -1125,7 +1125,7 @@ static mrb_value mrb_str_aref_m(mrb_state *mrb, mrb_value str) { mrb_value a1, a2; - int argc; + mrb_int argc; argc = mrb_get_args(mrb, "o|o", &a1, &a2); if (argc == 2) { -- cgit v1.2.3 From ef8df492e94cc0b94c5b504ebcbe42ecccb7a086 Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Mon, 25 Sep 2017 16:31:06 +0200 Subject: fix: src\string.c(1924): warning C4244: '=': conversion from 'mrb_int' to 'int', possible loss of data --- src/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index e455540f3..9a557bd08 100644 --- a/src/string.c +++ b/src/string.c @@ -1911,7 +1911,7 @@ mrb_str_rindex(mrb_state *mrb, mrb_value str) static mrb_value mrb_str_split_m(mrb_state *mrb, mrb_value str) { - int argc; + mrb_int argc; mrb_value spat = mrb_nil_value(); enum {awk, string, regexp} split_type = string; mrb_int i = 0; -- cgit v1.2.3 From 53f934a7ee2928b684189617af76c96b46731a83 Mon Sep 17 00:00:00 2001 From: Tomasz Dąbrowski Date: Mon, 25 Sep 2017 16:39:27 +0200 Subject: fix: src\string.c(2219): warning C4244: 'function': conversion from 'mrb_int' to 'int', possible loss of data --- src/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index 9a557bd08..1b57efc71 100644 --- a/src/string.c +++ b/src/string.c @@ -2025,7 +2025,7 @@ mrb_str_split_m(mrb_state *mrb, mrb_value str) } MRB_API mrb_value -mrb_str_len_to_inum(mrb_state *mrb, const char *str, size_t len, int base, int badcheck) +mrb_str_len_to_inum(mrb_state *mrb, const char *str, mrb_int len, mrb_int base, int badcheck) { const char *p = str; const char *pend = str + len; -- cgit v1.2.3