Skip to content

Commit

Permalink
Remove duplicate WARN_PRINT macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
madmiraal committed Feb 5, 2020
1 parent 5af3b4c commit f0db135
Show file tree
Hide file tree
Showing 37 changed files with 64 additions and 69 deletions.
2 changes: 1 addition & 1 deletion core/bind/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ PoolStringArray _ResourceLoader::get_dependencies(const String &p_path) {

#ifndef DISABLE_DEPRECATED
bool _ResourceLoader::has(const String &p_path) {
WARN_PRINTS("ResourceLoader.has() is deprecated, please replace it with the equivalent has_cached() or the new exists().");
WARN_PRINT("ResourceLoader.has() is deprecated, please replace it with the equivalent has_cached() or the new exists().");
return has_cached(p_path);
}
#endif // DISABLE_DEPRECATED
Expand Down
5 changes: 0 additions & 5 deletions core/error_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,11 +412,6 @@ void _err_print_index_error(const char *p_function, const char *p_file, int p_li
_err_print_error(FUNCTION_STR, __FILE__, __LINE__, DEBUG_STR(m_msg), ERR_HANDLER_WARNING); \
}

#define WARN_PRINTS(m_msg) \
{ \
_err_print_error(FUNCTION_STR, __FILE__, __LINE__, DEBUG_STR(m_msg), ERR_HANDLER_WARNING); \
}

// Only prints the warning message once.

#define WARN_PRINT_ONCE(m_msg) \
Expand Down
2 changes: 1 addition & 1 deletion core/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,7 @@ Image::AlphaMode Image::detect_alpha() const {
Error Image::load(const String &p_path) {
#ifdef DEBUG_ENABLED
if (p_path.begins_with("res://") && ResourceLoader::exists(p_path)) {
WARN_PRINTS("Loaded resource as image file, this will not work on export: '" + p_path + "'. Instead, import the image file as an Image resource and load it normally as a resource.");
WARN_PRINT("Loaded resource as image file, this will not work on export: '" + p_path + "'. Instead, import the image file as an Image resource and load it normally as a resource.");
}
#endif
return ImageLoader::load_image(p_path, this);
Expand Down
2 changes: 1 addition & 1 deletion core/io/packet_peer_udp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Error PacketPeerUDP::_poll() {

if (rb.space_left() < read + 24) {
#ifdef TOOLS_ENABLED
WARN_PRINTS("Buffer full, dropping packets!");
WARN_PRINT("Buffer full, dropping packets!");
#endif
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion core/io/resource_format_binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ Error ResourceFormatLoaderBinary::rename_dependencies(const String &p_path, cons
memdelete(da);
//use the old approach

WARN_PRINTS("This file is old, so it can't refactor dependencies, opening and resaving '" + p_path + "'.");
WARN_PRINT("This file is old, so it can't refactor dependencies, opening and resaving '" + p_path + "'.");

Error err;
f = FileAccess::open(p_path, FileAccess::READ, &err);
Expand Down
2 changes: 1 addition & 1 deletion core/os/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ int OS::get_process_id() const {

void OS::vibrate_handheld(int p_duration_ms) {

WARN_PRINTS("vibrate_handheld() only works with Android and iOS");
WARN_PRINT("vibrate_handheld() only works with Android and iOS");
}

bool OS::is_stdout_verbose() const {
Expand Down
2 changes: 1 addition & 1 deletion core/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ bool ProjectSettings::_get(const StringName &p_name, Variant &r_ret) const {
name = feature_overrides[name];
}
if (!props.has(name)) {
WARN_PRINTS("Property not found: " + String(name));
WARN_PRINT("Property not found: " + String(name));
return false;
}
r_ret = props[name].variant;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles2/rasterizer_storage_gles2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4709,7 +4709,7 @@ void RasterizerStorageGLES2::_render_target_allocate(RenderTarget *rt) {
int max_samples = 0;
glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
if (msaa > max_samples) {
WARN_PRINTS("MSAA must be <= GL_MAX_SAMPLES, falling-back to GL_MAX_SAMPLES = " + itos(max_samples));
WARN_PRINT("MSAA must be <= GL_MAX_SAMPLES, falling-back to GL_MAX_SAMPLES = " + itos(max_samples));
msaa = max_samples;
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/rasterizer_storage_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7144,7 +7144,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
int max_samples = 0;
glGetIntegerv(GL_MAX_SAMPLES, &max_samples);
if (msaa > max_samples) {
WARN_PRINTS("MSAA must be <= GL_MAX_SAMPLES, falling-back to GL_MAX_SAMPLES = " + itos(max_samples));
WARN_PRINT("MSAA must be <= GL_MAX_SAMPLES, falling-back to GL_MAX_SAMPLES = " + itos(max_samples));
msaa = max_samples;
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/pulseaudio/audio_driver_pulseaudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ Error AudioDriverPulseAudio::init_device() {
break;

default:
WARN_PRINTS("PulseAudio: Unsupported number of channels: " + itos(pa_map.channels));
WARN_PRINT("PulseAudio: Unsupported number of channels: " + itos(pa_map.channels));
pa_channel_map_init_stereo(&pa_map);
channels = 2;
break;
Expand Down Expand Up @@ -666,7 +666,7 @@ Error AudioDriverPulseAudio::capture_init_device() {
break;

default:
WARN_PRINTS("PulseAudio: Unsupported number of input channels: " + itos(pa_rec_map.channels));
WARN_PRINT("PulseAudio: Unsupported number of input channels: " + itos(pa_rec_map.channels));
pa_channel_map_init_stereo(&pa_rec_map);
break;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/wasapi/audio_driver_wasapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ Error AudioDriverWASAPI::init_render_device(bool reinit) {
break;

default:
WARN_PRINTS("WASAPI: Unsupported number of channels: " + itos(audio_output.channels));
WARN_PRINT("WASAPI: Unsupported number of channels: " + itos(audio_output.channels));
channels = 2;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/windows/file_access_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Error FileAccessWindows::_open(const String &p_path, int p_mode_flags) {

String base_file = path.get_file();
if (base_file != fname && base_file.findn(fname) == 0) {
WARN_PRINTS("Case mismatch opening requested file '" + base_file + "', stored as '" + fname + "' in the filesystem. This file will not open when exported to other case-sensitive platforms.");
WARN_PRINT("Case mismatch opening requested file '" + base_file + "', stored as '" + fname + "' in the filesystem. This file will not open when exported to other case-sensitive platforms.");
}
}
FindClose(f);
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 @@ -1114,7 +1114,7 @@ void EditorFileSystem::_notification(int p_what) {
Thread::wait_to_finish(thread);
memdelete(thread);
thread = NULL;
WARN_PRINTS("Scan thread aborted...");
WARN_PRINT("Scan thread aborted...");
set_process(false);
}

Expand Down
2 changes: 1 addition & 1 deletion editor/editor_help_search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ bool EditorHelpSearch::Runner::_slice() {
case PHASE_MAX:
return true;
default:
WARN_PRINTS("Invalid or unhandled phase in EditorHelpSearch::Runner, aborting search.");
WARN_PRINT("Invalid or unhandled phase in EditorHelpSearch::Runner, aborting search.");
return true;
};

Expand Down
4 changes: 2 additions & 2 deletions editor/editor_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3042,7 +3042,7 @@ void EditorNode::set_addon_plugin_enabled(const String &p_addon, bool p_enabled,
}
ps->set("editor_plugins/enabled", enabled_plugins);
ps->save();
WARN_PRINTS("Addon '" + p_addon + "' failed to load. No directory found. Removing from enabled plugins.");
WARN_PRINT("Addon '" + p_addon + "' failed to load. No directory found. Removing from enabled plugins.");
return;
}
Error err = cf->load(addon_path);
Expand Down Expand Up @@ -3988,7 +3988,7 @@ void EditorNode::show_warning(const String &p_text, const String &p_title) {
warning->set_title(p_title);
warning->popup_centered_minsize();
} else {
WARN_PRINTS(p_title + " " + p_text);
WARN_PRINT(p_title + " " + p_text);
}
}

Expand Down
12 changes: 6 additions & 6 deletions editor/editor_plugin_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,28 +96,28 @@ void EditorPluginSettings::update_plugins() {
Error err2 = cf->load(path);

if (err2 != OK) {
WARN_PRINTS("Can't load plugin config: " + path);
WARN_PRINT("Can't load plugin config: " + path);
} else {
bool key_missing = false;

if (!cf->has_section_key("plugin", "name")) {
WARN_PRINTS("Plugin config misses \"plugin/name\" key: " + path);
WARN_PRINT("Plugin config misses \"plugin/name\" key: " + path);
key_missing = true;
}
if (!cf->has_section_key("plugin", "author")) {
WARN_PRINTS("Plugin config misses \"plugin/author\" key: " + path);
WARN_PRINT("Plugin config misses \"plugin/author\" key: " + path);
key_missing = true;
}
if (!cf->has_section_key("plugin", "version")) {
WARN_PRINTS("Plugin config misses \"plugin/version\" key: " + path);
WARN_PRINT("Plugin config misses \"plugin/version\" key: " + path);
key_missing = true;
}
if (!cf->has_section_key("plugin", "description")) {
WARN_PRINTS("Plugin config misses \"plugin/description\" key: " + path);
WARN_PRINT("Plugin config misses \"plugin/description\" key: " + path);
key_missing = true;
}
if (!cf->has_section_key("plugin", "script")) {
WARN_PRINTS("Plugin config misses \"plugin/script\" key: " + path);
WARN_PRINT("Plugin config misses \"plugin/script\" key: " + path);
key_missing = true;
}

Expand Down
2 changes: 1 addition & 1 deletion editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ bool EditorSettings::_get(const StringName &p_name, Variant &r_ret) const {

const VariantContainer *v = props.getptr(p_name);
if (!v) {
WARN_PRINTS("EditorSettings::_get - Property not found: " + String(p_name));
WARN_PRINT("EditorSettings::_get - Property not found: " + String(p_name));
return false;
}
r_ret = v->variant;
Expand Down
14 changes: 7 additions & 7 deletions editor/import/editor_import_collada.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ Error ColladaImport::_create_mesh_surfaces(bool p_optimize, Ref<ArrayMesh> &p_me
material = material_cache[target];

} else if (p.material != "") {
WARN_PRINTS("Collada: Unreferenced material in geometry instance: " + p.material);
WARN_PRINT("Collada: Unreferenced material in geometry instance: " + p.material);
}
}

Expand Down Expand Up @@ -1210,7 +1210,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres
mesh_cache[meshid] = mesh;
} else {

WARN_PRINTS("Collada: Will not import geometry: " + meshid);
WARN_PRINT("Collada: Will not import geometry: " + meshid);
}
}

Expand All @@ -1237,7 +1237,7 @@ Error ColladaImport::_create_resources(Collada::Node *p_node, bool p_use_compres

mi->set_surface_material(i, material);
} else if (matname != "") {
WARN_PRINTS("Collada: Unreferenced material in geometry instance: " + matname);
WARN_PRINT("Collada: Unreferenced material in geometry instance: " + matname);
}
}
}
Expand Down Expand Up @@ -1408,7 +1408,7 @@ void ColladaImport::create_animations(bool p_make_tracks_in_all_bones, bool p_im

node = node_name_map[at.target];
} else {
WARN_PRINTS("Collada: Couldn't find node: " + at.target);
WARN_PRINT("Collada: Couldn't find node: " + at.target);
continue;
}
} else {
Expand Down Expand Up @@ -1588,7 +1588,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
}

if (xform_idx == -1) {
WARN_PRINTS("Collada: Couldn't find matching node " + at.target + " xform for track " + at.param + ".");
WARN_PRINT("Collada: Couldn't find matching node " + at.target + " xform for track " + at.param + ".");
continue;
}

Expand Down Expand Up @@ -1666,7 +1666,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones

Collada::Node *cn = collada.state.scene_map[E->key()];
if (cn->ignore_anim) {
WARN_PRINTS("Collada: Ignoring animation on node: " + path);
WARN_PRINT("Collada: Ignoring animation on node: " + path);
continue;
}

Expand Down Expand Up @@ -1735,7 +1735,7 @@ void ColladaImport::create_animation(int p_clip, bool p_make_tracks_in_all_bones
//matrix
WARN_PRINT("Collada: Value keys for matrices not supported.");
} else {
WARN_PRINTS("Collada: Unexpected amount of value keys: " + itos(data.size()));
WARN_PRINT("Collada: Unexpected amount of value keys: " + itos(data.size()));
}

animation->track_insert_key(track, time, value);
Expand Down
2 changes: 1 addition & 1 deletion editor/import/editor_scene_importer_gltf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2438,7 +2438,7 @@ Error EditorSceneImporterGLTF::_parse_animations(GLTFState &state) {
track->weight_tracks.write[k] = cf;
}
} else {
WARN_PRINTS("Invalid path '" + path + "'.");
WARN_PRINT("Invalid path '" + path + "'.");
}
}

Expand Down
4 changes: 2 additions & 2 deletions editor/import/resource_importer_obj.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static Error _parse_material_library(const String &p_path, Map<String, Ref<Spati
material_map[current_name] = current;
} else if (l.begins_with("Ka ")) {
//uv
WARN_PRINTS("OBJ: Ambient light for material '" + current_name + "' is ignored in PBR");
WARN_PRINT("OBJ: Ambient light for material '" + current_name + "' is ignored in PBR");

} else if (l.begins_with("Kd ")) {
//normal
Expand Down Expand Up @@ -119,7 +119,7 @@ static Error _parse_material_library(const String &p_path, Map<String, Ref<Spati

} else if (l.begins_with("map_Ka ")) {
//uv
WARN_PRINTS("OBJ: Ambient light texture for material '" + current_name + "' is ignored in PBR");
WARN_PRINT("OBJ: Ambient light texture for material '" + current_name + "' is ignored in PBR");

} else if (l.begins_with("map_Kd ")) {
//normal
Expand Down
2 changes: 1 addition & 1 deletion editor/plugins/asset_library_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,7 +812,7 @@ void EditorAssetLibrary::_image_request_completed(int p_status, int p_code, cons
_image_update(p_code == HTTPClient::RESPONSE_NOT_MODIFIED, true, p_data, p_queue_id);

} else {
WARN_PRINTS("Error getting image file from URL: " + image_queue[p_queue_id].image_url);
WARN_PRINT("Error getting image file from URL: " + image_queue[p_queue_id].image_url);
Object *obj = ObjectDB::get_instance(image_queue[p_queue_id].target);
if (obj) {
obj->call("set_image", image_queue[p_queue_id].image_type, image_queue[p_queue_id].image_index, get_icon("FileBrokenBigThumb", "EditorIcons"));
Expand Down
4 changes: 2 additions & 2 deletions modules/bullet/area_bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ void AreaBullet::set_param(PhysicsServer::AreaParameter p_param, const Variant &
set_spOv_gravityPointAttenuation(p_value);
break;
default:
WARN_PRINTS("Area doesn't support this parameter in the Bullet backend: " + itos(p_param));
WARN_PRINT("Area doesn't support this parameter in the Bullet backend: " + itos(p_param));
}
}

Expand All @@ -268,7 +268,7 @@ Variant AreaBullet::get_param(PhysicsServer::AreaParameter p_param) const {
case PhysicsServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION:
return spOv_gravityPointAttenuation;
default:
WARN_PRINTS("Area doesn't support this parameter in the Bullet backend: " + itos(p_param));
WARN_PRINT("Area doesn't support this parameter in the Bullet backend: " + itos(p_param));
return Variant();
}
}
Expand Down
6 changes: 3 additions & 3 deletions modules/bullet/rigid_body_bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ void RigidBodyBullet::set_param(PhysicsServer::BodyParameter p_param, real_t p_v
scratch_space_override_modificator();
break;
default:
WARN_PRINTS("Parameter " + itos(p_param) + " not supported by bullet. Value: " + itos(p_value));
WARN_PRINT("Parameter " + itos(p_param) + " not supported by bullet. Value: " + itos(p_value));
}
}

Expand All @@ -536,7 +536,7 @@ real_t RigidBodyBullet::get_param(PhysicsServer::BodyParameter p_param) const {
case PhysicsServer::BODY_PARAM_GRAVITY_SCALE:
return gravity_scale;
default:
WARN_PRINTS("Parameter " + itos(p_param) + " not supported by bullet");
WARN_PRINT("Parameter " + itos(p_param) + " not supported by bullet");
return 0;
}
}
Expand Down Expand Up @@ -619,7 +619,7 @@ Variant RigidBodyBullet::get_state(PhysicsServer::BodyState p_state) const {
case PhysicsServer::BODY_STATE_CAN_SLEEP:
return can_sleep;
default:
WARN_PRINTS("This state " + itos(p_state) + " is not supported by Bullet");
WARN_PRINT("This state " + itos(p_state) + " is not supported by Bullet");
return Variant();
}
}
Expand Down
10 changes: 5 additions & 5 deletions modules/bullet/space_bullet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ bool BulletPhysicsDirectSpaceState::intersect_ray(const Vector3 &p_from, const V
r_result.collider_id = gObj->get_instance_id();
r_result.collider = 0 == r_result.collider_id ? NULL : ObjectDB::get_instance(r_result.collider_id);
} else {
WARN_PRINTS("The raycast performed has hit a collision object that is not part of Godot scene, please check it.");
WARN_PRINT("The raycast performed has hit a collision object that is not part of Godot scene, please check it.");
}
return true;
} else {
Expand Down Expand Up @@ -389,7 +389,7 @@ void SpaceBullet::set_param(PhysicsServer::AreaParameter p_param, const Variant
case PhysicsServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION:
break;
default:
WARN_PRINTS("This set parameter (" + itos(p_param) + ") is ignored, the SpaceBullet doesn't support it.");
WARN_PRINT("This set parameter (" + itos(p_param) + ") is ignored, the SpaceBullet doesn't support it.");
break;
}
}
Expand All @@ -412,7 +412,7 @@ Variant SpaceBullet::get_param(PhysicsServer::AreaParameter p_param) {
case PhysicsServer::AREA_PARAM_GRAVITY_POINT_ATTENUATION:
return 0;
default:
WARN_PRINTS("This get parameter (" + itos(p_param) + ") is ignored, the SpaceBullet doesn't support it.");
WARN_PRINT("This get parameter (" + itos(p_param) + ") is ignored, the SpaceBullet doesn't support it.");
return Variant();
}
}
Expand All @@ -428,7 +428,7 @@ void SpaceBullet::set_param(PhysicsServer::SpaceParameter p_param, real_t p_valu
case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO:
case PhysicsServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS:
default:
WARN_PRINTS("This set parameter (" + itos(p_param) + ") is ignored, the SpaceBullet doesn't support it.");
WARN_PRINT("This set parameter (" + itos(p_param) + ") is ignored, the SpaceBullet doesn't support it.");
break;
}
}
Expand All @@ -444,7 +444,7 @@ real_t SpaceBullet::get_param(PhysicsServer::SpaceParameter p_param) {
case PhysicsServer::SPACE_PARAM_BODY_ANGULAR_VELOCITY_DAMP_RATIO:
case PhysicsServer::SPACE_PARAM_CONSTRAINT_DEFAULT_BIAS:
default:
WARN_PRINTS("The SpaceBullet doesn't support this get parameter (" + itos(p_param) + "), 0 is returned.");
WARN_PRINT("The SpaceBullet doesn't support this get parameter (" + itos(p_param) + "), 0 is returned.");
return 0.f;
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/gdscript/gdscript_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ void GDScriptFunctions::call(Function p_func, const Variant **p_args, int p_arg_
}

String message = *p_args[0];
WARN_PRINTS(message);
WARN_PRINT(message);
r_ret = Variant();
} break;
case VAR_TO_STR: {
Expand Down
Loading

0 comments on commit f0db135

Please sign in to comment.