Skip to content

Commit

Permalink
Resolve issue #2 and issue #3. Remove dead code. Remove unused files …
Browse files Browse the repository at this point in the history
…that will not be part of uint128 library. Refactor name violations.
  • Loading branch information
cpsusie committed Dec 30, 2020
1 parent d8340b5 commit 5d3373b
Show file tree
Hide file tree
Showing 15 changed files with 295 additions and 2,843 deletions.
5 changes: 0 additions & 5 deletions cpp/src/WinInt128/WinInt128.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -178,20 +178,15 @@
<ClCompile Include="..\cpp\uint128.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\headers\boost_uint_compare_test.hpp" />
<ClInclude Include="..\headers\cjm_numeric_concepts.hpp" />
<ClInclude Include="..\headers\cjm_string.hpp" />
<ClInclude Include="..\headers\fixed_uint.hpp" />
<ClInclude Include="..\headers\int128_tests.hpp" />
<ClInclude Include="..\headers\numerics.hpp" />
<ClInclude Include="..\headers\streams.hpp" />
<ClInclude Include="..\headers\testing.hpp" />
<ClInclude Include="..\headers\uint128.hpp" />
</ItemGroup>
<ItemGroup>
<None Include="..\asm\asmops.asm" />
<None Include="..\headers\cjm_string.inl" />
<None Include="..\headers\fixed_uint.inl" />
<None Include="..\headers\numerics.inl" />
<None Include="..\headers\uint128.inl" />
</ItemGroup>
Expand Down
15 changes: 0 additions & 15 deletions cpp/src/WinInt128/WinInt128.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,18 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\headers\boost_uint_compare_test.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\headers\cjm_numeric_concepts.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\headers\cjm_string.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\headers\fixed_uint.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\headers\int128_tests.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\headers\numerics.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\headers\streams.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\headers\testing.hpp">
<Filter>Header Files</Filter>
</ClInclude>
Expand All @@ -61,18 +52,12 @@
<None Include="..\headers\cjm_string.inl">
<Filter>Header Files</Filter>
</None>
<None Include="..\headers\fixed_uint.inl">
<Filter>Header Files</Filter>
</None>
<None Include="..\headers\numerics.inl">
<Filter>Header Files</Filter>
</None>
<None Include="..\headers\uint128.inl">
<Filter>Header Files</Filter>
</None>
<None Include="..\asm\asmops.asm">
<Filter>Source Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Text Include="..\cpp\llvm_int_typedefs.txt">
Expand Down
5 changes: 4 additions & 1 deletion cpp/src/cpp/int128_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,14 @@ cjm::uint128_tests::uint128_t cjm::uint128_tests::to_test(const ctrl_uint128_t&
{
std::uint64_t low_part = static_cast<std::uint64_t>(convert);
std::uint64_t high_part = static_cast<std::uint64_t>(convert >> 64);
return uint128_t::MakeUint128(high_part, low_part);
return uint128_t::make_uint128(high_part, low_part);
}

void cjm::uint128_tests::execute_uint128_tests()
{
constexpr auto two_fifty_five = 0xff_u128;
constexpr auto all_at_ends = 0xff00'0000'0000'0000'0000'0000'0000'0000_u128;
static_assert(((two_fifty_five << (15 * 8)) == all_at_ends) && ((all_at_ends >> (15 * 8)) == two_fifty_five));
print_uint128_eval_mode();
execute_test(execute_basic_test_one, "basic_test_one"sv);
execute_test(execute_string_parse_test, "string_parse_text"sv);
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/cpp/uint128.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void cjm::numerics::uint128::instrumented_div_mod(std::basic_ostream<char>& stre
stream << "divisor: 0x" << divisor << newl;

auto denominator = divisor;
auto quotient = MakeUint128(0, 0);
auto quotient = make_uint128(0, 0);

stream << "denominator: 0x" << denominator << newl;
stream << "quotient: 0x" << quotient << newl;
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/headers/cjm_numeric_concepts.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace cjm::numerics::concepts
/// 3- be trivially copyable
/// </summary>
template<typename To, typename From>
concept bit_castable = sizeof(To) == sizeof(From) && alignof(To) == alignof(From)
concept bit_castable = sizeof(To) == sizeof(From)
&& std::is_trivially_copyable_v<To> && std::is_trivially_copyable_v<From> && !std::is_polymorphic_v<To> && !std::is_polymorphic_v<From> && std::is_nothrow_default_constructible_v<To> && std::is_nothrow_default_constructible_v<From>;


Expand Down
9 changes: 6 additions & 3 deletions cpp/src/headers/cjm_string.hpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#ifndef cjm_string_hpp
#define cjm_string_hpp
#ifndef CJM_STRING_HPP_
#define CJM_STRING_HPP_
#include <iostream>
#include <iomanip>
#include <string>
#include <string_view>
#include <sstream>
#include <algorithm>
#include <locale>
#include "cjm_numeric_concepts.hpp"
namespace cjm::string
Expand Down Expand Up @@ -59,5 +62,5 @@ namespace cjm::string

}
#include "cjm_string.inl"
#endif // ! cjm_string_hpp
#endif // ! CJM_STRING_HPP_

7 changes: 3 additions & 4 deletions cpp/src/headers/cjm_string.inl
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#ifndef cjm_string_inl
#define cjm_string_inl
#include <algorithm>
#include <locale>
#ifndef CJM_STRING_INL_
#define CJM_STRING_INL_

#include "cjm_string.hpp"

template<typename Char, typename CharTraits, typename Allocator>
Expand Down
Loading

0 comments on commit 5d3373b

Please sign in to comment.