Merge pull request #101595 from adamscott/fix-with-String--num_64

Replace some problematic uses of `String::num` to `String::num_int64`
This commit is contained in:
Rémi Verschelde 2025-01-16 01:49:19 +01:00
commit 0726d3c7d5
10 changed files with 12 additions and 12 deletions

View file

@ -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;

View file

@ -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];

View file

@ -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);

View file

@ -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]);
}
}
@ -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]);
}
}

View file

@ -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]);
}
}

View file

@ -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]);
}
}

View file

@ -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;

View file

@ -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()) {

View file

@ -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);

View file

@ -191,7 +191,7 @@ String iOS::get_model() const {
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;