[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: XTL auto_mem_buffer
- To: Mike Caruso <mcaruso@nvl.army.mil>
- Subject: Re: XTL auto_mem_buffer
- From: Jose Orlando Pereira <jop@di.uminho.pt>
- Date: Thu, 11 Jan 2001 14:54:27 +0000
- Cc: xtl@lsd.di.uminho.pt
- Delivered-To: mailing list xtl@lsd.di.uminho.pt
- In-Reply-To: <3A5CE51C.5F0BB268@nvl.army.mil>
- Mailing-List: contact xtl-help@lsd.di.uminho.pt; run by ezmlm
- Organization: Universidade do Minho
- References: <3A5CE51C.5F0BB268@nvl.army.mil>
On Wednesday 10 January 2001 22:41, you wrote:
> I am using your auto_mem_buffer class in the XTL library and I think
> I'm using it wrong because I get a core dump when using it in a very
> simple scenario, I can't see any other way to use it .. can you please
> take a look at my simple example that cores on me ( I have attached the
> file ), I'm working on a SGI IRIX 6.5.7m OS with Mips Pro Compiler
> 7.2.1.3m. I am using XTl 1.4.
Yes, it is a bug. Please try the attached patch.
--
Jose Orlando Pereira
* mailto:jop@di.uminho.pt * http://gsd.di.uminho.pt/~jop *
--- include/xtl/xdr.h 2000/12/22 12:19:50 1.4
+++ include/xtl/xdr.h 2001/01/11 14:45:14
@@ -54,7 +54,7 @@
void output_simple(type1 const& data) { \
type2 store = static_cast<type2>( data ); \
_xtl_big_end( reinterpret_cast<char*>( &store ), \
- reinterpret_cast<char*>( require(4) ) ); \
+ reinterpret_cast<char*>( desire(4) ) ); \
}
#define def_output_simple_ll(type1, type2) \
@@ -62,9 +62,9 @@
union { type2 ll; int i[2]; } store; \
store.ll = static_cast<type2>( data ); \
_xtl_big_end( reinterpret_cast<char*>( &store.i[0] ), \
- reinterpret_cast<char*>( require(4) ) ); \
+ reinterpret_cast<char*>( desire(4) ) ); \
_xtl_big_end( reinterpret_cast<char*>( &store.i[1] ), \
- reinterpret_cast<char*>( require(4) ) ); \
+ reinterpret_cast<char*>( desire(4) ) ); \
}
// data is stored with big endian ordering (XDR standard)