From 7c5dd45eca377a3b675b6f0d4a9331bc3f971ac9 Mon Sep 17 00:00:00 2001 From: lemon Date: Sun, 22 Mar 2026 22:00:35 +0100 Subject: style: change uvlong -> u64int, vlong -> s64int Is much nicer. I don't know whether I want to do it for the other int types too. char and uchar are fine as bytes. u/short -> u/s16int, maybe. --- src/antcc.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/antcc.h') diff --git a/src/antcc.h b/src/antcc.h index 61170b9..976b766 100644 --- a/src/antcc.h +++ b/src/antcc.h @@ -12,8 +12,8 @@ typedef unsigned char uchar; typedef signed char schar; typedef unsigned short ushort; -typedef unsigned long long uvlong; -typedef signed long long vlong; +typedef unsigned long long u64int; +typedef signed long long s64int; typedef unsigned uint; #if __STDC_VERSION__ >= 202311L @@ -46,7 +46,7 @@ void _assertfmt(const char *file, int line, const char *func, const char *expr); #define popcnt(x) __builtin_popcountll(x) #else static inline uint -popcnt(uvlong x) { +popcnt(u64int x) { uint n = 0; while (x) n += x&1, x >>= 1; return n; @@ -54,7 +54,7 @@ popcnt(uvlong x) { #endif static inline bool -ispo2(uvlong x) { +ispo2(u64int x) { return (x != 0) & ((x & (x - 1)) == 0); } @@ -62,7 +62,7 @@ ispo2(uvlong x) { #define ilog2(x) __builtin_ctzll(x) #else static inline uint -ilog2(uvlong x) { /* assumes x is a power of 2 */ +ilog2(u64int x) { /* assumes x is a power of 2 */ uint n = 0; while (x >>= 1) ++n; return n; @@ -73,10 +73,10 @@ ilog2(uvlong x) { /* assumes x is a power of 2 */ #define lowestsetbit(x) __builtin_ctzll(x) #else static inline uint -lowestsetbit(uvlong x) +lowestsetbit(u64int x) { int i = 0; - for (uvlong mask = 1;; ++i, mask <<= 1) + for (u64int mask = 1;; ++i, mask <<= 1) if (x & mask) break; return i; -- cgit v1.2.3