Ticket #13183: 0001-added-copy-constructor-for-BStringRef-PVS-issue-32.patch

File 0001-added-copy-constructor-for-BStringRef-PVS-issue-32.patch, 1.1 KB (added by owenca, 3 years ago)
  • headers/os/support/String.h

    From 8e9dd5494ad4d4e5bc14c6d9069d4a15ab790da6 Mon Sep 17 00:00:00 2001
    From: Owen <owenca@users.noreply.github.com>
    Date: Sun, 8 Jan 2017 19:55:51 +0000
    Subject: [PATCH] added copy constructor for BStringRef (PVS issue 32)
    
    ---
     headers/os/support/String.h | 1 +
     src/kits/support/String.cpp | 7 +++++++
     2 files changed, 8 insertions(+)
    
    diff --git a/headers/os/support/String.h b/headers/os/support/String.h
    index 9e33c3c..144f791 100644
    a b operator!=(const char* str, const BString& string)  
    609609
    610610class BStringRef {
    611611public:
     612    BStringRef(const BStringRef& rc);
    612613    BStringRef(BString& string, int32 position);
    613614    ~BStringRef() {}
    614615
  • src/kits/support/String.cpp

    diff --git a/src/kits/support/String.cpp b/src/kits/support/String.cpp
    index 5533f03..91dbcdb 100644
    a b private:  
    135135//  #pragma mark - BStringRef
    136136
    137137
     138BStringRef::BStringRef(const BStringRef& rc)
     139    :
     140    fString(rc.fString), fPosition(rc.fPosition)
     141{
     142}
     143
     144
    138145BStringRef::BStringRef(BString& string, int32 position)
    139146    :
    140147    fString(string), fPosition(position)