Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-08-31
02:15 • Ticket [419528ffff] Non portable code in tclIndexObj.c status still Closed w... artifact: b2f6a5eeae user: hobbs
01:58 • Closed ticket [419528ffff]. artifact: da7a333acb user: hobbs
01:14 • Ticket [419528ffff]: 1 change artifact: 88855b54bf user: hobbs
2001-08-30
21:52 • Ticket [419528ffff]: 5 changes artifact: 7a2a9408ef user: msofer
2001-08-14
06:08 • Ticket [419528ffff]: 4 changes artifact: 4f1a3d484e user: msofer
06:08 • Ticket [419528ffff]: 4 changes artifact: 64af90267a user: msofer
06:08 • Add attachment patch419528.txt to ticket [419528ffff] artifact: 86aac23cce user: msofer
2001-04-28
07:40 • Ticket [419528ffff] Non portable code in tclIndexObj.c status still Open wit... artifact: dcd8f3dbd3 user: dgp
07:40 • Ticket [419528ffff]: 1 change artifact: 37100b8e54 user: dgp
2001-04-27
16:38 • New ticket [419528ffff]. artifact: 411961b13f user: nobody

Non portable code in tclIndexObj.c

Closed / Fixed419528ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 25 years ago
Descriptionplain2001-04-27 16:38:07
I had a problem with porting tcl to a Cray machine.
The code at lines 197, 242-245 in tclIndexObj.c assumes
a byte
addressable machine.  It casts a pointer to (size_t)
and then adds a
byte count to come up with a (char**).  This only works
on a byte
addressable machine.  It should be casting to (char*)
instead of (size_t)
since it is adding a number of characters.

I also had a problem with tk routine tkUnixFont.c at
line 41.
#define     FONTMAP_PAGES \
       (1 << (sizeof(Tcl_UniChar)*8 - FONTMAP_SHIFT))
There is an implicit assumption that
sizeof(Tcl_UniChar) is 2 bytes.
On a Cray it is 8 bytes, so that  FONTMAP_PAGES becomes
a huge
number, which is used to define the size of  an array
in structure  FontFamily.
My work around was to hardcode a 2 for
sizeof(Tcl_UniChar).

I believe these problems are in the 8.4 versions also.

Clay Andreasen ([email protected])
dgp Ticket [419528ffff]: 1 change [History diff]2001-04-28 07:40:05
dgpplain2001-04-28 07:40:06
Logged In: YES 
user_id=80530

Assigning to the Index Object category.

The Tk bug should be reported to the Tk project.

http://sourceforge.net/projects/tktoolkit/
msoferplain2001-08-14 06:08:30
Logged In: YES 
user_id=148712

Is the enclosed patch what is requested? It runs OK with
gcc/linux/i386.
msoferplain2001-08-14 06:08:31
File Added - 9498: patch419528.txt
msoferplain2001-08-30 21:52:18
Logged In: YES 
user_id=148712

Clay tells me that the enclosed patch solves his tcl
problem, and that he did report the tk bug to the tktoolkit
project.

Jan: would you care to take it from here?
hobbs Ticket [419528ffff]: 1 change [History diff]2001-08-31 01:14:45
hobbsplain2001-08-31 01:58:43
Logged In: YES 
user_id=72656

applied to 8.3.3+ and 8.4a4cvs.
hobbsplain2001-08-31 02:15:44
Logged In: YES 
user_id=72656

FWIW, these were change to size_t from long before, and 
this patch changed that to (char *).
Log in (anonymous is fine) to add a comment.

Attachments: