- double tsx, tsy, ts;
- /*
- * Each window dimension equals the tile size times 3 more than
- * the grid dimension (the border is 3/2 the width of the
- * tiles).
- */
- tsx = (double)*x / ((double)params->w + 3.0);
- tsy = (double)*y / ((double)params->h + 3.0);
- ts = min(tsx, tsy);
- if (expand)
- ds->tilesize = (int)(ts + 0.5);
- else
- ds->tilesize = min((int)ts, PREFERRED_TILE_SIZE);
+ /* Ick: fake up `ds->tilesize' for macro expansion purposes */
+ struct { int tilesize; } ads, *ds = &ads;
+ ads.tilesize = tilesize;