qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH V5 2/8] snapshot: distinguish id and name in sna


From: Wenchao Xia
Subject: Re: [Qemu-devel] [PATCH V5 2/8] snapshot: distinguish id and name in snapshot delete
Date: Fri, 19 Jul 2013 17:12:27 +0800
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/20130620 Thunderbird/17.0.7

于 2013-7-18 19:07, Stefan Hajnoczi 写道:
On Thu, Jul 11, 2013 at 01:46:58PM +0800, Wenchao Xia wrote:
diff --git a/include/qemu-common.h b/include/qemu-common.h
index f439738..06c777f 100644
--- a/include/qemu-common.h
+++ b/include/qemu-common.h
@@ -191,6 +191,9 @@ int64_t strtosz_suffix(const char *nptr, char **end, const 
char default_suffix);
  int64_t strtosz_suffix_unit(const char *nptr, char **end,
                              const char default_suffix, int64_t unit);

+/* used to print char* safely */
+#define STR_PRINT_CHAR(str) ((str) ? (str) : "null")

When I saw the name I thought it would filter out non-printable
characters.  Maybe STR_OR_NULL() is a better name?

  I'll use STR_OR_NULL(), looks better.

BTW the evil gcc shortcut is pretty quick to type: str ?: "null".

Besides this I'm pretty happy with this version.



--
Best Regards

Wenchao Xia




reply via email to

[Prev in Thread] Current Thread [Next in Thread]