Commit 4a77eb16 authored by LRN's avatar LRN Committed by Philip Withnall

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
parent 6abdc06d
......@@ -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
......
......@@ -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);
......
......@@ -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)
......
......@@ -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);
......
......@@ -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);
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment