appease gcc -Wuninitialized

This commit is contained in:
lukem 2005-06-02 11:10:00 +00:00
parent 51d9d5224b
commit 7f4d732106
15 changed files with 57 additions and 14 deletions

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: clparse.c,v 1.8 2004/04/02 22:53:15 mellon Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: clparse.c,v 1.9 2005/06/02 11:10:00 lukem Exp $ Copyright (c) 1996-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -639,7 +639,7 @@ void parse_option_list (cfile, list)
int ix, i;
int token;
const char *val;
pair p = (pair)0, q, r;
pair p = (pair)0, q = (pair)0, r;
ix = 0;
do {
@ -771,6 +771,8 @@ int interface_or_dummy (struct interface_info **pi, const char *name)
struct interface_info *ip = (struct interface_info *)0;
isc_result_t status;
status = ISC_R_FAILURE; /* XXXGCC -Wuninitialized */
/* Find the interface (if any) that matches the name. */
for (i = interfaces; i; i = i -> next) {
if (!strcmp (i -> name, name)) {

View File

@ -41,7 +41,7 @@
#ifndef lint
static char ocopyright[] =
"$Id: dhclient.c,v 1.13 2004/05/06 09:07:54 itojun Exp $ Copyright (c) 1995-2002 Internet Software Consortium. All rights reserved.\n";
"$Id: dhclient.c,v 1.14 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1995-2002 Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -3036,6 +3036,8 @@ isc_result_t client_dns_update (struct client_state *client, int addp, int ttl)
int result;
isc_result_t rcode;
rcode = ISC_R_FAILURE; /* XXXGCC -Wuninitialized */
/* If we didn't send an FQDN option, we certainly aren't going to
be doing an update. */
if (!client -> sent_options)

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: conflex.c,v 1.3 2004/10/29 21:19:32 dsl Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: conflex.c,v 1.4 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1995-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -315,6 +315,9 @@ static enum dhcp_token read_string (cfile)
int value;
int hex;
value = 0; /* XXXGCC -Wuninitialized */
hex = 0; /* XXXGCC -Wuninitialized */
for (i = 0; i < sizeof cfile -> tokbuf; i++) {
again:
c = get_char (cfile);

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: execute.c,v 1.4 2003/02/18 17:08:41 drochner Exp $ Copyright (c) 1998-2002 The Internet Software Consortium. All rights reserved.\n";
"$Id: execute.c,v 1.5 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1998-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -659,6 +659,8 @@ void write_statements (file, statements, indent)
if (!statements)
return;
col = 0; /* XXXGCC -Wuninitialized */
for (r = statements; r; r = r -> next) {
switch (r -> op) {
case statements_statement:

View File

@ -42,7 +42,7 @@
#ifndef lint
static char copyright[] =
"$Id: packet.c,v 1.5 2004/10/22 05:22:39 perry Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
"$Id: packet.c,v 1.6 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1996-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -244,6 +244,7 @@ ssize_t decode_udp_ip_header (interface, buf, bufix, from, data, buflen, rbuflen
ip = (struct ip *)(buf + bufix);
udp = (struct udphdr *)(buf + bufix + ip_len);
len = 0; /* XXXGCC -Wuninitialized */
#ifdef USERLAND_FILTER
/* Is it a UDP packet? */

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: tree.c,v 1.4 2003/02/18 17:08:41 drochner Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
"$Id: tree.c,v 1.5 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1995-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -657,6 +657,8 @@ int evaluate_dns_expression (result, packet, lease, client_state, in_options,
struct data_string name, data;
int r0, r1, r2;
tname = NULL; /* XXXGCC -Wuninitialized */
if (!result || *result) {
log_error ("evaluate_dns_expression called with non-null %s",
"result pointer");
@ -1280,6 +1282,8 @@ int evaluate_data_expression (result, packet, lease, client_state,
struct binding *binding;
struct binding_value *bv;
status = 0; /* XXXGCC -Wuninitialized */
switch (expr -> op) {
/* Extract N bytes starting at byte M of a data string. */
case expr_substring:

View File

@ -517,6 +517,8 @@ isc_result_t omapi_object_allocate (omapi_object_t **o,
omapi_object_t *foo;
isc_result_t status;
tsize = 0; /* XXXGCC -Wuninitialized */
if (type -> allocator) {
foo = (omapi_object_t *)0;
status = (*type -> allocator) (&foo, file, line);
@ -801,6 +803,11 @@ isc_result_t omapi_typed_data_new (const char *file, int line,
va_start (l, type);
val = 0; /* XXXGCC -Wuninitialized */
intval = 0; /* XXXGCC -Wuninitialized */
s = NULL; /* XXXGCC -Wuninitialized */
obj = NULL; /* XXXGCC -Wuninitialized */
switch (type) {
case omapi_datatype_int:
len = OMAPI_TYPED_DATA_INT_LEN;

View File

@ -714,6 +714,8 @@ static isc_result_t make_dst_key (DST_KEY **dst_key, omapi_object_t *a) {
char *name_str = NULL;
isc_result_t status = ISC_R_SUCCESS;
algorithm_id = 0; /* XXXGCC -Wuninitialized */
if (status == ISC_R_SUCCESS)
status = omapi_get_value_str
(a, (omapi_object_t *)0, "name", &name);

View File

@ -224,6 +224,8 @@ isc_result_t omapi_one_dispatch (omapi_object_t *wo,
omapi_waiter_object_t *waiter;
omapi_object_t *tmp = (omapi_object_t *)0;
status = ISC_R_FAILURE; /* XXXGCC -Wuninitialized */
if (!wo || wo -> type != omapi_type_waiter)
waiter = (omapi_waiter_object_t *)0;
else

View File

@ -660,6 +660,7 @@ omapi_message_process_internal (omapi_object_t *mo, omapi_object_t *po)
case OMAPI_OP_UPDATE:
if (m && m -> object) {
omapi_object_reference (&object, m -> object, MDL);
status = 0; /* XXXGCC -Wuninitialized */
} else {
status = omapi_handle_lookup (&object, message -> h);
if (status != ISC_R_SUCCESS) {

View File

@ -43,7 +43,7 @@
#ifndef lint
static char ocopyright[] =
"$Id: dhcrelay.c,v 1.5 2003/02/18 17:08:43 drochner Exp $ Copyright (c) 1997-2002 Internet Software Consortium. All rights reserved.\n";
"$Id: dhcrelay.c,v 1.6 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1997-2002 Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -647,7 +647,7 @@ int find_interface_by_agent_option (packet, out, buf, len)
{
int i = 0;
u_int8_t *circuit_id = 0;
unsigned circuit_id_len;
unsigned circuit_id_len = 0;
struct interface_info *ip;
while (i < len) {

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: confpars.c,v 1.6 2005/06/02 05:45:59 lukem Exp $ Copyright (c) 1995-2003 The Internet Software Consortium. All rights reserved.\n";
"$Id: confpars.c,v 1.7 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1995-2003 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -1810,6 +1810,8 @@ int parse_class_declaration (cp, cfile, group, type)
int new = 1;
isc_result_t status;
status = ISC_R_FAILURE; /* XXXGCC -Wuninitialized */
token = next_token (&val, (unsigned *)0, cfile);
if (token != STRING) {
parse_warn (cfile, "Expecting class name");
@ -2520,6 +2522,10 @@ int parse_lease_declaration (struct lease **lp, struct parse *cfile)
unsigned buflen = 0;
struct class *class;
seenbit = 0; /* XXXGCC -Wuninitialized */
newbinding = 0; /* XXXGCC -Wuninitialized */
new_state = 0; /* XXXGCC -Wuninitialized */
lease = (struct lease *)0;
status = lease_allocate (&lease, MDL);
if (status != ISC_R_SUCCESS)

View File

@ -43,7 +43,7 @@
#ifndef lint
static char copyright[] =
"$Id: failover.c,v 1.7 2002/06/11 15:22:59 wiz Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
"$Id: failover.c,v 1.8 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1999-2001 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -3424,6 +3424,10 @@ failover_option_t *dhcp_failover_make_option (unsigned code,
char tbuf [256];
#endif
size = 0; /* XXXGCC -Wuninitialized */
ilen = 0; /* XXXGCC -Wuninitialized */
txt = NULL; /* XXXGCC -Wuninitialized */
/* Note that the failover_option structure is used differently on
input than on output - on input, count is an element count, and
on output it's the number of bytes total in the option, including
@ -4945,6 +4949,8 @@ normal_binding_state_transition_check (struct lease *lease,
{
binding_state_t new_state;
new_state = 0; /* XXXGCC -Wuninitialized */
/* If there is no transition, it's no problem. */
if (binding_state == lease -> binding_state)
return binding_state;
@ -5108,6 +5114,8 @@ conflict_binding_state_transition_check (struct lease *lease,
{
binding_state_t new_state;
new_state = 0; /* XXXGCC -Wuninitialized */
/* If there is no transition, it's no problem. */
if (binding_state == lease -> binding_state)
new_state = binding_state;

View File

@ -50,7 +50,7 @@
#ifndef lint
static char copyright[] =
"$Id: omapi.c,v 1.5 2003/02/18 17:08:44 drochner Exp $ Copyright (c) 1999-2002 The Internet Software Consortium. All rights reserved.\n";
"$Id: omapi.c,v 1.6 2005/06/02 11:10:01 lukem Exp $ Copyright (c) 1999-2002 The Internet Software Consortium. All rights reserved.\n";
#endif /* not lint */
#include "dhcpd.h"
@ -2055,6 +2055,9 @@ isc_result_t binding_scope_get_value (omapi_value_t **value,
omapi_typed_data_t *td;
isc_result_t status;
char *nname;
status = ISC_R_FAILURE; /* XXXGCC -Wuninitialized */
nname = dmalloc (name -> len + 1, MDL);
if (!nname)
return ISC_R_NOMEMORY;

View File

@ -1,4 +1,4 @@
/* $NetBSD: lockf.c,v 1.5 2002/02/21 07:38:20 itojun Exp $ */
/* $NetBSD: lockf.c,v 1.6 2005/06/02 11:18:37 lukem Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@ -69,7 +69,7 @@ static void
trylocks(int id)
{
int i, ret, fd;
const char *which;
const char *which = NULL;
srand48(getpid());