diff options
author | mmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-06 15:46:49 +0000 |
---|---|---|
committer | mmentovai@google.com <mmentovai@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-06 15:46:49 +0000 |
commit | 294300a62be265e4b17eb9df0ee4ddfd543a1fb4 (patch) | |
tree | 0b794a735c8d8e9992105bb5a7c22fac68f583ea /base | |
parent | 7485061dd4022edb389503f0f8cc53421e49eb83 (diff) | |
download | chromium_src-294300a62be265e4b17eb9df0ee4ddfd543a1fb4.zip chromium_src-294300a62be265e4b17eb9df0ee4ddfd543a1fb4.tar.gz chromium_src-294300a62be265e4b17eb9df0ee4ddfd543a1fb4.tar.bz2 |
Portability fix for JSONWriter. gcc warns when the declaration order doesn't match the initialization order. Tossed in a couple of changes for better style guide conformance for good measure.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r-- | base/json_writer.cc | 4 | ||||
-rw-r--r-- | base/json_writer.h | 9 |
2 files changed, 7 insertions, 6 deletions
diff --git a/base/json_writer.cc b/base/json_writer.cc index 512e0a1..0a1b8bb 100644 --- a/base/json_writer.cc +++ b/base/json_writer.cc @@ -49,8 +49,8 @@ void JSONWriter::Write(const Value* const node, bool pretty_print, } JSONWriter::JSONWriter(bool pretty_print, std::string* json) - : pretty_print_(pretty_print), - json_string_(json) { + : json_string_(json), + pretty_print_(pretty_print) { DCHECK(json); } diff --git a/base/json_writer.h b/base/json_writer.h index 9f8f8d3..38255f3 100644 --- a/base/json_writer.h +++ b/base/json_writer.h @@ -27,8 +27,8 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -#ifndef CHROME_COMMON_JSON_WRITER_H__ -#define CHROME_COMMON_JSON_WRITER_H__ +#ifndef BASE_JSON_WRITER_H_ +#define BASE_JSON_WRITER_H_ #include <string> @@ -50,7 +50,6 @@ class JSONWriter { private: JSONWriter(bool pretty_print, std::string* json); - DISALLOW_EVIL_CONSTRUCTORS(JSONWriter); // Called recursively to build the JSON string. Whe completed, value is // json_string_ will contain the JSON. @@ -66,6 +65,8 @@ class JSONWriter { std::string* json_string_; bool pretty_print_; + + DISALLOW_COPY_AND_ASSIGN(JSONWriter); }; -#endif // CHROME_COMMON_JSON_WRITER_H__ +#endif // BASE_JSON_WRITER_H_ |