File bayonne2-const_char.patch of Package bayonne2

#! /bin/sh /usr/share/dpatch/dpatch-run
## gcc-4.4.dpatch by  <Stefan Potyra <sistpoty@ubuntu.com>>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
Index: bayonne2-2.3.2/binders/bayonnexml/image.cpp
===================================================================
--- bayonne2-2.3.2.orig/binders/bayonnexml/image.cpp
+++ bayonne2-2.3.2/binders/bayonnexml/image.cpp
@@ -88,11 +88,11 @@ unsigned ParseImage::getList(const char
 	return count;
 }
 
-const char *ParseImage::dupString(const char *text)
+char *ParseImage::dupString(const char *text)
 {
 	char *str = (char *)alloc(strlen(text) + 1);
 	strcpy(str, text);
-	return (const char *)str;
+	return str;
 }
 
 void ParseImage::postCompile(Compile *cc, unsigned long mask)
Index: bayonne2-2.3.2/binders/bayonnexml/module.h
===================================================================
--- bayonne2-2.3.2.orig/binders/bayonnexml/module.h
+++ bayonne2-2.3.2/binders/bayonnexml/module.h
@@ -57,7 +57,7 @@ class ParseImage : public ScriptImage, p
 public:
 	ParseImage();
 
-	const char *dupString(const char *str);
+	char *dupString(const char *str);
 	unsigned getList(const char **args, const char *text, unsigned len, unsigned max);
 	void getCompile(Compile *cc, const char *name = "1");
 	void postCompile(Compile *cc, unsigned long mask = 0);
Index: bayonne2-2.3.2/binders/bayonnexml/parse.cpp
===================================================================
--- bayonne2-2.3.2.orig/binders/bayonnexml/parse.cpp
+++ bayonne2-2.3.2/binders/bayonnexml/parse.cpp
@@ -151,7 +151,7 @@ void ParseThread::characters(const unsig
 void ParseThread::startDocument(const char **attrib)
 {
 	const char *vargs[3];
-	const char *voicelib = NULL;
+	char *voicelib = NULL;
 	char *p;
 
 	memset(vargs, 0, sizeof(vargs));
@@ -628,8 +628,8 @@ void ParseThread::playAudio(const char *
 void ParseThread::doGoto(const char **attrib)
 {
 	const char *submit = NULL;
-	const char *value = NULL;
-	const char *label = NULL;
+	char *value = NULL;
+	char *label = NULL;
 	const char *args[10];
 	unsigned argc = 0;
 	char *p, *q;
@@ -787,7 +787,7 @@ void ParseThread::startBlock(const char
 void ParseThread::endBlock(void)
 {
 	char *p, *q;
-	const char *label;
+	char *label;
 	const char *args[10];
 
 	current->trap = 0;
@@ -807,7 +807,7 @@ void ParseThread::endBlock(void)
 		else
 		{
 			label = NULL;
-			p = strchr(bnext, '#');
+			p = const_cast<char *>(strchr(bnext, '#'));
 			if(p)
 			{
 				*p = 0;
Index: bayonne2-2.3.2/binders/ivrscript/binder.cpp
===================================================================
--- bayonne2-2.3.2.orig/binders/ivrscript/binder.cpp
+++ bayonne2-2.3.2/binders/ivrscript/binder.cpp
@@ -427,7 +427,7 @@ bool Binder::testRegistered(ScriptInterp
 	char *p;
 
 	setString(vbuf, sizeof(vbuf), v);
-	p = strchr(v, ':');
+	p = const_cast<char *>(strchr(v, ':'));
 	if(p)
 	{
 		*p = 0;
@@ -449,7 +449,7 @@ bool Binder::testExternal(ScriptInterp *
 	char *p;
 
 	setString(vbuf, sizeof(vbuf), v);
-	p = strchr(v, ':');
+	p = const_cast<char *>(strchr(v, ':'));
 	if(p)
 	{
 		*p = 0;
@@ -471,7 +471,7 @@ bool Binder::testAvailable(ScriptInterp
 	char *p;
 
 	setString(vbuf, sizeof(vbuf), v);
-	p = strchr(v, ':');
+	p = const_cast<char *>(strchr(v, ':'));
 	if(p)
 	{
 		*p = 0;
@@ -505,7 +505,7 @@ bool Binder::testReachable(ScriptInterp
 	char *p;
 
 	setString(vbuf, sizeof(vbuf), v);
-	p = strchr(v, ':');
+	p = const_cast<char *>(strchr(v, ':'));
 	if(p)
 	{
 		*p = 0;
Index: bayonne2-2.3.2/engine/sysexec.cpp
===================================================================
--- bayonne2-2.3.2.orig/engine/sysexec.cpp
+++ bayonne2-2.3.2/engine/sysexec.cpp
@@ -322,8 +322,9 @@ exit:
 void BayonneTSession::sysTone(const char *tsid, char *tok)
 {
 	Event event;
-	const char *loc, *tone, *cp;
+	const char *loc, *cp;
 	char *p;
+	char *tone;
 	timeout_t timeout = TIMEOUT_INF;
 	Audio::Level level = 26000;
 	TelTone::tonekey_t *key;
Index: bayonne2-2.3.2/modules/sip/driver.cpp
===================================================================
--- bayonne2-2.3.2.orig/modules/sip/driver.cpp
+++ bayonne2-2.3.2/modules/sip/driver.cpp
@@ -2016,7 +2016,7 @@ add:
 	}
 	while(gateways)
 	{
-		p = strrchr(gateways, ':');
+		p = const_cast<char *>(strrchr(gateways, ':'));
 		if(p && !stricmp(p, ":5060"))
 			*p = 0;
 
Index: bayonne2-2.3.2/modules/webservice/session.cpp
===================================================================
--- bayonne2-2.3.2.orig/modules/webservice/session.cpp
+++ bayonne2-2.3.2/modules/webservice/session.cpp
@@ -297,7 +297,7 @@ timeout:
 	req_query = NULL;
 	req_auth = NULL;
 	if(req_path)
-		tok = strchr(req_path, '?');
+		tok = const_cast<char *>(strchr(req_path, '?'));
 	else
 		tok = NULL;
 	if(tok)
@@ -335,9 +335,9 @@ timeout:
 			cp = buffer + 11;
 			while(isspace(*cp))
 				++cp;
-			tok = strrchr(cp, '\r');
+			tok = const_cast<char *>(strrchr(cp, '\r'));
 			if(!tok)
-				tok = strrchr(cp, '\n');
+				tok = const_cast<char *>(strrchr(cp, '\n'));
 			if(tok)
 				*tok = 0;
 			setString(agent, sizeof(agent), cp);
openSUSE Build Service is sponsored by