Hi Julien,<br><br>Thanks so much for your review. Really appreciate it. Just a quick note.<br><br>>--- /dev/null<br>
>+++ b/src/windefs.h<br>
>[...]<br>>+#define WINVER 0x0501 /* required for getaddrinfo/freeaddrinfo defined only for WinXP and above */<br>
<br>
>Hum, are you sure you always want to define it?<br>
>If not, maybe adding #ifndef WINVER / #endif surrounding this #define<br>>might be a good idea.<br><br>Functions such as getaddrinfo and a couple of others are only available upwards of Win 2000. The code won't compile if Winver is targeted for a platform which isn't this. I have tested my code primarily under XP though I don't see why it won't work under 2000 either. For Win95/98,etc I can't say if it will even compile. I'd like to think this through a little bit.<br>
<br>>You are redefining the whole function. IMHO, this is not so good,<br>
>because you are duplicating a lot of code. And is some day we need to<br>
>fix code in one of that function, we may forget to fix it in the WIN32<br>>version.<br>
<br>You're right I'll change this asap.<br><br>
>--- a/src/xcb.h<br>
>+++ b/src/xcb.h<br>
>+int initWSA(void);<br>><br>>This is not right. If I'm understanding correctly, this is required to<br>
>initialize some stuff. The function name is not respecting the naming<br>
>scheme of xcb functions and the name is too generic.<br><br>Need to think more on this. Will look into it. <br><br>Just playing catch up with some other stuff right now....will look into these and other changes as suggested by Peter as soon as I can.<br>
<br>
Thanks.<br><br>Bye for now<br><br><br><div class="gmail_quote">On Mon, May 18, 2009 at 1:46 PM, Julien Danjou <span dir="ltr"><<a href="mailto:julien@danjou.info">julien@danjou.info</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
HI,<br>
<div class="im"><br>
At 1242038193 time_t, Jeetu Golani wrote:<br>
> I've updated my branch at github to reflect changes in code as suggested by<br>
> Julien and also rectify the goof ups I made with my initial submission.<br>
><br>
> Julien, I would appreciate if you could verify if all is well now.<br>
<br>
</div>Yeah, that's much better. :-)<br>
<br>
I'll quote some of your work here and just review it. I'm not qualified<br>
in Windows coding so I won't judge if the work is good, bad or even<br>
functionnal.<br>
<br>
--- /dev/null<br>
+++ b/src/windefs.h<br>
[...]<br>
+#define WINVER 0x0501 /* required for getaddrinfo/freeaddrinfo defined only for WinXP and above */<br>
<br>
Hum, are you sure you always want to define it?<br>
If not, maybe adding #ifndef WINVER / #endif surrounding this #define<br>
might be a good idea.<br>
<br>
<br>
--- a/src/xcb_in.c<br>
+++ b/src/xcb_in.c<br>
+static int read_block(const int fd, void *buf, const size_t len)<br>
and<br>
+int _xcb_in_read(xcb_connection_t *c)<br>
<br>
You are redefining the whole function. IMHO, this is not so good,<br>
because you are duplicating a lot of code. And is some day we need to<br>
fix code in one of that function, we may forget to fix it in the WIN32<br>
version.<br>
<br>
<br>
--- a/src/xcb.h<br>
+++ b/src/xcb.h<br>
+int initWSA(void);<br>
<br>
This is not right. If I'm understanding correctly, this is required to<br>
initialize some stuff. The function name is not respecting the naming<br>
scheme of xcb functions and the name is too generic.<br>
<br>
I suggest that:<br>
1. You drop the function and documente that loading winsock via<br>
WSAStartup() is mandatory before using XCB;<br>
2. or you add a static flag in xcb_open() that check that winsock has been<br>
initialized before running;<br>
3. or you initialize winsock in xcb_open() unconditionnally. I don't know<br>
if you can initialize winsock multiple times. If not, the solution<br>
above can be better. But again, maybe another lib can initiliaze<br>
winsock in its corner, so maybe if it can be initialized only once,<br>
solution 1 will be better.<br>
<br>
The rest seems fine to me.<br>
<div class="im"><br>
Cheers,<br>
--<br>
Julien Danjou<br>
// ᐰ <<a href="mailto:julien@danjou.info">julien@danjou.info</a>> <a href="http://julien.danjou.info" target="_blank">http://julien.danjou.info</a><br>
// 9A0D 5FD9 EB42 22F6 8974 C95C A462 B51E C2FE E5CD<br>
</div>// When I get sad, I stop being sad and be awesome instead. True story.<br>
<br>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.9 (GNU/Linux)<br>
<br>
iEYEARECAAYFAkoRIF4ACgkQpGK1HsLῄŸ昢ٌ㲃鶳𤫈퍤뎃鱯<br>
tJsAoNFkKUc1OjxugdpAG9U/sUifmgs6<br>
=HMAC<br>
-----END PGP SIGNATURE-----<br>
<br></blockquote></div><br>