unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* uniform vector byte signed or unsigned
@ 2004-07-23 23:11 Kevin Ryde
  2004-07-24 10:28 ` Neil Jerram
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Ryde @ 2004-07-23 23:11 UTC (permalink / raw)


In scm_cvref it looks like a byvect byte is fetched as a "char", which
is of course normally signed, but on some systems can be unsigned.

Is a byte meant to be treated as signed?  It's probably worth making
that explicit so scheme level stuff doesn't depend on the vagaries of
C type conventions.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: uniform vector byte signed or unsigned
  2004-07-23 23:11 uniform vector byte signed or unsigned Kevin Ryde
@ 2004-07-24 10:28 ` Neil Jerram
  2004-07-27 22:42   ` Kevin Ryde
  0 siblings, 1 reply; 3+ messages in thread
From: Neil Jerram @ 2004-07-24 10:28 UTC (permalink / raw)
  Cc: guile-devel

Kevin Ryde wrote:

> In scm_cvref it looks like a byvect byte is fetched as a "char", which
> is of course normally signed, but on some systems can be unsigned.
> 
> Is a byte meant to be treated as signed?  It's probably worth making
> that explicit so scheme level stuff doesn't depend on the vagaries of
> C type conventions.

Good spot.  I've hit this on Windows, where it comes out as signed, and 
so I have to do a trivial conversion to an unsigned value.

My preference would be for the value to be unsigned in the first place, 
though.

Regards,
       Neil



_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: uniform vector byte signed or unsigned
  2004-07-24 10:28 ` Neil Jerram
@ 2004-07-27 22:42   ` Kevin Ryde
  0 siblings, 0 replies; 3+ messages in thread
From: Kevin Ryde @ 2004-07-27 22:42 UTC (permalink / raw)
  Cc: guile-devel

Neil Jerram <neil@ossau.uklinux.net> writes:
>
> My preference would be for the value to be unsigned in the first
> place, though.

Me too, but it's probably too late to change.  I'd imagine everyone
who used it would have quickly found its signed, and written code for
that.

Actually, I see there's always a -128 to +127 check in array-fill!, so
I guess that answers the question what it ought to be.


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-07-27 22:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-23 23:11 uniform vector byte signed or unsigned Kevin Ryde
2004-07-24 10:28 ` Neil Jerram
2004-07-27 22:42   ` Kevin Ryde

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).