<br><br><div class="gmail_quote">On Thu, Jul 3, 2008 at 5:48 PM, Igor Stasenko &lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2008/7/4 Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>&gt;:<br>
<div><div></div><div class="Wj3C7c">&gt; Hi All,<br>
&gt;<br>
&gt; &nbsp; &nbsp; does anyone know (or even better has anyone fixed it) how hard it is to<br>
&gt; make Slang inline methods that contain simple type declarations?<br>
&gt;<br>
&gt; I would like to eliminate compile-time integer/pointer mismatch errors in<br>
&gt; the new StackInterpreter I&#39;m writing. &nbsp;I&#39;d like to say things like:<br>
&gt;<br>
&gt; callerSPOf: theFP<br>
&gt; &quot;Answer the SP of the caller provided theFP is not a base frame.<br>
&gt; This points to the hottest item on the frame&#39;s stack.&quot;<br>
&gt; self var: #theFP type: &#39;char *&#39;.<br>
&gt; self returnTypeC: &#39;char *&#39;.<br>
&gt; self assert: (self isBaseFrame: theFP) not.<br>
&gt; ^theFP + FoxCallerSavedIP + ((self frameNumArgs: theFP) + 2 * BytesPerWord)<br>
&gt; but Slang refuses to inline anything that has C declarations. &nbsp;I&#39;m guessing<br>
&gt; that the issue is moving the type information from the method to its inlined<br>
&gt; form. &nbsp;It took me half a day to discover where Slang refuses to inline<br>
&gt; (should have looked in the obvious place CCodeGenerator&gt;&gt;collectInlineList,<br>
&gt; instead of in the inlining code :/ ). &nbsp;So I&#39;m afraid to waste the time<br>
&gt; trying to find out where the restriction bites. &nbsp;Anyone know how to fix this<br>
&gt; or better still have a fix?<br>
&gt;<br>
<br>
</div></div>Doesn&#39;t &#39;self inline: true&#39; helps?</blockquote><div><br>No. &nbsp;Slang refuses to inline anything containing a C declaration (retrnTypeC:, var:type: cCode:inSmalltalk: etc)<br>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Or, can&#39;t you circumvent that by coercing a value to corresponding<br>
type at call site? Like:<br>
<br>
newSP := self cCoerce: (self callerSPOf: blabla) to: &#39;char *&#39;.</blockquote><div><br>That&#39;s worse than the disease :) &nbsp;There are many more uses than definitions. &nbsp;So I want the uses to look clean and I&#39;ll tolerate noisy definition. &nbsp;There are also argument types to consider. &nbsp;localIP has type char * for example, so where it is used as an argument I want the argument type to be char * or void *, etc.<br>
<br>&nbsp;</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">And don&#39;t touch the return type of function.<br>
<br>
&gt; best<br>
&gt; Eliot<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Best regards,<br>
Igor Stasenko AKA sig.<br>
<br>
</font></blockquote></div><br>