[BUG][FIX?] 1908PrintArrayFix, one more

Stephan Rudlof sr at evolgo.de
Mon Mar 13 16:38:04 UTC 2000


There was another method broken for me; corrected it is:

'From Squeak2.8alpha of 7 February 2000 [latest update: #1919] on 13
March 2000 at 5:23:51 pm'!

!InterpreterPlugin methodsFor: 'initialize' stamp: 'ar 10/11/1998
02:06'!
setInterpreter: anInterpreter
	| ok |
	self export: true.
	self var: #anInterpreter declareC: 'struct VirtualMachine
*anInterpreter'.
	interpreterProxy _ anInterpreter.

	"Note: 	The following is coded so that it can be run from Squeak
			where the return value is ignored."
	ok _ self cCode: 'interpreterProxy->majorVersion() == VM_PROXY_MAJOR'.
	ok == false ifTrue:[^false].
	ok _ self cCode: 'interpreterProxy->minorVersion() >= VM_PROXY_MINOR'.
	^ok! !


There is a working mixture of symbol and string while calling
#var:declareC:, but
	self var: 'anInterpreter' declareC: 'struct VirtualMachine
*anInterpreter'.
is possible, too...
So the problem *could* arise, if symbols are used; without using these
symbols I've no problems... So far!

Any ideas of people which have implemented this stuff?

Remark: Switch prettyPrint off to *see* such constructs as #'struct
VirtualMachine*' !


Stephan

Stephan Rudlof wrote:
> 
> Stefan (sma),
> 
> I have problems with your
> 
> 1908PrintArrayFix-sma -- Stefan Matthias Aust -- 3 March 2000
> Teamwork: Russell Swan noticed a bug, Bert Freudenberg suggested a fix
> and I implemented it.
> Actually, this became a complete pretty printing and refactoring of the
> plugin. I added a var:type:
> method which reduced the need to repeat the varName in var:declareC: and
> always because this is both
> error-prone and space consuming."
> 
> changeset.
> 
> Following method seems to be incorrect and has to be corrected as shown
> at the end.
> ---
> IntegerPlugin class >>
> declareCVarsIn: aCCodeGenerator
>         "Note: This method must be implemented by all subclasses to declare
> variables."
> 
>         aCCodeGenerator var: #interpreterProxy type: #'struct VirtualMachine*'
> ---
> 
> This doesn't generate the correct var declaration for #interpreterProxy
> in my LargeInteger plugin source.
> The same effect arises while compiling the KlattSynthesizerPlugin, so
> this seems to be a problem outside of my plugin: Mixing symbols and
> strings could be the origin of the problems... The other vars declared
> for the KlattSynthesizerPlugin,
> ---
> declareCVarsIn: cg
>         cg var: #resonators type: #'float*'.
>         cg var: #frame type: #'float*'.
>         cg var: #pitch type: #float.
>         cg var: #a1 type: #float.
>         cg var: #a2 type: #float.
>         cg var: #x1 type: #float.
>         cg var: #x2 type: #float.
>         cg var: #b1 type: #float.
>         cg var: #c1 type: #float.
>         cg var: #glast type: #float.
>         cg var: #vlast type: #float.
>         cg var: #nlast type: #float
> ---
> only appear as ints in the plugin source! Please take a look onto the
> generated plugin source...
> 
> Greetings,
> 
> Stephan (sr)
> 
> Fix (sufficient for me, but what's with the other plugins?):
> 
> 'From Squeak2.8alpha of 7 February 2000 [latest update: #1919] on 13
> March 2000 at 4:21:20 pm'!
> 
> !InterpreterPlugin class methodsFor: 'translation' stamp: 'sr 3/13/2000
> 16:09'!
> declareCVarsIn: aCCodeGenerator
>         "Note: This method must be implemented by all subclasses to declare
> variables."
> 
>         aCCodeGenerator var: 'interpreterProxy' type: 'struct VirtualMachine*'!
> !

-- 
Stephan Rudlof (sr at evolgo.de)
   "Genius doesn't work on an assembly line basis.
    You can't simply say, 'Today I will be brilliant.'"
    -- Kirk, "The Ultimate Computer", stardate 4731.3





More information about the Squeak-dev mailing list