From 27ce426f46c9395a135c69da852f249dead0e3b8 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Tue, 15 May 2012 16:06:33 -0400 Subject: [PATCH] return StringArray instead of StringArray & for choices --- pvDataApp/property/pvEnumerated.cpp | 3 +-- pvDataApp/property/pvEnumerated.h | 2 +- testApp/property/testProperty.cpp | 7 +------ 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/pvDataApp/property/pvEnumerated.cpp b/pvDataApp/property/pvEnumerated.cpp index 123ca28..10f3683 100644 --- a/pvDataApp/property/pvEnumerated.cpp +++ b/pvDataApp/property/pvEnumerated.cpp @@ -88,14 +88,13 @@ bool PVEnumerated::choicesMutable() return pvChoices->isImmutable(); } -StringArray& PVEnumerated:: getChoices() +StringArray PVEnumerated:: getChoices() { if(pvIndex.get()==NULL ) { throw std::logic_error(notAttached); } StringArrayData data; pvChoices->get(0,pvChoices->getLength(),data); -printf("getChoices %p size %d\n",&data.data,data.data.size()); return data.data; } diff --git a/pvDataApp/property/pvEnumerated.h b/pvDataApp/property/pvEnumerated.h index 382e94a..95a438b 100644 --- a/pvDataApp/property/pvEnumerated.h +++ b/pvDataApp/property/pvEnumerated.h @@ -27,7 +27,7 @@ public: int32 getIndex(); String getChoice(); bool choicesMutable(); - StringArray & getChoices(); + StringArray getChoices(); int32 getNumberChoices(); bool setChoices(StringArray & choices); private: diff --git a/testApp/property/testProperty.cpp b/testApp/property/testProperty.cpp index 1f3fdd8..039ab7c 100644 --- a/testApp/property/testProperty.cpp +++ b/testApp/property/testProperty.cpp @@ -214,13 +214,8 @@ static void testEnumerated(FILE * fd,FILE *auxfd) assert(result); int32 index = pvEnumerated.getIndex(); String choice = pvEnumerated.getChoice(); - StringArray &choices = pvEnumerated.getChoices(); + StringArray choices = pvEnumerated.getChoices(); int32 numChoices = pvEnumerated.getNumberChoices(); -printf("%p size %d numChoices %d\n",&choices,choices.size(),numChoices); -for(int i=0; i