[gtkmm/gtkmm-3-22] FileChooserDialog: Use static_cast, not C cast



commit b16cd04b4f7ef64f74c7f2d52a1b6eddd5775931
Author: Daniel Boles <dboles src gnome org>
Date:   Mon Mar 27 21:00:13 2017 +0100

    FileChooserDialog: Use static_cast, not C cast
    
    static_cast is better C++ style and safer due to compile-time checking.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=780004

 gtk/src/filechooserdialog.ccg |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/src/filechooserdialog.ccg b/gtk/src/filechooserdialog.ccg
index d911ec7..08b600e 100644
--- a/gtk/src/filechooserdialog.ccg
+++ b/gtk/src/filechooserdialog.ccg
@@ -24,27 +24,27 @@ namespace Gtk
 
 FileChooserDialog::FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, FileChooserAction 
action)
 :
-  _CONSTRUCT("title", title.c_str(), "action", (GtkFileChooserAction)action)
+  _CONSTRUCT("title", title.c_str(), "action", static_cast<GtkFileChooserAction>(action))
 {
   set_transient_for(parent);
 }
 
 FileChooserDialog::FileChooserDialog(const Glib::ustring& title, FileChooserAction action)
 :
-  _CONSTRUCT("title", title.c_str(), "action", (GtkFileChooserAction)action)
+  _CONSTRUCT("title", title.c_str(), "action", static_cast<GtkFileChooserAction>(action))
 {
 }
 
 _DEPRECATE_IFDEF_START
 FileChooserDialog::FileChooserDialog(const Glib::ustring& title, FileChooserAction action, const 
Glib::ustring& backend)
 :
-  _CONSTRUCT("title", title.c_str(), "action", (GtkFileChooserAction)action, "file-system-backend", 
backend.c_str())
+  _CONSTRUCT("title", title.c_str(), "action", static_cast<GtkFileChooserAction>(action), 
"file-system-backend", backend.c_str())
 {
 }
 
 FileChooserDialog::FileChooserDialog(Gtk::Window& parent, const Glib::ustring& title, FileChooserAction 
action, const Glib::ustring& backend)
 :
-  _CONSTRUCT("title", title.c_str(), "action", (GtkFileChooserAction)action, "file-system-backend", 
backend.c_str())
+  _CONSTRUCT("title", title.c_str(), "action", static_cast<GtkFileChooserAction>(action), 
"file-system-backend", backend.c_str())
 {
   set_transient_for(parent);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]