From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:41414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDVeq-0004mB-4N for qemu-devel@nongnu.org; Thu, 07 Mar 2013 02:54:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UDVep-0002ye-4F for qemu-devel@nongnu.org; Thu, 07 Mar 2013 02:54:32 -0500 Received: from e28smtp09.in.ibm.com ([122.248.162.9]:56716) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UDVeo-0002yP-JN for qemu-devel@nongnu.org; Thu, 07 Mar 2013 02:54:31 -0500 Received: from /spool/local by e28smtp09.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 7 Mar 2013 13:22:15 +0530 Received: from d28relay03.in.ibm.com (d28relay03.in.ibm.com [9.184.220.60]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 1F308E0056 for ; Thu, 7 Mar 2013 13:25:37 +0530 (IST) Received: from d28av01.in.ibm.com (d28av01.in.ibm.com [9.184.220.63]) by d28relay03.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r277sIa723331044 for ; Thu, 7 Mar 2013 13:24:18 +0530 Received: from d28av01.in.ibm.com (loopback [127.0.0.1]) by d28av01.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r277sHnp013809 for ; Thu, 7 Mar 2013 07:54:17 GMT Message-ID: <513847A1.5080006@linux.vnet.ibm.com> Date: Thu, 07 Mar 2013 15:54:09 +0800 From: Lei Li MIME-Version: 1.0 References: <1362577504-7994-1-git-send-email-lilei@linux.vnet.ibm.com> <1362577504-7994-2-git-send-email-lilei@linux.vnet.ibm.com> <51376134.1090001@redhat.com> In-Reply-To: <51376134.1090001@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2] qga: add windows implementation for guest-get-time List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, mdroth@linux.vnet.ibm.com On 03/06/2013 11:31 PM, Eric Blake wrote: > On 03/06/2013 06:45 AM, Lei Li wrote: >> Signed-off-by: Lei Li >> --- >> qga/commands-win32.c | 28 ++++++++++++++++++++++++++++ >> 1 files changed, 28 insertions(+), 0 deletions(-) >> >> diff --git a/qga/commands-win32.c b/qga/commands-win32.c >> index 7e8ecb3..4febec7 100644 >> --- a/qga/commands-win32.c >> +++ b/qga/commands-win32.c >> @@ -22,6 +22,8 @@ >> #define SHTDN_REASON_FLAG_PLANNED 0x80000000 >> #endif >> >> +#define _W32_FT_OFFSET (116444736000000000ULL) > Defining a macro with a leading underscore infringes on the namespace > reserved to the system headers and compiler implementation. Drop the > leading underscore. > > As written, the () are redundant. However, it would be nicer to state > HOW you came up with this number (and not that you just did a google > search for it), as in: > > /* multiple of 100 nanoseconds elapsed between windows baseline > (1/1/1601) and Unix Epoch (1/1/1970), accounting for leap years */ > #define W32_FT_OFFSET (10000000ULL * 60 * 60 * 24 * \ > (365 * (1970 - 1601) + \ > (1970 - 1601) / 4 - 3)) > Yes, it make sense, thanks! -- Lei