Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace some problematic uses of String::num to String::num_int64 #101595

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/debugger/remote_debugger_peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,12 @@ Error RemoteDebuggerPeerTCP::connect_to_host(const String &p_host, uint16_t p_po
} else {
const int ms = waits[i];
OS::get_singleton()->delay_usec(ms * 1000);
print_verbose("Remote Debugger: Connection failed with status: '" + String::num(tcp_client->get_status()) + "', retrying in " + String::num(ms) + " msec.");
print_verbose("Remote Debugger: Connection failed with status: '" + String::num_int64(tcp_client->get_status()) + "', retrying in " + String::num_int64(ms) + " msec.");
}
}

if (tcp_client->get_status() != StreamPeerTCP::STATUS_CONNECTED) {
ERR_PRINT(vformat("Remote Debugger: Unable to connect. Status: %s.", String::num(tcp_client->get_status())));
ERR_PRINT(vformat("Remote Debugger: Unable to connect. Status: %s.", String::num_int64(tcp_client->get_status())));
return FAILED;
}
connected = true;
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1747,7 +1747,7 @@ void EditorFileSystem::_save_filesystem_cache(EditorFileSystemDirectory *p_dir,
if (!p_dir) {
return; //none
}
p_file->store_line("::" + p_dir->get_path() + "::" + String::num(p_dir->modified_time));
p_file->store_line("::" + p_dir->get_path() + "::" + String::num_int64(p_dir->modified_time));

for (int i = 0; i < p_dir->files.size(); i++) {
const EditorFileSystemDirectory::FileInfo *file_info = p_dir->files[i];
Expand Down
2 changes: 1 addition & 1 deletion editor/export/editor_export_platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2209,7 +2209,7 @@ Vector<String> EditorExportPlatform::gen_export_flags(BitField<EditorExportPlatf
if (p_flags.has_flag(DEBUG_FLAG_REMOTE_DEBUG)) {
ret.push_back("--remote-debug");

ret.push_back(get_debug_protocol() + host + ":" + String::num(remote_port));
ret.push_back(get_debug_protocol() + host + ":" + String::num_int64(remote_port));

List<String> breakpoints;
ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
Expand Down
4 changes: 2 additions & 2 deletions editor/plugins/script_text_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ void ScriptTextEditor::_update_bookmark_list() {
line = line.substr(0, 50);
}

bookmarks_menu->add_item(String::num((int)bookmark_list[i] + 1) + " - `" + line + "`");
bookmarks_menu->add_item(String::num_int64(bookmark_list[i] + 1) + " - `" + line + "`");
bookmarks_menu->set_item_metadata(-1, bookmark_list[i]);
}
}
Expand Down Expand Up @@ -912,7 +912,7 @@ void ScriptTextEditor::_update_breakpoint_list() {
line = line.substr(0, 50);
}

breakpoints_menu->add_item(String::num((int)breakpoint_list[i] + 1) + " - `" + line + "`");
breakpoints_menu->add_item(String::num_int64(breakpoint_list[i] + 1) + " - `" + line + "`");
breakpoints_menu->set_item_metadata(-1, breakpoint_list[i]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/text_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ void TextEditor::_update_bookmark_list() {
line = line.substr(0, 50);
}

bookmarks_menu->add_item(String::num((int)bookmark_list[i] + 1) + " - \"" + line + "\"");
bookmarks_menu->add_item(String::num_int64(bookmark_list[i] + 1) + " - \"" + line + "\"");
bookmarks_menu->set_item_metadata(-1, bookmark_list[i]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/text_shader_editor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,7 @@ void TextShaderEditor::_update_bookmark_list() {
line = line.substr(0, 50);
}

bookmarks_menu->add_item(String::num((int)bookmark_list[i] + 1) + " - \"" + line + "\"");
bookmarks_menu->add_item(String::num_int64(bookmark_list[i] + 1) + " - \"" + line + "\"");
bookmarks_menu->set_item_metadata(-1, bookmark_list[i]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/regex/regex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ Error RegEx::compile(const String &p_pattern, bool p_show_error) {
if (p_show_error) {
PCRE2_UCHAR32 buf[256];
pcre2_get_error_message_32(err, buf, 256);
String message = String::num(offset) + ": " + String((const char32_t *)buf);
String message = String::num_int64(offset) + ": " + String((const char32_t *)buf);
ERR_PRINT(message.utf8());
}
return FAILED;
Expand Down
2 changes: 1 addition & 1 deletion modules/websocket/emws_peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Error EMWSPeer::connect_to_url(const String &p_url, Ref<TLSOptions> p_tls_option
requested_url = scheme + host;

if (port && ((scheme == "ws://" && port != 80) || (scheme == "wss://" && port != 443))) {
requested_url += ":" + String::num(port);
requested_url += ":" + String::num_int64(port);
}

if (!path.is_empty()) {
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/export/export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3163,7 +3163,7 @@ Error EditorExportPlatformIOS::run(const Ref<EditorExportPreset> &p_preset, int
if (p_debug_flags.has_flag(DEBUG_FLAG_REMOTE_DEBUG)) {
cmd_args_list.push_back("--remote-debug");

cmd_args_list.push_back(get_debug_protocol() + host + ":" + String::num(remote_port));
cmd_args_list.push_back(get_debug_protocol() + host + ":" + String::num_int64(remote_port));

List<String> breakpoints;
ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
Expand Down
2 changes: 1 addition & 1 deletion platform/ios/ios.mm
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
String iOS::get_rate_url(int p_app_id) const {
String app_url_path = "itms-apps://itunes.apple.com/app/idAPP_ID";

String ret = app_url_path.replace("APP_ID", String::num(p_app_id));
String ret = app_url_path.replace("APP_ID", String::num_int64(p_app_id));

print_verbose(vformat("Returning rate url %s", ret));
return ret;
Expand Down