[glibmm] gmmproc: Use nullptr instead of 0.
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] gmmproc: Use nullptr instead of 0.
- Date: Fri, 20 Nov 2015 09:37:26 +0000 (UTC)
commit 6f6e91dc4b7d55cf9ca90c10189f0238774ffaa8
Author: Murray Cumming <murrayc murrayc com>
Date: Thu Nov 19 12:58:14 2015 +0100
gmmproc: Use nullptr instead of 0.
glib/src/value_basictypes.cc.m4 | 2 +-
tools/m4/class_boxedtype.m4 | 4 ++--
tools/m4/class_opaque_copyable.m4 | 6 +++---
tools/m4/ctor.m4 | 14 +++++++-------
tools/pm/Output.pm | 10 +++++-----
5 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/glib/src/value_basictypes.cc.m4 b/glib/src/value_basictypes.cc.m4
index 090b33b..fd5f775 100644
--- a/glib/src/value_basictypes.cc.m4
+++ b/glib/src/value_basictypes.cc.m4
@@ -48,7 +48,7 @@ $1 Value<$1>::get() const
GParamSpec* Value<$1>::create_param_spec(const Glib::ustring& name) const
{
return g_param_spec_[]ifelse($2,schar,char,$2)(
- name.c_str(), 0, 0,ifelse($2,pointer,,[
+ name.c_str(), nullptr, nullptr,ifelse($2,pointer,,[
ifelse($3,,,[$3, $4, ])[]g_value_get_$2(&gobject_),])
GParamFlags(G_PARAM_READABLE | G_PARAM_WRITABLE));
}
diff --git a/tools/m4/class_boxedtype.m4 b/tools/m4/class_boxedtype.m4
index 58682f1..32b42ad 100644
--- a/tools/m4/class_boxedtype.m4
+++ b/tools/m4/class_boxedtype.m4
@@ -123,7 +123,7 @@ ifdef(`__BOOL_CUSTOM_DEFAULT_CTOR__',`dnl
__CPPNAME__::__CPPNAME__`'()
:
ifelse(__BOXEDTYPE_FUNC_NEW,NONE,`dnl
- gobject_ (0) // Allows creation of invalid wrapper, e.g. for output arguments to methods.
+ gobject_ (nullptr) // Allows creation of invalid wrapper, e.g. for output arguments to methods.
',`dnl else
gobject_ (__BOXEDTYPE_FUNC_NEW`'())
')dnl
@@ -132,7 +132,7 @@ ifelse(__BOXEDTYPE_FUNC_NEW,NONE,`dnl
__CPPNAME__::__CPPNAME__`'(const __CPPNAME__& other)
:
- gobject_ ((other.gobject_) ? __BOXEDTYPE_FUNC_COPY`'(other.gobject_) : 0)
+ gobject_ ((other.gobject_) ? __BOXEDTYPE_FUNC_COPY`'(other.gobject_) : nullptr)
{}
__CPPNAME__::__CPPNAME__`'(__CPPNAME__&& other) noexcept
diff --git a/tools/m4/class_opaque_copyable.m4 b/tools/m4/class_opaque_copyable.m4
index cfe7915..4fdab1e 100644
--- a/tools/m4/class_opaque_copyable.m4
+++ b/tools/m4/class_opaque_copyable.m4
@@ -97,7 +97,7 @@ ifdef(`__BOOL_CUSTOM_DEFAULT_CTOR__',`dnl
__CPPNAME__::__CPPNAME__`'()
:
ifelse(__OPAQUE_FUNC_NEW,NONE,`dnl
- gobject_ (0) // Allows creation of invalid wrapper, e.g. for output arguments to methods.
+ gobject_ (nullptr) // Allows creation of invalid wrapper, e.g. for output arguments to methods.
',`dnl else
gobject_ (__OPAQUE_FUNC_NEW`'())
')dnl
@@ -106,7 +106,7 @@ ifelse(__OPAQUE_FUNC_NEW,NONE,`dnl
__CPPNAME__::__CPPNAME__`'(const __CPPNAME__& src)
:
- gobject_ ((src.gobject_) ? __OPAQUE_FUNC_COPY`'(src.gobject_) : 0)
+ gobject_ ((src.gobject_) ? __OPAQUE_FUNC_COPY`'(src.gobject_) : nullptr)
{}
ifdef(`__BOOL_CUSTOM_CTOR_CAST__',,`dnl else
@@ -133,7 +133,7 @@ ifelse(__OPAQUE_FUNC_COPY,NONE,`dnl
',`dnl else
__CPPNAME__& __CPPNAME__::operator=(const __CPPNAME__`'& src)
{
- const auto new_gobject = (src.gobject_) ? __OPAQUE_FUNC_COPY`'(src.gobject_) : 0;
+ const auto new_gobject = (src.gobject_) ? __OPAQUE_FUNC_COPY`'(src.gobject_) : nullptr;
if(gobject_)
__OPAQUE_FUNC_FREE`'(gobject_);
diff --git a/tools/m4/ctor.m4 b/tools/m4/ctor.m4
index cca77e1..c9dd414 100644
--- a/tools/m4/ctor.m4
+++ b/tools/m4/ctor.m4
@@ -19,7 +19,7 @@ _PUSH(SECTION_CC)
__CPPNAME__::__CPPNAME__`'()
:
// Mark this class as non-derived to allow C++ vfuncs to be skipped.
- Glib::ObjectBase(0),
+ Glib::ObjectBase(nullptr),
__CPPPARENT__`'(Glib::ConstructParams(__BASE__`'_class_.init()))
{
_IMPORT(SECTION_CC_INITIALIZE_CLASS_EXTRA)
@@ -39,8 +39,8 @@ _PUSH(SECTION_CC)
__CPPNAME__::$1`'($3)
:
// Mark this class as non-derived to allow C++ vfuncs to be skipped.
- Glib::ObjectBase(0),
- __CPPPARENT__`'(Glib::ConstructParams(__BASE__`'_class_.init()m4_ifelse(`$4',,,`, $4,
static_cast<char*>(0)')))
+ Glib::ObjectBase(nullptr),
+ __CPPPARENT__`'(Glib::ConstructParams(__BASE__`'_class_.init()m4_ifelse(`$4',,,`, $4, nullptr')))
{
_IMPORT(SECTION_CC_INITIALIZE_CLASS_EXTRA)
@@ -51,16 +51,16 @@ _POP()')
m4_define(`_CONSTRUCT',
`// Mark this class as non-derived to allow C++ vfuncs to be skipped.
- Glib::ObjectBase(0),
- __CPPPARENT__`'(Glib::ConstructParams(__BASE__`'_class_.init()m4_ifelse(`$1',,,`, $@,
static_cast<char*>(0)')))')
+ Glib::ObjectBase(nullptr),
+ __CPPPARENT__`'(Glib::ConstructParams(__BASE__`'_class_.init()m4_ifelse(`$1',,,`, $@, nullptr')))')
dnl _CONSTRUCT() does not deal with multiple class definitions in one file.
dnl If necessary, _CONSTRUCT_SPECIFIC(BaseClass, Class) must be used instead.
dnl
m4_define(`_CONSTRUCT_SPECIFIC',
`// Mark this class as non-derived to allow C++ vfuncs to be skipped.
- Glib::ObjectBase(0),
- $1`'(Glib::ConstructParams(_LOWER(`$2')_class_.init()m4_ifelse(`$3',,,`, m4_shift(m4_shift($@)),
static_cast<char*>(0)')))')
+ Glib::ObjectBase(nullptr),
+ $1`'(Glib::ConstructParams(_LOWER(`$2')_class_.init()m4_ifelse(`$3',,,`, m4_shift(m4_shift($@)),
nullptr')))')
dnl Extra code for initialize_class.
dnl Not commonly used.
diff --git a/tools/pm/Output.pm b/tools/pm/Output.pm
index 71c2ceb..acb6dd8 100644
--- a/tools/pm/Output.pm
+++ b/tools/pm/Output.pm
@@ -1185,11 +1185,11 @@ sub convert_args_cpp_to_c($$$$$)
if(!($possible_arg_list =~ /\b$cpp_param_index\b/))
{
# If the C++ index is not found in the list of desired parameters, pass
- # NULL to the C func unless the param is not optional (applies to a
+ # nullptr to the C func unless the param is not optional (applies to a
# possibly added GError parameter).
if (($$cpp_param_flags[$cpp_param_index] & FLAG_PARAM_OPTIONAL))
{
- push(@conversions, "0");
+ push(@conversions, "nullptr");
next;
}
}
@@ -1268,7 +1268,7 @@ sub convert_args_cpp_to_c($$$$$)
if (($$cpp_param_flags[$cpp_param_index] & FLAG_PARAM_OPTIONAL) &&
$cppParamType =~ /^(const\s+)?(std::string|Glib::ustring)&?/)
{
- push(@conversions, "$cppParamName.empty() ? 0 : " . $std_conversion);
+ push(@conversions, "$cppParamName.empty() ? nullptr : " . $std_conversion);
}
else
{
@@ -1294,7 +1294,7 @@ sub convert_args_cpp_to_c($$$$$)
}
else
{
- push(@conversions, "0")
+ push(@conversions, "nullptr")
}
}
@@ -1528,7 +1528,7 @@ sub get_ctor_properties($$$$$$)
# NULL to the C func unless the param is not optional.
if (~($$cpp_param_flags[$cpp_param_index] & FLAG_PARAM_OPTIONAL))
{
- push(@result, "0");
+ push(@result, "nullptr");
next;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]