[BC] Block Closures, Version 2

PhiHo Hoang phiho.hoang at rogers.com
Mon Feb 18 05:42:24 UTC 2002


John,

>>tree, edit sqPlatformSpecific.h
>>		#define squeakFileOffsetType long
>>
>>and sqVirtualMachine.h to accommodate
>>
>>		#define squeakInt64 __int64
>>

> Phil, I should point out that by defining squeakFileOffsetType to 
> 32bits you restrict the file system logic to 32 bits. So in your note 

	Do I know Phil ;-)

	I hope I don't need to point out that this is just a truly quick
dirty little hack to get a BC3 VM built with both VS6 and MinGW in 30
seconds ;-)

	I was so eager to get to the little bug as soon as I can, but
ended up in playing BC3 FreeCell for hours (and the cards were flying
faster ;-)

> So in your note earlier where you talk about
>
>	__int64 _lseeki64( int handle, __int64 offset, int origin );
>	__int64 _telli64( int handle );
>
> and if you set squeakFileOffsetType to long then you restrict numbers 
> to a signed 32bit range. Also which wasn't clear was that you must
redefine
>
>	fseek
>	ftell
>
> ie
>	#define ftell(f)               _telli64(f)
>
> for example.

> Also from an code viewpoint you should review usage of 
> squeakFileOffsetType in the VM support code and their interface to 
> the plugin slang. Other places where this comes into play is 
> directory lookup prim, file size prim, and file truncate prim.

	I will make sure that I will not miss these points when I do a
full update for my MobVM. Thanks for the tip, John.

	BTW, in the 'interp.c', I found something like:


	int checkImageVersionFromstartingAt(sqImageFile f, off_t
imageOffset);


	In 'sqPlatformSpecific.h' we already had something like:

 	#define squeakFileOffsetType off_t


	is it OK to change to something like:

	int checkImageVersionFromstartingAt(sqImageFile f,
squeakFileOffsetType imageOffset);

	Just a thought.

	Cheers,

	PhiHo.





More information about the Squeak-dev mailing list