Skip to content

Commit

Permalink
Update to latest libdivide
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Jul 30, 2024
1 parent 8615966 commit fa5b042
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/libdivide.h
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ static LIBDIVIDE_INLINE uint64_t libdivide_128_div_64_to_64(

// Check for overflow and divide by 0.
if (numhi >= den) {
if (r != NULL) *r = ~0ull;
if (r) *r = ~0ull;
return ~0ull;
}

Expand Down Expand Up @@ -559,7 +559,7 @@ static LIBDIVIDE_INLINE uint64_t libdivide_128_div_64_to_64(
q0 = (uint32_t)qhat;

// Return remainder if requested.
if (r != NULL) *r = (rem * b + num0 - q0 * den) >> shift;
if (r) *r = (rem * b + num0 - q0 * den) >> shift;
return ((uint64_t)q1 << 32) | q0;
#endif
}
Expand Down

0 comments on commit fa5b042

Please sign in to comment.