Changeset 1735
- Timestamp:
- 06/11/11 10:42:45 (7 months ago)
- Location:
- trunk
- Files:
-
- 12 edited
-
CMakeLists.txt (modified) (2 diffs)
-
Windows_extra/libNeXus-0-x64.def (modified) (1 diff)
-
bindings/cpp/CMakeLists.txt (modified) (2 diffs)
-
bindings/cpp/NeXusFile.cpp (modified) (5 diffs)
-
bindings/cpp/NeXusFile.hpp (modified) (1 diff)
-
include/napi.h (modified) (2 diffs)
-
src/CMakeLists.txt (modified) (3 diffs)
-
src/napi.c (modified) (8 diffs)
-
src/napi4.c (modified) (1 diff)
-
src/napi5.c (modified) (4 diffs)
-
src/nxstack.c (modified) (3 diffs)
-
src/nxxml.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/CMakeLists.txt
r1727 r1735 134 134 135 135 if (HDF5_FOUND) 136 set (HDF5_CPP "-DHDF5 -DH5_USE_16_API") 136 # set (HDF5_CPP "-DHDF5 -DH5_USE_16_API") 137 set (HDF5_CPP "-DHDF5 -DH5_NO_DEPRECATED_SYMBOLS -DH5Acreate_vers=2 -DH5Aiterate_vers=2 -DH5Dcreate_vers=2 -DH5Dopen_vers=2 -DH5Eclear_vers=2 -DH5Eprint_vers=2 -DH5Epush_vers=2 -DH5Eset_auto_vers=2 -DH5Eget_auto_vers=2 -DH5Ewalk_vers=2 -DH5Gcreate_vers=2 -DH5Gopen_vers=2 -DH5Pget_filter_vers=2 -DH5Pget_filter_by_id_vers=2 -DH5Pinsert_vers=2 -DH5Pregister_vers=2 -DH5Rget_obj_type_vers=2 -DH5Tarray_create_vers=2 -DH5Tcommit_vers=2 -DH5Tget_array_dims_vers=2 -DH5Topen_vers=2") 137 138 endif (HDF5_FOUND) 138 139 … … 234 235 235 236 file(WRITE ${CMAKE_SOURCE_DIR}/include/nxconfig.h "/*A dummy config*/") 237 238 # warning 4820 is byte padding in structures 239 # warning 4996 is about using _strdup ratherthan strdup etc 240 # /W4 rather than /Wall 241 set(NX_CFLAGS "/W4 /wd4820 /wd4996") 242 set(NX_CPP -D_CRT_SECURE_NO_WARNINGS) 236 243 237 244 # Recurse into the subdirectories. -
trunk/Windows_extra/libNeXus-0-x64.def
r1674 r1735 76 76 putNXDatasetValueAt 77 77 nxigetpath_ 78 nxilinkexternaldataset_ 79 nxiisexternaldataset_ -
trunk/bindings/cpp/CMakeLists.txt
r1674 r1735 27 27 #==================================================================== 28 28 29 add_definitions(-DIN_NEXUS_CPP_LIBRARY=1 )29 add_definitions(-DIN_NEXUS_CPP_LIBRARY=1 ${NX_CPP}) 30 30 31 31 #Make NeXus CPP Bindings Static Library … … 33 33 set (HEADERS NeXusFile.hpp NeXusException.hpp NeXusStream.hpp) 34 34 set (SOURCES NeXusFile.hpp NeXusFile.cpp NeXusException.hpp NeXusException.cpp NeXusStream.hpp NeXusStream.cpp) 35 36 set_property(SOURCE ${SOURCES} APPEND PROPERTY COMPILE_FLAGS ${NX_CFLAGS}) 35 37 36 38 add_library (NeXus_CPP_Static_Library STATIC ${HEADERS} ${SOURCES}) -
trunk/bindings/cpp/NeXusFile.cpp
r1732 r1735 144 144 145 145 static void inner_malloc(void* & data, const std::vector<int64_t>& dims, NXnumtype type) { 146 size_t rank = dims.size();146 int rank = dims.size(); 147 147 int64_t c_dims[NX_MAXRANK]; 148 148 for (size_t i = 0; i < rank; i++) { … … 363 363 template <typename NumT> 364 364 void File::writeData(const string& name, const vector<NumT>& value) { 365 vector<int > dims(1, value.size());365 vector<int64_t> dims(1, value.size()); 366 366 this->writeData(name, value, dims); 367 367 } … … 375 375 } 376 376 377 template <typename NumT> 378 void File::writeData(const string& name, const vector<NumT>& value, 379 const vector<int64_t>& dims) { 380 this->makeData(name, getType<NumT>(), dims, true); 381 this->putData(value); 382 this->closeData(); 383 } 377 384 378 385 … … 642 649 template <typename NumT> 643 650 void File::putSlab(vector<NumT>& data, int64_t start, int64_t size) { 644 vector<int > start_v;651 vector<int64_t> start_v; 645 652 start_v.push_back(start); 646 vector<int > size_v;653 vector<int64_t> size_v; 647 654 size_v.push_back(size); 648 655 this->putSlab(data, start_v, size_v); … … 1012 1019 1013 1020 int rank = start.size(); 1014 int i_start[NX_MAXRANK]; 1015 for (int i = 0; i < rank; i++) { 1016 i_start[i] = start[i]; 1017 } 1018 int i_size[NX_MAXRANK]; 1019 for (int i = 0; i < rank; i++) { 1020 i_size[i] = size[i]; 1021 } 1022 1023 NXstatus status = NXgetslab(this->m_file_id, data, i_start, i_size); 1021 1022 NXstatus status = NXgetslab64(this->m_file_id, data, &(start[0]), &(size[0])); 1024 1023 if (status != NX_OK) { 1025 1024 throw Exception("NXgetslab failed", status); -
trunk/bindings/cpp/NeXusFile.hpp
r1732 r1735 332 332 const std::vector<int>& dims); 333 333 334 /** 335 * Create a n-dimension data field, insert the data, and close the data. 336 * 337 * \param name The name of the field to create. 338 * \param value The data to put into the file. 339 * \param dims The dimensions of the data. 340 * \tparam NumT numeric data type of \a value 341 */ 342 template <typename NumT> 343 void writeData(const std::string& name, const std::vector<NumT>& value, 344 const std::vector<int64_t>& dims); 334 345 335 346 /** Create a 1D data field with an unlimited dimension, insert the data, and close the data. -
trunk/include/napi.h
r1734 r1735 600 600 * @copydoc NXgetslab() 601 601 */ 602 extern NXstatus NXgetslab64(NXhandle handle, void* data, int64_t start[],int64_t size[]);602 extern NXstatus NXgetslab64(NXhandle handle, void* data, const int64_t start[], const int64_t size[]); 603 603 604 604 /** … … 907 907 NXstatus ( *nxgetinfo64)(NXhandle handle, int* rank, int64_t dimension[], int* datatype); 908 908 NXstatus ( *nxgetnextentry)(NXhandle handle, NXname name, NXname nxclass, int* datatype); 909 NXstatus ( *nxgetslab64)(NXhandle handle, void* data, int64_t start[],int64_t size[]);909 NXstatus ( *nxgetslab64)(NXhandle handle, void* data, const int64_t start[], const int64_t size[]); 910 910 NXstatus ( *nxgetnextattr)(NXhandle handle, NXname pName, int *iLength, int *iType); 911 911 NXstatus ( *nxgetattr)(NXhandle handle, char* name, void* data, int* iDataLen, int* iType); -
trunk/src/CMakeLists.txt
r1674 r1735 27 27 #==================================================================== 28 28 29 add_definitions(-DIN_NEXUS_LIBRARY ${HDF5_DEFINITIONS} ${HDF5_CPP} ${HDF4_CPP} ${MXML_CPP} )29 add_definitions(-DIN_NEXUS_LIBRARY ${HDF5_DEFINITIONS} ${HDF5_CPP} ${HDF4_CPP} ${MXML_CPP} ${NX_CPP}) 30 30 31 31 set (NAPISRC napi.c napiu.c nxstack.c nxstack.h stptok.c nxdataset.c nxdataset.h nx_stptok.h) … … 45 45 46 46 set (NAPISRC ${NAPISRC} nxxml.c nxio.c nxio.h) 47 48 set_property(SOURCE ${NAPISRC} APPEND PROPERTY COMPILE_FLAGS ${NX_CFLAGS}) 47 49 48 50 file(STRINGS ${PROJECT_SOURCE_DIR}/src/nexus_symbols.txt NEXUS_SYMBOLS) … … 66 68 # file(WRITE ${PROJECT_SOURCE_DIR}/src/nexus_symbols.sym ${NEXUS_SYMBOLS}) 67 69 #endif (MINGW_MSYS) 68 69 70 70 71 #Make NeXus Static Library -
trunk/src/napi.c
r1731 r1735 880 880 NXstatus NXputslab (NXhandle fid, void *data, int iStart[], int iSize[]) 881 881 { 882 int i, status,iType, rank;882 int i, iType, rank; 883 883 int64_t iStart64[NX_MAXRANK], iSize64[NX_MAXRANK]; 884 884 if (NXgetinfo64(fid, &rank, iStart64, &iType) != NX_OK) … … 961 961 int dimensions[], int datatype) 962 962 { 963 int i,status;963 int status; 964 964 int64_t* dims64 = dupDimsArray(dimensions, rank); 965 965 status = NXmalloc64(data, rank, dims64, datatype); … … 1041 1041 char *nxitrim(char *str) 1042 1042 { 1043 char *ibuf = str , *obuf = str;1044 int i = 0 , cnt = 0;1043 char *ibuf = str; 1044 int i = 0; 1045 1045 1046 1046 /* … … 1101 1101 int64_t dimension[], int *iType) 1102 1102 { 1103 char *pPtr = NULL;1104 1103 pNexusFunction pFunc = handleToNexusFunc(fid); 1105 1104 return LOCKED_CALL(pFunc->nxgetinfo64(pFunc->pNexusData, rank, dimension, iType)); … … 1110 1109 { 1111 1110 int i, status; 1112 char *pPtr = NULL;1113 1111 int64_t dims64[NX_MAXRANK]; 1114 1112 pNexusFunction pFunc = handleToNexusFunc(fid); … … 1164 1162 int iStart[], int iSize[]) 1165 1163 { 1166 int i, status,iType, rank;1164 int i, iType, rank; 1167 1165 int64_t iStart64[NX_MAXRANK], iSize64[NX_MAXRANK]; 1168 1166 if (NXgetinfo64(fid, &rank, iStart64, &iType) != NX_OK) … … 1179 1177 1180 1178 NXstatus NXgetslab64 (NXhandle fid, void *data, 1181 int64_t iStart[],int64_t iSize[])1179 const int64_t iStart[], const int64_t iSize[]) 1182 1180 { 1183 1181 pNexusFunction pFunc = handleToNexusFunc(fid); … … 1425 1423 char nxurl[1024], exfile[512], expath[512]; 1426 1424 pNexusFunction pFunc = handleToNexusFunc(fid); 1427 int 64_trank = 1;1425 int rank = 1; 1428 1426 int64_t dims[1] = {1}; 1429 1427 -
trunk/src/napi4.c
r1728 r1735 1618 1618 1619 1619 1620 NXstatus NX4getslab64 (NXhandle fid, void *data, int64_t iStart[],int64_t iSize[])1620 NXstatus NX4getslab64 (NXhandle fid, void *data, const int64_t iStart[], const int64_t iSize[]) 1621 1621 { 1622 1622 pNexusFile pFile; -
trunk/src/napi5.c
r1731 r1735 1784 1784 /*-------------------------------------------------------------------------*/ 1785 1785 1786 NXstatus NX5getslab64 (NXhandle fid, void *data, int64_t iStart[],int64_t iSize[])1786 NXstatus NX5getslab64 (NXhandle fid, void *data, const int64_t iStart[], const int64_t iSize[]) 1787 1787 { 1788 1788 pNexusFile5 pFile; … … 2032 2032 { 2033 2033 pNexusFile5 pFile; 2034 char *iname = NULL;2035 2034 hid_t idx; 2036 2035 int vid; … … 2128 2127 herr_t ret; 2129 2128 H5L_info_t link_buff; 2130 int size=1024; 2131 char linkval_buff[size]; 2129 char linkval_buff[1024]; 2132 2130 const char *filepath, *objpath; 2133 2131 … … 2139 2137 } 2140 2138 2141 ret = H5Lget_val(pFile->iFID, name, linkval_buff, size , H5P_DEFAULT);2139 ret = H5Lget_val(pFile->iFID, name, linkval_buff, sizeof(linkval_buff), H5P_DEFAULT); 2142 2140 if (ret < 0) { 2143 2141 return NX_ERROR; 2144 2142 } 2145 2143 2146 ret = H5Lunpack_elink_val(linkval_buff, size , 0, &filepath, &objpath);2144 ret = H5Lunpack_elink_val(linkval_buff, sizeof(linkval_buff), 0, &filepath, &objpath); 2147 2145 if (ret < 0 || link_buff.type != H5L_TYPE_EXTERNAL) { 2148 2146 return NX_ERROR; -
trunk/src/nxstack.c
r1636 r1735 71 71 /*----------------------------------------------------------------------*/ 72 72 void pushFileStack(pFileStack self, pNexusFunction pDriv, char *file){ 73 int length;73 size_t length; 74 74 75 75 self->fileStackPointer++; … … 123 123 /*-----------------------------------------------------------------------*/ 124 124 int buildPath(pFileStack self, char *path, int pathlen){ 125 int i, totalPathLength; 125 int i; 126 size_t totalPathLength; 126 127 char *totalPath; 127 128 … … 129 130 totalPathLength += strlen(self->pathStack[i]) + 1; 130 131 } 131 totalPath = malloc(totalPathLength*sizeof(char));132 totalPath = (char*)malloc(totalPathLength*sizeof(char)); 132 133 if(totalPath == NULL){ 133 134 return 0; -
trunk/src/nxxml.c
r1728 r1735 1146 1146 /*----------------------------------------------------------------------*/ 1147 1147 NXstatus NXXgetslab64 (NXhandle fid, void *data, 1148 int64_t iStart[],int64_t iSize[]){1148 const int64_t iStart[], const int64_t iSize[]){ 1149 1149 pXMLNexus xmlHandle = NULL; 1150 1150 mxml_node_t *userData = NULL;
Note: See TracChangeset
for help on using the changeset viewer.
