You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Fix -Wsign-compare warnings.
I decided to modify code in a defensive way. Ideally functions like size() or length() should return an unsigned type.
This commit is contained in:
@@ -1417,7 +1417,7 @@ StringName GDScriptTokenizerBuffer::get_token_identifier(int p_offset) const {
|
||||
|
||||
ERR_FAIL_INDEX_V(offset, tokens.size(), StringName());
|
||||
uint32_t identifier = tokens[offset] >> TOKEN_BITS;
|
||||
ERR_FAIL_UNSIGNED_INDEX_V(identifier, identifiers.size(), StringName());
|
||||
ERR_FAIL_UNSIGNED_INDEX_V(identifier, (uint32_t)identifiers.size(), StringName());
|
||||
|
||||
return identifiers[identifier];
|
||||
}
|
||||
@@ -1473,7 +1473,7 @@ const Variant &GDScriptTokenizerBuffer::get_token_constant(int p_offset) const {
|
||||
int offset = token + p_offset;
|
||||
ERR_FAIL_INDEX_V(offset, tokens.size(), nil);
|
||||
uint32_t constant = tokens[offset] >> TOKEN_BITS;
|
||||
ERR_FAIL_UNSIGNED_INDEX_V(constant, constants.size(), nil);
|
||||
ERR_FAIL_UNSIGNED_INDEX_V(constant, (uint32_t)constants.size(), nil);
|
||||
return constants[constant];
|
||||
}
|
||||
String GDScriptTokenizerBuffer::get_token_error(int p_offset) const {
|
||||
|
||||
Reference in New Issue
Block a user