Skip to content

Commit

Permalink
Fix compiler warnings
Browse files Browse the repository at this point in the history
Starting with commit df7a86e,
mingw32 builds result in a compiler warning for dns_addr:

  CC    slirp/slirp.o
/home/stefan/src/qemu/savannah/qemu/slirp/slirp.c:50: warning: missing braces around initializer
/home/stefan/src/qemu/savannah/qemu/slirp/slirp.c:50: warning: (near initialization for ‘dns_addr.S_un’)

Removing the assignment fixes the warning without the need of special code
for mingw32 (and also saves some bytes in the resulting binary).

To fix another potential compiler warning, the missing 'static'
attribute was added.

The same changes were applied to dns_addr_time.

Signed-off-by: Stefan Weil <[email protected]>
Signed-off-by: Blue Swirl <[email protected]>
  • Loading branch information
Stefan Weil authored and blueswirl committed Aug 31, 2009
1 parent 528e93a commit 9e3a95e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions slirp/slirp.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ static int do_slowtimo;
static TAILQ_HEAD(slirp_instances, Slirp) slirp_instances =
TAILQ_HEAD_INITIALIZER(slirp_instances);

struct in_addr dns_addr = { 0 };
u_int dns_addr_time = 0;
static struct in_addr dns_addr;
static u_int dns_addr_time;

#ifdef _WIN32

Expand Down

0 comments on commit 9e3a95e

Please sign in to comment.