[libvirt] [PATCH 3/6] Remove EMPTYSTR macro

Ján Tomko posted 6 patches 6 years, 12 months ago
[libvirt] [PATCH 3/6] Remove EMPTYSTR macro
Posted by Ján Tomko 6 years, 12 months ago
This macro neither takes nor produces an empty string.
Remove it in favor of NULLSTR_MINUS.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 src/internal.h        |  5 -----
 tools/virsh-network.c | 10 +++++-----
 2 files changed, 5 insertions(+), 10 deletions(-)

diff --git a/src/internal.h b/src/internal.h
index 7c11f57e33..cf03a82105 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -240,11 +240,6 @@
  */
 # define NULLSTR(s) ((s) ? (s) : "<null>")
 
-/*
- * Similar to NULLSTR, but print '-' to make it more user friendly.
- */
-# define EMPTYSTR(s) ((s) ? (s) : "-")
-
 /*
  * Turn a NULL string into an empty string
  */
diff --git a/tools/virsh-network.c b/tools/virsh-network.c
index 94adbabff7..9b86ef8071 100644
--- a/tools/virsh-network.c
+++ b/tools/virsh-network.c
@@ -1398,11 +1398,11 @@ cmdNetworkDHCPLeases(vshControl *ctl, const vshCmd *cmd)
 
         if (vshTableRowAppend(table,
                               expirytime,
-                              EMPTYSTR(lease->mac),
-                              EMPTYSTR(typestr),
-                              EMPTYSTR(cidr_format),
-                              EMPTYSTR(lease->hostname),
-                              EMPTYSTR(lease->clientid),
+                              NULLSTR_MINUS(lease->mac),
+                              NULLSTR_MINUS(typestr),
+                              NULLSTR_MINUS(cidr_format),
+                              NULLSTR_MINUS(lease->hostname),
+                              NULLSTR_MINUS(lease->clientid),
                               NULL) < 0)
             goto cleanup;
     }
-- 
2.20.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 3/6] Remove EMPTYSTR macro
Posted by Andrea Bolognani 6 years, 12 months ago
On Tue, 2019-02-12 at 17:40 +0100, Ján Tomko wrote:
> This macro neither takes nor produces an empty string.
> Remove it in favor of NULLSTR_MINUS.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
>  src/internal.h        |  5 -----
>  tools/virsh-network.c | 10 +++++-----
>  2 files changed, 5 insertions(+), 10 deletions(-)

Reviewed-by: Andrea Bolognani <abologna@redhat.com>

-- 
Andrea Bolognani / Red Hat / Virtualization

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list