Squash a bunch of warnings thrown up by g++.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8106 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-11-20 01:22:51 +00:00
parent f5d5eebe3c
commit c8507b7fcd
16 changed files with 50 additions and 24 deletions

View File

@ -233,8 +233,8 @@ void BulletsModule::setBullet(int level, const Bullet & bullet)
{
bullets_[level] = bullet;
QPushButton * pb;
QComboBox * co;
QPushButton * pb = 0;
QComboBox * co = 0;
switch (level) {
case 0: pb = bullet1PB; co = bulletsize1CO; break;

View File

@ -1,3 +1,12 @@
2003-11-20 Angus Leeming <leeming@lyx.org>
* BulletsModule.C (setBullet): squash gcc 'may be uninitialized' warning.
* QTabularDialog.C (hAlign_changed, vAlign_changed): ditto.
* QLImage.C (clip_impl): squash comparison of signed, unsigned warning.
* QSendto.C (apply, isValid): ditto.
* qt_helpers.C (formatted): ditto.
2003-11-05 João Luis M. Assirati <assirati@fma.if.usp.br>
* lyx_gui.C: {set,remove}_{server,data}socket_callback(): replace

View File

@ -208,7 +208,7 @@ void QLImage::clip_impl(Params const & params)
return;
int const xoffset_l = params.bb.xl;
int const yoffset_t = (pixmap_.height() > params.bb.yt ?
int const yoffset_t = (pixmap_.height() > int(params.bb.yt) ?
pixmap_.height() - params.bb.yt : 0);
xformed_pixmap_.resize(new_width, new_height);

View File

@ -78,7 +78,7 @@ void QSendto::apply()
{
int const line(dialog_->formatLB->currentItem());
if (line < 0 || line > dialog_->formatLB->count())
if (line < 0 || line > int(dialog_->formatLB->count()))
return;
string const cmd(fromqstr(dialog_->commandCO->currentText()));
@ -92,7 +92,7 @@ bool QSendto::isValid()
{
int const line(dialog_->formatLB->currentItem());
if (line < 0 || line > dialog_->formatLB->count())
if (line < 0 || line > int(dialog_->formatLB->count()))
return false;
else return dialog_->formatLB->count() != 0 &&

View File

@ -137,7 +137,7 @@ void QTabularDialog::rotateCell()
void QTabularDialog::hAlign_changed(int align)
{
ControlTabular::HALIGN h;
ControlTabular::HALIGN h = ControlTabular::LEFT;
switch (align) {
case 0: h = ControlTabular::LEFT; break;
@ -152,7 +152,7 @@ void QTabularDialog::hAlign_changed(int align)
void QTabularDialog::vAlign_changed(int align)
{
ControlTabular::VALIGN v;
ControlTabular::VALIGN v = ControlTabular::TOP;
switch (align) {
case 0: v = ControlTabular::TOP; break;

View File

@ -146,7 +146,7 @@ string const formatted(string const & text, int w)
line.empty() ? word : line + ' ' + word;
// FIXME: make w be size_t
if (line_plus_word.length() >= w) {
if (int(line_plus_word.length()) >= w) {
sout += line + '\n';
if (newline) {
sout += word + '\n';

View File

@ -1,3 +1,8 @@
2003-11-20 Angus Leeming <leeming@lyx.org>
* ColorHandler.C (ctor):
* FormNote.C (build, update): squash warnings about comparison of
signed, unsigned.
2003-11-04 Alfredo Braunstein <abraunst@libero.it>

View File

@ -56,7 +56,7 @@ LyXColorHandler::LyXColorHandler()
colormap = fl_state[fl_get_vclass()].colormap;
// Clear the GC cache
for (int i = 0; i < colorGCcache.size(); ++i) {
for (string::size_type i = 0; i < colorGCcache.size(); ++i) {
colorGCcache[i] = 0;
}
}

View File

@ -38,7 +38,7 @@ void FormNote::build()
note_gui_tokens(ids_, gui_names_);
for (int i = 0; i < gui_names_.size(); ++i) {
for (string::size_type i = 0; i < gui_names_.size(); ++i) {
fl_addto_choice(dialog_->choice_type, gui_names_[i].c_str());
}
@ -56,7 +56,7 @@ void FormNote::build()
void FormNote::update()
{
string type(controller().params().type);
for (int i = 0; i < gui_names_.size(); ++i) {
for (string::size_type i = 0; i < gui_names_.size(); ++i) {
if (type == ids_[i])
fl_set_choice_text(dialog_->choice_type, gui_names_[i].c_str());
}

View File

@ -1,3 +1,12 @@
2003-11-20 Angus Leeming <leeming@lyx.org>
* insetcharstyle.C (latex, linuxdoc, docbook, plaintext): squash warnings
about unused parameters.
* insetcollapsable.C (open):
* insettabular.C (pasteSelection):
* insettoc.C (draw): ditto.
2003-11-17 Alfredo Braunstein <abraunst@lyx.org>
* insetcollapsable.C:

View File

@ -150,8 +150,8 @@ int outputVerbatim(std::ostream & os, InsetText inset)
} // namespace anon
int InsetCharStyle::latex(Buffer const & buf, ostream & os,
OutputParams const & runparams) const
int InsetCharStyle::latex(Buffer const &, ostream & os,
OutputParams const &) const
{
os << "%\n\\" << params_.latexname << "{";
int i = outputVerbatim(os, inset);
@ -161,8 +161,8 @@ int InsetCharStyle::latex(Buffer const & buf, ostream & os,
}
int InsetCharStyle::linuxdoc(Buffer const & buf, std::ostream & os,
OutputParams const & runparams) const
int InsetCharStyle::linuxdoc(Buffer const &, std::ostream & os,
OutputParams const &) const
{
os << "<" << params_.latexname << ">";
int const i = outputVerbatim(os, inset);
@ -171,8 +171,8 @@ int InsetCharStyle::linuxdoc(Buffer const & buf, std::ostream & os,
}
int InsetCharStyle::docbook(Buffer const & buf, std::ostream & os,
OutputParams const & runparams) const
int InsetCharStyle::docbook(Buffer const &, std::ostream & os,
OutputParams const &) const
{
os << "<" << params_.latexname << ">";
int const i = outputVerbatim(os, inset);
@ -181,8 +181,8 @@ int InsetCharStyle::docbook(Buffer const & buf, std::ostream & os,
}
int InsetCharStyle::plaintext(Buffer const & buf, std::ostream & os,
OutputParams const & runparams) const
int InsetCharStyle::plaintext(Buffer const &, std::ostream & os,
OutputParams const & runparams) const
{
return outputVerbatim(os, inset);
}

View File

@ -379,7 +379,7 @@ LyXText * InsetCollapsable::getText(int i) const
}
void InsetCollapsable::open(BufferView * bv)
void InsetCollapsable::open(BufferView *)
{
if (!collapsed_)
return;

View File

@ -1905,7 +1905,7 @@ bool InsetTabular::copySelection(BufferView * bv)
}
bool InsetTabular::pasteSelection(BufferView * bv)
bool InsetTabular::pasteSelection(BufferView *)
{
if (!paste_tabular)
return false;

View File

@ -68,7 +68,7 @@ void InsetTOC::metrics(MetricsInfo & mi, Dimension & dim) const
}
void InsetTOC::draw(PainterInfo & pi, int x, int y) const
void InsetTOC::draw(PainterInfo & pi, int, int y) const
{
InsetCommand::draw(pi, button().box().x1, y);
}

View File

@ -1,3 +1,7 @@
2003-11-20 Angus Leeming <leeming@lyx.org>
* formulabase.C (getCursorDim): squash warning about unused variable.
2003-11-13 Alfredo Braunstein <abraunst@lyx.org>
* formulabase.[Ch] (getCursorDim): add

View File

@ -186,8 +186,7 @@ void InsetFormulaBase::getCursorPos(BufferView *, int & x, int & y) const
}
void InsetFormulaBase::getCursorDim(BufferView * bv,
int & asc, int & desc) const
void InsetFormulaBase::getCursorDim(BufferView *, int & asc, int & desc) const
{
if (!mathcursor)
return;