Diff
Not logged in

Differences From Artifact [0e3ccdf90c]:

To Artifact [7d9c64e78c]:


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.13.4.9 2005/10/18 20:46:18 dgp Exp $
 * RCS: @(#) $Id: tclBinary.c,v 1.13.4.10 2005/12/02 18:42:06 dgp Exp $
 */

#include "tclInt.h"

#include <math.h>

/*
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1081
1082
1083
1084
1085
1086
1087

1088
1089
1090
1091
1092
1093
1094







-







#endif /* TCL_MEM_DEBUG */

		resultPtr = Tcl_ObjSetVar2(interp, objv[arg], NULL, valuePtr,
			TCL_LEAVE_ERR_MSG);
		arg++;
		if (resultPtr == NULL) {
		    DeleteScanNumberCache(numberCachePtr);
		    Tcl_DecrRefCount(valuePtr);	/* unneeded */
		    return TCL_ERROR;
		}
		offset += count;
		break;
	    }
	    case 'b':
	    case 'B': {
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1135
1136
1137
1138
1139
1140
1141

1142
1143
1144
1145
1146
1147
1148







-







		}

		resultPtr = Tcl_ObjSetVar2(interp, objv[arg], NULL, valuePtr,
			TCL_LEAVE_ERR_MSG);
		arg++;
		if (resultPtr == NULL) {
		    DeleteScanNumberCache(numberCachePtr);
		    Tcl_DecrRefCount(valuePtr);	/* unneeded */
		    return TCL_ERROR;
		}
		offset += (count + 7 ) / 8;
		break;
	    }
	    case 'h':
	    case 'H': {
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1191
1192
1193
1194
1195
1196
1197

1198
1199
1200
1201
1202
1203
1204







-







		}

		resultPtr = Tcl_ObjSetVar2(interp, objv[arg], NULL, valuePtr,
			TCL_LEAVE_ERR_MSG);
		arg++;
		if (resultPtr == NULL) {
		    DeleteScanNumberCache(numberCachePtr);
		    Tcl_DecrRefCount(valuePtr);	/* unneeded */
		    return TCL_ERROR;
		}
		offset += (count + 1) / 2;
		break;
	    }
	    case 'c':
		size = 1;
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1260
1261
1262
1263
1264
1265
1266

1267
1268
1269
1270
1271
1272
1273







-







		}

		resultPtr = Tcl_ObjSetVar2(interp, objv[arg], NULL, valuePtr,
			TCL_LEAVE_ERR_MSG);
		arg++;
		if (resultPtr == NULL) {
		    DeleteScanNumberCache(numberCachePtr);
		    Tcl_DecrRefCount(valuePtr);	/* unneeded */
		    return TCL_ERROR;
		}
		break;
	    }
	    case 'x':
		if (count == BINARY_NOCOUNT) {
		    count = 1;