wiring: constify API call arguments where possible

mark cb_database_buttonhandler_t
This commit is contained in:
Darryl L. Miles 2025-01-31 19:02:19 +00:00 committed by Tim Edwards
parent 81d526562c
commit 922abe6b8d
3 changed files with 9 additions and 7 deletions

View File

@ -95,6 +95,7 @@ wireFindRootWindow(
* with the window's root cellUse (and the search is aborted). * with the window's root cellUse (and the search is aborted).
*/ */
/* @typedef cb_windows_search_t */
int int
wireFindRootFunc( wireFindRootFunc(
MagWindow *window, /* A layout window. */ MagWindow *window, /* A layout window. */
@ -133,7 +134,7 @@ WirePickType(
* If less than zero, then pick a new type * If less than zero, then pick a new type
* based on what's underneath the cursor. * based on what's underneath the cursor.
*/ */
Point *ppoint, /* If non-NULL, contains a point position const Point *ppoint, /* If non-NULL, contains a point position
* from which to get the wire type. * from which to get the wire type.
*/ */
int width) /* Width to use for future wiring. If type int width) /* Width to use for future wiring. If type
@ -304,7 +305,7 @@ WireAddLeg(
* of the wire, in root coordinates. If NULL, * of the wire, in root coordinates. If NULL,
* then the box is used for this. * then the box is used for this.
*/ */
Point *point, /* Describes where to paint the wire to, in const Point *point, /* Describes where to paint the wire to, in
* root coordinates. If NULL, then the cursor * root coordinates. If NULL, then the cursor
* location is used as the point. * location is used as the point.
*/ */
@ -1070,6 +1071,7 @@ WireAddContact(
* ---------------------------------------------------------------------------- * ----------------------------------------------------------------------------
*/ */
/** @typedef cb_database_buttonhandler_t */
void void
WireButtonProc( WireButtonProc(
MagWindow *w, /* Window in which button was pushed. */ MagWindow *w, /* Window in which button was pushed. */
@ -1114,7 +1116,7 @@ WireButtonProc(
void void
WireInit(void) WireInit(void)
{ {
static char *doc = static const char *doc =
"You are currently using the \"wiring\" tool. The button actions are:\n\ "You are currently using the \"wiring\" tool. The button actions are:\n\
left - pick a wiring layer and width (same as \":wire type\")\n\ left - pick a wiring layer and width (same as \":wire type\")\n\
right - add a leg to the wire (same as \":wire leg\")\n\ right - add a leg to the wire (same as \":wire leg\")\n\

View File

@ -88,7 +88,7 @@ WireTechInit(void)
/* ARGSUSED */ /* ARGSUSED */
bool bool
WireTechLine( WireTechLine(
char *sectionName, /* Name of this section (unused). */ const char *sectionName, /* Name of this section (unused). */
int argc, /* Number of arguments on line. */ int argc, /* Number of arguments on line. */
char *argv[]) /* Pointers to fields of line. */ char *argv[]) /* Pointers to fields of line. */
{ {

View File

@ -72,8 +72,8 @@ extern int WireWidth; /* Thickness of material to use for wiring. */
/* Procedures for placing wires: */ /* Procedures for placing wires: */
extern void WirePickType(TileType type, int width); extern void WirePickType(TileType type, const Point *ppoint, int width);
extern void WireAddLeg(Rect *rect, Point *point, int direction); extern void WireAddLeg(Rect *rect, const Point *point, int direction);
extern void WireAddContact(TileType newType, int newWidth); extern void WireAddContact(TileType newType, int newWidth);
extern void WireShowLeg(void); extern void WireShowLeg(void);
extern int WireGetWidth(void); extern int WireGetWidth(void);
@ -88,7 +88,7 @@ extern TileType WireGetType(void);
/* Procedures for reading the technology file: */ /* Procedures for reading the technology file: */
extern void WireTechInit(void); extern void WireTechInit(void);
extern bool WireTechLine(char *sectionName, int argc, char *argv[]); extern bool WireTechLine(const char *sectionName, int argc, char *argv[]);
extern void WireTechFinal(void); extern void WireTechFinal(void);
extern void WireTechScale(int scalen, int scaled); extern void WireTechScale(int scalen, int scaled);