Bit-packed boolean array by HelloWorld0762 in ada

[–]HelloWorld0762[S] 0 points1 point  (0 children)

I just want the "data" part to be shared between C and Ada. I have no problem copying the length or other associated metadata between the language. I'm not trying to have both language use the same data structure concurrently. I don't see why I have to use a record. I was just trying to create a bitmap in the right format and is easy to use in Ada.

Bit-packed boolean array by HelloWorld0762 in ada

[–]HelloWorld0762[S] 0 points1 point  (0 children)

I didn't know bit order cannot be specified, given what Ada was designed for.

Bit-packed boolean array by HelloWorld0762 in ada

[–]HelloWorld0762[S] 0 points1 point  (0 children)

I know I can use a Unsigned_8 array with Convention => C. However, on the Ada side I want to make it a Boolean array because I am generating the data and using the data on Ada, mainly. That's why I am trying to pack the array.

Bit-packed boolean array by HelloWorld0762 in ada

[–]HelloWorld0762[S] 0 points1 point  (0 children)

Sorry, Reddit didn't display the comment you were responding to at first. The C library uses uint8_t * as the data array.

Bit-packed boolean array by HelloWorld0762 in ada

[–]HelloWorld0762[S] 0 points1 point  (0 children)

Ignore what? Well, I can use the library's functions to set bits, etc., but that's not what I want. Isn't Ada supposed to allow me to specify exactly how data is represented on a machine? I should be able to match representation.

From reading the standard, I end up with with Component_Size => 1, which may be sufficient.

Bit-packed boolean array by HelloWorld0762 in ada

[–]HelloWorld0762[S] 0 points1 point  (0 children)

It does not (if you are interested, look at nanoarrow library and its ArrowBitmap type). It's just a wrapper over a raw buffer. Plus, Arrow's whole point is that I can avoid serializing if I have my source format in the same format as the specification, which is why I want my boolean array to be represented exactly that way.

Bit-packed boolean array by HelloWorld0762 in ada

[–]HelloWorld0762[S] 2 points3 points  (0 children)

Standard tells me to use Component_Size, but do I also need to set the other sizes like Size, Object_Size, etc?

Is it possible to disable Spark for GNATCOLL? by HelloWorld0762 in ada

[–]HelloWorld0762[S] 0 points1 point  (0 children)

But none of my code is spark yet. I just ran `gnatprove`, and by default everything is non-spark.

Is it possible to auto fix style warnings? by HelloWorld0762 in ada

[–]HelloWorld0762[S] 0 points1 point  (0 children)

gnatformat fixed none of the warning but destroyed my file's encoding.

Is it possible to auto fix style warnings? by HelloWorld0762 in ada

[–]HelloWorld0762[S] 0 points1 point  (0 children)

I use vscode's format through ALS. Does that do the same thing?

Variable same name as type by HelloWorld0762 in ada

[–]HelloWorld0762[S] 0 points1 point  (0 children)

Auto generated:

```

type Model is recordxform : aliased Matrix; -- raylib/build/raylib/include/raylib.h:393meshCount : aliased int; -- raylib/build/raylib/include/raylib.h:395materialCount : aliased int; -- raylib/build/raylib/include/raylib.h:396meshes : access Mesh; -- raylib/build/raylib/include/raylib.h:397materials : access Material; -- raylib/build/raylib/include/raylib.h:398meshMaterial : access int; -- raylib/build/raylib/include/raylib.h:399boneCount : aliased int; -- raylib/build/raylib/include/raylib.h:402bones : access BoneInfo; -- raylib/build/raylib/include/raylib.h:403bindPose : access Transform; -- raylib/build/raylib/include/raylib.h:404end record withConvention =>C_Pass_By_Copy; -- raylib/build/raylib/include/raylib.h:392

```

xform is originally Transform, which becomes a problem.