You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Replace more occurrences of NULL with nullptr
This commit is contained in:
@@ -73,7 +73,7 @@ def make_default_controller_mappings(target, source, env):
|
|||||||
g.write('\t"{}",\n'.format(mapping))
|
g.write('\t"{}",\n'.format(mapping))
|
||||||
g.write("#endif\n")
|
g.write("#endif\n")
|
||||||
|
|
||||||
g.write("\tNULL\n};\n")
|
g.write("\tnullptr\n};\n")
|
||||||
g.close()
|
g.close()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ def make_translations_header(target, source, env, category):
|
|||||||
g.write(
|
g.write(
|
||||||
'\t{{ "{}", {}, {}, _{}_translation_{}_compressed }},\n'.format(x[0], str(x[1]), str(x[2]), category, x[0])
|
'\t{{ "{}", {}, {}, _{}_translation_{}_compressed }},\n'.format(x[0], str(x[1]), str(x[2]), category, x[0])
|
||||||
)
|
)
|
||||||
g.write("\t{NULL, 0, 0, NULL}\n")
|
g.write("\t{nullptr, 0, 0, nullptr}\n")
|
||||||
g.write("};\n")
|
g.write("};\n")
|
||||||
|
|
||||||
g.write("#endif")
|
g.write("#endif")
|
||||||
|
|||||||
@@ -395,7 +395,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
|
|||||||
enum_vals.append(c)
|
enum_vals.append(c)
|
||||||
enum_constants.append(x[i])
|
enum_constants.append(x[i])
|
||||||
|
|
||||||
strs += "NULL}"
|
strs += "nullptr}"
|
||||||
|
|
||||||
fd.write(
|
fd.write(
|
||||||
"\t\t\t{(uint64_t(1<<" + str(bits) + ")-1)<<" + str(bitofs) + "," + str(bitofs) + "," + strs + "},\n"
|
"\t\t\t{(uint64_t(1<<" + str(bits) + ")-1)<<" + str(bitofs) + "," + str(bitofs) + "," + strs + "},\n"
|
||||||
@@ -422,7 +422,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
|
|||||||
conditionals_found.append(x)
|
conditionals_found.append(x)
|
||||||
fd.write("\t\t};\n\n")
|
fd.write("\t\t};\n\n")
|
||||||
else:
|
else:
|
||||||
fd.write("\t\tstatic const char **_conditional_strings=NULL;\n")
|
fd.write("\t\tstatic const char **_conditional_strings=nullptr;\n")
|
||||||
|
|
||||||
if header_data.uniforms:
|
if header_data.uniforms:
|
||||||
|
|
||||||
@@ -432,7 +432,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
|
|||||||
fd.write('\t\t\t"' + x + '",\n')
|
fd.write('\t\t\t"' + x + '",\n')
|
||||||
fd.write("\t\t};\n\n")
|
fd.write("\t\t};\n\n")
|
||||||
else:
|
else:
|
||||||
fd.write("\t\tstatic const char **_uniform_strings=NULL;\n")
|
fd.write("\t\tstatic const char **_uniform_strings=nullptr;\n")
|
||||||
|
|
||||||
if output_attribs:
|
if output_attribs:
|
||||||
if header_data.attributes:
|
if header_data.attributes:
|
||||||
@@ -442,7 +442,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
|
|||||||
fd.write('\t\t\t{"' + x[0] + '",' + x[1] + "},\n")
|
fd.write('\t\t\t{"' + x[0] + '",' + x[1] + "},\n")
|
||||||
fd.write("\t\t};\n\n")
|
fd.write("\t\t};\n\n")
|
||||||
else:
|
else:
|
||||||
fd.write("\t\tstatic AttributePair *_attribute_pairs=NULL;\n")
|
fd.write("\t\tstatic AttributePair *_attribute_pairs=nullptr;\n")
|
||||||
|
|
||||||
feedback_count = 0
|
feedback_count = 0
|
||||||
|
|
||||||
@@ -464,7 +464,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
|
|||||||
if gles2:
|
if gles2:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
fd.write("\t\tstatic const Feedback* _feedbacks=NULL;\n")
|
fd.write("\t\tstatic const Feedback* _feedbacks=nullptr;\n")
|
||||||
|
|
||||||
if header_data.texunits:
|
if header_data.texunits:
|
||||||
fd.write("\t\tstatic TexUnitPair _texunit_pairs[]={\n")
|
fd.write("\t\tstatic TexUnitPair _texunit_pairs[]={\n")
|
||||||
@@ -472,7 +472,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
|
|||||||
fd.write('\t\t\t{"' + x[0] + '",' + x[1] + "},\n")
|
fd.write('\t\t\t{"' + x[0] + '",' + x[1] + "},\n")
|
||||||
fd.write("\t\t};\n\n")
|
fd.write("\t\t};\n\n")
|
||||||
else:
|
else:
|
||||||
fd.write("\t\tstatic TexUnitPair *_texunit_pairs=NULL;\n")
|
fd.write("\t\tstatic TexUnitPair *_texunit_pairs=nullptr;\n")
|
||||||
|
|
||||||
if not gles2 and header_data.ubos:
|
if not gles2 and header_data.ubos:
|
||||||
fd.write("\t\tstatic UBOPair _ubo_pairs[]={\n")
|
fd.write("\t\tstatic UBOPair _ubo_pairs[]={\n")
|
||||||
@@ -483,7 +483,7 @@ def build_legacygl_header(filename, include, class_suffix, output_attribs, gles2
|
|||||||
if gles2:
|
if gles2:
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
fd.write("\t\tstatic UBOPair *_ubo_pairs=NULL;\n")
|
fd.write("\t\tstatic UBOPair *_ubo_pairs=nullptr;\n")
|
||||||
|
|
||||||
fd.write("\t\tstatic const char _vertex_code[]={\n")
|
fd.write("\t\tstatic const char _vertex_code[]={\n")
|
||||||
for x in header_data.vertex_lines:
|
for x in header_data.vertex_lines:
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ def _build_gdnative_api_struct_source(api):
|
|||||||
"\t{" + str(ext["version"]["major"]) + ", " + str(ext["version"]["minor"]) + "},",
|
"\t{" + str(ext["version"]["major"]) + ", " + str(ext["version"]["minor"]) + "},",
|
||||||
"\t"
|
"\t"
|
||||||
+ (
|
+ (
|
||||||
"NULL"
|
"nullptr"
|
||||||
if not ext["next"]
|
if not ext["next"]
|
||||||
else ("(const godot_gdnative_api_struct *)&" + get_extension_struct_instance_name(name, ext["next"]))
|
else ("(const godot_gdnative_api_struct *)&" + get_extension_struct_instance_name(name, ext["next"]))
|
||||||
)
|
)
|
||||||
@@ -191,7 +191,7 @@ def _build_gdnative_api_struct_source(api):
|
|||||||
"\t{" + str(core["version"]["major"]) + ", " + str(core["version"]["minor"]) + "},",
|
"\t{" + str(core["version"]["major"]) + ", " + str(core["version"]["minor"]) + "},",
|
||||||
"\t"
|
"\t"
|
||||||
+ (
|
+ (
|
||||||
"NULL"
|
"nullptr"
|
||||||
if not core["next"]
|
if not core["next"]
|
||||||
else (
|
else (
|
||||||
"(const godot_gdnative_api_struct *)& api_{0}_{1}".format(
|
"(const godot_gdnative_api_struct *)& api_{0}_{1}".format(
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ struct LocationLink {
|
|||||||
* Used as the underlined span for mouse interaction. Defaults to the word range at
|
* Used as the underlined span for mouse interaction. Defaults to the word range at
|
||||||
* the mouse position.
|
* the mouse position.
|
||||||
*/
|
*/
|
||||||
Range *originSelectionRange = NULL;
|
Range *originSelectionRange = nullptr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The target resource identifier of this link.
|
* The target resource identifier of this link.
|
||||||
@@ -1686,8 +1686,8 @@ struct InitializeResult {
|
|||||||
struct GodotNativeClassInfo {
|
struct GodotNativeClassInfo {
|
||||||
|
|
||||||
String name;
|
String name;
|
||||||
const DocData::ClassDoc *class_doc = NULL;
|
const DocData::ClassDoc *class_doc = nullptr;
|
||||||
const ClassDB::ClassInfo *class_info = NULL;
|
const ClassDB::ClassInfo *class_info = nullptr;
|
||||||
|
|
||||||
Dictionary to_json() {
|
Dictionary to_json() {
|
||||||
Dictionary dict;
|
Dictionary dict;
|
||||||
|
|||||||
@@ -2187,7 +2187,7 @@ Error BindingsGenerator::_generate_glue_method(const BindingsGenerator::TypeInte
|
|||||||
}
|
}
|
||||||
|
|
||||||
p_output.append(CS_PARAM_METHODBIND "->call(" CS_PARAM_INSTANCE ", ");
|
p_output.append(CS_PARAM_METHODBIND "->call(" CS_PARAM_INSTANCE ", ");
|
||||||
p_output.append(p_imethod.arguments.size() ? C_LOCAL_PTRCALL_ARGS ".ptr()" : "NULL");
|
p_output.append(p_imethod.arguments.size() ? C_LOCAL_PTRCALL_ARGS ".ptr()" : "nullptr");
|
||||||
p_output.append(", total_length, vcall_error);\n");
|
p_output.append(", total_length, vcall_error);\n");
|
||||||
|
|
||||||
if (!ret_void) {
|
if (!ret_void) {
|
||||||
|
|||||||
@@ -1364,7 +1364,7 @@ void DisplayServerWindows::cursor_set_custom_image(const RES &p_cursor, CursorSh
|
|||||||
|
|
||||||
GetMaskBitmaps(bitmap, clrTransparent, hAndMask, hXorMask);
|
GetMaskBitmaps(bitmap, clrTransparent, hAndMask, hXorMask);
|
||||||
|
|
||||||
if (NULL == hAndMask || nullptr == hXorMask) {
|
if (nullptr == hAndMask || nullptr == hXorMask) {
|
||||||
memfree(buffer);
|
memfree(buffer);
|
||||||
DeleteObject(bitmap);
|
DeleteObject(bitmap);
|
||||||
return;
|
return;
|
||||||
@@ -2445,7 +2445,7 @@ LRESULT DisplayServerWindows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARA
|
|||||||
|
|
||||||
case WM_ENTERSIZEMOVE: {
|
case WM_ENTERSIZEMOVE: {
|
||||||
InputFilter::get_singleton()->release_pressed_events();
|
InputFilter::get_singleton()->release_pressed_events();
|
||||||
move_timer_id = SetTimer(windows[window_id].hWnd, 1, USER_TIMER_MINIMUM, (TIMERPROC)NULL);
|
move_timer_id = SetTimer(windows[window_id].hWnd, 1, USER_TIMER_MINIMUM, (TIMERPROC) nullptr);
|
||||||
} break;
|
} break;
|
||||||
case WM_EXITSIZEMOVE: {
|
case WM_EXITSIZEMOVE: {
|
||||||
KillTimer(windows[window_id].hWnd, move_timer_id);
|
KillTimer(windows[window_id].hWnd, move_timer_id);
|
||||||
|
|||||||
@@ -176,7 +176,7 @@ int _main() {
|
|||||||
|
|
||||||
wc_argv = CommandLineToArgvW(GetCommandLineW(), &argc);
|
wc_argv = CommandLineToArgvW(GetCommandLineW(), &argc);
|
||||||
|
|
||||||
if (NULL == wc_argv) {
|
if (nullptr == wc_argv) {
|
||||||
wprintf(L"CommandLineToArgvW failed\n");
|
wprintf(L"CommandLineToArgvW failed\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -413,23 +413,6 @@ Vector3 Camera3D::project_position(const Point2 &p_point, float p_z_depth) const
|
|||||||
return get_camera_transform().xform(p);
|
return get_camera_transform().xform(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
void Camera::_camera_make_current(Node *p_camera) {
|
|
||||||
|
|
||||||
|
|
||||||
if (p_camera==this) {
|
|
||||||
RenderingServer::get_singleton()->viewport_attach_camera(viewport_id,camera);
|
|
||||||
active=true;
|
|
||||||
} else {
|
|
||||||
if (active && p_camera==NULL) {
|
|
||||||
//detech camera because no one else will claim it
|
|
||||||
RenderingServer::get_singleton()->viewport_attach_camera(viewport_id,RID());
|
|
||||||
}
|
|
||||||
active=false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void Camera3D::set_environment(const Ref<Environment> &p_environment) {
|
void Camera3D::set_environment(const Ref<Environment> &p_environment) {
|
||||||
|
|
||||||
environment = p_environment;
|
environment = p_environment;
|
||||||
|
|||||||
@@ -1242,19 +1242,6 @@ void AnimationPlayer::play(const StringName &p_name, float p_custom_blend, float
|
|||||||
bool AnimationPlayer::is_playing() const {
|
bool AnimationPlayer::is_playing() const {
|
||||||
|
|
||||||
return playing;
|
return playing;
|
||||||
/*
|
|
||||||
if (playback.current.from==NULL)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
float len=playback.current.from->animation->get_length();
|
|
||||||
float pos = playback.current.pos;
|
|
||||||
bool loop=playback.current.from->animation->has_loop();
|
|
||||||
if (!loop && pos >= len) {
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
|
|
||||||
return true;
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationPlayer::set_current_animation(const String &p_anim) {
|
void AnimationPlayer::set_current_animation(const String &p_anim) {
|
||||||
|
|||||||
@@ -561,12 +561,6 @@ void Control::_notification(int p_notification) {
|
|||||||
|
|
||||||
data.parent = nullptr;
|
data.parent = nullptr;
|
||||||
data.parent_canvas_item = nullptr;
|
data.parent_canvas_item = nullptr;
|
||||||
/*
|
|
||||||
if (data.theme_owner && data.theme.is_null()) {
|
|
||||||
data.theme_owner=NULL;
|
|
||||||
notification(NOTIFICATION_THEME_CHANGED);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_MOVED_IN_PARENT: {
|
case NOTIFICATION_MOVED_IN_PARENT: {
|
||||||
|
|||||||
@@ -1469,7 +1469,6 @@ CanvasItem::CanvasItem() :
|
|||||||
drawing = false;
|
drawing = false;
|
||||||
behind = false;
|
behind = false;
|
||||||
block_transform_notify = false;
|
block_transform_notify = false;
|
||||||
//viewport=NULL;
|
|
||||||
canvas_layer = nullptr;
|
canvas_layer = nullptr;
|
||||||
use_parent_material = false;
|
use_parent_material = false;
|
||||||
global_invalid = true;
|
global_invalid = true;
|
||||||
|
|||||||
@@ -2506,16 +2506,6 @@ void Viewport::_gui_hid_control(Control *p_control) {
|
|||||||
_drop_mouse_focus();
|
_drop_mouse_focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ???
|
|
||||||
if (data.window==p_control) {
|
|
||||||
window->drag_data=Variant();
|
|
||||||
if (window->drag_preview) {
|
|
||||||
memdelete( window->drag_preview);
|
|
||||||
window->drag_preview=NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (gui.key_focus == p_control)
|
if (gui.key_focus == p_control)
|
||||||
_gui_remove_focus();
|
_gui_remove_focus();
|
||||||
if (gui.mouse_over == p_control)
|
if (gui.mouse_over == p_control)
|
||||||
|
|||||||
Reference in New Issue
Block a user