chiark / gitweb /
tree-wide: htonl() is weird, let's use htobe32() instead (#3538)
[elogind.git] / coccinelle / htonl.cocci
diff --git a/coccinelle/htonl.cocci b/coccinelle/htonl.cocci
new file mode 100644 (file)
index 0000000..4e69bb7
--- /dev/null
@@ -0,0 +1,20 @@
+@@
+expression s;
+@@
+- htonl(s)
++ htobe32(s)
+@@
+expression s;
+@@
+- htons(s)
++ htobe16(s)
+@@
+expression s;
+@@
+- ntohl(s)
++ be32toh(s)
+@@
+expression s;
+@@
+- ntohs(s)
++ be16toh(s)