ts-7000
[Top] [All Lists]

[ts-7000] Re: pointer weirdness

To:
Subject: [ts-7000] Re: pointer weirdness
From: "Yan Seiner" <>
Date: Wed, 12 Sep 2007 23:50:19 -0000
--- In  "Stephen Queen" <> wrote:
>
> On 9/12/07, Yan Seiner <> wrote:
> >
> > printf("qddr: 0x%x 0x%x 0x%x 0x%x\n",*qddr,*((uint32_t
> > *)qddr),*(qddr+1), *((uint32_t *)(qddr+1)));
> 
> It looks like to me, the way you have things cast, that
> *qddr
> will give you the 16 bit contents of the object pointed to by qaddr,
while
> *((uint32_t *)(qddr))
> will cast qadd to 32 bits and then give you the 16 bit contents of the
> object pointed to by the 32 bit pointer.
> Do you mean
> (uint32_t)(*qddr)
> ????

What I was trying to do is figure out why 16 bit pointers weren't
giving me the result I was seeking, so the idea was to

1.  see what was at the *qddr location if we were to look at 2 bytes
2.  see what was at the *qddr location if we were to look at 4 bytes

Repeat at the next location

My understanding is that the pointers should point to the same thing,
except in one case I'd get 2 bytes back and in the other case I'd get
4 bytes back, and that the 2 bytes from the 16 bit pointer would be
somewhere in the 4 bytes of the 32 bit pointer.  It's purely a test
case.  Alas, it's not so and I can't figure out why.

I've been looking at this bloody code for so long that it's possible
I'm losing my mind....



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU