[strongtalk] r173 committed - merge underscore fix into SVN

3 views
Skip to first unread message

codesite...@google.com

unread,
Sep 19, 2009, 12:19:38 PM9/19/09
to strongta...@googlegroups.com
Revision: 173
Author: StephenLRees
Date: Sat Sep 19 09:18:27 2009
Log: merge underscore fix into SVN
http://code.google.com/p/strongtalk/source/detail?r=173

Modified:
/branches/gcc-linux/StrongtalkSource/Font.dlt
/branches/gcc-linux/vm/interpreter/prettyPrinter.cpp
/branches/gcc-linux/vm/oops/byteArrayOop.cpp

=======================================
--- /branches/gcc-linux/StrongtalkSource/Font.dlt Sat Nov 1 12:10:49 2008
+++ /branches/gcc-linux/StrongtalkSource/Font.dlt Sat Sep 19 09:18:27 2009
@@ -303,7 +303,7 @@
"Return the Glyph for the specified character of this font that will
render
using the paint p."

- | curmap <CanonicalCharGlyphs> gl <CharacterGlyph> code <Int> |
+ | curmap <CanonicalCharGlyphs> gl <CharacterGlyph> code <Int> ch
<Character> |

"We must cache the curmap in a local variable so that we can avoid a
critical
region"
@@ -312,19 +312,19 @@
(curmap == nil or: [ curmap paint ~~ paint and: [ curmap paint ~= paint
]])
ifTrue: [ curmap := self uncachedMapFor: paint.
self currentMap: curmap. ].
-
- code := c unicodeValue.
+ ch := c unicodeValue = 0 ifTrue: [$.] ifFalse: [c].
+ code := ch unicodeValue.
code > curmap size
- ifTrue: [ curmap := curmap copyWithSize: c unicodeValue.
+ ifTrue: [ curmap := curmap copyWithSize: ch unicodeValue.
self currentMap: curmap.
self critical:
[ self allMaps include: curmap. ].
].

- gl := curmap at: c unicodeValue.
+ gl := curmap at: ch unicodeValue.
gl == nil
- ifTrue: [ gl := CharacterGlyph buildFor: c painter: curmap painter.
- curmap at: c unicodeValue put: gl. ].
+ ifTrue: [ gl := CharacterGlyph buildFor: ch painter: curmap painter.
+ curmap at: ch unicodeValue put: gl. ].
^gl
!

=======================================
--- /branches/gcc-linux/vm/interpreter/prettyPrinter.cpp Mon Nov 12
14:26:32 2007
+++ /branches/gcc-linux/vm/interpreter/prettyPrinter.cpp Sat Sep 19
09:18:27 2009
@@ -86,7 +86,7 @@
symbolOop
selector,
GrowableArray<astNode*>*
arguments,
bool split) {
- if (ispunct(selector->byte_at(1))) {
+ if (selector->is_binary()) {
// binary send
output->print(selector->as_string());
output->space();
=======================================
--- /branches/gcc-linux/vm/oops/byteArrayOop.cpp Thu Oct 26 09:36:34 2006
+++ /branches/gcc-linux/vm/oops/byteArrayOop.cpp Sat Sep 19 09:18:27 2009
@@ -203,7 +203,7 @@
assert(length() > 0, "selector should have a positive length");

// Return 1 if binary selector
- if (ispunct(byte_at(1))) return 1;
+ if (is_binary()) return 1;

// Return number of colons
for (int index = 1; index <= length(); index++)
@@ -221,7 +221,9 @@
}

bool byteArrayOopDesc::is_binary() const {
- return ispunct(byte_at(1)) ? true : false;
+ u_char first = byte_at(1);
+ // special case _, as compiler treats as a letter
+ return first != '_' && ispunct(first) ? true : false;
}

bool byteArrayOopDesc::is_keyword() const {

Reply all
Reply to author
Forward
0 new messages