[glib] Replace all instances of ssize_t with gssize



commit 4a77eb16cecc7e3a076e046c6e890bee590a5c01
Author: Руслан Ижбулатов <lrn1986 gmail com>
Date:   Tue Oct 10 11:59:14 2017 +0000

    Replace all instances of ssize_t with gssize
    
    ssize_t is supported widely, but not universally, so use gssize instead.
    Currently only one piece of code actually *needs* this change to be compilable
    with MSVC, the rest are mostly in *nix parts of the code, but these are changed
    too, for symmetry.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=788180

 gio/glocalfile.c        |    2 +-
 gio/glocalfileinfo.c    |   14 +++++++-------
 gio/tests/dbus-launch.c |    2 +-
 glib/gfileutils.c       |    2 +-
 glib/tests/unix.c       |    2 +-
 tests/timeloop-basic.c  |    4 ++--
 6 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/gio/glocalfile.c b/gio/glocalfile.c
index d417c49..1f78818 100644
--- a/gio/glocalfile.c
+++ b/gio/glocalfile.c
@@ -1577,7 +1577,7 @@ expand_symlink (const char *link)
   char symlink_value[4096];
 #ifdef G_OS_WIN32
 #else
-  ssize_t res;
+  gssize res;
 #endif
   
 #ifdef G_OS_WIN32
diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c
index a46a842..35853cc 100644
--- a/gio/glocalfileinfo.c
+++ b/gio/glocalfileinfo.c
@@ -236,7 +236,7 @@ get_selinux_context (const char            *path,
 #define g_setxattr(path,name,value,size) setxattr(path,name,value,size,0)
 #endif
 
-static ssize_t
+static gssize
 g_getxattr (const char *path, const char *name, void *value, size_t size,
             gboolean follow_symlinks)
 {
@@ -250,7 +250,7 @@ g_getxattr (const char *path, const char *name, void *value, size_t size,
 #endif
 }
 
-static ssize_t
+static gssize
 g_listxattr(const char *path, char *namebuf, size_t size,
             gboolean follow_symlinks)
 {
@@ -400,7 +400,7 @@ get_one_xattr (const char *path,
 {
   char value[64];
   char *value_p;
-  ssize_t len;
+  gssize len;
   int errsv;
 
   len = g_getxattr (path, xattr, value, sizeof (value)-1, follow_symlinks);
@@ -450,7 +450,7 @@ get_xattrs (const char            *path,
 #ifdef HAVE_XATTR
   gboolean all;
   gsize list_size;
-  ssize_t list_res_size;
+  gssize list_res_size;
   size_t len;
   char *list;
   const char *attr, *attr2;
@@ -562,7 +562,7 @@ get_one_xattr_from_fd (int         fd,
 {
   char value[64];
   char *value_p;
-  ssize_t len;
+  gssize len;
   int errsv;
 
   len = g_fgetxattr (fd, xattr, value, sizeof (value) - 1);
@@ -610,7 +610,7 @@ get_xattrs_from_fd (int                    fd,
 #ifdef HAVE_XATTR
   gboolean all;
   gsize list_size;
-  ssize_t list_res_size;
+  gssize list_res_size;
   size_t len;
   char *list;
   const char *attr, *attr2;
@@ -1289,7 +1289,7 @@ get_content_type (const char          *basename,
 
          if (fd != -1)
            {
-             ssize_t res;
+             gssize res;
              
              res = read (fd, sniff_buffer, sniff_length);
              (void) g_close (fd, NULL);
diff --git a/gio/tests/dbus-launch.c b/gio/tests/dbus-launch.c
index 5eeb1c0..90d8d06 100644
--- a/gio/tests/dbus-launch.c
+++ b/gio/tests/dbus-launch.c
@@ -38,7 +38,7 @@ write_all (const void *ptr,
 
   while (len > 0)
     {
-      ssize_t done = write (STDOUT_FILENO, p, len);
+      gssize done = write (STDOUT_FILENO, p, len);
       int errsv = errno;
 
       if (done == 0)
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
index 2659522..ddafa6d 100644
--- a/glib/gfileutils.c
+++ b/glib/gfileutils.c
@@ -2055,7 +2055,7 @@ g_file_read_link (const gchar  *filename,
 #ifdef HAVE_READLINK
   gchar *buffer;
   size_t size;
-  ssize_t read_size;
+  gssize read_size;
   
   g_return_val_if_fail (filename != NULL, NULL);
   g_return_val_if_fail (error == NULL || *error == NULL, NULL);
diff --git a/glib/tests/unix.c b/glib/tests/unix.c
index 3543458..9d55a6c 100644
--- a/glib/tests/unix.c
+++ b/glib/tests/unix.c
@@ -32,7 +32,7 @@ test_pipe (void)
   GError *error = NULL;
   int pipefd[2];
   char buf[1024];
-  ssize_t bytes_read;
+  gssize bytes_read;
   gboolean res;
 
   res = g_unix_open_pipe (pipefd, FD_CLOEXEC, &error);
diff --git a/tests/timeloop-basic.c b/tests/timeloop-basic.c
index 7f95226..d2bc41e 100644
--- a/tests/timeloop-basic.c
+++ b/tests/timeloop-basic.c
@@ -35,7 +35,7 @@ int
 read_all (int fd, char *buf, int len)
 {
   size_t bytes_read = 0;
-  ssize_t count;
+  gssize count;
 
   while (bytes_read < len)
     {
@@ -58,7 +58,7 @@ int
 write_all (int fd, char *buf, int len)
 {
   size_t bytes_written = 0;
-  ssize_t count;
+  gssize count;
 
   while (bytes_written < len)
     {


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