Преглед на файлове

Fix data type issues for MSVC

Moritz Wanzenböck преди 6 години
родител
ревизия
fde64aa339
променени са 5 файла, в които са добавени 32 реда и са изтрити 32 реда
  1. 9 9
      include/hdf4cpp/HdfAttribute.h
  2. 5 5
      include/hdf4cpp/HdfAttribute_priv.h
  3. 9 9
      include/hdf4cpp/HdfItem.h
  4. 5 5
      lib/HdfAttribute.cpp
  5. 4 4
      lib/HdfItem.cpp

+ 9 - 9
include/hdf4cpp/HdfAttribute.h

@@ -28,7 +28,7 @@ class HdfAttribute : public HdfObject {
         }
 
         /// \returns The number of existing data in the attribute
-        virtual intn size() const = 0;
+        virtual int32 size() const = 0;
 
         /// \returns The data type number of the data held by the attribute
         virtual int32 getDataType() const = 0;
@@ -48,10 +48,10 @@ class HdfAttribute : public HdfObject {
       public:
         HdfDatasetAttribute(int32 id, const std::string &name, const HdfDestroyerChain &chain);
 
-        intn size() const;
+        int32 size() const;
 
       private:
-        intn _size;
+        int32 _size;
         int32 dataType;
 
         void get(void *dest);
@@ -63,10 +63,10 @@ class HdfAttribute : public HdfObject {
       public:
         HdfGroupAttribute(int32 id, const std::string &name, const HdfDestroyerChain &chain);
 
-        intn size() const;
+        int32 size() const;
 
       private:
-        intn _size;
+        int32 _size;
         int32 dataType;
 
         void get(void *dest);
@@ -78,10 +78,10 @@ class HdfAttribute : public HdfObject {
       public:
         HdfDataAttribute(int32 id, const std::string &name, const HdfDestroyerChain &chain);
 
-        intn size() const;
+        int32 size() const;
 
       private:
-        intn _size;
+        int32 _size;
         int32 dataType;
         void get(void *dest);
         int32 getDataType() const;
@@ -93,12 +93,12 @@ class HdfAttribute : public HdfObject {
     HdfAttribute &operator=(const HdfAttribute &attribute) = delete;
     HdfAttribute &operator=(HdfAttribute &&attribute);
     /// \returns the number of elements of the attribute data
-    intn size() const;
+    int32 size() const;
 
     /// Reads the data from the attribute
     /// \param dest the vector in which the data will be stored
     template <class T> void get(std::vector<T> &dest) {
-        intn length = size();
+        int32 length = size();
         auto it = typeSizeMap.find(getDataType());
         if (it != typeSizeMap.end()) {
             if ((size_t)it->second != sizeof(T)) {

+ 5 - 5
include/hdf4cpp/HdfAttribute_priv.h

@@ -32,7 +32,7 @@ class HdfAttribute::HdfAttributeBase : public HdfObject {
     virtual ~HdfAttributeBase() {}
 
     /// \returns The number of existing data in the attribute
-    virtual intn size() const = 0;
+    virtual int32 size() const = 0;
 
     /// \returns The data type number of the data held by the attribute
     virtual int32 getDataType() const = 0;
@@ -51,7 +51,7 @@ class HdfAttribute::HdfDatasetAttribute : public HdfAttributeBase {
 public:
     HdfDatasetAttribute(int32 id, const std::string& name, const HdfDestroyerChain& chain);
 
-    intn size() const;
+    int32 size() const;
 
 private:
     int32 _size;
@@ -66,10 +66,10 @@ class HdfAttribute::HdfGroupAttribute : public HdfAttributeBase {
 public:
     HdfGroupAttribute(int32 id, const std::string& name, const HdfDestroyerChain& chain);
 
-    intn size() const;
+    int32 size() const;
 
 private:
-    intn _size;
+    int32 _size;
     int32 dataType;
 
     void get(void *dest);
@@ -81,7 +81,7 @@ class HdfAttribute::HdfDataAttribute : public HdfAttributeBase {
 public:
     HdfDataAttribute(int32 id, const std::string& name, const HdfDestroyerChain& chain);
 
-    intn size() const;
+    int32 size() const;
 
 private:
     int32 _size;

+ 9 - 9
include/hdf4cpp/HdfItem.h

@@ -35,7 +35,7 @@ struct Range {
     }
 
     /// What would be the number of data to read, if we read in this range
-    intn size() const {
+    int32 size() const {
         if (!stride) {
             return 0;
         }
@@ -73,7 +73,7 @@ class HdfItem : public HdfObject {
     std::vector<int32> getDims();
 
     /// \returns The number of data being in the item
-    intn size() const;
+    int32 size() const;
 
     /// \returns the attribute of the item with the given name
     /// \param name the name of the attribute
@@ -156,7 +156,7 @@ class HdfItem : public HdfObject {
         /// Get the dimensions of the item
         virtual std::vector<int32> getDims() = 0;
         /// Get the number of data from the item
-        virtual intn size() const = 0;
+        virtual int32 size() const = 0;
         /// Get the attribute from the item given by its name
         virtual HdfAttribute getAttribute(const std::string &name) const = 0;
 
@@ -174,7 +174,7 @@ class HdfItem : public HdfObject {
         int32 getId() const;
         std::string getName() const;
         std::vector<int32> getDims();
-        intn size() const;
+        int32 size() const;
         HdfAttribute getAttribute(const std::string &name) const;
 
         /// Reads the data in a specific range. See Range
@@ -183,7 +183,7 @@ class HdfItem : public HdfObject {
         template <class T> void read(std::vector<T> &dest, std::vector<Range> &ranges) {
             std::vector<int32> dims = getDims();
             Range::fill(ranges, dims);
-            intn length = 1;
+            int32 length = 1;
             for (size_t i = 0; i < ranges.size(); ++i) {
                 if (!ranges[i].check(dims[i])) {
                     raiseException(INVALID_RANGES);
@@ -223,7 +223,7 @@ class HdfItem : public HdfObject {
         }
 
       private:
-        intn _size;
+        int32 _size;
         int32 dataType;
         std::string name;
         std::vector<int32> dims;
@@ -239,7 +239,7 @@ class HdfItem : public HdfObject {
         int32 getId() const;
         std::string getName() const;
         std::vector<int32> getDims();
-        intn size() const;
+        int32 size() const;
 
         HdfAttribute getAttribute(const std::string &name) const;
 
@@ -261,7 +261,7 @@ class HdfItem : public HdfObject {
 
         std::vector<int32> getDims();
 
-        intn size() const;
+        int32 size() const;
 
         HdfAttribute getAttribute(const std::string &name) const;
 
@@ -347,7 +347,7 @@ class HdfItem : public HdfObject {
         }
 
       private:
-        intn _size;
+        int32 _size;
         std::string name;
 
         int32 nrRecords;

+ 5 - 5
lib/HdfAttribute.cpp

@@ -17,7 +17,7 @@ hdf4cpp::HdfAttribute::HdfDatasetAttribute::HdfDatasetAttribute(int32 id,
         raiseException(STATUS_RETURN_FAIL);
     }
 }
-intn hdf4cpp::HdfAttribute::HdfDatasetAttribute::size() const {
+int32 hdf4cpp::HdfAttribute::HdfDatasetAttribute::size() const {
     return _size;
 }
 int32 hdf4cpp::HdfAttribute::HdfDatasetAttribute::getDataType() const {
@@ -39,7 +39,7 @@ hdf4cpp::HdfAttribute::HdfGroupAttribute::HdfGroupAttribute(int32 id,
                                                             const std::string &name,
                                                             const HdfDestroyerChain &chain)
     : HdfAttributeBase(id, 0, VGROUP, chain) {
-    int32 nrAtts = Vnattrs2(id);
+    intn nrAtts = Vnattrs2(id);
     for (intn i = 0; i < nrAtts; ++i) {
         char names[MAX_NAME_LENGTH];
         int32 type, count, size, nFields;
@@ -54,7 +54,7 @@ hdf4cpp::HdfAttribute::HdfGroupAttribute::HdfGroupAttribute(int32 id,
     }
     raiseException(INVALID_NAME);
 }
-intn hdf4cpp::HdfAttribute::HdfGroupAttribute::size() const {
+int32 hdf4cpp::HdfAttribute::HdfGroupAttribute::size() const {
     return _size;
 }
 int32 hdf4cpp::HdfAttribute::HdfGroupAttribute::getDataType() const {
@@ -73,7 +73,7 @@ hdf4cpp::HdfAttribute::HdfDataAttribute::HdfDataAttribute(int32 id,
         raiseException(STATUS_RETURN_FAIL);
     }
 }
-intn hdf4cpp::HdfAttribute::HdfDataAttribute::size() const {
+int32 hdf4cpp::HdfAttribute::HdfDataAttribute::size() const {
     return _size;
 }
 void hdf4cpp::HdfAttribute::HdfDataAttribute::get(void *dest) {
@@ -94,7 +94,7 @@ hdf4cpp::HdfAttribute &hdf4cpp::HdfAttribute::operator=(HdfAttribute &&attr) {
     setClassType(attribute->getClassType());
     return *this;
 }
-intn hdf4cpp::HdfAttribute::size() const {
+int32 hdf4cpp::HdfAttribute::size() const {
     return attribute->size();
 }
 HdfAttribute::HdfAttribute(HdfAttributeBase *attribute)

+ 4 - 4
lib/HdfItem.cpp

@@ -37,7 +37,7 @@ int32 hdf4cpp::HdfItem::HdfDatasetItem::getDataType() const {
 }
 hdf4cpp::HdfItem::HdfDatasetItem::~HdfDatasetItem() {
 }
-intn hdf4cpp::HdfItem::HdfDatasetItem::size() const {
+int32 hdf4cpp::HdfItem::HdfDatasetItem::size() const {
     return _size;
 }
 hdf4cpp::HdfItem::HdfGroupItem::HdfGroupItem(int32 id, const HdfDestroyerChain &chain)
@@ -61,7 +61,7 @@ int32 hdf4cpp::HdfItem::HdfGroupItem::getId() const {
 }
 hdf4cpp::HdfItem::HdfGroupItem::~HdfGroupItem() {
 }
-intn hdf4cpp::HdfItem::HdfGroupItem::size() const {
+int32 hdf4cpp::HdfItem::HdfGroupItem::size() const {
     raiseException(INVALID_OPERATION);
 }
 int32 hdf4cpp::HdfItem::HdfGroupItem::getDataType() const {
@@ -88,7 +88,7 @@ std::string hdf4cpp::HdfItem::HdfDataItem::getName() const {
 std::vector<int32> hdf4cpp::HdfItem::HdfDataItem::getDims() {
     raiseException(INVALID_OPERATION);
 }
-intn hdf4cpp::HdfItem::HdfDataItem::size() const {
+int32 hdf4cpp::HdfItem::HdfDataItem::size() const {
     raiseException(INVALID_OPERATION);
 }
 int32 hdf4cpp::HdfItem::HdfDataItem::getDataType() const {
@@ -119,7 +119,7 @@ hdf4cpp::HdfAttribute hdf4cpp::HdfItem::getAttribute(const std::string &name) co
 std::string hdf4cpp::HdfItem::getName() const {
     return item->getName();
 }
-intn hdf4cpp::HdfItem::size() const {
+int32 hdf4cpp::HdfItem::size() const {
     return item->size();
 }
 hdf4cpp::HdfItem::Iterator hdf4cpp::HdfItem::begin() const {