Re: Where is my DLL?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Robert Craig wrote:
> 
> Matt Lewis wrote:
> > 
> > 
> > if( (unsigned)hDLL > (unsigned)0x7fffffff)
> >   {  _9DLL_Instance = NewDouble( (double)(unsigned long) hDLL ); Ref(hDLL);}
> 
> Matt, the Ref(hDLL) should be deleted. 
> Ref should not be applied to a general 32-bit integer,
> just to a 32-bit Euphoria object (a 31-bit integer, or a pointer), 
> and it isn't needed anyway because NewDouble will set 
> the ref-count to 1, which should be fine.
> (Ref will be a no-op on a 31-bit Euphoria integer, so it won't do
> any damage in that very common case.)

Yes, I cut and pasted and put hDLL where I meant to put _9DLL_Instance.
I didn't know that NewDouble() Ref'd, though.  I think I was basing stuff
on examples of translated code.

> Also, you should change 0x7fffffff to 0x3fffffff, though 
> your way will work by luck in many cases.
> 
> Maybe you should check make_atom as well.
> (This bit fiddling stuff is very tricky. I hope I'm right here!)

Oops, you're right, of course.  I'll fix that up and re-submit.

Matt Lewis

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu