D15690: Removed old style casts

Pino Toscano noreply at phabricator.kde.org
Sun Sep 23 17:41:38 BST 2018


pino added a comment.


  - again, please do not mix unrelated changes, just submit //separate// and //documented// review for them
  - please follow a bit more the existing coding style

INLINE COMMENTS

> isotope.cpp:97
>      return m_abundance.value().toString();
> -    return QString();
>  }

unrelated change

> calculator.cpp:89
>  {
> -    if (item == 0L) {
> +    if (item == nullptr) {
>          return;

unrelated change

> concCalculator.cpp:291
>          return;
> -        break;
> +
>      case 2:     // molality specified

unrelated change

> concCalculator.cpp:299
>          return;
> -        break;
> +
>      case 5:     // mole fraction specified

unrelated change

> concCalculator.cpp:331
>          return;
> -        break;
> +
>      case 1: // normality specified

unrelated change

> concCalculator.cpp:341
>          return;
> -        break;
> +
>      }

unrelated change

> concCalculator.cpp:371-372
>          error(INSUFFICIENT_DATA_SOLVENT);
> -        return;
> -        break;      // cannot be calculated (insufficient data)
> +        return;   // cannot be calculated (insufficient data)
> +
>      case 5:         // mole fraction specified

unrelated changes

> concCalculator.cpp:626
>          volume = massSolute() / densitySolute();
> +        break;
>      default:

good, but unrelated change

> gasCalculator.cpp:337-338
>          ui.error->setText(i18n("Molar mass cannot be zero, please enter a non-zero value."));
> -    default:
> -        break;
>      }

unrelated change

> exportdialog.cpp:182
>      foreach (QListWidgetItem *element, ui.elementListWidget->selectedItems()) {
> +        ElementListEntry* element_entry = static_cast <ElementListEntry*> (element);
> +

coding style, extra space between angle bracket and round bracket

> exportdialog.cpp:188
>          foreach (QListWidgetItem *property, ui.propertyListWidget->selectedItems()) {
> +            PropertyListEntry* property_entry = static_cast<PropertyListEntry*> (property);
> +

coding style, extra space between angle bracket and round bracket

> exportdialog.cpp:193
>              << "</td>\n<td class=\"value\">"
> -            << KalziumUtils::prettyUnit(
> -                ((ElementListEntry*) element)->m_element,
> -                ((PropertyListEntry*) property)->m_type)
> +            << KalziumUtils::prettyUnit(element_entry->m_element,property_entry->m_type)
>              << "</td>\n</tr>\n";

coding style, i.e missing space after comma

> exportdialog.cpp:204
>      foreach (QListWidgetItem *element, ui.elementListWidget->selectedItems()) {
> +        ElementListEntry* element_entry = static_cast<ElementListEntry*> (element);
> +

coding style, extra space between angle bracket and round bracket

> exportdialog.cpp:210
>          foreach (QListWidgetItem *property, ui.propertyListWidget->selectedItems()) {
> +            PropertyListEntry* property_entry = static_cast<PropertyListEntry*> (property);
> +

coding style, extra space between angle bracket and round bracket

> exportdialog.cpp:215
>              << "\">"
> -            << KalziumUtils::prettyUnit(
> -                ((ElementListEntry*) element)->m_element,
> -                ((PropertyListEntry*) property)->m_type)
> +            << KalziumUtils::prettyUnit(element_entry->m_element,property_entry->m_type)
>              << "</property>\n";

coding style, i.e missing space after comma

> exportdialog.cpp:227
>      foreach (QListWidgetItem *property, ui.propertyListWidget->selectedItems()) {
> +        PropertyListEntry* property_entry = static_cast<PropertyListEntry*> (property);
> +

coding style, extra space between angle bracket and round bracket

> exportdialog.cpp:236
>      foreach (QListWidgetItem *element, ui.elementListWidget->selectedItems()) {
> +        ElementListEntry* element_entry = static_cast<ElementListEntry*> (element);
> +

coding style, extra space between angle bracket and round bracket

> exportdialog.cpp:242
>          foreach (QListWidgetItem *property, ui.propertyListWidget->selectedItems()) {
> +            PropertyListEntry* property_entry = static_cast<PropertyListEntry*> (property);
> +

coding style, extra space between angle bracket and round bracket

> exportdialog.cpp:245
>              *m_outputStream << ", \""
> -            << KalziumUtils::prettyUnit(
> -                ((ElementListEntry*) element)->m_element,
> -                ((PropertyListEntry*) property)->m_type)
> +            << KalziumUtils::prettyUnit(element_entry->m_element,property_entry->m_type)
>              << "\"";

coding style, i.e missing space after comma

> isotopeguideview.cpp:27
>  {
> -    m_guidedView = 0;
> +    m_guidedView = nullptr;
>      m_scale = 1.0;

unrelated change

> spectrumviewimpl.cpp:75
>                            << QString::number(peak->intensity);
> -
> -        items.append(new QTreeWidgetItem((QTreeWidget*)0, row));
> +        items.append(new QTreeWidgetItem(static_cast <QTreeWidget*> (nullptr), row));
>      }

unrelated change

> spectrumwidget.cpp:155
>  
> -    int wavelength_ = (int)floor(wavelength);
> +    int wavelength_ = static_cast <int> (floor(wavelength));
>  

coding style, extra space between angle bracket and round bracket

> spectrumwidget.cpp:206
>  //         return qRound(m_intensityMax * pow(color*factor, m_gamma)); FIXME
> -        return m_intensityMax * color;
> +        return static_cast <int> (m_intensityMax * color);
>      }

coding style, extra space between angle bracket and round bracket

> spectrumwidget.cpp:219
>      //the total number of tickmarks to draw (small and long)
> -    const int numberOfTickmarks = (int)floor((double)(width() / d));
> +    const int numberOfTickmarks = static_cast <int> (floor(width() / d));
>  

coding style, extra space between angle bracket and round bracket

> spectrumwidget.cpp:230
>                  i * d < width() - space) {
> -                pos = (double)(i * d) / width();
> +                pos = static_cast <double> (i * d) / width();
>                  p->fillRect(i * d - space, m_realHeight + 12, 2 * space, 15, Qt::white);

coding style, extra space between angle bracket and round bracket

> spectrumwidget.cpp:318
>  
> -    findPeakFromMouseposition(Wavelength((double)e->pos().x() / width()));
> +    findPeakFromMouseposition(Wavelength(static_cast <double> (e->pos().x()) / width()));
>  }

coding style, extra space between angle bracket and round bracket

> spectrumwidget.cpp:324
>      qDebug() << "SpectrumWidget::findPeakFromMouseposition()";
> -    Spectrum::peak *peak = NULL;
> +    Spectrum::peak *peak = nullptr;
>  

unrelated change

> spectrumwidget.cpp:361-362
>      if (e->button() == Qt::LeftButton) {
> -        int left = (int)Wavelength((double)m_LMBPointPress.x() / width());
> -        int right = (int)Wavelength((double)e->pos().x() / width());
> +        int left = static_cast <int> (Wavelength(m_LMBPointPress.x()) / width());
> +        int right = static_cast <int> (Wavelength(e->pos().x()) / width());
>  

coding style, extra space between angle bracket and round bracket

> tablesdialog.cpp:270
>  {
> -    QMenu* menu = new QMenu((QWidget*) sender());
> +    QMenu* menu = new QMenu(static_cast <QWidget*> (sender()));
>      menu->addAction(i18n("&Copy"), this, SLOT(copyToClipboard()), QKeySequence(Qt::Key_C | Qt::CTRL));

coding style, extra space between angle bracket and round bracket

> moleculeview.cpp:174
>      if (m_molecule.atomCount() != 0) {
> -        disconnect(ui.glWidget->molecule(), 0, this, 0);
> +        disconnect(ui.glWidget->molecule(), nullptr, this, nullptr);
>          ui.glWidget->setMolecule(&m_molecule);

unrelated change

> obconverter.cpp:64
>      delete OBConvObject;
> -    OBConvObject = NULL;
> +    OBConvObject = nullptr;
>  }

unrelated change

REPOSITORY
  R326 Kalzium

REVISION DETAIL
  https://phabricator.kde.org/D15690

To: carlos_hdc, tcanabrava, pino
Cc: pino, kde-edu, narvaez, apol
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-edu/attachments/20180923/41323b50/attachment-0001.html>


More information about the kde-edu mailing list