Fix some lint warnings.

This commit is contained in:
kristerw 2003-05-30 23:08:12 +00:00
parent a19b05b597
commit f4b0e187e9
2 changed files with 14 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: backupfile.c,v 1.9 2002/03/16 22:36:42 kristerw Exp $ */
/* $NetBSD: backupfile.c,v 1.10 2003/05/30 23:08:12 kristerw Exp $ */
/* backupfile.c -- make Emacs style backup file names
Copyright (C) 1990 Free Software Foundation, Inc.
@ -15,7 +15,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: backupfile.c,v 1.9 2002/03/16 22:36:42 kristerw Exp $");
__RCSID("$NetBSD: backupfile.c,v 1.10 2003/05/30 23:08:12 kristerw Exp $");
#endif /* not lint */
#include <stdio.h>
@ -44,13 +44,7 @@ __RCSID("$NetBSD: backupfile.c,v 1.9 2002/03/16 22:36:42 kristerw Exp $");
#include <unistd.h>
#if defined (_POSIX_VERSION)
/* POSIX does not require that the d_ino field be present, and some
systems do not provide it. */
#define REAL_DIR_ENTRY(dp) 1
#else
#define REAL_DIR_ENTRY(dp) ((dp)->d_ino != 0)
#endif
#define REAL_DIR_ENTRY(dp) ((dp)->d_fileno != 0)
/* Which type of backup file names are generated. */
enum backup_type backup_type = none;
@ -62,7 +56,7 @@ char *simple_backup_suffix = "~";
/* backupfile.c */
static int max_backup_version(char *, char *);
static char *make_version_name(char *, int);
static int version_number(char *, char *, int);
static int version_number(char *, char *, size_t);
static char *concat(char *, char *);
static char *dirname(char *);
static int argmatch(char *, char **);
@ -111,7 +105,7 @@ max_backup_version(char *file, char *dir)
struct direct *dp;
int highest_version;
int this_version;
int file_name_length;
size_t file_name_length;
dirp = opendir (dir);
if (!dirp)
@ -151,7 +145,7 @@ make_version_name(char *file, int version)
BASE should already have ".~" appended to it. */
static int
version_number(char *base, char *backup, int base_length)
version_number(char *base, char *backup, size_t base_length)
{
int version;
char *p;
@ -202,7 +196,7 @@ dirname(char *path)
{
char *newpath;
char *slash;
int length; /* Length of result, not including NUL. */
size_t length; /* Length of result, not including NUL. */
slash = strrchr (path, '/');
if (slash == 0)
@ -234,7 +228,7 @@ static int
argmatch(char *arg, char **optlist)
{
int i; /* Temporary index in OPTLIST. */
int arglen; /* Length of ARG. */
size_t arglen; /* Length of ARG. */
int matchind = -1; /* Index of first nonexact match. */
int ambiguous = 0; /* If nonzero, multiple nonexact match(es). */
@ -303,4 +297,5 @@ get_version(char *version)
return backup_types[i];
invalid_arg ("version control type", version, i);
exit (1);
/* NOTREACHED */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: patch.c,v 1.16 2003/05/30 22:33:58 kristerw Exp $ */
/* $NetBSD: patch.c,v 1.17 2003/05/30 23:08:13 kristerw Exp $ */
/* patch - a program to apply diffs to original files
*
@ -25,7 +25,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: patch.c,v 1.16 2003/05/30 22:33:58 kristerw Exp $");
__RCSID("$NetBSD: patch.c,v 1.17 2003/05/30 23:08:13 kristerw Exp $");
#endif /* not lint */
#include "INTERN.h"
@ -55,7 +55,7 @@ static void copy_till(LINENUM);
static void spew_output(void);
static void dump_line(LINENUM);
static bool patch_match(LINENUM, LINENUM, LINENUM);
static bool similar(char *, char *, int);
static bool similar(char *, char *, size_t);
int main(int, char *[]);
/* TRUE if -E was specified on command line. */
@ -321,6 +321,7 @@ main(int argc, char *argv[])
set_signals(1);
}
my_exit(failtotal);
/* NOTREACHED */
}
/* Prepare to find the next patch to do in the patch file. */
@ -871,7 +872,7 @@ patch_match(LINENUM base, LINENUM offset, LINENUM fuzz)
/* Do two lines match with canonicalized white space? */
static bool
similar(char *a, char *b, int len)
similar(char *a, char *b, size_t len)
{
while (len) {
if (isspace((unsigned char)*b)) {/* whitespace (or \n) to match? */