Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
May 03, 2004 Conflicting arguments that don't conflict | ||||
---|---|---|---|---|
| ||||
Attachments: | (I originally posted this as http://www.digitalmars.com/drn-bin/wwwnews?D/27445, but I didn't label it as a bug, so Walter may have missed it.) I think the problem is caused by the necessary types being defined in the private scope in each file. I guess I know how to *solve* it, but I still wonder whether it's an *error* or a *bug*. If it's an error, I'd like to understand what's actually wrong with the code. Here's my error message: direct.d(25): function Blt (tagRECT *,IDirectDrawSurface ,tagRECT *,uint,DDBLTFX *) does not match argument types (tagRECT *,IDirectDrawSurface ,tagRECT *,uint,DDBLTFX *) This bug still occurs in DMD 0.86. /* *** *** directdraw.d *** *** */ module directdraw; private { alias int HRESULT; alias uint DWORD; struct tagRECT{} alias tagRECT* LPRECT; } extern(Windows) { alias IDirectDrawSurface LPDIRECTDRAWSURFACE; struct DDBLTFX{} interface IDirectDrawSurface { HRESULT Blt(LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, DDBLTFX*); } } enum: uint { DDBLT_WAIT = 0x01000000 } /* *** *** direct.d *** *** */ module direct; private import directdraw; private { struct tagRECT{} alias tagRECT RECT; alias tagRECT* LPRECT; } class DirectApp { IDirectDrawSurface primSurface; IDirectDrawSurface backingSurface; public this(){} public void updatePrimarySurface() { RECT source; RECT destination; primSurface.Blt( cast(tagRECT*) &destination, /* line 25 */ cast(IDirectDrawSurface) backingSurface, cast(tagRECT*) &source, cast(uint) DDBLT_WAIT, cast(DDBLTFX*) null ); } } -- Justin http://jcc_7.tripod.com/d/ |
May 24, 2004 Re: Conflicting arguments that don't conflict | ||||
---|---|---|---|---|
| ||||
Posted in reply to J C Calvarese | This can be way, way cut down into a smaller example! "J C Calvarese" <jcc7@cox.net> wrote in message news:c76kf9$ph0$1@digitaldaemon.com... > (I originally posted this as http://www.digitalmars.com/drn-bin/wwwnews?D/27445, but I didn't label it as a bug, so Walter may have missed it.) > > I think the problem is caused by the necessary types being defined in the private scope in each file. I guess I know how to *solve* it, but I still wonder whether it's an *error* or a *bug*. If it's an error, I'd like to understand what's actually wrong with the code. > > > Here's my error message: > > direct.d(25): function Blt > (tagRECT *,IDirectDrawSurface ,tagRECT *,uint,DDBLTFX *) > does not match argument types > (tagRECT *,IDirectDrawSurface ,tagRECT *,uint,DDBLTFX *) > > > This bug still occurs in DMD 0.86. > > > /* *** *** directdraw.d *** *** */ > > module directdraw; > > private > { > alias int HRESULT; > alias uint DWORD; > > struct tagRECT{} > alias tagRECT* LPRECT; > } > > extern(Windows) > { > alias IDirectDrawSurface LPDIRECTDRAWSURFACE; > struct DDBLTFX{} > > interface IDirectDrawSurface > { > HRESULT Blt(LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, DDBLTFX*); > } > } > > enum: uint { DDBLT_WAIT = 0x01000000 } > > > > /* *** *** direct.d *** *** */ > > module direct; > > private import directdraw; > > private > { > struct tagRECT{} > alias tagRECT RECT; > alias tagRECT* LPRECT; > } > > class DirectApp > { > IDirectDrawSurface primSurface; > IDirectDrawSurface backingSurface; > > public this(){} > > public void updatePrimarySurface() > { > RECT source; > RECT destination; > primSurface.Blt( > cast(tagRECT*) &destination, /* line 25 */ > cast(IDirectDrawSurface) backingSurface, > cast(tagRECT*) &source, > cast(uint) DDBLT_WAIT, > cast(DDBLTFX*) null ); > } > } > > -- > Justin > http://jcc_7.tripod.com/d/ > ---------------------------------------------------------------------------- ---- > @echo off > dmd direct.d -c > pause > echo. > > > ---------------------------------------------------------------------------- ---- > module direct; > > private import directdraw; > > private > { > struct tagRECT{} > alias tagRECT RECT; > alias tagRECT* LPRECT; > } > > class DirectApp > { > > IDirectDrawSurface primSurface; > IDirectDrawSurface backingSurface; > > public this(){} > > public void updatePrimarySurface() > { > RECT source; > RECT destination; > primSurface.Blt( > cast(tagRECT*) &destination, > cast(IDirectDrawSurface) backingSurface, > cast(tagRECT*) &source, > cast(uint) DDBLT_WAIT, > cast(DDBLTFX*) null ); > } > } > > ---------------------------------------------------------------------------- ---- > module directdraw; > > private > { > alias int HRESULT; > alias uint DWORD; > > struct tagRECT{} > alias tagRECT* LPRECT; > } > > extern(Windows) > { > alias IDirectDrawSurface LPDIRECTDRAWSURFACE; > struct DDBLTFX{} > > interface IDirectDrawSurface > { > HRESULT Blt(LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, DDBLTFX*); > } > } > > enum: uint { DDBLT_WAIT = 0x01000000 } > > |
May 25, 2004 Re: Conflicting arguments that don't conflict | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote: > This can be way, way cut down into a smaller example! I started about with something like 700kb. I though you might appreciate how far I got. > > "J C Calvarese" <jcc7@cox.net> wrote in message > news:c76kf9$ph0$1@digitaldaemon.com... > >>(I originally posted this as >>http://www.digitalmars.com/drn-bin/wwwnews?D/27445, but I didn't label >>it as a bug, so Walter may have missed it.) >> >>I think the problem is caused by the necessary types being defined in >>the private scope in each file. I guess I know how to *solve* it, but I >>still wonder whether it's an *error* or a *bug*. If it's an error, I'd >>like to understand what's actually wrong with the code. >> >> >>Here's my error message: >> >>direct.d(25): function Blt >>(tagRECT *,IDirectDrawSurface ,tagRECT *,uint,DDBLTFX *) >>does not match argument types >>(tagRECT *,IDirectDrawSurface ,tagRECT *,uint,DDBLTFX *) >> >> >>This bug still occurs in DMD 0.86. >> >> >>/* *** *** directdraw.d *** *** */ >> >>module directdraw; >> >>private >>{ >> alias int HRESULT; >> alias uint DWORD; >> >> struct tagRECT{} >> alias tagRECT* LPRECT; >>} >> >>extern(Windows) >>{ >> alias IDirectDrawSurface LPDIRECTDRAWSURFACE; >> struct DDBLTFX{} >> >> interface IDirectDrawSurface >> { >> HRESULT Blt(LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, DDBLTFX*); >> } >>} >> >>enum: uint { DDBLT_WAIT = 0x01000000 } >> >> >> >>/* *** *** direct.d *** *** */ >> >>module direct; >> >>private import directdraw; >> >>private >>{ >> struct tagRECT{} >> alias tagRECT RECT; >> alias tagRECT* LPRECT; >>} >> >>class DirectApp >>{ >> IDirectDrawSurface primSurface; >> IDirectDrawSurface backingSurface; >> >> public this(){} >> >> public void updatePrimarySurface() >> { >> RECT source; >> RECT destination; >> primSurface.Blt( >> cast(tagRECT*) &destination, /* line 25 */ >> cast(IDirectDrawSurface) backingSurface, >> cast(tagRECT*) &source, >> cast(uint) DDBLT_WAIT, >> cast(DDBLTFX*) null ); >> } >>} >> >>-- >>Justin >>http://jcc_7.tripod.com/d/ >> > > > > ---------------------------------------------------------------------------- > ---- > > > >>@echo off >>dmd direct.d -c >>pause >>echo. >> >> >> > > > > ---------------------------------------------------------------------------- > ---- > > > >>module direct; >> >>private import directdraw; >> >>private >>{ >> struct tagRECT{} >> alias tagRECT RECT; >> alias tagRECT* LPRECT; >>} >> >>class DirectApp >>{ >> >>IDirectDrawSurface primSurface; >>IDirectDrawSurface backingSurface; >> >>public this(){} >> >>public void updatePrimarySurface() >>{ >>RECT source; >>RECT destination; >>primSurface.Blt( >> cast(tagRECT*) &destination, >> cast(IDirectDrawSurface) backingSurface, >> cast(tagRECT*) &source, >> cast(uint) DDBLT_WAIT, >> cast(DDBLTFX*) null ); >>} >>} >> >> > > > > ---------------------------------------------------------------------------- > ---- > > > >>module directdraw; >> >>private >>{ >> alias int HRESULT; >> alias uint DWORD; >> >> struct tagRECT{} >> alias tagRECT* LPRECT; >>} >> >>extern(Windows) >>{ >>alias IDirectDrawSurface LPDIRECTDRAWSURFACE; >>struct DDBLTFX{} >> >>interface IDirectDrawSurface >>{ >> HRESULT Blt(LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, DDBLTFX*); >> } >>} >> >>enum: uint { DDBLT_WAIT = 0x01000000 } >> >> > > > -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/ |
May 25, 2004 Re: Conflicting arguments that don't conflict | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter | Walter wrote: > This can be way, way cut down into a smaller example! I guess I'll take that as a request. By the way, the error message has gotten more interesting: a.d(17): function Blt (R *) does not match argument types (R *) a.d(17): cannot implicitly convert R * to R * > "J C Calvarese" <jcc7@cox.net> wrote in message news:c76kf9$ph0$1@digitaldaemon.com... > >>(I originally posted this as http://www.digitalmars.com/drn-bin/wwwnews?D/27445, but I didn't label it as a bug, so Walter may have missed it.) >> >>I think the problem is caused by the necessary types being defined in the private scope in each file. I guess I know how to *solve* it, but I still wonder whether it's an *error* or a *bug*. If it's an error, I'd like to understand what's actually wrong with the code. >> >> >>Here's my error message: >> >>direct.d(25): function Blt >>(tagRECT *,IDirectDrawSurface ,tagRECT *,uint,DDBLTFX *) >>does not match argument types >>(tagRECT *,IDirectDrawSurface ,tagRECT *,uint,DDBLTFX *) >> >> >>This bug still occurs in DMD 0.86. >> >> >>/* *** *** directdraw.d *** *** */ >> >>module directdraw; >> >>private >>{ >> alias int HRESULT; >> alias uint DWORD; >> >> struct tagRECT{} >> alias tagRECT* LPRECT; >>} >> >>extern(Windows) >>{ >> alias IDirectDrawSurface LPDIRECTDRAWSURFACE; >> struct DDBLTFX{} >> >> interface IDirectDrawSurface >> { >> HRESULT Blt(LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, DDBLTFX*); >> } >>} >> >>enum: uint { DDBLT_WAIT = 0x01000000 } >> >> >> >>/* *** *** direct.d *** *** */ >> >>module direct; >> >>private import directdraw; >> >>private >>{ >> struct tagRECT{} >> alias tagRECT RECT; >> alias tagRECT* LPRECT; >>} >> >>class DirectApp >>{ >> IDirectDrawSurface primSurface; >> IDirectDrawSurface backingSurface; >> >> public this(){} >> >> public void updatePrimarySurface() >> { >> RECT source; >> RECT destination; >> primSurface.Blt( >> cast(tagRECT*) &destination, /* line 25 */ >> cast(IDirectDrawSurface) backingSurface, >> cast(tagRECT*) &source, >> cast(uint) DDBLT_WAIT, >> cast(DDBLTFX*) null ); >> } >>} >> >>-- >>Justin >>http://jcc_7.tripod.com/d/ >> > > > > ---------------------------------------------------------------------------- > ---- > > > >>@echo off >>dmd direct.d -c >>pause >>echo. >> >> >> > > > > ---------------------------------------------------------------------------- > ---- > > > >>module direct; >> >>private import directdraw; >> >>private >>{ >> struct tagRECT{} >> alias tagRECT RECT; >> alias tagRECT* LPRECT; >>} >> >>class DirectApp >>{ >> >>IDirectDrawSurface primSurface; >>IDirectDrawSurface backingSurface; >> >>public this(){} >> >>public void updatePrimarySurface() >>{ >>RECT source; >>RECT destination; >>primSurface.Blt( >> cast(tagRECT*) &destination, >> cast(IDirectDrawSurface) backingSurface, >> cast(tagRECT*) &source, >> cast(uint) DDBLT_WAIT, >> cast(DDBLTFX*) null ); >>} >>} >> >> > > > > ---------------------------------------------------------------------------- > ---- > > > >>module directdraw; >> >>private >>{ >> alias int HRESULT; >> alias uint DWORD; >> >> struct tagRECT{} >> alias tagRECT* LPRECT; >>} >> >>extern(Windows) >>{ >>alias IDirectDrawSurface LPDIRECTDRAWSURFACE; >>struct DDBLTFX{} >> >>interface IDirectDrawSurface >>{ >> HRESULT Blt(LPRECT, LPDIRECTDRAWSURFACE, LPRECT, DWORD, DDBLTFX*); >> } >>} >> >>enum: uint { DDBLT_WAIT = 0x01000000 } >> >> > > > -- Justin (a/k/a jcc7) http://jcc_7.tripod.com/d/ |
May 25, 2004 Re: Conflicting arguments that don't conflict | ||||
---|---|---|---|---|
| ||||
Posted in reply to J C Calvarese | Ah, that's better! Thanks. "J C Calvarese" <jcc7@cox.net> wrote in message news:c8ufh5$23ql$1@digitaldaemon.com... > Walter wrote: > > This can be way, way cut down into a smaller example! > > I guess I'll take that as a request. ---------------------------------------------------------------------------- ---- > @echo off > dmd a.d -c > pause > echo. > > > ---------------------------------------------------------------------------- ---- > module a; > > private import b; > > private > { > struct R{} > } > > class DiRApp > { > I primS, backingS; > > public void upd() > { > R source; > primS.Blt(&source); > } > } > > ---------------------------------------------------------------------------- ---- > module b; > > private > { > struct R{} > } > > struct DDB{} > > interface I > { > int Blt(R*); > } > > > > |
Copyright © 1999-2021 by the D Language Foundation