MacOSX port, warnings removed
This commit is contained in:
@@ -20,7 +20,8 @@ growingCircularBufferTest_LIBS += pvAccessUtils Com
|
||||
|
||||
PROD_HOST += inetAddressUtilsTest
|
||||
inetAddressUtilsTest_SRCS += inetAddressUtilsTest.cpp
|
||||
inetAddressUtilsTest_LIBS += pvAccessUtils Com
|
||||
inetAddressUtilsTest_LIBS += pvAccessUtils Com pvData
|
||||
pvData_DIR = $(PVDATA_HOME)/lib/$(EPICS_HOST_ARCH)
|
||||
|
||||
PROD_HOST += loggerTest
|
||||
loggerTest_SRCS += loggerTest.cpp
|
||||
|
||||
@@ -14,7 +14,7 @@ using namespace epics::pvAccess;
|
||||
using std::cout;
|
||||
using std::endl;
|
||||
|
||||
const int CAPACITY = 10;
|
||||
const size_t CAPACITY = 10;
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
GrowingCircularBuffer<int> cb(CAPACITY);
|
||||
@@ -31,15 +31,15 @@ int main(int argc, char *argv[]) {
|
||||
assert(first);
|
||||
assert(cb.size()==0);
|
||||
|
||||
for(int i = 0; i<2*CAPACITY; i++) {
|
||||
for(size_t i = 0; i<2*CAPACITY; i++) {
|
||||
first = cb.insert(i);
|
||||
assert(cb.size()==i+1);
|
||||
assert((cb.size() == 1)==first);
|
||||
}
|
||||
assert(cb.size()==2*CAPACITY);
|
||||
|
||||
for(int i = 0; i<2*CAPACITY; i++) {
|
||||
assert(cb.extract()==i);
|
||||
for(size_t i = 0; i<2*CAPACITY; i++) {
|
||||
assert(cb.extract()==(int)i);
|
||||
assert(cb.size()==2*CAPACITY-i-1);
|
||||
}
|
||||
assert(cb.size()==0);
|
||||
|
||||
@@ -123,11 +123,11 @@ namespace epics {
|
||||
|
||||
#ifdef ARRAY_FIFO_DEBUG
|
||||
void debugState() {
|
||||
size_t mask = _size-1;
|
||||
//size_t mask = _size-1;
|
||||
std::cout<<"h:"<<_head<<",t:"<<_tail<<",c:"<<_size;
|
||||
std::cout<<",s:"<<size()<<std::endl;
|
||||
std::cout<<"Content:"<<std::endl;
|
||||
for (int i = 0; i < _size; i++)
|
||||
for (size_t i = 0; i < _size; i++)
|
||||
std::cout<<"["<<i<<"]: "<<_elements[i]<<std::endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -28,8 +28,8 @@ namespace epics {
|
||||
* Create a GrowingCircularBuffer with the given capacity.
|
||||
**/
|
||||
GrowingCircularBuffer(size_t capacity = 16) :
|
||||
_takePointer(0), _putPointer(0), _count(0), _size(capacity),
|
||||
_elements(new T[capacity]) {
|
||||
_elements(new T[capacity]), _takePointer(0), _putPointer(0), _count(0), _size(capacity)
|
||||
{
|
||||
}
|
||||
|
||||
~GrowingCircularBuffer() {
|
||||
|
||||
@@ -170,6 +170,7 @@ namespace epics {
|
||||
|
||||
switch(chp) {
|
||||
case '[':
|
||||
{
|
||||
// Each set must be close with a ], otherwise it is invalid.
|
||||
int end = pattern.find(']', ip);
|
||||
|
||||
@@ -211,12 +212,14 @@ namespace epics {
|
||||
ip = end+1;
|
||||
is++;
|
||||
break;
|
||||
}
|
||||
case '?':
|
||||
// Obvious
|
||||
ip++;
|
||||
is++;
|
||||
break;
|
||||
case '*':
|
||||
{
|
||||
// Trailing asterisk means that string matches till the end.
|
||||
// Also, checks if this is last char in the string
|
||||
if(ip+1==lp) return true;
|
||||
@@ -242,6 +245,7 @@ namespace epics {
|
||||
i++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
// Literal match
|
||||
if(is==ls||pattern.at(ip)!=str.at(is)) return false;
|
||||
|
||||
Reference in New Issue
Block a user