All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Charles A. Jolley" <charles.jolley@zeratec.com>
To: Hollis R Blanchard <hollis+@andrew.cmu.edu>
Cc: linuxppc-dev@lists.linuxppc.org
Subject: Re: QuickTime Streaming Server for Linux.. on x86
Date: Thu, 08 Jul 1999 15:01:51 -0500	[thread overview]
Message-ID: <199907082014.PAA19744@www2.tuckeris.com> (raw)


> 
> Also, lots and lots of "warning: multi-character character constant" coming
> from lines like
>
> static const FourCharCode kFractionLostPacketsSig = 'frac';
>
> Should those single ticks be quotes?
>
> -Hollis

The MacOS makes extensive use of 4-character constants (32-bit values) to
identify file and creator types, and also the types of resources in the
resource fork of a file.  The single quote method is a standard way of
indicating these constants and all MacOS compilers will take it without
complaint.  I encountered this same problem when porting some Mac stuff to
Linux some time ago.  I seem to recall that the compiler complained but
produced the right results anyway.  My Linux systems are down right now so I
can't check to make sure and I've since updated all my old code to work
around it.

Changing the single ticks to quotes will most definitely introduce errors,
though, because that will cause the compiler to produce a 32-bit pointer to
a NULL terminated string "frac", rather than a 32-bit value equal to the
four characters 'frac'.  This can be particularly deadly in code where types
are explicitly cast because it is still a 32-bit value either way.

Cheers,
-Charles


[[ This message was sent via the linuxppc-dev mailing list.  Replies are ]]
[[ not  forced  back  to the list, so be sure to Cc linuxppc-dev if your ]]
[[ reply is of general interest. Please check http://lists.linuxppc.org/ ]]
[[ and http://www.linuxppc.org/ for useful information before posting.   ]]

             reply	other threads:[~1999-07-08 20:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-07-08 20:01 Charles A. Jolley [this message]
1999-07-08 20:09 ` QuickTime Streaming Server for Linux.. on x86 Hollis R Blanchard
1999-07-08 20:58   ` Dan Burcaw
1999-07-09  8:34     ` Dan Burcaw
1999-07-09 18:58       ` Joel Klecker
1999-07-08 23:19   ` Deirdre Saoirse
     [not found] <3784D927.FFEAEFC9@madison-web.com>
1999-07-08 19:34 ` Hollis R Blanchard

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=199907082014.PAA19744@www2.tuckeris.com \
    --to=charles.jolley@zeratec.com \
    --cc=hollis+@andrew.cmu.edu \
    --cc=linuxppc-dev@lists.linuxppc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.