forked from osmocom/wireshark
Fixing some implicit coversations (-Wshorten-64-to-32)
Fixing some "implicit conversion loses integer precision" warnings reported by clang with -Wshorten-64-to-32 option Change-Id: Icd641d5f4fd8ff129f03f1b9e1da0fc86329f096 Reviewed-on: https://code.wireshark.org/review/31901 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
e46686cceb
commit
061ebbda56
|
@ -294,7 +294,7 @@ dissect_stcsig(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _
|
|||
}
|
||||
timestamp_2_5_ns = (guint64)(tvb_get_guint8(stcsig_tvb, 15) & 0xfc) << 30;
|
||||
timestamp_2_5_ns |= tvb_get_ntohl(stcsig_tvb, 11);
|
||||
timestamp.secs = timestamp_2_5_ns / 400000000L;
|
||||
timestamp.secs = (time_t)(timestamp_2_5_ns / 400000000L);
|
||||
timestamp.nsecs = (int)(timestamp_2_5_ns % 400000000L);
|
||||
proto_tree_add_time(stcsig_tree, &hfi_stcsig_timestamp, stcsig_tvb, 11, 5, ×tamp);
|
||||
proto_tree_add_item(stcsig_tree, &hfi_stcsig_prbseq, stcsig_tvb, 15, 1, ENC_NA);
|
||||
|
|
|
@ -583,7 +583,7 @@ steamdiscover_dissect_body_status(tvbuff_t *tvb, packet_info *pinfo, proto_tree
|
|||
break;
|
||||
case STEAMDISCOVER_FN_STATUS_TIMESTAMP:
|
||||
STEAMDISCOVER_ENSURE_WIRETYPE(PROTOBUF_WIRETYPE_VARINT);
|
||||
timestamp.secs = get_varint64(pb.tvb, pb.offset, pb.bytes_left, &len);
|
||||
timestamp.secs = (time_t)get_varint64(pb.tvb, pb.offset, pb.bytes_left, &len);
|
||||
timestamp.nsecs = 0;
|
||||
proto_tree_add_time(tree, hf_steam_ihs_discovery_body_status_timestamp, pb.tvb,
|
||||
pb.offset, len, ×tamp);
|
||||
|
|
|
@ -732,7 +732,7 @@ dissect_timestamp_mb(tvbuff_t * tvb, proto_tree* tree) {
|
|||
*/
|
||||
plc_timestamp_ns = ((plc_timestamp>>41)&0x7FFFFF)*100000*4194304 + ((plc_timestamp >>9)&0xFFFFFFFF)*100000/1024 + ((plc_timestamp>>4)&0x1F)*10000/2048 + (plc_timestamp&0x0F)*10000/2048/16;
|
||||
|
||||
ts.secs= plc_timestamp_ns/1000000000;
|
||||
ts.secs= (time_t)(plc_timestamp_ns/1000000000);
|
||||
ts.nsecs=plc_timestamp_ns%1000000000;
|
||||
proto_tree_add_time(timestamp_tree, hf_plc_mb_ts_timestamp_formatted, tvb, 1, 8, &ts);
|
||||
|
||||
|
|
|
@ -2048,7 +2048,7 @@ get_time_value(proto_tree *tree, tvbuff_t *tvb, const gint start,
|
|||
* The upper 48 bits are seconds since the
|
||||
* UN*X epoch.
|
||||
*/
|
||||
time_stamp->secs = tvb_get_ntoh48(tvb, start);
|
||||
time_stamp->secs = (time_t)tvb_get_ntoh48(tvb, start);
|
||||
/*
|
||||
* The lower 16 bits are 1/2^16s of a second;
|
||||
* convert them to nanoseconds.
|
||||
|
@ -2086,7 +2086,7 @@ get_time_value(proto_tree *tree, tvbuff_t *tvb, const gint start,
|
|||
* The lower 48 bits are seconds since the
|
||||
* UN*X epoch.
|
||||
*/
|
||||
time_stamp->secs = tvb_get_letoh48(tvb, start+2);
|
||||
time_stamp->secs = (time_t)tvb_get_letoh48(tvb, start+2);
|
||||
/*
|
||||
* The upper 16 bits are 1/2^16s of a second;
|
||||
* convert them to nanoseconds.
|
||||
|
|
|
@ -3872,7 +3872,7 @@ sharkd_rtp_download_decode(struct sharkd_download_rtp *req)
|
|||
SAMPLE *resample_buff = (SAMPLE *) g_malloc(resample_buff_len);
|
||||
spx_uint32_t cur_in_rate = 0;
|
||||
char *write_buff = NULL;
|
||||
gint64 write_bytes = 0;
|
||||
size_t write_bytes = 0;
|
||||
unsigned channels = 0;
|
||||
unsigned sample_rate = 0;
|
||||
|
||||
|
|
|
@ -742,7 +742,7 @@ void Iax2AnalysisDialog::savePayload(QTemporaryFile *tmpfile, packet_info *pinfo
|
|||
|
||||
if (iax2info->payload_len > 0) {
|
||||
const char *data = (const char *) iax2info->payload_data;
|
||||
size_t nchars;
|
||||
qint64 nchars;
|
||||
|
||||
nchars = tmpfile->write(data, iax2info->payload_len);
|
||||
if (nchars != (iax2info->payload_len)) {
|
||||
|
@ -908,7 +908,7 @@ void Iax2AnalysisDialog::saveAudio(Iax2AnalysisDialog::StreamDirection direction
|
|||
gint16 sample;
|
||||
guint8 pd[4];
|
||||
gboolean stop_flag = FALSE;
|
||||
size_t nchars;
|
||||
qint64 nchars;
|
||||
|
||||
save_file.open(QIODevice::WriteOnly);
|
||||
fwd_tempfile_->seek(0);
|
||||
|
|
|
@ -796,7 +796,7 @@ void RtpAnalysisDialog::savePayload(QTemporaryFile *tmpfile, tap_rtp_stat_t *sta
|
|||
(rtpinfo->info_payload_type == PT_CN_OLD)) {
|
||||
} else { /* All other payloads */
|
||||
const char *data;
|
||||
size_t nchars;
|
||||
qint64 nchars;
|
||||
tap_rtp_save_data_t save_data;
|
||||
|
||||
if (!rtpinfo->info_all_data_present) {
|
||||
|
@ -827,7 +827,7 @@ void RtpAnalysisDialog::savePayload(QTemporaryFile *tmpfile, tap_rtp_stat_t *sta
|
|||
}
|
||||
if (save_data.payload_len > 0) {
|
||||
nchars = tmpfile->write(data, save_data.payload_len);
|
||||
if (nchars != save_data.payload_len) {
|
||||
if ((size_t)nchars != save_data.payload_len) {
|
||||
/* Write error or short write */
|
||||
err_str_ = tr("Can't save in a file: File I/O problem.");
|
||||
save_payload_error_ = TAP_RTP_FILE_WRITE_ERROR;
|
||||
|
@ -1072,7 +1072,7 @@ size_t RtpAnalysisDialog::convert_payload_to_samples(unsigned int payload_type,
|
|||
|
||||
gboolean RtpAnalysisDialog::saveAudioAUSilence(size_t total_len, QFile *save_file, gboolean *stop_flag)
|
||||
{
|
||||
size_t nchars;
|
||||
qint64 nchars;
|
||||
guint8 pd_out[2*4000];
|
||||
gint16 silence;
|
||||
guint8 pd[4];
|
||||
|
@ -1095,9 +1095,9 @@ gboolean RtpAnalysisDialog::saveAudioAUSilence(size_t total_len, QFile *save_fil
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean RtpAnalysisDialog::saveAudioAUUnidir(tap_rtp_stat_t &statinfo, QTemporaryFile *tempfile, QFile *save_file, size_t header_end, gboolean *stop_flag, gboolean interleave, size_t prefix_silence)
|
||||
gboolean RtpAnalysisDialog::saveAudioAUUnidir(tap_rtp_stat_t &statinfo, QTemporaryFile *tempfile, QFile *save_file, qint64 header_end, gboolean *stop_flag, gboolean interleave, size_t prefix_silence)
|
||||
{
|
||||
size_t nchars;
|
||||
qint64 nchars;
|
||||
guint8 pd_out[2*4000];
|
||||
guint8 pd[4];
|
||||
tap_rtp_save_data_t save_data;
|
||||
|
@ -1125,7 +1125,7 @@ gboolean RtpAnalysisDialog::saveAudioAUUnidir(tap_rtp_stat_t &statinfo, QTempora
|
|||
}
|
||||
nchars += save_file->write((const char *)pd, 2);
|
||||
}
|
||||
if (nchars < sample_count*2) {
|
||||
if ((size_t)nchars < sample_count*2) {
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -1134,7 +1134,7 @@ gboolean RtpAnalysisDialog::saveAudioAUUnidir(tap_rtp_stat_t &statinfo, QTempora
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
gboolean RtpAnalysisDialog::saveAudioAUBidir(tap_rtp_stat_t &fwd_statinfo, tap_rtp_stat_t &rev_statinfo, QTemporaryFile *fwd_tempfile, QTemporaryFile *rev_tempfile, QFile *save_file, size_t header_end, gboolean *stop_flag, size_t prefix_silence_fwd, size_t prefix_silence_rev)
|
||||
gboolean RtpAnalysisDialog::saveAudioAUBidir(tap_rtp_stat_t &fwd_statinfo, tap_rtp_stat_t &rev_statinfo, QTemporaryFile *fwd_tempfile, QTemporaryFile *rev_tempfile, QFile *save_file, qint64 header_end, gboolean *stop_flag, size_t prefix_silence_fwd, size_t prefix_silence_rev)
|
||||
{
|
||||
if (! saveAudioAUUnidir(fwd_statinfo, fwd_tempfile, save_file, header_end, stop_flag, TRUE, prefix_silence_fwd))
|
||||
{
|
||||
|
@ -1151,8 +1151,8 @@ gboolean RtpAnalysisDialog::saveAudioAUBidir(tap_rtp_stat_t &fwd_statinfo, tap_r
|
|||
gboolean RtpAnalysisDialog::saveAudioAU(StreamDirection direction, QFile *save_file, gboolean *stop_flag, RtpAnalysisDialog::SyncType sync)
|
||||
{
|
||||
guint8 pd[4];
|
||||
size_t nchars;
|
||||
size_t header_end;
|
||||
qint64 nchars;
|
||||
qint64 header_end;
|
||||
size_t fwd_total_len;
|
||||
size_t rev_total_len;
|
||||
size_t total_len;
|
||||
|
|
|
@ -128,8 +128,8 @@ private:
|
|||
|
||||
size_t convert_payload_to_samples(unsigned int payload_type, QTemporaryFile *tempfile, guint8 *pd_out, size_t expected_nchars);
|
||||
gboolean saveAudioAUSilence(size_t total_len, QFile *save_file, gboolean *stop_flag);
|
||||
gboolean saveAudioAUUnidir(tap_rtp_stat_t &statinfo, QTemporaryFile *tempfile, QFile *save_file, size_t header_end, gboolean *stop_flag, gboolean interleave, size_t prefix_silence);
|
||||
gboolean saveAudioAUBidir(tap_rtp_stat_t &fwd_statinfo, tap_rtp_stat_t &rev_statinfo, QTemporaryFile *fwd_tempfile, QTemporaryFile *rev_tempfile, QFile *save_file, size_t header_end, gboolean *stop_flag, size_t prefix_silence_fwd, size_t prefix_silence_rev);
|
||||
gboolean saveAudioAUUnidir(tap_rtp_stat_t &statinfo, QTemporaryFile *tempfile, QFile *save_file, qint64 header_end, gboolean *stop_flag, gboolean interleave, size_t prefix_silence);
|
||||
gboolean saveAudioAUBidir(tap_rtp_stat_t &fwd_statinfo, tap_rtp_stat_t &rev_statinfo, QTemporaryFile *fwd_tempfile, QTemporaryFile *rev_tempfile, QFile *save_file, qint64 header_end, gboolean *stop_flag, size_t prefix_silence_fwd, size_t prefix_silence_rev);
|
||||
gboolean saveAudioAU(StreamDirection direction, QFile *save_file, gboolean *stop_flag, RtpAnalysisDialog::SyncType sync);
|
||||
gboolean saveAudioRAW(StreamDirection direction, QFile *save_file, gboolean *stop_flag);
|
||||
void saveAudio(StreamDirection direction, RtpAnalysisDialog::SyncType sync);
|
||||
|
|
Loading…
Reference in New Issue