Skip to content

Commit

Permalink
Fix warnings about missing structure initializers
Browse files Browse the repository at this point in the history
Using structure initializer that does not specify value for every
field generates a warning unless at least one member is explicitly
named.

Use named initializers which both makes the code more readable and
silences the warning.

[compilation] Fix warnings about missing structure initializers. Contributes to MER#1005
  • Loading branch information
spiiroin committed May 18, 2015
1 parent e379fe8 commit e63c2b6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/libiphb.c
Expand Up @@ -88,7 +88,7 @@ int
iphb_I_woke_up(iphb_t iphbh)
{
int st;
struct _iphb_req_t req = {IPHB_WAIT};
struct _iphb_req_t req = { .cmd = IPHB_WAIT, };

if (!iphbh) {
errno = EINVAL;
Expand Down Expand Up @@ -168,8 +168,8 @@ iphb_get_fd(iphb_t iphbh)
time_t
iphb_wait2(iphb_t iphbh, unsigned mintime, unsigned maxtime, int must_wait, int resume)
{
struct _iphb_req_t req = {IPHB_WAIT};
struct _iphb_wait_resp_t resp = {0};
struct _iphb_req_t req = { .cmd = IPHB_WAIT, };
struct _iphb_wait_resp_t resp = { .waited = 0, };

if( !iphbh || mintime > maxtime ) {
errno = EINVAL;
Expand Down Expand Up @@ -270,7 +270,7 @@ iphb_discard_wakeups(iphb_t iphbh)

int iphb_get_stats(iphb_t iphbh, struct iphb_stats *stats)
{
struct _iphb_req_t req = {IPHB_STAT};
struct _iphb_req_t req = { .cmd = IPHB_STAT, };
int bytes = -1;

if (!iphbh) {
Expand Down

0 comments on commit e63c2b6

Please sign in to comment.