From 9f9aeac59f5adbb5f070db26d85188af3bb05637 Mon Sep 17 00:00:00 2001 From: Patrick Reynolds Date: Sun, 17 Nov 2013 22:25:24 -0600 Subject: [PATCH] safer casts, clearer if-else chain --- .../linux/inspectable_web_contents_view_linux.cc | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/brightray/browser/linux/inspectable_web_contents_view_linux.cc b/brightray/browser/linux/inspectable_web_contents_view_linux.cc index dc58b38dff..2546bccc82 100644 --- a/brightray/browser/linux/inspectable_web_contents_view_linux.cc +++ b/brightray/browser/linux/inspectable_web_contents_view_linux.cc @@ -31,7 +31,7 @@ static void dump_one(GtkWidget *wat, int indent) { gtk_widget_get_allocation(wat, &alloc); fprintf(stderr, "%*s[%p] %s @%d,%d %dx%d", indent, "", wat, - g_type_name_from_instance(reinterpret_cast(wat)), + g_type_name_from_instance(static_cast(wat)), alloc.x, alloc.y, alloc.width, alloc.height); if (GTK_IS_WINDOW(wat)) { fprintf(stderr, " - \"%s\"", gtk_window_get_title(GTK_WINDOW(wat))); @@ -106,7 +106,7 @@ void InspectableWebContentsViewLinux::ShowDevTools() { DLOG(INFO) << base::StringPrintf( "InspectableWebContentsViewLinux::ShowDevTools - " \ "parent=%s@%p window=%p dockside=\"%s\"", - g_type_name_from_instance(reinterpret_cast(parent)), + g_type_name_from_instance(static_cast(parent)), parent, devtools_window_, dockside_.c_str()); @@ -132,15 +132,14 @@ void InspectableWebContentsViewLinux::CloseDevTools() { DLOG(INFO) << base::StringPrintf( "InspectableWebContentsViewLinux::CloseDevTools - " \ "parent=%s@%p window=%p dockside=\"%s\"", - g_type_name_from_instance(reinterpret_cast(parent)), + g_type_name_from_instance(static_cast(parent)), parent, devtools_window_, dockside_.c_str()); - if (!parent) + if (!parent) { return; // Not visible -> nothing to do - - if (GTK_IS_PANED(parent)) { + } else if (GTK_IS_PANED(parent)) { GtkWidget *browser = GetBrowserWindow(); GtkWidget *view = GetNativeView();