svn commit: r441540 - head/graphics/gdal/files

Sunpoet Po-Chuan Hsieh sunpoet at FreeBSD.org
Tue May 23 18:51:55 UTC 2017


Author: sunpoet
Date: Tue May 23 18:51:54 2017
New Revision: 441540
URL: https://svnweb.freebsd.org/changeset/ports/441540

Log:
  Fix build on i386
  
  Obtained from:	https://github.com/nextgis-borsch/lib_opencad/commit/f40ce46804f1612fbeb035d0be5a746105cfc17e
  Thanks to:	wen

Added:
  head/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-cadheader.cpp   (contents, props changed)
  head/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-cadheader.h   (contents, props changed)
  head/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-opencad.h   (contents, props changed)

Added: head/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-cadheader.cpp
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-cadheader.cpp	Tue May 23 18:51:54 2017	(r441540)
@@ -0,0 +1,81 @@
+Obtained from:	https://github.com/nextgis-borsch/lib_opencad/commit/f40ce46804f1612fbeb035d0be5a746105cfc17e
+
+--- ogr/ogrsf_frmts/cad/libopencad/cadheader.cpp.orig	2017-04-28 16:07:33 UTC
++++ ogr/ogrsf_frmts/cad/libopencad/cadheader.cpp
+@@ -310,14 +310,22 @@ CADVariant::CADVariant( const string& va
+ {
+ }
+ 
+-CADVariant::CADVariant( time_t val ) :
++CADVariant::CADVariant( long julianday, long milliseconds ) :
+     type        ( DataType::DATETIME ),
+     decimalVal  ( 0 ),
+     xVal        ( 0 ),
+     yVal        ( 0 ),
+-    zVal        ( 0 ),
+-    dateTimeVal ( val )
++    zVal        ( 0 )
+ {
++    // unix -> julian        return ( unixSecs / 86400.0 ) + 2440587.5;
++    // julian -> unix        return (julian - 2440587.5) * 86400.0
++
++    double dfSeconds = double( milliseconds ) / 1000;
++    double dfUnix = 0;
++    if(julianday != 0)
++        dfUnix = ( double( julianday ) - 2440587.5 ) * 86400.0;
++    dateTimeVal = static_cast<time_t>( dfUnix + dfSeconds );
++
+     char str_buff[256];
+     strftime(str_buff, 255, "%Y-%m-%d %H:%M:%S", localtime(&dateTimeVal));
+     stringVal = str_buff;
+@@ -335,33 +343,6 @@ CADVariant::CADVariant( const CADHandle&
+ {
+ }
+ 
+-CADVariant::CADVariant( const CADVariant& orig ) :
+-    type        ( orig.type ),
+-    decimalVal  ( orig.decimalVal ),
+-    xVal        ( orig.xVal ),
+-    yVal        ( orig.yVal ),
+-    zVal        ( orig.zVal ),
+-    stringVal   ( orig.stringVal ),
+-    handleVal   ( orig.handleVal ),
+-    dateTimeVal ( orig.dateTimeVal )
+-{
+-}
+-
+-CADVariant& CADVariant::operator=( const CADVariant& orig )
+-{
+-    if( this == & orig )
+-        return * this;
+-    type        = orig.type;
+-    stringVal   = orig.stringVal;
+-    decimalVal  = orig.decimalVal;
+-    xVal        = orig.xVal;
+-    yVal        = orig.yVal;
+-    zVal        = orig.zVal;
+-    handleVal   = orig.handleVal;
+-    dateTimeVal = orig.dateTimeVal;
+-    return * this;
+-}
+-
+ long CADVariant::getDecimal() const
+ {
+     return decimalVal;
+@@ -461,15 +442,7 @@ int CADHeader::addValue( short code, dou
+ 
+ int CADHeader::addValue( short code, long julianday, long milliseconds )
+ {
+-    // unix -> julian        return ( unixSecs / 86400.0 ) + 2440587.5;
+-    // julian -> unix        return (julian - 2440587.5) * 86400.0
+-
+-    double dfSeconds = double( milliseconds ) / 1000;
+-    double dfUnix = 0;
+-    if(julianday != 0)
+-        dfUnix = ( double( julianday ) - 2440587.5 ) * 86400.0;
+-    time_t fullSeconds = static_cast<time_t>( dfUnix + dfSeconds );
+-    return addValue( code, CADVariant( fullSeconds ) );
++    return addValue( code, CADVariant( julianday, milliseconds ) );
+ }
+ 
+ int CADHeader::getGroupCode( short code )

Added: head/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-cadheader.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-cadheader.h	Tue May 23 18:51:54 2017	(r441540)
@@ -0,0 +1,17 @@
+Obtained from:	https://github.com/nextgis-borsch/lib_opencad/commit/f40ce46804f1612fbeb035d0be5a746105cfc17e
+
+--- ogr/ogrsf_frmts/cad/libopencad/cadheader.h.orig	2017-04-28 16:07:33 UTC
++++ ogr/ogrsf_frmts/cad/libopencad/cadheader.h
+@@ -79,10 +79,8 @@ public:
+     // cppcheck-suppress noExplicitConstructor
+     CADVariant( const std::string& val );
+     // cppcheck-suppress noExplicitConstructor
+-    CADVariant( time_t val );
+-public:
+-    CADVariant( const CADVariant& orig );
+-    CADVariant& operator=( const CADVariant& orig );
++    CADVariant( long julianday, long milliseconds );
++
+ public:
+     long                getDecimal() const;
+     double              getReal() const;

Added: head/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-opencad.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/gdal/files/patch-ogr-ogrsf_frmts-cad-libopencad-opencad.h	Tue May 23 18:51:54 2017	(r441540)
@@ -0,0 +1,17 @@
+Obtained from:	https://github.com/nextgis-borsch/lib_opencad/commit/f40ce46804f1612fbeb035d0be5a746105cfc17e
+
+--- ogr/ogrsf_frmts/cad/libopencad/opencad.h.orig	2017-04-28 16:07:33 UTC
++++ ogr/ogrsf_frmts/cad/libopencad/opencad.h
+@@ -31,10 +31,10 @@
+ #ifndef OPENCAD_H
+ #define OPENCAD_H
+ 
+-#define OCAD_VERSION    "0.3.2"
++#define OCAD_VERSION    "0.3.3"
+ #define OCAD_VERSION_MAJOR 0
+ #define OCAD_VERSION_MINOR 3
+-#define OCAD_VERSION_REV   2
++#define OCAD_VERSION_REV   3
+ 
+ #ifndef OCAD_COMPUTE_VERSION
+ #define OCAD_COMPUTE_VERSION(maj,min,rev) ((maj)*10000+(min)*100+rev) // maj - any, min < 99, rev < 99


More information about the svn-ports-all mailing list