? intpspecs.patch
? longlong.patch
? test.py
? tests/.deps
? tests/.libs
? tests/intpspecs.patch
? tests/test-thread.lo
? tests/test-unknown.lo
? tests/testhelper.la
? tests/testhelpermodule.lo
Index: gobject/gobjectmodule.c
===================================================================
RCS file: /cvs/gnome/pygobject/gobject/gobjectmodule.c,v
retrieving revision 1.231
diff -u -p -r1.231 gobjectmodule.c
--- gobject/gobjectmodule.c	27 Aug 2006 12:02:32 -0000	1.231
+++ gobject/gobjectmodule.c	2 Sep 2006 15:30:31 -0000
@@ -740,7 +740,7 @@ create_property (const gchar  *prop_name
 	{
 	    guint minimum, maximum, default_value;
 
-	    if (!PyArg_ParseTuple(args, "iii", &minimum, &maximum,
+	    if (!PyArg_ParseTuple(args, "III", &minimum, &maximum,
 				  &default_value))
 		return NULL;
 	    pspec = g_param_spec_uint (prop_name, nick, blurb, minimum,
@@ -762,7 +762,7 @@ create_property (const gchar  *prop_name
 	{
 	    gulong minimum, maximum, default_value;
 
-	    if (!PyArg_ParseTuple(args, "lll", &minimum, &maximum,
+	    if (!PyArg_ParseTuple(args, "kkk", &minimum, &maximum,
 				  &default_value))
 		return NULL;
 	    pspec = g_param_spec_ulong (prop_name, nick, blurb, minimum,
Index: gobject/pygparamspec.c
===================================================================
RCS file: /cvs/gnome/pygobject/gobject/pygparamspec.c,v
retrieving revision 1.10
diff -u -p -r1.10 pygparamspec.c
--- gobject/pygparamspec.c	2 Sep 2005 18:05:08 -0000	1.10
+++ gobject/pygparamspec.c	2 Sep 2006 15:30:31 -0000
@@ -182,11 +182,11 @@ pyg_param_spec_getattr(PyGParamSpec *sel
 				 "name", "nick", "owner_type",
 				 "value_type");
 	} else if (!strcmp(attr, "default_value")) {
-	    return PyInt_FromLong(G_PARAM_SPEC_UINT(pspec)->default_value);
+	    return PyLong_FromUnsignedLong(G_PARAM_SPEC_UINT(pspec)->default_value);
 	} else if (!strcmp(attr, "minimum")) {
-	    return PyInt_FromLong(G_PARAM_SPEC_UINT(pspec)->minimum);
+	    return PyLong_FromUnsignedLong(G_PARAM_SPEC_UINT(pspec)->minimum);
 	} else if (!strcmp(attr, "maximum")) {
-	    return PyInt_FromLong(G_PARAM_SPEC_UINT(pspec)->maximum);
+	    return PyLong_FromUnsignedLong(G_PARAM_SPEC_UINT(pspec)->maximum);
 	}
     } else if (G_IS_PARAM_SPEC_LONG(pspec)) {
 	if (!strcmp(attr, "__members__")) {
@@ -208,11 +208,11 @@ pyg_param_spec_getattr(PyGParamSpec *sel
 				 "flags", "maximum", "minimum", "name",
 				 "nick", "owner_type", "value_type");
 	} else if (!strcmp(attr, "default_value")) {
-	    return PyLong_FromLong(G_PARAM_SPEC_ULONG(pspec)->default_value);
+	    return PyLong_FromUnsignedLong(G_PARAM_SPEC_ULONG(pspec)->default_value);
 	} else if (!strcmp(attr, "minimum")) {
-	    return PyLong_FromLong(G_PARAM_SPEC_ULONG(pspec)->minimum);
+	    return PyLong_FromUnsignedLong(G_PARAM_SPEC_ULONG(pspec)->minimum);
 	} else if (!strcmp(attr, "maximum")) {
-	    return PyLong_FromLong(G_PARAM_SPEC_ULONG(pspec)->maximum);
+	    return PyLong_FromUnsignedLong(G_PARAM_SPEC_ULONG(pspec)->maximum);
 	}
     } else if (G_IS_PARAM_SPEC_INT64(pspec)) {
 	if (!strcmp(attr, "__members__")) {
@@ -221,11 +221,11 @@ pyg_param_spec_getattr(PyGParamSpec *sel
 				 "flags", "maximum", "minimum", "name",
 				 "nick", "owner_type", "value_type");
 	} else if (!strcmp(attr, "default_value")) {
-	    return PyLong_FromLong(G_PARAM_SPEC_INT64(pspec)->default_value);
+	    return PyLong_FromLongLong(G_PARAM_SPEC_INT64(pspec)->default_value);
 	} else if (!strcmp(attr, "minimum")) {
-	    return PyLong_FromLong(G_PARAM_SPEC_INT64(pspec)->minimum);
+	    return PyLong_FromLongLong(G_PARAM_SPEC_INT64(pspec)->minimum);
 	} else if (!strcmp(attr, "maximum")) {
-	    return PyLong_FromLong(G_PARAM_SPEC_INT64(pspec)->maximum);
+	    return PyLong_FromLongLong(G_PARAM_SPEC_INT64(pspec)->maximum);
 	}
     } else if (G_IS_PARAM_SPEC_UINT64(pspec)) {
 	if (!strcmp(attr, "__members__")) {
@@ -235,11 +235,11 @@ pyg_param_spec_getattr(PyGParamSpec *sel
 				 "name", "nick", "owner_type",
 				 "value_type");
 	} else if (!strcmp(attr, "default_value")) {
-	    return PyLong_FromLong(G_PARAM_SPEC_UINT64(pspec)->default_value);
+	    return PyLong_FromUnsignedLongLong(G_PARAM_SPEC_UINT64(pspec)->default_value);
 	} else if (!strcmp(attr, "minimum")) {
-	    return PyLong_FromLong(G_PARAM_SPEC_UINT64(pspec)->minimum);
+	    return PyLong_FromUnsignedLongLong(G_PARAM_SPEC_UINT64(pspec)->minimum);
 	} else if (!strcmp(attr, "maximum")) {
-	    return PyLong_FromLong(G_PARAM_SPEC_UINT64(pspec)->maximum);
+	    return PyLong_FromUnsignedLongLong(G_PARAM_SPEC_UINT64(pspec)->maximum);
 	}
     } else if (G_IS_PARAM_SPEC_UNICHAR(pspec)) {
 	if (!strcmp(attr, "__members__")) {
Index: tests/test_properties.py
===================================================================
RCS file: /cvs/gnome/pygobject/tests/test_properties.py,v
retrieving revision 1.7
diff -u -p -r1.7 test_properties.py
--- tests/test_properties.py	11 Apr 2006 14:11:08 -0000	1.7
+++ tests/test_properties.py	2 Sep 2006 15:30:31 -0000
@@ -3,7 +3,9 @@ import unittest
 
 from common import testhelper
 from gobject import GObject, GType, new, PARAM_READWRITE, \
-     PARAM_CONSTRUCT, PARAM_READABLE, PARAM_CONSTRUCT_ONLY, TYPE_UINT64
+     PARAM_CONSTRUCT, PARAM_READABLE, PARAM_WRITABLE, PARAM_CONSTRUCT_ONLY, \
+     TYPE_INT, TYPE_UINT, TYPE_LONG, TYPE_ULONG, \
+     TYPE_INT64, TYPE_UINT64
 
 class PropertyObject(GObject):
     __gproperties__ = {
@@ -120,3 +122,63 @@ class TestProperties(unittest.TestCase):
                     }
         except OverflowError, ex:
             self.fail(str(ex))
+
+    def testMaxValues(self):
+        import struct
+
+        # kiwi code
+        def max(c):
+            return 2 ** ((8 * struct.calcsize(c)) - 1) - 1
+        def umax(c):
+            return 2 ** (8 * struct.calcsize(c)) - 1
+
+        maxint = max('i')
+        minint = -maxint - 1
+        maxuint = umax('I')
+        maxlong = max('l')
+        minlong = -maxlong - 1
+        maxulong = umax('L')
+        maxint64 = max('q')
+        minint64 = -maxint64 - 1
+        maxuint64 = umax('Q')
+
+        class IntPspec(GObject):
+            __gproperties__ = {
+                'int': (TYPE_INT, 'blurb', 'description', minint, maxint, 0,
+                      PARAM_WRITABLE),
+                'uint': (TYPE_UINT, 'blurb', 'description', 0, maxuint, 0,
+                       PARAM_WRITABLE),
+                'long': (TYPE_LONG, 'blurb', 'description', minlong, maxlong, 0,
+                         PARAM_WRITABLE),
+                'ulong': (TYPE_ULONG, 'blurb', 'description', 0, maxulong, 0,
+                          PARAM_WRITABLE),
+                'int64': (TYPE_INT64, 'blurb', 'description', minint64, maxint64, 0,
+                          PARAM_WRITABLE),
+                'uint64': (TYPE_UINT64, 'blurb', 'description', 0, maxuint64, 0,
+                           PARAM_WRITABLE),
+            }
+
+            def do_set_property(self, pspec, value):
+                if pspec.name == 'int':
+                    assert pspec.minimum == minint
+                    assert pspec.maximum == maxint
+                elif pspec.name == 'uint':
+		    assert pspec.maximum == maxuint
+                elif pspec.name == 'long':
+                    assert pspec.minimum == minlong
+                    assert pspec.maximum == maxlong
+                elif pspec.name == 'ulong':
+                    assert pspec.maximum == maxulong
+                elif pspec.name == 'int64':
+                    assert pspec.minimum == minint64
+                    assert pspec.maximum == maxint64
+                elif pspec.name == 'uint64':
+                    assert pspec.maximum == maxuint64
+
+        obj = IntPspec()
+        obj.props.int = 1
+        obj.props.uint = 1
+        obj.props.long = 1
+        obj.props.ulong = 1
+        obj.props.int64 = 1
+        obj.props.uint64 = 1
