Skip to content

Incorrect translation of fixed size array to CArray #197

Open
@david-bouyssie

Description

@david-bouyssie

For this given struct (see https://github.com/libexpat/libexpat/blob/master/expat/lib/expat.h#L507):

typedef struct {
  int map[256];
  void *data;
  int(XMLCALL *convert)(void *data, const char *s);
  void(XMLCALL *release)(void *data);
} XML_Encoding;

The produced definition is:

type struct_XML_Encoding = CStruct4[CArray[CInt, Nat.Digit[Nat._2, Nat.Digit[Nat._5, Nat._6]]], Ptr[Byte], CFunctionPtr2[Ptr[Byte], CString, CInt], CFunctionPtr1[Ptr[Byte], Unit]]

There are two minor problems here:

  • Nat.Digit is missing a number suffix
  • CFunctionPtrX should be CFuncPtrX

However the major problem is Nat.Digit[Nat._2, Nat.Digit[Nat._5, Nat._6]] which should simplified I guess toNat.Digit3[Nat._2, Nat._5, Nat._6]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions