summaryrefslogtreecommitdiff
path: root/libstore
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1998-10-20 08:38:41 +0000
committerRoland McGrath <roland@gnu.org>1998-10-20 08:38:41 +0000
commitfc40a731d23f893be2cb7699d7e078568d4c210c (patch)
tree9f1c90570e03a7c4082bee3fca2ced1755ac98a0 /libstore
parent6b0d5d23a26adea266903f285f7424a2f93863cb (diff)
Add braces to silence gcc warnings.
Diffstat (limited to 'libstore')
-rw-r--r--libstore/ChangeLog32
-rw-r--r--libstore/argp.c76
-rw-r--r--libstore/decode.c14
-rw-r--r--libstore/flags.c22
4 files changed, 87 insertions, 57 deletions
diff --git a/libstore/ChangeLog b/libstore/ChangeLog
index 8462dec2..8fa2e9ba 100644
--- a/libstore/ChangeLog
+++ b/libstore/ChangeLog
@@ -1,3 +1,22 @@
+1998-10-20 Roland McGrath <roland@baalperazim.frob.com>
+
+ * flags.c (store_clear_flags): Add braces to silence gcc warning.
+
+1998-10-19 Roland McGrath <roland@baalperazim.frob.com>
+
+ * rdwr.c (store_read): Add braces to silence gcc warning.
+ * flags.c (store_set_flags): Likewise.
+ * typed.c (store_typed_open): Likewise.
+ * decode.c (store_decode): Likewise.
+ * argp.c (store_parsed_append_args): Likewise.
+ (store_parsed_name): Likewise.
+ (store_parsed_open): Likewise.
+
+1998-09-05 Roland McGrath <roland@baalperazim.frob.com>
+
+ * argp.c (store_parsed_append_args): Use %d for layer, which is int.
+ Cast to int for %* field width arg.
+
1997-09-22 Miles Bader <miles@gnu.ai.mit.edu>
* encode.c (store_encode): Allocate the correct amount of memory
@@ -110,7 +129,7 @@
* Makefile (SRCS): Remove storeread.c & storecat.c.
(storeread, storecat): Rules removed.
* storeread.c, storecat.c: Moved to ../utils.
-
+
1997-06-18 Miles Bader <miles@gnu.ai.mit.edu>
* store.h (struct store): BLOCKS & SIZE are off_t, not size_t.
@@ -128,7 +147,7 @@
* derive.c: Include <assert.h>
(_store_derive): Assert that block_size & blocks_per_page are
powers of two (which should be enforced elsewhere).
-
+
* make.c (_store_create): Renamed from _make_store.
Return an error_t code, and add an additional argument STORE to
return the new store; all uses changed.
@@ -155,7 +174,7 @@
* store.h (store_copy_class): New declaration.
(store_copy_create, store_copy_open, store_buffer_create,
store_gunzip_create, store_gunzip_open): New declarations.
-
+
* decode.c (store_decode): Pass the original value of CLASSES to
any decode method, not our search tail.
@@ -333,7 +352,7 @@ Wed Sep 11 12:38:44 1996 Miles Bader <miles@gnu.ai.mit.edu>
* decode.c (store_with_decoded_runs): New function.
(store_std_leaf_decode): Call it.
* store.h (store_with_decoded_runs): New declaration.
-
+
* stripe.c (ileave_class, concat_class): Initialize the REMAP field.
(stripe_remap): New function.
* store.h (store_remap_create): New declaration.
@@ -402,7 +421,7 @@ Wed Sep 3 11:00:00 1996 Miles Bader <miles@gnu.ai.mit.edu>
(store_parsed_Free, store_parsed_open, store_parsed_append_args):
New declarations.
(struct store_parsed): New incomplete type.
-
+
Mon Sep 2 18:56:26 1996 Miles Bader <miles@gnu.ai.mit.edu>
* store.h (store_open): New declaration.
@@ -496,7 +515,7 @@ Tue May 21 00:01:02 1996 Miles Bader <miles@gnu.ai.mit.edu>
store_decode_children): New declarations
(store_decode, store_create, store_device_create, _store_device_create,
store_file_create, _store_file_create, store_ileave_create,
- store_concat_create, _make_store): Declarations updated.
+ store_concat_create, _make_store): Declarations updated.
* make.c (_make_store): CLASS param removed, METHS param renamed
CLASS; all callers changed. FLAGS param added.
* stripe.c (store_ileave_create, store_concat_create): Likewise.
@@ -576,4 +595,3 @@ Mon May 6 15:20:53 1996 Miles Bader <miles@gnu.ai.mit.edu>
* store.h: Move big comment describing file_get_storage_info
encoding to <hurd/hurd_types.h>.
-
diff --git a/libstore/argp.c b/libstore/argp.c
index 4d944107..b7636b56 100644
--- a/libstore/argp.c
+++ b/libstore/argp.c
@@ -1,6 +1,6 @@
/* Store argument parsing
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
This file is part of the GNU Hurd.
@@ -87,28 +87,30 @@ store_parsed_append_args (const struct store_parsed *parsed,
if (parsed->interleave)
snprintf (buf, sizeof buf, "--interleave=%ld", parsed->interleave);
else
- snprintf (buf, sizeof buf, "--layer=%ld", parsed->layer);
+ snprintf (buf, sizeof buf, "--layer=%d", parsed->layer);
err = argz_add (args, args_len, buf);
}
if (!err && parsed->type != parsed->default_type)
- if (parsed->name_prefix)
- /* A name prefix of "PFX" is equivalent to appending ":PFX" to the
- type name. */
- {
- size_t npfx_len = strlen (parsed->name_prefix);
- char tname[strlen ("--store-type=")
- + strlen (parsed->type->name) + 1 + npfx_len + 1];
- snprintf (tname, sizeof tname, "--store-type=%s:%.*s",
- parsed->type->name, npfx_len, parsed->name_prefix);
- err = argz_add (args, args_len, tname);
- }
- else
- /* A simple type name. */
- {
- snprintf (buf, sizeof buf, "--store-type=%s", parsed->type->name);
- err = argz_add (args, args_len, buf);
- }
+ {
+ if (parsed->name_prefix)
+ /* A name prefix of "PFX" is equivalent to appending ":PFX" to the
+ type name. */
+ {
+ size_t npfx_len = strlen (parsed->name_prefix);
+ char tname[strlen ("--store-type=")
+ + strlen (parsed->type->name) + 1 + npfx_len + 1];
+ snprintf (tname, sizeof tname, "--store-type=%s:%.*s",
+ parsed->type->name, (int) npfx_len, parsed->name_prefix);
+ err = argz_add (args, args_len, tname);
+ }
+ else
+ /* A simple type name. */
+ {
+ snprintf (buf, sizeof buf, "--store-type=%s", parsed->type->name);
+ err = argz_add (args, args_len, buf);
+ }
+ }
if (! err)
err = argz_append (args, args_len, parsed->names, parsed->names_len);
@@ -123,13 +125,15 @@ store_parsed_name (const struct store_parsed *parsed, char **name)
char *pfx = 0;
if (argz_count (parsed->names, parsed->names_len) > 1)
- if (parsed->interleave)
- {
- snprintf (buf, sizeof buf, "interleave(%ld,", parsed->interleave);
- pfx = buf;
- }
- else if (parsed->layer)
- pfx = "layer(";
+ {
+ if (parsed->interleave)
+ {
+ snprintf (buf, sizeof buf, "interleave(%ld,", parsed->interleave);
+ pfx = buf;
+ }
+ else if (parsed->layer)
+ pfx = "layer(";
+ }
if (pfx)
*name = malloc (strlen (pfx) + parsed->names_len + 1);
@@ -203,14 +207,16 @@ store_parsed_open (const struct store_parsed *parsed, int flags,
err = open (name, &stores[i]);
if (! err)
- if (parsed->interleave)
- err =
- store_ileave_create (stores, num, parsed->interleave,
- flags, store);
- else if (parsed->layer)
- assert (! parsed->layer);
- else
- err = store_concat_create (stores, num, flags, store);
+ {
+ if (parsed->interleave)
+ err =
+ store_ileave_create (stores, num, parsed->interleave,
+ flags, store);
+ else if (parsed->layer)
+ assert (! parsed->layer);
+ else
+ err = store_concat_create (stores, num, flags, store);
+ }
if (err)
{
@@ -283,7 +289,7 @@ parse_opt (int opt, char *arg, struct argp_state *state)
/* fall through */
case 'T':
return parse_type (arg, state, parsed);
-
+
case 'I':
if (parsed->layer)
PERR (EINVAL, "--layer and --interleave are exclusive");
diff --git a/libstore/decode.c b/libstore/decode.c
index c68f8386..33e99492 100644
--- a/libstore/decode.c
+++ b/libstore/decode.c
@@ -1,6 +1,6 @@
/* Store wire decoding
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
This file is part of the GNU Hurd.
@@ -43,7 +43,7 @@ store_std_leaf_decode (struct store_enc *enc,
{
return (*create)(port, flags, block_size, runs, num_runs, store);
}
-
+
/* Make sure there are enough encoded ints and ports. */
if (enc->cur_int + 6 > enc->num_ints || enc->cur_port + 1 > enc->num_ports)
return EINVAL;
@@ -169,10 +169,12 @@ store_decode (struct store_enc *enc, const struct store_class *const *classes,
for (cl = classes; *classes; cl ++)
if ((*cl)->id == enc->ints[enc->cur_int])
- if ((*cl)->decode)
- return (*(*cl)->decode) (enc, classes, store);
- else
- return EOPNOTSUPP;
+ {
+ if ((*cl)->decode)
+ return (*(*cl)->decode) (enc, classes, store);
+ else
+ return EOPNOTSUPP;
+ }
return EINVAL;
}
diff --git a/libstore/flags.c b/libstore/flags.c
index 7f366097..d80181ac 100644
--- a/libstore/flags.c
+++ b/libstore/flags.c
@@ -1,6 +1,6 @@
/* Setting various store flags
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
This file is part of the GNU Hurd.
@@ -31,10 +31,12 @@ store_set_flags (struct store *store, int flags)
int orig = store->flags, new = flags & ~orig;
if (new & STORE_BACKEND_FLAGS)
- if (store->class->set_flags)
- err = (*store->class->set_flags) (store, new);
- else
- err = EINVAL;
+ {
+ if (store->class->set_flags)
+ err = (*store->class->set_flags) (store, new);
+ else
+ err = EINVAL;
+ }
if (! err)
store->flags |= (new & ~STORE_BACKEND_FLAGS);
@@ -50,10 +52,12 @@ store_clear_flags (struct store *store, int flags)
int orig = store->flags, kill = flags & orig;
if (kill & STORE_BACKEND_FLAGS)
- if (store->class->clear_flags)
- err = (*store->class->clear_flags) (store, kill);
- else
- err = EINVAL;
+ {
+ if (store->class->clear_flags)
+ err = (*store->class->clear_flags) (store, kill);
+ else
+ err = EINVAL;
+ }
if (! err)
store->flags &= ~(kill & ~STORE_BACKEND_FLAGS);