poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[COMMITTED] testsuite, pickles: pass --no-stdtypes when testing pickles


From: Jose E. Marchesi
Subject: [COMMITTED] testsuite, pickles: pass --no-stdtypes when testing pickles
Date: Tue, 25 Apr 2023 11:52:30 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

This patch changes the pickles.exp testsuite so it uses the
--no-stdtypes command line option when testing pickles distributed
with poke.  It also removes use of standard types in some pickles.

2023-04-25  Jose E. Marchesi  <jemarch@gnu.org>

        * testsuite/lib/poke-pk.exp (tap_execute): Pass --no-stdtypes to
        poke.
        * pickles/asn1-ber.pk: Do not use "standard" types.
        * pickles/bmp.pk: Likewise.
        * pickles/color.pk: Likewise.
        * pickles/id3v2.pk: Likewise.
        * pickles/id3v1.pk: Likewise.
        * pickles/ieee754.pk: Likewise.
        * pickles/leb128.pk: Likewise.
        * pickles/mbr.pk: Likewise.
        * pickles/openpgp.pk: Likewise.
        * pickles/jffs2.pk: Likewise.
        * pickles/pdap.pk: Likewise.
        * pickles/pcap.pk: Likewise.
        * pickles/riscv.pk: Likewise.
        * testsuite/poke.pickles/mbr-test.pk: Likewise.
        * testsuite/poke.pickles/uuid-test.pk: Likewise.
        * testsuite/poke.pickles/search-test.pk: Likewise.
---
 ChangeLog                             | 21 ++++++++++++++++++++
 pickles/asn1-ber.pk                   | 20 +++++++++----------
 pickles/bmp.pk                        | 26 ++++++++++++-------------
 pickles/color.pk                      |  4 ++--
 pickles/id3v1.pk                      | 24 +++++++++++------------
 pickles/id3v2.pk                      | 28 +++++++++++++--------------
 pickles/ieee754.pk                    | 24 +++++++++++------------
 pickles/jffs2.pk                      | 28 +++++++++++++--------------
 pickles/leb128.pk                     |  4 ++--
 pickles/mbr.pk                        | 22 ++++++++++-----------
 pickles/openpgp.pk                    | 24 +++++++++++------------
 pickles/pcap.pk                       | 26 ++++++++++++-------------
 pickles/pdap.pk                       |  4 ++--
 pickles/riscv.pk                      | 14 +++++++-------
 testsuite/lib/poke-pk.exp             |  3 ++-
 testsuite/poke.pickles/mbr-test.pk    | 20 +++++++++----------
 testsuite/poke.pickles/pcap-test.pk   |  4 ++--
 testsuite/poke.pickles/search-test.pk |  2 +-
 testsuite/poke.pickles/uuid-test.pk   |  4 ++--
 19 files changed, 162 insertions(+), 140 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 56fa9165..efa72ee7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,24 @@
+2023-04-25  Jose E. Marchesi  <jemarch@gnu.org>
+
+       * testsuite/lib/poke-pk.exp (tap_execute): Pass --no-stdtypes to
+       poke.
+       * pickles/asn1-ber.pk: Do not use "standard" types.
+       * pickles/bmp.pk: Likewise.
+       * pickles/color.pk: Likewise.
+       * pickles/id3v2.pk: Likewise.
+       * pickles/id3v1.pk: Likewise.
+       * pickles/ieee754.pk: Likewise.
+       * pickles/leb128.pk: Likewise.
+       * pickles/mbr.pk: Likewise.
+       * pickles/openpgp.pk: Likewise.
+       * pickles/jffs2.pk: Likewise.
+       * pickles/pdap.pk: Likewise.
+       * pickles/pcap.pk: Likewise.
+       * pickles/riscv.pk: Likewise.
+       * testsuite/poke.pickles/mbr-test.pk: Likewise.
+       * testsuite/poke.pickles/uuid-test.pk: Likewise.
+       * testsuite/poke.pickles/search-test.pk: Likewise.
+
 2023-04-25  Jose E. Marchesi  <jemarch@gnu.org>
 
        * poke/poke.c (initialize): Use pk_compiler_new_with_flags.
diff --git a/pickles/asn1-ber.pk b/pickles/asn1-ber.pk
index 7f05645e..56bcc2c8 100644
--- a/pickles/asn1-ber.pk
+++ b/pickles/asn1-ber.pk
@@ -138,13 +138,13 @@ type BER_Identifier =
 type BER_Length =
   union
   {
-    offset<byte,B> short_form : short_form'magnitude < 0b1000_0000;
+    offset<uint<8>,B> short_form : short_form'magnitude < 0b1000_0000;
 
     struct
     {
       uint<1> first : first == 1;
       uint<7> len;
-      byte[len] octets;
+      uint<8>[len] octets;
     } long_form : long_form.first:::long_form.len != 0b1111_1111;
 
     method get = offset<uint<64>,B>:
@@ -183,16 +183,16 @@ type BER_Variable_Contents =
     type Datum =
       union
       {
-        byte[2] pair : pair[1] != 0UB;
-        byte single : single != 0UB;
+        uint<8>[2] pair : pair[1] != 0UB;
+        uint<8> single : single != 0UB;
       };
 
     Datum[] data;
-    byte[2] end : end == [0UB,0UB];
+    uint<8>[2] end : end == [0UB,0UB];
 
-    method get_bytes = byte[]:
+    method get_bytes = uint<8>[]:
     {
-      var bytes = byte[]();
+      var bytes = uint<8>[]();
       for (d in data)
         try bytes += d.pair;
         catch if E_elem { bytes += [d.single]; }
@@ -212,9 +212,9 @@ type BER_Data_Value =
     union
     {
       BER_Length definite;
-      byte indefinite : indefinite == 0b1000_0000;
+      uint<8> indefinite : indefinite == 0b1000_0000;
 
-      method is_indefinite = int:
+      method is_indefinite = int<32>:
       {
         return !(indefinite ?! E_elem);
       }
@@ -228,7 +228,7 @@ type BER_Data_Value =
     union
     {
       BER_Variable_Contents variable : !length.is_indefinite;
-      byte[length.get] fixed;
+      uint<8>[length.get] fixed;
     } contents;
 
     method _print = void:
diff --git a/pickles/bmp.pk b/pickles/bmp.pk
index ccfd21f2..b1e63eca 100644
--- a/pickles/bmp.pk
+++ b/pickles/bmp.pk
@@ -29,7 +29,7 @@ var IHS_BMP_V2 = 12U#B, IHS_BMP_V3 = 40U#B;
 type BMP_Header =
   struct
   {
-    byte[2] magic == ['B','M'];
+    uint<8>[2] magic == ['B','M'];
     offset<uint<32>,B> file_size;
     uint<16>; /* Reserved.  */
     uint<16>; /* Reserved.  */
@@ -46,7 +46,7 @@ type BMP_Info_Header =
     uint<16> planes;     /* Number of planes. (=1) XXX */
 
     uint<16> bits_per_pixel;
-    method num_colors = int: { return 2 ** bits_per_pixel; }
+    method num_colors = int<32>: { return 2 ** bits_per_pixel; }
 
     uint<32> compression; /* Type of compression.  */
 
@@ -62,18 +62,18 @@ type BMP_Info_Header =
 type BMP_RGB_Quad =
   struct
   {
-    byte blue;
-    byte green;
-    byte red;
-    byte; /* Reserved.  */
+    uint<8> blue;
+    uint<8> green;
+    uint<8> red;
+    uint<8>; /* Reserved.  */
   };
 
 type BMP_RGB_Triplet =
   struct
   {
-    byte blue;
-    byte green;
-    byte red;
+    uint<8> blue;
+    uint<8> green;
+    uint<8> red;
   };
 
 type BMP =
@@ -97,20 +97,20 @@ type BMP =
 
         union
         {
-          byte[bytes_per_line] image_data : info_header.bits_per_pixel < 8;
-          byte[info_header.width] color_index : info_header.bits_per_pixel == 
8;
+          uint<8>[bytes_per_line] image_data : info_header.bits_per_pixel < 8;
+          uint<8>[info_header.width] color_index : info_header.bits_per_pixel 
== 8;
           BMP_RGB_Triplet[info_header.width] triplets : 
info_header.bits_per_pixel == 24;
           BMP_RGB_Quad[info_header.width] quads : info_header.bits_per_pixel 
== 32;
         } pixels;
 
-        byte[padding] pad_bytes;
+        uint<8>[padding] pad_bytes;
       };
 
     /* Data.  */
     union
     {
       /* Compressed: data is an array of bytes.  */
-      byte[info_header.image_size] rle_data : (info_header.compression > 0);
+      uint<8>[info_header.image_size] rle_data : (info_header.compression > 0);
       /* Not compressed: data is organized in lines.  */
       BMP_Line[info_header.height] lines;
     } data;
diff --git a/pickles/color.pk b/pickles/color.pk
index d3f71472..74cc02dd 100644
--- a/pickles/color.pk
+++ b/pickles/color.pk
@@ -29,7 +29,7 @@ var color_num_colors = 0;
    define her own colors using this function, after loading this file.
    These colors will be allocated at the end of the color space.  */
 
-fun color_register = int:
+fun color_register = int<32>:
   {
     var c = color_num_colors;
     color_num_colors++;
@@ -77,7 +77,7 @@ assert (color_std_names'length == color_num_colors);
 
 /* Return the printable name of the given color code.  */
 
-fun color_name = (int color) string:
+fun color_name = (int<32> color) string:
   {
     if (color < color_LAST)
       return color_std_names[color];
diff --git a/pickles/id3v1.pk b/pickles/id3v1.pk
index d6133911..74f3d114 100644
--- a/pickles/id3v1.pk
+++ b/pickles/id3v1.pk
@@ -59,24 +59,24 @@ fun id3v1_search_genre = (string name) uint<8>:
 type ID3V1_Tag =
   struct
   {
-    char[3] id == ['T', 'A', 'G'];
+    uint<8>[3] id == ['T', 'A', 'G'];
 
-    char[30] title;
-    char[30] artist;
-    char[30] album;
-    char[4] year;
+    uint<8>[30] title;
+    uint<8>[30] artist;
+    uint<8>[30] album;
+    uint<8>[4] year;
 
     union
     {
       /* ID3v1.1  */
       struct
       {
-        char[28] comment;
-        byte zero = 0;
-        byte track : track != 0;
+        uint<8>[28] comment;
+        uint<8> zero = 0;
+        uint<8> track : track != 0;
       } extended;
       /* ID3v1  */
-      char[30] comment;
+      uint<8>[30] comment;
     } data;
 
     uint<8> genre;
@@ -86,7 +86,7 @@ type ID3V1_Tag =
     computed string title_str;
     computed string artist_str;
     computed string album_str;
-    computed int year_int;
+    computed int<32> year_int;
     computed string comment_str;
     computed string genre_str;
 
@@ -96,8 +96,8 @@ type ID3V1_Tag =
     method set_artist_str = (string val) void: { stoca (val, artist, ' '); }
     method get_album_str = string: { return rtrim (catos (album)); }
     method set_album_str = (string val) void: { stoca (val, album, ' '); }
-    method get_year_int = int: { return atoi (catos (year)); }
-    method set_year_int = (int val) void: { stoca (ltos (val), year, ' '); }
+    method get_year_int = int<32>: { return atoi (catos (year)); }
+    method set_year_int = (int<32> val) void: { stoca (ltos (val), year, ' '); 
}
 
     method get_comment_str = string:
       {
diff --git a/pickles/id3v2.pk b/pickles/id3v2.pk
index 85bd3294..325c9296 100644
--- a/pickles/id3v2.pk
+++ b/pickles/id3v2.pk
@@ -21,9 +21,9 @@
 type ID3V2_Hdr =
   struct
   {
-    char[3] head == ['I','D','3'];
-    byte ver_major : ver_major != 0xff;
-    byte ver_revision : ver_revision != 0xff;
+    uint<8>[3] head == ['I','D','3'];
+   uint<8> ver_major : ver_major != 0xff;
+   uint<8> ver_revision : ver_revision != 0xff;
 
     struct uint<8>
     {
@@ -33,7 +33,7 @@ type ID3V2_Hdr =
       uint<5>;
     } flags;
 
-    byte[4] size : (size[0] < 0x80
+    uint<8>[4] size : (size[0] < 0x80
                     && size[1] < 0x80
                     && size[2] < 0x80
                     && size[3] < 0x80);
@@ -54,7 +54,7 @@ type ID3V2_Ext_Hdr =
   struct
   {
     /* Size of this header, excluding this field.  */
-    uint32 size : size == 10;
+    uint<32> size : size == 10;
 
     struct uint<16>
     {
@@ -62,18 +62,18 @@ type ID3V2_Ext_Hdr =
       uint<15>;
     } flags;
 
-    uint32 padding_sz;
+    uint<32> padding_sz;
     if (flags.crc_present)
-      uint32 crc;
+      uint<32> crc;
   };
 
 type ID3V2_Frame =
   struct
   {
-    char[4] id : id[0] != 0;
+    uint<8>[4] id : id[0] != 0;
 
     /* Frame size without frame header.  */
-    uint32 size;
+    uint<32> size;
 
     struct uint<16>
     {
@@ -94,15 +94,15 @@ type ID3V2_Frame =
       {
         struct
         {
-          char id_asciiz_str = 0;
-          char[size - 1] frame_data;
+          uint<8> id_asciiz_str = 0;
+          uint<8>[size - 1] frame_data;
         } fd : size > 1;
 
-        char[size] frame_data;
+        uint<8>[size] frame_data;
       } fd : id[0] == 'T';
 
       /* Frame contains other data.  */
-      char[size] frame_data;
+      uint<8>[size] frame_data;
     } fd;
   };
 
@@ -115,5 +115,5 @@ type ID3V2_Tag =
     ID3V2_Frame[] frames;
 
     /* Padding.  */
-    byte[hdr.get_size - (frames'offset + (frames'size))/#B];
+    uint<8>[hdr.get_size - (frames'offset + (frames'size))/#B];
   };
diff --git a/pickles/ieee754.pk b/pickles/ieee754.pk
index b7dbe044..4905ed75 100644
--- a/pickles/ieee754.pk
+++ b/pickles/ieee754.pk
@@ -23,10 +23,10 @@ type IEEE754_binary16 =
     uint<5> exp;
     uint<10> frac; // aka significand, aka mantissa.
 
-    method is_nan_p  = int: { return exp == 0x1f && frac != 0; }
-    method is_snan_p = int: { return exp == 0x1f && (frac & 0x200U); }
-    method is_qnan_p = int: { return exp == 0x1f && !(frac & 0x200U); }
-    method is_inf_p  = int: { return exp == 0x1f && frac == 0; }
+    method is_nan_p  = int<32>: { return exp == 0x1f && frac != 0; }
+    method is_snan_p = int<32>: { return exp == 0x1f && (frac & 0x200U); }
+    method is_qnan_p = int<32>: { return exp == 0x1f && !(frac & 0x200U); }
+    method is_inf_p  = int<32>: { return exp == 0x1f && frac == 0; }
   };
 
 type IEEE754_binary32 =
@@ -36,10 +36,10 @@ type IEEE754_binary32 =
     uint<8> exp;
     uint<23> frac; // aka significand, aka mantissa.
 
-    method is_nan_p  = int: { return exp == 0xff && frac != 0; }
-    method is_snan_p = int: { return exp == 0xff && (frac & 0x400000U); }
-    method is_qnan_p = int: { return exp == 0xff && !(frac & 0x400000U); }
-    method is_inf_p  = int: { return exp == 0xff && frac == 0; }
+    method is_nan_p  = int<32>: { return exp == 0xff && frac != 0; }
+    method is_snan_p = int<32>: { return exp == 0xff && (frac & 0x400000U); }
+    method is_qnan_p = int<32>: { return exp == 0xff && !(frac & 0x400000U); }
+    method is_inf_p  = int<32>: { return exp == 0xff && frac == 0; }
 
     method _print = void: { printf ("#<%f32d>", sign:::exp:::frac); }
   };
@@ -51,10 +51,10 @@ type IEEE754_binary64 =
     uint<11> exp;
     uint<52> frac; // aka significand, aka mantissa.
 
-    method is_nan_p  = int: { return exp == 0x7ff && frac != 0; }
-    method is_snan_p = int: { return exp == 0x7ff && (frac & 
0x4000000000000U); }
-    method is_qnan_p = int: { return exp == 0x7ff && !(frac & 
0x4000000000000U); }
-    method is_inf_p  = int: { return exp == 0x7ff && frac == 0; }
+    method is_nan_p  = int<32>: { return exp == 0x7ff && frac != 0; }
+    method is_snan_p = int<32>: { return exp == 0x7ff && (frac & 
0x4000000000000U); }
+    method is_qnan_p = int<32>: { return exp == 0x7ff && !(frac & 
0x4000000000000U); }
+    method is_inf_p  = int<32>: { return exp == 0x7ff && frac == 0; }
 
     method _print = void: { printf ("#<%f64d>", sign:::exp:::frac); }
   };
diff --git a/pickles/jffs2.pk b/pickles/jffs2.pk
index 891f6bf3..c08b2a0a 100644
--- a/pickles/jffs2.pk
+++ b/pickles/jffs2.pk
@@ -163,10 +163,10 @@ struct
     uint<8>[2];
     uint<32> node_crc; // crc of data from node magic to unused
     uint<32> name_crc; // crc of name[nsize]
-    char[nsize] name; // file name
+    uint<8>[nsize] name; // file name
 
     // padding
-    byte[0] @ total_len + alignto(total_len, JFFS2_ALIGNMENT);
+    uint<8>[0] @ total_len + alignto(total_len, JFFS2_ALIGNMENT);
 
     method get_name = string:
     {
@@ -216,9 +216,9 @@ struct
     var rel_data_offset = OFFSET;
 
     // end of data + padding for alignment
-    byte[0] @ total_len + alignto(total_len, JFFS2_ALIGNMENT);
+    uint<8>[0] @ total_len + alignto(total_len, JFFS2_ALIGNMENT);
 
-    method get_data_offset = uoff64:
+    method get_data_offset = offset<uint<64>,b>:
     {
         return rel_data_offset;
     }
@@ -245,12 +245,12 @@ struct
     uint<32> data_crc;
     uint<32> node_crc;
     if (name_len != 0#B)
-      char[name_len] name;
+      uint<8>[name_len] name;
 
     var rel_value_offset = OFFSET;
 
     // end of data + padding for alignment
-    byte[0] @ total_len + alignto(total_len, JFFS2_ALIGNMENT);
+    uint<8>[0] @ total_len + alignto(total_len, JFFS2_ALIGNMENT);
 
     method get_name = string:
     {
@@ -258,7 +258,7 @@ struct
         catch if E_elem { return ""; }
     }
 
-    method get_value_offset = uoff64:
+    method get_value_offset = offset<uint<64>,b>:
     {
         return rel_value_offset;
     }
@@ -307,7 +307,7 @@ struct
     uint<32> ino; /* == zero for unlink */
     offset<uint<8>, B> nsize; /* dirent name size */
     uint<8> dir_type; /* dirent type */
-    char[nsize] name; /* dirent name */
+    uint<8>[nsize] name; /* dirent name */
 
     method get_name = string:
     {
@@ -395,17 +395,17 @@ struct
     uint<32> node_crc;
 
     var rel_records_offset = OFFSET;
-    byte[0] records;
+    uint<8>[0] records;
 
     // records end + padding
-    byte[0] @ total_len + alignto(total_len, JFFS2_ALIGNMENT);
+    uint<8>[0] @ total_len + alignto(total_len, JFFS2_ALIGNMENT);
 
     method get_records = JFFS2_Sum_Rec[]:
     {
         return JFFS2_Sum_Rec[sum_num] @ records'offset;
     }
 
-    method get_records_offset = uoff64:
+    method get_records_offset = offset<uint<64>,b>:
     {
         return rel_records_offset;
     }
@@ -429,12 +429,12 @@ struct
     uint<16> node_type; // could be anything
     offset<uint<32>, B> total_len : total_len >= JFFS2_HEADER_SIZE;
     uint<32> node_header_crc;
-    byte[0] data;
+    uint<8>[0] data;
 
     // data + padding
-    byte[0] @ total_len + alignto(total_len, JFFS2_ALIGNMENT);
+    uint<8>[0] @ total_len + alignto(total_len, JFFS2_ALIGNMENT);
 
-    method get_data_offset = uoff64:
+    method get_data_offset = offset<uint<64>,b>:
     {
         return data'offset;
     }
diff --git a/pickles/leb128.pk b/pickles/leb128.pk
index 48cf0835..3cf42c39 100644
--- a/pickles/leb128.pk
+++ b/pickles/leb128.pk
@@ -30,7 +30,7 @@ type ULEB128 =
   struct
   {
     LEB128_Byte[] variable;
-    byte last;
+    uint<8> last;
 
     method value = uint<64>:
       {
@@ -76,7 +76,7 @@ type LEB128 =
   struct
   {
     LEB128_Byte[] variable;
-    byte last;
+    uint<8> last;
 
     method value = int<64>:
       {
diff --git a/pickles/mbr.pk b/pickles/mbr.pk
index 619ae459..7692a5c2 100644
--- a/pickles/mbr.pk
+++ b/pickles/mbr.pk
@@ -21,13 +21,13 @@
 type MBR_CHS =
   struct
   {
-    byte head;
-    struct byte
+    uint<8> head;
+    struct uint<8>
       {
         uint<2> cylinder_hi;
         uint<6> sector;
       } cs;
-    byte cylinder_lo;
+    uint<8> cylinder_lo;
     computed uint<10> cylinder;
 
     method get_cylinder = uint<10>:
@@ -62,7 +62,7 @@ type MBR_CHS =
 type MBR_PTE =
   struct
   {
-    struct byte
+    struct uint<8>
     {
       uint<1> active;  /* bootable */
       uint<7>;
@@ -73,10 +73,10 @@ type MBR_PTE =
         }
     } attr;
     MBR_CHS start_chs;
-    byte part_type;  /* partition type*/
+    uint<8> part_type;  /* partition type*/
     MBR_CHS end_chs;
-    uint32 lba;
-    uint32 sector_count;
+    uint<32> lba;
+    uint<32> sector_count;
   };
 
 /*
@@ -96,9 +96,9 @@ type MBR_PTE =
 type MBR =
   struct
   {
-    byte[440#B] bootstrap;
-    uint32 signature;
-    byte[2] reserved;
+    uint<8>[440#B] bootstrap;
+    uint<32> signature;
+    uint<8>[2] reserved;
     MBR_PTE[4] pte;
-    uint16 magic == 0xaa55UH;
+    uint<16> magic == 0xaa55UH;
   };
diff --git a/pickles/openpgp.pk b/pickles/openpgp.pk
index 01e010d3..d3db6ac9 100644
--- a/pickles/openpgp.pk
+++ b/pickles/openpgp.pk
@@ -48,8 +48,8 @@ fun pgp_packet_tag_name = (uint<8> tag) string:
 type PGP_Version =
   union
   {
-    char v3 == 3;
-    char v4 == 4;
+    uint<8> v3 == 3;
+    uint<8> v4 == 4;
   };
 
 type PGP_V3_Packet_Length =
@@ -151,7 +151,7 @@ type PGP_MPI =
   struct
   {
     big offset<uint<16>,b> len;
-    byte[len + alignto(len,1#B) ] num; /* Bytes are stored in big-endian.  */
+    uint<8>[len + alignto(len,1#B) ] num; /* Bytes are stored in big-endian.  
*/
 
     method _print = void:
     {
@@ -204,7 +204,7 @@ type PGP_Public_Key =
       } dsa : algo == PGP_ALGO_DSA;
 
       /* The remainder is picked up in PGP_Packet.extra below.  */
-      byte[0] unknown;
+      uint<8>[0] unknown;
   } asf;
 };
 
@@ -233,7 +233,7 @@ type PGP_Signature_Subpacket =
     PGP_V4_Packet_Length len;
     PGP_Subpacket_Header hdr;
 
-    type Data_Bytes = byte[len.get - hdr'size];
+    type Data_Bytes = uint<8>[len.get - hdr'size];
 
     union
     {
@@ -250,7 +250,7 @@ type PGP_Signature_Subpacket =
       struct
       {
         PGP_Version version;
-        byte[20] hash;
+        uint<8>[20] hash;
 
         method _print = void:
         {
@@ -273,9 +273,9 @@ type PGP_Signature =
     uint<8> pk_algo;
     uint<8> hash_algo;
     offset<uint<16>,B> hashed_subpacket_len;
-    byte[hashed_subpacket_len] hashed_subpackets;
+    uint<8>[hashed_subpacket_len] hashed_subpackets;
     uint<16> unhashed_subpacket_len;
-    byte[unhashed_subpacket_len] unhashed_subpackets;
+    uint<8>[unhashed_subpacket_len] unhashed_subpackets;
 
     /* "begin of digest" in gpg --list-packets
 
@@ -299,7 +299,7 @@ type PGP_Signature =
         PGP_MPI s;
       } dsa : pk_algo == PGP_ALGO_DSA;
 
-      byte[0] unknown : pk_algo;
+      uint<8>[0] unknown : pk_algo;
     } asf;
 };
 
@@ -311,7 +311,7 @@ type PGP_Packet =
     type UID =
       struct
       {
-        byte[header.get_length] uid;
+        uint<8>[header.get_length] uid;
         method _print = void:
         {
           print "#<uid:";
@@ -326,12 +326,12 @@ type PGP_Packet =
       PGP_Signature signature : header.get_tag == 2;
       PGP_Public_Key public   : header.get_tag == 6;
       UID uid                 : header.get_tag == 13;
-      byte[header.get_length] unknown;
+      uint<8>[header.get_length] unknown;
     } payload ; //: payload'size == header.get_length; // TODO commented out 
because "extraneous" catches it below.
 
     var extraneous = header.get_length - payload'size;
     if (payload'size'magnitude)
-      byte[extraneous] extra;
+      uint<8>[extraneous] extra;
   };
 
 type PGP_File =
diff --git a/pickles/pcap.pk b/pickles/pcap.pk
index 008c56f5..be195f09 100644
--- a/pickles/pcap.pk
+++ b/pickles/pcap.pk
@@ -28,15 +28,15 @@ type PCAP_Header =
                                : magic in [[0xd4UB, 0xc3UB, 0xb2UB, 0xa1UB],
                                            [0xd4UB, 0x3cUB, 0xb2UB, 0xa1UB]];
 
-    uint16 version_major == 2;
-    uint16 version_minor == 4;
-    int32  thiszone; /* GMT to local correction */
-    uint32 sigfigs;  /* accuracy of timestamps */
-    uint32 snaplen;  /* max length of captured packets, in octets */
-    uint32 network;  /* data link type */
+    uint<16> version_major == 2;
+    uint<16> version_minor == 4;
+    int<32>  thiszone; /* GMT to local correction */
+    uint<32> sigfigs;  /* accuracy of timestamps */
+    uint<32> snaplen;  /* max length of captured packets, in octets */
+    uint<32> network;  /* data link type */
 
     /* Nano-second resolution file? */
-    method is_nsec_p = int:
+    method is_nsec_p = int<32>:
       {
         return magic in [
           [0xa1UB, 0xb2UB, 0x3cUB, 0xd4UB],
@@ -49,14 +49,14 @@ type PCAP_Header =
 type PCAP_PacketHeader =
   struct /* (int nsec_p) */
   {
-    uint32 ts_sec;   /* timestamp seconds */
-    uint32 ts_usec;  /* microseconds (or nanoseconds if `nsec_p`) */
-    offset<uint32,B> incl_len : /* number of octets of packet saved in file */
+    uint<32> ts_sec;   /* timestamp seconds */
+    uint<32> ts_usec;  /* microseconds (or nanoseconds if `nsec_p`) */
+    offset<uint<32>,B> incl_len : /* number of octets of packet saved in file 
*/
       incl_len > 0#B;
-    offset<uint32,B> orig_len : /* actual length of packet */
+    offset<uint<32>,B> orig_len : /* actual length of packet */
       incl_len <= orig_len;
 
-    method is_sliced_p = int:
+    method is_sliced_p = int<32>:
       {
         return incl_len != orig_len;
       }
@@ -66,7 +66,7 @@ type PCAP_Packet =
   struct
   {
     PCAP_PacketHeader header;
-    byte[header.incl_len] body;
+    uint<8>[header.incl_len] body;
   };
 
 type PCAP =
diff --git a/pickles/pdap.pk b/pickles/pdap.pk
index 1cc4cf2e..2b23b13d 100644
--- a/pickles/pdap.pk
+++ b/pickles/pdap.pk
@@ -95,7 +95,7 @@ type PDAP_Out_Msg =
     var body_end_off = OFFSET;
 
     /* End-of-packet marker.  */
-    byte[0] eop : body_end_off - body_begin_off + command'size == length;
+    uint<8>[0] eop : body_end_off - body_begin_off + command'size == length;
   };
 
 fun pdap_out_msg_iter_begin = (uint<64> iter) PDAP_Out_Msg:
@@ -189,7 +189,7 @@ type PDAP_Vu_Msg =
     var body_end_off = OFFSET;
 
     /* End-of-packet marker.  */
-    byte[0] eop : body_end_off - body_begin_off + command'size == length;
+    uint<8>[0] eop : body_end_off - body_begin_off + command'size == length;
   };
 
 fun pdap_vu_msg_iter_begin = (string filter) PDAP_Vu_Msg:
diff --git a/pickles/riscv.pk b/pickles/riscv.pk
index 435d77d0..7c0b031f 100644
--- a/pickles/riscv.pk
+++ b/pickles/riscv.pk
@@ -184,7 +184,7 @@ type RV32_InsnFmt_R = struct uint<32>
 
     method get_name = string:
       { return name[funct3]; }
-    method as_poke = (int cmd_p = 1) string:
+    method as_poke = (int<32> cmd_p = 1) string:
       {
         return cmd_p ? format ("rv32_%s :rd %u5d :rs1 %u5d :rs2 %u5d",
                                name[funct3], rd, rs1, rs2)
@@ -264,7 +264,7 @@ type RV32_InsnFmt_I = struct uint<32>
 
     method get_name = string:
       { return name; }
-    method as_poke = (int cmd_p = 1) string:
+    method as_poke = (int<32> cmd_p = 1) string:
       {
         if (name != "")
           {
@@ -359,7 +359,7 @@ type RV32_InsnFmt_S = struct uint<32>
 
     method get_name = string:
       { return names[funct3]; }
-    method as_poke = (int cmd_p = 1) string:
+    method as_poke = (int<32> cmd_p = 1) string:
       {
         assert (+opcode == RV32_OPCODE_STORE);
         return cmd_p ? format ("rv32_%s :rs1 %u5d :rs2 %u5d :imm %i32d",
@@ -420,7 +420,7 @@ type RV32_InsnFmt_B = struct uint<32>
 
     method get_name = string:
       { return names[funct3]; }
-    method as_poke = (int cmd_p = 1) string:
+    method as_poke = (int<32> cmd_p = 1) string:
       {
         assert (+opcode == RV32_OPCODE_BRANCH);
         return cmd_p ? format("rv32_%s :rs1 %u5d :rs2 %u5d :imm %i32d",
@@ -457,7 +457,7 @@ type RV32_InsnFmt_U = struct uint<32>
 
     method get_name = string:
       { return +opcode == RV32_OPCODE_LUI ? "lui" : "auipc"; }
-    method as_poke = (int cmd_p = 1) string:
+    method as_poke = (int<32> cmd_p = 1) string:
       {
         assert (+opcode == RV32_OPCODE_LUI || +opcode == RV32_OPCODE_AUIPC);
 
@@ -507,7 +507,7 @@ type RV32_InsnFmt_J = struct uint<32>
 
     method get_name = string:
       { return "jal"; }
-    method as_poke = (int cmd_p = 1) string:
+    method as_poke = (int<32> cmd_p = 1) string:
       {
         assert (+opcode == RV32_OPCODE_JAL);
         return cmd_p ? format ("rv32_jal :rd %u5d :imm %i32d", rd, get_imm)
@@ -542,7 +542,7 @@ type RV32_Insn = union uint<32>
              : !(j ?! E_elem) ? j.get_name
              : "" /* impossible */;
       }
-    method as_poke = (int cmd_p = 1) string:
+    method as_poke = (int<32> cmd_p = 1) string:
       {
         return !(r ?! E_elem) ? r.as_poke (cmd_p)
              : !(i ?! E_elem) ? i.as_poke (cmd_p)
diff --git a/testsuite/lib/poke-pk.exp b/testsuite/lib/poke-pk.exp
index 1396bb12..1776b541 100644
--- a/testsuite/lib/poke-pk.exp
+++ b/testsuite/lib/poke-pk.exp
@@ -47,7 +47,8 @@ proc tap_execute {pkfile_path} {
 
     # spawn the executable and look for the TAP output messages from the
     # test case.
-    spawn -noecho "${executable}" --no-hserver --color=no -q -L ${pkfile_path}
+    spawn -noecho "${executable}" --no-hserver --no-stdtypes \
+        --color=no -q -L ${pkfile_path}
     set txt "\[^\r\n\]*"
     set num "\[0-9\]\[0-9\]*"
     expect {
diff --git a/testsuite/poke.pickles/mbr-test.pk 
b/testsuite/poke.pickles/mbr-test.pk
index 7d42bac4..a8be8008 100644
--- a/testsuite/poke.pickles/mbr-test.pk
+++ b/testsuite/poke.pickles/mbr-test.pk
@@ -28,7 +28,7 @@ var tests = [
     name = "magic number",
     func = lambda (string name) void:
       {
-        byte[512] @ data : 0#B = byte[512] ();
+        uint<8>[512] @ data : 0#B = uint<8>[512] ();
 
         try
           {
@@ -42,7 +42,7 @@ var tests = [
           }
 
         /* Fix the magic number */
-        byte[2] @ data : 510#B = [0x55UB, 0xaaUB];
+        uint<8>[2] @ data : 510#B = [0x55UB, 0xaaUB];
 
         var m = MBR @ data : 0#B;
       },
@@ -51,8 +51,8 @@ var tests = [
     name = "CHS",
     func = lambda (string name) void:
       {
-        byte[510] @ data : 0#B = byte[510] ();
-        byte[2] @ data : 510#B = [0x55UB, 0xaaUB];
+        uint<8>[510] @ data : 0#B = uint<8>[510] ();
+        uint<8>[2] @ data : 510#B = [0x55UB, 0xaaUB];
 
         var m = MBR @ data : 0#B;
         var chs = m.pte[0].start_chs;
@@ -62,7 +62,7 @@ var tests = [
         assert(chs.cs.sector == 0);
         assert(chs.cylinder_lo == 0);
         assert(chs.cylinder == 0);
-        assert((byte[chs'size] @ data : chs'offset) == [0UB, 0UB, 0UB]);
+        assert((uint<8>[chs'size] @ data : chs'offset) == [0UB, 0UB, 0UB]);
 
         chs.cylinder = 0x3ff;
         assert(chs.head == 0);
@@ -70,7 +70,7 @@ var tests = [
         assert(chs.cs.sector == 0);
         assert(chs.cylinder_lo == 0xff);
         assert(chs.cylinder == 0x3ff);
-        assert((byte[chs'size] @ data : chs'offset) == [0UB, 0xc0UB, 0xffUB]);
+        assert((uint<8>[chs'size] @ data : chs'offset) == [0UB, 0xc0UB, 
0xffUB]);
 
         chs.cs.cylinder_hi = 1;
         assert(chs.head == 0);
@@ -78,7 +78,7 @@ var tests = [
         assert(chs.cs.sector == 0);
         assert(chs.cylinder_lo == 0xff);
         assert(chs.cylinder == 0x1ff);
-        assert((byte[chs'size] @ data : chs'offset) == [0UB, 0x40UB, 0xffUB]);
+        assert((uint<8>[chs'size] @ data : chs'offset) == [0UB, 0x40UB, 
0xffUB]);
 
         chs.head = 0xa5;
         assert(chs.head == 0xa5);
@@ -86,7 +86,7 @@ var tests = [
         assert(chs.cs.sector == 0);
         assert(chs.cylinder_lo == 0xff);
         assert(chs.cylinder == 0x1ff);
-        assert((byte[chs'size] @ data : chs'offset) ==
+        assert((uint<8>[chs'size] @ data : chs'offset) ==
                [0xa5UB, 0x40UB, 0xffUB]);
 
         chs.cs.sector = 0xff;  /* Only the 6 LSBs are relevant */
@@ -95,7 +95,7 @@ var tests = [
         assert(chs.cs.sector == 0x3f);
         assert(chs.cylinder_lo == 0xff);
         assert(chs.cylinder == 0x1ff);
-        assert((byte[chs'size] @ data : chs'offset) ==
+        assert((uint<8>[chs'size] @ data : chs'offset) ==
                [0xa5UB, 0x7fUB, 0xffUB]);
 
         chs.cylinder_lo = 0x81;
@@ -104,7 +104,7 @@ var tests = [
         assert(chs.cs.sector == 0x3f);
         assert(chs.cylinder_lo == 0x81);
         assert(chs.cylinder == 0x181);
-        assert((byte[chs'size] @ data : chs'offset) ==
+        assert((uint<8>[chs'size] @ data : chs'offset) ==
                [0xa5UB, 0x7fUB, 0x81UB]);
       },
   },
diff --git a/testsuite/poke.pickles/pcap-test.pk 
b/testsuite/poke.pickles/pcap-test.pk
index 17fd4090..e26dab36 100644
--- a/testsuite/poke.pickles/pcap-test.pk
+++ b/testsuite/poke.pickles/pcap-test.pk
@@ -189,7 +189,7 @@ var tests = [
           :endian ENDIAN_LITTLE
           :do lambda void:
             {
-              byte[] @ 0#B = DNS_DATA;
+              uint<8>[] @ 0#B = DNS_DATA;
 
               var pcap = PCAP @ 0#B,
                   hdr = pcap.header,
@@ -209,7 +209,7 @@ var tests = [
           :endian ENDIAN_BIG
           :do lambda void:
             {
-              byte[] @ 0#B = DNS_DATA;
+              uint<8>[] @ 0#B = DNS_DATA;
 
               try PCAP @ 0#B;
               catch (Exception ex)
diff --git a/testsuite/poke.pickles/search-test.pk 
b/testsuite/poke.pickles/search-test.pk
index 4f3e4856..245e975f 100644
--- a/testsuite/poke.pickles/search-test.pk
+++ b/testsuite/poke.pickles/search-test.pk
@@ -38,7 +38,7 @@ var tests = [
         with_temp_ios
           :do lambda void:
             {
-              byte[] @ 0#B = data;
+              uint<8>[] @ 0#B = data;
 
               var typ = typeof (T1),
                   matches = (search_type :typ typ);
diff --git a/testsuite/poke.pickles/uuid-test.pk 
b/testsuite/poke.pickles/uuid-test.pk
index dbed8141..7d3813ef 100644
--- a/testsuite/poke.pickles/uuid-test.pk
+++ b/testsuite/poke.pickles/uuid-test.pk
@@ -36,7 +36,7 @@ var tests = [
           :endian ENDIAN_BIG
           :do lambda void:
             {
-              byte[128#b] @ 0#B = DATA_UUIDv1_1;
+              uint<8>[128#b] @ 0#B = DATA_UUIDv1_1;
 
               var uuid = UUID @ 0#B;
 
@@ -59,7 +59,7 @@ var tests = [
           :endian ENDIAN_LITTLE
           :do lambda void:
             {
-              byte[128#b] @ 0#B = DATA_UUIDv1_1;
+              uint<8>[128#b] @ 0#B = DATA_UUIDv1_1;
 
               var uuid = UUID @ 0#B;
 
-- 
2.30.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]