logs archiveBotHelp.net / Freenode / #ada / 2015 / July / 20 / 1
Lucretia
alexandrus: http://pastebin.com/09F4rfhZ
Visaoni: the rm shows an example of binding strcpy (char*des, const char* src) and does exactly the same thing
alexandrus
hmm, the C.char_array seems correct
i woner about the GUIDs
usually, Ada can only pass by pointer, not by value
is it a *GUID in C?
Lucretia
it's an array of 16 8bit values
alexandrus
expected as pointer i presume...
Lucretia
it will get passed by reference from ada
alexandrus
yes
Lucretia
type GUID_Element is range 0 .. 255 with
convention => C,
Size => 8;

type GUIDs is array (1 .. 16) of GUID_Element with
Convention => C;
it didn't like the pack aspect
alexandrus
i think there is a Interfaces.C.Byte
and also a byte array...
but ok..
Lucretia
no, no byte
alexandrus
can you mock the SDL_Joystick by binding another c function you control?
just to debug this..
Lucretia
erm, not quickly
hang on
alexandrus
i have to read on fixed size array parameters here..
one of the stuff i never use..
no meaning...c xD
have to admit, i see nothing wrong with the code.
Lucretia
ok
alexandrus
would make the individual array elements aliased..
Lucretia
hmm
alexandrus
but thats just tiny..
Lucretia
well, create a new function, it doesn't like the address of the char_array passed in, says it can't access memory at 0x80 which is a wrong address
and
p cbGUID
$4 = -17568
which is what i'm getting their function
lemme try aliased
alexandrus
is the stack incremented by the something like 2 pointers and an int?
Lucretia
nope
alexandrus
what then?
Lucretia
aliased did nothing, i mean
alexandrus
i didn't expect anything here
ok, hacks 2
access GUIDs
ups..
typedef struct {
69 Uint8 data[16];
70 } SDL_JoystickGUID;
that sounds like pass by value..
if i am in the right file...
SDL_joystick.h
if its a pass by value...we can fix that
Lucretia
interesting gdb log http://pastebin.com/AGh9AXRs
check the contents of guid from within the C func and outside it
alexandrus
could it be, pass by value?
hard to read this output..
pragma Convention (C_Pass_By_Copy, My_Type);
http://flyx.org/2012/06/14/adabindings2/
is the source
lets try it on GUIDs
and make a record out of it..
http://www-personal.umich.edu/~bazald/l/api/_s_d_l__joystick_8h_source.html
Lucretia
er, wot?
alexandrus
is your header file different?
the .h file i mean
the ones i found, have the array inside a struct, which is passed by value
Lucretia
no, it's a struct
is that passed by value?
alexandrus
yes, c default
which of course...gives a totally different stack layout
and explains some "memory" issues...
by the way..is anyone here into geometric algebra?
Lucretia
aha!!!
thanks
alexandrus
:-)
Lucretia
been years since i've done proper C
alexandrus
not that you know, if you code c..
its invisible to the c coders unless they look at the stack
(or have trouble with it)
Lucretia
guid's now working :D
alexandrus
:-)
Lucretia
yeah, been years since i've done any c
thanks
alexandrus
lucky...
Lucretia
had to make it a record, but that's fine
alexandrus: just ask the question about geometric algebra, you never know
it's prolly over my head
alexandrus
oh, i spent a lot of time with it
currently implementing some rigid body dynamics simulation with it
one problem i have with pure geometric algebra is though
that it has no dyad operator
Lucretia
(Action) shrug
charlie5 might know, he's done some physics engine porting
alexandrus
ok, geometric algebra is a kind of much better quarternions
s/ar/a
Lucretia
not the "imagine a 4 dimensional sphere?"
alexandrus
quaternions can only handle 3D space
Lucretia
when i worked in the games co. they had a gems book, it started like that
« prev 1 2 3 4 5 next »