Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/makefs little size_t/ssize_t...
details: https://anonhg.NetBSD.org/src/rev/98eeda569a4d
branches: trunk
changeset: 342491:98eeda569a4d
user: christos <christos%NetBSD.org@localhost>
date: Thu Dec 24 15:52:37 2015 +0000
description:
little size_t/ssize_t...
diffstat:
usr.sbin/makefs/cd9660.c | 13 +++++++------
usr.sbin/makefs/cd9660.h | 4 ++--
usr.sbin/makefs/cd9660/cd9660_strings.c | 8 ++++----
usr.sbin/makefs/ffs/buf.c | 18 +++++++++---------
4 files changed, 22 insertions(+), 21 deletions(-)
diffs (152 lines):
diff -r 575b6c7ebb87 -r 98eeda569a4d usr.sbin/makefs/cd9660.c
--- a/usr.sbin/makefs/cd9660.c Thu Dec 24 14:16:46 2015 +0000
+++ b/usr.sbin/makefs/cd9660.c Thu Dec 24 15:52:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660.c,v 1.51 2015/12/21 03:19:17 christos Exp $ */
+/* $NetBSD: cd9660.c,v 1.52 2015/12/24 15:52:37 christos Exp $ */
/*
* Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -103,7 +103,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: cd9660.c,v 1.51 2015/12/21 03:19:17 christos Exp $");
+__RCSID("$NetBSD: cd9660.c,v 1.52 2015/12/24 15:52:37 christos Exp $");
#endif /* !__lint */
#include <string.h>
@@ -124,7 +124,7 @@
static void cd9660_finalize_PVD(iso9660_disk *);
static cd9660node *cd9660_allocate_cd9660node(void);
static void cd9660_set_defaults(iso9660_disk *);
-static int cd9660_arguments_set_string(const char *, const char *, int,
+static int cd9660_arguments_set_string(const char *, const char *, size_t,
char, char *);
static void cd9660_populate_iso_dir_record(
struct _iso_directory_record_cd9660 *, u_char, u_char, u_char,
@@ -339,10 +339,11 @@
}
static int
-cd9660_arguments_set_string(const char *val, const char *fieldtitle, int length,
- char testmode, char * dest)
+cd9660_arguments_set_string(const char *val, const char *fieldtitle,
+ size_t length, char testmode, char * dest)
{
- int len, test;
+ size_t len;
+ int test;
if (val == NULL)
warnx("error: The %s requires a string argument", fieldtitle);
diff -r 575b6c7ebb87 -r 98eeda569a4d usr.sbin/makefs/cd9660.h
--- a/usr.sbin/makefs/cd9660.h Thu Dec 24 14:16:46 2015 +0000
+++ b/usr.sbin/makefs/cd9660.h Thu Dec 24 15:52:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660.h,v 1.20 2013/01/29 15:52:25 christos Exp $ */
+/* $NetBSD: cd9660.h,v 1.21 2015/12/24 15:52:37 christos Exp $ */
/*
* Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -308,7 +308,7 @@
/************ FUNCTIONS **************/
int cd9660_valid_a_chars(const char *);
int cd9660_valid_d_chars(const char *);
-void cd9660_uppercase_characters(char *, int);
+void cd9660_uppercase_characters(char *, size_t);
/* ISO Data Types */
void cd9660_721(uint16_t, unsigned char *);
diff -r 575b6c7ebb87 -r 98eeda569a4d usr.sbin/makefs/cd9660/cd9660_strings.c
--- a/usr.sbin/makefs/cd9660/cd9660_strings.c Thu Dec 24 14:16:46 2015 +0000
+++ b/usr.sbin/makefs/cd9660/cd9660_strings.c Thu Dec 24 15:52:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cd9660_strings.c,v 1.5 2011/03/23 13:11:51 christos Exp $ */
+/* $NetBSD: cd9660_strings.c,v 1.6 2015/12/24 15:52:37 christos Exp $ */
/*
* Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -46,14 +46,14 @@
#include "cd9660.h"
#if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: cd9660_strings.c,v 1.5 2011/03/23 13:11:51 christos Exp $");
+__RCSID("$NetBSD: cd9660_strings.c,v 1.6 2015/12/24 15:52:37 christos Exp $");
#endif /* !__lint */
void
-cd9660_uppercase_characters(char *str, int len)
+cd9660_uppercase_characters(char *str, size_t len)
{
- int p;
+ size_t p;
for (p = 0; p < len; p++) {
if (islower((unsigned char)str[p]) )
diff -r 575b6c7ebb87 -r 98eeda569a4d usr.sbin/makefs/ffs/buf.c
--- a/usr.sbin/makefs/ffs/buf.c Thu Dec 24 14:16:46 2015 +0000
+++ b/usr.sbin/makefs/ffs/buf.c Thu Dec 24 15:52:37 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: buf.c,v 1.22 2015/03/29 05:52:59 agc Exp $ */
+/* $NetBSD: buf.c,v 1.23 2015/12/24 15:52:37 christos Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -41,7 +41,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: buf.c,v 1.22 2015/03/29 05:52:59 agc Exp $");
+__RCSID("$NetBSD: buf.c,v 1.23 2015/12/24 15:52:37 christos Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -80,7 +80,7 @@
if (lseek((*bpp)->b_fs->fd, offset, SEEK_SET) == -1)
err(1, "%s: lseek %lld (%lld)", __func__,
(long long)(*bpp)->b_blkno, (long long)offset);
- rv = read((*bpp)->b_fs->fd, (*bpp)->b_data, (*bpp)->b_bcount);
+ rv = read((*bpp)->b_fs->fd, (*bpp)->b_data, (size_t)(*bpp)->b_bcount);
if (debug & DEBUG_BUF_BREAD)
printf("bread: read %ld (%lld) returned %zd\n",
(*bpp)->b_bcount, (long long)offset, rv);
@@ -129,14 +129,14 @@
{
off_t offset;
ssize_t rv;
- int bytes;
+ size_t bytes;
fsinfo_t *fs = bp->b_fs;
assert (bp != NULL);
offset = bp->b_blkno * fs->sectorsize + fs->offset;
- bytes = bp->b_bcount;
+ bytes = (size_t)bp->b_bcount;
if (debug & DEBUG_BUF_BWRITE)
- printf("bwrite: blkno %lld offset %lld bcount %d\n",
+ printf("bwrite: blkno %lld offset %lld bcount %zu\n",
(long long)bp->b_blkno, (long long) offset, bytes);
if (lseek(bp->b_fs->fd, offset, SEEK_SET) == -1)
return (errno);
@@ -145,7 +145,7 @@
printf("bwrite: write %ld (offset %lld) returned %lld\n",
bp->b_bcount, (long long)offset, (long long)rv);
brelse(bp, 0);
- if (rv == bytes)
+ if (rv == (ssize_t)bytes)
return (0);
else if (rv == -1) /* write error */
return (errno);
@@ -210,8 +210,8 @@
}
bp->b_bcount = size;
if (bp->b_data == NULL || bp->b_bcount > bp->b_bufsize) {
- n = erealloc(bp->b_data, size);
- memset(n, 0, size);
+ n = erealloc(bp->b_data, (size_t)size);
+ memset(n, 0, (size_t)size);
bp->b_data = n;
bp->b_bufsize = size;
}
Home |
Main Index |
Thread Index |
Old Index