[PATCH] warning and cleanup fixes.
Jeremy Allison
jra at samba.org
Fri Jan 18 14:59:57 MST 2013
A couple of simple cleanup fixes attached. Please
review and push.
FYI - without the DEBUG fixes I got a compile
error for master on my 32-bit SuSE system.
Jeremy.
-------------- next part --------------
>From eb99c92dbe7c2ab4e826b85dcba19707f4f0f28e Mon Sep 17 00:00:00 2001
From: Jeremy Allison <jra at samba.org>
Date: Wed, 16 Jan 2013 16:12:29 -0800
Subject: [PATCH 1/2] Remove some unused variables.
Signed-off-by: Jeremy Allison <jra at samba.org>
---
lib/tdb/tools/tdbdump.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/lib/tdb/tools/tdbdump.c b/lib/tdb/tools/tdbdump.c
index bcd395f..47a84d2 100644
--- a/lib/tdb/tools/tdbdump.c
+++ b/lib/tdb/tools/tdbdump.c
@@ -55,9 +55,6 @@ static void log_stderr(struct tdb_context *tdb, enum tdb_debug_level level,
const char *fmt, ...)
{
va_list ap;
- char *ptr = NULL;
- int debuglevel = 0;
- int ret;
const char *name = tdb_name(tdb);
const char *prefix = "";
--
1.7.7.3
>From 1cc1c24c049231460655fdfe0ff7dc991f6d968f Mon Sep 17 00:00:00 2001
From: Jeremy Allison <jra at samba.org>
Date: Fri, 18 Jan 2013 13:57:16 -0800
Subject: [PATCH 2/2] Fix warnings with mismatched sizes in arguments to DEBUG
statements.
This can cause compile errors on 32-bit systems.
Signed-off-by: Jeremy Allison <jra at samba.org>
---
source3/smbd/smb2_ioctl_network_fs.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/source3/smbd/smb2_ioctl_network_fs.c b/source3/smbd/smb2_ioctl_network_fs.c
index a8d64e3..1e1e3e5 100644
--- a/source3/smbd/smb2_ioctl_network_fs.c
+++ b/source3/smbd/smb2_ioctl_network_fs.c
@@ -160,7 +160,7 @@ static struct tevent_req *fsctl_srv_copychunk_send(TALLOC_CTX *mem_ctx,
if (in_max_output < sizeof(struct srv_copychunk_rsp)) {
DEBUG(3, ("max output %d not large enough to hold copy chunk "
"response %lu\n", (int)in_max_output,
- sizeof(struct srv_copychunk_rsp)));
+ (unsigned long)sizeof(struct srv_copychunk_rsp)));
state->status = NT_STATUS_INVALID_PARAMETER;
tevent_req_nterror(req, state->status);
return tevent_req_post(req, ev);
@@ -253,14 +253,14 @@ static void fsctl_srv_copychunk_vfs_done(struct tevent_req *subreq)
&chunk_nwritten);
TALLOC_FREE(subreq);
if (NT_STATUS_IS_OK(status)) {
- DEBUG(10, ("good copy chunk recv %d of %d\n",
- state->recv_count,
- state->dispatch_count));
+ DEBUG(10, ("good copy chunk recv %u of %u\n",
+ (unsigned int)state->recv_count,
+ (unsigned int)state->dispatch_count));
state->total_written += chunk_nwritten;
} else {
- DEBUG(0, ("bad status in copy chunk recv %d of %d: %s\n",
- state->recv_count,
- state->dispatch_count,
+ DEBUG(0, ("bad status in copy chunk recv %u of %u: %s\n",
+ (unsigned int)state->recv_count,
+ (unsigned int)state->dispatch_count,
nt_errstr(status)));
state->bad_recv_count++;
/* may overwrite previous failed status */
@@ -427,7 +427,7 @@ static NTSTATUS fsctl_srv_req_resume_key(TALLOC_CTX *mem_ctx,
if (in_max_output < output.length) {
DEBUG(1, ("max output %u too small for resume key rsp %ld\n",
- in_max_output, (long int)output.length));
+ (unsigned int)in_max_output, (long int)output.length));
return NT_STATUS_INVALID_PARAMETER;
}
*out_output = output;
--
1.7.7.3
More information about the samba-technical
mailing list