diff options
author | lupoDharkael <izhe@hotmail.es> | 2020-04-02 01:20:12 +0200 |
---|---|---|
committer | lupoDharkael <izhe@hotmail.es> | 2020-04-02 13:38:00 +0200 |
commit | 95a1400a2ac9de1a29fa305f45b928ce8e3044bd (patch) | |
tree | be0cd59e5a90926e9d653fed9f3b1b77e735ca2f /platform/uwp | |
parent | 5f11e1557156617366d2c316a97716172103980d (diff) |
Replace NULL with nullptr
Diffstat (limited to 'platform/uwp')
-rw-r--r-- | platform/uwp/app.cpp | 12 | ||||
-rw-r--r-- | platform/uwp/context_egl_uwp.cpp | 2 | ||||
-rw-r--r-- | platform/uwp/export/export.cpp | 36 | ||||
-rw-r--r-- | platform/uwp/os_uwp.cpp | 16 | ||||
-rw-r--r-- | platform/uwp/os_uwp.h | 2 |
5 files changed, 34 insertions, 34 deletions
diff --git a/platform/uwp/app.cpp b/platform/uwp/app.cpp index ccb4b43373..d3870b0b6c 100644 --- a/platform/uwp/app.cpp +++ b/platform/uwp/app.cpp @@ -507,12 +507,12 @@ void App::UpdateWindowSize(Size size) { char **App::get_command_line(unsigned int *out_argc) { - static char *fail_cl[] = { "--path", "game", NULL }; + static char *fail_cl[] = { "--path", "game", nullptr }; *out_argc = 2; FILE *f = _wfopen(L"__cl__.cl", L"rb"); - if (f == NULL) { + if (f == nullptr) { wprintf(L"Couldn't open command line file.\n"); return fail_cl; @@ -558,7 +558,7 @@ char **App::get_command_line(unsigned int *out_argc) { if (r == strlen) { - int warg_size = MultiByteToWideChar(CP_UTF8, 0, arg, -1, NULL, 0); + int warg_size = MultiByteToWideChar(CP_UTF8, 0, arg, -1, nullptr, 0); wchar_t *warg = new wchar_t[warg_size]; MultiByteToWideChar(CP_UTF8, 0, arg, -1, warg, warg_size); @@ -583,14 +583,14 @@ char **App::get_command_line(unsigned int *out_argc) { for (int i = 0; i < cl.Size; i++) { - int arg_size = WideCharToMultiByte(CP_UTF8, 0, cl.GetAt(i)->Data(), -1, NULL, 0, NULL, NULL); + int arg_size = WideCharToMultiByte(CP_UTF8, 0, cl.GetAt(i)->Data(), -1, nullptr, 0, nullptr, nullptr); char *arg = new char[arg_size]; - WideCharToMultiByte(CP_UTF8, 0, cl.GetAt(i)->Data(), -1, arg, arg_size, NULL, NULL); + WideCharToMultiByte(CP_UTF8, 0, cl.GetAt(i)->Data(), -1, arg, arg_size, nullptr, nullptr); ret[i] = arg; } - ret[cl.Size] = NULL; + ret[cl.Size] = nullptr; *out_argc = cl.Size; return ret; diff --git a/platform/uwp/context_egl_uwp.cpp b/platform/uwp/context_egl_uwp.cpp index 7ac9489bb4..bc8ca2e36c 100644 --- a/platform/uwp/context_egl_uwp.cpp +++ b/platform/uwp/context_egl_uwp.cpp @@ -155,7 +155,7 @@ Error ContextEGL_UWP::initialize() { throw Exception::CreateException(E_FAIL, L"Failed to initialize EGL"); } - if (eglGetConfigs(display, NULL, 0, &numConfigs) == EGL_FALSE) { + if (eglGetConfigs(display, nullptr, 0, &numConfigs) == EGL_FALSE) { throw Exception::CreateException(E_FAIL, L"Failed to get EGLConfig count"); } diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp index 533293387d..06bf738dc1 100644 --- a/platform/uwp/export/export.cpp +++ b/platform/uwp/export/export.cpp @@ -54,7 +54,7 @@ static const char *uwp_capabilities[] = { "internetClient", "internetClientServer", "privateNetworkClientServer", - NULL + nullptr }; static const char *uwp_uap_capabilities[] = { "appointments", @@ -71,7 +71,7 @@ static const char *uwp_uap_capabilities[] = { "userAccountInformation", "videosLibrary", "voipCall", - NULL + nullptr }; static const char *uwp_device_capabilities[] = { "bluetooth", @@ -79,7 +79,7 @@ static const char *uwp_device_capabilities[] = { "microphone", "proximity", "webcam", - NULL + nullptr }; class AppxPackager { @@ -478,7 +478,7 @@ Error AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t // Data for compression z_stream strm; - FileAccess *strm_f = NULL; + FileAccess *strm_f = nullptr; Vector<uint8_t> strm_in; strm_in.resize(BLOCK_SIZE); Vector<uint8_t> strm_out; @@ -641,7 +641,7 @@ void AppxPackager::finish() { package->close(); memdelete(package); - package = NULL; + package = nullptr; } AppxPackager::AppxPackager() {} @@ -670,7 +670,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform { static const char *invalid_names[] = { "CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9", - NULL + nullptr }; const char **t = invalid_names; @@ -726,7 +726,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform { "snow", "springGreen", "steelBlue", "tan", "teal", "thistle", "tomato", "transparent", "turquoise", "violet", "wheat", "white", "whiteSmoke", "yellow", "yellowGreen", - NULL + nullptr }; const char **color = valid_colors; @@ -876,22 +876,22 @@ class EditorExportPlatformUWP : public EditorExportPlatform { Vector<uint8_t> _get_image_data(const Ref<EditorExportPreset> &p_preset, const String &p_path) { Vector<uint8_t> data; - StreamTexture *image = NULL; + StreamTexture *image = nullptr; if (p_path.find("StoreLogo") != -1) { - image = p_preset->get("images/store_logo").is_zero() ? NULL : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/store_logo"))); + image = p_preset->get("images/store_logo").is_zero() ? nullptr : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/store_logo"))); } else if (p_path.find("Square44x44Logo") != -1) { - image = p_preset->get("images/square44x44_logo").is_zero() ? NULL : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/square44x44_logo"))); + image = p_preset->get("images/square44x44_logo").is_zero() ? nullptr : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/square44x44_logo"))); } else if (p_path.find("Square71x71Logo") != -1) { - image = p_preset->get("images/square71x71_logo").is_zero() ? NULL : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/square71x71_logo"))); + image = p_preset->get("images/square71x71_logo").is_zero() ? nullptr : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/square71x71_logo"))); } else if (p_path.find("Square150x150Logo") != -1) { - image = p_preset->get("images/square150x150_logo").is_zero() ? NULL : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/square150x150_logo"))); + image = p_preset->get("images/square150x150_logo").is_zero() ? nullptr : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/square150x150_logo"))); } else if (p_path.find("Square310x310Logo") != -1) { - image = p_preset->get("images/square310x310_logo").is_zero() ? NULL : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/square310x310_logo"))); + image = p_preset->get("images/square310x310_logo").is_zero() ? nullptr : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/square310x310_logo"))); } else if (p_path.find("Wide310x150Logo") != -1) { - image = p_preset->get("images/wide310x150_logo").is_zero() ? NULL : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/wide310x150_logo"))); + image = p_preset->get("images/wide310x150_logo").is_zero() ? nullptr : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/wide310x150_logo"))); } else if (p_path.find("SplashScreen") != -1) { - image = p_preset->get("images/splash_screen").is_zero() ? NULL : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/splash_screen"))); + image = p_preset->get("images/splash_screen").is_zero() ? nullptr : Object::cast_to<StreamTexture>(((Object *)p_preset->get("images/splash_screen"))); } else { ERR_PRINT("Unable to load logo"); } @@ -961,7 +961,7 @@ class EditorExportPlatformUWP : public EditorExportPlatform { ".scn", // Binary scenes are usually already compressed ".stex", // Streamable textures are usually already compressed // Trailer for easier processing - NULL + nullptr }; for (const char **ext = unconditional_compress_ext; *ext; ++ext) { @@ -1251,7 +1251,7 @@ public: AppxPackager packager; packager.init(fa_pack); - FileAccess *src_f = NULL; + FileAccess *src_f = nullptr; zlib_filefunc_def io = zipio_create_io_from_file(&src_f); if (ep.step("Creating package...", 0)) { @@ -1283,7 +1283,7 @@ public: // get file name unz_file_info info; char fname[16834]; - ret = unzGetCurrentFileInfo(pkg, &info, fname, 16834, NULL, 0, NULL, 0); + ret = unzGetCurrentFileInfo(pkg, &info, fname, 16834, nullptr, 0, nullptr, 0); String path = fname; diff --git a/platform/uwp/os_uwp.cpp b/platform/uwp/os_uwp.cpp index 85719d13ae..f5e989b370 100644 --- a/platform/uwp/os_uwp.cpp +++ b/platform/uwp/os_uwp.cpp @@ -180,7 +180,7 @@ void OS_UWP::screen_size_changed() { Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_audio_driver) { - main_loop = NULL; + main_loop = nullptr; outside = true; // FIXME: Hardcoded for now, add Vulkan support. @@ -193,7 +193,7 @@ Error OS_UWP::initialize(const VideoMode &p_desired, int p_video_driver, int p_a if (gl_context->initialize() != OK) { memdelete(gl_context); - gl_context = NULL; + gl_context = nullptr; gl_initialization_error = true; } @@ -333,7 +333,7 @@ void OS_UWP::delete_main_loop() { if (main_loop) memdelete(main_loop); - main_loop = NULL; + main_loop = nullptr; } void OS_UWP::set_main_loop(MainLoop *p_main_loop) { @@ -347,7 +347,7 @@ void OS_UWP::finalize() { if (main_loop) memdelete(main_loop); - main_loop = NULL; + main_loop = nullptr; rendering_server->finish(); memdelete(rendering_server); @@ -773,9 +773,9 @@ void OS_UWP::hide_virtual_keyboard() { static String format_error_message(DWORD id) { - LPWSTR messageBuffer = NULL; + LPWSTR messageBuffer = nullptr; size_t size = FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, id, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&messageBuffer, 0, NULL); + nullptr, id, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&messageBuffer, 0, nullptr); String msg = "Error " + itos(id) + ": " + String(messageBuffer, size); @@ -869,14 +869,14 @@ OS_UWP::OS_UWP() { stdo = fopen("stdout.txt", "wb"); #endif - gl_context = NULL; + gl_context = nullptr; display_request = ref new Windows::System::Display::DisplayRequest(); managed_object = ref new ManagedType; managed_object->os = this; - mouse_mode_changed = CreateEvent(NULL, TRUE, FALSE, L"os_mouse_mode_changed"); + mouse_mode_changed = CreateEvent(nullptr, TRUE, FALSE, L"os_mouse_mode_changed"); AudioDriverManager::add_driver(&audio_driver); diff --git a/platform/uwp/os_uwp.h b/platform/uwp/os_uwp.h index de3b094ef4..ad0efa1d03 100644 --- a/platform/uwp/os_uwp.h +++ b/platform/uwp/os_uwp.h @@ -202,7 +202,7 @@ public: virtual void delay_usec(uint32_t p_usec) const; virtual uint64_t get_ticks_usec() const; - virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking = true, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL, bool read_stderr = false, Mutex *p_pipe_mutex = NULL); + virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking = true, ProcessID *r_child_id = nullptr, String *r_pipe = nullptr, int *r_exitcode = nullptr, bool read_stderr = false, Mutex *p_pipe_mutex = nullptr); virtual Error kill(const ProcessID &p_pid); virtual bool has_environment(const String &p_var) const; |