Patch: fix a problem on 64 bit machines

Mike FABIAN mfabian at suse.de
Mon Mar 31 04:00:08 EST 2003


smoynes at nexus.carleton.ca さんは書きました:

> Thank you. This has been applied to CVS.

Thank you.

I found another small problem which causes crashes on 64 bit machines
like AMD x86_64. Patch attached.

In Configuration.hh there is the code:

  inline bool getValue(const std::string &rname, int &value) const {
    return getValue(rname, (long&) value);
  }
  inline bool getValue(const std::string &rname, unsigned int &value) const {
    return getValue(rname, (unsigned long&) value);
  }

This looks suspicious to me, I think this casting of "int &" to "long
&" won't work on 64 bit platforms. My patch just avoids to call one of
the above two methods by using a "long" from the beginning, thus
avoiding the cast which makes it "work for me".

But something needs to be fixed in the above two methods if one
actually wants to use them on platforms where "int" and "long" are not
the same.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: openbox-2.2.3-64bit.diff
Type: text/x-patch
Size: 341 bytes
Desc: not available
URL: <http://icculus.org/pipermail/openbox/attachments/20030331/596d6138/attachment.bin>
-------------- next part --------------

-- 
Mike Fabian   <mfabian at suse.de>   http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。


More information about the openbox mailing list