home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / gnu / utils / bug / 2310 < prev    next >
Encoding:
Text File  |  1993-01-01  |  45.5 KB  |  1,613 lines

  1. Newsgroups: gnu.utils.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!twinsun.COM!eggert
  3. From: eggert@twinsun.COM (Paul Eggert)
  4. Subject: oleo 1.2 has many C function prototype problems
  5. Message-ID: <9301011813.AA03421@farside.twinsun.com>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Fri, 1 Jan 1993 18:13:24 GMT
  10. Approved: bug-gnu-utils@prep.ai.mit.edu
  11. Lines: 1600
  12.  
  13. oleo 1.2 has a lot of problems with ANSI C function prototypes.
  14.  
  15. * If __STDC__ is defined, oleo often uses declarations and definitions of the
  16.   following form:
  17.  
  18.     int f (CELLREF); /* declaration */
  19.     int f (x) CELLREF x; { ... } /* definition */
  20.  
  21.   But ANSI C does not allow this, since CELLREF is a short type like `unsigned
  22.   short', and the old-style definition promotes CELLREF to `int'.  Compiling
  23.   oleo with `gcc -ansi -pedantic' shows many instances of this problem; the
  24.   patch below contains several fixes but I'm not sure I caught all instances
  25.   of the problem.  This problem can cause oleo to fail on hosts that use
  26.   different calling conventions for passing shorts vs ints.
  27.  
  28. * oleo specifies incorrect function prototypes for calloc, malloc, and getenv.
  29.   This can cause compilation to fail in an ANSI C environment.
  30.  
  31. * The ANSI C way of declaring a function with no arguments is
  32.   `int f (void);'.  Unfortunately, oleo uses the style `int f ();';
  33.   this causes the C compiler to not check the types of arguments of calls to f.
  34.  
  35. * The 3rd arg of hash_insert should be VOIDSTAR, not char *.
  36.  
  37. * oleo doesn't declare function prototypes for for_all_vars, hash_insert,
  38.   index, rindex.
  39.  
  40. * oleo declares ck_fopen but never uses it.
  41.  
  42. Here is a patch.
  43.  
  44. Thu Dec 31 15:31:32 1992  Paul Eggert  (eggert@twinsun.com)
  45.  
  46.     * decompile.c (decomp): Use prototoype when defining in ANSI C, since
  47.     the argument type CELLREF will be promoted otherwise, and ANSI C does
  48.     not allow mixing old-style definitions with prototype declarations
  49.     when argument types are promoted.
  50.     * display.c (cell_display_of, pr_display_cell): Likewise.
  51.     * io-curses.c (_io_pr_cell_win, move_cursor_to): Likewise.
  52.     * io-term.c (set_cell_formula): Likewise.
  53.     * io-utils.c (cell_value_string, cell_name, col_to_str): Likewise.
  54.     * io-x11.c (xio_pr_cell_win): Likewise.
  55.     * lists.c (find_cell, find_or_make_cell): Likewise.
  56.     * ref.c (new_value, set_new_value, read_new_value, move_cell,
  57.     copy_cell, add_ref, flush_range_ref, add_ref_fm, flush_ref_fm,
  58.     push_cell): Likewise.
  59.     * regions.c (set_rng): Likewise.
  60.     * window.c (win_label_cols, io_pr_cell, io_move_cell_cursor): Likewise.
  61.  
  62.     * cell.h, font.h, global.h, io-abstract.h, io-generic.h, io-term.c,
  63.     io-term.h, io-utils.h, list.h, lists.h, oleofile.h, ref.h, regions.h,
  64.     sc.h, sylk.h, utils.h, window.h: If __STDC__, declare zero-argument
  65.     functions using `(void)', not `()'.
  66.  
  67.     * global.h (for_all_vars, hash_insert, index, rindex): Declare
  68.     argument types if __STDC__.
  69.  
  70.     * hash.c (hash_insert): 3rd arg is VOIDSTAR, not char *.
  71.  
  72.     * io-term.c: Declare prototype for getenv,
  73.     move_region, format_area, open_window, close_window, goto_window.
  74.  
  75.     * io-x11.c (getenv): Argument is const char *, not char *.
  76.  
  77.     * ref.c (for_all_vars): Use prototype for argument if __STDC__.
  78.  
  79.     * utils.h (abort, malloc, calloc): Correct prototypes to agree with
  80.     ANSI C.
  81.     * utils.h (ck_fopen): Delete unused declaration.
  82.  
  83. ===================================================================
  84. RCS file: RCS/cell.h,v
  85. retrieving revision 1.2
  86. retrieving revision 1.2.1.1
  87. diff -c -r1.2 -r1.2.1.1
  88. *** cell.h    1992/12/31 05:10:18    1.2
  89. --- cell.h    1992/12/31 15:31:32    1.2.1.1
  90. ***************
  91. *** 143,153 ****
  92.   extern CELL *find_or_make_cell (CELLREF, CELLREF);
  93.   extern void find_cells_in_range (struct rng *);
  94.   extern void make_cells_in_range (struct rng *);
  95. ! extern CELL *next_cell_in_range ();
  96.   extern CELL *next_row_col_in_range (CELLREF *, CELLREF *);
  97. ! extern void no_more_cells ();
  98.   extern char *decomp (CELLREF, CELLREF, CELL *);
  99. ! extern void decomp_free ();
  100.   #else
  101.   extern CELL *find_cell ();
  102.   extern CELL *find_or_make_cell ();
  103. --- 143,153 ----
  104.   extern CELL *find_or_make_cell (CELLREF, CELLREF);
  105.   extern void find_cells_in_range (struct rng *);
  106.   extern void make_cells_in_range (struct rng *);
  107. ! extern CELL *next_cell_in_range (void);
  108.   extern CELL *next_row_col_in_range (CELLREF *, CELLREF *);
  109. ! extern void no_more_cells (void);
  110.   extern char *decomp (CELLREF, CELLREF, CELL *);
  111. ! extern void decomp_free (void);
  112.   #else
  113.   extern CELL *find_cell ();
  114.   extern CELL *find_or_make_cell ();
  115. ===================================================================
  116. RCS file: RCS/decompile.c,v
  117. retrieving revision 1.2
  118. retrieving revision 1.2.1.1
  119. diff -c -r1.2 -r1.2.1.1
  120. *** decompile.c    1992/12/31 05:10:15    1.2
  121. --- decompile.c    1992/12/31 15:31:32    1.2.1.1
  122. ***************
  123. *** 565,575 ****
  124. --- 565,580 ----
  125.   /* Actual entry points to this file */
  126.   /* decomp(row, col, cell) returns a string that can be byte_compiled to create
  127.      cell->formula  decomp_free() frees up the allocated string */
  128. + #if __STDC__
  129.   char *
  130. + decomp (CELLREF r, CELLREF c, CELL *cell)
  131. + #else
  132. + char *
  133.   decomp (r, c, cell)
  134.        CELLREF r;
  135.        CELLREF c;
  136.        CELL *cell;
  137. + #endif
  138.   {
  139.     struct pr_node *ret;
  140.     char *str;
  141. ===================================================================
  142. RCS file: RCS/display.c,v
  143. retrieving revision 1.2
  144. retrieving revision 1.2.1.1
  145. diff -c -r1.2 -r1.2.1.1
  146. *** display.c    1992/12/28 05:04:08    1.2
  147. --- display.c    1992/12/31 15:31:32    1.2.1.1
  148. ***************
  149. *** 21,31 ****
  150. --- 21,36 ----
  151.   #include "cell.h"
  152.   #include "io-utils.h"
  153.   
  154. + #if __STDC__
  155.   struct cell_display *
  156. + cell_display_of (struct display *disp, CELLREF r, CELLREF c)
  157. + #else
  158. + struct cell_display *
  159.   cell_display_of (disp, r, c)
  160.        struct display *disp;
  161.        CELLREF r;
  162.        CELLREF c;
  163. + #endif
  164.   {
  165.     int cols = disp->range.hc - disp->range.lc + 1;
  166.     r -= disp->range.lr;
  167. ***************
  168. *** 69,80 ****
  169. --- 74,90 ----
  170.       }
  171.   }
  172.   
  173. + #if __STDC__
  174. + int
  175. + pr_display_cell (struct display *disp, CELLREF r, CELLREF c, CELL *cp)
  176. + #else
  177.   int
  178.   pr_display_cell (disp, r, c, cp)
  179.        struct display *disp;
  180.        CELLREF r;
  181.        CELLREF c;
  182.        CELL *cp;
  183. + #endif
  184.   {
  185.     int cols = disp->range.hc - disp->range.lc + 1;
  186.     struct cell_display *cd =
  187. ===================================================================
  188. RCS file: RCS/font.h,v
  189. retrieving revision 1.2
  190. retrieving revision 1.2.1.1
  191. diff -c -r1.2 -r1.2.1.1
  192. *** font.h    1992/12/28 05:00:39    1.2
  193. --- font.h    1992/12/31 15:31:32    1.2.1.1
  194. ***************
  195. *** 47,58 ****
  196.    */
  197.   
  198.   #ifdef __STDC__
  199. ! extern void init_fonts ();
  200. ! extern void flush_fonts ();
  201.   extern struct font_memo *intern_font (char *spec);
  202.   extern void define_font (char * spec);
  203.   extern void set_area_font (struct rng *, struct font_memo *);
  204. ! extern struct font_memo *default_font ();
  205.   extern void set_ps_font_cmd (char *);
  206.   extern void set_line_to_nice_font_name (struct line *, struct font_memo *);
  207.   #else
  208. --- 47,58 ----
  209.    */
  210.   
  211.   #ifdef __STDC__
  212. ! extern void init_fonts (void);
  213. ! extern void flush_fonts (void);
  214.   extern struct font_memo *intern_font (char *spec);
  215.   extern void define_font (char * spec);
  216.   extern void set_area_font (struct rng *, struct font_memo *);
  217. ! extern struct font_memo *default_font (void);
  218.   extern void set_ps_font_cmd (char *);
  219.   extern void set_line_to_nice_font_name (struct line *, struct font_memo *);
  220.   #else
  221. ===================================================================
  222. RCS file: RCS/global.h,v
  223. retrieving revision 1.2
  224. retrieving revision 1.2.1.1
  225. diff -c -r1.2 -r1.2.1.1
  226. *** global.h    1992/12/28 05:00:40    1.2
  227. --- global.h    1992/12/31 15:31:32    1.2.1.1
  228. ***************
  229. *** 137,144 ****
  230.   
  231.   #ifdef __STDC__
  232.   
  233. ! extern const char *index ();
  234. ! extern const char *rindex ();
  235.   extern char *strdup (const char *);
  236.   extern const char *strstr (const char *, const char *);
  237.   extern double astof (char **);
  238. --- 137,144 ----
  239.   
  240.   #ifdef __STDC__
  241.   
  242. ! extern const char *index (char *, int);
  243. ! extern const char *rindex (char *, int);
  244.   extern char *strdup (const char *);
  245.   extern const char *strstr (const char *, const char *);
  246.   extern double astof (char **);
  247. ***************
  248. *** 157,163 ****
  249.   extern void add_timer_ref (int);
  250.   extern void add_ref_to (int);
  251.   
  252. ! extern char *hash_insert ();
  253.   
  254.   extern char *jst_to_str (int);
  255.   extern char *fmt_to_str (int);
  256. --- 157,164 ----
  257.   extern void add_timer_ref (int);
  258.   extern void add_ref_to (int);
  259.   
  260. ! struct hash_control; /* in case it hasn't been declared yet */
  261. ! extern char *hash_insert (struct hash_control *, char *, VOIDSTAR);
  262.   
  263.   extern char *jst_to_str (int);
  264.   extern char *fmt_to_str (int);
  265. ***************
  266. *** 168,174 ****
  267.   
  268.   extern char *flt_to_str (double);
  269.   extern void push_refs (struct ref_fm *);
  270. ! extern void no_more_cells ();
  271.   
  272.   extern char *range_name (struct rng *);
  273.   extern char *cell_name (CELLREF, CELLREF);
  274. --- 169,175 ----
  275.   
  276.   extern char *flt_to_str (double);
  277.   extern void push_refs (struct ref_fm *);
  278. ! extern void no_more_cells (void);
  279.   
  280.   extern char *range_name (struct rng *);
  281.   extern char *cell_name (CELLREF, CELLREF);
  282. ***************
  283. *** 177,183 ****
  284.   
  285.   extern unsigned char parse_cell_or_range (char **, struct rng *);
  286.   
  287. ! extern void for_all_vars (void (*)());
  288.   #else
  289.   
  290.   extern char *index ();
  291. --- 178,185 ----
  292.   
  293.   extern unsigned char parse_cell_or_range (char **, struct rng *);
  294.   
  295. ! struct var; /* in case it hasn't been declared yet */
  296. ! extern void for_all_vars (void (*)(char *, struct var *));
  297.   #else
  298.   
  299.   extern char *index ();
  300. ===================================================================
  301. RCS file: RCS/hash.c,v
  302. retrieving revision 1.2
  303. retrieving revision 1.2.1.1
  304. diff -c -r1.2 -r1.2.1.1
  305. *** hash.c    1992/12/31 05:09:59    1.2
  306. --- hash.c    1992/12/31 15:31:32    1.2.1.1
  307. ***************
  308. *** 408,414 ****
  309.   hash_insert (handle, string, value)
  310.        register struct hash_control *handle;
  311.        register char *string;
  312. !      register char *value;
  313.   {
  314.     register struct hash_entry *entry;
  315.     register char *retval;
  316. --- 408,414 ----
  317.   hash_insert (handle, string, value)
  318.        register struct hash_control *handle;
  319.        register char *string;
  320. !      register VOIDSTAR value;
  321.   {
  322.     register struct hash_entry *entry;
  323.     register char *retval;
  324. ===================================================================
  325. RCS file: RCS/io-abstract.h,v
  326. retrieving revision 1.2
  327. retrieving revision 1.2.1.1
  328. diff -c -r1.2 -r1.2.1.1
  329. *** io-abstract.h    1992/12/28 05:13:11    1.2
  330. --- io-abstract.h    1992/12/31 15:31:32    1.2.1.1
  331. ***************
  332. *** 36,87 ****
  333.   #endif
  334.   
  335.   #ifdef __STDC__
  336. ! EXTERN void (*io_open_display) ();
  337. ! EXTERN void (*io_redisp) ();    /* Refresh the existing image. */
  338. ! EXTERN void (*io_repaint) ();    /* $$$ Recompute the image. */
  339.   EXTERN void (*io_repaint_win) (struct window *);
  340. ! EXTERN void (*io_close_display) ();
  341.   
  342.   /*
  343.    * Low level input.
  344.    */
  345. ! EXTERN int (*io_input_avail) ();/* How many chars can be read? */
  346.   EXTERN void (*io_scan_for_input) (int ok_to_block);
  347. ! EXTERN void (*io_wait_for_input) ();
  348.   EXTERN int (*io_read_kbd) (VOLATILE char *buf, int size);
  349.   
  350.   /* A curses compatible interface.  These have no effect on low level
  351.      calls except to consume characters which io_read_kbd might
  352.      otherwise return. */
  353.   EXTERN void (*io_nodelay) (int);
  354. ! EXTERN int (*io_getch) ();
  355.   
  356.   /* High level i/o. */
  357.   
  358.   /* Input and status areas: */
  359. ! EXTERN void (*io_clear_input_before) ();
  360. ! EXTERN void (*io_clear_input_after) ();
  361. ! EXTERN void (*io_update_status) ();
  362.   EXTERN void (*io_info_msg) (char *,...);
  363.   EXTERN void (*io_error_msg) (char *,...);
  364.   EXTERN int (*io_get_chr) (char *prompt);
  365.   EXTERN int (*io_get_line) (char *prompt, struct line * line);
  366.   
  367.   /* Multi-line txt messages. */
  368. ! EXTERN void (*io_text_start) ();
  369.   EXTERN void (*io_text_line) (char *,...);
  370. ! EXTERN void (*io_text_finish) ();
  371.   
  372.   /* Cell values */
  373. ! EXTERN void (*io_hide_cell_cursor) ();
  374. ! EXTERN void (*io_display_cell_cursor) ();
  375.   EXTERN void (*io_pr_cell_win) (struct window *,
  376.                      CELLREF, CELLREF,
  377.                      CELL *);
  378.   
  379.   /* The terminal's cursor may be in the current cell or the input area. */
  380. ! EXTERN void (*io_cellize_cursor) ();
  381. ! EXTERN void (*io_inputize_cursor) ();
  382.   #else
  383.   EXTERN void (*io_open_display) ();
  384.   EXTERN void (*io_redisp) ();    /* Refresh the existing image. */
  385. --- 36,87 ----
  386.   #endif
  387.   
  388.   #ifdef __STDC__
  389. ! EXTERN void (*io_open_display) (void);
  390. ! EXTERN void (*io_redisp) (void);    /* Refresh the existing image. */
  391. ! EXTERN void (*io_repaint) (void);    /* $$$ Recompute the image. */
  392.   EXTERN void (*io_repaint_win) (struct window *);
  393. ! EXTERN void (*io_close_display) (void);
  394.   
  395.   /*
  396.    * Low level input.
  397.    */
  398. ! EXTERN int (*io_input_avail) (void);/* How many chars can be read? */
  399.   EXTERN void (*io_scan_for_input) (int ok_to_block);
  400. ! EXTERN void (*io_wait_for_input) (void);
  401.   EXTERN int (*io_read_kbd) (VOLATILE char *buf, int size);
  402.   
  403.   /* A curses compatible interface.  These have no effect on low level
  404.      calls except to consume characters which io_read_kbd might
  405.      otherwise return. */
  406.   EXTERN void (*io_nodelay) (int);
  407. ! EXTERN int (*io_getch) (void);
  408.   
  409.   /* High level i/o. */
  410.   
  411.   /* Input and status areas: */
  412. ! EXTERN void (*io_clear_input_before) (void);
  413. ! EXTERN void (*io_clear_input_after) (void);
  414. ! EXTERN void (*io_update_status) (void);
  415.   EXTERN void (*io_info_msg) (char *,...);
  416.   EXTERN void (*io_error_msg) (char *,...);
  417.   EXTERN int (*io_get_chr) (char *prompt);
  418.   EXTERN int (*io_get_line) (char *prompt, struct line * line);
  419.   
  420.   /* Multi-line txt messages. */
  421. ! EXTERN void (*io_text_start) (void);
  422.   EXTERN void (*io_text_line) (char *,...);
  423. ! EXTERN void (*io_text_finish) (void);
  424.   
  425.   /* Cell values */
  426. ! EXTERN void (*io_hide_cell_cursor) (void);
  427. ! EXTERN void (*io_display_cell_cursor) (void);
  428.   EXTERN void (*io_pr_cell_win) (struct window *,
  429.                      CELLREF, CELLREF,
  430.                      CELL *);
  431.   
  432.   /* The terminal's cursor may be in the current cell or the input area. */
  433. ! EXTERN void (*io_cellize_cursor) (void);
  434. ! EXTERN void (*io_inputize_cursor) (void);
  435.   #else
  436.   EXTERN void (*io_open_display) ();
  437.   EXTERN void (*io_redisp) ();    /* Refresh the existing image. */
  438. ===================================================================
  439. RCS file: RCS/io-curses.c,v
  440. retrieving revision 1.2
  441. retrieving revision 1.2.1.1
  442. diff -c -r1.2 -r1.2.1.1
  443. *** io-curses.c    1992/12/28 05:04:08    1.2
  444. --- io-curses.c    1992/12/31 15:31:32    1.2.1.1
  445. ***************
  446. *** 1044,1055 ****
  447. --- 1044,1059 ----
  448.   #undef MORE
  449.       }
  450.   
  451. + #if __STDC__
  452. +   static void move_cursor_to (struct window *win, CELLREF r, CELLREF c, int dn)
  453. + #else
  454.     static void
  455.       move_cursor_to (win, r, c, dn)
  456.     struct window *win;
  457.     CELLREF r;
  458.     CELLREF c;
  459.     int dn;
  460. + #endif
  461.     {
  462.       int cc;
  463.       int cell_cursor_col;
  464. ***************
  465. *** 1320,1330 ****
  466. --- 1324,1338 ----
  467.     }
  468.   
  469.   
  470. + #if __STDC__
  471. +   static void _io_pr_cell_win (struct window *win, CELLREF r, CELLREF c, CELL *cp)
  472. + #else
  473.     static void _io_pr_cell_win (win, r, c, cp)
  474.     struct window *win;
  475.     CELLREF r;
  476.     CELLREF c;
  477.     CELL *cp;
  478. + #endif
  479.     {
  480.       int glowing;
  481.       int lenstr;
  482. ===================================================================
  483. RCS file: RCS/io-generic.h,v
  484. retrieving revision 1.2
  485. retrieving revision 1.2.1.1
  486. diff -c -r1.2 -r1.2.1.1
  487. *** io-generic.h    1992/12/28 05:13:10    1.2
  488. --- io-generic.h    1992/12/31 15:31:32    1.2.1.1
  489. ***************
  490. *** 43,56 ****
  491.   extern void (*read_file) (FILE *, int);
  492.   extern void (*write_file) (FILE *, struct rng *);
  493.   extern int (*set_file_opts) (int, char *);
  494. ! extern void (*show_file_opts) ();
  495.   
  496. ! extern int get_chr ();        /* read from kbd or macro */
  497.   extern void open_window (char *);    /* For syntax, see HOW-TO-USE */
  498.   extern void close_window (char *);
  499.   extern void goto_window (char *);
  500.   extern int set_window_option (int set_opt, char *text);
  501. ! extern void show_window_options ();
  502.   #else
  503.   extern void (*read_file) ();
  504.   extern void (*write_file) ();
  505. --- 43,56 ----
  506.   extern void (*read_file) (FILE *, int);
  507.   extern void (*write_file) (FILE *, struct rng *);
  508.   extern int (*set_file_opts) (int, char *);
  509. ! extern void (*show_file_opts) (void);
  510.   
  511. ! extern int get_chr (void);        /* read from kbd or macro */
  512.   extern void open_window (char *);    /* For syntax, see HOW-TO-USE */
  513.   extern void close_window (char *);
  514.   extern void goto_window (char *);
  515.   extern int set_window_option (int set_opt, char *text);
  516. ! extern void show_window_options (void);
  517.   #else
  518.   extern void (*read_file) ();
  519.   extern void (*write_file) ();
  520. ===================================================================
  521. RCS file: RCS/io-term.c,v
  522. retrieving revision 1.2
  523. retrieving revision 1.2.1.1
  524. diff -c -r1.2 -r1.2.1.1
  525. *** io-term.c    1992/12/31 05:09:55    1.2
  526. --- io-term.c    1992/12/31 15:31:32    1.2.1.1
  527. ***************
  528. *** 76,82 ****
  529.   
  530.   
  531.   #ifdef __STDC__
  532. ! extern char *getenv ();
  533.   extern unsigned ualarm (unsigned int, unsigned int);
  534.   #else
  535.   extern char *getenv ();
  536. --- 76,82 ----
  537.   
  538.   
  539.   #ifdef __STDC__
  540. ! extern char *getenv (const char *);
  541.   extern unsigned ualarm (unsigned int, unsigned int);
  542.   #else
  543.   extern char *getenv ();
  544. ***************
  545. *** 110,116 ****
  546.   /* Routines for implementing user commands */
  547.   int global_cmd (int);
  548.   void set_options (char *);
  549. ! void play_cell ();
  550.   
  551.   /* Backends for other functions */
  552.   static int do_set_option (char *);
  553. --- 110,116 ----
  554.   /* Routines for implementing user commands */
  555.   int global_cmd (int);
  556.   void set_options (char *);
  557. ! void play_cell (void);
  558.   
  559.   /* Backends for other functions */
  560.   static int do_set_option (char *);
  561. ***************
  562. *** 121,127 ****
  563.   
  564.   int main (int, char **);
  565.   void map_chr (int);
  566. ! extern void clear_spreadsheet ();
  567.   char *cell_name (CELLREF, CELLREF);
  568.   char *range_name (struct rng *);
  569.   char *fmt_to_str (int);
  570. --- 121,127 ----
  571.   
  572.   int main (int, char **);
  573.   void map_chr (int);
  574. ! extern void clear_spreadsheet (void);
  575.   char *cell_name (CELLREF, CELLREF);
  576.   char *range_name (struct rng *);
  577.   char *fmt_to_str (int);
  578. ***************
  579. *** 129,196 ****
  580.   char *col_to_str (CELLREF);
  581.   static void got_sigint (int);
  582.   /* The user commands that are defined in this file. . . */
  583. ! extern void copy_region ();
  584. ! extern void copy_values_region ();
  585. ! extern void set_format ();
  586. ! extern void move_region ();
  587. ! extern void delete_region ();
  588. ! extern void insert_row ();
  589. ! extern void insert_col ();
  590. ! extern void delete_row ();
  591. ! extern void delete_col ();
  592. ! extern void format_area ();
  593. ! extern void open_window ();
  594. ! extern void close_window ();
  595. ! extern void hsplit_window ();
  596. ! extern void vsplit_window ();
  597. ! extern void delete_window ();
  598. ! extern void delete_other_windows ();
  599. ! extern void goto_window ();
  600. ! extern void other_window ();
  601.   extern void print_region (struct rng *, char *);
  602.   extern void psprint_region_cmd (FILE *, struct rng *);
  603.   
  604.   static void do_debug (char *);
  605. ! static void end_macro ();
  606. ! static void do_break_cmd ();
  607. ! static void set_default ();
  608. ! static void quit_cmd ();
  609.   static void set_usr_fmt (char *);
  610.   static void set_var (char *);
  611.   static void show_var (char *);
  612. ! static void show_all_var ();
  613.   static void write_variables (FILE *);
  614.   static void read_variables (FILE *);
  615. ! static void recalc_cmd ();
  616.   static void bind_key_cmd (char *);
  617. ! static void desc_key_cmd ();
  618.   static void where_is_cmd (char *);
  619.   static void read_cmds_cmd (FILE *);
  620.   static void write_keys_cmd (FILE *);
  621.   static void write_cmd (FILE *);
  622.   static void read_cmd (FILE *);
  623.   static void read_merge_cmd (FILE *);
  624. ! static void kill_all_cmd ();
  625.   static void sort_region_cmd (char *);
  626.   static void write_reg_cmd (FILE *, struct rng *);
  627. ! static void start_macro ();
  628.   void execute_cmd (char *);
  629. ! static void interact_macro_cmd ();
  630.   static void goto_region (struct rng *);
  631. ! static void upper_left ();
  632. ! static void lower_left ();
  633. ! static void upper_right ();
  634. ! static void lower_right ();
  635. ! extern void exchange_point_and_mark ();
  636. ! static void mark_cell_cmd ();
  637. ! static void unmark_cmd ();
  638.   static void do_input_cmd (int, int);
  639.   static void set_region_formula (char *, struct rng *);
  640.   static void set_cell_formula (char *, CELLREF, CELLREF);
  641. ! static void format_cell_cmd ();
  642. ! static void kill_cell_cmd ();
  643.   static void digit_cmd (int);
  644. ! static void show_options ();
  645.   static void bound_macro (int);
  646.   static void make_keymap (char *);
  647.   static void set_cell_font_cmd (char *);
  648. --- 129,196 ----
  649.   char *col_to_str (CELLREF);
  650.   static void got_sigint (int);
  651.   /* The user commands that are defined in this file. . . */
  652. ! extern void copy_region (void);
  653. ! extern void copy_values_region (void);
  654. ! extern void set_format (void);
  655. ! extern void move_region (struct rng *, struct rng *);
  656. ! extern void delete_region (void);
  657. ! extern void insert_row (void);
  658. ! extern void insert_col (void);
  659. ! extern void delete_row (void);
  660. ! extern void delete_col (void);
  661. ! extern void format_area (struct rng *);
  662. ! extern void open_window (char *);
  663. ! extern void close_window (char *);
  664. ! extern void hsplit_window (void);
  665. ! extern void vsplit_window (void);
  666. ! extern void delete_window (void);
  667. ! extern void delete_other_windows (void);
  668. ! extern void goto_window (char *);
  669. ! extern void other_window (void);
  670.   extern void print_region (struct rng *, char *);
  671.   extern void psprint_region_cmd (FILE *, struct rng *);
  672.   
  673.   static void do_debug (char *);
  674. ! static void end_macro (void);
  675. ! static void do_break_cmd (void);
  676. ! static void set_default (void);
  677. ! static void quit_cmd (void);
  678.   static void set_usr_fmt (char *);
  679.   static void set_var (char *);
  680.   static void show_var (char *);
  681. ! static void show_all_var (void);
  682.   static void write_variables (FILE *);
  683.   static void read_variables (FILE *);
  684. ! static void recalc_cmd (void);
  685.   static void bind_key_cmd (char *);
  686. ! static void desc_key_cmd (void);
  687.   static void where_is_cmd (char *);
  688.   static void read_cmds_cmd (FILE *);
  689.   static void write_keys_cmd (FILE *);
  690.   static void write_cmd (FILE *);
  691.   static void read_cmd (FILE *);
  692.   static void read_merge_cmd (FILE *);
  693. ! static void kill_all_cmd (void);
  694.   static void sort_region_cmd (char *);
  695.   static void write_reg_cmd (FILE *, struct rng *);
  696. ! static void start_macro (void);
  697.   void execute_cmd (char *);
  698. ! static void interact_macro_cmd (void);
  699.   static void goto_region (struct rng *);
  700. ! static void upper_left (void);
  701. ! static void lower_left (void);
  702. ! static void upper_right (void);
  703. ! static void lower_right (void);
  704. ! extern void exchange_point_and_mark (void);
  705. ! static void mark_cell_cmd (void);
  706. ! static void unmark_cmd (void);
  707.   static void do_input_cmd (int, int);
  708.   static void set_region_formula (char *, struct rng *);
  709.   static void set_cell_formula (char *, CELLREF, CELLREF);
  710. ! static void format_cell_cmd (void);
  711. ! static void kill_cell_cmd (void);
  712.   static void digit_cmd (int);
  713. ! static void show_options (void);
  714.   static void bound_macro (int);
  715.   static void make_keymap (char *);
  716.   static void set_cell_font_cmd (char *);
  717. ***************
  718. *** 198,210 ****
  719.   static void scan_cell_cursor (int);
  720.   static void shift_cell_cursor (int);
  721.   static void scroll_cell_cursor (int);
  722. ! static void recenter_cur_win ();
  723. ! static void repaint ();
  724. ! static void mouse_goto_cmd ();
  725. ! static void mouse_mark_cmd ();
  726. ! static void mouse_mark_and_goto_cmd ();
  727.   static void set_page_size_cmd (char *);
  728. ! void toggle_load_hooks ();
  729.   void read_file_and_run_hooks (FILE *, int);
  730.   
  731.   #ifdef HAVE_X11_X_H
  732. --- 198,210 ----
  733.   static void scan_cell_cursor (int);
  734.   static void shift_cell_cursor (int);
  735.   static void scroll_cell_cursor (int);
  736. ! static void recenter_cur_win (void);
  737. ! static void repaint (void);
  738. ! static void mouse_goto_cmd (void);
  739. ! static void mouse_mark_cmd (void);
  740. ! static void mouse_mark_and_goto_cmd (void);
  741.   static void set_page_size_cmd (char *);
  742. ! void toggle_load_hooks (void);
  743.   void read_file_and_run_hooks (FILE *, int);
  744.   
  745.   #ifdef HAVE_X11_X_H
  746. ***************
  747. *** 4283,4292 ****
  748. --- 4283,4297 ----
  749.         }
  750.   }
  751.   
  752. + #if __STDC__
  753.   static void
  754. + set_cell_formula (char * str, CELLREF row, CELLREF col)
  755. + #else
  756. + static void
  757.   set_cell_formula (str, row, col)
  758.        char * str;
  759.        CELLREF row, col;
  760. + #endif
  761.   {
  762.     char * error = new_value (row, col, str);
  763.     if (error)
  764. ===================================================================
  765. RCS file: RCS/io-term.h,v
  766. retrieving revision 1.2
  767. retrieving revision 1.2.1.1
  768. diff -c -r1.2 -r1.2.1.1
  769. *** io-term.h    1992/11/28 03:28:59    1.2
  770. --- io-term.h    1992/12/31 15:31:32    1.2.1.1
  771. ***************
  772. *** 28,34 ****
  773.   
  774.   #ifdef __STDC__
  775.   extern int global_cmd (int);
  776. ! extern int real_get_chr ();
  777.   extern void read_mp_usr_fmt (char *);
  778.   extern void read_mp_options (char *);
  779.   extern void write_mp_options (FILE *);
  780. --- 28,34 ----
  781.   
  782.   #ifdef __STDC__
  783.   extern int global_cmd (int);
  784. ! extern int real_get_chr (void);
  785.   extern void read_mp_usr_fmt (char *);
  786.   extern void read_mp_options (char *);
  787.   extern void write_mp_options (FILE *);
  788. ===================================================================
  789. RCS file: RCS/io-utils.c,v
  790. retrieving revision 1.2.1.1
  791. retrieving revision 1.2.1.2
  792. diff -c -r1.2.1.1 -r1.2.1.2
  793. *** io-utils.c    1992/12/31 13:16:32    1.2.1.1
  794. --- io-utils.c    1992/12/31 15:31:32    1.2.1.2
  795. ***************
  796. *** 364,373 ****
  797. --- 364,378 ----
  798.   /* Return the value of ROW,COL in a human-readable fashion
  799.      In paticular, strings have "" around them, and are \\ed
  800.    */
  801. + #if __STDC__
  802.   char *
  803. + cell_value_string (CELLREF row, CELLREF col)
  804. + #else
  805. + char *
  806.   cell_value_string (row, col)
  807.        CELLREF row;
  808.        CELLREF col;
  809. + #endif
  810.   {
  811.     CELL *cp;
  812.   
  813. ***************
  814. *** 907,916 ****
  815. --- 912,926 ----
  816.   
  817.   /* Functions for printing out the names of cells and ranges */
  818.   
  819. + #if __STDC__
  820. + char *
  821. + cell_name (CELLREF rr, CELLREF cc)
  822. + #else
  823.   char *
  824.   cell_name (rr, cc)
  825.        CELLREF rr;
  826.        CELLREF cc;
  827. + #endif
  828.   {
  829.     static char strs[2][20];
  830.     static num = 0;
  831. ***************
  832. *** 1000,1008 ****
  833. --- 1010,1023 ----
  834.   }
  835.   
  836.   
  837. + #if __STDC__
  838. + char *
  839. + col_to_str (CELLREF col)
  840. + #else
  841.   char *
  842.   col_to_str (col)
  843.        CELLREF col;
  844. + #endif
  845.   {
  846.     static char strs[2][10];
  847.     static num;
  848. ===================================================================
  849. RCS file: RCS/io-utils.h,v
  850. retrieving revision 1.2
  851. retrieving revision 1.2.1.1
  852. diff -c -r1.2 -r1.2.1.1
  853. *** io-utils.h    1992/11/28 03:28:59    1.2
  854. --- io-utils.h    1992/12/31 15:31:32    1.2.1.1
  855. ***************
  856. *** 22,34 ****
  857.   #include "cell.h"
  858.   
  859.   #ifdef __STDC__
  860. ! extern void clear_spreadsheet ();
  861.   extern char *print_cell (CELL *);
  862.   extern char *cell_value_string (CELLREF r, CELLREF c);
  863.   extern char *col_to_str (CELLREF);
  864.   extern char *flt_to_str (double);
  865.   char *backslash_a_string (char *, int);
  866. ! extern int user_set_fmts ();
  867.   extern char *cell_name (CELLREF, CELLREF);
  868.   extern char *range_name (struct rng *);
  869.   extern char *new_var_value (char *, int, char *);
  870. --- 22,34 ----
  871.   #include "cell.h"
  872.   
  873.   #ifdef __STDC__
  874. ! extern void clear_spreadsheet (void);
  875.   extern char *print_cell (CELL *);
  876.   extern char *cell_value_string (CELLREF r, CELLREF c);
  877.   extern char *col_to_str (CELLREF);
  878.   extern char *flt_to_str (double);
  879.   char *backslash_a_string (char *, int);
  880. ! extern int user_set_fmts (void);
  881.   extern char *cell_name (CELLREF, CELLREF);
  882.   extern char *range_name (struct rng *);
  883.   extern char *new_var_value (char *, int, char *);
  884. ===================================================================
  885. RCS file: RCS/io-x11.c,v
  886. retrieving revision 1.2
  887. retrieving revision 1.2.1.1
  888. diff -c -r1.2 -r1.2.1.1
  889. *** io-x11.c    1992/12/30 02:17:42    1.2
  890. --- io-x11.c    1992/12/31 15:31:32    1.2.1.1
  891. ***************
  892. *** 51,57 ****
  893.   #ifdef __STDC__
  894.   extern char * x_get_string_resource (XrmDatabase, char *, char *);
  895.   extern XrmDatabase x_load_resources (Display *, char *, char *);
  896. ! extern char * getenv (char *);
  897.   #else
  898.   extern char * x_get_string_resource ();
  899.   extern XrmDatabase x_load_resources ();
  900. --- 51,57 ----
  901.   #ifdef __STDC__
  902.   extern char * x_get_string_resource (XrmDatabase, char *, char *);
  903.   extern XrmDatabase x_load_resources (Display *, char *, char *);
  904. ! extern char * getenv (const char *);
  905.   #else
  906.   extern char * x_get_string_resource ();
  907.   extern XrmDatabase x_load_resources ();
  908. ***************
  909. *** 1791,1802 ****
  910. --- 1791,1807 ----
  911.   }
  912.   
  913.   
  914. + #if __STDC__
  915.   static void
  916. + xio_pr_cell_win (struct window *win, CELLREF r, CELLREF c, CELL *cp)
  917. + #else
  918. + static void
  919.   xio_pr_cell_win (win, r, c, cp)
  920.        struct window *win;
  921.        CELLREF r;
  922.        CELLREF c;
  923.        CELL *cp;
  924. + #endif
  925.   {
  926.     struct x_window *xwin = x_win (thePort, win, 0);
  927.     struct display *disp = &xwin->display;
  928. ===================================================================
  929. RCS file: RCS/list.h,v
  930. retrieving revision 1.2
  931. retrieving revision 1.2.1.1
  932. diff -c -r1.2 -r1.2.1.1
  933. *** list.h    1992/11/28 03:29:00    1.2
  934. --- list.h    1992/12/31 15:31:32    1.2.1.1
  935. ***************
  936. *** 22,28 ****
  937.   extern void list_read_file (FILE *, int);
  938.   extern void list_write_file (FILE *, struct rng *);
  939.   extern int list_set_options (int, char *);
  940. ! extern void list_show_options ();
  941.   #else
  942.   extern void list_read_file ();
  943.   extern void list_write_file ();
  944. --- 22,28 ----
  945.   extern void list_read_file (FILE *, int);
  946.   extern void list_write_file (FILE *, struct rng *);
  947.   extern int list_set_options (int, char *);
  948. ! extern void list_show_options (void);
  949.   #else
  950.   extern void list_read_file ();
  951.   extern void list_write_file ();
  952. ===================================================================
  953. RCS file: RCS/lists.c,v
  954. retrieving revision 1.2
  955. retrieving revision 1.2.1.1
  956. diff -c -r1.2 -r1.2.1.1
  957. *** lists.c    1992/12/31 05:09:47    1.2
  958. --- lists.c    1992/12/31 15:31:32    1.2.1.1
  959. ***************
  960. *** 470,479 ****
  961. --- 470,484 ----
  962.     flush_fonts ();
  963.   }
  964.   
  965. + #if __STDC__
  966.   struct cell *
  967. + find_cell (CELLREF row, CELLREF col)
  968. + #else
  969. + struct cell *
  970.   find_cell (row, col)
  971.        CELLREF row;
  972.        CELLREF col;
  973. + #endif
  974.   {
  975.     void **v;
  976.   
  977. ***************
  978. *** 481,490 ****
  979. --- 486,500 ----
  980.     return v ? find (row, *v, sizeof (struct cell)) : 0;
  981.   }
  982.   
  983. + #if __STDC__
  984. + struct cell *
  985. + find_or_make_cell (CELLREF row, CELLREF col)
  986. + #else
  987.   struct cell *
  988.   find_or_make_cell (row, col)
  989.        CELLREF row;
  990.        CELLREF col;
  991. + #endif
  992.   {
  993.     struct list **v;
  994.   
  995. ===================================================================
  996. RCS file: RCS/lists.h,v
  997. retrieving revision 1.2
  998. retrieving revision 1.2.1.1
  999. diff -c -r1.2 -r1.2.1.1
  1000. *** lists.h    1992/12/28 05:00:43    1.2
  1001. --- lists.h    1992/12/31 15:31:32    1.2.1.1
  1002. ***************
  1003. *** 21,33 ****
  1004.   #include "global.h"
  1005.   
  1006.   #ifdef __STDC__
  1007. ! extern CELLREF highest_row ();
  1008. ! extern CELLREF highest_col ();
  1009.   extern unsigned short next_width (CELLREF *);
  1010.   extern void list_read_file (FILE *, int);
  1011.   extern void list_write_file (FILE *, struct rng *);
  1012.   extern int list_set_options (int, char *);
  1013. ! extern void list_show_options ();
  1014.   extern int get_scaled_width (CELLREF c);
  1015.   extern int get_scaled_height (CELLREF c);
  1016.   extern int get_width (CELLREF c);
  1017. --- 21,33 ----
  1018.   #include "global.h"
  1019.   
  1020.   #ifdef __STDC__
  1021. ! extern CELLREF highest_row (void);
  1022. ! extern CELLREF highest_col (void);
  1023.   extern unsigned short next_width (CELLREF *);
  1024.   extern void list_read_file (FILE *, int);
  1025.   extern void list_write_file (FILE *, struct rng *);
  1026.   extern int list_set_options (int, char *);
  1027. ! extern void list_show_options (void);
  1028.   extern int get_scaled_width (CELLREF c);
  1029.   extern int get_scaled_height (CELLREF c);
  1030.   extern int get_width (CELLREF c);
  1031. ***************
  1032. *** 35,42 ****
  1033.   extern void set_width (CELLREF, unsigned short);
  1034.   extern void set_height (CELLREF, unsigned short);
  1035.   extern void find_widths (CELLREF, CELLREF);
  1036. ! extern void flush_everything ();
  1037. ! extern void flush_all_timers ();
  1038.   extern CELLREF max_row (CELLREF);
  1039.   extern CELLREF max_col (CELLREF);
  1040.   extern void shift_widths (int, CELLREF, CELLREF);
  1041. --- 35,42 ----
  1042.   extern void set_width (CELLREF, unsigned short);
  1043.   extern void set_height (CELLREF, unsigned short);
  1044.   extern void find_widths (CELLREF, CELLREF);
  1045. ! extern void flush_everything (void);
  1046. ! extern void flush_all_timers (void);
  1047.   extern CELLREF max_row (CELLREF);
  1048.   extern CELLREF max_col (CELLREF);
  1049.   extern void shift_widths (int, CELLREF, CELLREF);
  1050. ===================================================================
  1051. RCS file: RCS/oleofile.h,v
  1052. retrieving revision 1.2
  1053. retrieving revision 1.2.1.1
  1054. diff -c -r1.2 -r1.2.1.1
  1055. *** oleofile.h    1992/11/28 03:29:00    1.2
  1056. --- oleofile.h    1992/12/31 15:31:32    1.2.1.1
  1057. ***************
  1058. *** 22,28 ****
  1059.   extern void oleo_read_file (FILE *, int);
  1060.   extern void oleo_write_file (FILE *, struct rng *);
  1061.   extern int oleo_set_options (int, char *);
  1062. ! extern void oleo_show_options ();
  1063.   #else
  1064.   extern void oleo_read_file ();
  1065.   extern void oleo_write_file ();
  1066. --- 22,28 ----
  1067.   extern void oleo_read_file (FILE *, int);
  1068.   extern void oleo_write_file (FILE *, struct rng *);
  1069.   extern int oleo_set_options (int, char *);
  1070. ! extern void oleo_show_options (void);
  1071.   #else
  1072.   extern void oleo_read_file ();
  1073.   extern void oleo_write_file ();
  1074. ===================================================================
  1075. RCS file: RCS/ref.c,v
  1076. retrieving revision 1.2
  1077. retrieving revision 1.2.1.1
  1078. diff -c -r1.2 -r1.2.1.1
  1079. *** ref.c    1992/12/31 05:09:32    1.2
  1080. --- ref.c    1992/12/31 15:31:32    1.2.1.1
  1081. ***************
  1082. *** 165,175 ****
  1083. --- 165,180 ----
  1084.   /* new_value() calls set_cell, but refuses to change locked cells, and
  1085.      updates and prints the results.  It returns an error msg on error. . .
  1086.    */
  1087. + #if __STDC__
  1088.   char *
  1089. + new_value (CELLREF row, CELLREF col, char *string)
  1090. + #else
  1091. + char *
  1092.   new_value (row, col, string)
  1093.        CELLREF row;
  1094.        CELLREF col;
  1095.        char *string;
  1096. + #endif
  1097.   {
  1098.     CELL *cp;
  1099.   
  1100. ***************
  1101. *** 195,206 ****
  1102. --- 200,216 ----
  1103.   }
  1104.   
  1105.   /* This sets the cell to a constant, stored in VALUE, whose type is in TYPE */
  1106. + #if __STDC__
  1107. + char *
  1108. + set_new_value (CELLREF row, CELLREF col, int type, union vals *value)
  1109. + #else
  1110.   char *
  1111.   set_new_value (row, col, type, value)
  1112.        CELLREF row;
  1113.        CELLREF col;
  1114.        int type;
  1115.        union vals *value;
  1116. + #endif
  1117.   {
  1118.     CELL *cp;
  1119.     extern int default_lock;
  1120. ***************
  1121. *** 273,284 ****
  1122. --- 283,299 ----
  1123.   /* We're reading in a cell, whose formula is FORM, and whose current value
  1124.      is VAL.  Parse both of them. . .  (Parsing of VAL is quite primitive)
  1125.    */
  1126. + #if __STDC__
  1127. + char *
  1128. + read_new_value (CELLREF row, CELLREF col, char *form, char *val)
  1129. + #else
  1130.   char *
  1131.   read_new_value (row, col, form, val)
  1132.        CELLREF row;
  1133.        CELLREF col;
  1134.        char *form;
  1135.        char *val;
  1136. + #endif
  1137.   {
  1138.     unsigned char *new_bytes;
  1139.     extern double __plinf, __neinf, __nan;
  1140. ***************
  1141. *** 398,409 ****
  1142. --- 413,429 ----
  1143.      we may *not* want to call move_outside. . .
  1144.    */
  1145.   
  1146. + #if __STDC__
  1147. + void
  1148. + move_cell (CELLREF rf, CELLREF cf, CELLREF rt, CELLREF ct)
  1149. + #else
  1150.   void
  1151.   move_cell (rf, cf, rt, ct)
  1152.        CELLREF rf;
  1153.        CELLREF cf;
  1154.        CELLREF rt;
  1155.        CELLREF ct;
  1156. + #endif
  1157.   {
  1158.     CELL *cpf;
  1159.   
  1160. ***************
  1161. *** 497,508 ****
  1162. --- 517,533 ----
  1163.     my_cell = 0;
  1164.   }
  1165.   
  1166. + #if __STDC__
  1167.   void
  1168. + copy_cell (CELLREF rf, CELLREF cf, CELLREF rt, CELLREF ct)
  1169. + #else
  1170. + void
  1171.   copy_cell (rf, cf, rt, ct)
  1172.        CELLREF rf;
  1173.        CELLREF cf;
  1174.        CELLREF rt;
  1175.        CELLREF ct;
  1176. + #endif
  1177.   {
  1178.     CELL *cpf;
  1179.   
  1180. ***************
  1181. *** 852,861 ****
  1182. --- 877,891 ----
  1183.   
  1184.   /* --------- Routines for dealing with cell references to other cells ------ */
  1185.   
  1186. + #if __STDC__
  1187.   void
  1188. + add_ref (CELLREF row, CELLREF col)
  1189. + #else
  1190. + void
  1191.   add_ref (row, col)
  1192.        CELLREF row;
  1193.        CELLREF col;
  1194. + #endif
  1195.   {
  1196.     CELL *other_cell;
  1197.   
  1198. ***************
  1199. *** 918,928 ****
  1200. --- 948,963 ----
  1201.       } */
  1202.   }
  1203.   
  1204. + #if __STDC__
  1205. + static void
  1206. + flush_range_ref (struct rng *rng, CELLREF rr, CELLREF cc)
  1207. + #else
  1208.   static void
  1209.   flush_range_ref (rng, rr, cc)
  1210.        struct rng *rng;
  1211.        CELLREF rr;
  1212.        CELLREF cc;
  1213. + #endif
  1214.   {
  1215.     CELL *other_cell;
  1216.   #ifndef SPLIT_REFS
  1217. ***************
  1218. *** 1129,1139 ****
  1219. --- 1164,1179 ----
  1220.   /* This adds a from reference to a cells reference list.
  1221.    * Note that the ref_fm structures themselves are hash-consed.
  1222.    */
  1223. + #if __STDC__
  1224. + static void
  1225. + add_ref_fm (struct ref_fm **where, CELLREF r, CELLREF c)
  1226. + #else
  1227.   static void
  1228.   add_ref_fm (where, r, c)
  1229.        struct ref_fm **where;
  1230.        CELLREF r;
  1231.        CELLREF c;
  1232. + #endif
  1233.   {
  1234.     struct ref_fm *from;
  1235.     int n;
  1236. ***************
  1237. *** 1181,1191 ****
  1238. --- 1221,1236 ----
  1239.       flush_fm_ref (from);
  1240.   }
  1241.   
  1242. + #if __STDC__
  1243. + static void
  1244. + flush_ref_fm (struct ref_fm **where, CELLREF r, CELLREF c)
  1245. + #else
  1246.   static void
  1247.   flush_ref_fm (where, r, c)
  1248.        struct ref_fm **where;
  1249.        CELLREF r;
  1250.        CELLREF c;
  1251. + #endif
  1252.   {
  1253.     struct ref_fm *from;
  1254.     int n;
  1255. ***************
  1256. *** 2476,2485 ****
  1257. --- 2521,2535 ----
  1258.      intersecting branches in the dependency tree, however, it's close enough
  1259.      for most people.
  1260.    */
  1261. + #if __STDC__
  1262.   void
  1263. + push_cell (CELLREF row, CELLREF col)
  1264. + #else
  1265. + void
  1266.   push_cell (row, col)
  1267.        CELLREF row;
  1268.        CELLREF col;
  1269. + #endif
  1270.   {
  1271.     struct pos *dup;
  1272.     CELL *cp;
  1273. ***************
  1274. *** 2707,2713 ****
  1275.   
  1276.   void
  1277.   #ifdef __STDC__
  1278. ! for_all_vars (void (*func) ())
  1279.   #else
  1280.   for_all_vars (func)
  1281.        void (*func) ();
  1282. --- 2757,2763 ----
  1283.   
  1284.   void
  1285.   #ifdef __STDC__
  1286. ! for_all_vars (void (*func) (char *, struct var *))
  1287.   #else
  1288.   for_all_vars (func)
  1289.        void (*func) ();
  1290. ===================================================================
  1291. RCS file: RCS/ref.h,v
  1292. retrieving revision 1.2
  1293. retrieving revision 1.2.1.1
  1294. diff -c -r1.2 -r1.2.1.1
  1295. *** ref.h    1992/11/28 03:29:01    1.2
  1296. --- ref.h    1992/12/31 15:31:32    1.2.1.1
  1297. ***************
  1298. *** 22,34 ****
  1299.   
  1300.   #ifdef __STDC__
  1301.   extern void add_var_ref (void *);
  1302. ! extern int eval_next_cell ();
  1303.   extern struct var *find_var (char *, int);
  1304.   extern void push_cell (CELLREF, CELLREF);
  1305.   extern void push_refs (struct ref_fm *);
  1306.   extern struct var *find_or_make_var (char *, int);
  1307.   extern void add_range_ref (struct rng *);
  1308. ! extern void flush_old_value ();
  1309.   extern void add_ref_to (int);
  1310.   extern char *set_new_value (CELLREF, CELLREF, int, union vals *);
  1311.   extern char *new_value (CELLREF, CELLREF, char *);
  1312. --- 22,34 ----
  1313.   
  1314.   #ifdef __STDC__
  1315.   extern void add_var_ref (void *);
  1316. ! extern int eval_next_cell (void);
  1317.   extern struct var *find_var (char *, int);
  1318.   extern void push_cell (CELLREF, CELLREF);
  1319.   extern void push_refs (struct ref_fm *);
  1320.   extern struct var *find_or_make_var (char *, int);
  1321.   extern void add_range_ref (struct rng *);
  1322. ! extern void flush_old_value (void);
  1323.   extern void add_ref_to (int);
  1324.   extern char *set_new_value (CELLREF, CELLREF, int, union vals *);
  1325.   extern char *new_value (CELLREF, CELLREF, char *);
  1326. ===================================================================
  1327. RCS file: RCS/regions.c,v
  1328. retrieving revision 1.2
  1329. retrieving revision 1.2.1.1
  1330. diff -c -r1.2 -r1.2.1.1
  1331. *** regions.c    1992/12/31 05:09:27    1.2
  1332. --- regions.c    1992/12/31 15:31:32    1.2.1.1
  1333. ***************
  1334. *** 40,52 ****
  1335. --- 40,57 ----
  1336.   /* Take a struct rng (R) and init its elements to R1 C1 R2 C2, making sure
  1337.      they are put in in the right order.
  1338.    */
  1339. + #if __STDC__
  1340.   void
  1341. + set_rng (struct rng *r, CELLREF r1, CELLREF c1, CELLREF r2, CELLREF c2)
  1342. + #else
  1343. + void
  1344.   set_rng (r, r1, c1, r2, c2)
  1345.        struct rng *r;
  1346.        CELLREF r1;
  1347.        CELLREF c1;
  1348.        CELLREF r2;
  1349.        CELLREF c2;
  1350. + #endif
  1351.   {
  1352.     if (r1 <= r2)
  1353.       {
  1354. ===================================================================
  1355. RCS file: RCS/regions.h,v
  1356. retrieving revision 1.2
  1357. retrieving revision 1.2.1.1
  1358. diff -c -r1.2 -r1.2.1.1
  1359. *** regions.h    1992/12/28 05:00:46    1.2
  1360. --- regions.h    1992/12/31 15:31:32    1.2.1.1
  1361. ***************
  1362. *** 43,49 ****
  1363.   extern void set_rng (struct rng *, CELLREF, CELLREF, CELLREF, CELLREF);
  1364.   extern void lock_region (struct rng *, int);
  1365.   extern void format_region (struct rng *, int, int);
  1366. ! extern void sort_region ();
  1367.   #else
  1368.   extern int cmp_cells ();
  1369.   extern void swp_cells ();
  1370. --- 43,49 ----
  1371.   extern void set_rng (struct rng *, CELLREF, CELLREF, CELLREF, CELLREF);
  1372.   extern void lock_region (struct rng *, int);
  1373.   extern void format_region (struct rng *, int, int);
  1374. ! extern void sort_region (void);
  1375.   #else
  1376.   extern int cmp_cells ();
  1377.   extern void swp_cells ();
  1378. ===================================================================
  1379. RCS file: RCS/sc.h,v
  1380. retrieving revision 1.2
  1381. retrieving revision 1.2.1.1
  1382. diff -c -r1.2 -r1.2.1.1
  1383. *** sc.h    1992/11/28 03:29:01    1.2
  1384. --- sc.h    1992/12/31 15:31:32    1.2.1.1
  1385. ***************
  1386. *** 24,30 ****
  1387.   extern void sc_read_file (FILE *,int);
  1388.   extern void sc_write_file (FILE *,struct rng *);
  1389.   extern  int sc_set_options (int, char *);
  1390. ! extern void sc_show_options ();
  1391.   #else
  1392.   extern void sc_read_file ();
  1393.   extern void sc_write_file ();
  1394. --- 24,30 ----
  1395.   extern void sc_read_file (FILE *,int);
  1396.   extern void sc_write_file (FILE *,struct rng *);
  1397.   extern  int sc_set_options (int, char *);
  1398. ! extern void sc_show_options (void);
  1399.   #else
  1400.   extern void sc_read_file ();
  1401.   extern void sc_write_file ();
  1402. ===================================================================
  1403. RCS file: RCS/sylk.h,v
  1404. retrieving revision 1.2
  1405. retrieving revision 1.2.1.1
  1406. diff -c -r1.2 -r1.2.1.1
  1407. *** sylk.h    1992/12/28 05:00:50    1.2
  1408. --- sylk.h    1992/12/31 15:31:32    1.2.1.1
  1409. ***************
  1410. *** 24,30 ****
  1411.   extern void sylk_read_file (FILE *,int);
  1412.   extern void sylk_write_file (FILE *,struct rng *);
  1413.   extern  int sylk_set_options (int, char *);
  1414. ! extern void sylk_show_options ();
  1415.   #else
  1416.   extern void sylk_read_file ();
  1417.   extern void sylk_write_file ();
  1418. --- 24,30 ----
  1419.   extern void sylk_read_file (FILE *,int);
  1420.   extern void sylk_write_file (FILE *,struct rng *);
  1421.   extern  int sylk_set_options (int, char *);
  1422. ! extern void sylk_show_options (void);
  1423.   #else
  1424.   extern void sylk_read_file ();
  1425.   extern void sylk_write_file ();
  1426. ===================================================================
  1427. RCS file: RCS/utils.c,v
  1428. retrieving revision 1.2
  1429. retrieving revision 1.2.1.1
  1430. diff -c -r1.2 -r1.2.1.1
  1431. *** utils.c    1992/12/31 05:45:45    1.2
  1432. --- utils.c    1992/12/31 15:31:32    1.2.1.1
  1433. ***************
  1434. *** 53,61 ****
  1435.   #endif
  1436.   
  1437.   #ifdef __STDC__
  1438. ! extern void abort ();
  1439. ! extern void *malloc (int);
  1440. ! extern void *calloc (int, int);
  1441.   extern void *realloc (void *, size_t);
  1442.   char *strdup (CONST char *);
  1443.   #else
  1444. --- 53,61 ----
  1445.   #endif
  1446.   
  1447.   #ifdef __STDC__
  1448. ! extern void abort (void);
  1449. ! extern void *malloc (size_t);
  1450. ! extern void *calloc (size_t, size_t);
  1451.   extern void *realloc (void *, size_t);
  1452.   char *strdup (CONST char *);
  1453.   #else
  1454. ===================================================================
  1455. RCS file: RCS/utils.h,v
  1456. retrieving revision 1.2
  1457. retrieving revision 1.2.1.1
  1458. diff -c -r1.2 -r1.2.1.1
  1459. *** utils.h    1992/12/28 05:00:50    1.2
  1460. --- utils.h    1992/12/31 15:31:32    1.2.1.1
  1461. ***************
  1462. *** 34,40 ****
  1463.   #define ck_free free
  1464.   #define ck_remalloc(OLD, SIZE) \
  1465.     ((OLD) ? ck_realloc ((OLD), (SIZE)) : ck_malloc (SIZE))
  1466. - extern FILE *ck_fopen();
  1467.   
  1468.   extern void get_usr_stats (int, char **);
  1469.   extern void set_usr_stats (int, char **);
  1470. --- 34,39 ----
  1471. ***************
  1472. *** 43,62 ****
  1473.   extern int string_to_char (char **);
  1474.   extern FILE *xopen_with_backup (const char *,const char *);
  1475.   extern int xclose (FILE *);
  1476. ! extern char *err_msg ();
  1477.   extern char *mk_sprintf (char *, ...);
  1478.   
  1479. ! extern void init_mem ();
  1480. ! extern void init_eval ();
  1481. ! extern void init_refs ();
  1482. ! extern void init_cells ();
  1483. ! extern VOIDSTAR init_stack ();
  1484.   
  1485.   struct rng;
  1486.   extern void panic_read_file (FILE *,int);
  1487.   extern void panic_write_file (FILE *,struct rng *);
  1488.   extern  int panic_set_options (int, char *);
  1489. ! extern void panic_show_options ();
  1490.   
  1491.   extern VOIDSTAR pop_stack (VOIDSTAR);
  1492.   extern void push_stack (VOIDSTAR, VOIDSTAR);
  1493. --- 42,61 ----
  1494.   extern int string_to_char (char **);
  1495.   extern FILE *xopen_with_backup (const char *,const char *);
  1496.   extern int xclose (FILE *);
  1497. ! extern char *err_msg (void);
  1498.   extern char *mk_sprintf (char *, ...);
  1499.   
  1500. ! extern void init_mem (void);
  1501. ! extern void init_eval (void);
  1502. ! extern void init_refs (void);
  1503. ! extern void init_cells (void);
  1504. ! extern VOIDSTAR init_stack (void);
  1505.   
  1506.   struct rng;
  1507.   extern void panic_read_file (FILE *,int);
  1508.   extern void panic_write_file (FILE *,struct rng *);
  1509.   extern  int panic_set_options (int, char *);
  1510. ! extern void panic_show_options (void);
  1511.   
  1512.   extern VOIDSTAR pop_stack (VOIDSTAR);
  1513.   extern void push_stack (VOIDSTAR, VOIDSTAR);
  1514. ***************
  1515. *** 70,76 ****
  1516.   #define ck_free free
  1517.   #define ck_remalloc(OLD, SIZE) \
  1518.     ((OLD) ? ck_realloc ((OLD), (SIZE)) : ck_malloc (SIZE))
  1519. - extern FILE *ck_fopen();
  1520.   
  1521.   extern void get_usr_stats ();
  1522.   extern void set_usr_stats ();
  1523. --- 69,74 ----
  1524. ===================================================================
  1525. RCS file: RCS/window.c,v
  1526. retrieving revision 1.2
  1527. retrieving revision 1.2.1.1
  1528. diff -c -r1.2 -r1.2.1.1
  1529. *** window.c    1992/12/28 05:04:07    1.2
  1530. --- window.c    1992/12/31 15:31:32    1.2.1.1
  1531. ***************
  1532. *** 281,290 ****
  1533. --- 281,295 ----
  1534.   }
  1535.   
  1536.   
  1537. + #if __STDC__
  1538.   int
  1539. + win_label_cols (struct window * win, CELLREF hr)
  1540. + #else
  1541. + int
  1542.   win_label_cols (win, hr)
  1543.        struct window * win;
  1544.        CELLREF hr;
  1545. + #endif
  1546.   {
  1547.     int lh;
  1548.   
  1549. ***************
  1550. *** 769,779 ****
  1551. --- 774,789 ----
  1552.   }
  1553.   
  1554.   
  1555. + #if __STDC__
  1556. + void 
  1557. + io_pr_cell (CELLREF r, CELLREF c, CELL *cp)
  1558. + #else
  1559.   void 
  1560.   io_pr_cell (r, c, cp)
  1561.        CELLREF r;
  1562.        CELLREF c;
  1563.        CELL *cp;
  1564. + #endif
  1565.   {
  1566.     struct window *win;
  1567.   
  1568. ***************
  1569. *** 864,873 ****
  1570. --- 874,888 ----
  1571.     do_close_window (win - wins);
  1572.   }
  1573.   
  1574. + #if __STDC__
  1575. + void 
  1576. + io_move_cell_cursor (CELLREF rr, CELLREF cc)
  1577. + #else
  1578.   void 
  1579.   io_move_cell_cursor (rr, cc)
  1580.        CELLREF rr;
  1581.        CELLREF cc;
  1582. + #endif
  1583.   {
  1584.     if (cwin->link != -1)
  1585.       shift_linked_window ((long) rr - curow, (long) cc - cucol);
  1586. ===================================================================
  1587. RCS file: RCS/window.h,v
  1588. retrieving revision 1.2
  1589. retrieving revision 1.2.1.1
  1590. diff -c -r1.2 -r1.2.1.1
  1591. *** window.h    1992/12/28 05:00:51    1.2
  1592. --- window.h    1992/12/31 15:31:32    1.2.1.1
  1593. ***************
  1594. *** 149,156 ****
  1595.   extern void io_scroll_cell_cursor (int dirn);
  1596.   extern void io_pr_cell (CELLREF r, CELLREF c, CELL *);
  1597.   extern void io_redo_region (struct rng * rng);
  1598. ! extern void io_recenter_cur_win ();
  1599. ! extern void io_recenter_all_win ();
  1600.   
  1601.   extern int win_label_rows (struct window * win);
  1602.   extern int win_label_cols (struct window * win, CELLREF last_row);
  1603. --- 149,156 ----
  1604.   extern void io_scroll_cell_cursor (int dirn);
  1605.   extern void io_pr_cell (CELLREF r, CELLREF c, CELL *);
  1606.   extern void io_redo_region (struct rng * rng);
  1607. ! extern void io_recenter_cur_win (void);
  1608. ! extern void io_recenter_all_win (void);
  1609.   
  1610.   extern int win_label_rows (struct window * win);
  1611.   extern int win_label_cols (struct window * win, CELLREF last_row);
  1612.  
  1613.