Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(734)

Issue 1574041: tcs: update for 32-bit Rune (2)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by knieriem
Modified:
8 years, 7 months ago
Reviewers:
CC:
rsc, codebot
Visibility:
Public.

Description

This patch fixes unicode, unicode-be and unicode-le input, and unicode output, which have been broken due to the change of the size of Rune from two bytes to four bytes. (Unicode-le and unicode-be output have not been affected, since they work different, and produce correct output as long as sizeof(Rune) >= 2.) In all of the affected functions an extra array of N elements of type u16int is used to temporarily store the 16-bit unicode data. As this increases stack usage, perhaps a different, slightly more complicated solution might be preferred, where only a single `Rune buf[N]' is used for both temporary storage and the result.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+21 lines, -11 lines) Patch
M src/cmd/tcs/tcs.c View 5 chunks +21 lines, -11 lines 0 comments Download

Messages

Total messages: 2
knieriem
13 years, 10 months ago (2010-06-06 23:00:57 UTC) #1
rsc
13 years, 10 months ago (2010-06-28 21:43:35 UTC) #2
*** Submitted as c84a78ce14d6 ***

This patch fixes unicode, unicode-be and unicode-le
input, and unicode output, which have been broken due
to the change of the size of Rune from two bytes to
four bytes.

(Unicode-le and unicode-be output have not been
affected, since they work different, and produce
correct output as long as sizeof(Rune) >= 2.)

In all of the affected functions an extra array of N
elements of type u16int is used to temporarily store
the 16-bit unicode data.  As this increases stack
usage, perhaps a different, slightly more complicated
solution might be preferred, where only a single
`Rune buf[N]' is used for both temporary storage and
the result.

R=rsc
CC=codebot
http://codereview.appspot.com/1574041

Committer: Russ Cox <rsc@swtch.com>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b