diff options
author | dim <dim@FreeBSD.org> | 2015-06-01 06:54:21 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2015-06-01 06:54:21 +0000 |
commit | 8c2b6d93700b452fac3cadba57de1b18a783ec92 (patch) | |
tree | 6e8da4ceef4a7a36d46426497125611b2907ee1f /lib/libc | |
parent | b237d0308e74533064fa98d3f529f1b7eebd9e96 (diff) | |
parent | 2474a7a0d8a20e46cb41b5752822e3856e1f3bfb (diff) | |
download | FreeBSD-src-8c2b6d93700b452fac3cadba57de1b18a783ec92.zip FreeBSD-src-8c2b6d93700b452fac3cadba57de1b18a783ec92.tar.gz |
Merge ^/head r283771 through r283870.
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/arm/SYS.h | 4 | ||||
-rw-r--r-- | lib/libc/arm/aeabi/aeabi_asm_double.S | 10 | ||||
-rw-r--r-- | lib/libc/arm/aeabi/aeabi_asm_float.S | 10 | ||||
-rw-r--r-- | lib/libc/arm/gen/_setjmp.S | 14 | ||||
-rw-r--r-- | lib/libc/arm/gen/setjmp.S | 8 | ||||
-rw-r--r-- | lib/libc/arm/string/ffs.S | 1 | ||||
-rw-r--r-- | lib/libc/arm/string/memmove.S | 22 | ||||
-rw-r--r-- | lib/libc/arm/string/memset.S | 22 | ||||
-rw-r--r-- | lib/libc/arm/string/strcmp.S | 1 | ||||
-rw-r--r-- | lib/libc/arm/string/strlen.S | 4 | ||||
-rw-r--r-- | lib/libc/arm/string/strncmp.S | 3 | ||||
-rw-r--r-- | lib/libc/xdr/xdr.c | 134 | ||||
-rw-r--r-- | lib/libc/xdr/xdr_array.c | 23 | ||||
-rw-r--r-- | lib/libc/xdr/xdr_float.c | 4 | ||||
-rw-r--r-- | lib/libc/xdr/xdr_mem.c | 50 | ||||
-rw-r--r-- | lib/libc/xdr/xdr_rec.c | 98 | ||||
-rw-r--r-- | lib/libc/xdr/xdr_reference.c | 18 | ||||
-rw-r--r-- | lib/libc/xdr/xdr_sizeof.c | 29 | ||||
-rw-r--r-- | lib/libc/xdr/xdr_stdio.c | 37 |
19 files changed, 189 insertions, 303 deletions
diff --git a/lib/libc/arm/SYS.h b/lib/libc/arm/SYS.h index 3254c45..1173087 100644 --- a/lib/libc/arm/SYS.h +++ b/lib/libc/arm/SYS.h @@ -39,15 +39,11 @@ #include <sys/syscall.h> #include <machine/swi.h> -#ifdef __ARM_EABI__ #define SYSTRAP(x) \ mov ip, r7; \ ldr r7, =SYS_ ## x; \ swi 0; \ mov r7, ip -#else -#define SYSTRAP(x) swi 0 | SYS_ ## x -#endif #define CERROR _C_LABEL(cerror) #define CURBRK _C_LABEL(curbrk) diff --git a/lib/libc/arm/aeabi/aeabi_asm_double.S b/lib/libc/arm/aeabi/aeabi_asm_double.S index ab44362..7a5af82 100644 --- a/lib/libc/arm/aeabi/aeabi_asm_double.S +++ b/lib/libc/arm/aeabi/aeabi_asm_double.S @@ -56,7 +56,7 @@ ENTRY(__aeabi_cdcmple) cmp r0, #1 bne 1f /* Yes, clear Z and C */ - msr cpsr_c, #(0) + mov ip, #(0) b 99f 1: @@ -70,14 +70,15 @@ ENTRY(__aeabi_cdcmple) cmp r0, #1 bne 2f /* Yes, set Z and C */ - msr cpsr_c, #(PCR_Z | PCR_C) + mov ip, #(PCR_Z | PCR_C) b 99f 2: /* Not less than or equal, set C and clear Z */ - msr cpsr_c, #(PCR_C) + mov ip, #(PCR_C) 99: + msr cpsr_c, ip pop {r4, r5, r6, r7, ip, pc} END(__aeabi_cdcmple) @@ -112,6 +113,7 @@ ENTRY(__aeabi_cdcmpeq) RET 1: - msr cpsr_c, #(PCR_C) + mov ip, #(PCR_C) + msr cpsr_c, ip RET END(__aeabi_cdcmpeq) diff --git a/lib/libc/arm/aeabi/aeabi_asm_float.S b/lib/libc/arm/aeabi/aeabi_asm_float.S index bf32af7..e05daa5 100644 --- a/lib/libc/arm/aeabi/aeabi_asm_float.S +++ b/lib/libc/arm/aeabi/aeabi_asm_float.S @@ -54,7 +54,7 @@ ENTRY(__aeabi_cfcmple) cmp r0, #1 bne 1f /* Yes, clear Z and C */ - msr cpsr_c, #(0) + mov ip, #(0) b 99f 1: @@ -66,14 +66,15 @@ ENTRY(__aeabi_cfcmple) cmp r0, #1 bne 2f /* Yes, set Z and C */ - msr cpsr_c, #(PCR_Z | PCR_C) + mov ip, #(PCR_Z | PCR_C) b 99f 2: /* Not less than or equal, set C and clear Z */ - msr cpsr_c, #(PCR_C) + mov ip, #(PCR_C) 99: + msr cpsr_c, ip pop {r4, r5, ip, pc} END(__aeabi_cfcmple) @@ -103,6 +104,7 @@ ENTRY(__aeabi_cfcmpeq) RET 1: - msreq cpsr_c, #(PCR_C) + mov ip, #(PCR_C) + msr cpsr_c, ip RET END(__aeabi_cfcmpeq) diff --git a/lib/libc/arm/gen/_setjmp.S b/lib/libc/arm/gen/_setjmp.S index 3de9d99..853f61c 100644 --- a/lib/libc/arm/gen/_setjmp.S +++ b/lib/libc/arm/gen/_setjmp.S @@ -36,7 +36,7 @@ #error FPA is not supported anymore #endif -#if defined(__ARM_EABI__) && !defined(_STANDALONE) +#if !defined(_STANDALONE) .fpu vfp #endif @@ -61,7 +61,7 @@ __FBSDID("$FreeBSD$"); ENTRY(_setjmp) ldr r1, .L_setjmp_magic -#if defined(__ARM_EABI__) && !defined(_STANDALONE) +#if !defined(_STANDALONE) ldr r2, .Lfpu_present #ifdef PIC GOT_INIT(r3, .L_setjmp_got, .L_setjmp_gotinit) @@ -79,7 +79,7 @@ ENTRY(_setjmp) vmrs r2, fpscr str r2, [r0, #(_JB_REG_FPSCR * 4)] 1: -#endif /* __ARM_EABI__ */ +#endif /* !_STANDALONE */ str r1, [r0] @@ -99,11 +99,11 @@ END(_setjmp) .L_setjmp_magic: .word _JB_MAGIC__SETJMP -#if defined(__ARM_EABI__) && !defined(_STANDALONE) +#if !defined(_STANDALONE) GOT_INITSYM(.L_setjmp_got, .L_setjmp_gotinit) .Lfpu_present: .word PIC_SYM(_libc_arm_fpu_present, GOTOFF) -#endif /* __ARM_EABI__ */ +#endif /* !_STANDALONE */ WEAK_ALIAS(___longjmp, _longjmp) ENTRY(_longjmp) @@ -114,7 +114,7 @@ ENTRY(_longjmp) teq ip, r3 /* magic correct? */ bne botch /* no, botch */ -#if defined(__ARM_EABI__) && !defined(_STANDALONE) +#if !defined(_STANDALONE) teq r3, r2 /* did magic change? */ beq 1f /* no, don't restore VFP */ add ip, r0, #(_JB_REG_D8 * 4) @@ -122,7 +122,7 @@ ENTRY(_longjmp) ldr ip, [r0, #(_JB_REG_FPSCR * 4)] vmsr fpscr, ip 1: -#endif /* __ARM_EABI__ */ +#endif /* !_STANDALONE */ add r0, r0, #(_JB_REG_R4 * 4) /* Restore integer registers */ diff --git a/lib/libc/arm/gen/setjmp.S b/lib/libc/arm/gen/setjmp.S index 6269563..c9ae329 100644 --- a/lib/libc/arm/gen/setjmp.S +++ b/lib/libc/arm/gen/setjmp.S @@ -36,9 +36,7 @@ #error FPA is not supported anymore #endif -#ifdef __ARM_EABI__ .fpu vfp -#endif #include <machine/asm.h> #include <machine/setjmp.h> @@ -66,7 +64,6 @@ ENTRY(setjmp) ldr r1, .Lsetjmp_magic -#ifdef __ARM_EABI__ ldr r2, .Lfpu_present #ifdef PIC GOT_INIT(r3, .Lsetjmp_got, .Lsetjmp_gotinit) @@ -84,7 +81,6 @@ ENTRY(setjmp) vmrs r2, fpscr str r2, [r0, #(_JB_REG_FPSCR * 4)] 1: -#endif /* __ARM_EABI__ */ str r1, [r0] /* store magic */ @@ -102,11 +98,9 @@ ENTRY(setjmp) .Lsetjmp_magic: .word _JB_MAGIC_SETJMP -#ifdef __ARM_EABI__ GOT_INITSYM(.Lsetjmp_got, .Lsetjmp_gotinit) .Lfpu_present: .word PIC_SYM(_libc_arm_fpu_present, GOTOFF) -#endif /* __ARM_EABI__ */ END(setjmp) .weak _C_LABEL(longjmp) @@ -126,7 +120,6 @@ ENTRY(__longjmp) bl PIC_SYM(_C_LABEL(sigprocmask), PLT) ldmfd sp!, {r0-r2, r14} -#ifdef __ARM_EABI__ tst r2, #(_JB_MAGIC_SETJMP ^ _JB_MAGIC_SETJMP_VFP) /* is this a VFP magic? */ beq 1f /* no, don't restore VFP */ @@ -135,7 +128,6 @@ ENTRY(__longjmp) ldr ip, [r0, #(_JB_REG_FPSCR * 4)] vmsr fpscr, ip 1: -#endif /* __ARM_EABI__ */ add r0, r0, #(_JB_REG_R4 * 4) /* Restore integer registers */ diff --git a/lib/libc/arm/string/ffs.S b/lib/libc/arm/string/ffs.S index 4567f6c..cc7f396 100644 --- a/lib/libc/arm/string/ffs.S +++ b/lib/libc/arm/string/ffs.S @@ -78,6 +78,7 @@ ENTRY(ffs) .byte 31, 0, 0, 0, 0, 24, 0, 20 /* 48-55 */ .byte 30, 0, 23, 19, 29, 18, 17, 0 /* 56-63 */ #else + itt ne clzne r0, r0 rsbne r0, r0, #32 RET diff --git a/lib/libc/arm/string/memmove.S b/lib/libc/arm/string/memmove.S index 94e5474..2cd5a5e 100644 --- a/lib/libc/arm/string/memmove.S +++ b/lib/libc/arm/string/memmove.S @@ -48,7 +48,9 @@ ENTRY(bcopy) #endif /* Do the buffers overlap? */ cmp r0, r1 + it eq RETeq /* Bail now if src/dst are the same */ + ite cc subcc r3, r0, r1 /* if (dst > src) r3 = dst - src */ subcs r3, r1, r0 /* if (src > dsr) r3 = src - dst */ cmp r3, r2 /* if (r3 < len) we have an overlap */ @@ -56,8 +58,10 @@ ENTRY(bcopy) /* Determine copy direction */ cmp r1, r0 + it cc bcc .Lmemmove_backwards + itt eq moveq r0, #0 /* Quick abort for len=0 */ RETeq @@ -88,6 +92,7 @@ ENTRY(bcopy) bge .Lmemmove_floop32 cmn r2, #0x10 + ittt ge ldmiage r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ stmiage r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 @@ -98,6 +103,7 @@ ENTRY(bcopy) /* blat 12 bytes at a time */ .Lmemmove_floop12: + ittt ge ldmiage r1!, {r3, r12, lr} stmiage r0!, {r3, r12, lr} subsge r2, r2, #0x0c @@ -108,8 +114,10 @@ ENTRY(bcopy) blt .Lmemmove_fl4 subs r2, r2, #4 + itt lt ldrlt r3, [r1], #4 strlt r3, [r0], #4 + ittt ge ldmiage r1!, {r3, r12} stmiage r0!, {r3, r12} subge r2, r2, #4 @@ -117,14 +125,17 @@ ENTRY(bcopy) .Lmemmove_fl4: /* less than 4 bytes to go */ adds r2, r2, #4 + it eq ldmiaeq sp!, {r0, pc} /* done */ /* copy the crud byte at a time */ cmp r2, #2 ldrb r3, [r1], #1 strb r3, [r0], #1 + itt ge ldrbge r3, [r1], #1 strbge r3, [r0], #1 + itt gt ldrbgt r3, [r1], #1 strbgt r3, [r0], #1 ldmia sp!, {r0, pc} @@ -137,8 +148,10 @@ ENTRY(bcopy) /* align destination with byte copies */ ldrb r3, [r1], #1 strb r3, [r0], #1 + itt ge ldrbge r3, [r1], #1 strbge r3, [r0], #1 + itt gt ldrbgt r3, [r1], #1 strbgt r3, [r0], #1 subs r2, r2, r12 @@ -355,10 +368,12 @@ ENTRY(bcopy) .Lmemmove_bl32: cmn r2, #0x10 + ittt ge ldmdbge r1!, {r3, r4, r12, lr} /* blat a remaining 16 bytes */ stmdbge r0!, {r3, r4, r12, lr} subge r2, r2, #0x10 adds r2, r2, #0x14 + ittt ge ldmdbge r1!, {r3, r12, lr} /* blat a remaining 12 bytes */ stmdbge r0!, {r3, r12, lr} subge r2, r2, #0x0c @@ -368,8 +383,10 @@ ENTRY(bcopy) adds r2, r2, #8 blt .Lmemmove_bl4 subs r2, r2, #4 + itt lt ldrlt r3, [r1, #-4]! strlt r3, [r0, #-4]! + ittt ge ldmdbge r1!, {r3, r12} stmdbge r0!, {r3, r12} subge r2, r2, #4 @@ -377,14 +394,17 @@ ENTRY(bcopy) .Lmemmove_bl4: /* less than 4 bytes to go */ adds r2, r2, #4 + it eq RETeq /* done */ /* copy the crud byte at a time */ cmp r2, #2 ldrb r3, [r1, #-1]! strb r3, [r0, #-1]! + itt ge ldrbge r3, [r1, #-1]! strbge r3, [r0, #-1]! + itt gt ldrbgt r3, [r1, #-1]! strbgt r3, [r0, #-1]! RET @@ -396,8 +416,10 @@ ENTRY(bcopy) /* align destination with byte copies */ ldrb r3, [r1, #-1]! strb r3, [r0, #-1]! + itt ge ldrbge r3, [r1, #-1]! strbge r3, [r0, #-1]! + itt gt ldrbgt r3, [r1, #-1]! strbgt r3, [r0, #-1]! subs r2, r2, r12 diff --git a/lib/libc/arm/string/memset.S b/lib/libc/arm/string/memset.S index 66af33e..6d76901 100644 --- a/lib/libc/arm/string/memset.S +++ b/lib/libc/arm/string/memset.S @@ -114,6 +114,7 @@ ENTRY(memset) orr r3, r3, r3, lsl #16 /* Extend value to 32-bits */ #endif #ifdef _ARM_ARCH_5E + itt ne subne r1, r1, #0x04 /* Quad-align if necessary */ strne r3, [ip], #0x04 cmp r1, #0x10 @@ -127,18 +128,22 @@ ENTRY(memset) .Lmemset_loop128: subs r1, r1, #0x80 #ifdef _ARM_ARCH_5E + itttt ge strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 + itttt ge strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 + itttt ge strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 + itttt ge strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 @@ -162,6 +167,7 @@ ENTRY(memset) stmiage ip!, {r2-r3} #endif bgt .Lmemset_loop128 + it eq RETeq /* Zero length so just exit */ add r1, r1, #0x80 /* Adjust for extra sub */ @@ -169,6 +175,7 @@ ENTRY(memset) /* Do 32 bytes at a time */ .Lmemset_loop32: subs r1, r1, #0x20 + itttt ge #ifdef _ARM_ARCH_5E strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 @@ -181,11 +188,13 @@ ENTRY(memset) stmiage ip!, {r2-r3} #endif bgt .Lmemset_loop32 + it eq RETeq /* Zero length so just exit */ adds r1, r1, #0x10 /* Partially adjust for extra sub */ /* Deal with 16 bytes or more */ + itt ge #ifdef _ARM_ARCH_5E strdge r2, [ip], #0x08 strdge r2, [ip], #0x08 @@ -193,20 +202,25 @@ ENTRY(memset) stmiage ip!, {r2-r3} stmiage ip!, {r2-r3} #endif + it eq RETeq /* Zero length so just exit */ + it lt addlt r1, r1, #0x10 /* Possibly adjust for extra sub */ /* We have at least 4 bytes so copy as words */ .Lmemset_loop4: subs r1, r1, #0x04 + it ge strge r3, [ip], #0x04 bgt .Lmemset_loop4 + it eq RETeq /* Zero length so just exit */ #ifdef _ARM_ARCH_5E /* Compensate for 64-bit alignment check */ adds r1, r1, #0x04 + it eq RETeq cmp r1, #2 #else @@ -214,7 +228,9 @@ ENTRY(memset) #endif strb r3, [ip], #0x01 /* Set 1 byte */ + it ge strbge r3, [ip], #0x01 /* Set another byte */ + it gt strbgt r3, [ip] /* and a third */ RET /* Exit */ @@ -222,18 +238,24 @@ ENTRY(memset) rsb r2, r2, #0x004 strb r3, [ip], #0x01 /* Set 1 byte */ cmp r2, #0x02 + it ge strbge r3, [ip], #0x01 /* Set another byte */ sub r1, r1, r2 + it gt strbgt r3, [ip], #0x01 /* and a third */ cmp r1, #0x04 /* More than 4 bytes left? */ + it ge bge .Lmemset_wordaligned /* Yup */ .Lmemset_lessthanfour: cmp r1, #0x00 + it eq RETeq /* Zero length so exit */ strb r3, [ip], #0x01 /* Set 1 byte */ cmp r1, #0x02 + it ge strbge r3, [ip], #0x01 /* Set another byte */ + it gt strbgt r3, [ip] /* and a third */ RET /* Exit */ #ifdef _BZERO diff --git a/lib/libc/arm/string/strcmp.S b/lib/libc/arm/string/strcmp.S index 3dd7453..d610fea 100644 --- a/lib/libc/arm/string/strcmp.S +++ b/lib/libc/arm/string/strcmp.S @@ -37,6 +37,7 @@ ENTRY(strcmp) ldrb r2, [r0], #1 ldrb r3, [r1], #1 cmp r2, #1 + it cs cmpcs r2, r3 beq 1b sub r0, r2, r3 diff --git a/lib/libc/arm/string/strlen.S b/lib/libc/arm/string/strlen.S index 7447710..c9334f9 100644 --- a/lib/libc/arm/string/strlen.S +++ b/lib/libc/arm/string/strlen.S @@ -52,8 +52,10 @@ ENTRY(strlen) #else ands r3, r2, #0xff000000 #endif + it ne addne r1, r1, #1 .Ldo_3: + itt ne #ifndef __ARMEB__ andsne r3, r2, #0x0000ff00 #else @@ -61,6 +63,7 @@ ENTRY(strlen) #endif addne r1, r1, #1 .Ldo_2: + itt ne #ifndef __ARMEB__ andsne r3, r2, #0x00ff0000 #else @@ -68,6 +71,7 @@ ENTRY(strlen) #endif addne r1, r1, #1 .Ldo_1: + ittt ne #ifndef __ARMEB__ andsne r3, r2, #0xff000000 #else diff --git a/lib/libc/arm/string/strncmp.S b/lib/libc/arm/string/strncmp.S index ac59deb..a5c0320 100644 --- a/lib/libc/arm/string/strncmp.S +++ b/lib/libc/arm/string/strncmp.S @@ -35,18 +35,21 @@ __FBSDID("$FreeBSD$"); ENTRY(strncmp) /* if (len == 0) return 0 */ cmp r2, #0 + itt eq moveq r0, #0 moveq pc, lr /* ip == last src address to compare */ adds ip, r0, r2 /* Use last possible address on overflow. */ + it cs movcs ip, #0 sub ip, ip, #1 1: ldrb r2, [r0], #1 ldrb r3, [r1], #1 cmp ip, r0 + itt cs cmpcs r2, #1 cmpcs r2, r3 beq 1b diff --git a/lib/libc/xdr/xdr.c b/lib/libc/xdr/xdr.c index 4435119..4138171 100644 --- a/lib/libc/xdr/xdr.c +++ b/lib/libc/xdr/xdr.c @@ -76,9 +76,7 @@ static const char xdr_zero[BYTES_PER_XDR_UNIT] = { 0, 0, 0, 0 }; * Not a filter, but a convenient utility nonetheless */ void -xdr_free(proc, objp) - xdrproc_t proc; - void *objp; +xdr_free(xdrproc_t proc, void *objp) { XDR x; @@ -101,9 +99,7 @@ xdr_void(void) * XDR integers */ bool_t -xdr_int(xdrs, ip) - XDR *xdrs; - int *ip; +xdr_int(XDR *xdrs, int *ip) { long l; @@ -131,9 +127,7 @@ xdr_int(xdrs, ip) * XDR unsigned integers */ bool_t -xdr_u_int(xdrs, up) - XDR *xdrs; - u_int *up; +xdr_u_int(XDR *xdrs, u_int *up) { u_long l; @@ -163,9 +157,7 @@ xdr_u_int(xdrs, up) * same as xdr_u_long - open coded to save a proc call! */ bool_t -xdr_long(xdrs, lp) - XDR *xdrs; - long *lp; +xdr_long(XDR *xdrs, long *lp) { switch (xdrs->x_op) { case XDR_ENCODE: @@ -184,9 +176,7 @@ xdr_long(xdrs, lp) * same as xdr_long - open coded to save a proc call! */ bool_t -xdr_u_long(xdrs, ulp) - XDR *xdrs; - u_long *ulp; +xdr_u_long(XDR *xdrs, u_long *ulp) { switch (xdrs->x_op) { case XDR_ENCODE: @@ -206,9 +196,7 @@ xdr_u_long(xdrs, ulp) * same as xdr_u_int32_t - open coded to save a proc call! */ bool_t -xdr_int32_t(xdrs, int32_p) - XDR *xdrs; - int32_t *int32_p; +xdr_int32_t(XDR *xdrs, int32_t *int32_p) { long l; @@ -237,9 +225,7 @@ xdr_int32_t(xdrs, int32_p) * same as xdr_int32_t - open coded to save a proc call! */ bool_t -xdr_u_int32_t(xdrs, u_int32_p) - XDR *xdrs; - u_int32_t *u_int32_p; +xdr_u_int32_t(XDR *xdrs, u_int32_t *u_int32_p) { u_long l; @@ -268,9 +254,7 @@ xdr_u_int32_t(xdrs, u_int32_p) * same as xdr_int32_t - open coded to save a proc call! */ bool_t -xdr_uint32_t(xdrs, u_int32_p) - XDR *xdrs; - uint32_t *u_int32_p; +xdr_uint32_t(XDR *xdrs, uint32_t *u_int32_p) { u_long l; @@ -298,9 +282,7 @@ xdr_uint32_t(xdrs, u_int32_p) * XDR short integers */ bool_t -xdr_short(xdrs, sp) - XDR *xdrs; - short *sp; +xdr_short(XDR *xdrs, short *sp) { long l; @@ -328,9 +310,7 @@ xdr_short(xdrs, sp) * XDR unsigned short integers */ bool_t -xdr_u_short(xdrs, usp) - XDR *xdrs; - u_short *usp; +xdr_u_short(XDR *xdrs, u_short *usp) { u_long l; @@ -359,9 +339,7 @@ xdr_u_short(xdrs, usp) * XDR 16-bit integers */ bool_t -xdr_int16_t(xdrs, int16_p) - XDR *xdrs; - int16_t *int16_p; +xdr_int16_t(XDR *xdrs, int16_t *int16_p) { long l; @@ -389,9 +367,7 @@ xdr_int16_t(xdrs, int16_p) * XDR unsigned 16-bit integers */ bool_t -xdr_u_int16_t(xdrs, u_int16_p) - XDR *xdrs; - u_int16_t *u_int16_p; +xdr_u_int16_t(XDR *xdrs, u_int16_t *u_int16_p) { u_long l; @@ -419,9 +395,7 @@ xdr_u_int16_t(xdrs, u_int16_p) * XDR unsigned 16-bit integers */ bool_t -xdr_uint16_t(xdrs, u_int16_p) - XDR *xdrs; - uint16_t *u_int16_p; +xdr_uint16_t(XDR *xdrs, uint16_t *u_int16_p) { u_long l; @@ -450,9 +424,7 @@ xdr_uint16_t(xdrs, u_int16_p) * XDR a char */ bool_t -xdr_char(xdrs, cp) - XDR *xdrs; - char *cp; +xdr_char(XDR *xdrs, char *cp) { int i; @@ -468,9 +440,7 @@ xdr_char(xdrs, cp) * XDR an unsigned char */ bool_t -xdr_u_char(xdrs, cp) - XDR *xdrs; - u_char *cp; +xdr_u_char(XDR *xdrs, u_char *cp) { u_int u; @@ -486,9 +456,7 @@ xdr_u_char(xdrs, cp) * XDR booleans */ bool_t -xdr_bool(xdrs, bp) - XDR *xdrs; - bool_t *bp; +xdr_bool(XDR *xdrs, bool_t *bp) { long lb; @@ -516,9 +484,7 @@ xdr_bool(xdrs, bp) * XDR enumerations */ bool_t -xdr_enum(xdrs, ep) - XDR *xdrs; - enum_t *ep; +xdr_enum(XDR *xdrs, enum_t *ep) { enum sizecheck { SIZEVAL }; /* used to find the size of an enum */ @@ -542,10 +508,7 @@ xdr_enum(xdrs, ep) * cp points to the opaque object and cnt gives the byte length. */ bool_t -xdr_opaque(xdrs, cp, cnt) - XDR *xdrs; - caddr_t cp; - u_int cnt; +xdr_opaque(XDR *xdrs, caddr_t cp, u_int cnt) { u_int rndup; static int crud[BYTES_PER_XDR_UNIT]; @@ -594,11 +557,7 @@ xdr_opaque(xdrs, cp, cnt) * If *cpp is NULL maxsize bytes are allocated */ bool_t -xdr_bytes(xdrs, cpp, sizep, maxsize) - XDR *xdrs; - char **cpp; - u_int *sizep; - u_int maxsize; +xdr_bytes(XDR *xdrs, char **cpp, u_int *sizep, u_int maxsize) { char *sp = *cpp; /* sp is the actual string pointer */ u_int nodesize; @@ -650,9 +609,7 @@ xdr_bytes(xdrs, cpp, sizep, maxsize) * Implemented here due to commonality of the object. */ bool_t -xdr_netobj(xdrs, np) - XDR *xdrs; - struct netobj *np; +xdr_netobj(XDR *xdrs, struct netobj *np) { return (xdr_bytes(xdrs, &np->n_bytes, &np->n_len, MAX_NETOBJ_SZ)); @@ -670,12 +627,14 @@ xdr_netobj(xdrs, np) * If there is no specific or default routine an error is returned. */ bool_t -xdr_union(xdrs, dscmp, unp, choices, dfault) - XDR *xdrs; - enum_t *dscmp; /* enum to decide which arm to work on */ - char *unp; /* the union itself */ - const struct xdr_discrim *choices; /* [value, xdr proc] for each arm */ - xdrproc_t dfault; /* default xdr routine */ +xdr_union(XDR *xdrs, enum_t *dscmp, char *unp, const struct xdr_discrim *choices, xdrproc_t dfault) +/* + * XDR *xdrs; + * enum_t *dscmp; // enum to decide which arm to work on + * char *unp; // the union itself + * const struct xdr_discrim *choices; // [value, xdr proc] for each arm + * xdrproc_t dfault; // default xdr routine + */ { enum_t dscm; @@ -719,10 +678,7 @@ xdr_union(xdrs, dscmp, unp, choices, dfault) * of the string as specified by a protocol. */ bool_t -xdr_string(xdrs, cpp, maxsize) - XDR *xdrs; - char **cpp; - u_int maxsize; +xdr_string(XDR *xdrs, char **cpp, u_int maxsize) { char *sp = *cpp; /* sp is the actual string pointer */ u_int size; @@ -786,9 +742,7 @@ xdr_string(xdrs, cpp, maxsize) * routines like clnt_call */ bool_t -xdr_wrapstring(xdrs, cpp) - XDR *xdrs; - char **cpp; +xdr_wrapstring(XDR *xdrs, char **cpp) { return xdr_string(xdrs, cpp, LASTUNSIGNED); } @@ -805,9 +759,7 @@ xdr_wrapstring(xdrs, cpp) * XDR 64-bit integers */ bool_t -xdr_int64_t(xdrs, llp) - XDR *xdrs; - int64_t *llp; +xdr_int64_t(XDR *xdrs, int64_t *llp) { u_long ul[2]; @@ -838,9 +790,7 @@ xdr_int64_t(xdrs, llp) * XDR unsigned 64-bit integers */ bool_t -xdr_u_int64_t(xdrs, ullp) - XDR *xdrs; - u_int64_t *ullp; +xdr_u_int64_t(XDR *xdrs, u_int64_t *ullp) { u_long ul[2]; @@ -870,9 +820,7 @@ xdr_u_int64_t(xdrs, ullp) * XDR unsigned 64-bit integers */ bool_t -xdr_uint64_t(xdrs, ullp) - XDR *xdrs; - uint64_t *ullp; +xdr_uint64_t(XDR *xdrs, uint64_t *ullp) { u_long ul[2]; @@ -903,9 +851,7 @@ xdr_uint64_t(xdrs, ullp) * XDR hypers */ bool_t -xdr_hyper(xdrs, llp) - XDR *xdrs; - longlong_t *llp; +xdr_hyper(XDR *xdrs, longlong_t *llp) { /* @@ -920,9 +866,7 @@ xdr_hyper(xdrs, llp) * XDR unsigned hypers */ bool_t -xdr_u_hyper(xdrs, ullp) - XDR *xdrs; - u_longlong_t *ullp; +xdr_u_hyper(XDR *xdrs, u_longlong_t *ullp) { /* @@ -937,9 +881,7 @@ xdr_u_hyper(xdrs, ullp) * XDR longlong_t's */ bool_t -xdr_longlong_t(xdrs, llp) - XDR *xdrs; - longlong_t *llp; +xdr_longlong_t(XDR *xdrs, longlong_t *llp) { /* @@ -954,9 +896,7 @@ xdr_longlong_t(xdrs, llp) * XDR u_longlong_t's */ bool_t -xdr_u_longlong_t(xdrs, ullp) - XDR *xdrs; - u_longlong_t *ullp; +xdr_u_longlong_t(XDR *xdrs, u_longlong_t *ullp) { /* diff --git a/lib/libc/xdr/xdr_array.c b/lib/libc/xdr/xdr_array.c index 620155c..a11c7a1 100644 --- a/lib/libc/xdr/xdr_array.c +++ b/lib/libc/xdr/xdr_array.c @@ -64,13 +64,15 @@ __FBSDID("$FreeBSD$"); * xdr procedure to call to handle each element of the array. */ bool_t -xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) - XDR *xdrs; - caddr_t *addrp; /* array pointer */ - u_int *sizep; /* number of elements */ - u_int maxsize; /* max numberof elements */ - u_int elsize; /* size in bytes of each element */ - xdrproc_t elproc; /* xdr routine to handle each element */ +xdr_array(XDR *xdrs, caddr_t *addrp, u_int *sizep, u_int maxsize, u_int elsize, xdrproc_t elproc) +/* + * XDR *xdrs; + * caddr_t *addrp; // array pointer + * u_int *sizep; // number of elements + * u_int maxsize; // max numberof elements + * u_int elsize; // size in bytes of each element + * xdrproc_t elproc; // xdr routine to handle each element + */ { u_int i; caddr_t target = *addrp; @@ -142,12 +144,7 @@ xdr_array(xdrs, addrp, sizep, maxsize, elsize, elproc) * > xdr_elem: routine to XDR each element */ bool_t -xdr_vector(xdrs, basep, nelem, elemsize, xdr_elem) - XDR *xdrs; - char *basep; - u_int nelem; - u_int elemsize; - xdrproc_t xdr_elem; +xdr_vector(XDR *xdrs, char *basep, u_int nelem, u_int elemsize, xdrproc_t xdr_elem) { u_int i; char *elptr; diff --git a/lib/libc/xdr/xdr_float.c b/lib/libc/xdr/xdr_float.c index 1d3bb61..fc024fc 100644 --- a/lib/libc/xdr/xdr_float.c +++ b/lib/libc/xdr/xdr_float.c @@ -204,9 +204,7 @@ static struct dbl_limits { bool_t -xdr_double(xdrs, dp) - XDR *xdrs; - double *dp; +xdr_double(XDR *xdrs, double *dp) { #ifdef IEEEFP int32_t *i32p; diff --git a/lib/libc/xdr/xdr_mem.c b/lib/libc/xdr/xdr_mem.c index 70f79c6..0455a5a 100644 --- a/lib/libc/xdr/xdr_mem.c +++ b/lib/libc/xdr/xdr_mem.c @@ -98,11 +98,7 @@ static const struct xdr_ops xdrmem_ops_unaligned = { * memory buffer. */ void -xdrmem_create(xdrs, addr, size, op) - XDR *xdrs; - char *addr; - u_int size; - enum xdr_op op; +xdrmem_create(XDR *xdrs, char *addr, u_int size, enum xdr_op op) { xdrs->x_op = op; @@ -114,16 +110,13 @@ xdrmem_create(xdrs, addr, size, op) /*ARGSUSED*/ static void -xdrmem_destroy(xdrs) - XDR *xdrs; +xdrmem_destroy(XDR *xdrs) { } static bool_t -xdrmem_getlong_aligned(xdrs, lp) - XDR *xdrs; - long *lp; +xdrmem_getlong_aligned(XDR *xdrs, long *lp) { if (xdrs->x_handy < sizeof(int32_t)) @@ -135,9 +128,7 @@ xdrmem_getlong_aligned(xdrs, lp) } static bool_t -xdrmem_putlong_aligned(xdrs, lp) - XDR *xdrs; - const long *lp; +xdrmem_putlong_aligned(XDR *xdrs, const long *lp) { if (xdrs->x_handy < sizeof(int32_t)) @@ -149,9 +140,7 @@ xdrmem_putlong_aligned(xdrs, lp) } static bool_t -xdrmem_getlong_unaligned(xdrs, lp) - XDR *xdrs; - long *lp; +xdrmem_getlong_unaligned(XDR *xdrs, long *lp) { u_int32_t l; @@ -165,9 +154,7 @@ xdrmem_getlong_unaligned(xdrs, lp) } static bool_t -xdrmem_putlong_unaligned(xdrs, lp) - XDR *xdrs; - const long *lp; +xdrmem_putlong_unaligned(XDR *xdrs, const long *lp) { u_int32_t l; @@ -181,10 +168,7 @@ xdrmem_putlong_unaligned(xdrs, lp) } static bool_t -xdrmem_getbytes(xdrs, addr, len) - XDR *xdrs; - char *addr; - u_int len; +xdrmem_getbytes(XDR *xdrs, char *addr, u_int len) { if (xdrs->x_handy < len) @@ -196,10 +180,7 @@ xdrmem_getbytes(xdrs, addr, len) } static bool_t -xdrmem_putbytes(xdrs, addr, len) - XDR *xdrs; - const char *addr; - u_int len; +xdrmem_putbytes(XDR *xdrs, const char *addr, u_int len) { if (xdrs->x_handy < len) @@ -211,8 +192,7 @@ xdrmem_putbytes(xdrs, addr, len) } static u_int -xdrmem_getpos(xdrs) - XDR *xdrs; +xdrmem_getpos(XDR *xdrs) { /* XXX w/64-bit pointers, u_int not enough! */ @@ -220,9 +200,7 @@ xdrmem_getpos(xdrs) } static bool_t -xdrmem_setpos(xdrs, pos) - XDR *xdrs; - u_int pos; +xdrmem_setpos(XDR *xdrs, u_int pos) { char *newaddr = xdrs->x_base + pos; char *lastaddr = (char *)xdrs->x_private + xdrs->x_handy; @@ -235,9 +213,7 @@ xdrmem_setpos(xdrs, pos) } static int32_t * -xdrmem_inline_aligned(xdrs, len) - XDR *xdrs; - u_int len; +xdrmem_inline_aligned(XDR *xdrs, u_int len) { int32_t *buf = 0; @@ -251,9 +227,7 @@ xdrmem_inline_aligned(xdrs, len) /* ARGSUSED */ static int32_t * -xdrmem_inline_unaligned(xdrs, len) - XDR *xdrs; - u_int len; +xdrmem_inline_unaligned(XDR *xdrs, u_int len) { return (0); diff --git a/lib/libc/xdr/xdr_rec.c b/lib/libc/xdr/xdr_rec.c index 3f63498..f818ed94 100644 --- a/lib/libc/xdr/xdr_rec.c +++ b/lib/libc/xdr/xdr_rec.c @@ -161,15 +161,18 @@ static bool_t realloc_stream(RECSTREAM *, int); * calls expect that they take an opaque handle rather than an fd. */ void -xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit) - XDR *xdrs; - u_int sendsize; - u_int recvsize; - void *tcp_handle; - /* like read, but pass it a tcp_handle, not sock */ - int (*readit)(void *, void *, int); - /* like write, but pass it a tcp_handle, not sock */ - int (*writeit)(void *, void *, int); +xdrrec_create(XDR *xdrs, u_int sendsize, u_int recvsize, void *tcp_handle, + int (*readit)(void *, void *, int), int (*writeit)(void *, void *, int)) +/* + * XDR *xdrs; + * u_int sendsize; + * u_int recvsize; + * void *tcp_handle; + * // like read, but pass it a tcp_handle, not sock + * int (*readit)(void *, void *, int); + * // like write, but pass it a tcp_handle, not sock + * int (*writeit)(void *, void *, int); + */ { RECSTREAM *rstrm = mem_alloc(sizeof(RECSTREAM)); @@ -229,9 +232,7 @@ xdrrec_create(xdrs, sendsize, recvsize, tcp_handle, readit, writeit) */ static bool_t -xdrrec_getlong(xdrs, lp) - XDR *xdrs; - long *lp; +xdrrec_getlong(XDR *xdrs, long *lp) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); int32_t *buflp = (int32_t *)(void *)(rstrm->in_finger); @@ -253,9 +254,7 @@ xdrrec_getlong(xdrs, lp) } static bool_t -xdrrec_putlong(xdrs, lp) - XDR *xdrs; - const long *lp; +xdrrec_putlong(XDR *xdrs, const long *lp) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); int32_t *dest_lp = ((int32_t *)(void *)(rstrm->out_finger)); @@ -277,10 +276,7 @@ xdrrec_putlong(xdrs, lp) } static bool_t /* must manage buffers, fragments, and records */ -xdrrec_getbytes(xdrs, addr, len) - XDR *xdrs; - char *addr; - u_int len; +xdrrec_getbytes(XDR *xdrs, char *addr, u_int len) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); int current; @@ -305,10 +301,7 @@ xdrrec_getbytes(xdrs, addr, len) } static bool_t -xdrrec_putbytes(xdrs, addr, len) - XDR *xdrs; - const char *addr; - u_int len; +xdrrec_putbytes(XDR *xdrs, const char *addr, u_int len) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); size_t current; @@ -331,8 +324,7 @@ xdrrec_putbytes(xdrs, addr, len) } static u_int -xdrrec_getpos(xdrs) - XDR *xdrs; +xdrrec_getpos(XDR *xdrs) { RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; off_t pos; @@ -358,9 +350,7 @@ xdrrec_getpos(xdrs) } static bool_t -xdrrec_setpos(xdrs, pos) - XDR *xdrs; - u_int pos; +xdrrec_setpos(XDR *xdrs, u_int pos) { RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; u_int currpos = xdrrec_getpos(xdrs); @@ -397,9 +387,7 @@ xdrrec_setpos(xdrs, pos) } static int32_t * -xdrrec_inline(xdrs, len) - XDR *xdrs; - u_int len; +xdrrec_inline(XDR *xdrs, u_int len) { RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; int32_t *buf = NULL; @@ -429,8 +417,7 @@ xdrrec_inline(xdrs, len) } static void -xdrrec_destroy(xdrs) - XDR *xdrs; +xdrrec_destroy(XDR *xdrs) { RECSTREAM *rstrm = (RECSTREAM *)xdrs->x_private; @@ -449,8 +436,7 @@ xdrrec_destroy(xdrs) * this procedure to guarantee proper record alignment. */ bool_t -xdrrec_skiprecord(xdrs) - XDR *xdrs; +xdrrec_skiprecord(XDR *xdrs) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); enum xprt_stat xstat; @@ -485,8 +471,7 @@ xdrrec_skiprecord(xdrs) * after consuming the rest of the current record. */ bool_t -xdrrec_eof(xdrs) - XDR *xdrs; +xdrrec_eof(XDR *xdrs) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); @@ -509,9 +494,7 @@ xdrrec_eof(xdrs) * pipelined procedure calls.) TRUE => immmediate flush to tcp connection. */ bool_t -xdrrec_endofrecord(xdrs, sendnow) - XDR *xdrs; - bool_t sendnow; +xdrrec_endofrecord(XDR *xdrs, bool_t sendnow) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); u_long len; /* fragment length */ @@ -535,10 +518,7 @@ xdrrec_endofrecord(xdrs, sendnow) * Return true if a record is available in the buffer, false if not. */ bool_t -__xdrrec_getrec(xdrs, statp, expectdata) - XDR *xdrs; - enum xprt_stat *statp; - bool_t expectdata; +__xdrrec_getrec(XDR *xdrs, enum xprt_stat *statp, bool_t expectdata) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); ssize_t n; @@ -618,9 +598,7 @@ __xdrrec_getrec(xdrs, statp, expectdata) } bool_t -__xdrrec_setnonblock(xdrs, maxrec) - XDR *xdrs; - int maxrec; +__xdrrec_setnonblock(XDR *xdrs, int maxrec) { RECSTREAM *rstrm = (RECSTREAM *)(xdrs->x_private); @@ -635,9 +613,7 @@ __xdrrec_setnonblock(xdrs, maxrec) * Internal useful routines */ static bool_t -flush_out(rstrm, eor) - RECSTREAM *rstrm; - bool_t eor; +flush_out(RECSTREAM *rstrm, bool_t eor) { u_int32_t eormask = (eor == TRUE) ? LAST_FRAG : 0; u_int32_t len = (u_int32_t)((u_long)(rstrm->out_finger) - @@ -655,8 +631,7 @@ flush_out(rstrm, eor) } static bool_t /* knows nothing about records! Only about input buffers */ -fill_input_buf(rstrm) - RECSTREAM *rstrm; +fill_input_buf(RECSTREAM *rstrm) { char *where; u_int32_t i; @@ -678,10 +653,7 @@ fill_input_buf(rstrm) } static bool_t /* knows nothing about records! Only about input buffers */ -get_input_bytes(rstrm, addr, len) - RECSTREAM *rstrm; - char *addr; - int len; +get_input_bytes(RECSTREAM *rstrm, char *addr, int len) { size_t current; @@ -711,8 +683,7 @@ get_input_bytes(rstrm, addr, len) } static bool_t /* next two bytes of the input stream are treated as a header */ -set_input_fragment(rstrm) - RECSTREAM *rstrm; +set_input_fragment(RECSTREAM *rstrm) { u_int32_t header; @@ -737,9 +708,7 @@ set_input_fragment(rstrm) } static bool_t /* consumes input bytes; knows nothing about records! */ -skip_input_bytes(rstrm, cnt) - RECSTREAM *rstrm; - long cnt; +skip_input_bytes(RECSTREAM *rstrm, long cnt) { u_int32_t current; @@ -759,8 +728,7 @@ skip_input_bytes(rstrm, cnt) } static u_int -fix_buf_size(s) - u_int s; +fix_buf_size(u_int s) { if (s < 100) @@ -772,9 +740,7 @@ fix_buf_size(s) * Reallocate the input buffer for a non-block stream. */ static bool_t -realloc_stream(rstrm, size) - RECSTREAM *rstrm; - int size; +realloc_stream(RECSTREAM *rstrm, int size) { ptrdiff_t diff; char *buf; diff --git a/lib/libc/xdr/xdr_reference.c b/lib/libc/xdr/xdr_reference.c index 146dcf2..9acdd96 100644 --- a/lib/libc/xdr/xdr_reference.c +++ b/lib/libc/xdr/xdr_reference.c @@ -65,11 +65,13 @@ __FBSDID("$FreeBSD$"); * proc is the routine to handle the referenced structure. */ bool_t -xdr_reference(xdrs, pp, size, proc) - XDR *xdrs; - caddr_t *pp; /* the pointer to work on */ - u_int size; /* size of the object pointed to */ - xdrproc_t proc; /* xdr routine to handle the object */ +xdr_reference(XDR *xdrs, caddr_t *pp, u_int size, xdrproc_t proc) +/* + * XDR *xdrs; + * caddr_t *pp; // the pointer to work on + * u_int size; // size of the object pointed to + * xdrproc_t proc; // xdr routine to handle the object + */ { caddr_t loc = *pp; bool_t stat; @@ -122,11 +124,7 @@ xdr_reference(xdrs, pp, size, proc) * */ bool_t -xdr_pointer(xdrs,objpp,obj_size,xdr_obj) - XDR *xdrs; - char **objpp; - u_int obj_size; - xdrproc_t xdr_obj; +xdr_pointer(XDR *xdrs, char **objpp, u_int obj_size, xdrproc_t xdr_obj) { bool_t more_data; diff --git a/lib/libc/xdr/xdr_sizeof.c b/lib/libc/xdr/xdr_sizeof.c index 3daaa0c..f4b2874 100644 --- a/lib/libc/xdr/xdr_sizeof.c +++ b/lib/libc/xdr/xdr_sizeof.c @@ -47,9 +47,7 @@ __FBSDID("$FreeBSD$"); /* ARGSUSED */ static bool_t -x_putlong(xdrs, longp) - XDR *xdrs; - long *longp; +x_putlong(XDR *xdrs, const long *longp) { xdrs->x_handy += BYTES_PER_XDR_UNIT; return (TRUE); @@ -57,36 +55,28 @@ x_putlong(xdrs, longp) /* ARGSUSED */ static bool_t -x_putbytes(xdrs, bp, len) - XDR *xdrs; - char *bp; - u_int len; +x_putbytes(XDR *xdrs, const char *bp, u_int len) { xdrs->x_handy += len; return (TRUE); } static u_int -x_getpostn(xdrs) - XDR *xdrs; +x_getpostn(XDR *xdrs) { return (xdrs->x_handy); } /* ARGSUSED */ static bool_t -x_setpostn(xdrs, pos) - XDR *xdrs; - u_int pos; +x_setpostn(XDR *xdrs, u_int pos) { /* This is not allowed */ return (FALSE); } static int32_t * -x_inline(xdrs, len) - XDR *xdrs; - u_int len; +x_inline(XDR *xdrs, u_int len) { if (len == 0) { return (NULL); @@ -113,15 +103,14 @@ x_inline(xdrs, len) } static int -harmless() +harmless(void) { /* Always return FALSE/NULL, as the case may be */ return (0); } static void -x_destroy(xdrs) - XDR *xdrs; +x_destroy(XDR *xdrs) { xdrs->x_handy = 0; xdrs->x_base = 0; @@ -133,9 +122,7 @@ x_destroy(xdrs) } unsigned long -xdr_sizeof(func, data) - xdrproc_t func; - void *data; +xdr_sizeof(xdrproc_t func, void *data) { XDR x; struct xdr_ops ops; diff --git a/lib/libc/xdr/xdr_stdio.c b/lib/libc/xdr/xdr_stdio.c index 832b308..0065154 100644 --- a/lib/libc/xdr/xdr_stdio.c +++ b/lib/libc/xdr/xdr_stdio.c @@ -83,10 +83,7 @@ static const struct xdr_ops xdrstdio_ops = { * Operation flag is set to op. */ void -xdrstdio_create(xdrs, file, op) - XDR *xdrs; - FILE *file; - enum xdr_op op; +xdrstdio_create(XDR *xdrs, FILE *file, enum xdr_op op) { xdrs->x_op = op; @@ -101,17 +98,14 @@ xdrstdio_create(xdrs, file, op) * Cleans up the xdr stream handle xdrs previously set up by xdrstdio_create. */ static void -xdrstdio_destroy(xdrs) - XDR *xdrs; +xdrstdio_destroy(XDR *xdrs) { (void)fflush((FILE *)xdrs->x_private); /* XXX: should we close the file ?? */ } static bool_t -xdrstdio_getlong(xdrs, lp) - XDR *xdrs; - long *lp; +xdrstdio_getlong(XDR *xdrs, long *lp) { u_int32_t temp; @@ -122,9 +116,7 @@ xdrstdio_getlong(xdrs, lp) } static bool_t -xdrstdio_putlong(xdrs, lp) - XDR *xdrs; - const long *lp; +xdrstdio_putlong(XDR *xdrs, const long *lp) { int32_t mycopy = htonl((u_int32_t)*lp); @@ -134,10 +126,7 @@ xdrstdio_putlong(xdrs, lp) } static bool_t -xdrstdio_getbytes(xdrs, addr, len) - XDR *xdrs; - char *addr; - u_int len; +xdrstdio_getbytes(XDR *xdrs, char *addr, u_int len) { if ((len != 0) && (fread(addr, (size_t)len, 1, (FILE *)xdrs->x_private) != 1)) @@ -146,10 +135,7 @@ xdrstdio_getbytes(xdrs, addr, len) } static bool_t -xdrstdio_putbytes(xdrs, addr, len) - XDR *xdrs; - const char *addr; - u_int len; +xdrstdio_putbytes(XDR *xdrs, const char *addr, u_int len) { if ((len != 0) && (fwrite(addr, (size_t)len, 1, @@ -159,17 +145,14 @@ xdrstdio_putbytes(xdrs, addr, len) } static u_int -xdrstdio_getpos(xdrs) - XDR *xdrs; +xdrstdio_getpos(XDR *xdrs) { return ((u_int) ftell((FILE *)xdrs->x_private)); } static bool_t -xdrstdio_setpos(xdrs, pos) - XDR *xdrs; - u_int pos; +xdrstdio_setpos(XDR *xdrs, u_int pos) { return ((fseek((FILE *)xdrs->x_private, (long)pos, 0) < 0) ? @@ -178,9 +161,7 @@ xdrstdio_setpos(xdrs, pos) /* ARGSUSED */ static int32_t * -xdrstdio_inline(xdrs, len) - XDR *xdrs; - u_int len; +xdrstdio_inline(XDR *xdrs, u_int len) { /* |