[gnome-commander/Implement_CppCheck_suggestions] C++11 cast, use nullptr instead of NULL
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/Implement_CppCheck_suggestions] C++11 cast, use nullptr instead of NULL
- Date: Wed, 20 Mar 2019 22:34:42 +0000 (UTC)
commit f072c0f42e1d9bbea0c2ca6a246aef4d5e1b4a95
Author: Uwe Scholz <u scholz83 gmx de>
Date: Wed Mar 20 23:08:15 2019 +0100
C++11 cast, use nullptr instead of NULL
src/gnome-cmd-con-smb.cc | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/src/gnome-cmd-con-smb.cc b/src/gnome-cmd-con-smb.cc
index 09611029..bd0a9ae2 100644
--- a/src/gnome-cmd-con-smb.cc
+++ b/src/gnome-cmd-con-smb.cc
@@ -1,4 +1,4 @@
-/**
+/**
* @file gnome-cmd-con-smb.cc
* @copyright (C) 2001-2006 Marcus Bjurman\n
* @copyright (C) 2007-2012 Piotr Eljasiak\n
@@ -37,7 +37,7 @@ struct GnomeCmdConSmbClass
};
-static GnomeCmdConClass *parent_class = NULL;
+static GnomeCmdConClass *parent_class = nullptr;
static void
@@ -45,7 +45,7 @@ get_file_info_callback (GnomeVFSAsyncHandle *handle,
GList *results, /* GnomeVFSGetFileInfoResult *items */
GnomeCmdCon *con)
{
- g_return_if_fail (results != NULL);
+ g_return_if_fail (results != nullptr);
if (con->state == GnomeCmdCon::STATE_OPENING)
{
@@ -85,7 +85,7 @@ get_file_info_callback (GnomeVFSAsyncHandle *handle,
static void smb_open (GnomeCmdCon *con)
{
if (!con->base_path)
- con->base_path = new GnomeCmdSmbPath(NULL, NULL, NULL);
+ con->base_path = new GnomeCmdSmbPath(nullptr, nullptr, nullptr);
GnomeVFSURI *uri = gnome_cmd_con_create_uri (con, con->base_path);
if (!uri)
@@ -98,7 +98,7 @@ static void smb_open (GnomeCmdCon *con)
}
DEBUG('l', "Connecting to %s\n", gnome_vfs_uri_to_string (uri, GNOME_VFS_URI_HIDE_PASSWORD));
- GList *uri_list = g_list_append (NULL, uri);
+ GList *uri_list = g_list_append (nullptr, uri);
con->state = GnomeCmdCon::STATE_OPENING;
con->open_result = GnomeCmdCon::OPEN_IN_PROGRESS;
@@ -141,11 +141,11 @@ static GnomeVFSURI *smb_create_uri (GnomeCmdCon *con, GnomeCmdPath *path)
GnomeVFSURI *u1, *u2;
u1 = gnome_vfs_uri_new ("smb:");
- if (!u1) return NULL;
+ if (!u1) return nullptr;
u2 = gnome_vfs_uri_append_path (u1, path->get_path());
gnome_vfs_uri_unref (u1);
- if (!u2) return NULL;
+ if (!u2) return nullptr;
const gchar *p = gnome_vfs_uri_get_path (u2);
gchar *s = g_strdup_printf ("smb:/%s", p);
@@ -186,7 +186,7 @@ static void class_init (GnomeCmdConSmbClass *klass)
GtkObjectClass *object_class = GTK_OBJECT_CLASS (klass);
GnomeCmdConClass *con_class = GNOME_CMD_CON_CLASS (klass);
- parent_class = (GnomeCmdConClass *) gtk_type_class (GNOME_CMD_TYPE_CON);
+ parent_class = (static_cast<GnomeCmdConClass*> (gtk_type_class (GNOME_CMD_TYPE_CON));
object_class->destroy = destroy;
@@ -239,9 +239,9 @@ GtkType gnome_cmd_con_smb_get_type ()
sizeof (GnomeCmdConSmbClass),
(GtkClassInitFunc) class_init,
(GtkObjectInitFunc) init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL
+ /* reserved_1 */ nullptr,
+ /* reserved_2 */ nullptr,
+ (GtkClassInitFunc) nullptr
};
type = gtk_type_unique (GNOME_CMD_TYPE_CON, &info);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]