From a6a8805b906dc9be2ec3ecba647997335e345182 Mon Sep 17 00:00:00 2001 From: Steve Vinoski Date: Sat, 29 May 2010 12:07:32 -0400 Subject: compact IEEE 754 double encoding in external binary format for ei Implement the compact IEEE 754 double encoding in external binary format for ei. Encoding for ei now always produces the NEW_FLOAT_EXT format. Decoding and term printing handle both the old ERL_FLOAT_EXT encoding and the new NEW_FLOAT_EXT encoding. Legacy erl_interface code also handles the new encoding, but still produces the ERL_FLOAT_EXT encoding by default. Also enable the DFLAG_NEW_FLOATS distribution flag. Reduce the number of copies of the code for encoding and decoding doubles throughout ei and erl_interface by instead calling the ei encoding and decoding functions wherever possible. Restore commented-out float tests in ei_decode_SUITE and ei_encode_SUITE in lib/erl_interface/test. Modify them to make them match the style of other tests in the same suites. These changes are based on an ei float patch from Serge Aleynikov originally submitted against R12B-2 in July 2008. --- lib/erl_interface/src/decode/decode_skip.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/erl_interface/src/decode/decode_skip.c') diff --git a/lib/erl_interface/src/decode/decode_skip.c b/lib/erl_interface/src/decode/decode_skip.c index 316b5bee98..efe323d0d5 100644 --- a/lib/erl_interface/src/decode/decode_skip.c +++ b/lib/erl_interface/src/decode/decode_skip.c @@ -77,6 +77,7 @@ int ei_skip_term(const char* buf, int* index) if (ei_decode_big(buf, index, NULL) < 0) return -1; break; case ERL_FLOAT_EXT: + case NEW_FLOAT_EXT: if (ei_decode_double(buf, index, NULL) < 0) return -1; break; case ERL_FUN_EXT: -- cgit v1.2.3