aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/data.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/data.c b/src/data.c
index fd8cdd19aa2..2e7f3e017be 100644
--- a/src/data.c
+++ b/src/data.c
@@ -3071,11 +3071,13 @@ usage: (logxor &rest INTS-OR-MARKERS) */)
3071 3071
3072DEFUN ("logcount", Flogcount, Slogcount, 1, 1, 0, 3072DEFUN ("logcount", Flogcount, Slogcount, 1, 1, 0,
3073 doc: /* Return population count of VALUE. 3073 doc: /* Return population count of VALUE.
3074If VALUE is negative, the count is of its two's complement representation. */) 3074This is the number of one bits in the two's complement representation
3075of VALUE. If VALUE is negative, return the number of zero bits in the
3076representation. */)
3075 (Lisp_Object value) 3077 (Lisp_Object value)
3076{ 3078{
3077 CHECK_NUMBER (value); 3079 CHECK_NUMBER (value);
3078 EMACS_UINT v = XUINT (value); 3080 EMACS_INT v = XINT (value) < 0 ? -1 - XINT (value) : XINT (value);
3079 return make_number (EMACS_UINT_WIDTH <= UINT_WIDTH 3081 return make_number (EMACS_UINT_WIDTH <= UINT_WIDTH
3080 ? count_one_bits (v) 3082 ? count_one_bits (v)
3081 : EMACS_UINT_WIDTH <= ULONG_WIDTH 3083 : EMACS_UINT_WIDTH <= ULONG_WIDTH