summaryrefslogtreecommitdiff
path: root/geometry.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-12-11 15:18:26 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2023-01-03 11:02:11 -0800
commit6db8fd556e2562e9a0a821c0d6fd4f7cdcf6266c (patch)
tree45171678d6b1fbfe936bb2586933d3e03c93500a /geometry.c
parent299c9762b1dbe53f3297c54e5526aeae767d1a10 (diff)
Mark more pointers as const
Some suggested by cppcheck, others by manual code inspection Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'geometry.c')
-rw-r--r--geometry.c77
1 files changed, 33 insertions, 44 deletions
diff --git a/geometry.c b/geometry.c
index 241f8d9..69dfc3c 100644
--- a/geometry.c
+++ b/geometry.c
@@ -247,7 +247,7 @@ typedef struct _GeometryInfo
} GeometryInfo;
static char *
-ddText(Display * dpy, DoodadInfo * di)
+ddText(Display *dpy, const DoodadInfo *di)
{
static char buf[64];
@@ -269,7 +269,7 @@ ddText(Display * dpy, DoodadInfo * di)
/***====================================================================***/
static void
-InitPropertyInfo(PropertyInfo * pi, GeometryInfo * info)
+InitPropertyInfo(PropertyInfo *pi, const GeometryInfo *info)
{
pi->defs.defined = 0;
pi->defs.fileID = info->fileID;
@@ -301,7 +301,7 @@ FreeProperties(PropertyInfo * pi, GeometryInfo * info)
}
static void
-InitKeyInfo(KeyInfo * key, RowInfo * row, GeometryInfo * info)
+InitKeyInfo(KeyInfo *key, RowInfo *row, const GeometryInfo *info)
{
if (key != &row->dfltKey)
@@ -337,7 +337,7 @@ ClearKeyInfo(KeyInfo * key)
}
static void
-FreeKeys(KeyInfo * key, RowInfo * row, GeometryInfo * info)
+FreeKeys(KeyInfo *key, RowInfo *row, const GeometryInfo *info)
{
KeyInfo *tmp;
KeyInfo *next;
@@ -357,7 +357,7 @@ FreeKeys(KeyInfo * key, RowInfo * row, GeometryInfo * info)
}
static void
-InitRowInfo(RowInfo * row, SectionInfo * section, GeometryInfo * info)
+InitRowInfo(RowInfo *row, SectionInfo *section, const GeometryInfo *info)
{
if (row != &section->dfltRow)
{
@@ -380,7 +380,7 @@ InitRowInfo(RowInfo * row, SectionInfo * section, GeometryInfo * info)
}
static void
-ClearRowInfo(RowInfo * row, GeometryInfo * info)
+ClearRowInfo(RowInfo *row, const GeometryInfo *info)
{
row->defs.defined &= ~_GR_Default;
row->top = row->left = 0;
@@ -394,7 +394,7 @@ ClearRowInfo(RowInfo * row, GeometryInfo * info)
}
static void
-FreeRows(RowInfo * row, SectionInfo * section, GeometryInfo * info)
+FreeRows(RowInfo *row, SectionInfo *section, const GeometryInfo *info)
{
RowInfo *next;
@@ -557,7 +557,8 @@ InitSectionInfo(SectionInfo * si, GeometryInfo * info)
}
static void
-DupSectionInfo(SectionInfo * into, SectionInfo * from, GeometryInfo * info)
+DupSectionInfo(SectionInfo *into, const SectionInfo *from,
+ const GeometryInfo *info)
{
CommonInfo defs;
@@ -710,7 +711,7 @@ NextProperty(GeometryInfo * info)
}
static PropertyInfo *
-FindProperty(GeometryInfo * info, char *name)
+FindProperty(const GeometryInfo *info, const char *name)
{
PropertyInfo *old;
@@ -1088,7 +1089,7 @@ NextSection(GeometryInfo * info)
}
static SectionInfo *
-FindMatchingSection(GeometryInfo * info, SectionInfo * new)
+FindMatchingSection(GeometryInfo *info, const SectionInfo *new)
{
for (SectionInfo *old = info->sections; old != NULL;
old = (SectionInfo *) old->defs.next)
@@ -1399,9 +1400,8 @@ HandleIncludeGeometry(IncludeStmt * stmt, XkbDescPtr xkb, GeometryInfo * info,
}
static int
-SetShapeField(ShapeInfo * si,
- const char *field,
- ExprDef * arrayNdx, ExprDef * value, GeometryInfo * info)
+SetShapeField(ShapeInfo *si, const char *field,
+ const ExprDef *arrayNdx, const ExprDef *value, GeometryInfo *info)
{
ExprResult tmp;
@@ -1431,10 +1431,8 @@ SetShapeField(ShapeInfo * si,
}
static int
-SetShapeDoodadField(DoodadInfo * di,
- const char *field,
- ExprDef * arrayNdx,
- ExprDef * value, SectionInfo * si, GeometryInfo * info)
+SetShapeDoodadField(DoodadInfo *di, const char *field, const ExprDef *arrayNdx,
+ const ExprDef *value, SectionInfo *si, GeometryInfo *info)
{
ExprResult tmp;
const char *typeName;
@@ -1501,10 +1499,8 @@ SetShapeDoodadField(DoodadInfo * di,
#define FIELD_USHORT 2
static int
-SetTextDoodadField(DoodadInfo * di,
- const char *field,
- ExprDef * arrayNdx,
- ExprDef * value, SectionInfo * si, GeometryInfo * info)
+SetTextDoodadField(DoodadInfo *di, const char *field, const ExprDef *arrayNdx,
+ const ExprDef *value, SectionInfo *si, GeometryInfo *info)
{
ExprResult tmp;
unsigned def;
@@ -1651,11 +1647,9 @@ SetTextDoodadField(DoodadInfo * di,
}
static int
-SetIndicatorDoodadField(DoodadInfo * di,
- const char *field,
- ExprDef * arrayNdx,
- ExprDef * value,
- SectionInfo * si, GeometryInfo * info)
+SetIndicatorDoodadField(DoodadInfo * di, const char *field,
+ const ExprDef *arrayNdx, const ExprDef *value,
+ SectionInfo *si, GeometryInfo *info)
{
ExprResult tmp;
@@ -1696,10 +1690,8 @@ SetIndicatorDoodadField(DoodadInfo * di,
}
static int
-SetLogoDoodadField(DoodadInfo * di,
- const char *field,
- ExprDef * arrayNdx,
- ExprDef * value, SectionInfo * si, GeometryInfo * info)
+SetLogoDoodadField(DoodadInfo *di, const char *field, const ExprDef *arrayNdx,
+ const ExprDef *value, SectionInfo *si, GeometryInfo *info)
{
ExprResult tmp;
const char *typeName = "logo doodad";
@@ -1777,10 +1769,9 @@ SetLogoDoodadField(DoodadInfo * di,
}
static int
-SetDoodadField(DoodadInfo * di,
- const char *field,
- ExprDef * arrayNdx,
- ExprDef * value, SectionInfo * si, GeometryInfo * info)
+SetDoodadField(DoodadInfo *di, const char *field,
+ const ExprDef *arrayNdx, const ExprDef *value,
+ SectionInfo *si, GeometryInfo *info)
{
ExprResult tmp;
@@ -1880,9 +1871,9 @@ SetDoodadField(DoodadInfo * di,
}
static int
-SetSectionField(SectionInfo * si,
- const char *field,
- ExprDef * arrayNdx, ExprDef * value, GeometryInfo * info)
+SetSectionField(SectionInfo *si, const char *field,
+ const ExprDef *arrayNdx, const ExprDef *value,
+ GeometryInfo *info)
{
unsigned short *pField;
unsigned def;
@@ -1968,9 +1959,8 @@ SetSectionField(SectionInfo * si,
}
static int
-SetRowField(RowInfo * row,
- const char *field,
- ExprDef * arrayNdx, ExprDef * value, GeometryInfo * info)
+SetRowField(RowInfo *row, const char *field,
+ const ExprDef *arrayNdx, const ExprDef *value, GeometryInfo *info)
{
ExprResult tmp;
@@ -2034,9 +2024,8 @@ SetRowField(RowInfo * row,
}
static int
-SetKeyField(KeyInfo * key,
- const char *field,
- ExprDef * arrayNdx, ExprDef * value, GeometryInfo * info)
+SetKeyField(KeyInfo *key, const char *field,
+ const ExprDef *arrayNdx, const ExprDef *value, GeometryInfo *info)
{
ExprResult tmp;
@@ -2112,7 +2101,7 @@ SetKeyField(KeyInfo * key,
}
static int
-SetGeometryProperty(GeometryInfo * info, char *property, ExprDef * value)
+SetGeometryProperty(GeometryInfo *info, char *property, const ExprDef *value)
{
PropertyInfo pi;
ExprResult result;