diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-08-22 12:51:32 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-09-10 11:27:36 +0200 |
commit | 1544d17f73cf1f14873f75b00f4765f8e24b6dae (patch) | |
tree | 981fdba9f09916d27804ecc9f10febe387bd932a /src/libudev/libudev-util.c | |
parent | libudev-util: drop unnecessary argument 'struct udev *udev' from util_resolve... (diff) | |
download | systemd-1544d17f73cf1f14873f75b00f4765f8e24b6dae.tar.xz systemd-1544d17f73cf1f14873f75b00f4765f8e24b6dae.zip |
libudev-util: adjust type of returned value by util_string_hash32()
Diffstat (limited to 'src/libudev/libudev-util.c')
-rw-r--r-- | src/libudev/libudev-util.c | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c index 1cc7bd6612..97aedda5da 100644 --- a/src/libudev/libudev-util.c +++ b/src/libudev/libudev-util.c @@ -84,8 +84,7 @@ int util_resolve_subsys_kernel(const char *string, return 0; } -int util_log_priority(const char *priority) -{ +int util_log_priority(const char *priority) { char *endptr; int prio; @@ -100,8 +99,7 @@ int util_log_priority(const char *priority) return log_level_from_string(priority); } -size_t util_path_encode(const char *src, char *dest, size_t size) -{ +size_t util_path_encode(const char *src, char *dest, size_t size) { size_t i, j; for (i = 0, j = 0; src[i] != '\0'; i++) { @@ -146,8 +144,7 @@ size_t util_path_encode(const char *src, char *dest, size_t size) * Note this may be called with 'str' == 'to', i.e. to replace whitespace * in-place in a buffer. This function can handle that situation. */ -int util_replace_whitespace(const char *str, char *to, size_t len) -{ +int util_replace_whitespace(const char *str, char *to, size_t len) { size_t i, j; /* strip trailing whitespace */ @@ -175,8 +172,7 @@ int util_replace_whitespace(const char *str, char *to, size_t len) } /* allow chars in whitelist, plain ascii, hex-escaping and valid utf8 */ -int util_replace_chars(char *str, const char *white) -{ +int util_replace_chars(char *str, const char *white) { size_t i = 0; int replaced = 0; @@ -229,21 +225,18 @@ int util_replace_chars(char *str, const char *white) * * Returns: 0 if the entire string was copied, non-zero otherwise. **/ -_public_ int udev_util_encode_string(const char *str, char *str_enc, size_t len) -{ +_public_ int udev_util_encode_string(const char *str, char *str_enc, size_t len) { return encode_devnode_name(str, str_enc, len); } -unsigned int util_string_hash32(const char *str) -{ +uint32_t util_string_hash32(const char *str) { return MurmurHash2(str, strlen(str), 0); } /* get a bunch of bit numbers out of the hash, and set the bits in our bit field */ -uint64_t util_string_bloom64(const char *str) -{ +uint64_t util_string_bloom64(const char *str) { uint64_t bits = 0; - unsigned int hash = util_string_hash32(str); + uint32_t hash = util_string_hash32(str); bits |= 1LLU << (hash & 63); bits |= 1LLU << ((hash >> 6) & 63); |