Return the greatest common divisor */
| 268 | |
| 269 | /* Return the greatest common divisor */ |
| 270 | static unsigned |
| 271 | gcd(unsigned a, unsigned b) |
| 272 | { |
| 273 | while (TRUE) { |
| 274 | if (b == 0) return a; |
| 275 | a %= b; |
| 276 | if (a == 0) return b; |
| 277 | b %= a; |
| 278 | } |
| 279 | } |
| 280 | |
| 281 | static void |
| 282 | split_tiles(const struct TileSetImage *image) |