Update of /cvsroot/cerber/cerb-ng/kcerb In directory sc8-pr-cvs1:/tmp/cvs-serv30776 Modified Files: Makefile cerb_action.c cerb_action.h cerb_addons.c cerb_fdesc.c cerb_lock.c cerb_macros.h cerb_main.c cerb_math.c cerb_operations.master cerb_string.c cerb_sysctl.c cerb_sysctl.h cerb_tests.c cerb_trace.c cerb_tree.c cerb_types.h cerb_urules.c make_const.sh make_operations.sh make_types.sh Log Message: - Made code WARNS 1 clean. That's all we can do, because of warnings in #includes. - Show if compiling cerb for UP or SMP machine. Cerb will be compiled for SMP machine on UP machine when WITH_SMP=yes is given, cerb also could be compiled for UP machine on SMP machine - there have to be WITHOUT_SMP=yes given. Index: Makefile =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/Makefile,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- Makefile 29 Jun 2003 16:46:16 -0000 1.44 +++ Makefile 29 Jun 2003 20:50:43 -0000 1.45 @@ -7,8 +7,12 @@ # KMOD= cerb + NCPU!= /sbin/sysctl -n hw.ncpu +CFLAGS+=-Icontrib +CWARNFLAGS+=-Werror +WARNS= 1 cerb_operations.h: cerb_operations.master make_operations.sh sh make_operations.sh @@ -77,8 +81,6 @@ cerb_const.h \ cerb_sysctl.c \ cerb_sysctl.h \ - cerb_dev.c \ - cerb_dev.h \ cerb_trace.c \ cerb_trace.h \ freebsd_syscalls.c \ @@ -86,12 +88,48 @@ contrib/strlcpy.c \ contrib/basename.c \ contrib/dirname.c - -CFLAGS= -Werror -Icontrib +# cerb_dev.c +# cerb_dev.h .if ${NCPU} > 1 +.ifndef (WITHOUT_SMP) CFLAGS+=-DSMP -DAPIC_IO -.endif +.BEGIN: + @echo + @echo SMP machine detected. Cerb will be compiled with SMP support. + @echo +.END: + @echo + @echo Cerb has been compiled with SMP support. +.else # WITHOUT_SMP +.BEGIN: + @echo + @echo SMP machine detected, but cerb will be compiled for UP machine on request. + @echo +.END: + @echo + @echo Cerb has been compiled for UP machine on request. +.endif # WITHOUT_SMP +.else # NCPU == 1 +.ifndef (WITH_SMP) +.BEGIN: + @echo + @echo UP machine detected. Cerb will be compiled for UP machine. + @echo +.END: + @echo + @echo Cerb has been compiled for UP machine. +.else # WITH_SMP +CFLAGS+=-DSMP -DAPIC_IO +.BEGIN: + @echo + @echo UP machine detected, but cerb will be compiled with SMP support on request. + @echo +.END: + @echo + @echo Cerb has been compiled with SMP support on request. +.endif # WITH_SMP +.endif # NCPU == 1 CLEANFILES= cerb_operations.c \ cerb_operations.h \ Index: cerb_action.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_action.c,v retrieving revision 1.119 retrieving revision 1.120 diff -u -d -r1.119 -r1.120 --- cerb_action.c 29 Jun 2003 16:40:53 -0000 1.119 +++ cerb_action.c 29 Jun 2003 20:50:43 -0000 1.120 @@ -90,6 +90,8 @@ fcb_op_tmp(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + MCB_DEBUG("Operation %s is not implemented yet.\n", tcb_opname[fun]); } @@ -109,6 +111,8 @@ fcb_op_nofun(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals > 0) { retv->v_id = v[0]->v_id; retv->v_type = v[0]->v_type; @@ -137,6 +141,8 @@ u_int i, nv; int error; + CB_SHUTUP_COMPILER(); + if (nvals < 2) { MCB_XCONFERR(th, EINVAL, "Too few arguments: %u (should be " "more than %u.", nvals, 1); @@ -227,6 +233,8 @@ fcb_op_chgsign(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -260,6 +268,8 @@ register struct scb_val *val; u_int i; + CB_SHUTUP_COMPILER(); + if (nvals < 2) { MCB_XCONFERR(th, EINVAL, "Too few arguments: %u (should be " "more than %u.", nvals, 1); @@ -288,6 +298,8 @@ { dcb_math **ftab; + CB_SHUTUP_COMPILER(); + if (nvals < 2) { MCB_XCONFERR(th, EINVAL, "Too few arguments: %u (should be " "more than %u.", nvals, 1); @@ -325,6 +337,8 @@ fcb_op_call(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals != 0) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(no arguments required).", nvals); @@ -357,6 +371,8 @@ register_t *args; u_int scallno, nargs, i; + CB_SHUTUP_COMPILER(); + if (nvals <= 0) { MCB_XCONFERR(th, EINVAL, "Too few arguments: %u (should be " "more than %u.", nvals, 0); @@ -440,6 +456,8 @@ struct pcred *pc; struct ucred *cred, *oldcred; + CB_SHUTUP_COMPILER(); + if (nvals == 0) { euid = UID_ROOT; } else if (nvals == 1) { @@ -482,6 +500,8 @@ fcb_op_return(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -520,6 +540,8 @@ { enum uio_seg sflag; + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -562,6 +584,8 @@ enum uio_seg sflag; int error; + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -692,6 +716,8 @@ struct scb_val *val; u_int i; + CB_SHUTUP_COMPILER(); + retv->v_id = ECB_CONST_I; retv->v_size = 0; @@ -956,7 +982,7 @@ for (i = 0; pc->pc_ucred->cr_groups[i] != val->v_uval; ++i) ; pc->pc_ucred = crcopy(pc->pc_ucred); - for (; i < pc->pc_ucred->cr_ngroups; ++i) { + for (; i < (u_int)pc->pc_ucred->cr_ngroups; ++i) { pc->pc_ucred->cr_groups[i] = pc->pc_ucred->cr_groups[i + 1]; } @@ -1034,6 +1060,8 @@ register struct proc *proc; int error; + CB_SHUTUP_COMPILER(); + retv->v_id = ECB_CONST_I; retv->v_size = 0; @@ -1174,6 +1202,8 @@ struct proc *proc; struct prison *pr; + CB_SHUTUP_COMPILER(); + retv->v_id = ECB_CONST_I; retv->v_size = 0; @@ -1292,6 +1322,8 @@ struct vnode *vnp; int fd, error; + CB_SHUTUP_COMPILER(); + retv->v_id = ECB_CONST_I; retv->v_size = 0; @@ -1393,6 +1425,8 @@ enum uio_seg sflag; int error; + CB_SHUTUP_COMPILER(); + if (nvals != 2) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 2); @@ -1444,6 +1478,8 @@ u_int type, plen; int error; + CB_SHUTUP_COMPILER(); + if (nvals == 1) { new = NULL; newlen = 0; @@ -1626,6 +1662,8 @@ { int error; + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -1658,6 +1696,8 @@ fcb_op_isnull(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -1680,6 +1720,8 @@ fcb_op_null(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -1710,6 +1752,8 @@ char **envv; char *envp, *pattern; + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -1783,6 +1827,8 @@ { u_int type; + CB_SHUTUP_COMPILER(); + if (nvals != 2) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 2); @@ -1866,6 +1912,8 @@ fcb_op_gettabsize(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -1896,6 +1944,8 @@ u_int start, n, end; size_t elemsize; + CB_SHUTUP_COMPILER(); + if (nvals != 2 && nvals != 3) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u or %u).", nvals, 2, 3); @@ -2016,6 +2066,8 @@ { register u_int i; + CB_SHUTUP_COMPILER(); + if (nvals != 2) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 2); @@ -2113,6 +2165,8 @@ register u_int i, j, max; int after; + CB_SHUTUP_COMPILER(); + MCB_ASSERT(fun == CB_ADDELEM_O, "Invalid operation here: %s.", tcb_opname[fun]); if (nvals != 2 && nvals != 3) { @@ -2171,7 +2225,7 @@ after = v[2]->v_val; if (after < 0) after = -1; - else if (after >= val->v_size) + else if ((u_int)after >= val->v_size) after = val->v_size - 1; } else /* if (nvals == 2) */ { after = val->v_size - 1; @@ -2181,7 +2235,7 @@ size_t strsize; char **strp; - if (after == val->v_size - 1) + if (after == (int)val->v_size - 1) --after; strp = retv->v_strp = fcb_malloc(sizeof(char *) * retv->v_size); fcb_mtemp_add(th, strp); @@ -2197,7 +2251,7 @@ strp[i] = fcb_malloc(strsize); fcb_mtemp_add(th, strp[i]); strlcpy(strp[i], val->v_strp[j], strsize); - if (i == after) + if (i == (u_int)after) ++i; } strp[i] = NULL; @@ -2212,7 +2266,7 @@ i = (after < 0) ? 1 : 0; for (j = 0; j < val->v_size; ++i, ++j) { retv->v_valp[i] = val->v_valp[j]; - if (i == after) + if (i == (u_int)after) ++i; } #ifdef CB_INVARIANTS @@ -2232,6 +2286,8 @@ register u_int i, j; u_int elem; + CB_SHUTUP_COMPILER(); + MCB_ASSERT(fun == CB_RMELEM_O, "Invalid operation here: %s.", tcb_opname[fun]); if (nvals != 2) { @@ -2327,6 +2383,8 @@ { char *buf; + CB_SHUTUP_COMPILER(); + if (nvals < 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be more than %u).", nvals, 0); @@ -2358,6 +2416,8 @@ { char *buf; + CB_SHUTUP_COMPILER(); + if (nvals < 2) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be more than %u).", nvals, 1); @@ -2396,6 +2456,8 @@ fcb_op_ask(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals < 3) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be more than %u).", nvals, 2); @@ -2429,6 +2491,8 @@ fcb_op_getfamily(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -2463,6 +2527,8 @@ { struct sockaddr_in *sin; + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -2501,6 +2567,8 @@ struct sockaddr_in *sin; struct sockaddr_in6 *sin6; + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -2544,6 +2612,8 @@ { struct sockaddr_un *sun; + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -2582,6 +2652,8 @@ fcb_op_logic(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + MCB_ASSERT(0, "Operation %s shouldn't be called in this way.", tcb_opname[fun]); } @@ -2593,6 +2665,8 @@ fcb_op_neg(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -2634,6 +2708,8 @@ register int ret; register u_int i; + CB_SHUTUP_COMPILER(); + if (nvals < 2) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be more than %u).", nvals, 1); @@ -2691,6 +2767,8 @@ fcb_op_roll(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals != 2) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 2); @@ -2853,6 +2931,8 @@ fcb_op_mod(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals != 2) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 2); @@ -2885,6 +2965,8 @@ fcb_op_trace(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + #ifndef CERB_TRACE MCB_XCONFERR(th, EOPNOTSUPP, "Trace functionality not avaliable. " "Recompile cerb with CERB_TRACE."); @@ -2907,9 +2989,11 @@ * Operation returns argument's type. */ void -fcb_op_typesize(CB_OPARGS) +fcb_op_type_or_size(CB_OPARGS) { + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -2941,6 +3025,8 @@ int error; size_t size; + CB_SHUTUP_COMPILER(); + if (nvals != 1) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u).", nvals, 1); @@ -2984,12 +3070,16 @@ fcb_op_crsysctl(CB_OPARGS) { #ifndef CERB_USERSYSCTL + CB_SHUTUP_COMPILER(); + MCB_XCONFERR(th, EOPNOTSUPP, "User sysctl functionality not avaliable. " "Recompile cerb with CERB_USERSYSCTL."); #else /* CERB_USERSYSCTL */ struct scb_val val, *valp; int type, flags; + CB_SHUTUP_COMPILER(); + if (nvals < 1 || nvals > 3) { MCB_XCONFERR(th, EINVAL, "Invalid number of arguments: %u " "(should be %u, %u or %u).", nvals, 1, 2, 3); @@ -3048,6 +3138,8 @@ void fcb_op_rmsysctl(CB_OPARGS) { + + CB_SHUTUP_COMPILER(); #ifndef CERB_USERSYSCTL MCB_XCONFERR(th, EOPNOTSUPP, "User sysctl functionality not avaliable. " Index: cerb_action.h =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_action.h,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- cerb_action.h 26 Jun 2003 22:34:42 -0000 1.51 +++ cerb_action.h 29 Jun 2003 20:50:44 -0000 1.52 @@ -21,6 +21,14 @@ u_int nvals, register struct scb_val *retv, \ u_int fun +#define CB_SHUTUP_COMPILER() while (0) { \ + th = th; \ + v = v; \ + nvals = nvals; \ + retv = retv; \ + fun = fun; \ +} + void fcb_regfree(struct scb_thdata *th, u_int no); #endif /* _KERNEL */ Index: cerb_addons.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_addons.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- cerb_addons.c 29 Jun 2003 16:40:53 -0000 1.32 +++ cerb_addons.c 29 Jun 2003 20:50:44 -0000 1.33 @@ -277,7 +277,7 @@ oidp = SLIST_FIRST(&sysctl__children); for (i = 0; oidp != NULL && i < namelen; ) { - if (oidp->oid_number == name[i]) { + if (oidp->oid_number == (int)name[i]) { ++i; if (*buf == '\0') { strlcpy(buf, oidp->oid_name, bufsiz); Index: cerb_fdesc.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_fdesc.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- cerb_fdesc.c 29 Jun 2003 16:40:53 -0000 1.14 +++ cerb_fdesc.c 29 Jun 2003 20:50:44 -0000 1.15 @@ -103,7 +103,7 @@ #ifdef CB_DEBUG_FDESC MCB_DEBUG("Fdesc add: [%s] (name=%s)(nfd=%u).", p->p_comm, name, nfd); #endif - if (nfd >= p->p_fd->fd_nfiles || p->p_fd->fd_ofiles[nfd] == NULL) + if ((int)nfd >= p->p_fd->fd_nfiles || p->p_fd->fd_ofiles[nfd] == NULL) return (EINVAL); error = 0; @@ -277,7 +277,7 @@ register struct file *fp; char *out; - if (nfd >= p->p_fd->fd_nfiles || p->p_fd->fd_ofiles[nfd] == NULL) { + if ((int)nfd >= p->p_fd->fd_nfiles || p->p_fd->fd_ofiles[nfd] == NULL) { #ifdef CB_DEBUG_FDESC MCB_DEBUG("Fdesc getname: [%s] Too big descriptor number " "(nfiles=%u)(nfd=%u).", p->p_comm, p->p_fd->fd_nfiles, Index: cerb_lock.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_lock.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- cerb_lock.c 18 Jun 2003 17:34:55 -0000 1.13 +++ cerb_lock.c 29 Jun 2003 20:50:44 -0000 1.14 @@ -79,7 +79,11 @@ } void +#ifdef CB_DEBUG_LOCK fcb_unlock(struct proc *p, struct scb_lock *lk, char *info) +#else +fcb_unlock(struct proc *p, struct scb_lock *lk, char *info __unused) +#endif { if (lk->lk_stat == CB_UNLOCKED_LK) Index: cerb_macros.h =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_macros.h,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- cerb_macros.h 29 Jun 2003 14:42:59 -0000 1.40 +++ cerb_macros.h 29 Jun 2003 20:50:44 -0000 1.41 @@ -65,7 +65,7 @@ * This macro checks if given space is in vmspace of current process. */ static __inline int -icb_validspace(struct proc *p, void *addr, size_t size) +icb_validspace(void *addr, size_t size) { char buf; @@ -76,7 +76,7 @@ return (0); } } -#define MCB_VALIDSPACE(p, addr, size) icb_validspace(p, addr, size) +#define MCB_VALIDSPACE(addr, size) icb_validspace(addr, size) /* * This macro returns number of arguments for specified syscall. Index: cerb_main.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_main.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- cerb_main.c 28 Jun 2003 06:59:49 -0000 1.39 +++ cerb_main.c 29 Jun 2003 20:50:44 -0000 1.40 @@ -31,7 +31,9 @@ #include "cerb_gregs.h" #include "cerb_fdesc.h" #include "cerb_ask.h" +#if 0 #include "cerb_dev.h" +#endif static void @@ -61,7 +63,6 @@ static int offset = NO_SYSCALL; static int -/* ARGSUSED */ load(struct module *module __unused, int cmd, void *arg __unused) { int error = 0; @@ -81,7 +82,7 @@ fcb_scall_cache(); fcb_rule_init(); fcb_ask_init(); -#if 1 +#if 0 fcb_dev_init(); #endif log(LOG_INFO, "CerbNG %s-%u loaded.\n", CB_VERSION_G, @@ -97,9 +98,11 @@ error = fcb_ask_clear(); if (error != 0) break; +#if 0 error = fcb_dev_clear(); if (error != 0) break; +#endif fcb_scall_restore(); fcb_fdesc_clear(); fcb_rule_clear(); Index: cerb_math.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_math.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- cerb_math.c 29 Jun 2003 16:40:53 -0000 1.7 +++ cerb_math.c 29 Jun 2003 20:50:44 -0000 1.8 @@ -84,8 +84,9 @@ int -fcb_math_invalid(struct scb_thdata *th, u_int op, register struct scb_val **v, - u_int nvals, struct scb_val *retv) +fcb_math_invalid(struct scb_thdata *th, u_int op, + register struct scb_val **v __unused, u_int nvals __unused, + struct scb_val *retv __unused) { MCB_XCONFERR(th, EINVAL, "Operation %s isn't permited for given type.", @@ -93,8 +94,8 @@ } int -fcb_math_add_str(struct scb_thdata *th, u_int op, register struct scb_val **v, - u_int nvals, struct scb_val *retv) +fcb_math_add_str(struct scb_thdata *th, u_int op __unused, + register struct scb_val **v, u_int nvals, struct scb_val *retv) { char *str; size_t size; @@ -131,8 +132,8 @@ } int -fcb_math_add_strptr(struct scb_thdata *th, u_int op, register struct scb_val **v, - u_int nvals, struct scb_val *retv) +fcb_math_add_strptr(struct scb_thdata *th, u_int op __unused, + register struct scb_val **v, u_int nvals, struct scb_val *retv) { char **strp; size_t size; @@ -210,8 +211,8 @@ } int -fcb_math_add_def(struct scb_thdata *th, u_int op, register struct scb_val **v, - u_int nvals, struct scb_val *retv) +fcb_math_add_def(struct scb_thdata *th, u_int op __unused, + register struct scb_val **v, u_int nvals, struct scb_val *retv) { u_int i; int out; @@ -236,8 +237,8 @@ } int -fcb_math_add_defptr(struct scb_thdata *th, u_int op, register struct scb_val **v, - u_int nvals, struct scb_val *retv) +fcb_math_add_defptr(struct scb_thdata *th, u_int op __unused, + register struct scb_val **v, u_int nvals, struct scb_val *retv) { int *valp; size_t size; @@ -302,8 +303,8 @@ } int -fcb_math_sub_def(struct scb_thdata *th, u_int op, register struct scb_val **v, - u_int nvals, struct scb_val *retv) +fcb_math_sub_def(struct scb_thdata *th, u_int op __unused, + register struct scb_val **v, u_int nvals, struct scb_val *retv) { u_int i; int out; @@ -328,8 +329,8 @@ } int -fcb_math_mul_def(struct scb_thdata *th, u_int op, register struct scb_val **v, - u_int nvals, struct scb_val *retv) +fcb_math_mul_def(struct scb_thdata *th, u_int op __unused, + register struct scb_val **v, u_int nvals, struct scb_val *retv) { u_int i; int out; @@ -354,8 +355,8 @@ } int -fcb_math_div_def(struct scb_thdata *th, u_int op, register struct scb_val **v, - u_int nvals, struct scb_val *retv) +fcb_math_div_def(struct scb_thdata *th, u_int op __unused, + register struct scb_val **v, u_int nvals, struct scb_val *retv) { u_int i; int out; Index: cerb_operations.master =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_operations.master,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- cerb_operations.master 28 Jun 2003 06:59:49 -0000 1.41 +++ cerb_operations.master 29 Jun 2003 20:50:44 -0000 1.42 @@ -144,8 +144,8 @@ "getip" getip GETIP "getunpath" getunpath GETUNPATH "trace" trace TRACE -"type" typesize TYPE -"size" typesize SIZE +"type" type_or_size TYPE +"size" type_or_size SIZE "basename" basedirname BASENAME "dirname" basedirname DIRNAME "crsysctl" crsysctl CRSYSCTL Index: cerb_string.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_string.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- cerb_string.c 29 Jun 2003 16:40:53 -0000 1.31 +++ cerb_string.c 29 Jun 2003 20:50:44 -0000 1.32 @@ -532,7 +532,7 @@ nlb = fcb_vprintf_str(buf, size, nlb, "\", \""); } nlb = fcb_vprintf_str(buf, size, nlb, val->v_strp[i]); - if (tsize == val->v_size - 1) + if (tsize == (int)val->v_size - 1) nlb = fcb_vprintf_str(buf, size, nlb, "\" ]"); else { nlb = fcb_vprintf_str(buf, size, nlb, Index: cerb_sysctl.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_sysctl.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- cerb_sysctl.c 29 Jun 2003 14:42:59 -0000 1.32 +++ cerb_sysctl.c 29 Jun 2003 20:50:44 -0000 1.33 @@ -92,6 +92,8 @@ int error; u_int lockrules; + CB_SYSCTL_SHUTUP_COMPILER(); + lockrules = ccb_lock; error = sysctl_handle_int(oidp, &lockrules, 0, req); if (error != 0 || req->newptr == NULL) @@ -115,6 +117,8 @@ { int error, ntab; + CB_SYSCTL_SHUTUP_COMPILER(); + ntab = ccb_ntab; error = sysctl_handle_int(oidp, &ntab, 0, req); if (error != 0 || req->newptr == NULL) @@ -133,6 +137,8 @@ { int error, ntab; + CB_SYSCTL_SHUTUP_COMPILER(); + ntab = ccb_ntab; error = sysctl_handle_int(oidp, &ntab, 0, req); if (error != 0 || req->newptr == NULL) @@ -153,6 +159,8 @@ { int error, ntab; + CB_SYSCTL_SHUTUP_COMPILER(); + ntab = ccb_ntab; error = sysctl_handle_int(oidp, &ntab, 0, req); if (error != 0 || req->newptr == NULL) @@ -173,6 +181,8 @@ { int error, ntab; + CB_SYSCTL_SHUTUP_COMPILER(); + ntab = ccb_ntab; error = sysctl_handle_int(oidp, &ntab, 0, req); if (error != 0 || req->newptr == NULL) @@ -191,6 +201,8 @@ { int error, n; + CB_SYSCTL_SHUTUP_COMPILER(); + MCB_THREAD_LOCK(); n = fcb_thread_count(); MCB_THREAD_UNLOCK(); @@ -210,6 +222,8 @@ int error; u_int memstat; + CB_SYSCTL_SHUTUP_COMPILER(); + memstat = 0; error = sysctl_handle_int(oidp, &memstat, 0, req); if (error != 0 || req->newptr == NULL) @@ -233,6 +247,8 @@ int error; u_int safe_malloc; + CB_SYSCTL_SHUTUP_COMPILER(); + safe_malloc = ccb_mem_safe_malloc; error = sysctl_handle_int(oidp, &safe_malloc, 0, req); if (error != 0 || req->newptr == NULL) @@ -265,6 +281,8 @@ int error; u_int memdebug; + CB_SYSCTL_SHUTUP_COMPILER(); + memdebug = ccb_mem_debug; error = sysctl_handle_int(oidp, &memdebug, 0, req); if (error != 0 || req->newptr == NULL) @@ -289,6 +307,8 @@ static char buf[256]; int error; + CB_SYSCTL_SHUTUP_COMPILER(); + *buf = '\0'; error = sysctl_handle_string(oidp, buf, sizeof buf, req); if (error != 0 || req->newptr == NULL || *buf == '\0') @@ -308,6 +328,8 @@ u_int stat; int error; + CB_SYSCTL_SHUTUP_COMPILER(); + stat = ccb_fdesc_stat; error = sysctl_handle_int(oidp, &stat, 0, req); if (error != 0 || req->newptr == NULL || stat == ccb_fdesc_stat) @@ -325,6 +347,8 @@ u_int clear; int error; + CB_SYSCTL_SHUTUP_COMPILER(); + clear = 0; error = sysctl_handle_int(oidp, &clear, 0, req); if (error != 0 || req->newptr == NULL) @@ -347,6 +371,8 @@ static char buf[256]; int error; + CB_SYSCTL_SHUTUP_COMPILER(); + *buf = '\0'; error = sysctl_handle_string(oidp, buf, sizeof buf, req); if (error != 0 || req->newptr == NULL || *buf == '\0') @@ -365,6 +391,8 @@ { int stat = 0, error; + CB_SYSCTL_SHUTUP_COMPILER(); + error = sysctl_handle_int(oidp, &stat, 0, req); if (error != 0 || req->newptr == NULL) return (error); @@ -385,6 +413,8 @@ int error; u_int trace_kind; + CB_SYSCTL_SHUTUP_COMPILER(); + trace_kind = ccb_trace_kind; error = sysctl_handle_int(oidp, &trace_kind, 0, req); if (error != 0 || req->newptr == NULL) @@ -411,6 +441,8 @@ int error; u_int trace_on_error; + CB_SYSCTL_SHUTUP_COMPILER(); + trace_on_error = ccb_trace_on_error; error = sysctl_handle_int(oidp, &trace_on_error, 0, req); if (error != 0 || req->newptr == NULL) @@ -437,6 +469,8 @@ { int error; u_int off_on_error; + + CB_SYSCTL_SHUTUP_COMPILER(); off_on_error = ccb_off_on_error; error = sysctl_handle_int(oidp, &off_on_error, 0, req); Index: cerb_sysctl.h =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_sysctl.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- cerb_sysctl.h 29 Jun 2003 14:42:59 -0000 1.5 +++ cerb_sysctl.h 29 Jun 2003 20:50:44 -0000 1.6 @@ -14,6 +14,14 @@ extern u_int ccb_off_on_error; +#define CB_SYSCTL_SHUTUP_COMPILER() while (0) { \ + oidp = oidp; \ + arg1 = arg1; \ + arg2 = arg2; \ + req = req; \ +} + + int fcb_sysctl_init(void); int fcb_sysctl_clear(void); Index: cerb_tests.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_tests.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- cerb_tests.c 1 May 2003 20:15:40 -0000 1.11 +++ cerb_tests.c 29 Jun 2003 20:50:44 -0000 1.12 @@ -38,8 +38,8 @@ u_int -fcb_tests_invalid(struct scb_thdata *th, u_int op, register struct scb_val *lv, - register struct scb_val *rv) +fcb_tests_invalid(struct scb_thdata *th, u_int op, + register struct scb_val *lv __unused, register struct scb_val *rv __unused) { MCB_XCONFERR(th, EINVAL, "Operation %s isn't permited for given type.", Index: cerb_trace.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_trace.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- cerb_trace.c 29 Jun 2003 16:40:53 -0000 1.9 +++ cerb_trace.c 29 Jun 2003 20:50:44 -0000 1.10 @@ -104,7 +104,7 @@ if (rule->r_true != NULL) { fcb_trace_show(th, rule->r_true, tabs + 1, labels_head); if (rule->r_false == NULL && CB_SHOW_TR()) { - register u_int i; + register int i; printf("%s", prefix); for (i = 0; i < tabs; ++i) @@ -114,7 +114,7 @@ } if (rule->r_false != NULL) { if (CB_SHOW_TR()) { - register u_int i; + register int i; printf("%s", prefix); for (i = 0; i < tabs; ++i) @@ -123,7 +123,7 @@ } fcb_trace_show(th, rule->r_false, tabs + 1, labels_head); if (CB_SHOW_TR()) { - register u_int i; + register int i; printf("%s", prefix); for (i = 0; i < tabs; ++i) Index: cerb_tree.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_tree.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- cerb_tree.c 29 Jun 2003 16:40:53 -0000 1.35 +++ cerb_tree.c 29 Jun 2003 20:50:44 -0000 1.36 @@ -257,7 +257,7 @@ MCB_PRINTF_L("%s: ", label); if (tabs > 0) { - for (i = 0; i < tabs; ++i) + for (i = 0; (int)i < tabs; ++i) MCB_PRINTF_L("%s", CB_TAB_TR); } @@ -385,18 +385,18 @@ fcb_tree_show(rule->r_true, tabs + 1, CB_RECURSE_TR, labels_head); if (rule->r_false == NULL) { - for (i = 0; i < tabs; ++i) + for (i = 0; (int)i < tabs; ++i) MCB_PRINTF_L("%s", CB_TAB_TR); MCB_PRINTF_L("}\n"); } } if (rule->r_false != NULL) { - for (i = 0; i < tabs; ++i) + for (i = 0; (int)i < tabs; ++i) MCB_PRINTF_L("%s", CB_TAB_TR); MCB_PRINTF_L("} else {\n"); fcb_tree_show(rule->r_false, tabs + 1, CB_RECURSE_TR, labels_head); - for (i = 0; i < tabs; ++i) + for (i = 0; (int)i < tabs; ++i) MCB_PRINTF_L("%s", CB_TAB_TR); MCB_PRINTF_L("}\n"); } Index: cerb_types.h =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_types.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- cerb_types.h 26 Jun 2003 22:34:42 -0000 1.8 +++ cerb_types.h 29 Jun 2003 20:50:44 -0000 1.9 @@ -16,8 +16,8 @@ #define CB_NARGS_G 9 /* Maximum number of syscall's arguments */ -extern char *tcb_idname[]; -extern char *tcb_typename[]; +extern const char *tcb_idname[]; +extern const char *tcb_typename[]; extern u_int tcb_argtype[SYS_MAXSYSCALL + 1][CB_NARGS_G]; Index: cerb_urules.c =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/cerb_urules.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- cerb_urules.c 29 Jun 2003 16:40:53 -0000 1.75 +++ cerb_urules.c 29 Jun 2003 20:50:44 -0000 1.76 @@ -251,7 +251,7 @@ MCB_DEBUG("Invalid syscall: %u.", scalls[i]); #endif } - if (ccb_ntab == ntab) { + if (ccb_ntab == (int)ntab) { MCB_GIANT_LOCK(); for (i = 0; i < SYS_MAXSYSCALL; ++i) { if (tcb_tabs[ntab].t_scalls[i]) @@ -290,7 +290,7 @@ fcb_usersysctl_clear(0); #ifdef CERB_INITRUN - if (ccb_ntab == ntab) + if (ccb_ntab == (int)ntab) fcb_syscalls(p, NULL); #endif return (0); @@ -368,7 +368,8 @@ if (urule->ur_true < 0) rule->r_true = NULL; - else if (urule->ur_true >= nrules || urule->ur_true == nrule) { + else if (urule->ur_true >= (int)nrules || + urule->ur_true == (int)nrule) { MCB_XERROR("Incorrect ,,true'' argument."); return (EINVAL); } else { @@ -377,7 +378,8 @@ if (urule->ur_false < 0) rule->r_false = NULL; - else if (urule->ur_false >= nrules || urule->ur_false == nrule) { + else if (urule->ur_false >= (int)nrules || + urule->ur_false == (int)nrule) { MCB_XERROR("Incorrect ,,false'' argument."); return (EINVAL); } else { @@ -386,7 +388,8 @@ if (urule->ur_next < 0) rule->r_next = NULL; - else if (urule->ur_next >= nrules || urule->ur_next == nrule) { + else if (urule->ur_next >= (int)nrules || + urule->ur_next == (int)nrule) { MCB_XERROR("Incorrect ,,next'' argument."); return (EINVAL); } else { @@ -700,8 +703,7 @@ rule->r_args[i].v_nreg = args[i].v_nreg; break; case ECB_FUN_I: - if (args[i].v_nrule < 0 || - args[i].v_nrule >= nrules || + if (args[i].v_nrule >= nrules || args[i].v_nrule == nrule) { MCB_XERROR("Incorrect v_val for ECB_FUN_I ID " "%d", i); Index: make_const.sh =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/make_const.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- make_const.sh 13 Mar 2003 01:03:26 -0000 1.4 +++ make_const.sh 29 Jun 2003 20:50:45 -0000 1.5 @@ -50,7 +50,7 @@ echo "/*" echo " * Names of local variables." echo " */" -echo "char *tcb_locname[] = {" +echo "const char *tcb_locname[] = {" } > $const_c egrep -v '^(#|$)' $master | awk '{ printf " \"%s\", /* ECB_%s_L */\n", $1, toupper($1) @@ -107,7 +107,7 @@ echo "#ifndef _CERB_CONST_H_" echo "#define _CERB_CONST_H_" echo -echo "extern char *tcb_locname[];" +echo "extern const char *tcb_locname[];" echo "extern u_int tcb_local2type[];" echo "#ifndef _KERNEL" echo "extern struct var_u2k var_u2k_map[];" Index: make_operations.sh =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/make_operations.sh,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- make_operations.sh 1 Apr 2003 09:49:40 -0000 1.14 +++ make_operations.sh 29 Jun 2003 20:50:45 -0000 1.15 @@ -53,7 +53,7 @@ echo "#ifdef _KERNEL" echo "extern dcb_op *tcb_op[];" echo "#endif /* _KERNEL */" -echo "extern char *tcb_opname[];" +echo "extern const char *tcb_opname[];" echo echo } >> $operations_h @@ -93,7 +93,7 @@ }' echo "#endif /* _KERNEL */" echo -echo "char *tcb_opname[] = {" +echo "const char *tcb_opname[] = {" } >> $operations_c { echo Index: make_types.sh =================================================================== RCS file: /cvsroot/cerber/cerb-ng/kcerb/make_types.sh,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- make_types.sh 12 Apr 2003 21:15:59 -0000 1.6 +++ make_types.sh 29 Jun 2003 20:50:45 -0000 1.7 @@ -53,7 +53,7 @@ sed 's/^ ECB_//' | \ sed 's/_I, .*//' | awk ' BEGIN { - printf "char *tcb_idname[] = {\n" + printf "const char *tcb_idname[] = {\n" } { printf " \"%s\",\n", $1 } END { @@ -68,7 +68,7 @@ sed 's/^#define CB_//' | \ sed 's/_T .*//' | awk ' BEGIN { - printf "char *tcb_typename[] = {\n" + printf "const char *tcb_typename[] = {\n" } { if ($1 == "MAXTYPE") { exit 0 |