summaryrefslogtreecommitdiff
path: root/source4/lib/registry
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2004-04-25 22:15:48 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:51:34 -0500
commitf3d3b3c8091ad4540c330c07662540440affb96e (patch)
tree39efb9209216232a3b1a7518327017f9f31df502 /source4/lib/registry
parent27ce4aa829ec1b4642a66fef2c31192778eef078 (diff)
downloadsamba-f3d3b3c8091ad4540c330c07662540440affb96e.tar.gz
samba-f3d3b3c8091ad4540c330c07662540440affb96e.tar.bz2
samba-f3d3b3c8091ad4540c330c07662540440affb96e.zip
r355: Fix a bunch of compiler warnings in the registry code.
(This used to be commit 0be7a866dc39e2d63c9c114d0f668287259e7c9e)
Diffstat (limited to 'source4/lib/registry')
-rw-r--r--source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c11
-rw-r--r--source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c14
-rw-r--r--source4/lib/registry/reg_backend_w95/reg_backend_w95.c15
-rw-r--r--source4/lib/registry/tools/regdiff.c21
-rw-r--r--source4/lib/registry/tools/regpatch.c2
-rw-r--r--source4/lib/registry/tools/regshell.c3
-rw-r--r--source4/lib/registry/tools/regtree.c1
7 files changed, 31 insertions, 36 deletions
diff --git a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
index 9a3005457e..ff39954a9f 100644
--- a/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
+++ b/source4/lib/registry/reg_backend_nt4/reg_backend_nt4.c
@@ -945,6 +945,8 @@ static WERROR vk_to_val(REG_KEY *parent, VK_HDR *vk_hdr, int size, REG_VAL **val
return WERR_OK;
}
+#if 0 /* unused */
+
static BOOL vl_verify(VL_TYPE vl, int count, int size)
{
if(!vl) return False;
@@ -955,6 +957,8 @@ static BOOL vl_verify(VL_TYPE vl, int count, int size)
return True;
}
+#endif
+
static WERROR lf_verify(REG_HANDLE *h, LF_HDR *lf_hdr, int size)
{
int lf_id;
@@ -1128,6 +1132,8 @@ static WERROR nk_to_key(REG_HANDLE *h, NK_HDR *nk_hdr, int size, REG_KEY *parent
return WERR_OK;
}
+#if 0 /* unused */
+
/*
* Allocate a new hbin block, set up the header for the block etc
*/
@@ -1463,8 +1469,6 @@ static unsigned int nt_store_security(REG_HANDLE *regf, KEY_SEC_DESC *sec)
}
-#if 0
-
/*
* Store a KEY in the file ...
*
@@ -1534,7 +1538,6 @@ static int nt_store_reg_key(REG_HANDLE *regf, REG_KEY *key)
error:
return 0;
}
-#endif
/*
* Store the registry header ...
@@ -1563,6 +1566,8 @@ error:
return NULL;
}
+#endif
+
static WERROR nt_close_registry (REG_HANDLE *h)
{
REGF *regf = h->backend_data;
diff --git a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c
index 6d1b293ee5..a24df893fb 100644
--- a/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c
+++ b/source4/lib/registry/reg_backend_rpc/reg_backend_rpc.c
@@ -192,7 +192,6 @@ static WERROR rpc_key_put_rpc_data(REG_KEY *k, struct rpc_key_data **data)
static WERROR rpc_open_key(REG_HANDLE *h, const char *name, REG_KEY **key)
{
- WERROR error;
struct rpc_key_data *mykeydata;
*key = reg_key_new_abs(name, h, NULL);
return rpc_key_put_rpc_data(*key, &mykeydata);
@@ -202,7 +201,6 @@ static WERROR rpc_get_value_by_index(REG_KEY *parent, int n, REG_VAL **value)
{
struct winreg_EnumValue r;
struct winreg_Uint8buf vb;
- struct winreg_Uint16buf bn;
struct rpc_data *mydata = parent->handle->backend_data;
struct winreg_EnumValueName vn;
NTSTATUS status;
@@ -272,9 +270,7 @@ static WERROR rpc_get_subkey_by_index(REG_KEY *parent, int n, REG_KEY **subkey)
struct rpc_data *mydata = parent->handle->backend_data;
struct rpc_key_data *mykeydata = parent->backend_data;
WERROR error;
- int i;
NTSTATUS status;
- TALLOC_CTX *mem_ctx;
/* If parent is the root key, list the hives */
if(parent->backend_data == mydata) {
@@ -321,10 +317,8 @@ static WERROR rpc_query_key(REG_KEY *k)
{
NTSTATUS status;
struct winreg_QueryInfoKey r;
- struct rpc_data *mydata = k->handle->backend_data;
- struct rpc_key_data *mykeydata;
- WERROR error = rpc_key_put_rpc_data(k, &mykeydata);
-
+ struct rpc_data *mydata = k->handle->backend_data;
+ struct rpc_key_data *mykeydata;
r.in.handle = &mykeydata->pol;
init_winreg_String(&r.in.class, NULL);
@@ -387,7 +381,7 @@ static WERROR rpc_num_values(REG_KEY *key, int *count) {
if(!W_ERROR_IS_OK(error)) return error;
if(mykeydata->num_values == -1) {
- WERROR error = rpc_query_key(key);
+ error = rpc_query_key(key);
if(!W_ERROR_IS_OK(error)) return error;
}
@@ -411,7 +405,7 @@ static WERROR rpc_num_subkeys(REG_KEY *key, int *count) {
if(!W_ERROR_IS_OK(error)) return error;
if(mykeydata->num_subkeys == -1) {
- WERROR error = rpc_query_key(key);
+ error = rpc_query_key(key);
if(!W_ERROR_IS_OK(error)) return error;
}
diff --git a/source4/lib/registry/reg_backend_w95/reg_backend_w95.c b/source4/lib/registry/reg_backend_w95/reg_backend_w95.c
index cd07e0a179..80108fd541 100644
--- a/source4/lib/registry/reg_backend_w95/reg_backend_w95.c
+++ b/source4/lib/registry/reg_backend_w95/reg_backend_w95.c
@@ -137,6 +137,8 @@ static DWORD str_to_dword(const char *a) {
return ret;
}
+#if 0 /* unused */
+
static DWORD calc_hash(const char *str) {
DWORD ret = 0;
int i;
@@ -152,7 +154,7 @@ static void parse_rgkn_block(CREG *creg, off_t start_off, off_t end_off)
for(i = start_off; end_off - i > sizeof(RGKN_KEY); i+= sizeof(RGKN_KEY)) {
RGKN_KEY *key = (RGKN_KEY *)LOCN_RGKN(creg, i);
if(key->type == 0) {
- DEBUG(4,("Regular, id: %d, %d, parent: %x, firstchild: %x, next: %x hash: %lX\n", key->id.id, key->id.rgdb, key->parent_offset, key->first_child_offset, key->next_offset, key->hash));
+ DEBUG(4,("Regular, id: %d, %d, parent: %x, firstchild: %x, next: %x hash: %lX\n", key->id.id, key->id.rgdb, key->parent_offset, key->first_child_offset, key->next_offset, (long)key->hash));
} else if(key->type == 0x80000000) {
DEBUG(3,("free\n"));
i += key->hash;
@@ -162,6 +164,8 @@ static void parse_rgkn_block(CREG *creg, off_t start_off, off_t end_off)
}
}
+#endif
+
static void parse_rgdb_block(CREG *creg, RGDB_HDR *rgdb_hdr)
{
DWORD used_size = rgdb_hdr->size - rgdb_hdr->unused_size;
@@ -226,8 +230,8 @@ static WERROR w95_open_reg (REG_HANDLE *h, const char *location, const char *cre
{
CREG *creg;
DWORD creg_id, rgkn_id;
- DWORD i, nfree = 0;
- DWORD offset, end_offset;
+ DWORD i;
+ DWORD offset;
creg = talloc_p(h->mem_ctx, CREG);
memset(creg, 0, sizeof(CREG));
@@ -284,8 +288,8 @@ static WERROR w95_open_reg (REG_HANDLE *h, const char *location, const char *cre
RGDB_HDR *rgdb_hdr = (RGDB_HDR *)LOCN_RGDB_BLOCK(creg, offset);
if(strncmp((char *)&(rgdb_hdr->RGDB_ID), "RGDB", 4)) {
- DEBUG(0, ("unrecognized rgdb entry: %4s, %s\n",
- &rgdb_hdr->RGDB_ID, location));
+ DEBUG(0, ("unrecognized rgdb entry: %4d, %s\n",
+ rgdb_hdr->RGDB_ID, location));
return WERR_FOOBAR;
} else {
DEBUG(3, ("Valid rgdb entry, first free id: %d, max id: %d\n", rgdb_hdr->first_free_id, rgdb_hdr->max_id));
@@ -317,7 +321,6 @@ static WERROR w95_close_reg(REG_HANDLE *h)
static WERROR w95_fetch_values(REG_KEY *k, int *count, REG_VAL ***values)
{
RGKN_KEY *rgkn_key = k->backend_data;
- RGDB_VALUE *val;
DWORD i;
DWORD offset = 0;
RGDB_KEY *rgdb_key = LOCN_RGDB_KEY((CREG *)k->handle->backend_data, rgkn_key->id.rgdb, rgkn_key->id.id);
diff --git a/source4/lib/registry/tools/regdiff.c b/source4/lib/registry/tools/regdiff.c
index 94cdf8c8af..305a7a1e46 100644
--- a/source4/lib/registry/tools/regdiff.c
+++ b/source4/lib/registry/tools/regdiff.c
@@ -23,7 +23,7 @@
void writediff(REG_KEY *oldkey, REG_KEY *newkey, FILE *out)
{
- int i, numkeys1, numvals1, numvals2, numkeys2;
+ int i;
REG_KEY *t1,*t2;
REG_VAL *v1, *v2;
WERROR error1, error2;
@@ -33,12 +33,12 @@ void writediff(REG_KEY *oldkey, REG_KEY *newkey, FILE *out)
if(W_ERROR_EQUAL(error2, WERR_DEST_NOT_FOUND)) {
fprintf(out, "-%s\n", reg_key_get_path(t1)+1);
} else if(!W_ERROR_IS_OK(error2)) {
- DEBUG(0, ("Error occured while getting subkey by name: %d\n", error2));
+ DEBUG(0, ("Error occured while getting subkey by name: %d\n", W_ERROR_V(error2)));
}
}
if(!W_ERROR_EQUAL(error1, WERR_NO_MORE_ITEMS)) {
- DEBUG(0, ("Error occured while getting subkey by index: %d\n", error1));
+ DEBUG(0, ("Error occured while getting subkey by index: %d\n", W_ERROR_V(error1)));
return;
}
@@ -47,13 +47,13 @@ void writediff(REG_KEY *oldkey, REG_KEY *newkey, FILE *out)
if(W_ERROR_EQUAL(error2, WERR_DEST_NOT_FOUND)) {
fprintf(out, "\n[%s]\n", reg_key_get_path(t1)+1);
} else if(!W_ERROR_IS_OK(error2)) {
- DEBUG(0, ("Error occured while getting subkey by name: %d\n", error2));
+ DEBUG(0, ("Error occured while getting subkey by name: %d\n", W_ERROR_V(error2)));
}
writediff(t2, t1, out);
}
if(!W_ERROR_EQUAL(error1, WERR_NO_MORE_ITEMS)) {
- DEBUG(0, ("Error occured while getting subkey by index: %d\n", error1));
+ DEBUG(0, ("Error occured while getting subkey by index: %d\n", W_ERROR_V(error1)));
return;
}
@@ -65,12 +65,12 @@ void writediff(REG_KEY *oldkey, REG_KEY *newkey, FILE *out)
}
if(!W_ERROR_IS_OK(error2) && !W_ERROR_EQUAL(error2, WERR_DEST_NOT_FOUND)) {
- DEBUG(0, ("Error occured while getting value by name: %d\n", error2));
+ DEBUG(0, ("Error occured while getting value by name: %d\n", W_ERROR_V(error2)));
}
}
if(!W_ERROR_EQUAL(error1, WERR_NO_MORE_ITEMS)) {
- DEBUG(0, ("Error occured while getting value by index: %d\n", error1));
+ DEBUG(0, ("Error occured while getting value by index: %d\n", W_ERROR_V(error1)));
return;
}
@@ -81,22 +81,20 @@ void writediff(REG_KEY *oldkey, REG_KEY *newkey, FILE *out)
} else if(W_ERROR_EQUAL(error2, WERR_DEST_NOT_FOUND)) {
fprintf(out, "\"%s\"=-\n", reg_val_name(v1));
} else {
- DEBUG(0, ("Error occured while getting value by name: %d\n", error2));
+ DEBUG(0, ("Error occured while getting value by name: %d\n", W_ERROR_V(error2)));
}
}
if(!W_ERROR_EQUAL(error1, WERR_NO_MORE_ITEMS)) {
- DEBUG(0, ("Error occured while getting value by index: %d\n", error1));
+ DEBUG(0, ("Error occured while getting value by index: %d\n", W_ERROR_V(error1)));
return;
}
}
int main (int argc, char **argv)
{
- uint32 setparms, checkparms;
int opt;
poptContext pc;
- REG_KEY *root;
const char *backend1 = NULL, *backend2 = NULL;
const char *location2;
const char *credentials1= NULL, *credentials2 = NULL;
@@ -105,7 +103,6 @@ int main (int argc, char **argv)
REG_HANDLE *h2;
REG_KEY *root1 = NULL, *root2;
int from_null = 0;
- int fullpath = 0, no_values = 0;
WERROR error;
struct poptOption long_options[] = {
POPT_AUTOHELP
diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c
index 9a51b0f7ff..e632edaa49 100644
--- a/source4/lib/registry/tools/regpatch.c
+++ b/source4/lib/registry/tools/regpatch.c
@@ -754,7 +754,6 @@ int nt_apply_reg_command_file(REG_KEY *root, const char *cmd_file_name)
int main (int argc, char **argv)
{
- uint32 setparms, checkparms;
int opt;
poptContext pc;
REG_KEY *root;
@@ -763,7 +762,6 @@ int main (int argc, char **argv)
const char *patch;
const char *backend = "dir";
REG_HANDLE *h;
- int fullpath = 0, no_values = 0;
WERROR error;
struct poptOption long_options[] = {
POPT_AUTOHELP
diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c
index 18399b5bda..8ee2a65d06 100644
--- a/source4/lib/registry/tools/regshell.c
+++ b/source4/lib/registry/tools/regshell.c
@@ -58,7 +58,7 @@ static REG_KEY *cmd_ck(REG_KEY *cur, int argc, char **argv)
static REG_KEY *cmd_ls(REG_KEY *cur, int argc, char **argv)
{
- int i, num;
+ int i;
WERROR error;
REG_VAL *value;
REG_KEY *sub;
@@ -198,7 +198,6 @@ REG_KEY *process_cmd(REG_KEY *k, char *line)
int main (int argc, char **argv)
{
- uint32 setparms, checkparms;
int opt;
char *backend = "dir";
char *credentials = NULL;
diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c
index 3e74db2557..94018bdc5c 100644
--- a/source4/lib/registry/tools/regtree.c
+++ b/source4/lib/registry/tools/regtree.c
@@ -60,7 +60,6 @@ void print_tree(int l, REG_KEY *p, int fullpath, int novals)
int main (int argc, char **argv)
{
- uint32 setparms, checkparms;
int opt;
char *backend = "dir", *credentials = NULL;
poptContext pc;