source: fix -Wshorten-64-to-32 warnings

Ticket: #6186
pull/11595/head
Philippe Antoine 7 months ago committed by Victor Julien
parent 4ae5799720
commit f96994fb3b

@ -158,7 +158,7 @@ static inline TmEcode ReadErfRecord(ThreadVars *tv, Packet *p, void *data)
ErfFileThreadVars *etv = (ErfFileThreadVars *)data;
DagRecord dr;
int r = fread(&dr, sizeof(DagRecord), 1, etv->erf);
size_t r = fread(&dr, sizeof(DagRecord), 1, etv->erf);
if (r < 1) {
if (feof(etv->erf)) {
SCLogInfo("End of ERF file reached");

@ -166,7 +166,7 @@ void TmModuleDecodePcapRegister (void)
static inline void UpdatePcapStatsValue64(uint64_t *last, uint32_t current32)
{
/* uint64_t -> uint32_t is defined behaviour. It slices lower 32bits. */
uint32_t last32 = *last;
uint32_t last32 = (uint32_t)*last;
/* Branchless code as wrap-around is defined for unsigned */
*last += (uint32_t)(current32 - last32);

Loading…
Cancel
Save