ronantakizawa/codereview-bench huggingface dataset:
Repository: godotengine/godot
File: core/os/os.cpp (C++)

Code before:
	Dictionary meminfo;

	meminfo["physical"] = -1;
	meminfo["free"] = -1;
	meminfo["available"] = -1;
	meminfo["stack"] = -1;

	return meminfo;
}

void OS::yield() {
}

void OS::ensure_user_data_dir() {
	String dd = get_user_data_dir();
	if (DirAccess::exists(dd)) {
		return;
	}

	Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
	Error err = da->make_dir_recursive(dd);
	ERR_FAIL_COND_MSG(err != OK, "Error attempting to create data dir: " + dd + ".");
}

String OS::get_model_name() const {
	return "GenericDevice";
}

void OS::set_cmdline(const char *p_execpath, const List<String> &p_args, const List<String> &p_user_args) {
	_execpath = String::utf8(p_execpath);
	_cmdline = p_args;
	_user_args = p_user_args;
}

String OS::get_unique_id() const {
	ERR_FAIL_V("");
}

int OS::get_processor_count() const {
	return std::thread::hardware_concurrency();
}

String OS::get_processor_name() const {
	return "";
}

void OS::set_has_server_feature_callback(HasServerFeatureCallback p_callback) {
	has_server_feature_callback = p_callback;
}

bool OS::has_feature(const String &p_feature) {

Review comment (refactor):
This is pretty hacky, and shouldn't here. The abstract `OS` class shouldn't know about its implementations so it shouldn't hardcode a special case.

You can do this logic in the editor code.

Code after:

	meminfo["physical"] = -1;
	meminfo["free"] = -1;
	meminfo["available"] = -1;
	meminfo["stack"] = -1;

	return meminfo;
}

void OS::yield() {
}

void OS::ensure_user_data_dir() {
	String dd = get_user_data_dir();
	if (DirAccess::exists(dd)) {
		return;
	}

	Ref<DirAccess> da = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
	Error err = da->make_dir_recursive(dd);
	ERR_FAIL_COND_MSG(err != OK, "Error attempting to create data dir: " + dd + ".");
}

String OS::get_model_name() const {
	return "GenericDevice";
}

void OS::set_cmdline(const char *p_execpath, const List<String> &p_args, const List<String> &p_user_args) {
	_execpath = String::utf8(p_execpath);
	_cmdline = p_args;
	_user_args = p_user_args;
}

String OS::get_unique_id() const {
	ERR_FAIL_V("");
}

int OS::get_processor_count() const {
	return std::thread::hardware_concurrency();
}

String OS::get_processor_name() const {
	return "";
}

void OS::set_has_server_feature_callback(HasServerFeatureCallback p_callback) {
	has_server_feature_callback = p_callback;
}

bool OS::has_feature(const String &p_feature) {
	// Feature tags are always lowercase for consistency.
Repository: godotengine/godot
File: platform/linuxbsd/display_server_x11.cpp (C++)

Code before:
					break;
				}
			}

			if (found_active_mode) {
				for (int mode = 0; mode < screen_info->nmode; mode++) {
					XRRModeInfo m_info = screen_info->modes[mode];
					if (m_info.id == current_mode) {
						// Snap to nearest 0.01 to stay consistent with other platforms.
						return Math::snapped((float)m_info.dotClock / ((float)m_info.hTotal * (float)m_info.vTotal), 0.01);
					}
				}
			}

			ERR_PRINT("An error occurred while trying to get the screen refresh rate."); // We should have returned the refresh rate by now. An error must have occurred.
			return SCREEN_REFRESH_RATE_FALLBACK;
		} else {
			ERR_PRINT("An error occurred while trying to get the screen refresh rate.");
			return SCREEN_REFRESH_RATE_FALLBACK;
		}
	}
	ERR_PRINT("An error occurred while trying to get the screen refresh rate.");
	return SCREEN_REFRESH_RATE_FALLBACK;
}

bool DisplayServerX11::screen_is_touchscreen(int p_screen) const {
	_THREAD_SAFE_METHOD_

#ifndef _MSC_VER
#warning Need to get from proper window
#endif

	return DisplayServer::screen_is_touchscreen(p_screen);
}

#ifdef DBUS_ENABLED
void DisplayServerX11::screen_set_keep_on(bool p_enable) {
	if (screen_is_kept_on() == p_enable) {
		return;
	}

	if (p_enable) {
		screensaver->inhibit();
	} else {
		screensaver->uninhibit();
	}

	keep_screen_on = p_enable;
}

bool DisplayServerX11::screen_is_kept_on() const {

Review comment (suggestion):
I guess this method should be removed until and if it's actually implemented (a comment does not have any useful information). Same for Windows.

Code after:
					break;
				}
			}

			if (found_active_mode) {
				for (int mode = 0; mode < screen_info->nmode; mode++) {
					XRRModeInfo m_info = screen_info->modes[mode];
					if (m_info.id == current_mode) {
						// Snap to nearest 0.01 to stay consistent with other platforms.
						return Math::snapped((float)m_info.dotClock / ((float)m_info.hTotal * (float)m_info.vTotal), 0.01);
					}
				}
			}

			ERR_PRINT("An error occurred while trying to get the screen refresh rate."); // We should have returned the refresh rate by now. An error must have occurred.
			return SCREEN_REFRESH_RATE_FALLBACK;
		} else {
			ERR_PRINT("An error occurred while trying to get the screen refresh rate.");
			return SCREEN_REFRESH_RATE_FALLBACK;
		}
	}
	ERR_PRINT("An error occurred while trying to get the screen refresh rate.");
	return SCREEN_REFRESH_RATE_FALLBACK;
}

#ifdef DBUS_ENABLED
void DisplayServerX11::screen_set_keep_on(bool p_enable) {
	if (screen_is_kept_on() == p_enable) {
		return;
	}

	if (p_enable) {
		screensaver->inhibit();
	} else {
		screensaver->uninhibit();
	}

	keep_screen_on = p_enable;
}

bool DisplayServerX11::screen_is_kept_on() const {
	return keep_screen_on;
}
#endif

Vector<DisplayServer::WindowID> DisplayServerX11::get_window_list() const {
	_THREAD_SAFE_METHOD_

	Vector<int> ret;
	for (const KeyValue<WindowID, WindowData> &E : windows) {
		ret.push_back(E.key);
Repository: godotengine/godot
File: core/core_bind.h (C/C++)

Code before:
		FLAG_SAVE_BIG_ENDIAN = 16,
		FLAG_COMPRESS = 32,
		FLAG_REPLACE_SUBRESOURCE_PATHS = 64,
	};

	static ResourceSaver *get_singleton() { return singleton; }

	Error save(const Ref<Resource> &p_resource, const String &p_path, BitField<SaverFlags> p_flags);
	Vector<String> get_recognized_extensions(const Ref<Resource> &p_resource);
	void add_resource_format_saver(Ref<ResourceFormatSaver> p_format_saver, bool p_at_front);
	void remove_resource_format_saver(Ref<ResourceFormatSaver> p_format_saver);

	ResourceSaver() { singleton = this; }
};

class OS : public Object {
	GDCLASS(OS, Object);

protected:
	static void _bind_methods();
	static OS *singleton;

public:
	enum VideoDriver {
		VIDEO_DRIVER_VULKAN,
		VIDEO_DRIVER_OPENGL_3,
	};

	enum Weekday {
		DAY_SUNDAY,
		DAY_MONDAY,
		DAY_TUESDAY,
		DAY_WEDNESDAY,
		DAY_THURSDAY,
		DAY_FRIDAY,
		DAY_SATURDAY
	};

	enum Month {
		// Start at 1 to follow Windows SYSTEMTIME structure
		// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724950(v=vs.85).aspx
		MONTH_JANUARY = 1,
		MONTH_FEBRUARY,
		MONTH_MARCH,
		MONTH_APRIL,
		MONTH_MAY,
		MONTH_JUNE,
		MONTH_JULY,
		MONTH_AUGUST,
		MONTH_SEPTEMBER,
		MONTH_OCTOBER,

Review comment (suggestion):
Personally I think it would look better as `_OPENGL3` instead of `_OPENGL_3`, but I'm fine with either :)

Code after:
		FLAG_SAVE_BIG_ENDIAN = 16,
		FLAG_COMPRESS = 32,
		FLAG_REPLACE_SUBRESOURCE_PATHS = 64,
	};

	static ResourceSaver *get_singleton() { return singleton; }

	Error save(const Ref<Resource> &p_resource, const String &p_path, BitField<SaverFlags> p_flags);
	Vector<String> get_recognized_extensions(const Ref<Resource> &p_resource);
	void add_resource_format_saver(Ref<ResourceFormatSaver> p_format_saver, bool p_at_front);
	void remove_resource_format_saver(Ref<ResourceFormatSaver> p_format_saver);

	ResourceSaver() { singleton = this; }
};

class OS : public Object {
	GDCLASS(OS, Object);

protected:
	static void _bind_methods();
	static OS *singleton;

public:
	enum RenderingDriver {
		RENDERING_DRIVER_VULKAN,
		RENDERING_DRIVER_OPENGL3,
	};

	enum Weekday {
		DAY_SUNDAY,
		DAY_MONDAY,
		DAY_TUESDAY,
		DAY_WEDNESDAY,
		DAY_THURSDAY,
		DAY_FRIDAY,
		DAY_SATURDAY
	};

	enum Month {
		// Start at 1 to follow Windows SYSTEMTIME structure
		// https://msdn.microsoft.com/en-us/library/windows/desktop/ms724950(v=vs.85).aspx
		MONTH_JANUARY = 1,
		MONTH_FEBRUARY,
		MONTH_MARCH,
		MONTH_APRIL,
		MONTH_MAY,
		MONTH_JUNE,
		MONTH_JULY,
		MONTH_AUGUST,
		MONTH_SEPTEMBER,
		MONTH_OCTOBER,
Repository: godotengine/godot
File: platform/uwp/os_uwp.cpp (C++)

Code before:

	NetSocketPosix::make_default();

	// We need to know how often the clock is updated
	QueryPerformanceFrequency((LARGE_INTEGER *)&ticks_per_second);
	QueryPerformanceCounter((LARGE_INTEGER *)&ticks_start);

	IPUnix::make_default();

	cursor_shape = CURSOR_ARROW;
}

void OS_UWP::set_window(Windows::UI::Core::CoreWindow ^ p_window) {
	window = p_window;
}

void OS_UWP::screen_size_changed() {
	gl_context->reset();
}

Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
	main_loop = nullptr;
	outside = true;

	// FIXME: Hardcoded for now, add Vulkan support.
	p_video_driver = VIDEO_DRIVER_OPENGL;
	ContextEGL_UWP::Driver opengl_api_type = ContextEGL_UWP::GLES_2_0;

	bool gl_initialization_error = false;

	gl_context = memnew(ContextEGL_UWP(window, opengl_api_type));

	if (gl_context->initialize() != OK) {
		memdelete(gl_context);
		gl_context = nullptr;
		gl_initialization_error = true;
	}

	if (opengl_api_type == ContextEGL_UWP::GLES_2_0) {
		if (RasterizerGLES3::is_viable() == OK) {
			RasterizerGLES3::register_config();
			RasterizerGLES3::make_current();
		} else {
			gl_initialization_error = true;
		}
	}

	if (gl_initialization_error) {
		OS::get_singleton()->alert("Your video card driver does not support any of the supported OpenGL versions.\n"
								   "Please update your drivers or if you have a very old or integrated GPU upgrade it.",
				"Unable to initialize video driver");

Review comment (suggestion):
```suggestion
	p_video_driver = RENDERING_DRIVER_OPENGL3;
```

Code after:

	NetSocketPosix::make_default();

	// We need to know how often the clock is updated
	QueryPerformanceFrequency((LARGE_INTEGER *)&ticks_per_second);
	QueryPerformanceCounter((LARGE_INTEGER *)&ticks_start);

	IPUnix::make_default();

	cursor_shape = CURSOR_ARROW;
}

void OS_UWP::set_window(Windows::UI::Core::CoreWindow ^ p_window) {
	window = p_window;
}

void OS_UWP::screen_size_changed() {
	gl_context->reset();
}

Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) {
	main_loop = nullptr;
	outside = true;

	// FIXME: Hardcoded for now, add Vulkan support.
	p_video_driver = RENDERING_DRIVER_OPENGL3;
	ContextEGL_UWP::Driver opengl_api_type = ContextEGL_UWP::GLES_2_0;

	bool gl_initialization_error = false;

	gl_context = memnew(ContextEGL_UWP(window, opengl_api_type));

	if (gl_context->initialize() != OK) {
		memdelete(gl_context);
		gl_context = nullptr;
		gl_initialization_error = true;
	}

	if (opengl_api_type == ContextEGL_UWP::GLES_2_0) {
		if (RasterizerGLES3::is_viable() == OK) {
			RasterizerGLES3::register_config();
			RasterizerGLES3::make_current();
		} else {
			gl_initialization_error = true;
		}
	}

	if (gl_initialization_error) {
		OS::get_singleton()->alert("Your video card driver does not support any of the supported OpenGL versions.\n"
								   "Please update your drivers or if you have a very old or integrated GPU upgrade it.",
				"Unable to initialize video driver");
Repository: godotengine/godot
File: scene/main/viewport.cpp (C++)

Code before:
		if (!sw->is_visible_in_tree()) {
			continue;
		}

		Transform2D xform;
		CanvasItem *pci = sw->get_parent_item();
		if (pci) {
			xform = pci->get_global_transform_with_canvas();
		} else {
			xform = sw->get_canvas_transform();
		}

		Control *ret = _gui_find_control_at_pos(sw, p_global, xform, gui.focus_inv_xform);
		if (ret) {
			return ret;
		}
	}

	return nullptr;
}

Control *Viewport::_gui_find_control_at_pos(CanvasItem *p_node, const Point2 &p_global, const Transform2D &p_xform, Transform2D &r_inv_xform) {
	if (Object::cast_to<Viewport>(p_node)) {
		return nullptr;
	}

	if (!p_node->is_visible()) {
		return nullptr; // Canvas item hidden, discard.
	}

	Transform2D matrix = p_xform * p_node->get_transform();
	// matrix.basis_determinant() == 0.0f implies that node does not exist on scene
	if (matrix.basis_determinant() == 0.0f) {
		return nullptr;
	}

	Control *c = Object::cast_to<Control>(p_node);

	if (!c || !c->is_clipping_contents() || c->has_point(matrix.affine_inverse().xform(p_global))) {
		for (int i = p_node->get_child_count() - 1; i >= 0; i--) {
			CanvasItem *ci = Object::cast_to<CanvasItem>(p_node->get_child(i));
			if (!ci || ci->is_set_as_top_level()) {
				continue;
			}

			Control *ret = _gui_find_control_at_pos(ci, p_global, matrix, r_inv_xform);
			if (ret) {
				return ret;
			}
		}
	}

Review comment (bug):
Actually got one concern: is `p_node` guaranteed to be not null in here? If not then previously that removed `if` would handle such case and now it would crash in the subsequent `if`.

Code after:
		if (!sw->is_visible_in_tree()) {
			continue;
		}

		Transform2D xform;
		CanvasItem *pci = sw->get_parent_item();
		if (pci) {
			xform = pci->get_global_transform_with_canvas();
		} else {
			xform = sw->get_canvas_transform();
		}

		Control *ret = _gui_find_control_at_pos(sw, p_global, xform, gui.focus_inv_xform);
		if (ret) {
			return ret;
		}
	}

	return nullptr;
}

Control *Viewport::_gui_find_control_at_pos(CanvasItem *p_node, const Point2 &p_global, const Transform2D &p_xform, Transform2D &r_inv_xform) {
	if (!p_node->is_visible()) {
		return nullptr; // Canvas item hidden, discard.
	}

	Transform2D matrix = p_xform * p_node->get_transform();
	// matrix.basis_determinant() == 0.0f implies that node does not exist on scene
	if (matrix.basis_determinant() == 0.0f) {
		return nullptr;
	}

	Control *c = Object::cast_to<Control>(p_node);

	if (!c || !c->is_clipping_contents() || c->has_point(matrix.affine_inverse().xform(p_global))) {
		for (int i = p_node->get_child_count() - 1; i >= 0; i--) {
			CanvasItem *ci = Object::cast_to<CanvasItem>(p_node->get_child(i));
			if (!ci || ci->is_set_as_top_level()) {
				continue;
			}

			Control *ret = _gui_find_control_at_pos(ci, p_global, matrix, r_inv_xform);
			if (ret) {
				return ret;
			}
		}
	}

	if (!c || c->data.mouse_filter == Control::MOUSE_FILTER_IGNORE) {
		return nullptr;
	}
Repository: godotengine/godot
File: editor/project_settings_editor.cpp (C++)

Code before:
	} else {
		popup_centered_clamped(Size2(1200, 700) * EDSCALE, 0.8);
	}

	_add_feature_overrides();
	general_settings_inspector->update_category_list();
	set_process_shortcut_input(true);

	localization_editor->update_translations();
	autoload_settings->update_autoload();
	group_settings->update_groups();
	plugin_settings->update_plugins();
	import_defaults_editor->clear();

	if (p_clear_filter) {
		search_box->clear();
	}

	_focus_current_search_box();
}

void ProjectSettingsEditor::queue_save() {
	settings_changed = true;
	timer->start();
}

void ProjectSettingsEditor::_save() {
	settings_changed = false;
	if (ps) {
		ps->save();
	}
}

void ProjectSettingsEditor::set_plugins_page() {
	tab_container->set_current_tab(tab_container->get_tab_idx_from_control(plugin_settings));
}

void ProjectSettingsEditor::set_general_page(const String &p_category) {
	tab_container->set_current_tab(tab_container->get_tab_idx_from_control(general_editor));
	general_settings_inspector->set_current_section(p_category);
}

void ProjectSettingsEditor::update_plugins() {
	plugin_settings->update_plugins();
}

void ProjectSettingsEditor::init_autoloads() {
	autoload_settings->init_autoloads();
}

void ProjectSettingsEditor::_setting_edited(const String &p_name) {

Review comment (suggestion):
```suggestion
	general_settings_inspector->set_current_section(ProjectSettings::EDITOR_SETTING_OVERRIDE_PREFIX + p_override.get_slice("/", 0));
```

Code after:
	} else {
		popup_centered_clamped(Size2(1200, 700) * EDSCALE, 0.8);
	}

	_add_feature_overrides();
	general_settings_inspector->update_category_list();
	set_process_shortcut_input(true);

	localization_editor->update_translations();
	autoload_settings->update_autoload();
	group_settings->update_groups();
	plugin_settings->update_plugins();
	import_defaults_editor->clear();

	if (p_clear_filter) {
		search_box->clear();
	}

	_focus_current_search_box();
}

void ProjectSettingsEditor::popup_for_override(const String &p_override) {
	popup_project_settings();
	tab_container->set_current_tab(0);
	general_settings_inspector->set_current_section(ProjectSettings::EDITOR_SETTING_OVERRIDE_PREFIX + p_override.get_slicec('/', 0));
}

void ProjectSettingsEditor::queue_save() {
	settings_changed = true;
	timer->start();
}

void ProjectSettingsEditor::_save() {
	settings_changed = false;
	if (ps) {
		ps->save();
	}
	if (pending_override_notify) {
		pending_override_notify = false;
		EditorNode::get_singleton()->notify_settings_overrides_changed();
	}
}

void ProjectSettingsEditor::set_plugins_page() {
	tab_container->set_current_tab(tab_container->get_tab_idx_from_control(plugin_settings));
}

void ProjectSettingsEditor::set_general_page(const String &p_category) {
	tab_container->set_current_tab(tab_container->get_tab_idx_from_control(general_editor));
	general_settings_inspector->set_current_section(p_category);
}
Repository: godotengine/godot
File: editor/project_settings_editor.cpp (C++)

Code before:
	} else {
		popup_centered_clamped(Size2(1200, 700) * EDSCALE, 0.8);
	}

	_add_feature_overrides();
	general_settings_inspector->update_category_list();
	set_process_shortcut_input(true);

	localization_editor->update_translations();
	autoload_settings->update_autoload();
	group_settings->update_groups();
	plugin_settings->update_plugins();
	import_defaults_editor->clear();

	if (p_clear_filter) {
		search_box->clear();
	}

	_focus_current_search_box();
}

void ProjectSettingsEditor::popup_for_override(const String &p_override) {
	popup_project_settings();
	tab_container->set_current_tab(0);
	general_settings_inspector->set_current_section(ProjectSettings::EDITOR_SETTING_OVERRIDE_PREFIX + p_override.get_slice("/", 0));
}

void ProjectSettingsEditor::queue_save() {
	settings_changed = true;
	timer->start();
}

void ProjectSettingsEditor::_save() {
	settings_changed = false;
	if (ps) {
		ps->save();
	}
	if (pending_override_notify) {
		pending_override_notify = false;
		EditorNode::get_singleton()->notify_settings_overrides_changed();
	}
}

void ProjectSettingsEditor::set_plugins_page() {
	tab_container->set_current_tab(tab_container->get_tab_idx_from_control(plugin_settings));
}

void ProjectSettingsEditor::set_general_page(const String &p_category) {
	tab_container->set_current_tab(tab_container->get_tab_idx_from_control(general_editor));
	general_settings_inspector->set_current_section(p_category);
}

Review comment (suggestion):
```suggestion
	general_settings_inspector->set_current_section(ProjectSettings::EDITOR_SETTING_OVERRIDE_PREFIX + p_override.get_slicec('/', 0));
```

Code after:
		popup(saved_size);
	} else {
		popup_centered_clamped(Size2(1200, 700) * EDSCALE, 0.8);
	}

	_add_feature_overrides();
	general_settings_inspector->update_category_list();
	set_process_shortcut_input(true);

	localization_editor->update_translations();
	autoload_settings->update_autoload();
	group_settings->update_groups();
	plugin_settings->update_plugins();
	import_defaults_editor->clear();

	if (p_clear_filter) {
		search_box->clear();
	}

	_focus_current_search_box();
}

void ProjectSettingsEditor::popup_for_override(const String &p_override) {
	popup_project_settings();
	tab_container->set_current_tab(0);
	general_settings_inspector->set_current_section(ProjectSettings::EDITOR_SETTING_OVERRIDE_PREFIX + p_override.get_slicec('/', 0));
}

void ProjectSettingsEditor::queue_save() {
	settings_changed = true;
	timer->start();
}

void ProjectSettingsEditor::_save() {
	settings_changed = false;
	if (ps) {
		ps->save();
	}
	if (pending_override_notify) {
		pending_override_notify = false;
		EditorNode::get_singleton()->notify_settings_overrides_changed();
	}
}

void ProjectSettingsEditor::set_plugins_page() {
	tab_container->set_current_tab(tab_container->get_tab_idx_from_control(plugin_settings));
}

void ProjectSettingsEditor::set_general_page(const String &p_category) {
	tab_container->set_current_tab(tab_container->get_tab_idx_from_control(general_editor));
	general_settings_inspector->set_current_section(p_category);
Repository: godotengine/godot
File: core/variant/variant_utility.cpp (C++)

Code before:
	return s;
}

String VariantUtilityFunctions::error_string(Error error) {
	if (error < 0 || error >= ERR_MAX) {
		return String("(invalid error code)");
	}

	return String(error_names[error]);
}

void VariantUtilityFunctions::print(const Variant **p_args, int p_arg_count, Callable::CallError &r_error) {
	String s;
	for (int i = 0; i < p_arg_count; i++) {
		String os = p_args[i]->operator String();

		if (i == 0) {
			s = os;
		} else {
			s += os;
		}
	}

	print_line(s);
	r_error.error = Callable::CallError::CALL_OK;
}

void VariantUtilityFunctions::print_rich(const Variant **p_args, int p_arg_count, Callable::CallError &r_error) {
	String s;
	for (int i = 0; i < p_arg_count; i++) {
		String os = p_args[i]->operator String();

		if (i == 0) {
			s = os;
		} else {
			s += os;
		}
	}

	print_line_rich(s);
	r_error.error = Callable::CallError::CALL_OK;
}

#undef print_verbose

void VariantUtilityFunctions::print_verbose(const Variant **p_args, int p_arg_count, Callable::CallError &r_error) {
	if (OS::get_singleton()->is_stdout_verbose()) {
		String s;
		for (int i = 0; i < p_arg_count; i++) {
			String os = p_args[i]->operator String();


Review comment (bug):
```suggestion
#ifdef DEBUG_ENABLED
		ERR_FAIL_INDEX_V_MSG((int)type, (int)Variant::VARIANT_MAX, "<invalid type>", "Invalid type argument to type_string(), use the TYPE_* constants.");
#endif
```

Code after:
	return s;
}

String VariantUtilityFunctions::error_string(Error error) {
	if (error < 0 || error >= ERR_MAX) {
		return String("(invalid error code)");
	}

	return String(error_names[error]);
}

String VariantUtilityFunctions::type_string(Variant::Type p_type) {
	ERR_FAIL_INDEX_V_MSG((int)p_type, (int)Variant::VARIANT_MAX, "<invalid type>", "Invalid type argument to type_string(), use the TYPE_* constants.");
	return Variant::get_type_name(p_type);
}

void VariantUtilityFunctions::print(const Variant **p_args, int p_arg_count, Callable::CallError &r_error) {
	String s;
	for (int i = 0; i < p_arg_count; i++) {
		String os = p_args[i]->operator String();

		if (i == 0) {
			s = os;
		} else {
			s += os;
		}
	}

	print_line(s);
	r_error.error = Callable::CallError::CALL_OK;
}

void VariantUtilityFunctions::print_rich(const Variant **p_args, int p_arg_count, Callable::CallError &r_error) {
	String s;
	for (int i = 0; i < p_arg_count; i++) {
		String os = p_args[i]->operator String();

		if (i == 0) {
			s = os;
		} else {
			s += os;
		}
	}

	print_line_rich(s);
	r_error.error = Callable::CallError::CALL_OK;
}

#undef print_verbose

void VariantUtilityFunctions::print_verbose(const Variant **p_args, int p_arg_count, Callable::CallError &r_error) {