1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

checker: restrict numeric promotions to cases where no data is lost

This commit is contained in:
Uwe Krüger
2020-05-27 05:42:48 +02:00
committed by GitHub
parent fc67046bac
commit 013fdb8a4b
81 changed files with 510 additions and 247 deletions

View File

@@ -750,7 +750,7 @@ pub fn (s string) ends_with(p string) bool {
pub fn (s string) to_lower() string {
mut b := malloc(s.len + 1)
for i in 0..s.len {
b[i] = C.tolower(s.str[i])
b[i] = byte(C.tolower(s.str[i]))
}
return tos(b, s.len)
}
@@ -767,7 +767,7 @@ pub fn (s string) is_lower() bool {
pub fn (s string) to_upper() string {
mut b := malloc(s.len + 1)
for i in 0..s.len {
b[i] = C.toupper(s.str[i])
b[i] = byte(C.toupper(s.str[i]))
}
return tos(b, s.len)
}