]> git.lyx.org Git - features.git/commitdiff
no time to finish compile, fixes to cxx warnings
authorLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 27 Sep 2000 18:13:30 +0000 (18:13 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Wed, 27 Sep 2000 18:13:30 +0000 (18:13 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1050 a592a061-630c-0410-9148-cb99ea01b6c8

15 files changed:
src/LyXView.C
src/LyXView.h
src/Painter.C
src/Painter.h
src/PainterBase.h
src/font.C
src/font.h
src/insets/figinset.C
src/insets/insetcite.C
src/insets/insetexternal.C
src/insets/insettabular.C
src/insets/insettabular.h
src/insets/insettext.C
src/insets/insettext.h
src/tabular.C

index 92655d1430e8c2d2fc690fefc7d844e638fabfe7..1691e71457ee2168c2b70c0134e5382f53d2b73c 100644 (file)
@@ -120,7 +120,7 @@ Toolbar * LyXView::getToolbar() const
 }
 
 
-void LyXView::setLayout(int layout)
+void LyXView::setLayout(LyXTextClass::size_type layout)
 {
        toolbar->setLayout(layout);
 }
index 7e994aeb435aec84f952f94ef0d40b81b3de424e..9aa11c02050ce94ac7502a31dafc621487466589 100644 (file)
@@ -76,7 +76,7 @@ public:
        Toolbar * getToolbar() const;
 
        /// sets the layout in the toolbar layout combox
-       void setLayout(int layout);
+       void setLayout(LyXTextClass::size_type layout);
 
        /// update the toolbar
        void updateToolbar();
index d3216b9ef93c27515be46b26e61ed2cb63aa1079..8ab7f4fb73cc8e45d1f262ff086b402ca7aa2978 100644 (file)
@@ -269,7 +269,7 @@ PainterBase & Painter::text(int x, int y, char c, LyXFont const & f)
 }
 
 
-PainterBase & Painter::text(int x, int y, char const * s, int ls,
+PainterBase & Painter::text(int x, int y, char const * s, size_t ls,
                        LyXFont const & f)
 {
        if (lyxrc.font_norm_type == LyXRC::ISO_10646_1) {
index 1becb41462cf5b8f83973d6d2e81985bff10a05a..7225500072c8fdd6470077e9284dd13ee54f362d 100644 (file)
@@ -86,7 +86,7 @@ public:
        
        /** Draw a string at position x, y (y is the baseline)
            This is just for fast drawing */
-       PainterBase & text(int x, int y, char const * str, int l,
+       PainterBase & text(int x, int y, char const * str, size_t l,
                           LyXFont const & f);
        
        /// Draw a char at position x, y (y is the baseline)
index 771baec8b980c6fcd9a059fcc43c79ba48de8bd5..47fa8c89939a805e7571d2f92711f9c776fe4a1b 100644 (file)
@@ -157,7 +157,7 @@ public:
 
        /** Draw a string at position x, y (y is the baseline)
            This is just for fast drawing */
-       virtual PainterBase & text(int x, int y, char const * str, int l,
+       virtual PainterBase & text(int x, int y, char const * str, size_t l,
                       LyXFont const & f) = 0;
 
        /// Draw a char at position x, y (y is the baseline)
index 076f16d7b26507ae8ef73e829291de89c974bd8b..ab5610124059bc78c949bdec0b13f5a2802aa61b 100644 (file)
@@ -101,7 +101,7 @@ int lyxfont::rbearing(char c, LyXFont const & f)
 }
 
 
-int lyxfont::width(char const * s, int n, LyXFont const & f)
+int lyxfont::width(char const * s, size_t n, LyXFont const & f)
 {
        if (!lyxrc.use_gui)
                return n;
index d078ea8ba2c5c19d9f0084be9e6b339dc65c5f1f..95a55951514e7a88ee6c9d7745368c8565f950e3 100644 (file)
@@ -51,7 +51,7 @@ struct lyxfont {
        }
        ///
        static
-       int width(char const * s, int n, LyXFont const & f);
+       int width(char const * s, size_t n, LyXFont const & f);
        ///
        static
        int width(string const & s, LyXFont const & f) {
index 4b71d58a55f0844f92644207d103ffcd2b91aba3..6436b6e5eb1a46b4c8a6ed64a3097f349269d0cb 100644 (file)
@@ -98,15 +98,12 @@ static queue<queue_element> gsqueue; // queue for ghostscripting
 
 static int gsrunning = 0;      /* currently so many gs's are running */
 static bool bitmap_waiting = false; /* bitmaps are waiting finished */
-static char bittable[256];     /* bit reversion table */
 
 static bool gs_color;                  // do we allocate colors for gs?
 static bool color_visual;              // is the visual color?
 static bool gs_xcolor = false;         // allocated extended colors
 static unsigned long gs_pixels[128];   // allocated pixels
-static int gs_num_pixels;              // number of pixels allocated
 static int gs_spc;                     // shades per color
-static bool gs_gray;                   // is grayscale?
 static int gs_allcolors;               // number of all colors
 
 static list<int> pidwaitlist; // pid wait list
@@ -195,7 +192,6 @@ int GhostscriptMsg(FL_OBJECT *, Window, int, int,
                                register XImage * im;
                                int i;
                                int y;
-                               int wid1;
                                int spc1 = gs_spc - 1;
                                int spc2 = gs_spc * gs_spc;
                                int wid = p->wid;
@@ -256,7 +252,6 @@ int GhostscriptMsg(FL_OBJECT *, Window, int, int,
                                                     .colormap, cmap,
                                                     gs_allcolors);
                                        XFlush(tmpdisp);
-                                       wid1 = p->wid - 1;
                                // now we process all the image
                                        for (y = 0; y < p->hgh; ++y) {
                                                for (int x = 0; x < wid; ++x) {
@@ -318,9 +313,9 @@ void AllocColors(int num)
        if (num > 5) num = 5;
        XColor xcol;
        for (int i = 0; i < num * num * num; ++i) {
-               xcol.red = 65535 * (i / (num * num)) / (num - 1);
-               xcol.green = 65535 * ((i / num) % num) / (num - 1);
-               xcol.blue = 65535 * (i % num) / (num - 1);
+               xcol.red = short(65535 * (i / (num * num)) / (num - 1));
+               xcol.green = short(65535 * ((i / num) % num) / (num - 1));
+               xcol.blue = short(65535 * (i % num) / (num - 1));
                xcol.flags = DoRed | DoGreen | DoBlue;
                if (!XAllocColor(fl_display,
                                 fl_state[fl_get_vclass()].colormap, &xcol)) {
@@ -337,9 +332,7 @@ void AllocColors(int num)
                gs_pixels[i] = xcol.pixel;
        }
        gs_color = true;
-       gs_gray = false;
        gs_spc = num;
-       gs_num_pixels = num * num * num;
 }
 
 
@@ -377,8 +370,6 @@ void AllocGrays(int num)
                gs_pixels[i] = xcol.pixel;
        }
        gs_color = true;
-       gs_gray = false;
-       gs_num_pixels = num;
 }
 
 
@@ -394,7 +385,6 @@ void InitFigures()
                k = 0;
                for (unsigned int j = 0; j < 8; ++j)
                        if (i & (1 << (7-j))) k |= 1 << j;
-               bittable[i] = char(~k);
        }
 
        // allocate color cube on pseudo-color display
index 640c53695b3c82323f6c4dcd2f931227c4be589f..fa2777fa9761f689f677a56217f4f51b6e86a36a 100644 (file)
@@ -30,16 +30,16 @@ string const InsetCitation::getScreenLabel() const
 
        // If keys is "too long" then only print out the first few tokens
        string label;
-       if( contains( keys, "," ) ) {
+       if (contains(keys, ",")) {
                // Final comma allows while loop to cover all keys
-               keys = frontStrip( split( keys, label, ',' ) ) + ",";
+               keys = frontStrip(split(keys, label, ',')) + ",";
 
-               const int maxSize( 40 );
-               while( contains( keys, "," ) ) {
+               size_t const maxSize = 40;
+               while (contains( keys, "," )) {
                        string key;
-                       keys = frontStrip( split( keys, key, ',' ) );
+                       keys = frontStrip(split(keys, key, ','));
 
-                       int size = label.size() + 2 + key.size();
+                       size_t size = label.size() + 2 + key.size();
                        if( size >= maxSize ) {
                                label += ", ...";
                                break;
@@ -50,7 +50,7 @@ string const InsetCitation::getScreenLabel() const
                label = keys;
        }
 
-       if( !getOptions().empty() )
+       if (!getOptions().empty())
                label += ", " + getOptions();
 
        return '[' + label + ']';
@@ -59,6 +59,6 @@ string const InsetCitation::getScreenLabel() const
 
 void InsetCitation::Edit(BufferView * bv, int, int, unsigned int)
 {
-       bv->owner()->getDialogs()->showCitation( this );
+       bv->owner()->getDialogs()->showCitation(this);
 }
 
index cd42207704983bfafb0da17fd5132d0f9a27dd45..a60d7facac2f74b2c920f90d8b123e0886508e68 100644 (file)
@@ -314,10 +314,10 @@ void InsetExternal::Write(Buffer const *, std::ostream & os) const
 void InsetExternal::Read(Buffer const *, LyXLex & lex)
 {
        lex.EatLine();
-       string format = lex.GetString();
-       int pos1 = format.find(",");
+       string const format = lex.GetString();
+       string::size_type const pos1 = format.find(",");
        templatename = format.substr(0, pos1);
-       int pos2 = format.find("\",\"", pos1);
+       string::size_type const pos2 = format.find("\",\"", pos1);
        filename = format.substr(pos1 + 2, pos2 - (pos1 + 2));
        parameters = format.substr(pos2 + 3, format.length() - (pos2 + 4));
 
@@ -473,7 +473,7 @@ string const InsetExternal::doSubstitution(Buffer const * buffer,
                                     string const & s) const
 {
        string result;
-       string basename = ChangeExtension(filename, string());
+       string const basename = ChangeExtension(filename, string());
        result = subst(s, "$$FName", filename);
        result = subst(result, "$$Basename", basename);
        result = subst(result, "$$Parameters", parameters);
@@ -484,8 +484,8 @@ string const InsetExternal::doSubstitution(Buffer const * buffer,
        // Handle the $$Contents(filename) syntax
        if (contains(result, "$$Contents(\"")) {
 
-               int const pos = result.find("$$Contents(\"");
-               int const end = result.find("\")", pos);
+               string::size_type const pos = result.find("$$Contents(\"");
+               string::size_type const end = result.find("\")", pos);
                string const file = result.substr(pos + 12, end - (pos + 12));
                string contents;
                if (buffer) {
index ada68fc0addece9da40e613d29f37b314b42aaa1..edb29a69d4f575ed6edfc8d08d31f25e680c77c2 100644 (file)
@@ -950,7 +950,8 @@ bool InsetTabular::calculate_dimensions_of_cells(BufferView * bv,
 }
 
 
-void InsetTabular::GetCursorPos(BufferView *, int & x, int & y) const
+void InsetTabular::GetCursorPos(BufferView *,
+                               unsigned long & x, unsigned long & y) const
 {
     x = cursor.x() - top_x;
     y = cursor.y();
@@ -1222,15 +1223,15 @@ bool InsetTabular::TabularFeatures(BufferView * bv, string const & what)
 void InsetTabular::TabularFeatures(BufferView * bv, int feature,
                                   string const & value)
 {
-    int
-       i, j,
-       sel_col_start,
-       sel_col_end,
-       sel_row_start,
-       sel_row_end,
-        setLines = 0,
-        setAlign = LYX_ALIGN_LEFT,
-        lineSet;
+    int i;
+    int j;
+    int sel_col_start;
+    int sel_col_end;
+    int sel_row_start;
+    int sel_row_end;
+    int setLines = 0;
+    LyXAlignment setAlign = LYX_ALIGN_LEFT;
+    int lineSet;
     bool what;
 
     switch (feature) {
@@ -1403,9 +1404,9 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature,
     case LyXTabular::ALIGN_LEFT:
     case LyXTabular::ALIGN_RIGHT:
     case LyXTabular::ALIGN_CENTER:
-       for(i=sel_row_start; i<=sel_row_end; ++i)
-           for(j=sel_col_start; j<=sel_col_end; ++j)
-               tabular->SetAlignment(tabular->GetCellNumber(i,j),setAlign,
+       for(i = sel_row_start; i <= sel_row_end; ++i)
+           for(j = sel_col_start; j <= sel_col_end; ++j)
+               tabular->SetAlignment(tabular->GetCellNumber(i, j), setAlign,
                                      flag);
        if (hasSelection())
            UpdateLocal(bv, INIT, true);
@@ -1419,9 +1420,9 @@ void InsetTabular::TabularFeatures(BufferView * bv, int feature,
     case LyXTabular::VALIGN_TOP:
     case LyXTabular::VALIGN_BOTTOM:
     case LyXTabular::VALIGN_CENTER:
-       for(i=sel_row_start; i<=sel_row_end; ++i)
-           for(j=sel_col_start; j<=sel_col_end; ++j)
-               tabular->SetVAlignment(tabular->GetCellNumber(i,j), setAlign,
+       for(i = sel_row_start; i <= sel_row_end; ++i)
+           for(j = sel_col_start; j <= sel_col_end; ++j)
+               tabular->SetVAlignment(tabular->GetCellNumber(i, j), setAlign,
                                       flag);
        if (hasSelection())
            UpdateLocal(bv, INIT, true);
index df4d05a0c136c10bd0d3af275129fe3d6282e362..6b4701e3cd95a9feef66ec872aebefbaf4140fc0 100644 (file)
@@ -145,7 +145,8 @@ public:
     ///
     Inset::Code LyxCode() const { return Inset::TABULAR_CODE; }
     ///
-    void GetCursorPos(BufferView *, int & x, int & y) const;
+    void GetCursorPos(BufferView *, unsigned long & x,
+                     unsigned long & y) const;
     ///
     void ToggleInsetCursor(BufferView *);
     ///
@@ -245,7 +246,7 @@ private:
     ///
     mutable int inset_x;
     ///
-    mutable int inset_y;
+    mutable unsigned long inset_y;
     ///
     mutable int sel_pos_start;
     ///
index ec9e2ed665f7b57ea6e985924cdccbfe87a6f11e..298f11edd38fee7c57bec3114a97b18247c79d4c 100644 (file)
@@ -313,20 +313,20 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
     y += baseline - row->ascent_of_text();
     if (cleared || !locked || (need_update == FULL)) {
        while (row != 0) {
-           TEXT(bv)->GetVisibleRow(bv, y, int(x), row, y, cleared);
+           TEXT(bv)->GetVisibleRow(bv, int(y), int(x), row, y, cleared);
            y += row->height();
            row = row->next();
        }
     } else if (need_update == SELECTION) {
-       bv->screen()->ToggleToggle(TEXT(bv), y, int(x));
+       bv->screen()->ToggleToggle(TEXT(bv), int(y), int(x));
     } else {
        locked = false;
        if (need_update == CURSOR) {
-           bv->screen()->ToggleSelection(TEXT(bv), true, y, int(x));
+           bv->screen()->ToggleSelection(TEXT(bv), true, int(y), int(x));
            TEXT(bv)->ClearSelection();
            TEXT(bv)->sel_cursor = TEXT(bv)->cursor;
        }
-       bv->screen()->Update(TEXT(bv), y, int(x));
+       bv->screen()->Update(TEXT(bv), int(y), int(x));
        locked = true;
     }
     TEXT(bv)->refresh_y = 0;
@@ -1351,13 +1351,14 @@ LyXFont InsetText::GetDrawFont(BufferView * bv, LyXParagraph * p, int pos) const
 }
 #endif
 
-int InsetText::cx(BufferView * bv) const
+
+long InsetText::cx(BufferView * bv) const
 {
     return TEXT(bv)->cursor.x() + top_x + TEXT_TO_INSET_OFFSET;
 }
 
 
-int InsetText::cy(BufferView * bv) const
+long InsetText::cy(BufferView * bv) const
 {
     LyXFont font;
     return TEXT(bv)->cursor.y() - ascent(bv, font) + TEXT_TO_INSET_OFFSET;
index d1be15fc08a52708069e677174b3aeb3dca9d2ac..23dfb2ae00a20a5957426a6b20de2bdbca3c1d41 100644 (file)
@@ -221,9 +221,9 @@ private:
     void removeNewlines();
 
     ///
-    int cx(BufferView *) const;
+    long cx(BufferView *) const;
     ///
-    int cy(BufferView *) const;
+    long cy(BufferView *) const;
     ///
     int cpos(BufferView *) const;
     ///
@@ -242,7 +242,7 @@ private:
     ///
     mutable int insetAscent;
     ///
-    mutable int insetDescent;
+    mutable long insetDescent;
     ///
     mutable int insetWidth;
     ///
index 2f4abff8016375b2e76c8e832fa428eb280a9e16..25697c118f6cee99018706591de3423f4c2f3bb5 100644 (file)
@@ -619,7 +619,7 @@ bool LyXTabular::SetWidthOfCell(int cell, int new_width)
 }
 
 
-bool LyXTabular::SetAlignment(int cell, char align, bool onlycolumn)
+bool LyXTabular::SetAlignment(int cell, LyXAlignment align, bool onlycolumn)
 {
 #warning Please fix align type. (Lgb)
     if (!IsMultiColumn(cell) || onlycolumn)