diff options
Diffstat (limited to 'glib/src/fileutils.ccg')
-rw-r--r-- | glib/src/fileutils.ccg | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/glib/src/fileutils.ccg b/glib/src/fileutils.ccg index 59fe145c..43dc1857 100644 --- a/glib/src/fileutils.ccg +++ b/glib/src/fileutils.ccg @@ -26,7 +26,7 @@ namespace Glib Dir::Dir(const std::string& path) { - GError* error = 0; + GError* error = nullptr; gobject_ = g_dir_open(path.c_str(), 0, &error); if(error) @@ -60,7 +60,7 @@ void Dir::close() if(gobject_) { g_dir_close(gobject_); - gobject_ = 0; + gobject_ = nullptr; } } @@ -125,7 +125,7 @@ bool file_test(const std::string& filename, FileTest test) int mkstemp(std::string& filename_template) { const ScopedPtr<char> buf (g_strndup(filename_template.data(), filename_template.size())); - const int fileno = g_mkstemp(buf.get()); + const auto fileno = g_mkstemp(buf.get()); filename_template = buf.get(); return fileno; @@ -136,10 +136,10 @@ int file_open_tmp(std::string& name_used, const std::string& prefix) std::string basename_template (prefix); basename_template += "XXXXXX"; // this sillyness shouldn't be in the interface - GError* error = 0; + GError* error = nullptr; ScopedPtr<char> buf_name_used; - const int fileno = g_file_open_tmp(basename_template.c_str(), buf_name_used.addr(), &error); + const auto fileno = g_file_open_tmp(basename_template.c_str(), buf_name_used.addr(), &error); if(error) Glib::Error::throw_exception(error); @@ -150,10 +150,10 @@ int file_open_tmp(std::string& name_used, const std::string& prefix) int file_open_tmp(std::string& name_used) { - GError* error = 0; + GError* error = nullptr; ScopedPtr<char> buf_name_used; - const int fileno = g_file_open_tmp(0, buf_name_used.addr(), &error); + const auto fileno = g_file_open_tmp(0, buf_name_used.addr(), &error); if(error) Glib::Error::throw_exception(error); @@ -166,7 +166,7 @@ std::string file_get_contents(const std::string& filename) { ScopedPtr<char> contents; gsize length = 0; - GError* error = 0; + GError* error = nullptr; g_file_get_contents(filename.c_str(), contents.addr(), &length, &error); @@ -181,7 +181,7 @@ file_set_contents(const std::string& filename, const gchar *contents, gssize length) { - GError* error = 0; + GError* error = nullptr; g_file_set_contents(filename.c_str(), contents, length, &error); |