[comp.windows.x] X.V11R2/clients/xedit/ps.c PSgetLastPos

bob@ALLOSAUR.CIS.OHIO-STATE.EDU (Bob Sutterfield) (08/27/88)

In X.V11R2/clients/xedit/ps.c, the function PSgetLastPos() is
implicitly defined by its use in PSscan(); then when it is explicitly
defined later the types conflict.  The fix is to simply move the
explicit definition to before the definition of PSscan().  Context
diffs follow.

GCC complained about it, and GCC's -Wimplicit switch found it.

*** /ai0/Sun-X.V11R2/clients/xedit/ps.c~	Thu Feb 25 23:51:07 1988
--- /ai0/Sun-X.V11R2/clients/xedit/ps.c	Fri Aug 26 14:38:28 1988
***************
*** 257,262 ****
--- 257,270 ----
  	    position++;\
      }\
  }
+ static XtTextPosition PSgetLastPos(src)
+   XtTextSource src;
+ {
+   PSContext *ctx = (PSContext *)src->data;
+     return ctx->endPos;
+ }
+ 
+  
  static XtTextPosition PSscan (src, pos, sType, dir, count, include)
    XtTextSource src;
    XtTextPosition pos;
***************
*** 619,632 ****
      ctx->endPos = lastPos;
  }
  
- static XtTextPosition PSgetLastPos(src)
-   XtTextSource src;
- {
-   PSContext *ctx = (PSContext *)src->data;
-     return ctx->endPos;
- }
- 
-  
  static InitPieceTable(ctx)
    PSContext *ctx;
  {
--- 627,632 ----
								--Bob