From 17c6b3b2fbec49dbff0e176786a5d4292bb69366 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Sun, 14 Feb 1999 05:56:15 +0000 Subject: [PATCH] Added some "const" to code that was retrieving a pointer to the internal buffer managed by nsString --- gfx/src/nsDeviceContext.cpp | 2 +- gfx/src/nsFont.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gfx/src/nsDeviceContext.cpp b/gfx/src/nsDeviceContext.cpp index 1fffa32aee27..0968d767dc94 100644 --- a/gfx/src/nsDeviceContext.cpp +++ b/gfx/src/nsDeviceContext.cpp @@ -449,7 +449,7 @@ public: PRUint32 FontAliasKey::HashValue(void) const { PRUint32 hash = 0; - PRUnichar* string = mString; + const PRUnichar* string = mString; PRUnichar ch; while ((ch = *string++) != 0) { // FYI: hash = hash*37 + ch diff --git a/gfx/src/nsFont.cpp b/gfx/src/nsFont.cpp index 0a789c256e30..ccd3c3b7b0cf 100644 --- a/gfx/src/nsFont.cpp +++ b/gfx/src/nsFont.cpp @@ -103,7 +103,8 @@ PRBool nsFont::EnumerateFamilies(nsFontFamilyEnumFunc aFunc, void* aData) const familyList.Append(kNullCh); // put an extra null at the end - PRUnichar* start = (PRUnichar*)familyList; + // XXX This code is evil... + PRUnichar* start = (PRUnichar*)(const PRUnichar*)familyList; PRUnichar* end = start; while (running && (kNullCh != *start)) {