Tcl Source Code

Check-in [6e311ccfa4]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:
* generic/tclObj.c: TclParseNumber calls meant to parse an integer value now pass the TCL_PARSE_INTEGER_ONLY flag.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | kennykb-numerics-branch
Files: files | file ages | folders
SHA1:6e311ccfa465bdf5d052c9c72fa47a0c9d757a93
User & Date: dgp 2005-09-01 16:27:50
Context
2005-09-02
17:42
[kennykb-numerics-branch]
* generic/tclScan.c: Bug fix: The %o, %x, %i formats o...
check-in: 7f0027be0c user: dgp tags: kennykb-numerics-branch
2005-09-01
16:27
* generic/tclObj.c: TclParseNumber calls meant to parse an integer value now pas...
check-in: 6e311ccfa4 user: dgp tags: kennykb-numerics-branch
16:09
[kennykb-numerics-branch]
* generic/tclScan.c: Extended scan to accept the %ll...
check-in: fc4c109c84 user: dgp tags: kennykb-numerics-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to ChangeLog.

1
2
3



4
5
6
7
8
9
10
2005-09-01  Don Porter  <dgp@users.sourceforge.net>

	[kennykb-numerics-branch]




	* generic/tclScan.c:	Extended [scan] to accept the %lld,
	%llo, %llx, and %lli formats.  Numeric scanning is now done
	via TclParseNumber calls.

	* generic/tclInt.h:	Extended TclParseNumber to accept new flag
	* generic/tclStrToD.c:	values TCL_PARSE_INTEGER_ONLY,



>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2005-09-01  Don Porter  <dgp@users.sourceforge.net>

	[kennykb-numerics-branch]

	* generic/tclObj.c:	TclParseNumber calls meant to parse an
	integer value now pass the TCL_PARSE_INTEGER_ONLY flag.

	* generic/tclScan.c:	Extended [scan] to accept the %lld,
	%llo, %llx, and %lli formats.  Numeric scanning is now done
	via TclParseNumber calls.

	* generic/tclInt.h:	Extended TclParseNumber to accept new flag
	* generic/tclStrToD.c:	values TCL_PARSE_INTEGER_ONLY,

Changes to generic/tclObj.c.

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
....
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
....
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
 * Copyright (c) 1999 by Scriptics Corporation.
 * Copyright (c) 2001 by ActiveState Corporation.
 * Copyright (c) 2005 by Kevin B. Kenny.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclObj.c,v 1.72.2.32 2005/08/30 19:20:42 dgp Exp $
 */

#include "tclInt.h"
#include "tommath.h"
#include <float.h>

#define BIGNUM_AUTO_NARROW 1
................................................................................
		char *s = "integer value too large to represent";
		Tcl_Obj* msg = Tcl_NewStringObj(s, -1);
		Tcl_SetObjResult(interp, msg);
		Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, (char *)NULL);
	    }
	    return TCL_ERROR;
	}
    } while (TclParseNumber(interp, objPtr, "integer",
			    NULL, -1, NULL, 0)==TCL_OK);
    return TCL_ERROR;
}
#ifndef NO_WIDE_TYPE
 
/*
 *----------------------------------------------------------------------
 *
................................................................................
		char *s = "integer value too large to represent";
		Tcl_Obj* msg = Tcl_NewStringObj(s, -1);
		Tcl_SetObjResult(interp, msg);
		Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, (char *)NULL);
	    }
	    return TCL_ERROR;
	}
    } while (TclParseNumber(interp, objPtr, "integer",
			    NULL, -1, NULL, 0)==TCL_OK);
    return TCL_ERROR;
}
 
/*
 *----------------------------------------------------------------------
 *
 * FreeBignum --
................................................................................
			Tcl_NewStringObj("expected integer but got \"", -1);
		Tcl_AppendObjToObj(msg, objPtr);
		Tcl_AppendToObj(msg, "\"", -1);
		Tcl_SetObjResult(interp, msg);
	    }
	    return TCL_ERROR;
	}
    } while (TclParseNumber(interp, objPtr, "integer",
			    NULL, -1, NULL, 0)==TCL_OK);
    return TCL_ERROR;
}
 
/*
 *----------------------------------------------------------------------
 *
 * Tcl_SetBignumObj --







|







 







|
|







 







|
|







 







|
|







8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
....
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
....
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
....
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
 * Copyright (c) 1999 by Scriptics Corporation.
 * Copyright (c) 2001 by ActiveState Corporation.
 * Copyright (c) 2005 by Kevin B. Kenny.  All rights reserved.
 *
 * See the file "license.terms" for information on usage and redistribution of
 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
 *
 * RCS: @(#) $Id: tclObj.c,v 1.72.2.33 2005/09/01 16:27:51 dgp Exp $
 */

#include "tclInt.h"
#include "tommath.h"
#include <float.h>

#define BIGNUM_AUTO_NARROW 1
................................................................................
		char *s = "integer value too large to represent";
		Tcl_Obj* msg = Tcl_NewStringObj(s, -1);
		Tcl_SetObjResult(interp, msg);
		Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, (char *)NULL);
	    }
	    return TCL_ERROR;
	}
    } while (TclParseNumber(interp, objPtr, "integer", NULL, -1, NULL,
	    TCL_PARSE_INTEGER_ONLY)==TCL_OK);
    return TCL_ERROR;
}
#ifndef NO_WIDE_TYPE
 
/*
 *----------------------------------------------------------------------
 *
................................................................................
		char *s = "integer value too large to represent";
		Tcl_Obj* msg = Tcl_NewStringObj(s, -1);
		Tcl_SetObjResult(interp, msg);
		Tcl_SetErrorCode(interp, "ARITH", "IOVERFLOW", s, (char *)NULL);
	    }
	    return TCL_ERROR;
	}
    } while (TclParseNumber(interp, objPtr, "integer", NULL, -1, NULL,
	    TCL_PARSE_INTEGER_ONLY)==TCL_OK);
    return TCL_ERROR;
}
 
/*
 *----------------------------------------------------------------------
 *
 * FreeBignum --
................................................................................
			Tcl_NewStringObj("expected integer but got \"", -1);
		Tcl_AppendObjToObj(msg, objPtr);
		Tcl_AppendToObj(msg, "\"", -1);
		Tcl_SetObjResult(interp, msg);
	    }
	    return TCL_ERROR;
	}
    } while (TclParseNumber(interp, objPtr, "integer", NULL, -1, NULL,
	    TCL_PARSE_INTEGER_ONLY)==TCL_OK);
    return TCL_ERROR;
}
 
/*
 *----------------------------------------------------------------------
 *
 * Tcl_SetBignumObj --