From 7c7f5ce019e8eff60777b642821f2232c1ef7d3b Mon Sep 17 00:00:00 2001 From: dkf Date: Thu, 10 Feb 2005 10:28:02 +0000 Subject: More consistency. [Bug 1117017] --- ChangeLog | 5 +++++ doc/binary.n | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0760372..76e0127 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-02-10 Donal K. Fellows + + * doc/binary.n: Made the documentation of sign bit masking and + [binary scan] consistent. [Bug 1117017] + 2005-02-01 Don Porter * generic/tclExecute.c (TclCompEvalObj): Removed stray statement diff --git a/doc/binary.n b/doc/binary.n index 582b562..d25e120 100644 --- a/doc/binary.n +++ b/doc/binary.n @@ -4,7 +4,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: binary.n,v 1.11.2.7 2004/10/27 14:23:41 dkf Exp $ +'\" RCS: @(#) $Id: binary.n,v 1.11.2.8 2005/02/10 10:28:21 dkf Exp $ '\" .so man.macros .TH binary n 8.0 Tcl "Tcl Built-In Commands" @@ -476,7 +476,7 @@ stored in \fBvar2\fR. Note that the integers returned are signed, but they can be converted to unsigned 8-bit quantities using an expression like: .CS -\fBexpr ( $num + 0x100 ) % 0x100\fR +\fBexpr { $num & 0xff }\fR .CE .RE .IP \fBs\fR 5 @@ -495,7 +495,7 @@ stored in \fBvar2\fR. Note that the integers returned are signed, but they can be converted to unsigned 16-bit quantities using an expression like: .CS -\fBexpr ( $num + 0x10000 ) % 0x10000\fR +\fBexpr { $num & 0xffff }\fR .CE .RE .IP \fBS\fR 5 @@ -521,8 +521,12 @@ example, \fBbinary scan \\x05\\x00\\x00\\x00\\x07\\x00\\x00\\x00\\xf0\\xff\\xff\\xff i2i* var1 var2\fR .CE will return \fB2\fR with \fB5 7\fR stored in \fBvar1\fR and \fB-16\fR -stored in \fBvar2\fR. Note that the integers returned are signed and -cannot be represented by Tcl as unsigned values. +stored in \fBvar2\fR. Note that the integers returned are signed, but +they can be converted to unsigned 32-bit quantities using an expression +like: +.CS +\fBexpr { $num & 0xffffffff }\fR +.CE .RE .IP \fBI\fR 5 This form is the same as \fBI\fR except that the data is interpreted -- cgit v0.12