Commit fdfdf110 authored by Jeremy White's avatar Jeremy White Committed by Frediano Ziglio

Use C99 struct initializiers instead of memset for local structures.

Signed-off-by: Jeremy White's avatarJeremy White <jwhite@codeweavers.com>
Acked-by: Frediano Ziglio's avatarFrediano Ziglio <fziglio@redhat.com>
parent c67dc59e
......@@ -147,10 +147,9 @@ void session_disconnect_client(session_t *session)
int main(int argc, char *argv[])
{
gui_t gui;
session_t session;
session_t session = { 0 };
setlocale(LC_ALL, "");
memset(&session, 0, sizeof(session));
gui_create(&gui, &session, argc, argv);
gui_run(&gui);
gui_destroy(&gui);
......
......@@ -117,11 +117,10 @@ int listen_parse(const char *listen_spec, char **addr, int *port_start, int *por
static int try_port(const char *addr, int port)
{
static const int on = 1, off = 0;
struct addrinfo ai, *res, *e;
struct addrinfo ai = { 0 }, *res, *e;
char portbuf[33];
int sock, rc;
memset(&ai, 0, sizeof(ai));
ai.ai_flags = AI_PASSIVE | AI_ADDRCONFIG;
ai.ai_socktype = SOCK_STREAM;
ai.ai_family = 0;
......
......@@ -55,7 +55,7 @@ int main(int argc, char *argv[])
{
int rc;
session_t session;
session_t session = { 0 };
int display_opened = 0;
int spice_started = 0;
......@@ -63,8 +63,6 @@ int main(int argc, char *argv[])
int session_created = 0;
int session_started = 0;
memset(&session, 0, sizeof(session));
/*------------------------------------------------------------------------
** Parse arguments
**----------------------------------------------------------------------*/
......
......@@ -474,9 +474,8 @@ static int send_monitors_config(spice_t *s, int w, int h)
int spice_create_primary(spice_t *s, int w, int h, int bytes_per_line, void *shmaddr)
{
QXLDevSurfaceCreate surface;
QXLDevSurfaceCreate surface = { 0 };
memset(&surface, 0, sizeof(surface));
surface.height = h;
surface.width = w;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment