}
static int next_conflict(struct point here, struct csl *start_c1, struct csl *start_c2,
- struct point *start, struct point *end,
- struct file *a, struct file *b, struct file *c)
+ struct point *start, struct point *end)
{
/* We want to find the start and end of the 'next' conflict.
* There may not be another conflict, in which case set start and
retreat(c1,c2, &start_last);
while (!end_of_file(end_last, c1, c2)) {
- next_conflict(end_last, c1, c2, &start_next, &end_next, a, b, c);
+ next_conflict(end_last, c1, c2, &start_next, &end_next);
while (already_applied(c1,c2,start_next,end_next,a,b,c)) {
rv.ignored++;
- next_conflict(end_next, c1,c2,&start_next,&end_next,a,b,c);
+ next_conflict(end_next, c1,c2,&start_next,&end_next);
}
#if 0
printf("start %d %d (%d,%d) end %d %d (%d,%d)\n",
#include "wiggle.h"
#include <malloc.h>
-#include <string.h>
#include <curses.h>
#include <unistd.h>
#include <stdlib.h>
#include <signal.h>
#include <fcntl.h>
-static void term_init();
+static void term_init(void);
#define assert(x) do { if (!(x)) abort(); } while (0)
unsigned int start, unsigned int end);
/* global attributes */
-int a_delete, a_added, a_common, a_sep, a_void, a_unmatched, a_extra, a_already;
+unsigned int a_delete, a_added, a_common, a_sep, a_void,
+ a_unmatched, a_extra, a_already;
/******************************************************************
* Help window
*/
static int visible(int mode, enum mergetype type, int stream)
{
- if (mode == 0) return -1;
+ if (mode == 0)
+ return -1;
/* mode can be any combination of ORIG RESULT BEFORE AFTER */
switch(type) {
case End: /* The END is always visible */
}
/* blank a whole row of display */
-static void blank(int row, int start, int cols, int attr)
+static void blank(int row, int start, int cols, unsigned int attr)
{
(void)attrset(attr);
move(row,start);
mvaddstr(row, col-start+offset, b);
col += strlen(b);
}
- blank(row, col-start+offset, start+cols-col, e.start?visible(mode, m[pos.p.m].type, pos.p.s):A_NORMAL );
+ blank(row, col-start+offset, start+cols-col,
+ e.start
+ ?(unsigned)visible(mode, m[pos.p.m].type, pos.p.s)
+ :A_NORMAL );
return;
}
if (visible(mode, m[pos.p.m].type, pos.p.s) == -1) {
int meta = 0, tmeta;
int num= -1, tnum;
char search[80];
- int searchlen = 0;
+ unsigned int searchlen = 0;
int search_notfound = 0;
int searchdir = 0;
struct search_anchor {
struct search_anchor *next;
struct mpos pos;
int notfound;
- int row, col, searchlen;
+ int row, col;
+ unsigned int searchlen;
} *anchor = NULL;
if (f == NULL) {
mvaddstr(0, cols - strlen(lbuf) - 1, lbuf);
}
/* Always refresh the line */
- while (start > target) { start -= 8; refresh = 1;}
+ while (start > target) {
+ start -= 8;
+ refresh = 1;
+ }
if (start < 0) start = 0;
retry:
draw_mline(mode, row, start, cols, fm,fb,fa,ci.merger,
s.body = malloc(s.len);
if (s.body) {
fseek(f, start, 0);
- if (fread(s.body, 1, s.len, f) != s.len) {
+ if (fread(s.body, 1, s.len, f) != (size_t)s.len) {
free(s.body);
s.body = NULL;
}
exit(2);
}
-static void term_init()
+static void term_init(void)
{
static int init_done = 0;