Skip to content

Commit

Permalink
source: fix -Wshorten-64-to-32 warnings
Browse files Browse the repository at this point in the history
Ticket: OISF#6186
  • Loading branch information
catenacyber authored and victorjulien committed Aug 1, 2024
1 parent 4ae5799 commit f96994f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/source-erf-file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
2 changes: 1 addition & 1 deletion src/source-pcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f96994f

Please sign in to comment.