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:
parent
5c410e9dcb
commit
0376430702
|
|
@ -201,7 +201,7 @@ cmdEditRedisplayFunc(
|
||||||
MagWindow *w, /* Window containing edit cell. */
|
MagWindow *w, /* Window containing edit cell. */
|
||||||
Rect *area) /* Area to be redisplayed. */
|
Rect *area) /* Area to be redisplayed. */
|
||||||
{
|
{
|
||||||
static Rect origin = {{-1, -1}, {1, 1}};
|
static const Rect origin = {-1, -1, 1, 1};
|
||||||
Rect tmp;
|
Rect tmp;
|
||||||
DBWclientRec *crec = (DBWclientRec *) w->w_clientData;
|
DBWclientRec *crec = (DBWclientRec *) w->w_clientData;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -942,7 +942,7 @@ CmdFlush(
|
||||||
{
|
{
|
||||||
CellDef *def;
|
CellDef *def;
|
||||||
int action;
|
int action;
|
||||||
static char *actionNames[] = { "no", "yes", 0 };
|
static const char * const actionNames[] = { "no", "yes", 0 };
|
||||||
char *prompt;
|
char *prompt;
|
||||||
bool dereference = FALSE;
|
bool dereference = FALSE;
|
||||||
char *strNoConfirm;
|
char *strNoConfirm;
|
||||||
|
|
|
||||||
|
|
@ -1566,7 +1566,7 @@ CmdPort(
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static int cmdClassToBitmask[] =
|
static const int cmdClassToBitmask[] =
|
||||||
{
|
{
|
||||||
PORT_CLASS_DEFAULT,
|
PORT_CLASS_DEFAULT,
|
||||||
PORT_CLASS_INPUT,
|
PORT_CLASS_INPUT,
|
||||||
|
|
@ -1590,7 +1590,7 @@ CmdPort(
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static int cmdUseToBitmask[] =
|
static const int cmdUseToBitmask[] =
|
||||||
{
|
{
|
||||||
PORT_USE_DEFAULT,
|
PORT_USE_DEFAULT,
|
||||||
PORT_USE_ANALOG,
|
PORT_USE_ANALOG,
|
||||||
|
|
@ -1611,7 +1611,7 @@ CmdPort(
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static int cmdShapeToBitmask[] =
|
static const int cmdShapeToBitmask[] =
|
||||||
{
|
{
|
||||||
PORT_SHAPE_DEFAULT,
|
PORT_SHAPE_DEFAULT,
|
||||||
PORT_SHAPE_ABUT,
|
PORT_SHAPE_ABUT,
|
||||||
|
|
|
||||||
|
|
@ -720,7 +720,7 @@ cmdCheckNewName(
|
||||||
bool tryRename,
|
bool tryRename,
|
||||||
bool noninteractive)
|
bool noninteractive)
|
||||||
{
|
{
|
||||||
static char *yesno[] = { "no", "yes", 0 };
|
static const char * const yesno[] = { "no", "yes", 0 };
|
||||||
char *filename;
|
char *filename;
|
||||||
char *prompt;
|
char *prompt;
|
||||||
char *returnname;
|
char *returnname;
|
||||||
|
|
@ -1076,7 +1076,7 @@ CmdWarnWrite(void)
|
||||||
{
|
{
|
||||||
int count, code;
|
int count, code;
|
||||||
int cmdWarnWriteFunc(CellDef *cellDef, int *pcount);
|
int cmdWarnWriteFunc(CellDef *cellDef, int *pcount);
|
||||||
static char *yesno[] = { "no", "yes", 0 };
|
static const char * const yesno[] = { "no", "yes", 0 };
|
||||||
char *prompt;
|
char *prompt;
|
||||||
|
|
||||||
count = 0;
|
count = 0;
|
||||||
|
|
|
||||||
|
|
@ -1932,9 +1932,9 @@ cmdWriteallFunc(
|
||||||
{
|
{
|
||||||
char *prompt, *argv;
|
char *prompt, *argv;
|
||||||
int i, action, cidx = 0;
|
int i, action, cidx = 0;
|
||||||
static char *actionNames[] =
|
static const char * const actionNames[] =
|
||||||
{ "write", "flush", "skip", "abort", "autowrite", 0 };
|
{ "write", "flush", "skip", "abort", "autowrite", 0 };
|
||||||
static char *explain[] =
|
static const char * const explain[] =
|
||||||
{ "", "(bboxes)", "(timestamps)", "(bboxes/timestamps)", 0 };
|
{ "", "(bboxes)", "(timestamps)", "(bboxes/timestamps)", 0 };
|
||||||
|
|
||||||
if (def->cd_flags & CDINTERNAL) return 0;
|
if (def->cd_flags & CDINTERNAL) return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue