On Sunday 25 May 2008 16:19:24 Dmitry Timoshkov wrote:
@@ -314,6 +316,7 @@ static const int ws_proto_map[][2] = MAP_OPTION( IPPROTO_ICMP ), MAP_OPTION( IPPROTO_IGMP ), MAP_OPTION( IPPROTO_RAW ),
- {FROM_PROTOCOL_INFO, FROM_PROTOCOL_INFO},
};
Although it was the case before, it's a mistake to have a comma after the last struct member initializer.
It is? K&R seems to use both, so I preferred to keep it similar to all the other struct member initializers.
- if (lpProtocolInfo) {
if (af == FROM_PROTOCOL_INFO)
af = lpProtocolInfo->iAddressFamily;
if (type == FROM_PROTOCOL_INFO)
type = lpProtocolInfo->iSocketType;
if (protocol == FROM_PROTOCOL_INFO)
protocol = lpProtocolInfo->iProtocol;
Please keep opening brace style/indentation consistent with code you have removed.
The function is a mess with brace style and indentation. I've used the same indentaion as the if right above this one. The function wildly mixes two-space, three-space and four-space indents. In this case, I used two-space indents for the outer if and four-space indents for the inner ifs for better readability.
--- a/include/winsock.h +++ b/include/winsock.h @@ -146,6 +146,7 @@ extern "C" { /* proper 4-byte packing */ #include <pshpack4.h>
+#define FROM_PROTOCOL_INFO (-1)
PSDK has it in winsock2.h
PSDK has the AF_*, PF_*, SOCK_* and IPPROTO_* defines in winsock2.h as well, Wine hasn't. I preferred to keep them together.
I don't fully understand why people suddenly start getting picky about stuff like this when noone previously gave a damn. As it's not acceptable to just go over this mess with indent, I don't see how conforming to one sort of messy indentation is preferrable to another sort of messy indentation.
Seriously, this patch fixes a bug, take it or leave it and fix it yourself. Kai