From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:8fc4:: with SMTP id r187-v6mr21702591iod.87.1537271676272; Tue, 18 Sep 2018 04:54:36 -0700 (PDT) X-Received: by 2002:a9d:6309:: with SMTP id q9-v6mr228025otk.5.1537271676122; Tue, 18 Sep 2018 04:54:36 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.linkpendium.com!news.linkpendium.com!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!x188-v6no59416ite.0!news-out.google.com!z5-v6ni72ite.0!nntp.google.com!x188-v6no59411ite.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 18 Sep 2018 04:54:35 -0700 (PDT) In-Reply-To: <01166054-3971-4df6-8af4-f9fc4d8a30c4@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=121.45.194.120; posting-account=3BDb0woAAAAxEpy0UNGOioOboBRjpqqT NNTP-Posting-Host: 121.45.194.120 References: <01166054-3971-4df6-8af4-f9fc4d8a30c4@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <082b9b50-7689-4990-8b7e-9106a6564371@googlegroups.com> Subject: Re: Interface To C Struct That Includes An Array From: rogermc@iinet.net.au Injection-Date: Tue, 18 Sep 2018 11:54:36 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:54359 Date: 2018-09-18T04:54:35-07:00 List-Id: 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 onl= y 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 aiGetMater= ialString cuts the 32-bit prefix and corrects the length in aiString field = by itself. >=20 > =D0=BF=D0=BE=D0=BD=D0=B5=D0=B4=D0=B5=D0=BB=D1=8C=D0=BD=D0=B8=D0=BA, 17 = =D1=81=D0=B5=D0=BD=D1=82=D1=8F=D0=B1=D1=80=D1=8F 2018 =D0=B3., 15:01:43 UTC= +3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C= rog...@iinet.net.au =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > > 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 e= very 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 inter= facing is by pointers? >=20 > > 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 smal= l 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 ob= viously being hex for 11 which is the ASCII code for an unprintable charact= er (VT) so its actually (VT)000phoenix.pcx0. The final three zeros above ar= e an error in my report. >=20 > > function API_Get_Material_Texture (aMaterial : access API_Materia= l_Tex; > > Tex_Type : AI_Texture_Type; > > Index : Interfaces.C.unsig= ned; > > Path : access Assimp_Type= s.API_String :=3D null; > > Mapping : access AI_Texture_= Mapping :=3D null; > > UV_Index : access Interfaces.= C.unsigned :=3D null; > > Blend : access Interfaces.= C.C_float :=3D null; > > Op : access AI_Texture_= Op :=3D null; > > Map_Mode : access AI_Texture_= Map_Mode :=3D 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 instea= d of aiGetMaterialTexture. Thanks for that observation. I'll add flags to my declaration of API_Get_Ma= terial_Texture.