poke-devel
[Top][All Lists]
Advanced

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

[COMMITTED] pickles: fix compilation errors in openpgp.pk


From: Jose E. Marchesi
Subject: [COMMITTED] pickles: fix compilation errors in openpgp.pk
Date: Sun, 10 Apr 2022 21:38:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Now the pickle loads.

2022-04-10  Jose E. Marchesi  <jemarch@gnu.org>

        * pickles/openpgp.pk (PGP_V3_Packet_Length): Use tag logic to get
        the union value.
        (PGP_V4_Packet_Length): fix units.
        (PGP_Packet_Header): Use the right method name.
        (PGP_Key_Flags): Add missing semicolon.
        (PGP_File): Fix type name for PGP_Packet.
---
 ChangeLog          |  9 +++++++++
 pickles/openpgp.pk | 21 ++++++++++++---------
 2 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3f936a7f..df1cb830 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2022-04-10  Jose E. Marchesi  <jemarch@gnu.org>
+
+       * pickles/openpgp.pk (PGP_V3_Packet_Length): Use tag logic to get
+       the union value.
+       (PGP_V4_Packet_Length): fix units.
+       (PGP_Packet_Header): Use the right method name.
+       (PGP_Key_Flags): Add missing semicolon.
+       (PGP_File): Fix type name for PGP_Packet.
+
 2022-04-09  Mohammad-Reza Nabipoor  <mnabipoor@gnu.org>
 
        * libpoke/pvm.h (pvm_assert): Add more parameters.
diff --git a/pickles/openpgp.pk b/pickles/openpgp.pk
index de2abde7..42a61dc9 100644
--- a/pickles/openpgp.pk
+++ b/pickles/openpgp.pk
@@ -78,9 +78,12 @@ type PGP_V3_Packet_Length =
 
     method get = offset<uint<32>,B>:
     {
-      { return l.l8; } ?! E_elem;
-      { return l.l16; } ?! E_elem;
-      return l.l32;
+      if (typ == 0)
+        return l.l8;
+      else if (typ == 1)
+        return l.l16;
+      else
+        return l.l32;
     }
   };
 
@@ -91,7 +94,7 @@ type PGP_V4_Packet_Length =
 
     struct uint<8>
     {
-      offset<uint<8>,B> packed : packed <= 191;
+      offset<uint<8>,B> packed : packed <= 191#B;
     } uint8;
 
     struct uint<40>
@@ -102,12 +105,12 @@ type PGP_V4_Packet_Length =
 
     struct uint<16>
     {
-      offset<uint<8>,B> packed : 192 <= packed && packed <= 223;
-      uint<8> shifted;
+      offset<uint<8>,B> packed : 192#B <= packed && packed <= 223#B;
+      offset<uint<8>,B> shifted;
 
       method get = offset<uint<32>,B>:
       {
-        return ((packed - 192) <<. 8) + shifted + 192;
+        return ((packed - 192#B) <<. 8) + shifted + 192#B;
       }
     } uint16;
 
@@ -140,11 +143,11 @@ type PGP_Packet_Header =
       return v4_format ? length.v4_length.get : length.v3_length.get;
     }
 
-    method get_tag = uint:
+    method get_tag = uint<32>:
     {
       return (v4_format
               ? old_packet_tag:::old_length_bits
-              : old_packet_tag);
+              : old_packet_tag as uint<6>);
     }
 
     method _print = void:
-- 
2.11.0




reply via email to

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