Commit 5297f864 authored by Yuelong Yu's avatar Yuelong Yu
Browse files

fixed warnings

parent 5f1c8ada
......@@ -261,16 +261,16 @@ void AGIPD::init_device()
// *attr_Delay8_read = 0;
*attr_IntegrationTime_read = 0;
*attr_LiveMode_read = true;
*attr_SaveFilePath_read = "./";
*attr_SaveFileName_read = "test_00000";
*attr_SaveFilePath_read = Tango::DevString("./");
*attr_SaveFileName_read = Tango::DevString("test_00000");
*attr_FrameNumbers_read = 0;
*attr_LatestImageNumber_read = 0;
*attr_IntegrationOffset_read = 0;
*attr_PatternFile_read = "./";
*attr_BunchStructureFile_read="./";
*attr_ASICCS_read = "--";
*attr_ASICPS_read = "--";
*attr_Mask_read = "00000000";
*attr_PatternFile_read = Tango::DevString("./");
*attr_BunchStructureFile_read= Tango::DevString("./");
*attr_ASICCS_read = Tango::DevString("--");
*attr_ASICPS_read = Tango::DevString("--");
*attr_Mask_read = Tango::DevString("00000000");
*attr_SaveAllImages_read = false;
*attr_LiveFrameNoAnalog_read = 0;
*attr_LiveFrameNoDigital_read = 0;
......@@ -291,9 +291,9 @@ void AGIPD::init_device()
*attr_FileSizeLimit_read =20; //file limit size GigaBytes
*attr_TotalLossFrames_read = 0;
*attr_FilePrefix_read = "test";
*attr_FilePrefix_read = Tango::DevString("test");
*attr_FileStartNum_read = 0;
*attr_FilePostfix_read = "nxs";
*attr_FilePostfix_read = Tango::DevString("nxs");
if(uDPMACAddr.empty())
cout<<"uDPMACAddr:"<<uDPMACAddr<<"uDPPort:"<<uDPPort<<"uDPIP:"<<uDPIP<<endl
......@@ -303,7 +303,7 @@ void AGIPD::init_device()
if(simulationMode == 0)
{
// Initialize device
*attr_PatternFile_read = "./pattern/test.txt";
*attr_PatternFile_read = Tango::DevString("./pattern/test.txt");
if(uDPMACAddr.empty() || uDPPort == 0 || uDPIP.empty()
|| tCPIP.empty() || tCPPort == 0
|| uDPSrcIP.empty() || uDPSrcMAC.empty())
......@@ -681,7 +681,7 @@ void AGIPD::write_ASICCS(Tango::WAttribute &attr)
int nChipNum = 16;
bool bWrite = true;
if(string(w_val).length() == nChipNum)
if(string(w_val).length() == static_cast<unsigned int>(nChipNum))
{
vector<short> vShData(nChipNum,0);
*attr_ASICCS_read = w_val;
......@@ -752,7 +752,7 @@ void AGIPD::write_ASICPS(Tango::WAttribute &attr)
int nChipNum = 16;
bool bWrite = true;
if(string(w_val).length() == nChipNum)
if(string(w_val).length() == static_cast<unsigned int>(nChipNum))
{
vector<short> vShData(nChipNum,0);
*attr_ASICPS_read = w_val;
......@@ -1628,7 +1628,7 @@ void AGIPD::write_Mask(Tango::WAttribute &attr)
/*----- PROTECTED REGION ID(AGIPD::write_Mask) ENABLED START -----*/
int nChipNum = 8;
bool bWrite = true;
if(string(w_val).length() == nChipNum)
if(string(w_val).length() == static_cast<unsigned int>(nChipNum))
{
vector<short> vShData(nChipNum,0);
*attr_Mask_read = w_val;
......
......@@ -467,8 +467,8 @@ namespace AGIPD_ns
private:
/// member variables
AGIPDInterface* m_objDet;
AGIPD* m_objAGIPD;
AGIPDInterface* m_objDet;
omni_mutex& m_mutexAcq;
long m_lRequestFrameNo;
......
......@@ -66,7 +66,7 @@ $(LIB_PNIIO_CONFIG) \
#CXXFLAGS_USR =-O2 -DTIMEMEASUREMENT -std=c++0x $(RELEASE_TYPE) -D_REENTRANT \
$(CPPFLAGS_PNIIO_CONFIG) $(INC_DIR_USER)
CXXFLAGS_USR =-O3 -std=c++0x $(RELEASE_TYPE) -D_REENTRANT \
CXXFLAGS_USR =-O3 -std=c++11 -Wall $(RELEASE_TYPE) -D_REENTRANT \
$(CPPFLAGS_PNIIO_CONFIG) $(INC_DIR_USER)
......
......@@ -25,6 +25,7 @@
#include <iostream>
#include <map>
#include <vector>
#include <sys/stat.h>
#include <pni/core/arrays.hpp>
#include <pni/core/types.hpp>
......@@ -49,17 +50,20 @@ namespace NexusNS
{
/* general error */
NO_ERROR, /* 0 */
/* file related error */
FILE_CREATE_ERROR, /* 1 */
GROUP_CREATE_ERROR, /* 2 */
FIELD_CREATE_ERROR, /* 3 */
GET_GROUP_ERROR, /* 4 */
GET_FIELD_ERROR, /* 5 */
WRITE_ERROR, /* 6 */
INDEX_ERROR, /* 7 */
CLOSE_ERROR, /* 8 */
COMPRESSION_RATIO_ERROR /* 9 */
FILE_ERROR, /* 1 */
OBJECT_ERROR, /* 2 */
INVALID_OBJECT_ERROR, /* 3 */
IO_ERROR, /* 4 */
TYPE_ERROR, /* 5 */
KEY_ERROR, /* 6 */
MEMORY_NOT_ALLOCATED_ERROR, /* 7 */
SIZE_MISMATCH_ERROR, /* 8 */
COMPRESSION_RATIO_ERROR, /* 9 */
INDEX_ERROR, /* 10 */
GET_FIELD_ERROR, /* 11 */
WRITE_ERROR /* 12 */
};
/**
......@@ -102,15 +106,15 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return FILE_CREATE_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(io_error& ie)
{
return FILE_CREATE_ERROR;
return IO_ERROR;
}
catch(object_error& oe)
{
return FILE_CREATE_ERROR;
return OBJECT_ERROR;
}
}
......@@ -123,9 +127,13 @@ namespace NexusNS
* @return 0: OK;
* 1: failed;
*/
int CreateFile(const string strFileName,const bool bOverwrite,const bool bSplit,const int nLimitSize)
int CreateFile(const string /* strFileName */,
const bool /* bOverwrite */,
const bool /* bSplit */,
const int /* nLimitSize */)
{
///TODO
return FILE_ERROR;
}
/**
......@@ -154,11 +162,11 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return GROUP_CREATE_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return GROUP_CREATE_ERROR;
return OBJECT_ERROR;
}
}
......@@ -189,19 +197,19 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return FIELD_CREATE_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return FIELD_CREATE_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return FIELD_CREATE_ERROR;
return TYPE_ERROR;
}
catch(size_mismatch_error& se)
{
return FIELD_CREATE_ERROR;
return SIZE_MISMATCH_ERROR;
}
}
......@@ -225,25 +233,26 @@ namespace NexusNS
//create filed under parent group
m_nxField = m_nxGroup.create_field<T>(strFieldName,shape_t{0,nSize});
m_nxField = m_nxGroup.create_field<T>(strFieldName,
shape_t{0,static_cast<unsigned int>(nSize)});
return NO_ERROR;
}
catch(invalid_object_error& ie)
{
return FIELD_CREATE_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return FIELD_CREATE_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return FIELD_CREATE_ERROR;
return TYPE_ERROR;
}
catch(size_mismatch_error& se)
{
return FIELD_CREATE_ERROR;
return SIZE_MISMATCH_ERROR;
}
}
......@@ -271,8 +280,12 @@ namespace NexusNS
return nRet;
shape_t spChunk = shape_t{nCacheSize,nX,nY};
shape_t spShape = shape_t{0,nX,nY};
shape_t spChunk = shape_t{static_cast<unsigned int>(nCacheSize),
static_cast<unsigned int>(nX),
static_cast<unsigned int>(nY)};
shape_t spShape = shape_t{0,
static_cast<unsigned int>(nX),
static_cast<unsigned int>(nY)};
//no compression
if(nCompressor == 0)
......@@ -285,22 +298,24 @@ namespace NexusNS
m_nxField = m_nxGroup.create_field<T>(strFieldName,spShape,spChunk,m_nxCompressor);
return NO_ERROR;
}
else
return FILE_ERROR;
}
catch(invalid_object_error& ie)
{
return FIELD_CREATE_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return FIELD_CREATE_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return FIELD_CREATE_ERROR;
return TYPE_ERROR;
}
catch(size_mismatch_error& se)
{
return FIELD_CREATE_ERROR;
return SIZE_MISMATCH_ERROR;
}
}
......@@ -321,11 +336,11 @@ namespace NexusNS
}
catch(object_error& oe)
{
return CLOSE_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return CLOSE_ERROR;
return TYPE_ERROR;
}
}
......@@ -345,19 +360,19 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return GET_GROUP_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return GET_GROUP_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return GET_GROUP_ERROR;
return TYPE_ERROR;
}
catch(key_error& te)
{
return GET_GROUP_ERROR;
return KEY_ERROR;
}
}
......@@ -377,19 +392,19 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return GET_FIELD_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return GET_FIELD_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return GET_FIELD_ERROR;
return TYPE_ERROR;
}
catch(key_error& te)
{
return GET_FIELD_ERROR;
return KEY_ERROR;
}
}
......@@ -449,23 +464,23 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return WRITE_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return WRITE_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return WRITE_ERROR;
return TYPE_ERROR;
}
catch(size_mismatch_error& se)
{
return WRITE_ERROR;
return SIZE_MISMATCH_ERROR;
}
catch(io_error& ie)
{
return WRITE_ERROR;
return IO_ERROR;
}
}
......@@ -500,23 +515,23 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return WRITE_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return WRITE_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return WRITE_ERROR;
return TYPE_ERROR;
}
catch(size_mismatch_error& se)
{
return WRITE_ERROR;
return SIZE_MISMATCH_ERROR;
}
catch(io_error& ie)
{
return WRITE_ERROR;
return IO_ERROR;
}
}
......@@ -558,23 +573,23 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return WRITE_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return WRITE_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return WRITE_ERROR;
return TYPE_ERROR;
}
catch(size_mismatch_error& se)
{
return WRITE_ERROR;
return SIZE_MISMATCH_ERROR;
}
catch(io_error& ie)
{
return WRITE_ERROR;
return IO_ERROR;
}
}
......@@ -615,23 +630,23 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return WRITE_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return WRITE_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return WRITE_ERROR;
return TYPE_ERROR;
}
catch(size_mismatch_error& se)
{
return WRITE_ERROR;
return SIZE_MISMATCH_ERROR;
}
catch(io_error& ie)
{
return WRITE_ERROR;
return IO_ERROR;
}
}
......@@ -672,23 +687,23 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return WRITE_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return WRITE_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return WRITE_ERROR;
return TYPE_ERROR;
}
catch(size_mismatch_error& se)
{
return WRITE_ERROR;
return SIZE_MISMATCH_ERROR;
}
catch(io_error& ie)
{
return WRITE_ERROR;
return IO_ERROR;
}
}
......@@ -747,23 +762,23 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return WRITE_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return WRITE_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return WRITE_ERROR;
return TYPE_ERROR;
}
catch(size_mismatch_error& se)
{
return WRITE_ERROR;
return SIZE_MISMATCH_ERROR;
}
catch(io_error& ie)
{
return WRITE_ERROR;
return IO_ERROR;
}
}
......@@ -812,7 +827,7 @@ namespace NexusNS
if(nSize == -1)
return INDEX_ERROR;
long long unsigned int nOffset[3] = {nSize,0,0};
long long unsigned int nOffset[3] = {static_cast<unsigned int>(nSize),0,0};
//do chunk write
int nRet = H5DOwrite_chunk(nID //dataset id
,H5P_DEFAULT //not used
......@@ -832,23 +847,23 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return WRITE_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return WRITE_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return WRITE_ERROR;
return TYPE_ERROR;
}
catch(size_mismatch_error& se)
{
return WRITE_ERROR;
return SIZE_MISMATCH_ERROR;
}
catch(io_error& ie)
{
return WRITE_ERROR;
return IO_ERROR;
}
}
......@@ -869,19 +884,19 @@ namespace NexusNS
}
catch(invalid_object_error& ie)
{
return GET_GROUP_ERROR;
return INVALID_OBJECT_ERROR;
}
catch(object_error& oe)
{
return GET_GROUP_ERROR;
return OBJECT_ERROR;
}
catch(type_error& te)
{
return GET_GROUP_ERROR;
return TYPE_ERROR;
}
catch(key_error& te)
{
return GET_GROUP_ERROR;
return KEY_ERROR;
}
}
......@@ -921,7 +936,7 @@ namespace NexusNS
* @brief get write position for 2D data
* because of the m_nxField.size() overflow problem
*/
int GetWritePositionFor2DData(int nSizeOfElement)
int GetWritePositionFor2DData(int /* nSizeOfElement */)
{
m_nxField.grow(0,1);
m_nIdx++;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment