Subject: bad casts in FvwmPager ?

From: [email-masked] (Stephane Rosa)
Date: Fri, 7 Jan 2000 12:33:50 +0100 (CET)

Dunno if it is related to funny behaviors in the Pager, but
in FvwmPager.c :

...
  Scr.Vx = (long)body[0];
  Scr.Vy = (long)body[1];
  if (Scr.CurrentDesk != (long)body[2])
...
  if((Scr.VxMax != body[3])||(Scr.VyMax != body[4]))
  {
    Scr.VxMax = body[3];
    Scr.VyMax = body[4];

body comes as unsigned long, is casted to a long to fit in
a int (as per FvwmPager.h) :

FvwmPager.h
...
  int VxMax;             /* Max location for top left of virt desk*/
  int VyMax;
  int Vx;                /* Current loc for top left of virt desk */
  int Vy;

Am I wrong (or does sizeof(long)==sizeof(int) somewhere) ?

Cheers
Stephane

--
SILICON GRAPHICS                 EUROPEAN MANUFACTURING CENTER
##############################################################
Stephane Rosa                     Tel :     +41 (0)32 843-3638
Business Analyst                  Fax :     +41 (0)32 843-3909
APS/FP  Project                   GSM :     +41 (0)79 448-5335
--------------------------------------------------------------
ircnoc.neu.sgi.com  SGI Intranet  IRC :   EuroOper on #irchelp
irc.stealth.net     Euro-IRCNet   IRC :   Clipper on #radionet
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dan Espen <[email-masked]>
Date: Fri, 07 Jan 2000 10:09:10 -0500

> Am I wrong (or does sizeof(long)==sizeof(int) somewhere) ?

Depending on the machine, a long and an int can be the same size.

It seems to me, the real issue with this code is will the x and y
values ever exceed the size of an int.

Since the values  for  x and y  are  based on pixel dimensions  of the
screen, I don't think using an int is going to cause a problem.

--
Dan Espen
444 Hoes Lane  Room RRC 1C-214           E-mail: [email-masked]
Piscataway, NJ 08854                     Phone: (732) 699-5570
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]