comparison data/model/PowerOfTwoZoomConstraint.cpp @ 929:59e7fe1b1003 warnfix_no_size_t

Unsigned removals and warning fixes in data/
author Chris Cannam
date Tue, 17 Jun 2014 14:33:42 +0100
parents 3a13b0d4934e
children d4a28d1479a8 48e9f538e6e9
comparison
equal deleted inserted replaced
928:6a94bb528e9d 929:59e7fe1b1003
13 COPYING included with this distribution for more information. 13 COPYING included with this distribution for more information.
14 */ 14 */
15 15
16 #include "PowerOfTwoZoomConstraint.h" 16 #include "PowerOfTwoZoomConstraint.h"
17 17
18 size_t 18 int
19 PowerOfTwoZoomConstraint::getNearestBlockSize(size_t req, 19 PowerOfTwoZoomConstraint::getNearestBlockSize(int req,
20 RoundingDirection dir) const 20 RoundingDirection dir) const
21 { 21 {
22 size_t result = 0; 22 int result = 0;
23 23
24 for (size_t bs = 1; ; bs *= 2) { 24 for (int bs = 1; ; bs *= 2) {
25 if (bs >= req) { 25 if (bs >= req) {
26 if (dir == RoundNearest) { 26 if (dir == RoundNearest) {
27 if (bs - req < req - bs/2) { 27 if (bs - req < req - bs/2) {
28 result = bs; 28 result = bs;
29 break; 29 break;