Lines Matching refs:umax
79 PHPAPI uint32_t php_random_range32(php_random_algo_with_state engine, uint32_t umax) in php_random_range32() argument
100 if (UNEXPECTED(umax == UINT32_MAX)) { in php_random_range32()
105 umax++; in php_random_range32()
108 if ((umax & (umax - 1)) == 0) { in php_random_range32()
109 return result & (umax - 1); in php_random_range32()
113 limit = UINT32_MAX - (UINT32_MAX % umax) - 1; in php_random_range32()
135 return result % umax; in php_random_range32()
138 PHPAPI uint64_t php_random_range64(php_random_algo_with_state engine, uint64_t umax) in php_random_range64() argument
159 if (UNEXPECTED(umax == UINT64_MAX)) { in php_random_range64()
164 umax++; in php_random_range64()
167 if ((umax & (umax - 1)) == 0) { in php_random_range64()
168 return result & (umax - 1); in php_random_range64()
172 limit = UINT64_MAX - (UINT64_MAX % umax) - 1; in php_random_range64()
194 return result % umax; in php_random_range64()
294 zend_ulong umax = (zend_ulong) max - (zend_ulong) min; in php_random_range() local
296 if (umax > UINT32_MAX) { in php_random_range()
297 return (zend_long) (php_random_range64(engine, umax) + min); in php_random_range()
300 return (zend_long) (php_random_range32(engine, umax) + min); in php_random_range()