File: const_cast_conversion.dpatch

package info (click to toggle)
libcommoncpp2 1.7.3-1.1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,060 kB
  • ctags: 3,614
  • sloc: cpp: 27,934; sh: 9,842; ansic: 1,123; makefile: 228; xml: 5
file content (28 lines) | stat: -rw-r--r-- 879 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/sh /usr/share/dpatch/dpatch-run
## const_cast_conversion.dpatch by Mehdi Dogguy <mehdi@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: constant string to char* conversion

@DPATCH@
diff -urNad libcommoncpp2-1.7.3~/src/cidr.cpp libcommoncpp2-1.7.3/src/cidr.cpp
--- libcommoncpp2-1.7.3~/src/cidr.cpp	2009-01-16 13:27:00.000000000 +0100
+++ libcommoncpp2-1.7.3/src/cidr.cpp	2010-02-01 15:15:53.000000000 +0100
@@ -202,7 +202,7 @@
 #if defined(_MSC_VER) && _MSC_VER >= 1500
 	ep = (char *)strchr(cp, '/');
 #else
- 	ep = strchr(cp, '/');
+ 	ep = strchr(const_cast<char *>(cp), '/');
 #endif
 
 	if(ep)
@@ -332,7 +332,7 @@
 	memset(&netmask, 0, sizeof(netmask));
 	bitset((bit_t *)&netmask, getMask(cp));
 	setString(cbuf, sizeof(cbuf), cp);
-	ep = strchr(cp, '/');
+	ep = strchr(const_cast<char *>(cp), '/');
 	if(ep)
 		*ep = 0;