Makes all samples compile with -Wall -Wshadow -Werror.

This commit is contained in:
vladlosev
2010-02-27 08:21:11 +00:00
parent 70eceaf8e7
commit fe78760959
7 changed files with 49 additions and 49 deletions

View File

@@ -40,13 +40,13 @@
// A simple string class.
class MyString {
private:
const char * c_string_;
const char* c_string_;
const MyString& operator=(const MyString& rhs);
public:
// Clones a 0-terminated C string, allocating memory using new.
static const char * CloneCString(const char * c_string);
static const char* CloneCString(const char* a_c_string);
////////////////////////////////////////////////////////////
//
@@ -56,8 +56,8 @@ class MyString {
MyString() : c_string_(NULL) {}
// Constructs a MyString by cloning a 0-terminated C string.
explicit MyString(const char * c_string) : c_string_(NULL) {
Set(c_string);
explicit MyString(const char* a_c_string) : c_string_(NULL) {
Set(a_c_string);
}
// Copy c'tor
@@ -72,14 +72,14 @@ class MyString {
~MyString() { delete[] c_string_; }
// Gets the 0-terminated C string this MyString object represents.
const char * c_string() const { return c_string_; }
const char* c_string() const { return c_string_; }
size_t Length() const {
return c_string_ == NULL ? 0 : strlen(c_string_);
}
// Sets the 0-terminated C string this MyString object represents.
void Set(const char * c_string);
void Set(const char* c_string);
};