diff --git a/pvDataApp/factory/Convert.cpp b/pvDataApp/factory/Convert.cpp index e24c5b6..40aa52a 100644 --- a/pvDataApp/factory/Convert.cpp +++ b/pvDataApp/factory/Convert.cpp @@ -2721,7 +2721,7 @@ void convertStructure(StringBuilder buffer,PVStructure const *data,int indentLev } } -void convertArray(StringBuilder buffer,PVScalarArray const * xxx,int indentLevel) +void convertArray(StringBuilder buffer,PVScalarArray const * xxx,int /*indentLevel*/) { PVScalarArray *pv = const_cast(xxx); ScalarArrayConstPtr array = pv->getScalarArray(); diff --git a/pvDataApp/factory/FieldCreateFactory.cpp b/pvDataApp/factory/FieldCreateFactory.cpp index 108b12f..c3eee33 100644 --- a/pvDataApp/factory/FieldCreateFactory.cpp +++ b/pvDataApp/factory/FieldCreateFactory.cpp @@ -39,7 +39,7 @@ Field::~Field() { } -void Field::toString(StringBuilder buffer,int indentLevel) const{ +void Field::toString(StringBuilder /*buffer*/,int /*indentLevel*/) const{ } @@ -54,7 +54,7 @@ struct ScalarArrayHashFunction { }; struct StructureHashFunction { - size_t operator() (const Structure& structure) const { return 0; } + size_t operator() (const Structure& /*structure*/) const { return 0; } // TODO // final int PRIME = 31; // return PRIME * Arrays.hashCode(fieldNames) + Arrays.hashCode(fields); @@ -70,7 +70,7 @@ Scalar::Scalar(ScalarType scalarType) Scalar::~Scalar(){} -void Scalar::toString(StringBuilder buffer,int indentLevel) const{ +void Scalar::toString(StringBuilder buffer,int /*indentLevel*/) const{ *buffer += getID(); } @@ -119,7 +119,7 @@ void Scalar::serialize(ByteBuffer *buffer, SerializableControl *control) const { buffer->putByte(getTypeCodeLUT()); } -void Scalar::deserialize(ByteBuffer *buffer, DeserializableControl *control) { +void Scalar::deserialize(ByteBuffer */*buffer*/, DeserializableControl */*control*/) { // must be done via FieldCreate throw std::runtime_error("not valid operation, use FieldCreate::deserialize instead"); } @@ -213,7 +213,7 @@ String ScalarArray::getID() const return getIDScalarArrayLUT(); } -void ScalarArray::toString(StringBuilder buffer,int indentLevel) const{ +void ScalarArray::toString(StringBuilder buffer,int /*indentLevel*/) const{ *buffer += getID(); } @@ -222,7 +222,7 @@ void ScalarArray::serialize(ByteBuffer *buffer, SerializableControl *control) co buffer->putByte(0x10 | getTypeCodeLUT()); } -void ScalarArray::deserialize(ByteBuffer *buffer, DeserializableControl *control) { +void ScalarArray::deserialize(ByteBuffer */*buffer*/, DeserializableControl */*control*/) { throw std::runtime_error("not valid operation, use FieldCreate::deserialize instead"); } @@ -252,7 +252,7 @@ void StructureArray::serialize(ByteBuffer *buffer, SerializableControl *control) control->cachedSerialize(pstructure, buffer); } -void StructureArray::deserialize(ByteBuffer *buffer, DeserializableControl *control) { +void StructureArray::deserialize(ByteBuffer */*buffer*/, DeserializableControl */*control*/) { throw std::runtime_error("not valid operation, use FieldCreate::deserialize instead"); } @@ -357,7 +357,7 @@ void Structure::serialize(ByteBuffer *buffer, SerializableControl *control) cons serializeStructureField(this, buffer, control); } -void Structure::deserialize(ByteBuffer *buffer, DeserializableControl *control) { +void Structure::deserialize(ByteBuffer */*buffer*/, DeserializableControl */*control*/) { throw std::runtime_error("not valid operation, use FieldCreate::deserialize instead"); } diff --git a/pvDataApp/factory/PVDataCreateFactory.cpp b/pvDataApp/factory/PVDataCreateFactory.cpp index 95de04f..f18dfbe 100644 --- a/pvDataApp/factory/PVDataCreateFactory.cpp +++ b/pvDataApp/factory/PVDataCreateFactory.cpp @@ -147,9 +147,9 @@ void BasePVString::serialize(ByteBuffer *pbuffer, { // check bounds const size_t length = /*(value == null) ? 0 :*/ value.length(); - if (offset < 0) offset = 0; - else if (offset > length) offset = length; - if (count < 0) count = length; + /*if (offset < 0) offset = 0; + else*/ if (offset > length) offset = length; + //if (count < 0) count = length; const size_t maxCount = length - offset; if (count > maxCount) @@ -271,7 +271,7 @@ size_t DefaultPVArray::get(size_t offset, size_t len, PVArrayData &data) size_t length = this->getLength(); if(offset+len > length) { n = length-offset; - if(n<0) n = 0; + //if(n<0) n = 0; } data.data = *value.get(); data.offset = offset; @@ -331,8 +331,8 @@ template void DefaultPVArray::deserialize(ByteBuffer *pbuffer, DeserializableControl *pcontrol) { size_t size = SerializeHelper::readSize(pbuffer, pcontrol); - // if (size>0) { pcontrol->ensureData(sizeof(T)-1); pbuffer->align(sizeof(T)); } - if(size>=0) { + // alignment if (size>0) { pcontrol->ensureData(sizeof(T)-1); pbuffer->align(sizeof(T)); } + //if(size>=0) { // prepare array, if necessary if(size>this->getCapacity()) this->setCapacity(size); // set new length @@ -356,7 +356,7 @@ void DefaultPVArray::deserialize(ByteBuffer *pbuffer, } // inform about the change? PVField::postPut(); - } + //} // TODO null arrays (size == -1) not supported } @@ -367,10 +367,10 @@ void DefaultPVArray::serialize(ByteBuffer *pbuffer, size_t length = this->getLength(); // check bounds - if(offset<0) + /*if(offset<0) offset = 0; - else if(offset>length) offset = length; - if(count<0) count = length; + else*/ if(offset>length) offset = length; + //if(count<0) count = length; size_t maxCount = length-offset; if(count>maxCount) count = maxCount; @@ -406,7 +406,7 @@ template<> void DefaultPVArray::deserialize(ByteBuffer *pbuffer, DeserializableControl *pcontrol) { size_t size = SerializeHelper::readSize(pbuffer, pcontrol); - if(size>=0) { + //if(size>=0) { // prepare array, if necessary if(size>getCapacity()) setCapacity(size); // set new length @@ -419,7 +419,7 @@ void DefaultPVArray::deserialize(ByteBuffer *pbuffer, } // inform about the change? postPut(); - } + //} // TODO null arrays (size == -1) not supported } @@ -429,10 +429,10 @@ void DefaultPVArray::serialize(ByteBuffer *pbuffer, size_t length = getLength(); // check bounds - if(offset<0) + /*if(offset<0) offset = 0; - else if(offset>length) offset = length; - if(count<0) count = length; + else*/ if(offset>length) offset = length; + //if(count<0) count = length; size_t maxCount = length-offset; if(count>maxCount) count = maxCount; diff --git a/pvDataApp/factory/PVStructureArray.cpp b/pvDataApp/factory/PVStructureArray.cpp index b6cba3f..d08b6a4 100644 --- a/pvDataApp/factory/PVStructureArray.cpp +++ b/pvDataApp/factory/PVStructureArray.cpp @@ -133,7 +133,7 @@ size_t PVStructureArray::get( size_t length = getLength(); if(offset+len > length) { n = length - offset; - if(n<0) n = 0; + //if(n<0) n = 0; } data.data = *value.get(); data.offset = offset; @@ -197,7 +197,7 @@ void PVStructureArray::serialize(ByteBuffer *pbuffer, void PVStructureArray::deserialize(ByteBuffer *pbuffer, DeserializableControl *pcontrol) { size_t size = SerializeHelper::readSize(pbuffer, pcontrol); - if(size>=0) { + //if(size>=0) { // prepare array, if necessary if(size>getCapacity()) setCapacity(size); setLength(size); @@ -217,7 +217,7 @@ void PVStructureArray::deserialize(ByteBuffer *pbuffer, } } postPut(); - } + //} } void PVStructureArray::serialize(ByteBuffer *pbuffer, @@ -226,10 +226,10 @@ void PVStructureArray::serialize(ByteBuffer *pbuffer, size_t length = getLength(); // check bounds - if(offset<0) + /*if(offset<0) offset = 0; - else if(offset>length) offset = length; - if(count<0) count = length; + else*/ if(offset>length) offset = length; + //if(count<0) count = length; size_t maxCount = length-offset; if(count>maxCount) count = maxCount; diff --git a/pvDataApp/misc/bitSet.cpp b/pvDataApp/misc/bitSet.cpp index 4576ddb..bccb391 100644 --- a/pvDataApp/misc/bitSet.cpp +++ b/pvDataApp/misc/bitSet.cpp @@ -331,7 +331,7 @@ namespace epics { namespace pvData { return !(*this == set); } - void BitSet::toString(StringBuilder buffer, int indentLevel) const + void BitSet::toString(StringBuilder buffer, int /*indentLevel*/) const { *buffer += '{'; int32 i = nextSetBit(0); diff --git a/pvDataApp/misc/serializeHelper.cpp b/pvDataApp/misc/serializeHelper.cpp index d067765..75804ea 100644 --- a/pvDataApp/misc/serializeHelper.cpp +++ b/pvDataApp/misc/serializeHelper.cpp @@ -77,14 +77,14 @@ namespace epics { void SerializeHelper::serializeSubstring(const String& value, std::size_t offset, std::size_t count, ByteBuffer* buffer, SerializableControl* flusher) { - if(offset<0) + /*if(offset<0) offset = 0; - else if(offset>(std::size_t)value.length()) offset = value.length(); + else*/ if(offset>value.length()) offset = value.length(); - if(offset+count>(std::size_t)value.length()) count = value.length()-offset; + if(offset+count>value.length()) count = value.length()-offset; SerializeHelper::writeSize(count, buffer, flusher); - if (count<=0) return; + /*if (count<=0)*/ return; std::size_t i = 0; while(true) { std::size_t maxToWrite = min(count-i, buffer->getRemaining()); diff --git a/pvDataApp/misc/status.cpp b/pvDataApp/misc/status.cpp index 789b03b..2ddc4fe 100644 --- a/pvDataApp/misc/status.cpp +++ b/pvDataApp/misc/status.cpp @@ -117,7 +117,7 @@ String Status::toString() const return str; } -void Status::toString(StringBuilder buffer, int indentLevel) const +void Status::toString(StringBuilder buffer, int /*indentLevel*/) const { *buffer += "Status [type="; *buffer += StatusTypeName[m_statusType]; diff --git a/testApp/misc/testBaseException.cpp b/testApp/misc/testBaseException.cpp index cf9cd49..2a00995 100644 --- a/testApp/misc/testBaseException.cpp +++ b/testApp/misc/testBaseException.cpp @@ -27,11 +27,11 @@ struct Unroller }; template<> -void Unroller::unroll<0>(double d) { +void Unroller::unroll<0>(double /*d*/) { THROW_BASE_EXCEPTION("the root cause"); } -void internalTestBaseException(int unused = 0) +void internalTestBaseException(int /*unused*/ = 0) { try { // NOTE: 5, 4, 3, 2, 1 calls will be optimized and not shown diff --git a/testApp/misc/testMessageQueue.cpp b/testApp/misc/testMessageQueue.cpp index 67ce0a5..dac867b 100644 --- a/testApp/misc/testMessageQueue.cpp +++ b/testApp/misc/testMessageQueue.cpp @@ -30,7 +30,7 @@ using namespace epics::pvData; -static void testBasic(FILE * fd,FILE *auxfd ) { +static void testBasic(FILE * fd,FILE */*auxfd*/) { int queueSize = 3; StringArray messages; messages.reserve(5); diff --git a/testApp/misc/testSerialization.cpp b/testApp/misc/testSerialization.cpp index 41045f0..238bd7f 100644 --- a/testApp/misc/testSerialization.cpp +++ b/testApp/misc/testSerialization.cpp @@ -24,22 +24,24 @@ #include -#define BYTE_MAX_VALUE 127 -#define BYTE_MIN_VALUE -128 -#define UBYTE_MAX_VALUE 255 -#define SHORT_MAX_VALUE 32767 -#define SHORT_MIN_VALUE -32768 -#define USHORT_MAX_VALUE 65535 -#define INT_MAX_VALUE 2147483647 -#define INT_MIN_VALUE (-INT_MAX_VALUE - 1) -#define UINT_MAX_VALUE 4294967295ULL -#define LONG_MAX_VALUE 9223372036854775807LL -#define LONG_MIN_VALUE (-LONG_MAX_VALUE - 1LL) -#define ULONG_MAX_VALUE 18446744073709549999ULL -#define FLOAT_MAX_VALUE 3.4028235E38 -#define FLOAT_MIN_VALUE 1.4E-45 -#define DOUBLE_MAX_VALUE 1.7976931348623157E308 -#define DOUBLE_MIN_VALUE 4.9E-324 +#include + +#define BYTE_MAX_VALUE std::numeric_limits::max() +#define BYTE_MIN_VALUE std::numeric_limits::min() +#define UBYTE_MAX_VALUE std::numeric_limits::max() +#define SHORT_MAX_VALUE std::numeric_limits::max() +#define SHORT_MIN_VALUE std::numeric_limits::min() +#define USHORT_MAX_VALUE std::numeric_limits::max() +#define INT_MAX_VALUE std::numeric_limits::max() +#define INT_MIN_VALUE std::numeric_limits::min() +#define UINT_MAX_VALUE std::numeric_limits::max() +#define LONG_MAX_VALUE std::numeric_limits::max() +#define LONG_MIN_VALUE std::numeric_limits::min() +#define ULONG_MAX_VALUE std::numeric_limits::max() +#define FLOAT_MAX_VALUE std::numeric_limits::max() +#define FLOAT_MIN_VALUE std::numeric_limits::min() +#define DOUBLE_MAX_VALUE std::numeric_limits::max() +#define DOUBLE_MIN_VALUE std::numeric_limits::min() using namespace epics::pvData; @@ -54,7 +56,7 @@ public: virtual void flushSerializeBuffer() { } - virtual void ensureBuffer(std::size_t size) { + virtual void ensureBuffer(std::size_t /*size*/) { } virtual void alignBuffer(std::size_t alignment) { @@ -76,7 +78,7 @@ public: class DeserializableControlImpl : public DeserializableControl, public NoDefaultMethods { public: - virtual void ensureData(size_t size) { + virtual void ensureData(size_t /*size*/) { } virtual void alignData(size_t alignment) { diff --git a/testApp/monitor/testMonitor.cpp b/testApp/monitor/testMonitor.cpp index f5adfa3..ce33e7a 100644 --- a/testApp/monitor/testMonitor.cpp +++ b/testApp/monitor/testMonitor.cpp @@ -50,7 +50,7 @@ public: printf("poll called\n"); return emptyElement; } - virtual void release(MonitorElementPtr const & monitorElement) + virtual void release(MonitorElementPtr const & /*monitorElement*/) { printf("release called\n"); } @@ -70,7 +70,7 @@ static void testMonitor() } -int main(int argc,char *argv[]) +int main(int, char **) { testMonitor(); return(0); diff --git a/testApp/property/testProperty.cpp b/testApp/property/testProperty.cpp index 23eb465..923276c 100644 --- a/testApp/property/testProperty.cpp +++ b/testApp/property/testProperty.cpp @@ -48,7 +48,7 @@ static String allProperties("alarm,timeStamp,display,control"); static PVStructurePtr doubleRecord; static PVStructurePtr enumeratedRecord; -static void createRecords(FILE * fd,FILE *auxfd) +static void createRecords(FILE * fd,FILE */*auxfd*/) { doubleRecord = standardPVField->scalar(pvDouble,allProperties); if(debug) { @@ -70,7 +70,7 @@ static void createRecords(FILE * fd,FILE *auxfd) } } -static void printRecords(FILE * fd,FILE *auxfd) +static void printRecords(FILE * fd,FILE */*auxfd*/) { fprintf(fd,"doubleRecord\n"); builder.clear(); @@ -82,7 +82,7 @@ static void printRecords(FILE * fd,FILE *auxfd) fprintf(fd,"%s\n",builder.c_str()); } -static void testAlarm(FILE * fd,FILE *auxfd) +static void testAlarm(FILE * fd,FILE */*auxfd*/) { if(debug) fprintf(fd,"testAlarm\n"); Alarm alarm; @@ -155,7 +155,7 @@ static void testTimeStamp(FILE * fd,FILE *auxfd) fprintf(fd,"testTimeStamp PASSED\n"); } -static void testControl(FILE * fd,FILE *auxfd) +static void testControl(FILE * fd,FILE */*auxfd*/) { if(debug) fprintf(fd,"testControl\n"); Control control; @@ -182,7 +182,7 @@ static void testControl(FILE * fd,FILE *auxfd) fprintf(fd,"testControl PASSED\n"); } -static void testDisplay(FILE * fd,FILE *auxfd) +static void testDisplay(FILE * fd,FILE */*auxfd*/) { if(debug) fprintf(fd,"testDisplay\n"); Display display; @@ -215,7 +215,7 @@ static void testDisplay(FILE * fd,FILE *auxfd) fprintf(fd,"testDisplay PASSED\n"); } -static void testEnumerated(FILE * fd,FILE *auxfd) +static void testEnumerated(FILE * fd,FILE */*auxfd*/) { if(debug) fprintf(fd,"testEnumerated\n"); PVEnumerated pvEnumerated; diff --git a/testApp/pv/testPVData.cpp b/testApp/pv/testPVData.cpp index bb60a2a..71654da 100644 --- a/testApp/pv/testPVData.cpp +++ b/testApp/pv/testPVData.cpp @@ -77,7 +77,7 @@ static void testCreatePVStructure(FILE * fd) fprintf(fd,"testCreatePVStructure PASSED\n"); } -static void testPVScalarCommon(FILE * fd,String fieldName,ScalarType stype) +static void testPVScalarCommon(FILE * fd,String /*fieldName*/,ScalarType stype) { PVScalarPtr pvScalar = pvDataCreate->createPVScalar(stype); if(stype==pvBoolean) { @@ -91,7 +91,7 @@ static void testPVScalarCommon(FILE * fd,String fieldName,ScalarType stype) } static void testPVScalarWithProperties( - FILE * fd,String fieldName,ScalarType stype) + FILE * fd,String /*fieldName*/,ScalarType stype) { PVStructurePtr pvStructure; bool hasValueAlarm = false; @@ -335,7 +335,7 @@ static void testPVScalar(FILE * fd) { } -static void testScalarArrayCommon(FILE * fd,String fieldName,ScalarType stype) +static void testScalarArrayCommon(FILE * fd,String /*fieldName*/,ScalarType stype) { PVStructurePtr pvStructure = standardPVField->scalarArray( stype,alarmTimeStamp); diff --git a/testApp/pv/testStandardField.cpp b/testApp/pv/testStandardField.cpp index efae647..661caa1 100644 --- a/testApp/pv/testStandardField.cpp +++ b/testApp/pv/testStandardField.cpp @@ -35,7 +35,7 @@ static void print(String name) if(debug) printf("\n%s\n%s\n",name.c_str(),builder.c_str()); } -int main(int argc,char *argv[]) +int main(int, char **) { StructureConstPtr doubleValue = standardField->scalar(pvDouble, "alarm,timeStamp,display,control,valueAlarm"); diff --git a/testApp/pv/testStandardPVField.cpp b/testApp/pv/testStandardPVField.cpp index 675cf15..7c19ccd 100644 --- a/testApp/pv/testStandardPVField.cpp +++ b/testApp/pv/testStandardPVField.cpp @@ -37,7 +37,7 @@ static void print(String name) if(debug) printf("\n%s\n%s\n",name.c_str(),builder.c_str()); } -int main(int argc,char *argv[]) +int main(int, char **) { PVStructurePtr pvStructure = standardPVField->scalar(pvDouble, "alarm,timeStamp,display,control,valueAlarm");