mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-10-06 09:53:00 +02:00
command: use 'const' with readonly data
This then required a cascade of function APIs to also now receive const arguments. This reduces the .data segment use of this module.
This commit is contained in:
committed by
Tim Edwards
parent
5c410e9dcb
commit
0376430702
+1
-1
@@ -201,7 +201,7 @@ cmdEditRedisplayFunc(
|
||||
MagWindow *w, /* Window containing edit cell. */
|
||||
Rect *area) /* Area to be redisplayed. */
|
||||
{
|
||||
static Rect origin = {{-1, -1}, {1, 1}};
|
||||
static const Rect origin = {-1, -1, 1, 1};
|
||||
Rect tmp;
|
||||
DBWclientRec *crec = (DBWclientRec *) w->w_clientData;
|
||||
|
||||
|
||||
+1
-1
@@ -942,7 +942,7 @@ CmdFlush(
|
||||
{
|
||||
CellDef *def;
|
||||
int action;
|
||||
static char *actionNames[] = { "no", "yes", 0 };
|
||||
static const char * const actionNames[] = { "no", "yes", 0 };
|
||||
char *prompt;
|
||||
bool dereference = FALSE;
|
||||
char *strNoConfirm;
|
||||
|
||||
+3
-3
@@ -1566,7 +1566,7 @@ CmdPort(
|
||||
NULL
|
||||
};
|
||||
|
||||
static int cmdClassToBitmask[] =
|
||||
static const int cmdClassToBitmask[] =
|
||||
{
|
||||
PORT_CLASS_DEFAULT,
|
||||
PORT_CLASS_INPUT,
|
||||
@@ -1590,7 +1590,7 @@ CmdPort(
|
||||
NULL
|
||||
};
|
||||
|
||||
static int cmdUseToBitmask[] =
|
||||
static const int cmdUseToBitmask[] =
|
||||
{
|
||||
PORT_USE_DEFAULT,
|
||||
PORT_USE_ANALOG,
|
||||
@@ -1611,7 +1611,7 @@ CmdPort(
|
||||
NULL
|
||||
};
|
||||
|
||||
static int cmdShapeToBitmask[] =
|
||||
static const int cmdShapeToBitmask[] =
|
||||
{
|
||||
PORT_SHAPE_DEFAULT,
|
||||
PORT_SHAPE_ABUT,
|
||||
|
||||
+2
-2
@@ -720,7 +720,7 @@ cmdCheckNewName(
|
||||
bool tryRename,
|
||||
bool noninteractive)
|
||||
{
|
||||
static char *yesno[] = { "no", "yes", 0 };
|
||||
static const char * const yesno[] = { "no", "yes", 0 };
|
||||
char *filename;
|
||||
char *prompt;
|
||||
char *returnname;
|
||||
@@ -1076,7 +1076,7 @@ CmdWarnWrite(void)
|
||||
{
|
||||
int count, code;
|
||||
int cmdWarnWriteFunc(CellDef *cellDef, int *pcount);
|
||||
static char *yesno[] = { "no", "yes", 0 };
|
||||
static const char * const yesno[] = { "no", "yes", 0 };
|
||||
char *prompt;
|
||||
|
||||
count = 0;
|
||||
|
||||
+2
-2
@@ -1932,9 +1932,9 @@ cmdWriteallFunc(
|
||||
{
|
||||
char *prompt, *argv;
|
||||
int i, action, cidx = 0;
|
||||
static char *actionNames[] =
|
||||
static const char * const actionNames[] =
|
||||
{ "write", "flush", "skip", "abort", "autowrite", 0 };
|
||||
static char *explain[] =
|
||||
static const char * const explain[] =
|
||||
{ "", "(bboxes)", "(timestamps)", "(bboxes/timestamps)", 0 };
|
||||
|
||||
if (def->cd_flags & CDINTERNAL) return 0;
|
||||
|
||||
Reference in New Issue
Block a user