× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Subject: RE: unsigned char (was Examples)
  • From: bmorris@xxxxxxxxxx
  • Date: Fri, 16 Jun 2000 17:36:55 -0400




>Date: Tue, 13 Jun 2000 15:23:22 -0500
>From: "Bob Crothers" <bob@cstoneindy.com>
>
>Greg,
> ...
>First, I'd recommend you use the following declaration for your space
>pointer:
>
>unsigned char *mySpacePtr;
> ...

This is interesting.  Greg, "char" is normally already an unsigned char.
If it was always true instead of just "normally" I'd say that Bob was
wrong advising you to add "unsigned" to your declaration.  But there
is a possibility of having chars default to signed by coding
  #pragma chars(unsigned)
before any other statements in the file (including directives, so
don't worry about having an include file do this pragma).

That pragma must exist because some implementations of C default char
to signed, so for portable code, I guess you should indeed specify
unsigned for bit-twiddling purposes.  (Not sure how portable your
API/user-space code needs to be though ...)

Greg, if the user-space is known to contain a particular structure, say
the return value from an API, you might as well just declare the pointer
as a pointer to that structure:

  Qus_Generic_Header_0100_t *pGenericHeader;
  QUSPTRUS (myuserspace, &pGenericHeader, &errCode);

Barbara Morris


+---
| This is the C/400 Mailing List!
| To submit a new message, send your mail to C400-L@midrange.com.
| To subscribe to this list send email to C400-L-SUB@midrange.com.
| To unsubscribe from this list send email to C400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: bob@cstoneindy.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.