bzr branch
http://darksoft.org/webbzr/tomo/pyhst
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
#include <stdio.h> #include "hw_tools.h" int hw_calc_blocks(int items, int block_size, int *increment) { int grids = items / block_size; int inc = grids * block_size - items; if (inc) { if (increment) *increment = inc + block_size; return grids + 1; } if (increment) *increment = inc; return grids; } |