1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

o Remove a couple of warnings, and one bug in ttree. Spotted by the optimiser

This commit is contained in:
Joe Thornber 2001-10-25 13:08:29 +00:00
parent 11f0a12ed8
commit 3cfae6cfce
3 changed files with 7 additions and 5 deletions

View File

@ -231,7 +231,7 @@ int write_config(struct config_file *cf, const char *file)
*/ */
static struct config_node *_file(struct parser *p) static struct config_node *_file(struct parser *p)
{ {
struct config_node *root = 0, *n, *l; struct config_node *root = NULL, *n, *l = NULL;
while (p->t != TOK_EOF) { while (p->t != TOK_EOF) {
if (!(n = _section(p))) { if (!(n = _section(p))) {
stack; stack;
@ -250,7 +250,7 @@ static struct config_node *_file(struct parser *p)
static struct config_node *_section(struct parser *p) static struct config_node *_section(struct parser *p)
{ {
/* IDENTIFIER '{' VALUE* '}' */ /* IDENTIFIER '{' VALUE* '}' */
struct config_node *root, *n, *l; struct config_node *root, *n, *l = NULL;
if (!(root = _create_node(p))) { if (!(root = _create_node(p))) {
stack; stack;
return 0; return 0;

View File

@ -16,7 +16,7 @@
static int _check_vgs(struct list_head *pvs) static int _check_vgs(struct list_head *pvs)
{ {
struct list_head *tmp; struct list_head *tmp;
struct disk_list *dl; struct disk_list *dl = NULL;
struct disk_list *first = NULL; struct disk_list *first = NULL;
int pv_count = 0; int pv_count = 0;

View File

@ -67,11 +67,13 @@ int ttree_insert(struct ttree *tt, unsigned int *key, void *data)
int count = tt->klen; int count = tt->klen;
unsigned int k; unsigned int k;
while (*c && count) { do {
k = *key++; k = *key++;
c = _lookup_single(c, k); c = _lookup_single(c, k);
count--; count--;
}
} while (*c && count);
if (!*c) { if (!*c) {
count++; count++;