| ︙ | | |
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
|
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
|
-
+
-
+
|
/*
* Initialize bytes to start of the object's string rep if the caller
* didn't pass anything else.
*/
if (bytes == NULL) {
if (interp == NULL && endPtrPtr == NULL) {
if (TclHasIntRep(objPtr, &tclDictType)) {
if (TclHasInternalRep(objPtr, &tclDictType)) {
/* A dict can never be a (single) number */
return TCL_ERROR;
}
if (TclHasIntRep(objPtr, &tclListType)) {
if (TclHasInternalRep(objPtr, &tclListType)) {
int length;
/* A list can only be a (single) number if its length == 1 */
TclListObjLength(NULL, objPtr, &length);
if (length != 1) {
return TCL_ERROR;
}
}
|
| ︙ | | |
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
|
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
|
-
+
|
}
/*
* Generate and store the appropriate internal rep.
*/
if (status == TCL_OK && objPtr != NULL) {
TclFreeIntRep(objPtr);
TclFreeInternalRep(objPtr);
switch (acceptState) {
case SIGNUM:
case BAD_OCTAL:
case ZERO_X:
case ZERO_O:
case ZERO_B:
case ZERO_D:
|
| ︙ | | |
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
|
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
|
-
+
|
}
}
}
if ((err == MP_OKAY) && octalSignificandOverflow) {
if (signum) {
err = mp_neg(&octalSignificandBig, &octalSignificandBig);
}
TclSetBignumIntRep(objPtr, &octalSignificandBig);
TclSetBignumInternalRep(objPtr, &octalSignificandBig);
}
if (err != MP_OKAY) {
return TCL_ERROR;
}
break;
case ZERO:
|
| ︙ | | |
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
|
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
|
-
+
|
}
}
}
if ((err == MP_OKAY) && significandOverflow) {
if (signum) {
err = mp_neg(&significandBig, &significandBig);
}
TclSetBignumIntRep(objPtr, &significandBig);
TclSetBignumInternalRep(objPtr, &significandBig);
}
if (err != MP_OKAY) {
return TCL_ERROR;
}
break;
case FRACTION:
|
| ︙ | | |