[Kde-bindings] Re: Munging of long long

Richard Dale richard.dale at telefonica.net
Wed Sep 29 17:34:20 UTC 2010


On Wednesday, September 29, 2010 06:17:57 pm Arno Rehn wrote:
> On Wednesday 29 September 2010 19:11:41 Richard Dale wrote:
> > On Tuesday, September 28, 2010 10:21:42 pm Arno Rehn wrote:
> > > On Tuesday 28 September 2010 22:17:48 Chris Burel wrote:
> > > > I spoke briefly with Arno about this. My understanding is that it is
> > > > in the voidpTypes list because it is stored as a voidp in the
> > > > Smoke::StackItem union.  From my experience with the Perl bindings,
> > > > adding <typeName>long long</typeName> to the list of scalar types in
> > > > all the smokeconfig.xml files is good enough to force smoke to munge
> > > > long long to "$".
> > > > Arno, what do you think?
> > > 
> > > Yes, long long is munged to '?' because there is no Smoke::StackItem
> > > field for long long. So currently long longs are passed by-ref in the
> > > s_voidp field. I do see that this is not the optimal solution since
> > > long long is really an integral type and should have its own field.
> > > The problem is that we can't simply add such a field without seriously
> > > breaking functionality.
> > 
> > I disagree because kalyptus treated long longs as '$'. It would only
> > affect the Qyoto C# bindings I think. I don't know about the differences
> > between the kalyptus generated C# sources and the dynamically generated
> > ones in the gitorius project though.
> 
> Oh, I didn't know that. I was pretty sure kalyptus has munged them to ? as
> well. Well then, I think we can change it to $ again, if that makes
> everything work again.
> However, this doesn't change the situation that long longs are passed
> by-ref, whereas all other scalars are passed by-value.
long longs are fine in smoke libs as void pointers, and they don't need to be 
added to the primitive types union. The cause of the problem is that languages 
like ruby just have an 'Integer' type which has an arbitrary size. They store 
the value in a C 'int' until it gets too big, and then they change the storage 
format to cope with really big numbers - but the application programmer never 
sees that. In C or C++ you need to distinguish between longs and long longs 
upfront in your code.

-- Richard



More information about the Kde-bindings mailing list