Repository: lucy Updated Branches: refs/heads/master 8a37f575d -> 873f4391b
Remove U64_TO_DOUBLE macro It was only needed for MSVC6. Project: http://git-wip-us.apache.org/repos/asf/lucy/repo Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/4b541569 Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/4b541569 Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/4b541569 Branch: refs/heads/master Commit: 4b541569518665e3974f96f76c493ff05f200a33 Parents: 8a37f57 Author: Nick Wellnhofer <wellnho...@aevum.de> Authored: Fri Feb 3 13:32:48 2017 +0100 Committer: Nick Wellnhofer <wellnho...@aevum.de> Committed: Fri Feb 3 14:52:46 2017 +0100 ---------------------------------------------------------------------- common/charmonizer.c | 33 ------------------------------- test/Lucy/Test/Search/TestSortSpec.c | 4 ++-- 2 files changed, 2 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/lucy/blob/4b541569/common/charmonizer.c ---------------------------------------------------------------------- diff --git a/common/charmonizer.c b/common/charmonizer.c index 3abadd5..3f581bb 100644 --- a/common/charmonizer.c +++ b/common/charmonizer.c @@ -7278,17 +7278,6 @@ static const char chaz_Integers_literal64_code[] = CHAZ_QUOTE( return 0; ) CHAZ_QUOTE( } ); -static const char chaz_Integers_u64_to_double_code[] = - CHAZ_QUOTE( #include <stdio.h> ) - CHAZ_QUOTE( int main() ) - CHAZ_QUOTE( { ) - CHAZ_QUOTE( unsigned %s int_num = 0; ) - CHAZ_QUOTE( double float_num; ) - CHAZ_QUOTE( float_num = (double)int_num; ) - CHAZ_QUOTE( printf("%%f\n", float_num); ) - CHAZ_QUOTE( return 0; ) - CHAZ_QUOTE( } ); - void chaz_Integers_run(void) { char *output; @@ -7558,28 +7547,6 @@ chaz_Integers_run(void) { } } - /* Create macro for converting uint64_t to double. */ - if (has_64) { - /* - * Determine whether unsigned 64-bit integers can be converted to - * double. Older MSVC versions don't support this conversion. - */ - sprintf(code_buf, chaz_Integers_u64_to_double_code, i64_t_type); - output = chaz_CC_capture_output(code_buf, &output_len); - if (output != NULL) { - chaz_ConfWriter_add_def("U64_TO_DOUBLE(num)", "((double)(num))"); - free(output); - } - else { - chaz_ConfWriter_add_def( - "U64_TO_DOUBLE(num)", - "((num) & UINT64_C(0x8000000000000000) ? " - "(double)(int64_t)((num) & UINT64_C(0x7FFFFFFFFFFFFFFF)) + " - "9223372036854775808.0 : " - "(double)(int64_t)(num))"); - } - } - chaz_ConfWriter_end_module(); /* Integer typedefs. */ http://git-wip-us.apache.org/repos/asf/lucy/blob/4b541569/test/Lucy/Test/Search/TestSortSpec.c ---------------------------------------------------------------------- diff --git a/test/Lucy/Test/Search/TestSortSpec.c b/test/Lucy/Test/Search/TestSortSpec.c index 1dd704b..ea85d6d 100644 --- a/test/Lucy/Test/Search/TestSortSpec.c +++ b/test/Lucy/Test/Search/TestSortSpec.c @@ -297,14 +297,14 @@ S_random_int64() { static Obj* S_random_float32() { uint64_t num = TestUtils_random_u64(); - double d = CHY_U64_TO_DOUBLE(num) * (10.0 / UINT64_MAX); + double d = (double)num * (10.0 / UINT64_MAX); return (Obj*)Float_new((float)d); } static Obj* S_random_float64() { uint64_t num = TestUtils_random_u64(); - return (Obj*)Float_new(CHY_U64_TO_DOUBLE(num) * (10.0 / UINT64_MAX)); + return (Obj*)Float_new((double)num * (10.0 / UINT64_MAX)); } static Vector*