comp.lang.ada
 help / color / mirror / Atom feed
From: rogermc@iinet.net.au
Subject: Re: Interface To C Struct That Includes An Array
Date: Tue, 18 Sep 2018 04:54:35 -0700 (PDT)
Date: 2018-09-18T04:54:35-07:00	[thread overview]
Message-ID: <082b9b50-7689-4990-8b7e-9106a6564371@googlegroups.com> (raw)
In-Reply-To: <01166054-3971-4df6-8af4-f9fc4d8a30c4@googlegroups.com>

On Tuesday, 18 September 2018 18:19:30 UTC+10, rakusu...@fastmail.jp  wrote:
> Probably you pass a link to the whole record somewhere where expected only a link to the data field. The other explanation of binary garbage in the string is that you get somwhere a raw uncutted data, because the aiGetMaterialString cuts the 32-bit prefix and corrects the length in aiString field by itself.
> 
> понедельник, 17 сентября 2018 г., 15:01:43 UTC+3 пользователь rog...@iinet.net.au написал:
> >    pragma Convention (C_Pass_By_Copy, API_String);
> It doesn't seems to be a good idea for me to copy a kilobyte of data on every call.
I agree but I don't know how to avoid it.
Would pragma Convention (C, API_String) be OK?
Also, I'm not sure that API_String is ever actually copied as all the interfacing is by pointers?
> 
> > The returned Assimp_Path is Length: 16, Data:  B000phoenix.pcx0000
> > in which B is a series of four small zeros inside a rectangle.
> > I haven't been able to find a syntactical explanation for the four small zeros inside a rectangle.
> As I can remember, this icon stays for nonprintable characters.
I've since discovered that its actually 000B inside the rectangle, the B obviously being hex for 11 which is the ASCII code for an unprintable character (VT) so its actually (VT)000phoenix.pcx0. The final three zeros above are an error in my report.
> 
> >       function API_Get_Material_Texture (aMaterial : access API_Material_Tex;
> >                                          Tex_Type  : AI_Texture_Type;
> >                                          Index     : Interfaces.C.unsigned;
> >                                          Path      : access Assimp_Types.API_String := null;
> >                                          Mapping   : access AI_Texture_Mapping := null;
> >                                          UV_Index  : access Interfaces.C.unsigned := null;
> >                                          Blend     : access Interfaces.C.C_float := null;
> >                                          Op        : access AI_Texture_Op := null;
> >                                          Map_Mode  : access AI_Texture_Map_Mode := null)
> >                                          return Assimp_Types.API_Return;
> I also notice, that you forget the last argument "unsigned int * flags".
Yes, I seem to have inadvertently used the declaration of GetTexture instead of aiGetMaterialTexture.
Thanks for that observation. I'll add flags to my declaration of API_Get_Material_Texture.


  reply	other threads:[~2018-09-18 11:54 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-17 12:01 Interface To C Struct That Includes An Array rogermc
2018-09-17 12:11 ` rogermc
2018-09-17 15:25   ` Lucretia
2018-09-17 22:35     ` Roger
2018-09-18  0:45       ` Roger
2018-09-18  1:19         ` rogermc
2018-09-17 12:26 ` gautier_niouzes
2018-09-17 13:28   ` Roger
2018-09-17 13:55     ` gautier_niouzes
2018-09-17 14:03       ` Roger
2018-09-17 15:24 ` Lucretia
2018-09-17 23:06   ` Roger
2018-09-17 16:29 ` Jeffrey R. Carter
2018-09-17 22:57   ` Roger
2018-09-18  0:53   ` Roger
2018-09-18  4:18     ` Roger
2018-09-18  8:19 ` rakusu_klein
2018-09-18 11:54   ` rogermc [this message]
2018-09-18 12:21     ` Egil H H
2018-09-18 12:24       ` rogermc
2018-09-18 18:55     ` rakusu_klein
2018-09-18 21:28       ` rogermc
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox