www.digitalmars.com         C & C++   DMDScript  

D - "cannot implicitly convert uint to int"

reply Sam <Sam_member pathlink.com> writes:
That's the error message the dmd compiler give me
when I import windows.d :

line 999: const int MAXDWORD = (0xFFFFFFFF);

is there a bug with hexadecimal numbers ?

before i install 0.66, this error never occurs. Please help me !
Jun 12 2003
parent reply Helmut Leitner <helmut.leitner chello.at> writes:
Sam wrote:
 
 That's the error message the dmd compiler give me
 when I import windows.d :
 
 line 999: const int MAXDWORD = (0xFFFFFFFF);
 
 is there a bug with hexadecimal numbers ?
 
 before i install 0.66, this error never occurs. Please help me !

The line should read const int MAXDWORD = (int)(0xFFFFFFFF); I think the compiler got this "feature" in version 0.61 A revised windows.d file was posted by someone here in the newsgroup (there weree about hundred lines that had to be changed) If you don't find it easily, I can send you a copy. -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Jun 12 2003
next sibling parent reply Mark T <Mark_member pathlink.com> writes:
 
 before i install 0.66, this error never occurs. Please help me !

The line should read const int MAXDWORD = (int)(0xFFFFFFFF); I think the compiler got this "feature" in version 0.61

DWORD = 32 bit unsigned int
Jun 13 2003
parent reply Helmut Leitner <leitner hls.via.at> writes:
Mark T wrote:
 
 before i install 0.66, this error never occurs. Please help me !

The line should read const int MAXDWORD = (int)(0xFFFFFFFF); I think the compiler got this "feature" in version 0.61

DWORD = 32 bit unsigned int

Yes, but I think that a compiler might alternatively interpret 0xFFFFFFFF as "bit pattern" constant in this context (in fact we do). -- Helmut Leitner leitner hls.via.at Graz, Austria www.hls-software.com
Jun 13 2003
parent "Fabian Giesen" <rygNO SPAMgmx.net> writes:
Helmut Leitner wrote:
 Mark T wrote:
 before i install 0.66, this error never occurs. Please help me !

The line should read const int MAXDWORD = (int)(0xFFFFFFFF); I think the compiler got this "feature" in version 0.61

DWORD = 32 bit unsigned int

Yes, but I think that a compiler might alternatively interpret 0xFFFFFFFF as "bit pattern" constant in this context (in fact we do).

I rather think his point was that the constant should be uint, not int :) -fg
Jun 13 2003
prev sibling parent sam <sam_member pathlink.com> writes:
Sam wrote:
 
 That's the error message the dmd compiler give me
 when I import windows.d :
 
 line 999: const int MAXDWORD = (0xFFFFFFFF);
 
 is there a bug with hexadecimal numbers ?
 
 before i install 0.66, this error never occurs. Please help me !

The line should read const int MAXDWORD = (int)(0xFFFFFFFF); I think the compiler got this "feature" in version 0.61 A revised windows.d file was posted by someone here in the newsgroup (there weree about hundred lines that had to be changed) If you don't find it easily, I can send you a copy

I tried to cast the hexadecimal number to (int) but it doesn't work either the only way to compile is to change "const int" into "const uint" i'm interested to this version of windows.d you were talking about ( i tried but can't find it in the newsgroup ) could you please EMail it to me ? thanx in advance.
Jun 13 2003