diff options
author | William Pitcock <nenolod@dereferenced.org> | 2017-06-01 04:24:15 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2017-06-01 04:24:15 +0000 |
commit | 40aee5f1d055461f17be6e1c564dee2679ba6e3c (patch) | |
tree | 250becf3401d054c7b5ca32ac480f73e9fdc96d4 /src/apk_defines.h | |
parent | 9325eb721d123bbcb51f0cd838fbe7dc54bc77bb (diff) | |
download | apk-tools-40aee5f1d055461f17be6e1c564dee2679ba6e3c.tar.gz apk-tools-40aee5f1d055461f17be6e1c564dee2679ba6e3c.tar.bz2 apk-tools-40aee5f1d055461f17be6e1c564dee2679ba6e3c.tar.xz apk-tools-40aee5f1d055461f17be6e1c564dee2679ba6e3c.zip |
apk_defines: implement mulmod()
Diffstat (limited to 'src/apk_defines.h')
-rw-r--r-- | src/apk_defines.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/apk_defines.h b/src/apk_defines.h index 50bd063..f5124e9 100644 --- a/src/apk_defines.h +++ b/src/apk_defines.h @@ -121,6 +121,14 @@ static inline size_t muldiv(size_t a, size_t b, size_t c) tmp /= c; return (size_t) tmp; } +static inline size_t mulmod(size_t a, size_t b, size_t c) +{ + unsigned long long tmp; + tmp = a; + tmp *= b; + tmp %= c; + return (size_t) tmp; +} typedef void (*apk_progress_cb)(void *cb_ctx, size_t); |