Jürgen Spitzmüller <[EMAIL PROTECTED]> writes:
>> Kernel.cpp:109: warning: 'void
>> __static_initialization_and_destruction_0(int, int)' defined but not used
These are related to some version of gcc. Harmless.
>> IconPalette.cpp:47: warning: unused parameter 'event'
>> IconPalette.cpp:70: warning: unused parameter 'event'
>> IconPalette.cpp:153: warning: unused parameter 'event'
>> IconPalette.cpp:231: warning: unused parameter 'event'
The following patch fixes this, along with several other warnings.
Juergen, do you want this in branch?
JMarc
svndiff src/insets/InsetSpace.cpp src/insets/InsetListings.cpp src/insets/InsetText.cpp src/TextMetrics.cpp src/frontends/qt4/qt_helpers.cpp src/frontends/qt4/IconPalette.cpp src/Paragraph.cpp
Index: src/insets/InsetSpace.cpp
===================================================================
--- src/insets/InsetSpace.cpp (revision 24609)
+++ src/insets/InsetSpace.cpp (working copy)
@@ -72,7 +72,7 @@ bool InsetSpace::metrics(MetricsInfo & m
break;
case ENSPACE:
case ENSKIP:
- dim.wid = 0.5 * fm.width(char_type('M'));
+ dim.wid = fm.width(char_type('M')) / 2;
break;
}
bool const changed = dim_ != dim;
Index: src/insets/InsetListings.cpp
===================================================================
--- src/insets/InsetListings.cpp (revision 24609)
+++ src/insets/InsetListings.cpp (working copy)
@@ -165,7 +165,8 @@ int InsetListings::latex(Buffer const &
++lines;
}
}
- char const * delimiter;
+ // FIXME: use C++ code instead of this thing.
+ char const * delimiter = 0;
if (lstinline) {
for (delimiter = lstinline_delimiters; delimiter != '\0'; ++delimiter)
if (!contains(code, *delimiter))
Index: src/insets/InsetText.cpp
===================================================================
--- src/insets/InsetText.cpp (revision 24609)
+++ src/insets/InsetText.cpp (working copy)
@@ -87,7 +87,7 @@ InsetText::InsetText(BufferParams const
InsetText::InsetText(InsetText const & in)
- : Inset(in), text_(), fixed_width_(fixed_width_)
+ : Inset(in), fixed_width_(fixed_width_), text_()
{
text_.autoBreakRows_ = in.text_.autoBreakRows_;
drawFrame_ = in.drawFrame_;
Index: src/TextMetrics.cpp
===================================================================
--- src/TextMetrics.cpp (revision 24609)
+++ src/TextMetrics.cpp (working copy)
@@ -336,17 +336,18 @@ RowMetrics TextMetrics::computeRowMetric
// The test on par.size() is to catch zero-size pars, which
// would trigger the assert in Paragraph::getInset().
//inset = par.size() ? par.getInset(row.pos()) : 0;
- if (row.pos() < par.size()
- && par.isInset(row.pos()))
- {
- switch(par.getInset(row.pos())->display()) {
+ if (row.pos() < par.size() && par.isInset(row.pos())) {
+ switch(par.getInset(row.pos())->display()) {
case Inset::AlignLeft:
align = LYX_ALIGN_BLOCK;
break;
case Inset::AlignCenter:
align = LYX_ALIGN_CENTER;
break;
- // other types unchanged (use align)
+ case Inset::Inline:
+ case Inset::AlignRight:
+ // unchanged (use align)
+ break;
}
}
Index: src/frontends/qt4/qt_helpers.cpp
===================================================================
--- src/frontends/qt4/qt_helpers.cpp (revision 24609)
+++ src/frontends/qt4/qt_helpers.cpp (working copy)
@@ -93,13 +93,16 @@ Length widgetsToLength(QLineEdit const *
}
+namespace {
+
void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
- Length const & len, Length::UNIT defaultUnit)
+ Length const & len)
{
combo->setCurrentItem(Length(len).unit());
input->setText(toqstr(convert<string>(Length(len).value())));
}
+}
void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
string const & len, Length::UNIT defaultUnit)
@@ -113,7 +116,7 @@ void lengthToWidgets(QLineEdit * input,
combo->setCurrentItem(defaultUnit);
input->setText(toqstr(len));
} else {
- lengthToWidgets(input, combo, Length(len), defaultUnit);
+ lengthToWidgets(input, combo, Length(len));
}
}
@@ -124,7 +127,7 @@ void lengthAutoToWidgets(QLineEdit * inp
if (len.value() == 0)
lengthToWidgets(input, combo, "auto", defaultUnit);
else
- lengthToWidgets(input, combo, len, defaultUnit);
+ lengthToWidgets(input, combo, len);
}
Index: src/frontends/qt4/IconPalette.cpp
===================================================================
--- src/frontends/qt4/IconPalette.cpp (revision 24609)
+++ src/frontends/qt4/IconPalette.cpp (working copy)
@@ -43,7 +43,7 @@ TearOff::TearOff(QWidget * parent)
}
-void TearOff::mouseReleaseEvent(QMouseEvent * event)
+void TearOff::mouseReleaseEvent(QMouseEvent * /*event*/)
{
// signal
tearOff();
@@ -66,7 +66,7 @@ void TearOff::leaveEvent(QEvent * event)
}
-void TearOff::paintEvent(QPaintEvent * event)
+void TearOff::paintEvent(QPaintEvent * /*event*/)
{
QPainter p(this);
const int fw = style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, this);
@@ -149,7 +149,7 @@ void IconPalette::clicked(QAction * acti
}
-void IconPalette::showEvent(QShowEvent * event)
+void IconPalette::showEvent(QShowEvent * /*event*/)
{
resize(sizeHint());
setMaximumSize(sizeHint());
@@ -227,7 +227,7 @@ void IconPalette::updateParent()
}
-void IconPalette::paintEvent(QPaintEvent * event)
+void IconPalette::paintEvent(QPaintEvent * /*event*/)
{
// draw border
const int fw = style()->pixelMetric(QStyle::PM_MenuPanelWidth, 0, this);
Index: src/Paragraph.cpp
===================================================================
--- src/Paragraph.cpp (revision 24609)
+++ src/Paragraph.cpp (working copy)
@@ -636,7 +636,7 @@ bool Paragraph::Pimpl::simpleTeXBlanks(E
int Paragraph::Pimpl::writeScriptChars(odocstream & os,
- value_type c,
+ value_type /*c*/,
docstring const & ltx,
Change & runningChange,
Encoding const & encoding,