Skip to content

Commit

Permalink
Fix compiler warning
Browse files Browse the repository at this point in the history
src/sys_unix.c:132:10: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        int r = lrand48(); // this is not thread-safe
            ~   ^~~~~~~~~
  • Loading branch information
LudovicRousseau committed May 6, 2024
1 parent 692c0e5 commit 16369c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sys_unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ INTERNAL int SYS_RandomInt(void)
// the casts are for the sake of clarity
return (int)(ui & (unsigned int)INT_MAX);
#else
int r = lrand48(); // this is not thread-safe
int r = (int)lrand48(); // this is not thread-safe
return r;
#endif /* HAVE_GETRANDOM */
}
Expand Down

0 comments on commit 16369c8

Please sign in to comment.