Changes between Version 22 and Version 23 of PIL


Ignore:
Timestamp:
10/16/24 20:18:45 (19 months ago)
Author:
siegel
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • PIL

    v22 v23  
    7171where expr is an integer constant expression and typename is the name of an unsized type.  For example,
    7272{{{
     73typedef $size(1) $int char;
    7374typedef $size(4) $int int;
    7475typedef $size(8) $int long;
     
    7677typedef $size(8) $real double;
    7778}}}
    78 defines 4 distinct types.  Certain operations require a sized type.
     79defines 5 distinct types.  Certain operations require a sized type.
     80
     81Restrictions on sized types:
     82 - an array type cannot be sized
     83 - the type `$obj` cannot be sized
     84 - if a struct type is sized and all of its fields have sized types then the size of the struct
     85   must be the sum of the sizes of the fields
     86 - if a union type is sized then the size of the union must be greater than or equal to the
     87   size of any sized type field
     88
     89Note on translation from C: C structs can have "padding" after each field.  This can be modeled
     90in PIL by making the padding explicit, e.g.,
     91{{{
     92struct Pair {
     93  int i;
     94  char[2] _padding1;
     95  double x;
     96  char[4] _padding2;
     97}}}
     98
     99Except... you can do things like `char[2]` in PIL, hmmm, have to think about this.
    79100
    80101