www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2002/07/20/06:30:56

From: Richard Dawe <rich AT phekda DOT freeserve DOT co DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: 16 bit buffer
Date: Sat, 20 Jul 2002 10:22:56 +0100
Lines: 23
Message-ID: <3D392BF0.BC4558B8@phekda.freeserve.co.uk>
References: <3d391151 DOT 2522562 AT news DOT onet DOT pl>
NNTP-Posting-Host: modem-69.endostatin.dialup.pol.co.uk
Mime-Version: 1.0
X-Trace: news7.svr.pol.co.uk 1027157121 14936 62.136.92.197 (20 Jul 2002 09:25:21 GMT)
NNTP-Posting-Date: 20 Jul 2002 09:25:21 GMT
X-Complaints-To: abuse AT theplanet DOT net
X-Mailer: Mozilla 4.77 [en] (X11; U; Linux 2.2.19 i586)
X-Accept-Language: de,fr
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hello.

gienek wrote:
> Hi, I've got this tiny problem. I have something like
> this:
> 
> usnigned int *buffer16;
> unsigned long int *buffer32;
> 
> these pointers are equal.
> Now, when I want to write a word through the
> pointer buffer16 , this beast writes 32 bits.
> How to make it write 16 bits not 32???


I believe DJGPP has the ILP32 convention - integers, longs and pointers are 32
bits wide. A short is 16 bits wide for DJGPP. So you need to declare
'buffer16' as 'unsigned short *'.

HTH, regards,

-- 
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019