python/dist/src/Objects stringobject.c, 2.229, 2.230 longobject.c, 1.167, 1.168
Update of /cvsroot/python/python/dist/src/Objects In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14804/Objects Modified Files: stringobject.c longobject.c Log Message: SF bug #1224347: int/long unification and hex() Hex longs now print with lowercase letters like their int counterparts. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.229 retrieving revision 2.230 diff -u -d -r2.229 -r2.230 --- stringobject.c 20 Feb 2005 09:54:52 -0000 2.229 +++ stringobject.c 29 Jun 2005 23:29:54 -0000 2.230 @@ -3753,18 +3753,12 @@ } /* Fix up case for hex conversions. */ - switch (type) { - case 'x': - /* Need to convert all upper case letters to lower case. */ + if (type == 'X') { + /* Need to convert all lower case letters to upper case. + and need to convert 0x to 0X (and -0x to -0X). */ for (i = 0; i < len; i++) - if (buf[i] >= 'A' && buf[i] <= 'F') - buf[i] += 'a'-'A'; - break; - case 'X': - /* Need to convert 0x to 0X (and -0x to -0X). */ - if (buf[sign + 1] == 'x') - buf[sign + 1] = 'X'; - break; + if (buf[i] >= 'a' && buf[i] <= 'x') + buf[i] -= 'a'-'A'; } *pbuf = buf; *plen = len; Index: longobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v retrieving revision 1.167 retrieving revision 1.168 diff -u -d -r1.167 -r1.168 --- longobject.c 26 Apr 2005 03:45:25 -0000 1.167 +++ longobject.c 29 Jun 2005 23:29:55 -0000 1.168 @@ -1090,7 +1090,7 @@ assert(accumbits >= basebits); do { char cdigit = (char)(accum & (base - 1)); - cdigit += (cdigit < 10) ? '0' : 'A'-10; + cdigit += (cdigit < 10) ? '0' : 'a'-10; assert(p > PyString_AS_STRING(str)); *--p = cdigit; accumbits -= basebits; @@ -1144,7 +1144,7 @@ digit nextrem = (digit)(rem / base); char c = (char)(rem - nextrem * base); assert(p > PyString_AS_STRING(str)); - c += (c < 10) ? '0' : 'A'-10; + c += (c < 10) ? '0' : 'a'-10; *--p = c; rem = nextrem; --ntostore;
participants (1)
-
rhettingerīŧ users.sourceforge.net