Module Name: src Committed By: dholland Date: Wed Feb 1 05:46:46 UTC 2012
Modified Files: src/include: quota.h src/lib/libquota: libquota.3 quota_cursor.c quota_kernel.c quota_oldfiles.c quota_schema.c quotapvt.h src/sys/compat/netbsd32: netbsd32.h src/sys/kern: vfs_syscalls.c src/sys/sys: quotactl.h Log Message: Be consistent about whether idtype and objtype codes are signed or unsigned. They are signed. (While unsigned might have been a better choice, it doesn't really matter and the majority of preexisting uses were signed. And consistency is good.) To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/include/quota.h cvs rdiff -u -r1.2 -r1.3 src/lib/libquota/libquota.3 \ src/lib/libquota/quota_kernel.c cvs rdiff -u -r1.5 -r1.6 src/lib/libquota/quota_cursor.c cvs rdiff -u -r1.6 -r1.7 src/lib/libquota/quota_oldfiles.c \ src/lib/libquota/quota_schema.c cvs rdiff -u -r1.13 -r1.14 src/lib/libquota/quotapvt.h cvs rdiff -u -r1.91 -r1.92 src/sys/compat/netbsd32/netbsd32.h cvs rdiff -u -r1.446 -r1.447 src/sys/kern/vfs_syscalls.c cvs rdiff -u -r1.34 -r1.35 src/sys/sys/quotactl.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/include/quota.h diff -u src/include/quota.h:1.5 src/include/quota.h:1.6 --- src/include/quota.h:1.5 Mon Jan 30 16:45:13 2012 +++ src/include/quota.h Wed Feb 1 05:46:45 2012 @@ -48,10 +48,10 @@ const char *quota_getmountdevice(struct const char *quota_getimplname(struct quotahandle *); unsigned quota_getrestrictions(struct quotahandle *); -unsigned quota_getnumidtypes(struct quotahandle *); +int quota_getnumidtypes(struct quotahandle *); const char *quota_idtype_getname(struct quotahandle *, int /*idtype*/); -unsigned quota_getnumobjtypes(struct quotahandle *); +int quota_getnumobjtypes(struct quotahandle *); const char *quota_objtype_getname(struct quotahandle *, int /*objtype*/); int quota_objtype_isbytes(struct quotahandle *, int /*objtype*/); @@ -69,7 +69,7 @@ int quota_delete(struct quotahandle *, c struct quotacursor *quota_opencursor(struct quotahandle *); void quotacursor_close(struct quotacursor *); -int quotacursor_skipidtype(struct quotacursor *, unsigned /*idtype*/); +int quotacursor_skipidtype(struct quotacursor *, int /*idtype*/); int quotacursor_get(struct quotacursor *, struct quotakey *, struct quotaval *); Index: src/lib/libquota/libquota.3 diff -u src/lib/libquota/libquota.3:1.2 src/lib/libquota/libquota.3:1.3 --- src/lib/libquota/libquota.3:1.2 Wed Jan 25 21:58:43 2012 +++ src/lib/libquota/libquota.3 Wed Feb 1 05:46:46 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: libquota.3,v 1.2 2012/01/25 21:58:43 wiz Exp $ +.\" $NetBSD: libquota.3,v 1.3 2012/02/01 05:46:46 dholland Exp $ .\" .\" Copyright (c) 2012 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -67,9 +67,9 @@ .Fn quota_getmountpoint "struct quotahandle *qh" .Ft const char * .Fn quota_getimplname "struct quotahandle *qh" -.Ft unsigned +.Ft int .Fn quota_getnumidtypes "struct quotahandle *qh" -.Ft unsigned +.Ft int .Fn quota_getnumobjtypes "struct quotahandle *qh" .Ft const char * .Fn quota_idtype_getname "struct quotahandle *qh" "int idtype" Index: src/lib/libquota/quota_kernel.c diff -u src/lib/libquota/quota_kernel.c:1.2 src/lib/libquota/quota_kernel.c:1.3 --- src/lib/libquota/quota_kernel.c:1.2 Wed Feb 1 05:43:53 2012 +++ src/lib/libquota/quota_kernel.c Wed Feb 1 05:46:46 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: quota_kernel.c,v 1.2 2012/02/01 05:43:53 dholland Exp $ */ +/* $NetBSD: quota_kernel.c,v 1.3 2012/02/01 05:46:46 dholland Exp $ */ /*- * Copyright (c) 2012 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: quota_kernel.c,v 1.2 2012/02/01 05:43:53 dholland Exp $"); +__RCSID("$NetBSD: quota_kernel.c,v 1.3 2012/02/01 05:46:46 dholland Exp $"); #include <stdlib.h> #include <err.h> @@ -79,7 +79,7 @@ __quota_kernel_getrestrictions(struct qu return stat.qs_restrictions; } -unsigned +int __quota_kernel_getnumidtypes(struct quotahandle *qh) { struct quotastat stat; @@ -105,7 +105,7 @@ __quota_kernel_idtype_getname(struct quo return stat.qis_name; } -unsigned +int __quota_kernel_getnumobjtypes(struct quotahandle *qh) { struct quotastat stat; @@ -266,7 +266,7 @@ __quota_kernel_cursor_destroy(struct quo int __quota_kernel_cursor_skipidtype(struct quotahandle *qh, struct kernel_quotacursor *cursor, - unsigned idtype) + int idtype) { struct quotactl_args args; Index: src/lib/libquota/quota_cursor.c diff -u src/lib/libquota/quota_cursor.c:1.5 src/lib/libquota/quota_cursor.c:1.6 --- src/lib/libquota/quota_cursor.c:1.5 Wed Feb 1 05:34:40 2012 +++ src/lib/libquota/quota_cursor.c Wed Feb 1 05:46:46 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: quota_cursor.c,v 1.5 2012/02/01 05:34:40 dholland Exp $ */ +/* $NetBSD: quota_cursor.c,v 1.6 2012/02/01 05:46:46 dholland Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: quota_cursor.c,v 1.5 2012/02/01 05:34:40 dholland Exp $"); +__RCSID("$NetBSD: quota_cursor.c,v 1.6 2012/02/01 05:46:46 dholland Exp $"); #include <stdlib.h> #include <errno.h> @@ -117,7 +117,7 @@ quotacursor_close(struct quotacursor *qc } int -quotacursor_skipidtype(struct quotacursor *qc, unsigned idtype) +quotacursor_skipidtype(struct quotacursor *qc, int idtype) { switch (qc->qc_type) { case QC_OLDFILES: Index: src/lib/libquota/quota_oldfiles.c diff -u src/lib/libquota/quota_oldfiles.c:1.6 src/lib/libquota/quota_oldfiles.c:1.7 --- src/lib/libquota/quota_oldfiles.c:1.6 Wed Feb 1 05:34:40 2012 +++ src/lib/libquota/quota_oldfiles.c Wed Feb 1 05:46:46 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: quota_oldfiles.c,v 1.6 2012/02/01 05:34:40 dholland Exp $ */ +/* $NetBSD: quota_oldfiles.c,v 1.7 2012/02/01 05:46:46 dholland Exp $ */ /* * Copyright (c) 1980, 1990, 1993 @@ -748,7 +748,7 @@ __quota_oldfiles_cursor_destroy(struct o int __quota_oldfiles_cursor_skipidtype(struct oldfiles_quotacursor *oqc, - unsigned idtype) + int idtype) { switch (idtype) { case QUOTA_IDTYPE_USER: Index: src/lib/libquota/quota_schema.c diff -u src/lib/libquota/quota_schema.c:1.6 src/lib/libquota/quota_schema.c:1.7 --- src/lib/libquota/quota_schema.c:1.6 Wed Feb 1 05:34:40 2012 +++ src/lib/libquota/quota_schema.c Wed Feb 1 05:46:46 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: quota_schema.c,v 1.6 2012/02/01 05:34:40 dholland Exp $ */ +/* $NetBSD: quota_schema.c,v 1.7 2012/02/01 05:46:46 dholland Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -29,7 +29,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: quota_schema.c,v 1.6 2012/02/01 05:34:40 dholland Exp $"); +__RCSID("$NetBSD: quota_schema.c,v 1.7 2012/02/01 05:46:46 dholland Exp $"); #include <sys/types.h> #include <sys/statvfs.h> @@ -88,7 +88,7 @@ quota_getrestrictions(struct quotahandle return 0; } -unsigned +int quota_getnumidtypes(struct quotahandle *qh) { switch (qh->qh_mode) { @@ -132,7 +132,7 @@ quota_idtype_getname(struct quotahandle return "???"; } -unsigned +int quota_getnumobjtypes(struct quotahandle *qh) { switch (qh->qh_mode) { Index: src/lib/libquota/quotapvt.h diff -u src/lib/libquota/quotapvt.h:1.13 src/lib/libquota/quotapvt.h:1.14 --- src/lib/libquota/quotapvt.h:1.13 Wed Feb 1 05:34:41 2012 +++ src/lib/libquota/quotapvt.h Wed Feb 1 05:46:46 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: quotapvt.h,v 1.13 2012/02/01 05:34:41 dholland Exp $ */ +/* $NetBSD: quotapvt.h,v 1.14 2012/02/01 05:46:46 dholland Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -56,9 +56,9 @@ struct quotacursor { /* new non-proplib kernel interface */ const char *__quota_kernel_getimplname(struct quotahandle *); unsigned __quota_kernel_getrestrictions(struct quotahandle *); -unsigned __quota_kernel_getnumidtypes(struct quotahandle *); +int __quota_kernel_getnumidtypes(struct quotahandle *); const char *__quota_kernel_idtype_getname(struct quotahandle *, int idtype); -unsigned __quota_kernel_getnumobjtypes(struct quotahandle *); +int __quota_kernel_getnumobjtypes(struct quotahandle *); const char *__quota_kernel_objtype_getname(struct quotahandle *, int objtype); int __quota_kernel_objtype_isbytes(struct quotahandle *, int objtype); int __quota_kernel_quotaon(struct quotahandle *, int idtype); @@ -73,14 +73,14 @@ void __quota_kernel_cursor_destroy(struc struct kernel_quotacursor *); int __quota_kernel_cursor_skipidtype(struct quotahandle *, struct kernel_quotacursor *, - unsigned idtype); + int idtype); int __quota_kernel_cursor_get(struct quotahandle *, struct kernel_quotacursor *, struct quotakey *, struct quotaval *); int __quota_kernel_cursor_getn(struct quotahandle *, struct kernel_quotacursor *, struct quotakey *, struct quotaval *, - unsigned); + unsigned maxnum); int __quota_kernel_cursor_atend(struct quotahandle *, struct kernel_quotacursor *); int __quota_kernel_cursor_rewind(struct quotahandle *, @@ -108,7 +108,7 @@ struct oldfiles_quotacursor * __quota_oldfiles_cursor_create(struct quotahandle *); void __quota_oldfiles_cursor_destroy(struct oldfiles_quotacursor *); int __quota_oldfiles_cursor_skipidtype(struct oldfiles_quotacursor *, - unsigned idtype); + int idtype); int __quota_oldfiles_cursor_get(struct quotahandle *, struct oldfiles_quotacursor *, struct quotakey *, struct quotaval *); Index: src/sys/compat/netbsd32/netbsd32.h diff -u src/sys/compat/netbsd32/netbsd32.h:1.91 src/sys/compat/netbsd32/netbsd32.h:1.92 --- src/sys/compat/netbsd32/netbsd32.h:1.91 Wed Feb 1 05:43:54 2012 +++ src/sys/compat/netbsd32/netbsd32.h Wed Feb 1 05:46:46 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: netbsd32.h,v 1.91 2012/02/01 05:43:54 dholland Exp $ */ +/* $NetBSD: netbsd32.h,v 1.92 2012/02/01 05:46:46 dholland Exp $ */ /* * Copyright (c) 1998, 2001, 2008 Matthew R. Green @@ -303,7 +303,7 @@ struct netbsd32_quotactlargs { } cursorclose; struct { netbsd32_pointer_t qc_cursor; - unsigned qc_idtype; + int qc_idtype; } cursorskipidtype; struct { netbsd32_pointer_t qc_cursor; Index: src/sys/kern/vfs_syscalls.c diff -u src/sys/kern/vfs_syscalls.c:1.446 src/sys/kern/vfs_syscalls.c:1.447 --- src/sys/kern/vfs_syscalls.c:1.446 Wed Feb 1 05:43:54 2012 +++ src/sys/kern/vfs_syscalls.c Wed Feb 1 05:46:45 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_syscalls.c,v 1.446 2012/02/01 05:43:54 dholland Exp $ */ +/* $NetBSD: vfs_syscalls.c,v 1.447 2012/02/01 05:46:45 dholland Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -70,7 +70,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.446 2012/02/01 05:43:54 dholland Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls.c,v 1.447 2012/02/01 05:46:45 dholland Exp $"); #ifdef _KERNEL_OPT #include "opt_fileassoc.h" @@ -771,7 +771,7 @@ do_sys_quotactl_cursorskipidtype(struct static int do_sys_quotactl_cursorget(struct mount *mp, struct quotakcursor *cursor_u, struct quotakey *keys_u, struct quotaval *vals_u, unsigned maxnum, - int *ret_u) + unsigned *ret_u) { #define CGET_STACK_MAX 8 struct quotakcursor cursor_k; @@ -779,7 +779,7 @@ do_sys_quotactl_cursorget(struct mount * struct quotaval stackvals[CGET_STACK_MAX]; struct quotakey *keys_k; struct quotaval *vals_k; - int ret_k; + unsigned ret_k; int error; if (maxnum > 128) { Index: src/sys/sys/quotactl.h diff -u src/sys/sys/quotactl.h:1.34 src/sys/sys/quotactl.h:1.35 --- src/sys/sys/quotactl.h:1.34 Wed Feb 1 05:43:54 2012 +++ src/sys/sys/quotactl.h Wed Feb 1 05:46:45 2012 @@ -1,4 +1,4 @@ -/* $NetBSD: quotactl.h,v 1.34 2012/02/01 05:43:54 dholland Exp $ */ +/* $NetBSD: quotactl.h,v 1.35 2012/02/01 05:46:45 dholland Exp $ */ /*- * Copyright (c) 2011 The NetBSD Foundation, Inc. * All rights reserved. @@ -47,8 +47,8 @@ */ struct quotastat { char qs_implname[QUOTA_NAMELEN]; - unsigned qs_numidtypes; - unsigned qs_numobjtypes; + int qs_numidtypes; + int qs_numobjtypes; unsigned qs_restrictions; /* semantic restriction codes */ }; @@ -127,7 +127,7 @@ struct quotactl_args { } cursorclose; struct { struct quotakcursor *qc_cursor; - unsigned qc_idtype; + int qc_idtype; } cursorskipidtype; struct { struct quotakcursor *qc_cursor;