[futurebasic] Re: [FB] FBtoC compiler Warning Question

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : July 2008 : Group Archive : Group : All Groups

From: Robert Purves <listrp@...>
Date: Sun, 27 Jul 2008 12:08:30 +1200
Walter Lenk wrote:

> LOCAL FN File_To_Container( @CPtr AS PTR, L&)
>  IF CPtr.nil& THEN CALL DisposeHandle( CPtr.nil& ) : CPtr.nil& = _nil
>  CPtr.nil& = Fn NewHandle(L&)
>  LONG IF (CPtr.nil& != _nil)
>    CALL HLOCK( CPtr.nil& )
>    READ FILE #_InputFile, [CPtr.nil&], L&
>    CALL HUNLOCK( CPtr.nil& )
>  XELSE
>    IF CPtr.nil& THEN CALL DISPOSEHANDLE( CPtr.nil& ) : CPtr.nil& =  
> _nil
>  END IF
> END FN

> the FBtoC compiler throws this warning -
>   warning: assignment makes integer from pointer without a cast
>   Referring to the line:   CPtr.nil& = Fn NewHandle(L&)

> Anyone have suggestions as to how to fix this ?


local fn File_To_Container( @cPtr as ptr, lngth as long )
'~'1
dim as Handle h

h = cPtr.0&
if ( h ) then DisposeHandle( h )
h = fn NewHandle( lngth )
cPtr.0& = h
long if ( h )
read file #_InputFile, [h], lngth
end if
end fn




Robert P.