|
From: | Paolo Bonzini |
Subject: | Re: [PATCH 3/3 v2] Handle Windows CE and rewrite NT version handling. |
Date: | Sun, 04 Oct 2009 12:25:08 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3 |
On 10/04/2009 11:45 AM, Bruno Haible wrote:
Now, looking at the two sides of this patch, honestly I don't find the latter side more readable. The first code is immediately, it's clear what it does. For the second code I find myself asking: "What if the loop over i falls off the end of the array?" "Why are two strings concatenated with a "\0" separator, rather than put separately in the struct?" "Why is version.wProductType being used in cases like (5,1) which don't have a distinction between workstation and server?"
The main difference is what happens on the next Windows version. It is 1 line added vs. at least 6 (or more if the major version changes). So, IMO the disadvantages fade quickly (they probably would have already faded if Microsoft went with a major version of 7 for, ehm, Windows 7).
The new code is only 9 lines longer, yet distinguishes Windows NT 4.0 Workstation and Windows NT 4.0 Server.
I squashed the attached to your patch and pushed it. 2009-10-04 Paolo Bonzini <address@hidden> * lib/uname.c (uname): Use a table-driven algorithm to compute NT versions.
uname-finish.patch
Description: Text document
[Prev in Thread] | Current Thread | [Next in Thread] |