comparison data/model/PowerOfTwoZoomConstraint.cpp @ 936:0c1d6de8f44b

Merge from branch warnfix_no_size_t
author Chris Cannam
date Wed, 18 Jun 2014 13:51:16 +0100
parents 59e7fe1b1003
children d4a28d1479a8 48e9f538e6e9
comparison
equal deleted inserted replaced
917:49618f39ff09 936:0c1d6de8f44b
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;