On 12/11/2011 11:55 PM, David Griffith wrote:
> On Sun, 11 Dec 2011, Ralf A. Quint wrote:
>
>> At 09:36 PM 12/11/2011, Ralf A. Quint wrote:
>>>> How can I get this code to do the Right Thing?
>> Actually just realized that it's pretty easy, you just need to
>> typecast properly all parts of the makeid macro:
> Ugh!  how'd I miss something like that?  This revelation may come in handy
> when dealing with some uint32 types.
>
>

Just another general rule for good C code - mark your constants if they 
are large.  For example:

#define CONNECT_TMEOUT_MS (50000ul)

That does not work in your case, but it looks nicer than repeated casting.

The compiler wants to 'think' 16 bits, because that is what it is good 
at.  It can do 32 bits, but it has to be forced to do so.  Whenever you 
are doing mixed 16 and 32 bit computations start casting upward like crazy.


Mike



------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching it streamed LIVE online.  
Learn more at http://p.sf.net/sfu/ms-windowsazure
_______________________________________________
Freedos-user mailing list
Freedos-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-user

Reply via email to