Am 22.05.2015 um 16:32 schrieb Jean-Marc Lasgouttes 
<jean-marc.lasgout...@inria.fr>:

> Hi,
> 
> There is a compilation warning with clang related to the new splash stuff:
> 
> ../../../../master/src/frontends/qt4/GuiView.cpp: In member function ‘QSize 
> lyx::frontend::{anonymous}::BackgroundWidget::splashSize()’:
> ../../../../master/src/frontends/qt4/GuiView.cpp:248:61: warning: conversion 
> to ‘int’ from ‘double’ may alter its value [-Wfloat-conversion]
>   return  QSize(width_ * pixelRatio(),height_ * pixelRatio());
>                                                             ^
> ../../../../master/src/frontends/qt4/GuiView.cpp:248:61: warning: conversion 
> to ‘int’ from ‘double’ may alter its value [-Wfloat-conversion]
> 
> It is easy enough to fix, but I am a bit confused about the code there (see 
> below). Is there a reason why splashSize has nothing to do with splashWidth() 
> and splashHeight()?

Sorry, I don't see this. I hate warnings and I'd kill them if I could see them.
Neither the Xcode compiler (cmake) nor the auto tools compiler settings enable 
these.

The method splashSize() is used to compute the target size of
the rendered image. This depends of the desired logical size
and the device pixel ratio.

The splashWidth() and splashHeigth() are used to get the current
logical dimensions of the splash_ pixmap. But the same result
should be achieved by using width_ and height_ directly.

> 
> Moreover there are some cosmetic remarks
> 
> * spacing: add spaces around '/', and after comma.
> 
> * these methods and some of the ones around them should be const.

Ok.

I've commit a patch to fix this. Thank you for your comments.

Stephan

Reply via email to