From b8a7e70cb5a1da6583e445be8f2afb03b8abbabf Mon Sep 17 00:00:00 2001 From: pjrm Date: Sun, 16 Sep 2007 14:27:13 +0000 Subject: [PATCH] trivial: Address some g++-4.2 writable-strings warnings. --- src/dom/cssparser.cpp | 2 +- src/dom/cssparser.h | 2 +- src/dom/lsimpl.cpp | 2 +- src/dom/lsimpl.h | 2 +- src/dom/svg/svgparser.cpp | 2 +- src/dom/svg/svgparser.h | 2 +- src/dom/svg/svgtypes.h | 4 ++-- src/dom/uri.cpp | 4 ++-- src/dom/uri.h | 20 ++++++++++---------- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/dom/cssparser.cpp b/src/dom/cssparser.cpp index d6aaac13d..7aed0dd22 100644 --- a/src/dom/cssparser.cpp +++ b/src/dom/cssparser.cpp @@ -76,7 +76,7 @@ void CssParser::getColumnAndRow(int p, int &colResult, int &rowResult, int &last /** * */ -void CssParser::error(char *fmt, ...) +void CssParser::error(char const *fmt, ...) { int lineNr; int colNr; diff --git a/src/dom/cssparser.h b/src/dom/cssparser.h index f03b243da..6c7db16f9 100644 --- a/src/dom/cssparser.h +++ b/src/dom/cssparser.h @@ -81,7 +81,7 @@ private: /** * */ - void error(char *fmt, ...) + void error(char const *fmt, ...) #ifdef G_GNUC_PRINTF G_GNUC_PRINTF(2, 3) #endif diff --git a/src/dom/lsimpl.cpp b/src/dom/lsimpl.cpp index 84d12ddfb..40b464814 100644 --- a/src/dom/lsimpl.cpp +++ b/src/dom/lsimpl.cpp @@ -272,7 +272,7 @@ void LSSerializerImpl::spaces() /** * */ -void LSSerializerImpl::po(char *fmt, ...) +void LSSerializerImpl::po(char const *fmt, ...) { char str[257]; va_list args; diff --git a/src/dom/lsimpl.h b/src/dom/lsimpl.h index 0dd0dc62c..2375a1d49 100644 --- a/src/dom/lsimpl.h +++ b/src/dom/lsimpl.h @@ -236,7 +236,7 @@ private: void spaces(); - void po(char *fmt, ...) + void po(char const *fmt, ...) #ifdef G_GNUC_PRINTF G_GNUC_PRINTF(2, 3) #endif diff --git a/src/dom/svg/svgparser.cpp b/src/dom/svg/svgparser.cpp index a6e017110..350277f47 100644 --- a/src/dom/svg/svgparser.cpp +++ b/src/dom/svg/svgparser.cpp @@ -89,7 +89,7 @@ XMLCh SvgParser::get(int p) * Test if the given substring exists at the given position * in parsebuf. Use get() in case of out-of-bounds */ -bool SvgParser::match(int pos, char *str) +bool SvgParser::match(int pos, char const *str) { while (*str) { diff --git a/src/dom/svg/svgparser.h b/src/dom/svg/svgparser.h index 548077dd5..2b7119040 100644 --- a/src/dom/svg/svgparser.h +++ b/src/dom/svg/svgparser.h @@ -88,7 +88,7 @@ private: * Test if the given substring exists at the given position * in parsebuf. Use get() in case of out-of-bounds */ - bool match(int pos, char *str); + bool match(int pos, char const *str); /** * diff --git a/src/dom/svg/svgtypes.h b/src/dom/svg/svgtypes.h index bb169885d..59fe38ab5 100644 --- a/src/dom/svg/svgtypes.h +++ b/src/dom/svg/svgtypes.h @@ -4013,7 +4013,7 @@ protected: ########################################################################### #########################################################################*/ -static char *pathSegLetters[] = +static char const *const pathSegLetters[] = { "@", // PATHSEG_UNKNOWN, "z", // PATHSEG_CLOSEPATH @@ -4091,7 +4091,7 @@ public: int typ = type; if (typ<0 || typ>PATHSEG_CURVETO_QUADRATIC_SMOOTH_REL) typ = PATHSEG_UNKNOWN; - char *ch = pathSegLetters[typ]; + char const *ch = pathSegLetters[typ]; DOMString letter = ch; return letter; } diff --git a/src/dom/uri.cpp b/src/dom/uri.cpp index 9eff6b8b0..e68caf898 100644 --- a/src/dom/uri.cpp +++ b/src/dom/uri.cpp @@ -49,7 +49,7 @@ namespace dom typedef struct { int ival; - char *sval; + char const *sval; int port; } LookupEntry; @@ -572,7 +572,7 @@ int URI::peek(int p) -int URI::match(int p0, char *key) +int URI::match(int p0, char const *key) { int p = p0; while (p < parselen) diff --git a/src/dom/uri.h b/src/dom/uri.h index 87a287b39..10d13365c 100644 --- a/src/dom/uri.h +++ b/src/dom/uri.h @@ -70,23 +70,23 @@ public: /** * */ - URI(const DOMString &str); + URI(DOMString const &str); /** * */ - URI(const char *str); + URI(char const *str); /** * Copy constructor */ - URI(const URI &other); + URI(URI const &other); /** * Assignment */ - URI &operator=(const URI &other); + URI &operator=(URI const &other); /** * @@ -96,7 +96,7 @@ public: /** * */ - virtual bool parse(const DOMString &str); + virtual bool parse(DOMString const &str); /** * @@ -162,7 +162,7 @@ public: /** * */ - virtual URI resolve(const URI &other) const; + virtual URI resolve(URI const &other) const; /** * @@ -174,7 +174,7 @@ private: void init(); //assign values of other to this. used by copy constructor - void assign(const URI &other); + void assign(URI const &other); int scheme; @@ -196,13 +196,13 @@ private: std::vector fragment; - void error(const char *fmt, ...) + void error(char const *fmt, ...) #ifdef G_GNUC_PRINTF G_GNUC_PRINTF(2, 3) #endif ; - void trace(const char *fmt, ...) + void trace(char const *fmt, ...) #ifdef G_GNUC_PRINTF G_GNUC_PRINTF(2, 3) #endif @@ -210,7 +210,7 @@ private: int peek(int p); - int match(int p, char *key); + int match(int p, char const *key); int parseHex(int p, int &result); -- 2.30.2