forked from osmocom/wireshark
Qt: Fix -Wshorten-64-to-32 warnings
Fix some warnings when building with -Wshorten-64-to-32 flag for C++ code. Fixes for warnings from QList, QTimer and QVector has been pushed upstream, so some time we may be able to enable this flag for C++. Change-Id: Iae7457f9afc469c63f3edbe23dbf272b5c6c9e5e Reviewed-on: https://code.wireshark.org/review/20310 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
parent
311b1ee700
commit
26e62dfad0
|
@ -572,7 +572,7 @@ void ByteViewText::updateScrollbars()
|
|||
|
||||
qint64 maxval = length / row_width_ + ((length % row_width_) ? 1 : 0) - viewport()->height() / line_spacing_;
|
||||
|
||||
verticalScrollBar()->setRange(0, qMax((qint64)0, maxval));
|
||||
verticalScrollBar()->setRange(0, int(qMax((qint64)0, maxval)));
|
||||
horizontalScrollBar()->setRange(0, qMax(0, static_cast<int>((totalPixels() - viewport()->width()) / font_width_)));
|
||||
}
|
||||
|
||||
|
|
|
@ -113,12 +113,12 @@ void FileSetDialog::addFile(fileset_entry *entry) {
|
|||
* it will be 0.
|
||||
*/
|
||||
if (entry->ctime > 0)
|
||||
created = QDateTime::fromTime_t(entry->ctime).toLocalTime().toString("yyyy-MM-dd HH:mm:ss");
|
||||
created = QDateTime::fromTime_t(uint(entry->ctime)).toLocalTime().toString("yyyy-MM-dd HH:mm:ss");
|
||||
else
|
||||
created = "Not available";
|
||||
}
|
||||
|
||||
modified = QDateTime::fromTime_t(entry->mtime).toLocalTime().toString("yyyy-MM-dd HH:mm:ss");
|
||||
modified = QDateTime::fromTime_t(uint(entry->mtime)).toLocalTime().toString("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
size_str = format_size(entry->size, format_size_unit_bytes|format_size_prefix_si);
|
||||
|
||||
|
|
|
@ -974,7 +974,7 @@ void Iax2AnalysisDialog::saveAudio(Iax2AnalysisDialog::StreamDirection direction
|
|||
if (stop_flag) {
|
||||
break;
|
||||
}
|
||||
ui->progressFrame->setValue(fwd_tempfile_->pos() * 100 / fwd_tempfile_->size());
|
||||
ui->progressFrame->setValue(int(fwd_tempfile_->pos() * 100 / fwd_tempfile_->size()));
|
||||
|
||||
if (fwd_statinfo_.pt == PT_PCMU) {
|
||||
sample = ulaw2linear((unsigned char)f_rawvalue);
|
||||
|
@ -1001,7 +1001,7 @@ void Iax2AnalysisDialog::saveAudio(Iax2AnalysisDialog::StreamDirection direction
|
|||
if (stop_flag) {
|
||||
break;
|
||||
}
|
||||
ui->progressFrame->setValue(rev_tempfile_->pos() * 100 / rev_tempfile_->size());
|
||||
ui->progressFrame->setValue(int(rev_tempfile_->pos() * 100 / rev_tempfile_->size()));
|
||||
|
||||
if (rev_statinfo_.pt == PT_PCMU) {
|
||||
sample = ulaw2linear((unsigned char)r_rawvalue);
|
||||
|
@ -1041,8 +1041,8 @@ void Iax2AnalysisDialog::saveAudio(Iax2AnalysisDialog::StreamDirection direction
|
|||
if (stop_flag) {
|
||||
break;
|
||||
}
|
||||
int fwd_pct = fwd_tempfile_->pos() * 100 / fwd_tempfile_->size();
|
||||
int rev_pct = rev_tempfile_->pos() * 100 / rev_tempfile_->size();
|
||||
int fwd_pct = int(fwd_tempfile_->pos() * 100 / fwd_tempfile_->size());
|
||||
int rev_pct = int(rev_tempfile_->pos() * 100 / rev_tempfile_->size());
|
||||
ui->progressFrame->setValue(qMin(fwd_pct, rev_pct));
|
||||
|
||||
if (f_write_silence > 0) {
|
||||
|
@ -1108,13 +1108,13 @@ void Iax2AnalysisDialog::saveAudio(Iax2AnalysisDialog::StreamDirection direction
|
|||
switch (direction) {
|
||||
/* Only forward direction */
|
||||
case dir_forward_: {
|
||||
progress_pct = fwd_tempfile_->pos() * 100 / fwd_tempfile_->size();
|
||||
progress_pct = int(fwd_tempfile_->pos() * 100 / fwd_tempfile_->size());
|
||||
tempfile = fwd_tempfile_;
|
||||
break;
|
||||
}
|
||||
/* only reversed direction */
|
||||
case dir_reverse_: {
|
||||
progress_pct = rev_tempfile_->pos() * 100 / rev_tempfile_->size();
|
||||
progress_pct = int(rev_tempfile_->pos() * 100 / rev_tempfile_->size());
|
||||
tempfile = rev_tempfile_;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -437,7 +437,7 @@ void ImportTextDialog::check_line_edit(SyntaxLineEdit *le, bool &ok_enabled, con
|
|||
if (is_short) {
|
||||
*val_ptr = num_str.toUShort(&conv_ok, base);
|
||||
} else {
|
||||
*val_ptr = num_str.toULong(&conv_ok, base);
|
||||
*val_ptr = (guint)num_str.toULong(&conv_ok, base);
|
||||
}
|
||||
if (conv_ok && *val_ptr <= max_val) {
|
||||
syntax_state = SyntaxLineEdit::Valid;
|
||||
|
|
|
@ -2032,7 +2032,7 @@ void IOGraph::recalcGraphData(capture_file *cap_file)
|
|||
mavg_in_average_count++;
|
||||
mavg_right++;
|
||||
}
|
||||
mavg_to_add = warmup_interval;
|
||||
mavg_to_add = (unsigned int)warmup_interval;
|
||||
}
|
||||
|
||||
for (int i = 0; i <= cur_idx_; i++) {
|
||||
|
|
|
@ -5624,7 +5624,7 @@ void QCPAxis::generateAutoTicks()
|
|||
// Generate tick positions according to mTickStep:
|
||||
qint64 firstStep = floor(mRange.lower/mTickStep); // do not use qFloor here, or we'll lose 64 bit precision
|
||||
qint64 lastStep = ceil(mRange.upper/mTickStep); // do not use qCeil here, or we'll lose 64 bit precision
|
||||
int tickcount = lastStep-firstStep+1;
|
||||
int tickcount = int(lastStep-firstStep+1);
|
||||
if (tickcount < 0) tickcount = 0;
|
||||
mTickVector.resize(tickcount);
|
||||
for (int i=0; i<tickcount; ++i)
|
||||
|
|
|
@ -176,7 +176,7 @@ const QString file_size_to_qstring(const gint64 size)
|
|||
|
||||
const QString time_t_to_qstring(time_t ti_time)
|
||||
{
|
||||
QDateTime date_time = QDateTime::fromTime_t(ti_time);
|
||||
QDateTime date_time = QDateTime::fromTime_t(uint(ti_time));
|
||||
QString time_str = date_time.toLocalTime().toString("yyyy-MM-dd hh:mm:ss");
|
||||
return time_str;
|
||||
}
|
||||
|
|
|
@ -1153,7 +1153,7 @@ gboolean RtpAnalysisDialog::saveAudioAUUnidir(tap_rtp_stat_t &statinfo, QTempora
|
|||
if (*stop_flag) {
|
||||
return FALSE;
|
||||
}
|
||||
ui->progressFrame->setValue(tempfile->pos() * 100 / tempfile->size());
|
||||
ui->progressFrame->setValue(int(tempfile->pos() * 100 / tempfile->size()));
|
||||
|
||||
sample_count=convert_payload_to_samples(save_data.payload_type, tempfile ,pd_out, save_data.payload_len);
|
||||
|
||||
|
@ -1369,7 +1369,7 @@ gboolean RtpAnalysisDialog::saveAudioRAW(StreamDirection direction, QFile *save_
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
ui->progressFrame->setValue(tempfile->pos() * 100 / fwd_tempfile_->size());
|
||||
ui->progressFrame->setValue(int(tempfile->pos() * 100 / fwd_tempfile_->size()));
|
||||
|
||||
if (save_data.payload_len > 0) {
|
||||
for(size_t i = 0; i < save_data.payload_len; i++) {
|
||||
|
|
|
@ -960,7 +960,7 @@ goodput_adjust_for_sacks(guint32 *seglen, guint32 last_ack,
|
|||
*seglen += (next_new->second - next_new->first);
|
||||
// insert next_new before next_old in old_sacks
|
||||
// (be sure to save and restore next_old iterator around insert!)
|
||||
int next_old_idx = next_old - old_sacks.begin();
|
||||
int next_old_idx = int(next_old - old_sacks.begin());
|
||||
old_sacks.insert(next_old, *next_new);
|
||||
next_old = old_sacks.begin() + next_old_idx + 1;
|
||||
// advance to the next remaining sack in new_sacks
|
||||
|
|
Loading…
Reference in New Issue