crasher fix


Subject: crasher fix
From: Patrick Lam (plam@plam.lcs.mit.edu)
Date: Tue May 15 2001 - 01:58:40 CDT


This following patch seems to work, partially reverting a change by abela.

However, as I am no C++ expert and I'm not quite sure what the semantics
of a const function are, I will not check in this change myself. Could
someone figure out why it seems to work?

smart quotes still crash, mind you; but at least you can type now when
smart quotes are disabled.

pat

Index: src/af/util/xp/ut_vector.h
===================================================================
RCS file: /cvsroot/abi/src/af/util/xp/ut_vector.h,v
retrieving revision 1.33
diff -u -r1.33 ut_vector.h
--- src/af/util/xp/ut_vector.h 2001/05/12 16:01:17 1.33
+++ src/af/util/xp/ut_vector.h 2001/05/15 06:57:56
@@ -55,7 +55,7 @@
                 return m_pEntries[n];
         }
 
- void* operator[](UT_uint32 i) const;
+ const void* operator[](UT_uint32 i) const;
         UT_sint32 setNthItem(UT_uint32 ndx, void * pNew, void **
ppOld);
         void* getFirstItem() const;
         void* getLastItem() const;
@@ -132,7 +132,7 @@
         UT_sint32 addItem(void*);
         UT_sint32 addItem(void* p, UT_uint32 * pIndex);
         void* getNthItem(UT_uint32 n) const;
- void* operator[](UT_uint32 i) const;
+ const void* operator[](UT_uint32 i) const;
         UT_sint32 setNthItem(UT_uint32 ndx, void * pNew, void **
ppOld);
         void* getFirstItem() const;
         void* getLastItem() const;
Index: src/af/util/xp/ut_vector.cpp
===================================================================
RCS file: /cvsroot/abi/src/af/util/xp/ut_vector.cpp,v
retrieving revision 1.39
diff -u -r1.39 ut_vector.cpp
--- src/af/util/xp/ut_vector.cpp 2001/05/12 16:01:17 1.39
+++ src/af/util/xp/ut_vector.cpp 2001/05/15 06:57:56
@@ -252,7 +252,7 @@
         return 0;
 }
 
-void* UT_Vector::operator[](UT_uint32 i) const
+const void* UT_Vector::operator[](UT_uint32 i) const
 {
         return this->getNthItem(i);
 }
@@ -357,7 +357,7 @@
         return 0;
 }
 
-void* UT_Vector::operator[](UT_uint32 i) const
+const void* UT_Vector::operator[](UT_uint32 i) const
 {
         return m_STLVec[i];
 }



This archive was generated by hypermail 2b25 : Sat May 26 2001 - 03:51:04 CDT