Print this page
6447 handful of nvpair cleanups

*** 22,32 **** * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ #include <unistd.h> ! #include <strings.h> #include <libintl.h> #include <sys/types.h> #include <sys/inttypes.h> #include <stdarg.h> #include <note.h> --- 22,32 ---- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012 by Delphix. All rights reserved. */ #include <unistd.h> ! #include <string.h> #include <libintl.h> #include <sys/types.h> #include <sys/inttypes.h> #include <stdarg.h> #include <note.h>
*** 209,219 **** NVLIST_PRTFUNC(uint16, uint16_t, uint16_t, "0x%x") NVLIST_PRTFUNC(int32, int32_t, int32_t, "%d") NVLIST_PRTFUNC(uint32, uint32_t, uint32_t, "0x%x") NVLIST_PRTFUNC(int64, int64_t, longlong_t, "%lld") NVLIST_PRTFUNC(uint64, uint64_t, u_longlong_t, "0x%llx") ! NVLIST_PRTFUNC(double, double, double, "0x%llf") NVLIST_PRTFUNC(string, char *, char *, "%s") NVLIST_PRTFUNC(hrtime, hrtime_t, hrtime_t, "0x%llx") /* * Generate functions to print array-valued nvlist members. --- 209,219 ---- NVLIST_PRTFUNC(uint16, uint16_t, uint16_t, "0x%x") NVLIST_PRTFUNC(int32, int32_t, int32_t, "%d") NVLIST_PRTFUNC(uint32, uint32_t, uint32_t, "0x%x") NVLIST_PRTFUNC(int64, int64_t, longlong_t, "%lld") NVLIST_PRTFUNC(uint64, uint64_t, u_longlong_t, "0x%llx") ! NVLIST_PRTFUNC(double, double, double, "0x%f") NVLIST_PRTFUNC(string, char *, char *, "%s") NVLIST_PRTFUNC(hrtime, hrtime_t, hrtime_t, "0x%llx") /* * Generate functions to print array-valued nvlist members.
*** 1227,1248 **** (val_array[ai] == val_arg)) return (1); break; } case DATA_TYPE_BOOLEAN_VALUE: { ! boolean_t val, val_arg; /* scanf boolean_t from value and check for match */ sr = sscanf(value, "%"SCNi32, &val_arg); if ((sr == 1) && (nvpair_value_boolean_value(nvp, &val) == 0) && (val == val_arg)) return (1); break; } case DATA_TYPE_BOOLEAN_ARRAY: { ! boolean_t *val_array, val_arg; /* check indexed value of array for match */ sr = sscanf(value, "%"SCNi32, &val_arg); if ((sr == 1) && (nvpair_value_boolean_array(nvp, --- 1227,1250 ---- (val_array[ai] == val_arg)) return (1); break; } case DATA_TYPE_BOOLEAN_VALUE: { ! int32_t val_arg; ! boolean_t val; /* scanf boolean_t from value and check for match */ sr = sscanf(value, "%"SCNi32, &val_arg); if ((sr == 1) && (nvpair_value_boolean_value(nvp, &val) == 0) && (val == val_arg)) return (1); break; } case DATA_TYPE_BOOLEAN_ARRAY: { ! boolean_t *val_array; ! int32_t val_arg; /* check indexed value of array for match */ sr = sscanf(value, "%"SCNi32, &val_arg); if ((sr == 1) && (nvpair_value_boolean_array(nvp,