]> git.lyx.org Git - lyx.git/commitdiff
64 bit compile fixes.
authorAngus Leeming <leeming@lyx.org>
Wed, 24 Mar 2004 17:06:17 +0000 (17:06 +0000)
committerAngus Leeming <leeming@lyx.org>
Wed, 24 Mar 2004 17:06:17 +0000 (17:06 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8525 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/errorlist.C
src/errorlist.h
src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlErrorList.C
src/frontends/controllers/ControlSpellchecker.C
src/paragraph.C
src/paragraph.h
src/text.C

index c480db6f73bdd278da8694e6f9d409e5a4b840d4..e87981e5cfe201f27900599b60afca137f58740f 100644 (file)
@@ -1,3 +1,17 @@
+2004-03-24  Angus Leeming  <leeming@lyx.org>
+
+       64-bit compile fixes.
+
+       * errorlist.[Ch] (pos_start, pos_end): store as lyx::pos_type.
+       (c-tor): pass lyx::pos_types rather than ints.
+
+       * paragraph.[Ch] (beginOfBody, begin_of_body_): return, store as
+       lyx::pos_type.
+
+       * text.C (Delete): compile fix.
+       (getPar): ensure that function declaration is the same as that in
+       the header file.
+
 2004-03-23  Angus Leeming  <leeming@lyx.org>
 
        * ispell.C (LaunchIspell):
index 3052ba49f8d96c8bec745a211dcd54517ad4ea6f..d829f04c4f573c5766f102362b7399201243f04a 100644 (file)
 
 #include "errorlist.h"
 
+using lyx::pos_type;
 using std::string;
 
 
-ErrorItem::ErrorItem(string const & error, string const & description,
-                    int par_id, int pos_start, int pos_end)
-       : error(error), description(description), par_id(par_id),
-         pos_start(pos_start),  pos_end(pos_end)
+ErrorItem::ErrorItem(string const & error_, string const & description_,
+                    int par_id_, pos_type pos_start_, pos_type pos_end_)
+       : error(error_), description(description_), par_id(par_id_),
+         pos_start(pos_start_),  pos_end(pos_end_)
 {}
 
 
index 20b386c8418b65761cf858d8bcb5ebc48c2f45c9..52e79a5ee290f9c81c075a263c669239031be971 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef ERRORLIST_H
 #define ERRORLIST_H
 
+#include "support/types.h"
+
 #include <vector>
 #include <string>
 
@@ -22,10 +24,10 @@ struct ErrorItem {
        std::string error;
        std::string description;
        int par_id;
-       int pos_start;
-       int pos_end;
+       lyx::pos_type pos_start;
+       lyx::pos_type pos_end;
        ErrorItem(std::string const & error, std::string const & description,
-                 int parid, int posstart, int posend);
+                 int parid, lyx::pos_type posstart, lyx::pos_type posend);
        ErrorItem();
 };
 
index 61c503d1ad6ee1a2a47bcdff9fe648d6f8219449..965b47df868b939a0a3e0833267398d3fba34a7a 100644 (file)
@@ -1,3 +1,13 @@
+2004-03-24  Angus Leeming  <leeming@lyx.org>
+
+       64-bit compile fixes.
+
+       * ControlErrorList.C (goTo): use lyx::pos_type as type of
+       temporary vars.
+
+       * ControlSpellchecker.C (nextWord): pass progress as a
+       PosIterator::difference_type, not an int.
+
 2004-03-17  Angus Leeming  <leeming@lyx.org>
 
        * ControlForks.[Ch]: removed.
index 621182662064bd67c5611e5bb0c6c799f050b7c2..b31ba80eb50a6b3dab3dea92fcbed0a60b31701d 100644 (file)
@@ -68,9 +68,9 @@ void ControlErrorList::goTo(int item)
                return;
        }
 
-       int const end = std::min(err.pos_end, pit->size());
-       int const start = std::min(err.pos_start, end);
-       int const range = end - start;
+       lyx::pos_type const end = std::min(err.pos_end, pit->size());
+       lyx::pos_type const start = std::min(err.pos_start, end);
+       lyx::pos_type const range = end - start;
 
        // Now make the selection.
        PosIterator const pos(pit, start);
index 4955ab8677e1d481a71396dbbc9f3bdb24a6fd5e..46beabd4ab5dfe78b088318f75ea1f114cd6a9a8 100644 (file)
@@ -160,7 +160,8 @@ bool isLetter(PosIterator & cur)
 
 
 WordLangTuple nextWord(PosIterator & cur, PosIterator const & end,
-                      int & progress, BufferParams & bp)
+                      PosIterator::difference_type & progress, 
+                      BufferParams & bp)
 {
        // skip until we have real text (will jump paragraphs)
        for (; cur != end && !isLetter(cur); ++cur, ++progress);
index bbefcb92549ed8f97c156ebf2c1ca03e26f9b849..365600571cd6c1d89b9101511e986a53e3f97c26 100644 (file)
@@ -645,7 +645,7 @@ void Paragraph::applyLayout(LyXLayout_ptr const & new_layout)
 }
 
 
-int Paragraph::beginOfBody() const
+pos_type Paragraph::beginOfBody() const
 {
        return begin_of_body_;
 }
index 08e897bba77ffed295453d563eb351d40df76a6c..5eb1e37d9990a5a2b1f06e3a7c87fc9ea851eb07 100644 (file)
@@ -202,7 +202,7 @@ public:
        /// the paragraph alongside the text of the rest of the paragraph
        /// (the body). This function returns the starting position of the
        /// body of the text in the paragraph.
-       int beginOfBody() const;
+       lyx::pos_type beginOfBody() const;
        /// recompute this value
        void setBeginOfBody();
 
@@ -353,7 +353,7 @@ private:
        // for average tasks as buffer loading/switching etc.
        TextContainer text_;
        /// end of label
-       int begin_of_body_;
+       lyx::pos_type begin_of_body_;
 
        struct Pimpl;
        ///
index 85cf1332d9fbe7e843686c6a9167108ae4d05cb2..38e5ae671fb053807faba0a9d49f8dbb356f2e02 100644 (file)
@@ -1341,7 +1341,8 @@ void LyXText::Delete(LCursor & cur)
        CursorSlice sl = cur.top();
        cursorRight(cur);
        if (sl == cur.top()) {
-               recordUndo(cur, Undo::DELETE, cur.par(), max(0, cur.par() - 1));
+               recordUndo(cur, Undo::DELETE, cur.par(), 
+                          max(par_type(0), cur.par() - 1));
                backspace(cur);
        }
 }
@@ -1442,7 +1443,7 @@ ParagraphList::iterator LyXText::getPar(CursorSlice const & cur) const
 }
 
 
-ParagraphList::iterator LyXText::getPar(int par) const
+ParagraphList::iterator LyXText::getPar(par_type par) const
 {
        //lyxerr << "getPar: " << par << " from " << paragraphs().size() << endl;
        BOOST_ASSERT(par >= 0);