Use 32-bit timestamps for imported Eagle files

Fixes: lp:1754610
* https://bugs.launchpad.net/kicad/+bug/1754610
This commit is contained in:
Maciej Suminski 2018-03-09 14:27:02 +01:00
parent 3fcc84dde3
commit 30a78f00bc
2 changed files with 9 additions and 9 deletions

View File

@ -258,20 +258,20 @@ NODE_MAP MapChildren( wxXmlNode* aCurrentNode )
} }
unsigned long EagleTimeStamp( wxXmlNode* aTree ) unsigned int EagleTimeStamp( wxXmlNode* aTree )
{ {
// in this case from a unique tree memory location // in this case from a unique tree memory location
return (unsigned long)(void*) aTree; return (unsigned int) reinterpret_cast<uintptr_t>( aTree );
} }
time_t EagleModuleTstamp( const wxString& aName, const wxString& aValue, int aUnit ) unsigned int EagleModuleTstamp( const wxString& aName, const wxString& aValue, int aUnit )
{ {
std::size_t h1 = std::hash<wxString>{}( aName ); std::size_t h1 = std::hash<wxString>{}( aName );
std::size_t h2 = std::hash<wxString>{}( aValue ); std::size_t h2 = std::hash<wxString>{}( aValue );
std::size_t h3 = std::hash<int>{}( aUnit ); std::size_t h3 = std::hash<int>{}( aUnit );
return h1 ^ (h2 << 1) ^ (h3 << 2); return (unsigned int)( h1 ^ (h2 << 1) ^ (h3 << 2) );
} }

View File

@ -364,13 +364,13 @@ public:
*/ */
NODE_MAP MapChildren( wxXmlNode* aCurrentNode ); NODE_MAP MapChildren( wxXmlNode* aCurrentNode );
/// Make a unique time stamp ///> Make a unique time stamp
unsigned long EagleTimeStamp( wxXmlNode* aTree ); unsigned int EagleTimeStamp( wxXmlNode* aTree );
/// Computes module timestamp basing on its name, value and unit ///> Computes module timestamp basing on its name, value and unit
time_t EagleModuleTstamp( const wxString& aName, const wxString& aValue, int aUnit ); unsigned int EagleModuleTstamp( const wxString& aName, const wxString& aValue, int aUnit );
/// Convert an Eagle curve end to a KiCad center for S_ARC ///> Convert an Eagle curve end to a KiCad center for S_ARC
wxPoint ConvertArcCenter( const wxPoint& aStart, const wxPoint& aEnd, double aAngle ); wxPoint ConvertArcCenter( const wxPoint& aStart, const wxPoint& aEnd, double aAngle );
// Pre-declare for typedefs // Pre-declare for typedefs