about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2020-02-11 17:41:06 -0500
committerJune McEnroe <june@causal.agency>2020-02-11 17:41:06 -0500
commitaf87b4e68d14ff5a3155c1f9c2ce1fa7d536c278 (patch)
tree9c4ed01387b22b76ea0f54d9c185befa36aba606
parentMove base64 out of chat.h (diff)
downloadcatgirl-af87b4e68d14ff5a3155c1f9c2ce1fa7d536c278.tar.gz
catgirl-af87b4e68d14ff5a3155c1f9c2ce1fa7d536c278.zip
Move hash to top of chat.h
-rw-r--r--chat.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/chat.h b/chat.h
index a2da9bf..1e28bad 100644
--- a/chat.h
+++ b/chat.h
@@ -58,6 +58,18 @@ static inline size_t idFor(const char *name) {
 	return idNext++;
 }
 
+extern uint32_t hashInit;
+static inline enum Color hash(const char *str) {
+	if (*str == '~') str++;
+	uint32_t hash = hashInit;
+	for (; *str; ++str) {
+		hash = (hash << 5) | (hash >> 27);
+		hash ^= *str;
+		hash *= 0x27220A95;
+	}
+	return 2 + hash % 74;
+}
+
 #define ENUM_CAP \
 	X("extended-join", CapExtendedJoin) \
 	X("sasl", CapSASL) \
@@ -195,18 +207,6 @@ int getopt_config(
 	const char *optstring, const struct option *longopts, int *longindex
 );
 
-extern uint32_t hashInit;
-static inline enum Color hash(const char *str) {
-	if (*str == '~') str++;
-	uint32_t hash = hashInit;
-	for (; *str; ++str) {
-		hash = (hash << 5) | (hash >> 27);
-		hash ^= *str;
-		hash *= 0x27220A95;
-	}
-	return 2 + hash % 74;
-}
-
 // Defined in libcrypto if missing from libc:
 void explicit_bzero(void *b, size_t len);
 #ifndef strlcat
693ca99231f8cc6de505cf15dc&follow=1'>Fix comparison warning in ttpreJune McEnroe 2019-05-20Add AuthorityJune McEnroe 2019-05-19Specify precedence of unary versions of operatorsJune McEnroe 2019-05-18Add compound assignment operators to orderJune McEnroe 2019-05-15Support simple assignment in orderJune McEnroe 2019-05-15Implement sizeof in orderJune McEnroe 2019-05-15Add orderJune McEnroe 2019-05-12Add T suffix in bitJune McEnroe 2019-05-10Highlight yacc and lex files as CJune McEnroe 2019-05-10Use val instead of suboptargJune McEnroe 2019-05-09Add Parable of the SowerJune McEnroe 2019-05-07Add bit without buildJune McEnroe 2019-05-04Fix MANDIR typoJune McEnroe 2019-05-04Move relay to binJune McEnroe