[Vm-dev] Cross file updates

Ian Piumarta piumarta at speakeasy.net
Thu Mar 7 06:59:39 UTC 2013


On Mar 7, 2013, at 05:29 , tim Rowledge wrote:

> 3.9-ish HostWindowPlugin.h uses 'unsigned *'. At that point unix has no relevant code, Mac used 'unsigned int*' (and evidently compiled despite the disagreement)

There is no disagreement.  The modifier 'unsigned' modifies an implicit 'int' type if there is no explicit type given (in exactly the same way that 'short' and 'long' modify an implicit 'int' that almost everyone omits from their code).  Implicit 'int' used to be the rule in C, rather than the exception.

> 4.4-ish HostWindowPlugin.h had 'unsigned char *' until I changed it. Unix uses 'unsigned char *', windows now uses 'unsigned char *', Mac now uses 'unsigned char *' and RISC OS still uses 'unsigned *'.

Then everything was in agreement except ROS, which was using 'unsigned int *' and should be changed to conform.

> Except, we should recall, of course that interp.c has firstIndexableField defined as 
> char * first indexableField
> But sqVirtualMachine.c & .h have
> void * firstIndexableField
> just to add fun.

This should be changed to eliminate ugly warnings about incompatible definitions and/or assignments.  The semantics will not change and the different declarations will not introduce any bugs.  On every common architecture, including all that we currently support, there is effectively no difference between 'char *' and 'void *' until you try to dereference the latter.

Ian



More information about the Vm-dev mailing list