diff options
author | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2010-02-27 08:21:11 +0000 |
---|---|---|
committer | vladlosev <vladlosev@861a406c-534a-0410-8894-cb66d6ee9925> | 2010-02-27 08:21:11 +0000 |
commit | 8f3826a7fa25e245cfe1124ee303483c102236d0 (patch) | |
tree | 16852104c3aae569b2100ad1351206b3f7178f45 /samples/sample2.cc | |
parent | 221d3c6bd315b45b8ce354d7548c1c519e1e1752 (diff) | |
download | gtest-8f3826a7fa25e245cfe1124ee303483c102236d0.tar.gz gtest-8f3826a7fa25e245cfe1124ee303483c102236d0.tar.bz2 gtest-8f3826a7fa25e245cfe1124ee303483c102236d0.tar.xz |
Makes all samples compile with -Wall -Wshadow -Werror.
git-svn-id: http://googletest.googlecode.com/svn/trunk@383 861a406c-534a-0410-8894-cb66d6ee9925
Diffstat (limited to 'samples/sample2.cc')
-rw-r--r-- | samples/sample2.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/samples/sample2.cc b/samples/sample2.cc index 53857c0..5f763b9 100644 --- a/samples/sample2.cc +++ b/samples/sample2.cc @@ -36,21 +36,21 @@ #include <string.h> // Clones a 0-terminated C string, allocating memory using new. -const char * MyString::CloneCString(const char * c_string) { - if (c_string == NULL) return NULL; +const char* MyString::CloneCString(const char* a_c_string) { + if (a_c_string == NULL) return NULL; - const size_t len = strlen(c_string); - char * const clone = new char[ len + 1 ]; - memcpy(clone, c_string, len + 1); + const size_t len = strlen(a_c_string); + char* const clone = new char[ len + 1 ]; + memcpy(clone, a_c_string, len + 1); return clone; } // Sets the 0-terminated C string this MyString object // represents. -void MyString::Set(const char * c_string) { +void MyString::Set(const char* a_c_string) { // Makes sure this works when c_string == c_string_ - const char * const temp = MyString::CloneCString(c_string); + const char* const temp = MyString::CloneCString(a_c_string); delete[] c_string_; c_string_ = temp; } |