1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-09 12:50:35 +00:00

Fix MSVC warning C4706: assignment within conditional expression

Part of #66537.
This commit is contained in:
Rémi Verschelde
2022-09-28 15:59:08 +02:00
parent 14e1f36e61
commit 0e53dd642c
8 changed files with 102 additions and 67 deletions

View File

@@ -2624,10 +2624,11 @@ double String::to_float() const {
uint32_t String::hash(const char *p_cstr) {
uint32_t hashv = 5381;
uint32_t c;
uint32_t c = *p_cstr++;
while ((c = *p_cstr++)) {
while (c) {
hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */
c = *p_cstr++;
}
return hashv;
@@ -2653,10 +2654,11 @@ uint32_t String::hash(const wchar_t *p_cstr, int p_len) {
uint32_t String::hash(const wchar_t *p_cstr) {
uint32_t hashv = 5381;
uint32_t c;
uint32_t c = *p_cstr++;
while ((c = *p_cstr++)) {
while (c) {
hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */
c = *p_cstr++;
}
return hashv;
@@ -2673,10 +2675,11 @@ uint32_t String::hash(const char32_t *p_cstr, int p_len) {
uint32_t String::hash(const char32_t *p_cstr) {
uint32_t hashv = 5381;
uint32_t c;
uint32_t c = *p_cstr++;
while ((c = *p_cstr++)) {
while (c) {
hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */
c = *p_cstr++;
}
return hashv;
@@ -2687,10 +2690,11 @@ uint32_t String::hash() const {
const char32_t *chr = get_data();
uint32_t hashv = 5381;
uint32_t c;
uint32_t c = *chr++;
while ((c = *chr++)) {
while (c) {
hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */
c = *chr++;
}
return hashv;
@@ -2701,10 +2705,11 @@ uint64_t String::hash64() const {
const char32_t *chr = get_data();
uint64_t hashv = 5381;
uint64_t c;
uint64_t c = *chr++;
while ((c = *chr++)) {
while (c) {
hashv = ((hashv << 5) + hashv) + c; /* hash * 33 + c */
c = *chr++;
}
return hashv;