[PATCH] two small cleanups
Volker Lendecke
vl at samba.org
Thu Aug 11 15:14:44 UTC 2016
Hi!
Review appreciated!
Thanks, Volker
-------------- next part --------------
>From 31646d3087ac2b6fb1d617779e4f1a52d6f2318a Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 11 Aug 2016 15:46:49 +0200
Subject: [PATCH 1/2] ldb: Fix some signed/unsigned hickups
Signed-off-by: Volker Lendecke <vl at samba.org>
---
lib/ldb/common/ldb_pack.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/lib/ldb/common/ldb_pack.c b/lib/ldb/common/ldb_pack.c
index cc3a552..7e6dd2d 100644
--- a/lib/ldb/common/ldb_pack.c
+++ b/lib/ldb/common/ldb_pack.c
@@ -185,8 +185,7 @@ static bool ldb_consume_element_data(uint8_t **pp, size_t *premaining)
unsigned int remaining = *premaining;
uint8_t *p = *pp;
uint32_t num_values = pull_uint32(p, 0);
- uint32_t len;
- int j;
+ uint32_t j, len;
p += 4;
if (remaining < 4) {
@@ -348,7 +347,7 @@ int ldb_unpack_data_only_attr_list_flags(struct ldb_context *ldb,
*/
if (list_size != 0) {
bool keep = false;
- int h;
+ unsigned int h;
/*
* We know that p has a \0 terminator before the
--
2.1.4
>From 4b78ceb51d72b1a2cc62a7419a92d365b3c727f4 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Sun, 31 Jul 2016 07:42:21 +0200
Subject: [PATCH 2/2] lib: Use replace.h properly in pthreadpool
Signed-off-by: Volker Lendecke <vl at samba.org>
---
source3/lib/pthreadpool/pthreadpool.c | 14 +++-----------
1 file changed, 3 insertions(+), 11 deletions(-)
diff --git a/source3/lib/pthreadpool/pthreadpool.c b/source3/lib/pthreadpool/pthreadpool.c
index 4b745e4..d2250f4 100644
--- a/source3/lib/pthreadpool/pthreadpool.c
+++ b/source3/lib/pthreadpool/pthreadpool.c
@@ -17,21 +17,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "config.h"
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <pthread.h>
-#include <signal.h>
-#include <assert.h>
-#include <fcntl.h>
+#include "replace.h"
#include "system/time.h"
#include "system/filesys.h"
-#include "replace.h"
-
#include "pthreadpool.h"
#include "lib/util/dlinklist.h"
+#include <pthread.h>
+#include <assert.h>
struct pthreadpool_job {
int id;
--
2.1.4
More information about the samba-technical
mailing list