mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-08-22 14:17:43 +02:00
K&R sim/*.c: bulk function implementation conversion
K&R obsolete syntax removal for C23 compatibility series
This commit is contained in:
committed by
R. Timothy Edwards
parent
b3384f9104
commit
1fbba4408f
+49
-49
@@ -83,9 +83,9 @@ static char bestName[256];
|
||||
*/
|
||||
|
||||
int
|
||||
SimConnectFunc(tile, cx)
|
||||
Tile *tile; /* Tile found. */
|
||||
TreeContext *cx; /* Describes context of search. The client
|
||||
SimConnectFunc(
|
||||
Tile *tile, /* Tile found. */
|
||||
TreeContext *cx) /* Describes context of search. The client
|
||||
* data is a pointer to the list head of
|
||||
* the conSrArg2's describing the areas
|
||||
* left to check.
|
||||
@@ -318,8 +318,8 @@ SimConnectFunc(tile, cx)
|
||||
#define MAXPATHNAME 256
|
||||
|
||||
void
|
||||
SimTreeCopyConnect(scx, mask, xMask, connect, area, destUse, Node_Name)
|
||||
SearchContext *scx; /* Describes starting area. The
|
||||
SimTreeCopyConnect(
|
||||
SearchContext *scx, /* Describes starting area. The
|
||||
* scx_use field gives the root of
|
||||
* the hierarchy to search, and the
|
||||
* scx_area field gives the starting
|
||||
@@ -327,26 +327,26 @@ SimTreeCopyConnect(scx, mask, xMask, connect, area, destUse, Node_Name)
|
||||
* this area. The transform is from
|
||||
* coords of scx_use to destUse.
|
||||
*/
|
||||
TileTypeBitMask *mask; /* Tile types to start from in area. */
|
||||
int xMask; /* Information must be expanded in all
|
||||
TileTypeBitMask *mask, /* Tile types to start from in area. */
|
||||
int xMask, /* Information must be expanded in all
|
||||
* of the windows indicated by this
|
||||
* mask. Use 0 to consider all info
|
||||
* regardless of expansion.
|
||||
*/
|
||||
TileTypeBitMask *connect; /* Points to table that defines what
|
||||
TileTypeBitMask *connect, /* Points to table that defines what
|
||||
* each tile type is considered to
|
||||
* connect to. Use DBConnectTbl as
|
||||
* a default.
|
||||
*/
|
||||
Rect *area; /* The resulting information is
|
||||
Rect *area, /* The resulting information is
|
||||
* clipped to this area. Pass
|
||||
* TiPlaneRect to get everything.
|
||||
*/
|
||||
CellUse *destUse; /* Result use in which to place
|
||||
CellUse *destUse, /* Result use in which to place
|
||||
* anything connected to material of
|
||||
* type mask in area of rootUse.
|
||||
*/
|
||||
char *Node_Name; /* Name of node returned.
|
||||
char *Node_Name) /* Name of node returned.
|
||||
* NOTE: Don't call this "NodeName",
|
||||
* because that conflicts with reserved
|
||||
* words in some compilers.
|
||||
@@ -438,8 +438,9 @@ SimTreeCopyConnect(scx, mask, xMask, connect, area, destUse, Node_Name)
|
||||
*/
|
||||
|
||||
bool
|
||||
efPreferredName(name1, name2)
|
||||
char *name1, *name2;
|
||||
efPreferredName(
|
||||
char *name1,
|
||||
char *name2)
|
||||
{
|
||||
int nslashes1, nslashes2;
|
||||
char *np1, *np2;
|
||||
@@ -550,32 +551,31 @@ efPreferredName(name1, name2)
|
||||
*/
|
||||
|
||||
int
|
||||
SimSrConnect(def, startArea, mask, connect, bounds, func, clientData)
|
||||
CellDef *def; /* Cell definition in which to carry out
|
||||
SimSrConnect(
|
||||
CellDef *def, /* Cell definition in which to carry out
|
||||
* the connectivity search. Only paint
|
||||
* in this definition is considered.
|
||||
*/
|
||||
Rect *startArea; /* Area to search for an initial tile. Only
|
||||
Rect *startArea, /* Area to search for an initial tile. Only
|
||||
* tiles OVERLAPPING the area are considered.
|
||||
* This area should have positive x and y
|
||||
* dimensions.
|
||||
*/
|
||||
TileTypeBitMask *mask; /* Only tiles of one of these types are used
|
||||
TileTypeBitMask *mask, /* Only tiles of one of these types are used
|
||||
* as initial tiles.
|
||||
*/
|
||||
TileTypeBitMask *connect; /* Pointer to a table indicating what tile
|
||||
TileTypeBitMask *connect, /* Pointer to a table indicating what tile
|
||||
* types connect to what other tile types.
|
||||
* Each entry gives a mask of types that
|
||||
* connect to tiles of a given type.
|
||||
*/
|
||||
Rect *bounds; /* Area, in coords of scx->scx_use->cu_def,
|
||||
Rect *bounds, /* Area, in coords of scx->scx_use->cu_def,
|
||||
* that limits the search: only tiles
|
||||
* overalapping this area will be returned.
|
||||
* Use TiPlaneRect to search everywhere.
|
||||
*/
|
||||
int (*func)(); /* Function to apply at each connected tile. */
|
||||
ClientData clientData; /* Client data for above function. */
|
||||
|
||||
int (*func)(), /* Function to apply at each connected tile. */
|
||||
ClientData clientData) /* Client data for above function. */
|
||||
{
|
||||
struct conSrArg csa;
|
||||
int startPlane, result;
|
||||
@@ -661,26 +661,26 @@ SimSrConnect(def, startArea, mask, connect, bounds, func, clientData)
|
||||
*/
|
||||
|
||||
int
|
||||
SimTreeSrTiles(scx, mask, xMask, tpath, func, cdarg)
|
||||
SearchContext *scx; /* Pointer to search context specifying
|
||||
SimTreeSrTiles(
|
||||
SearchContext *scx, /* Pointer to search context specifying
|
||||
* a cell use to search, an area in the
|
||||
* coordinates of the cell's def, and a
|
||||
* transform back to "root" coordinates.
|
||||
*/
|
||||
TileTypeBitMask *mask; /* Only tiles with a type for which
|
||||
TileTypeBitMask *mask, /* Only tiles with a type for which
|
||||
* a bit in this mask is on are processed.
|
||||
*/
|
||||
int xMask; /* All subcells are visited recursively
|
||||
int xMask, /* All subcells are visited recursively
|
||||
* until we encounter uses whose flags,
|
||||
* when anded with xMask, are not
|
||||
* equal to xMask.
|
||||
*/
|
||||
TerminalPath *tpath; /* Pointer to a structure describing a
|
||||
TerminalPath *tpath, /* Pointer to a structure describing a
|
||||
* partially filled-in terminal pathname.
|
||||
* Add new components as encountered.
|
||||
*/
|
||||
int (*func)(); /* Function to apply at each qualifying tile */
|
||||
ClientData cdarg; /* Client data for above function */
|
||||
int (*func)(), /* Function to apply at each qualifying tile */
|
||||
ClientData cdarg) /* Client data for above function */
|
||||
{
|
||||
int SimCellTileSrFunc();
|
||||
TreeFilter filter;
|
||||
@@ -703,29 +703,29 @@ SimTreeSrTiles(scx, mask, xMask, tpath, func, cdarg)
|
||||
*/
|
||||
|
||||
int
|
||||
SimTreeSrNMTiles(scx, dinfo, mask, xMask, tpath, func, cdarg)
|
||||
SearchContext *scx; /* Pointer to search context specifying
|
||||
SimTreeSrNMTiles(
|
||||
SearchContext *scx, /* Pointer to search context specifying
|
||||
* a cell use to search, an area in the
|
||||
* coordinates of the cell's def, and a
|
||||
* transform back to "root" coordinates.
|
||||
*/
|
||||
TileType dinfo; /* Type containing information about the
|
||||
TileType dinfo, /* Type containing information about the
|
||||
* triangular area to search.
|
||||
*/
|
||||
TileTypeBitMask *mask; /* Only tiles with a type for which
|
||||
TileTypeBitMask *mask, /* Only tiles with a type for which
|
||||
* a bit in this mask is on are processed.
|
||||
*/
|
||||
int xMask; /* All subcells are visited recursively
|
||||
int xMask, /* All subcells are visited recursively
|
||||
* until we encounter uses whose flags,
|
||||
* when anded with xMask, are not
|
||||
* equal to xMask.
|
||||
*/
|
||||
TerminalPath *tpath; /* Pointer to a structure describing a
|
||||
TerminalPath *tpath, /* Pointer to a structure describing a
|
||||
* partially filled-in terminal pathname.
|
||||
* Add new components as encountered.
|
||||
*/
|
||||
int (*func)(); /* Function to apply at each qualifying tile */
|
||||
ClientData cdarg; /* Client data for above function */
|
||||
int (*func)(), /* Function to apply at each qualifying tile */
|
||||
ClientData cdarg) /* Client data for above function */
|
||||
{
|
||||
int SimCellTileSrFunc();
|
||||
TreeFilter filter;
|
||||
@@ -746,9 +746,9 @@ SimTreeSrNMTiles(scx, dinfo, mask, xMask, tpath, func, cdarg)
|
||||
*/
|
||||
|
||||
int
|
||||
SimCellTileSrFunc(scx, fp)
|
||||
SearchContext *scx;
|
||||
TreeFilter *fp;
|
||||
SimCellTileSrFunc(
|
||||
SearchContext *scx,
|
||||
TreeFilter *fp)
|
||||
{
|
||||
TreeContext context;
|
||||
TerminalPath *tp;
|
||||
@@ -860,15 +860,15 @@ cleanup:
|
||||
*/
|
||||
|
||||
int
|
||||
SimPutLabel(cellDef, rect, align, text, type)
|
||||
CellDef *cellDef; /* Cell in which label is placed */
|
||||
Rect *rect; /* Location of label; see above for description */
|
||||
int align; /* Orientation/alignment of text. If this is < 0,
|
||||
SimPutLabel(
|
||||
CellDef *cellDef, /* Cell in which label is placed */
|
||||
Rect *rect, /* Location of label, see above for description */
|
||||
int align, /* Orientation/alignment of text. If this is < 0,
|
||||
* an orientation will be picked to keep the text
|
||||
* inside the cell boundary.
|
||||
*/
|
||||
char *text; /* Pointer to actual text of label */
|
||||
TileType type; /* Type of tile to be labeled */
|
||||
char *text, /* Pointer to actual text of label */
|
||||
TileType type) /* Type of tile to be labeled */
|
||||
{
|
||||
Label *lab;
|
||||
int len, x1, x2, y1, y2, tmp, labx, laby;
|
||||
@@ -963,9 +963,9 @@ SimPutLabel(cellDef, rect, align, text, type)
|
||||
*/
|
||||
|
||||
void
|
||||
SimRsimHandler(w, cmd)
|
||||
MagWindow *w; /* Window containing cursor. */
|
||||
TxCommand *cmd; /* Describes what happened. */
|
||||
SimRsimHandler(
|
||||
MagWindow *w, /* Window containing cursor. */
|
||||
TxCommand *cmd) /* Describes what happened. */
|
||||
{
|
||||
|
||||
static int buttonCorner = TOOL_ILG;
|
||||
|
||||
Reference in New Issue
Block a user