[Vm-dev] Cross file updates

tim Rowledge tim at rowledge.org
Wed Mar 6 20:29:26 UTC 2013


OK, so the original HostWindowBlah stuff used 'unsigned *' because that is what we got from 
"dispBits = ((unsigned *) (interpreterProxy->firstIndexableField();"
in the plugin code. Please don't ask me why, because that was too long ago.

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), windows used 'unsigned *' and obviously RISC OS used 'unsigned *' since it  matched the plugin I had originally written.

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 *'.

The sequence tells me exactly what happened; I did my initial re-starting work in the 3.9-ish sources so I could work on something I had tools for stashed away. I made the code work with the situation pertaining at that point - ie 'unsigned *'. 
When I bumped up to the 4.4-ish sources I still had the changes awaiting commit since I had no write permissions to Cross until this week; I hadn't thought that stuff in that area would change so didn't manually check the other platforms.

Now it wouldn't be hard to change the RISC OS code to use 'unsigned char *' of course, except that the generated plugin code is *still*
dispBits = ((unsigned *) (interpreterProxy->firstIndexableField(…..
which means that 
ok= ioShowDisplayOnWindow(dispBits,…
really ought to be declared as 
ioShowDisplayOnWindow(unsigned * displayThingy...
and not
ioShowDisplayOnWindow(unsigned char * dippitydoodah…

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.

Take your pick! I suppose we should probably change the plugin to generate "(unsigned char *)( (interpreterProxy->indexabibbley" and then fix sqVirtualMachine.[ch] to match and return HostWindowPlugin.h to 'unsigned char *'. Any problems that would cause?

tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
C for sinking, java for drinking, Smalltalk for thinking




More information about the Vm-dev mailing list