unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "Hannes Müller" <h.c.f.mueller@gmail.com>
To: guile-devel@gnu.org
Subject: patch submission to fix compiler warning if glib.h is included in project
Date: Tue, 23 Nov 2021 19:28:02 +0100	[thread overview]
Message-ID: <d5d20b8cf222d26111ae4be9b649285fb171c70b.camel@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 65 bytes --]

Hi,

Please consider to appy the attached patch.

Thanks
Hannes 

[-- Attachment #2: 0001-Fix-warning-if-libguile-is-used-with-compile-option-.patch --]
[-- Type: text/x-patch, Size: 1237 bytes --]

From 6549b46942e8154e37ffbba3ad1ef88dc809e7a3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Hannes=20M=C3=BCller?= <>
Date: Tue, 23 Nov 2021 18:38:05 +0100
Subject: [PATCH] Fix warning if libguile is used with compile option
 -Wsign-conversion

Avoid a warning if glib.h is included in a code project using compile option
-Wsign-conversion
---
 libguile/array-handle.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libguile/array-handle.h b/libguile/array-handle.h
index 6ad80eb41..ae62df48e 100644
--- a/libguile/array-handle.h
+++ b/libguile/array-handle.h
@@ -105,7 +105,7 @@ scm_array_handle_ref (scm_t_array_handle *h, ssize_t p)
     /* catch overflow */
     scm_out_of_range (NULL, scm_from_ssize_t (p));
   /* perhaps should catch overflow here too */
-  return h->vref (h->vector, h->base + p);
+  return h->vref (h->vector, h->base + (size_t)p);
 }
 
 SCM_INLINE_IMPLEMENTATION void
@@ -115,7 +115,7 @@ scm_array_handle_set (scm_t_array_handle *h, ssize_t p, SCM v)
     /* catch overflow */
     scm_out_of_range (NULL, scm_from_ssize_t (p));
   /* perhaps should catch overflow here too */
-  h->vset (h->vector, h->base + p, v);
+  h->vset (h->vector, h->base + (size_t)p, v);
 }
 
 #endif
-- 
2.30.2


                 reply	other threads:[~2021-11-23 18:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d5d20b8cf222d26111ae4be9b649285fb171c70b.camel@gmail.com \
    --to=h.c.f.mueller@gmail.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).