RE: Bizarre happening in my plugin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: Bizarre happening in my plugin

Bob.Cowdery
RE: Bizarre happening in my plugin

John M. McIntosh wrote:
> It's the
>
> self cCode: 'return value'

Thanks very much for the comprehensive reply John. I was fairly sure the answer was in what I needed to do with the stack. I think what confused me was I found some examples that did what I did and others that did stuff with the stack. I also read that Slang automatically handled the stack. I put 2 and 2 together and got 5. I'm sure I can figure out what to do now though.

Bob

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.



Reply | Threaded
Open this post in threaded view
|

RE: Bizarre happening in my plugin

Bob.Cowdery
RE: Bizarre happening in my plugin

John M. McIntosh wrote:

> It's the
>
> self cCode: 'return value'

Getting there, but clearly I don't completely understand yet.

Here's the code in calling order. I get 'Primitive Mode Change failed' from this. The dll is called ok from the run/stop so it has to be parameters still.

primModeChng: mode
        <primitive: 'modeChng' module:'SDRPhasingDSPPlugin'>
        Transcript show: 'Primitive Mode Change failed'.
        ^ false

modeChng: mode
        self export: true.

        self    primitive: 'Sideband'
                parameters: #(SmallInteger).

        (self
                        cCode: 'SetSideband(mode)'
                        inSmalltalk: [false])
                ifFalse: [^ interpreterProxy primitiveFail].

# the generated function and the function it calls
EXPORT(int) Sideband(void) {
        int mode;

        mode = interpreterProxy->stackIntegerValue(0);
        if (interpreterProxy->failed()) {
                return null;
        }
        if (!(SetSideband(mode))) {
                interpreterProxy->primitiveFail();
                return null;
        }
        if (interpreterProxy->failed()) {
                return null;
        }
        interpreterProxy->pop(1);
        return null;
}

int SetSideband( int sideband )
{
         m_sideband = sideband;
         return true;
}

Bob--

*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.



Reply | Threaded
Open this post in threaded view
|

Re: Bizarre happening in my plugin

timrowledge

On 22-Jan-06, at 6:26 AM, [hidden email] wrote:

> Here's the code in calling order. I get 'Primitive Mode Change  
> failed' from this. The dll is called ok from the run/stop so it has  
> to be parameters still.
>
> primModeChng: mode
>         <primitive: 'modeChng' module:'SDRPhasingDSPPlugin'>
>         Transcript show: 'Primitive Mode Change failed'.
>         ^ false
>
> modeChng: mode
>         self export: true.
>
>         self    primitive: 'Sideband'
>                 parameters: #(SmallInteger).
>
>         (self
>                         cCode: 'SetSideband(mode)'
>                         inSmalltalk: [false])
>                 ifFalse: [^ interpreterProxy primitiveFail].
Compare the name of the plugin prim you are calling in  
#primModeChange: and the name you are giving the prim in modeChng:

<primitive: 'modeChng' module:'SDRPhasingDSPPlugin'>
self    primitive: 'Sideband'
                 parameters: #(SmallInteger).

How can the lookup find modeChng if you have only implemented  
Sideband? I suggest that you name your primitives as  
'primSetSideBand' etc to help with making it clear to you later which  
bits of code are handlign the primitive and which bits a re support  
code.

Minnow is no responding so you should start from http://
minnow.cc.gatech.edu/squeak/464 and take alook at Andy Greenbergs  
tutorial and Ned Konz's paper and *especially* Andy's Specifications  
For Named Primitives page. Which, admittedly, needs a bunch more  
work. Sigh.

For reference, look at subclasses of SmartSyntaxInterpreterPlugin  
such as FileCopyPlugin (for real triviality), FilePlugin etc.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
A bug in the hand is better than one as yet undetected.



Reply | Threaded
Open this post in threaded view
|

RE: Bizarre happening in my plugin

Bob.Cowdery
In reply to this post by Bob.Cowdery


Tim Rowledge said:
> How can the lookup find modeChng if you have only implemented  
> Sideband? I suggest that you name your primitives as  
> 'primSetSideBand' etc to help with making it clear to you later which

> bits of code are handlign the primitive and which bits a re support  
> code.

I just figured out what I had done then your reply popped up. This is
the trouble with not fully understanding what goes on. Now this is
working I will take time out to tidy things up and make sure I know how
it all fits together. Thanks to yourself and everyone else who helped.

Bob --


*** Confidentiality Notice *** Proprietary/Confidential
Information belonging to CGI Group Inc. and its affiliates
may be contained in this message. If you are not a recipient
indicated or intended in this message (or responsible for
delivery of this message to such person), or you think for
any reason that this message may have been addressed to you
in error, you may not use or copy or deliver this message
to anyone else.  In such case, you should destroy this
message and are asked to notify the sender by reply email.