g-wrap-dev
[Top][All Lists]
Advanced

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

ssize_t must be a signed type


From: gregory benison
Subject: ssize_t must be a signed type
Date: Wed, 2 Aug 2006 01:34:24 -0400


The most recent g-wrap code (from address@hidden/g-wrap--dev--0) wraps ssize_t but appears not to allow negative values.  This breaks some functions in guile-gnome; for example this call will fail:

(gtk-ui-manager-add-string ui str -1)

but it should succeed since -1 is a valid value for the third argument.  A patch such as the following resolves the issue.

--- orig/g-wrap/ws/standard.scm
+++ mod/g-wrap/ws/standard.scm
@@ -200,10 +200,12 @@
                              #:max "SIZE_MAX"
                              #:ffspec 'size_t)

+  ;; FIXME I'm not sure if this is the correct value for minimum ssize_t's,
+  ;; but ssize_t must be a signed type.
   (wrap-ranged-integer-type! wrapset
                              #:name  'ssize_t
                              #:c-type-name "ssize_t"
-                             #:max "SSIZE_MAX"
+                             #:min "(1 - SSIZE_MAX)" #:max "SSIZE_MAX"
                              #:ffspec 'ssize_t)

   (wrap-type! wrapset 'mchars

--

======================
Gregory Benison
Oregon State University
(541)-737-1876
address@hidden
======================


reply via email to

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