Peter Dimov
de4aadcb11
Use temporary variables to hold the result of BOOST_ENDIAN_INTRINSIC_*
2018-12-06 18:48:43 +02:00
Peter Dimov
84273c7139
Add BOOST_ENDIAN_NO_INTRINSICS tests to test/Jamfile
2018-12-06 18:02:52 +02:00
Peter Dimov
9cbd708ce5
Rename uint*_t types to avoid conflict
2018-12-06 18:02:23 +02:00
Peter Dimov
59126b39ae
Add intrinsic_test.cpp to test/Jamfile
2018-12-06 17:51:38 +02:00
Peter Dimov
07ec535600
boost/predef/detail/endian_compat.h is deprecated; switch to boost/predef/other/endian.h
2018-09-11 18:54:54 +03:00
Peter Dimov
62802fee96
Add unaligned test
2017-12-23 17:22:35 +02:00
Peter Dimov
10877d3667
Remove one more integer overflow
2017-12-23 04:47:54 +02:00
Peter Dimov
d4738d8598
Avoid undefined behavior due to signed integer overflow
2017-12-23 00:04:34 +02:00
Peter Dimov
0d5adab378
Refactor boundary values tests
2017-12-22 16:35:21 +02:00
Peter Dimov
4648d237f0
Merge branch 'add-test-for-boundary-values' of https://github.com/arvidn/endian into develop
2017-12-22 16:28:00 +02:00
arvidn
674adbd592
add test to expose undefined behaviors endian_buffer when used with signed integers
2017-12-22 00:00:16 +01:00
Peter Dimov
34542134be
Merge pull request #23 from arvidn/remove-trailing-whitespace
...
[cleanup] remove trailing whitespace from source code files
2017-12-21 17:42:03 +02:00
Peter Dimov
b647051422
Add a construction/assignment/value test for buffer types
2017-12-21 03:32:38 +02:00
arvidn
4b4123a0fa
[cleanup] remove trailing whitespace from source code files
2017-11-04 13:07:54 +01:00
Beman
739bc40bfc
Update tools version
2017-10-15 10:02:13 -04:00
Ben Wiederhake
b51593c766
Fix typos in documentation/comments
...
Credits go to the authors of codespell.
2016-04-03 19:13:04 +02:00
Beman
1b0a41e6cb
Add Clang/c2 solution with conversion_test_clang project. Clang/c2 uses the Microsoft rather than GCC intrinsics, so check for defined(_MSC_VER) before defined(__clang__)
2015-12-11 08:15:25 -05:00
Beman
cd57e01f9c
The boost::uint64_t fix for old msvc compilers is also needed for buffer_test.cpp
2015-03-30 07:15:15 -04:00
Beman
fdc8965842
Some older Microsoft libraries did not have uint64_t, so use boost/cstdint.hpp for it.
2015-03-26 11:03:39 -04:00
Beman
5caf1d16c8
Remove floating point support for boost 1.58.0. As currently implemented, return by value operations are not reliable because normalization and other bit pattern changes can occur. Docs not updated as yet. Floating point support will be corrected and reinstated for boost 1.59.0, based on in-place customization and inplace and/or copy signatures to replace the unsafe (i.e. native_to_big/little ) by value returns. The big/little_to_native return by value functions are safe, but require reimplementation.
2015-03-24 17:24:56 -04:00
Beman
a15f9420cb
Add fp_exhaustive_test.
2015-03-20 08:59:47 -04:00
Beman
5ab08db7a4
Use BOOST_NO_CXX11_NUMERIC_LIMITS for testing with C++03 standard libraries. Always show test output.
2015-03-16 08:58:42 -04:00
Beman
44542694e3
Add round trip test to auto test. Remove tests made redundant by auto test.
2015-03-14 09:45:50 -04:00
Beman
cea2be8023
Add auto_test cases lowest(), epsilon(), 0.0, -0.0, 1.0, -1.0
2015-03-14 09:01:55 -04:00
Beman
ff4b22bdec
Add more auto_test cases.
2015-03-14 08:20:41 -04:00
Beman
affdcac443
Rename float_test to floating_point_test. Old name was unclear. Might have incorrectly been read as "test of type float" instead of "test of floating point types".
2015-03-11 10:36:34 -04:00
Beman
7460870381
Comment out failing signaling_NaN() tests.
2015-03-10 16:37:36 -04:00
Beman
13b0d7b9ba
Add missing #include <limits>.
2015-03-10 16:34:47 -04:00
Beman
4f2a715c9f
Fully implement float_value_test and double_value_test
2015-03-09 17:11:54 -04:00
Beman
09ae6c961f
Rename BOOST_TEST_MEMCMP_EQ to BOOST_TEST_MEM_EQ. Add float_test to Jamfile. Add float_value_test() and double_value_test().
2015-03-08 10:50:39 -04:00
Beman
adc09abc7a
Also show numeric_limits values in big and little endian hex.
2015-03-07 08:59:14 -05:00
Beman
072b495240
Add Endian specific lightweight_test.hpp with new macro BOOST_TEST_MEMCMP_EQ that uses std::memcmp(...)==0 to determine equality. Bitwise equality is the standard we want floating point round trips to be held to, since NaN's are then equal.
2015-03-05 10:52:28 -05:00
Beman
482bcb0855
report_limits() working.
2015-03-04 14:51:39 -05:00
Beman
a968c67510
Initial commit of infrastructure. No test cases yet.
2015-03-04 11:48:21 -05:00
Beman
9c0cbae556
Revert the default (*_t) types to unaligned, and used *_at to identify the aligned types. See mini-review thread for rationale.
2015-02-23 07:24:17 -05:00
Beman
b0ef03b9d6
Rearranges rows and columns in tables. Add big_int8_t, big_uint8_t, little_int8_t, little_uint8_t arithmetic and buffer types, in response to mini-review query.
2015-02-16 19:31:48 -05:00
Beman
512287dfa7
Clear some warnings in test programs.
2015-01-19 08:44:19 -05:00
Beman
adee2fe513
Add support for deprecated names from pre-review releases.
2015-01-18 19:48:27 -05:00
Beman
35f4c47a22
Add endian_buffer stream inserter and extractor, beef up buffer_test a bit.
2015-01-17 10:25:29 -05:00
Beman
10bcb52d97
Add loop_time_test options
2015-01-15 09:17:31 -05:00
Beman
810f5453a6
Work-in-progress, including various bug fixes and doc updates.
2015-01-14 16:28:30 -05:00
Beman
321d5a087a
For X86 and X64 architectures, which permit unaligned loads and stores, unaligned little endian buffer and arithmetic types use regular loads and stores when the size is exact. This makes unaligned little endian buffer and arithmetic types significantly more efficient on these architectures.(Pull request from Jeremy Maitin-Shepard) Docs updated, but timing results have not yet been updated.
2015-01-06 16:57:53 -05:00
Beman
d15b2fdb1c
Refined rationale for choice of exact-length types for conversion support.
2014-12-16 08:49:01 -05:00
Beman
6de2f69b77
Get MSVC 64-builds working under Visual Studio.
2014-12-15 20:20:16 -05:00
Beman
971ba888d6
Decompose Reversible into EndianReversible and EndianReversibleInplace.
2014-12-11 11:41:44 -05:00
Beman
6c173766e3
Eliminate gcc -Wconversion warnings.
2014-12-10 15:03:06 -05:00
Beman
dcde9463fc
Do not define _SCL_SECURE_NO_WARNINGS or _CRT_SECURE_NO_WARNINGS if already defined (such as on the command line), plus related cleanups.
2014-12-10 10:26:49 -05:00
Beman
c201455c84
Change "in_place" to "inplace". Rationale: shortens names without impacting expressiveness.
2014-12-10 09:39:03 -05:00
Beman
2cbcd6f7d3
Rename "runtime_conditional_reverse" to "conditional_reverse". The differing number of arguments is sufficient to disambiguate the compile-time and run-time overloads.
2014-12-10 09:26:47 -05:00
Beman
51b990eb50
Add associated-files.vcxproj and related infrastructure so Visual Studio IDE find-in-files and replace-in-files works for associated files like headers and HTML files.
2014-12-10 09:00:43 -05:00
Beman
dcca2835a9
Rename "reverse_endianness" to "endian_reverse". Shorter but still plenty explicit. See bikeshed.txt for alternatives considered.
2014-12-10 08:30:30 -05:00
Beman
e4466edf4e
Drop the _unless_big and _unless_little functions. KISS. They were confusing, and less confusing names were never found.
2014-12-09 20:43:47 -05:00
Beman
55a65c3806
Revert to again supply the reverse_endianness_in_place template. This has the effect of providing a default reverse_endianness_in_place for user-defined types. Add error checking for UDT's to verify this works as desired. Provide a note in the conversion docs to that effect.
2014-12-09 11:36:42 -05:00
Beman
4b6019c82e
Use hex in literal for value where octal is confusing.
2014-12-09 07:10:25 -05:00
Beman
439207b388
Add conversion_use_case
2014-12-05 09:01:59 -05:00
Beman
e2045b7ffa
Finalize buffer and arithmetic decomposition. Finalize name changes. Finalize test cases. Remove cruft. Docs still to do.
2014-11-26 10:04:33 -05:00
Beman
bb785ed8e0
UDT tests added. Passing on Windows, all local compilers.
2014-11-25 11:31:30 -05:00
Beman
7b119ba0ee
Add full set of modify in place tests.
2014-11-25 09:58:59 -05:00
Beman
56103a7bc6
Finish conversion.hpp cleanup after name changes. conversion_test.cpp return-by-value tests reorganized and passing. UTD and in-place tests still to come. Add doc/bikeshed.txt to keep record of naming rationale.
2014-11-24 10:04:23 -05:00
Beman
4197f996ac
More conversion.hpp fixes. Some, but not all, conversion_test tests passing.
2014-11-23 10:38:21 -05:00
Beman
fc7733ade1
Major renaming. Class "endian" becomes class "endian_arithmetic" to mimic the C++ standard's description of such types as "arithmetic types". Rename header accordingly. The convenience typedefs have been changed shorten aligned names, as they are often being, but keeping the unaligned type names relatively short via a simple "_ut" suffix.
2014-11-19 10:53:11 -05:00
Beman
61d9046348
Remove "operator value_type() const noexcept" from buffers. Make the buffer ctor explicit. Buffers were requested by people who do not want automatic conversions because they want full control over conversions, and are very concerned about "efficiency".
...
Add "operator value_type() const noexcept" to the endian arithmetic types. These types are used by people who do want fully automatic conversions. The arithmetic types need to be drop-in replacements for the built-in arithmetic types for these users.
2014-11-18 14:33:31 -05:00
Beman
221ad3c585
Add use_cases.cpp
2014-11-18 10:05:45 -05:00
Beman
e9f6d2c37c
Re-implement the endian types by inheriting from endian_buffer.
2014-11-15 21:04:19 -05:00
Beman
561d8f7070
Initial commit buffers.hpp and related infrastructure. A separate buffer class without arithmetic operators was requested during the formal review.
2014-11-15 08:02:08 -05:00
Beman
f8e60ae4e9
Switch to VC++ 2014, and clear a resulting shadow warning.
2014-11-14 14:23:36 -05:00
Beman
fd1ab6daff
Add additional ambiguity detection.
2014-11-13 13:10:57 -05:00
Beman
c41521cead
For the endian types, add stream inserters and extractors as requested during the formal review.
2014-11-11 21:08:08 -05:00
Beman
72a9095a03
Fix tests that were backwards on big endian machines. Thanks to Lars Viklund for testing on three different big-endian systems.
2014-08-15 18:07:12 -04:00
Beman
e609015dd6
Some IDE generated files and directories violate boost guidelines, so ignore.
2014-08-15 12:01:05 -04:00
Beman
ea44132749
Add native float tests.
2014-08-13 14:02:09 -04:00
Beman
f2dad97c44
Upgrade to msvc 2013. Rename msvc2012 to msvc so directory doesn't have to be renamed each msvc release.
2014-08-11 10:01:24 -04:00
Beman
8c36890e77
Test and doc updates for Pierre Talbot's int8_t/uint8_t reverse_value() and templated reverse() patch.
2014-04-16 13:52:24 -04:00
Beman
d339470e6e
Remove "explicit" from Endian type constructors. Rationale: Having to write "cntr.insert(big_int32_t(value))" instead of "cntr.insert(value)" gets old fast when you are writing application code and the use case arises more or less continuously. Additionally, the use of an endian type is an implementation detail that should not leak into the application code that needs to create values of the type. Furthermore, the ambiguities that caused the constructors to be made explicit no longer occur; they were eliminated when BOOST_MINIMAL_INTEGER_COVER_OPERATORS was introduced to removed a dependency on boost/operators.hpp. If an ambiguity does arise, it is easy to clear via a static_cast or a function-style cast.
2013-09-06 10:36:54 -04:00
Beman
016d3b2e7c
Rename the endian typedefs. Rationale: Subjective - during three months working on the B-tree library, the *un_t names were a constant source of irritation. Objective - the new scheme, which reverts the *un_t names to having no alignment decoration, provides consistent *_align* decoration for both FP and integer types. Also, the library now provides conversion functions which may reduce use of aligned endian types.
2013-09-01 08:40:32 -04:00
Beman
a40d580782
Get 64-bit builds working. Update timings to reflect 64-bit build.
2013-06-06 08:00:28 -04:00
Beman
74b122c581
Alignment of 64-bit integers on a 32-bit system may be to a 32-bit boundary!
2013-05-30 10:07:16 -04:00
Beman
cd985897e6
By default use a shorter test, but add coverage of the aligned types.
2013-05-30 09:19:42 -04:00
Beman
30c44461f6
Only do relational tests if signedness is the same, to quiet GCC warnings. Start using lightweight test.
2013-05-30 08:57:09 -04:00
Beman
db3864b3d4
Fix boo boos detected by inspect program.
2013-05-29 09:40:35 -04:00
Beman
9c25d54d38
Finalize index.html discussion.
2013-05-28 09:42:04 -04:00
Beman
a55a44c67b
Loop test time work in progress.
2013-05-28 07:37:52 -04:00
Beman
50b5488997
loop_time_test current work-in-progress
2013-05-27 08:53:18 -04:00
Beman
32b04869e8
Initial commit loop_time_test.cpp and its infrastructure.
2013-05-27 07:44:29 -04:00
Beman
7f9d91e6d2
Rename unaligned integers to fit the floating point pattern. Unifies the naming pattern, deliberately makes the unaligned type names a bit uglier.
2013-05-26 12:05:33 -04:00
Beman
dff7c1254e
Add unaligned floating point types and supporting infrastructure.
2013-05-26 08:25:10 -04:00
Beman
a7ba65f830
Implement, test, float and double endian types.
2013-05-25 12:16:32 -04:00
Beman
f8f8d90b1f
Eliminate addition as not adding any useful information.
2013-05-24 13:22:48 -04:00
Beman
77520edff1
Change speed_test.cpp output to HTML
2013-05-24 11:28:26 -04:00
Beman
2f85e370b6
Add 16 and 64 bit varieties
2013-05-23 10:19:56 -04:00
Beman
8f55000f6f
Finally getting useful speed_test results from both GCC and VC++
2013-05-23 10:11:29 -04:00
Beman
c7beb10785
Add alignment test cases for aligned endian types.
2013-05-22 08:46:56 -04:00
Beman
6f84684e9e
Add separate big and little specializations for aligned case; the attempt to combine into a single specialization was selecting the unaligned specialization. Rework speed_test to try to get more meaningful results and cover more test cases.
2013-05-22 08:14:51 -04:00
Beman
4d6f7001fa
Create separate synopsis section
2013-05-21 08:38:24 -04:00
Beman
ddb5936b68
Yet another naming scheme for type synonyms. Aligned type names now exactly follow the <cstdint> pattern, while the unaligned names elide "int".
2013-05-21 07:56:27 -04:00
Beman
870b542456
Rename endian types to a scheme that mimics cstdint.hpp. Change test and example code accordingly.
2013-05-20 17:03:12 -04:00
Beman
f13a9cd6a4
Rename integers.hpp to types.hpp in case floating point is someday supported.
2013-05-20 09:07:01 -04:00
Beman
9089eb037b
Rename header converters.hpp back to conversion.hpp. Clean up infrastructure.
2013-05-18 16:14:30 -04:00
Beman
de91bcd571
Cleanup residue from prior changes.
2013-05-18 15:09:51 -04:00
Beman
c0fc4cdf8c
Somewhat more interesting results after redoing loop based on iteration count rather than time. Release builds particularly interesting.
2013-05-18 10:27:18 -04:00