[PATCH V2 (rename isset as suggested by Adrian)] pathencode: change isset name to avoid name collision

André Sintzoff andre.sintzoff at gmail.com
Sun Sep 30 08:36:21 CDT 2012


# HG changeset patch
# User André Sintzoff <andre.sintzoff at gmail.com>
# Date 1349011887 -7200
# Node ID 53069aa9bf3bd0fe5075a864201ab0e708c55332
# Parent  5c89e7fa5bc20597080494aea43a09903e9e7a6a
pathencode: change isset name to avoid name collision

On old Mac OS X versions (10.4), arpa/inet.h (included in mercurial/util.h)
includes system/param.h which defines isset macro.

diff --git a/mercurial/pathencode.c b/mercurial/pathencode.c
--- a/mercurial/pathencode.c
+++ b/mercurial/pathencode.c
@@ -55,7 +55,7 @@
 	DDEFAULT,
 };
 
-static inline int isset(const uint32_t bitset[], char c)
+static inline int inset(const uint32_t bitset[], char c)
 {
 	return bitset[((uint8_t)c) >> 5] & (1 << (((uint8_t)c) & 31));
 }
@@ -419,7 +419,7 @@
 			}
 			break;
 		case DEFAULT:
-			while (isset(onebyte, src[i])) {
+			while (inset(onebyte, src[i])) {
 				charcopy(dest, &destlen, destsize, src[i++]);
 				if (i == len)
 					goto done;
@@ -439,14 +439,14 @@
 				i++;
 				break;
 			default:
-				if (isset(onebyte, src[i])) {
+				if (inset(onebyte, src[i])) {
 					do {
 						charcopy(dest, &destlen,
 							 destsize, src[i++]);
 					} while (i < len &&
-						 isset(onebyte, src[i]));
+						 inset(onebyte, src[i]));
 				}
-				else if (isset(twobytes, src[i])) {
+				else if (inset(twobytes, src[i])) {
 					char c = src[i++];
 					charcopy(dest, &destlen, destsize, '_');
 					charcopy(dest, &destlen, destsize,


More information about the Mercurial-devel mailing list