Thread overview
"cannot implicitly convert uint to int"
Jun 12, 2003
Sam
Jun 12, 2003
Helmut Leitner
Re:
Jun 13, 2003
Mark T
Jun 13, 2003
Helmut Leitner
Jun 13, 2003
Fabian Giesen
Re: uint to (int)
Jun 13, 2003
sam
June 12, 2003
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 !


June 12, 2003

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
June 13, 2003
>> 
>> 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


June 13, 2003

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
June 13, 2003
>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.


June 13, 2003
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