[geary/wip/737642-uint] Fix static/const issue in UID/UIDValidity/SequenceNumber



commit ab0db97c9e13e772f1808d1c54d09621857e2e41
Author: Jim Nelson <jim yorba org>
Date:   Wed Nov 12 14:00:41 2014 -0800

    Fix static/const issue in UID/UIDValidity/SequenceNumber

 src/engine/imap/message/imap-sequence-number.vala |    6 +++---
 src/engine/imap/message/imap-uid-validity.vala    |   18 ++++++++++++++----
 src/engine/imap/message/imap-uid.vala             |   18 ++++++++++++++----
 3 files changed, 31 insertions(+), 11 deletions(-)
---
diff --git a/src/engine/imap/message/imap-sequence-number.vala 
b/src/engine/imap/message/imap-sequence-number.vala
index f13de5b..80bec5c 100644
--- a/src/engine/imap/message/imap-sequence-number.vala
+++ b/src/engine/imap/message/imap-sequence-number.vala
@@ -19,12 +19,12 @@ public class Geary.Imap.SequenceNumber : Geary.MessageData.Int64MessageData, Gea
      *
      * See [[http://tools.ietf.org/html/rfc3501#section-2.3.1.2]]
      */
-    public static int64 MIN = 1;
+    public const int64 MIN = 1;
     
     /**
-     * 32-bit upper limit of a valid { link SequenceNumber}.
+     * Upper limit of a valid { link SequenceNumber}.
      */
-    public static int64 MAX = uint32.MAX;
+    public const int64 MAX = 0xFFFFFFFF;
     
     /**
      * Create a new { link SequenceNumber}.
diff --git a/src/engine/imap/message/imap-uid-validity.vala b/src/engine/imap/message/imap-uid-validity.vala
index 1068838..6dd779a 100644
--- a/src/engine/imap/message/imap-uid-validity.vala
+++ b/src/engine/imap/message/imap-uid-validity.vala
@@ -13,10 +13,20 @@
  */
 
 public class Geary.Imap.UIDValidity : Geary.MessageData.Int64MessageData, Geary.Imap.MessageData {
-    // Using statics because uint32.MAX is static, not const (??)
-    public static int64 MIN = 1;
-    public static int64 MAX = uint32.MAX;
-    public static int64 INVALID = -1;
+    /**
+     * Minimum valid value for a { link UIDValidity}.
+     */
+    public const int64 MIN = 1;
+    
+    /**
+     * Maximum valid value for a { link UIDValidity}.
+     */
+    public const int64 MAX = 0xFFFFFFFF;
+    
+    /**
+     * Invalid (placeholder) { link UIDValidity} value.
+     */
+    public const int64 INVALID = -1;
     
     /**
      * Creates a new { link UIDValidity} without checking for valid values.
diff --git a/src/engine/imap/message/imap-uid.vala b/src/engine/imap/message/imap-uid.vala
index e0a85dd..f4bfec9 100644
--- a/src/engine/imap/message/imap-uid.vala
+++ b/src/engine/imap/message/imap-uid.vala
@@ -14,10 +14,20 @@
 
 public class Geary.Imap.UID : Geary.MessageData.Int64MessageData, Geary.Imap.MessageData,
     Gee.Comparable<Geary.Imap.UID> {
-    // Using statics because uint32.MAX is static, not const (??)
-    public static int64 MIN = 1;
-    public static int64 MAX = uint32.MAX;
-    public static int64 INVALID = -1;
+    /**
+     * Minimum valid value for a { link UID}.
+     */
+    public const int64 MIN = 1;
+    
+    /**
+     * Maximum valid value for a { link UID}.
+     */
+    public const int64 MAX = 0xFFFFFFFF;
+    
+    /**
+     * Invalid (placeholder) { link UID} value.
+     */
+    public const int64 INVALID = -1;
     
     /**
      * Creates a new { link UID} without checking for validity.


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