diff options
Diffstat (limited to 'lib/util')
-rw-r--r-- | lib/util/byteorder.h | 2 | ||||
-rw-r--r-- | lib/util/config.mk | 1 | ||||
-rw-r--r-- | lib/util/debug.c | 2 | ||||
-rw-r--r-- | lib/util/idtree.c | 32 | ||||
-rw-r--r-- | lib/util/util_ldb.c | 2 | ||||
-rw-r--r-- | lib/util/xfile.c | 1 |
6 files changed, 20 insertions, 20 deletions
diff --git a/lib/util/byteorder.h b/lib/util/byteorder.h index 894beccabf..b860dea791 100644 --- a/lib/util/byteorder.h +++ b/lib/util/byteorder.h @@ -151,7 +151,7 @@ static __inline__ void st_le32(uint32_t *addr, const uint32_t val) #if HAVE_ASM_BYTEORDER -#define _PTRPOS(buf,pos) (((const uint8_t *)buf)+(pos)) +#define _PTRPOS(buf,pos) (((const uint8_t *)(buf))+(pos)) #define SVAL(buf,pos) ld_le16((const uint16_t *)_PTRPOS(buf,pos)) #define IVAL(buf,pos) ld_le32((const uint32_t *)_PTRPOS(buf,pos)) #define SSVAL(buf,pos,val) st_le16((uint16_t *)_PTRPOS(buf,pos), val) diff --git a/lib/util/config.mk b/lib/util/config.mk index 22f22b5771..14bdb2a277 100644 --- a/lib/util/config.mk +++ b/lib/util/config.mk @@ -30,6 +30,7 @@ LIBSAMBA-UTIL_OBJ_FILES = $(addprefix $(libutilsrcdir)/, \ params.o) PUBLIC_HEADERS += $(addprefix $(libutilsrcdir)/, util.h \ + dlinklist.h \ attr.h \ byteorder.h \ data_blob.h \ diff --git a/lib/util/debug.c b/lib/util/debug.c index 98aabc554b..578822088f 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -102,7 +102,7 @@ _PUBLIC_ void dbghdr(int level, const char *location, const char *func) } -_PUBLIC_ void dbghdrclass(int level, int class, const char *location, const char *func) +_PUBLIC_ void dbghdrclass(int level, int dclass, const char *location, const char *func) { /* Simple wrapper, Samba 4 doesn't do debug classes */ dbghdr(level, location, func); diff --git a/lib/util/idtree.c b/lib/util/idtree.c index 193922973f..c8a8b6346a 100644 --- a/lib/util/idtree.c +++ b/lib/util/idtree.c @@ -92,10 +92,10 @@ static void free_layer(struct idr_context *idp, struct idr_layer *p) static int idr_pre_get(struct idr_context *idp) { while (idp->id_free_cnt < IDR_FREE_MAX) { - struct idr_layer *new = talloc_zero(idp, struct idr_layer); - if(new == NULL) + struct idr_layer *pn = talloc_zero(idp, struct idr_layer); + if(pn == NULL) return (0); - free_layer(idp, new); + free_layer(idp, pn); } return 1; } @@ -103,7 +103,7 @@ static int idr_pre_get(struct idr_context *idp) static int sub_alloc(struct idr_context *idp, void *ptr, int *starting_id) { int n, m, sh; - struct idr_layer *p, *new; + struct idr_layer *p, *pn; struct idr_layer *pa[MAX_LEVEL]; int l, id, oid; uint32_t bm; @@ -155,9 +155,9 @@ restart: * Create the layer below if it is missing. */ if (!p->ary[m]) { - if (!(new = alloc_layer(idp))) + if (!(pn = alloc_layer(idp))) return -1; - p->ary[m] = new; + p->ary[m] = pn; p->count++; } pa[l--] = p; @@ -188,7 +188,7 @@ restart: static int idr_get_new_above_int(struct idr_context *idp, void *ptr, int starting_id) { - struct idr_layer *p, *new; + struct idr_layer *p, *pn; int layers, v, id; idr_pre_get(idp); @@ -210,24 +210,24 @@ build_up: layers++; if (!p->count) continue; - if (!(new = alloc_layer(idp))) { + if (!(pn = alloc_layer(idp))) { /* * The allocation failed. If we built part of * the structure tear it down. */ - for (new = p; p && p != idp->top; new = p) { + for (pn = p; p && p != idp->top; pn = p) { p = p->ary[0]; - new->ary[0] = NULL; - new->bitmap = new->count = 0; - free_layer(idp, new); + pn->ary[0] = NULL; + pn->bitmap = pn->count = 0; + free_layer(idp, pn); } return -1; } - new->ary[0] = p; - new->count = 1; + pn->ary[0] = p; + pn->count = 1; if (p->bitmap == IDR_FULL) - set_bit(0, new->bitmap); - p = new; + set_bit(0, pn->bitmap); + p = pn; } idp->top = p; idp->layers = layers; diff --git a/lib/util/util_ldb.c b/lib/util/util_ldb.c index 70b18478c6..c11b6879d2 100644 --- a/lib/util/util_ldb.c +++ b/lib/util/util_ldb.c @@ -21,9 +21,7 @@ */ #include "includes.h" -#include "lib/events/events.h" #include "lib/ldb/include/ldb.h" -#include "lib/ldb/include/ldb_errors.h" #include "../lib/util/util_ldb.h" /* search the sam for the specified attributes - va_list variant diff --git a/lib/util/xfile.c b/lib/util/xfile.c index cf195706db..16499e1736 100644 --- a/lib/util/xfile.c +++ b/lib/util/xfile.c @@ -112,6 +112,7 @@ XFILE *x_fopen(const char *fname, int flags, mode_t mode) if ((flags & O_ACCMODE) == O_RDWR) { /* we don't support RDWR in XFILE - use file descriptors instead */ + SAFE_FREE(ret); errno = EINVAL; return NULL; } |