mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 15:41:30 -07:00
Limit maximum grid size in Loopy
Every grid shape has its own limit, so this involved adding a new interface between loopy.c and grid.c. The limits are based on ensuring that the co-ordinate system of the grid doesn't overflow INT_MAX and neither do the lengths of the face and dot arrays. Though now I come to look at it I think the actual limits of grid.c are much lower. Hmm.
This commit is contained in:
2
grid.h
2
grid.h
@ -115,6 +115,8 @@ typedef struct grid {
|
||||
typedef enum grid_type { GRIDGEN_LIST(ENUM) GRID_TYPE_MAX } grid_type;
|
||||
#undef ENUM
|
||||
|
||||
const char *grid_validate_params(grid_type type, int width, int height);
|
||||
|
||||
/* Free directly after use if non-NULL. Will never contain an underscore
|
||||
* (so clients can safely use that as a separator). */
|
||||
char *grid_new_desc(grid_type type, int width, int height, random_state *rs);
|
||||
|
Reference in New Issue
Block a user