================ @@ -58,21 +38,15 @@ v2 = ROTL(v2, 32); \ } while (0) -/* - Computes a SipHash value - *in: pointer to input data (read-only) - inlen: input data length in bytes (any size_t value) - *k: pointer to the key data (read-only), must be 16 bytes - *out: pointer to output data (write-only), outlen bytes must be allocated - outlen: length of the output in bytes, must be 8 or 16 -*/ -int siphash(const void *in, const size_t inlen, const void *k, uint8_t *out, - const size_t outlen) { +template <int cROUNDS, int dROUNDS, class ResultTy> +static inline ResultTy siphash(const unsigned char *in, uint64_t inlen, ---------------- kbeyls wrote:
Rather than using "static inline", wouldn't putting the `siphash` function in an anonymous namespace be the more C++-way of not making this function available to other translation units? I'm also not fully sure if the `inline` keyword makes a meaningful difference? (I'm not an expert on this, just wondering) https://github.com/llvm/llvm-project/pull/94394 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits