The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: imp@bsdimp.com (Warner Losh)
Subject: [TUHS] X and NeWS history (long)
Date: Thu, 14 Sep 2017 09:12:31 -0600	[thread overview]
Message-ID: <CANCZdfoWCFTBKUa2KODkhnDT28C_Lxu-z-mCnH8nQZFcTTGL8A@mail.gmail.com> (raw)
In-Reply-To: <20170914123041.B4F851525F0F@macaroni.inf.ed.ac.uk>

On Thu, Sep 14, 2017 at 6:30 AM, Richard Tobin <richard at inf.ed.ac.uk> wrote:

> > I really kind of liked that toolkit, it was all key/value like so:
> >
> >         panel = xv_create(
> >           frame, PANEL,
> >             XV_WIDTH, WIDTH,
> >           XV_HEIGHT, 30,
> >             PANEL_LAYOUT, PANEL_HORIZONTAL,
> >             XV_SHOW, FALSE,
> >           NULL);
> >
> > So the order of the args didn't really matter, I think the first one
> > maybe did because that was the parent but not sure, the rest could
> > be any order you wanted.  Pretty simple.
>
> The first two were fixed; the prototype was
>
>   Xv_object xv_create (Xv_opaque owner, Xv_pkg *pkg, ...);
>
> The keywords (XV_WIDTH etc) contained a bitfield encoding the type and
> cardinality of the value argument(s) so that the argument list could
> be traversed without knowing every package's keywords.
>
> Using NULL as the terminating argument looks unportable.


It turned out to be portable enough. And no worse than calloc dependencies
in the base X11 library (which assumes that the address used when the
integer 0 is assigned to a pointer has no bits set). The only other
assumption was that pointers and ints were passed the same way, and that
whatever NULL expanded to was at least as long as an int.

So, yes this wouldn't work on a system whose null-pointer representation
contained bits set, but that was already an assumption of X11...

Warner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://minnie.tuhs.org/pipermail/tuhs/attachments/20170914/122f19dc/attachment-0001.html>


  reply	other threads:[~2017-09-14 15:12 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14 12:30 Richard Tobin
2017-09-14 15:12 ` Warner Losh [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-09-13 18:54 Nelson H. F. Beebe
2017-09-13 21:27 ` ron minnich
2017-09-13 15:17 Richard Tobin
2017-09-13 16:01 ` Jon Steinhart
2017-09-14  1:08   ` Nemo
2017-09-14  3:14 ` Larry McVoy
2017-09-08 20:54 [TUHS] Happy birthday, Dennis Ritchie! Dave Horsfall
2017-09-08 21:14 ` William Pechter
2017-09-11 16:30   ` Paul Winalski
2017-09-11 16:49     ` [TUHS] Happy birthday, Dennis Ritchie! [ really sun vs dec/apollo ] Jon Steinhart
2017-09-11 23:09       ` Larry McVoy
2017-09-12  7:38         ` arnold
2017-09-12 15:35           ` [TUHS] Happy birthday, Dennis Ritchie! [ really sun vs dec/apollo --> X and NeWS ] Jon Steinhart
2017-09-12 17:04             ` Arthur Krewat
2017-09-12 22:11               ` [TUHS] X and NeWS history (long) Jon Steinhart
2017-09-12 22:58                 ` Larry McVoy
2017-09-12 23:22                   ` Jon Steinhart
2017-09-12 23:44                     ` Chris Torek
2017-09-12 23:41                 ` Adam Sampson
2017-09-13  0:14                   ` Jon Steinhart
2017-09-13  0:29                 ` Bakul Shah
2017-09-13  0:52                   ` ron minnich
2017-09-13  0:54                     ` Warner Losh
2017-09-13  0:56                       ` ron minnich
2017-09-13  0:57                         ` Warner Losh
2017-09-13  2:06                         ` Kurt H Maier
2017-09-13  3:34                           ` ron minnich
2017-09-13  3:55                             ` Jon Steinhart
2017-09-13 15:16                               ` Arthur Krewat
2017-09-13  1:42                     ` Arthur Krewat
2017-09-13  2:27                       ` Grant Taylor
2017-09-13 16:14                     ` Lawrence Stewart
2017-09-13  0:56                   ` Jon Steinhart
2017-09-13  1:34                     ` Bakul Shah
2017-09-13  2:43                     ` Grant Taylor
2017-09-13  3:01                       ` Jon Steinhart
2017-09-13  3:25                         ` Grant Taylor
2017-09-13  3:27                           ` Jon Steinhart
2017-09-13 15:09                 ` Tony Finch
2017-09-13 15:19                   ` Jon Steinhart

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

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

  git send-email \
    --in-reply-to=CANCZdfoWCFTBKUa2KODkhnDT28C_Lxu-z-mCnH8nQZFcTTGL8A@mail.gmail.com \
    --to=imp@bsdimp.com \
    /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 NNTP newsgroup(s).