Mercurial > dovecot > core-2.2
comparison src/lib/lib.c @ 188:88b31d45c8a4 HEAD
..and now it uses size_t properly..
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 08 Sep 2002 17:59:13 +0300 |
parents | ecbff0f2b811 |
children | fcd6c11710b4 |
comparison
equal
deleted
inserted
replaced
187:ecbff0f2b811 | 188:88b31d45c8a4 |
---|---|
28 #include <stdlib.h> | 28 #include <stdlib.h> |
29 #include <time.h> | 29 #include <time.h> |
30 | 30 |
31 size_t nearest_power(size_t num) | 31 size_t nearest_power(size_t num) |
32 { | 32 { |
33 unsigned int n = 1; | 33 size_t n = 1; |
34 | 34 |
35 i_assert(num <= (unsigned int) (1 << (BITS_IN_SIZE_T-1))); | 35 i_assert(num <= (size_t) (1 << (BITS_IN_SIZE_T-1))); |
36 | 36 |
37 while (n < num) n <<= 1; | 37 while (n < num) n <<= 1; |
38 return n; | 38 return n; |
39 } | 39 } |
40 | 40 |