1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
-
+
|
/*
* tclBinary.c --
*
* This file contains the implementation of the "binary" Tcl built-in
* command and the Tcl binary data object.
*
* Copyright (c) 1997 by Sun Microsystems, Inc.
* Copyright (c) 1998-1999 by Scriptics Corporation.
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS: @(#) $Id: tclBinary.c,v 1.28 2006/04/26 13:42:43 dgp Exp $
* RCS: @(#) $Id: tclBinary.c,v 1.29 2006/08/10 12:15:30 dkf Exp $
*/
#include "tclInt.h"
#include <math.h>
/*
|
| ︙ | | |
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
|
-
+
|
* value. */
int length) /* Length of the array of bytes, which must be
* >= 0. */
{
ByteArray *byteArrayPtr;
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("Tcl_SetByteArrayObj called with shared object");
Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayObj");
}
TclFreeIntRep(objPtr);
Tcl_InvalidateStringRep(objPtr);
byteArrayPtr = (ByteArray *) ckalloc(BYTEARRAY_SIZE(length));
byteArrayPtr->used = length;
byteArrayPtr->allocated = length;
|
| ︙ | | |
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
|
-
+
|
Tcl_SetByteArrayLength(
Tcl_Obj *objPtr, /* The ByteArray object. */
int length) /* New length for internal byte array. */
{
ByteArray *byteArrayPtr, *newByteArrayPtr;
if (Tcl_IsShared(objPtr)) {
Tcl_Panic("Tcl_SetObjLength called with shared object");
Tcl_Panic("%s called with shared object", "Tcl_SetByteArrayLength");
}
if (objPtr->typePtr != &tclByteArrayType) {
SetByteArrayFromAny(NULL, objPtr);
}
byteArrayPtr = GET_BYTEARRAY(objPtr);
if (length > byteArrayPtr->allocated) {
|
| ︙ | | |
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
|
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
|
-
+
|
if (TclNokia770Doubles()) {
return 2;
}
return 0;
#endif
}
Tcl_Panic("unexpected fall-through");
Tcl_Panic("unexpected fallthrough");
return 0;
}
/*
*----------------------------------------------------------------------
*
* CopyNumber --
|
| ︙ | | |