Skip to content

Commit

Permalink
Fix compiler error with 32 bit gcc 14 in Windows
Browse files Browse the repository at this point in the history
This fixes the following compiler error.

../../gmime/gmime-gpgme-utils.c:69:9: error: initialization of
'gpgme_ssize_t (*)(void *, void *, size_t)' {aka 'long int (*)(void *, void *, unsigned int)'}
from incompatible pointer type
'ssize_t (*)(void *, void *, size_t)' {aka 'int (*)(void *, void *, unsigned int)'}
[-Wincompatible-pointer-types]
   69 |         g_mime_gpgme_stream_read,
      |         ^~~~~~~~~~~~~~~~~~~~~~~~
  • Loading branch information
Biswa96 authored and jstedfast committed Jul 6, 2024
1 parent 76aee73 commit 2972da2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions gmime/gmime-gpgme-utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,28 +32,28 @@

#define _(x) x

static ssize_t
static gpgme_ssize_t
g_mime_gpgme_stream_read (void *stream, void *buffer, size_t size)
{
return g_mime_stream_read ((GMimeStream *) stream, (char *) buffer, size);
}

static ssize_t
static gpgme_ssize_t
g_mime_gpgme_stream_write (void *stream, const void *buffer, size_t size)
{
return g_mime_stream_write ((GMimeStream *) stream, (const char *) buffer, size);
}

static off_t
g_mime_gpgme_stream_seek (void *stream, off_t offset, int whence)
static gpgme_off_t
g_mime_gpgme_stream_seek (void *stream, gpgme_off_t offset, int whence)
{
switch (whence) {
case SEEK_SET:
return (off_t) g_mime_stream_seek ((GMimeStream *) stream, (gint64) offset, GMIME_STREAM_SEEK_SET);
return (gpgme_off_t) g_mime_stream_seek ((GMimeStream *) stream, (gint64) offset, GMIME_STREAM_SEEK_SET);
case SEEK_CUR:
return (off_t) g_mime_stream_seek ((GMimeStream *) stream, (gint64) offset, GMIME_STREAM_SEEK_CUR);
return (gpgme_off_t) g_mime_stream_seek ((GMimeStream *) stream, (gint64) offset, GMIME_STREAM_SEEK_CUR);
case SEEK_END:
return (off_t) g_mime_stream_seek ((GMimeStream *) stream, (gint64) offset, GMIME_STREAM_SEEK_END);
return (gpgme_off_t) g_mime_stream_seek ((GMimeStream *) stream, (gint64) offset, GMIME_STREAM_SEEK_END);
default:
return -1;
}
Expand Down

0 comments on commit 2972da2

Please sign in to comment.