Various updates and fixes

This commit is contained in:
Torsten Kurbad
2024-11-05 12:51:21 +01:00
parent 1b59ab7cfc
commit 430bf5360d
22 changed files with 1445 additions and 0 deletions
@@ -0,0 +1,49 @@
diff '--color=auto' -ur kicad-8.0.5.orig/3d-viewer/3d_cache/3d_cache.cpp kicad-8.0.5/3d-viewer/3d_cache/3d_cache.cpp
--- kicad-8.0.5.orig/3d-viewer/3d_cache/3d_cache.cpp 2024-09-06 18:28:40.000000000 +0200
+++ kicad-8.0.5/3d-viewer/3d_cache/3d_cache.cpp 2024-11-05 11:40:58.773367999 +0100
@@ -381,7 +381,13 @@
fclose( fp );
unsigned int digest[5];
- dblock.get_digest( digest );
+ // V8 only
+ // Boost 1.86 and later changed digest_type from uchar[20] from int[5]
+ // But KiCad 8.99 and later use MurmurHash3 here, so just do a fairly ugly cast to keep
+ // this going for another few months.
+ static_assert( sizeof( digest ) == sizeof( boost::uuids::detail::sha1::digest_type& ),
+ "SHA1 digest size mismatch" );
+ dblock.get_digest( reinterpret_cast<boost::uuids::detail::sha1::digest_type&>( digest ) );
// ensure MSB order
for( int i = 0; i < 5; ++i )
diff '--color=auto' -ur kicad-8.0.5.orig/common/kiid.cpp kicad-8.0.5/common/kiid.cpp
--- kicad-8.0.5.orig/common/kiid.cpp 2024-09-06 18:28:40.000000000 +0200
+++ kicad-8.0.5/common/kiid.cpp 2024-11-05 11:40:49.030394379 +0100
@@ -25,9 +25,9 @@
#include <kiid.h>
+#include <boost/random/mersenne_twister.hpp>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
-#include <boost/functional/hash.hpp>
#if BOOST_VERSION >= 106700
#include <boost/uuid/entropy_error.hpp>
@@ -235,15 +235,7 @@
size_t KIID::Hash() const
{
- size_t hash = 0;
-
- // Note: this is NOT little-endian/big-endian safe, but as long as it's just used
- // at runtime it won't matter.
-
- for( int i = 0; i < 4; ++i )
- boost::hash_combine( hash, reinterpret_cast<const uint32_t*>( m_uuid.data )[i] );
-
- return hash;
+ return boost::uuids::hash_value( m_uuid );
}
@@ -0,0 +1,27 @@
diff '--color=auto' -ur kicad-8.0.5.orig/kicad/project_tree_pane.cpp kicad-8.0.5/kicad/project_tree_pane.cpp
--- kicad-8.0.5.orig/kicad/project_tree_pane.cpp 2024-09-06 18:28:40.000000000 +0200
+++ kicad-8.0.5/kicad/project_tree_pane.cpp 2024-11-05 12:20:14.524026741 +0100
@@ -2240,12 +2240,19 @@
}
git_oid oid;
- // Check if the libgit2 library version is 1.8.0 or higher
-#if( LIBGIT2_VER_MAJOR > 1 ) || ( LIBGIT2_VER_MAJOR == 1 && LIBGIT2_VER_MINOR >= 8 )
- // For libgit2 version 1.8.0 and above
+
+#if ( ( LIBGIT2_VER_MAJOR == 1 \
+ && ( ( LIBGIT2_VER_MINOR == 8 \
+ && ( LIBGIT2_VER_REVISION < 2 || LIBGIT2_VER_REVISION == 3 ) ) \
+ || ( LIBGIT2_VER_MINOR > 8 ) ) ) \
+ || LIBGIT2_VER_MAJOR > 1 )
+ // For libgit2 versions 1.8.0, 1.8.1.
+ // This change was reverted for 1.8.2
+ // This change was re-reverted for 1.8.3
+ // This change was re-re-reverted for 1.8.4+
git_commit* const parents[1] = { parent };
#else
- // For libgit2 versions older than 1.8.0
+ // For libgit2 versions older than 1.8.0, or equal to 1.8.2/1.8.4
const git_commit* parents[1] = { parent };
#endif