Get rid of a few warnings.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19409 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Lars Gullik Bjønnes 2007-08-10 20:14:54 +00:00
parent 79bc04d87e
commit 5ae54ddafb
10 changed files with 38 additions and 32 deletions

View File

@ -153,7 +153,7 @@ void zlib_base::reset(bool compress, bool realloc)
void zlib_base::do_init
( const zlib_params& p, bool compress,
#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
zlib::alloc_func alloc, zlib::free_func free,
zlib::alloc_func /*alloc*/, zlib::free_func /*free*/,
#endif
void* derived )
{

View File

@ -199,7 +199,7 @@ public:
Buffer::Impl::Impl(Buffer & parent, FileName const & file, bool readonly_)
: lyx_clean(true), bak_clean(true), unnamed(false), read_only(readonly_),
filename(file), file_fully_loaded(false), inset(params),
timestamp_(0), checksum_(0), toc_backend(&parent)
toc_backend(&parent), timestamp_(0), checksum_(0)
{
inset.setAutoBreakRows(true);
lyxvc.buffer(&parent);

View File

@ -519,26 +519,32 @@ void Encodings::read(FileName const & encfile, FileName const & symbolsfile)
string const iconvname = lex.getString();
lex.next();
string const width = lex.getString();
bool fixedwidth;
bool fixedwidth;;
if (width == "fixed")
fixedwidth = true;
else if (width == "variable")
fixedwidth = false;
else
else {
fixedwidth = false;
lex.printError("Encodings::read: "
"Unknown width: `$$Token'");
}
lex.next();
string const p = lex.getString();
Encoding::Package package;
if (p == "none")
package = Encoding::none;
package = Encoding::none;
else if (p == "inputenc")
package = Encoding::inputenc;
else if (p == "CJK")
package = Encoding::CJK;
else
else {
package = Encoding::none;
lex.printError("Encodings::read: "
"Unknown package: `$$Token'");
}
LYXERR(Debug::INFO) << "Reading encoding " << name << endl;
encodinglist[name] = Encoding(name, latexname,
iconvname, fixedwidth,

View File

@ -339,8 +339,11 @@ RowMetrics TextMetrics::computeRowMetrics(pit_type const pit,
case Inset::AlignCenter:
align = LYX_ALIGN_CENTER;
break;
// other types unchanged (use align)
}
case Inset::Inline:
case Inset::AlignRight:
// unchanged (use align)
break;
}
}
switch (align) {

View File

@ -63,7 +63,7 @@ ToolbarItem::ToolbarItem(Type type, FuncRequest const & func, docstring const &
ToolbarItem::ToolbarItem(Type type, string const & name, docstring const & label)
: type_(type), name_(name), label_(label)
: type_(type), label_(label), name_(name)
{
}

View File

@ -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 * action)
}
void IconPalette::showEvent(QShowEvent * event)
void IconPalette::showEvent(QShowEvent * /*event*/)
{
resize(sizeHint());
setMaximumSize(sizeHint());
@ -218,7 +218,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);

View File

@ -94,7 +94,7 @@ Length widgetsToLength(QLineEdit const * input, QComboBox const * combo)
void lengthToWidgets(QLineEdit * input, LengthCombo * combo,
Length const & len, Length::UNIT defaultUnit)
Length const & len, Length::UNIT /*defaultUnit*/)
{
combo->setCurrentItem(Length(len).unit());
input->setText(toqstr(convert<string>(Length(len).value())));

View File

@ -848,8 +848,11 @@ int InsetGraphics::plaintext(Buffer const & buf, odocstream & os,
namespace {
int writeImageObject(char * format, odocstream & os, OutputParams const & runparams,
docstring const graphic_label, docstring const attributes)
int writeImageObject(char const * format,
odocstream & os,
OutputParams const & runparams,
docstring const & graphic_label,
docstring const & attributes)
{
if (runparams.flavor != OutputParams::XML) {
os << "<![ %output.print."

View File

@ -135,7 +135,7 @@ int InsetListings::latex(Buffer const & buf, odocstream & os,
// NOTE: I use {} to quote text, which is an experimental feature
// of the listings package (see page 25 of the manual)
int lines = 0;
bool lstinline = params().isInline();
bool isInline = params().isInline();
// get the paragraphs. We can not output them directly to given odocstream
// because we can not yet determine the delimiter character of \lstinline
docstring code;
@ -156,17 +156,17 @@ int InsetListings::latex(Buffer const & buf, odocstream & os,
++par;
// for the inline case, if there are multiple paragraphs
// they are simply joined. Otherwise, expect latex errors.
if (par != end && !lstinline && !captionline) {
if (par != end && !isInline && !captionline) {
code += "\n";
++lines;
}
}
char const * delimiter;
if (lstinline) {
for (delimiter = lstinline_delimiters; delimiter != '\0'; ++delimiter)
if (isInline) {
char const * delimiter = lstinline_delimiters;
for (; delimiter != '\0'; ++delimiter)
if (!contains(code, *delimiter))
break;
// this code piece contains all possible special character? !!!
// This code piece contains all possible special character? !!!
// Replace ! with a warning message and use ! as delimiter.
if (*delimiter == '\0') {
code = subst(code, from_ascii("!"), from_ascii(" WARNING: no lstline delimiter can be used "));
@ -176,6 +176,8 @@ int InsetListings::latex(Buffer const & buf, odocstream & os,
os << "\\lstinline" << *delimiter;
else
os << "\\lstinline[" << from_ascii(param_string) << "]" << *delimiter;
os << code
<< *delimiter;
} else {
docstring const caption = getCaption(buf, runparams);
if (param_string.empty() && caption.empty())
@ -190,12 +192,8 @@ int InsetListings::latex(Buffer const & buf, odocstream & os,
os << from_utf8(param_string) << "]\n";
}
lines += 4;
}
os << code;
if (lstinline)
os << *delimiter;
else {
os << "\n\\end{lstlisting}\n\\endgroup\n";
os << code
<< "\n\\end{lstlisting}\n\\endgroup\n";
lines += 3;
}

View File

@ -39,10 +39,6 @@ template struct boost::detail::crc_table_t<32, 0x04C11DB7, true>;
// are available. Order is faster to slowest.
#if defined(HAVE_MMAP) && defined(HAVE_MUNMAP)
// Make sure we get modern version of mmap and friends with void*,
// not `compatibility' version with caddr_t.
#define _POSIX_C_SOURCE 199506L
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif