From 8f688079bebafbf537c6105915b5d396af69dd54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= Date: Sun, 31 Mar 2019 00:53:27 +0100 Subject: Fix D_processinputdata type MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Define d_processinputdata as struct pwdata instead of doing casts back and forth. Removes clang warning with -Wcast-align. Signed-off-by: Amadeusz Sławiński --- src/display.h | 2 +- src/socket.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/display.h b/src/display.h index e09d380..5b1564d 100644 --- a/src/display.h +++ b/src/display.h @@ -90,7 +90,7 @@ struct Display { Canvas *d_forecv; /* current input focus */ Layout *d_layout; /* layout we're using */ void (*d_processinput) (char *, size_t); - char *d_processinputdata; /* data for processinput */ + struct pwdata *d_processinputdata; /* data for processinput */ int d_vpxmin, d_vpxmax; /* min/max used position on display */ Window *d_fore; /* pointer to fore window */ Window *d_other; /* pointer to other window */ diff --git a/src/socket.c b/src/socket.c index e3a66c2..7d9fff5 100644 --- a/src/socket.c +++ b/src/socket.c @@ -1111,7 +1111,7 @@ static void AskPassword(Message *m) pwdata->len = 0; pwdata->m = *m; - D_processinputdata = (char *)pwdata; + D_processinputdata = pwdata; D_processinput = PasswordProcessInput; /* if GECOS data is CSV, we only want the text before the first comma */ @@ -1221,7 +1221,7 @@ static void PasswordProcessInput(char *ibuf, size_t ilen) size_t len; int pid = D_userpid; - pwdata = (struct pwdata *)D_processinputdata; + pwdata = D_processinputdata; len = pwdata->len; while (ilen-- > 0) { c = *(unsigned char *)ibuf++; -- cgit v1.2.1