9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: erik quanstrom <quanstro@quanstro.net>
To: 9fans@9fans.net
Subject: Re: [9fans] incompatible type signature
Date: Thu, 12 Sep 2013 01:30:17 -0400	[thread overview]
Message-ID: <2906a8aa08ff577a1ff6393ab13d50ef@brasstown.quanstro.net> (raw)
In-Reply-To: <94594e360af74d88545fc8c2358c4c44@brasstown.quanstro.net>

it appears that there are mistakes in ntohl and ntohs.
for obvious reasons int is valid for both "unsigned long" and
"unsigned short" due to the usual conversions (and the local,
temporary conventions on amd64), but remember, type
signatures are based on C types, and may differ from the
implementation.

- erik

; 9diff ntohl.c
/n/sources/plan9/sys/src/ape/lib/bsd/ntohl.c:1,5 - ntohl.c:1,5
  unsigned long
- ntohl(int x)
+ ntohl(unsigned long x)
  {
  	unsigned long n;
  	unsigned char *p;
/n/sources/plan9/sys/src/ape/lib/bsd/ntohl.c:24,30 - ntohl.c:24,30
  }

  unsigned short
- ntohs(int x)
+ ntohs(unsigned short x)
  {
  	unsigned short n;
  	unsigned char *p;



  reply	other threads:[~2013-09-12  5:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12  5:11 lucio
2013-09-12  5:21 ` erik quanstrom
2013-09-12  5:30   ` erik quanstrom [this message]
2013-09-12  5:39     ` lucio
2013-09-12  5:49       ` erik quanstrom
2013-09-12  6:27     ` lucio
2013-09-12 13:47       ` erik quanstrom
2013-09-12  5:36   ` lucio
2013-09-12  5:37     ` erik quanstrom
2013-09-12  7:42   ` Jens Staal
2013-09-12 15:16     ` erik quanstrom
2013-09-13 12:30       ` Jens Staal
2013-09-13 13:02         ` Jens Staal

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=2906a8aa08ff577a1ff6393ab13d50ef@brasstown.quanstro.net \
    --to=quanstro@quanstro.net \
    --cc=9fans@9fans.net \
    /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).