[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: BUG triggered by examples/smart
Angus Leeming wrote:
>
> Compiling examples/smart/smart with DEC cxx triggers the following Warning
> message that I don't feel comfortable addressing:
> Perhaps convert to "long"? This would workk on both 32 and 64 bit machines.
> Angus
I don't remember why the cast to int is there... But it seems to
no longer be needed. Patch included.
--
Jose Orlando Pereira
* mailto:jop@di.uminho.pt * http://gsd.di.uminho.pt/~jop *
--- graphio.h.old Thu Mar 2 15:24:18 2000
+++ graphio.h Wed Apr 26 15:59:27 2000
@@ -22,7 +22,7 @@
* Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA
*
- * $Id: graphio.h 1.4 Thu, 02 Mar 2000 15:24:18 +0000 jop $
+ * $Id: graphio.h 1.5 Wed, 15 Mar 2000 14:36:21 +0000 jop $
*/
#ifndef __XTL_GRAPHIO
@@ -34,7 +34,7 @@
private:
int label;
- typedef map<int,int> trans_type;
+ typedef map<void*,int> trans_type;
trans_type trans;
public:
@@ -46,24 +46,24 @@
stream.simple(x);
if (x==0) {
ptr=new T;
- trans.insert(pair<int,int>(label, (int)(void*)ptr));
+ trans.insert(pair<void*,int>(label, (void*)ptr));
label++;
- stream.simple(*ptr);
+ stream.content(*ptr);
} else
- ptr=(T*)(void*)trans[x];
+ ptr=(T*)trans[x];
}
template <class Format, class Refs, class T>
void reference(obj_output<Format, Refs>& stream, T const* ptr) {
- trans_type::iterator i=trans.find((int)(void*)ptr);
+ trans_type::iterator i=trans.find((void*)ptr);
if (i!=trans.end())
stream.simple((*i).second);
else {
stream.simple(0);
- trans.insert(pair<int,int>((int)(void*)ptr, label));
+ trans.insert(pair<void*,int>((void*)ptr, label));
int tmp=label;
label++;
- stream.simple(*ptr);
+ stream.content(*ptr);
}
}
};