Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
* So Y is my pointer so bogus
@ 1999-02-03 22:36 Uncle George
  1999-02-03 22:59 ` Jason Duerstock
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Uncle George @ 1999-02-03 22:36 UTC (permalink / raw)
  To: axp-list; +Cc: Dan Schmitt

This little example caused a (un-expected ) pointer failure in one of
the font routines in my java 1.2 port on linux/alpha. It was expected to
add a -1760 ( -1760 * sizeof(int)) but does not.
Ugg. what is a 64bitter to do.
gat
main()
{

        int x1,x2,x3;
        int y1,y2,y3;
        unsigned int P;
        unsigned int S;
        void *a;

        a = (void *)0;
        x1=20,x2=0,x3=0;
        y1=5, y2=0,y3=0;
        P = 1;
        S = 348;

        a = (int *)a +(x2-x1-x3)*P + (y2-y1-y3)*S;
        printf("a = %p\n",a);
}






^ permalink raw reply	[flat|nested] 11+ messages in thread
* RE: So Y is my pointer so bogus
@ 1999-02-03 22:57 Lagodzinski, Andrew
  0 siblings, 0 replies; 11+ messages in thread
From: Lagodzinski, Andrew @ 1999-02-03 22:57 UTC (permalink / raw)
  To: axp-list

try this:
    a = ((int *)a) +(x2-x1-x3)*P + (y2-y1-y3)*S;

Not the extra parens around (int*)a.


> -----Original Message-----
> From: Uncle George [mailto:gatgul@voicenet.com]
> Sent: Wednesday, February 03, 1999 2:36 PM
> To: axp-list@redhat.com
> Cc: recipient list not shown;
> @redhat.com@kla-tencor.com@kla-tencor.com@kla-tencor.com
> Subject: So Y is my pointer so bogus
> 
> 
> This little example caused a (un-expected ) pointer failure in one of
> the font routines in my java 1.2 port on linux/alpha. It was 
> expected to
> add a -1760 ( -1760 * sizeof(int)) but does not.
> Ugg. what is a 64bitter to do.
> gat
> main()
> {
> 
>         int x1,x2,x3;
>         int y1,y2,y3;
>         unsigned int P;
>         unsigned int S;
>         void *a;
> 
>         a = (void *)0;
>         x1=20,x2=0,x3=0;
>         y1=5, y2=0,y3=0;
>         P = 1;
>         S = 348;
> 
>         a = (int *)a +(x2-x1-x3)*P + (y2-y1-y3)*S;
>         printf("a = %p\n",a);
> }
> 
> 
> 
> 
> 
> -- 
> To unsubscribe: send e-mail to axp-list-request@redhat.com with
> 'unsubscribe' as the subject.  Do not send it to axp-list@redhat.com
> 


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~1999-02-04 11:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1999-02-03 22:36 So Y is my pointer so bogus Uncle George
1999-02-03 22:59 ` Jason Duerstock
1999-02-03 23:32   ` B. James Phillippe
1999-02-03 23:45     ` Uncle George
1999-02-04  0:51       ` Michal Jaegermann
1999-02-04  0:55         ` Michal Jaegermann
1999-02-03 23:36   ` Uncle George
1999-02-03 23:40   ` Re[2]: " Dan
1999-02-04  0:38 ` Michal Jaegermann
1999-02-04 11:25 ` Phil Carmody
  -- strict thread matches above, loose matches on Subject: below --
1999-02-03 22:57 Lagodzinski, Andrew

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox