#define XDR_TRUE ((long) 1)
#define LASTUNSIGNED ((u_int) 0-1)
+#ifdef USE_VALGRIND
+#include <valgrind/memcheck.h>
+#endif
+
/*
* for unit alignment
*/
switch (xdrs->x_op) {
case XDR_ENCODE:
+#ifdef USE_VALGRIND
+ VALGRIND_CHECK_DEFINED(*ip);
+#endif
if (*ip > 0x7fffffffL || *ip < -0x7fffffffL - 1L)
return (FALSE);
switch (xdrs->x_op) {
case XDR_ENCODE:
+#ifdef USE_VALGRIND
+ VALGRIND_CHECK_DEFINED(*up);
+#endif
if (*up > 0xffffffffUL)
return (FALSE);
switch (xdrs->x_op) {
case XDR_ENCODE:
+#ifdef USE_VALGRIND
+ VALGRIND_CHECK_DEFINED(*lp);
+#endif
if (*lp > 0x7fffffffL || *lp < -0x7fffffffL - 1L)
return (FALSE);
switch (xdrs->x_op) {
case XDR_ENCODE:
+#ifdef USE_VALGRIND
+ VALGRIND_CHECK_DEFINED(*ulp);
+#endif
if (*ulp > 0xffffffffUL)
return (FALSE);
switch (xdrs->x_op) {
case XDR_ENCODE:
+#ifdef USE_VALGRIND
+ VALGRIND_CHECK_DEFINED(*sp);
+#endif
l = (long) *sp;
return (XDR_PUTLONG(xdrs, &l));
switch (xdrs->x_op) {
case XDR_ENCODE:
+#ifdef USE_VALGRIND
+ VALGRIND_CHECK_DEFINED(*usp);
+#endif
l = (u_long) *usp;
return (XDR_PUTLONG(xdrs, (long *) &l));
{
int i;
+#ifdef USE_VALGRIND
+ switch (xdrs->x_op) {
+ case XDR_ENCODE:
+ VALGRIND_CHECK_DEFINED(*cp);
+ break;
+ default:
+ break;
+ }
+#endif
i = (*cp);
if (!xdr_int(xdrs, &i)) {
return (FALSE);
{
u_int u;
+#ifdef USE_VALGRIND
+ switch (xdrs->x_op) {
+ case XDR_ENCODE:
+ VALGRIND_CHECK_DEFINED(*cp);
+ break;
+ default:
+ break;
+ }
+#endif
u = (*cp);
if (!xdr_u_int(xdrs, &u)) {
return (FALSE);
switch (xdrs->x_op) {
case XDR_ENCODE:
+#ifdef USE_VALGRIND
+ VALGRIND_CHECK_DEFINED(*bp);
+#endif
lb = *bp ? XDR_TRUE : XDR_FALSE;
return (XDR_PUTLONG(xdrs, &lb));
/*
* enums are treated as ints
*/
+#ifdef USE_VALGRIND
+ switch (xdrs->x_op) {
+ case XDR_ENCODE:
+ VALGRIND_CHECK_DEFINED(*ep);
+ break;
+ default:
+ break;
+ }
+#endif
if (sizeof (enum sizecheck) == sizeof (long)) {
return (xdr_long(xdrs, (long *)ep));
} else if (sizeof (enum sizecheck) == sizeof (int)) {
}
if (xdrs->x_op == XDR_ENCODE) {
+#ifdef USE_VALGRIND
+ VALGRIND_CHECK_READABLE((volatile void *)cp, cnt);
+#endif
if (!XDR_PUTBYTES(xdrs, cp, cnt)) {
return (FALSE);
}
switch (xdrs->x_op) {
case XDR_ENCODE:
+#ifdef USE_VALGRIND
+ VALGRIND_CHECK_DEFINED(*ip);
+#endif
l = *ip;
return (xdr_long(xdrs, &l));
switch (xdrs->x_op) {
case XDR_ENCODE:
+#ifdef USE_VALGRIND
+ VALGRIND_CHECK_DEFINED(*up);
+#endif
ul = *up;
return (xdr_u_long(xdrs, &ul));