------------------------------------------------------------ revno: 12656 revision-id: squid3@treenet.co.nz-20131120001113-2ihj1l3ahb2opt8c parent: squid3@treenet.co.nz-20131120001016-i9wq2n2gzcaqmfki committer: Amos Jeffries branch nick: 3.3 timestamp: Tue 2013-11-19 17:11:13 -0700 message: Windows: Ensure array index is an integer in C code MSVC compiler does not accept non-integer types for array indexes so we must cast these CHAR index values to int before use. This is an iCelero Inc sponsored fix. ------------------------------------------------------------ # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: squid3@treenet.co.nz-20131120001113-2ihj1l3ahb2opt8c # target_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # testament_sha1: e827cb4fcb4b053dcdb8306aa3d1a446167814be # timestamp: 2013-11-20 00:17:08 +0000 # source_branch: http://bzr.squid-cache.org/bzr/squid3/3.3 # base_revision_id: squid3@treenet.co.nz-20131120001016-\ # i9wq2n2gzcaqmfki # # Begin patch === modified file 'lib/encrypt.c' --- lib/encrypt.c 2012-08-28 13:00:30 +0000 +++ lib/encrypt.c 2013-11-20 00:11:13 +0000 @@ -148,7 +148,7 @@ int n; { for (; n--; pc++, a++) - *a = e[*pc]; + *a = e[(int)*pc]; } static void @@ -164,7 +164,7 @@ for (i = 0; i < 8; i++) { for (j = 0, sbval = 0; j < 6; j++) - sbval = (sbval << 1) | (nachr_r[*e++] ^ *schl++); + sbval = (sbval << 1) | (nachr_r[(int)*e++] ^ *schl++); sbval = S_BOX[i][sbval]; for (tp += 4, j = 4; j--; sbval >>= 1) *--tp = sbval & 1; @@ -173,7 +173,7 @@ e = PERM; for (i = 0; i < BS2; i++) - *nachr_l++ ^= tmp[*e++]; + *nachr_l++ ^= tmp[(int)*e++]; } void