[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 13/17: [grops,libgroff]: Fix code style nits.
From: |
G. Branden Robinson |
Subject: |
[groff] 13/17: [grops,libgroff]: Fix code style nits. |
Date: |
Sat, 17 Feb 2024 22:08:44 -0500 (EST) |
gbranden pushed a commit to branch master
in repository groff.
commit 080141020ca47dc04cde31aadcc8e6e34c899ef4
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
AuthorDate: Sat Feb 17 18:12:21 2024 -0600
[grops,libgroff]: Fix code style nits.
Annotate null pointers with `nullptr` comment to ease any future
transition to C++11, which defines it as a keyword. Kill off trailing
whitespace.
---
src/devices/grops/psrm.cpp | 3 ++-
src/libs/libgroff/string.cpp | 6 +++---
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/devices/grops/psrm.cpp b/src/devices/grops/psrm.cpp
index f7ba771c6..379ed9b6f 100644
--- a/src/devices/grops/psrm.cpp
+++ b/src/devices/grops/psrm.cpp
@@ -138,7 +138,8 @@ struct resource {
};
resource::resource(resource_type t, string &n, string &v, unsigned r)
-: next(0), type(t), flags(0), revision(r), filename(0), rank(-1)
+: next(0 /* nullptr */), type(t), flags(0), revision(r),
+ filename(0 /* nullptr */), rank(-1)
{
name.move(n);
version.move(v);
diff --git a/src/libs/libgroff/string.cpp b/src/libs/libgroff/string.cpp
index a939b24d6..0633db526 100644
--- a/src/libs/libgroff/string.cpp
+++ b/src/libs/libgroff/string.cpp
@@ -95,9 +95,9 @@ string::string(const char *p, int n) : len(n)
string::string(const char *p)
{
- if (p == 0) {
+ if (p == 0 /* nullptr */) {
len = 0;
- ptr = 0;
+ ptr = 0 /* nullptr */;
sz = 0;
}
else {
@@ -120,7 +120,7 @@ string::string(const string &s) : len(s.len)
if (len != 0)
memcpy(ptr, s.ptr, len);
}
-
+
string::~string()
{
sfree(ptr, sz);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 13/17: [grops,libgroff]: Fix code style nits.,
G. Branden Robinson <=