summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2022-09-11 12:35:40 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2022-09-17 08:33:11 -0700
commit0d1e202f83774543aeb6e66a9dc46160e2bfff5d (patch)
tree8df4b483c51b01f3395d0b323282d1442edae924
parentca9c5d01c44fe3a67389f3e6e0bcc34bac09c1c0 (diff)
Inline *Move & *Goto functions
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--DviP.h29
-rw-r--r--draw.c24
2 files changed, 25 insertions, 28 deletions
diff --git a/DviP.h b/DviP.h
index f1aae33..f85abbe 100644
--- a/DviP.h
+++ b/DviP.h
@@ -243,11 +243,32 @@ typedef struct _DviRec {
DviPart dvi;
} DviRec;
+/* previously in draw.c */
+static inline void
+HorizontalMove(DviWidget dw, int delta)
+{
+ dw->dvi.state->x += delta;
+}
+
+static inline void
+HorizontalGoto(DviWidget dw, int NewPosition)
+{
+ dw->dvi.state->x = NewPosition;
+}
+
+static inline void
+VerticalMove(DviWidget dw, int delta)
+{
+ dw->dvi.state->y += delta;
+}
+
+static inline void
+VerticalGoto(DviWidget dw, int NewPosition)
+{
+ dw->dvi.state->y = NewPosition;
+}
+
/* draw.c */
-extern void HorizontalMove(DviWidget, int);
-extern void HorizontalGoto(DviWidget, int);
-extern void VerticalMove(DviWidget, int);
-extern void VerticalGoto(DviWidget, int);
extern void FlushCharCache(DviWidget);
extern void SetGCForDraw(DviWidget);
extern void DrawLine(DviWidget, int, int);
diff --git a/draw.c b/draw.c
index cf43985..d8fb093 100644
--- a/draw.c
+++ b/draw.c
@@ -78,30 +78,6 @@ static void InsertPoint(Point *p, Point *q);
static void LineApprox(Point *p1, Point *p2, Point *p3);
static Point * MakePoint(double x, double y);
-void
-HorizontalMove(DviWidget dw, int delta)
-{
- dw->dvi.state->x += delta;
-}
-
-void
-HorizontalGoto(DviWidget dw, int NewPosition)
-{
- dw->dvi.state->x = NewPosition;
-}
-
-void
-VerticalMove(DviWidget dw, int delta)
-{
- dw->dvi.state->y += delta;
-}
-
-void
-VerticalGoto(DviWidget dw, int NewPosition)
-{
- dw->dvi.state->y = NewPosition;
-}
-
#ifdef USE_XFT
static void
DrawText (DviWidget dw)