summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-20 16:08:34 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-20 16:08:34 -0200
commit7a44f525570af2e1d24893635c85cd86091c5503 (patch)
tree471c560c9f00852fd027098801ad0f6a535a8030
parentb4dc9afe20ab9c4ddec29a7357e147258e34bb67 (diff)
Ansification and compile warning fixes.
This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects make distcheck and most gcc 4.3 and sparse warnings. Remaining warning is due to passing read or write as function pointers in the format ssize_t (*)(int, void *, size_t), as it is const for write, but not for read.
-rw-r--r--.gitignore4
-rw-r--r--Makefile.am4
-rw-r--r--configure.ac14
-rw-r--r--genauth.c2
-rw-r--r--greeter/Login.c3
-rw-r--r--greeter/greet.c6
-rw-r--r--prngc.c4
-rw-r--r--protodpy.c6
-rw-r--r--xdmauth.c3
-rw-r--r--xdmshell.c3
10 files changed, 33 insertions, 16 deletions
diff --git a/.gitignore b/.gitignore
index 5df8b88..102db40 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,3 +24,7 @@ xdm
xdm.1
xdmshell
*~
+*.o
+xdm-*.tar.*
+ChangeLog
+tags
diff --git a/Makefile.am b/Makefile.am
index 0edca97..729f618 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,7 +30,7 @@ xdmlib_PROGRAMS = chooser
# xdm
#
-xdm_CFLAGS = $(XDM_CFLAGS) -D_BSD_SOURCE
+xdm_CFLAGS = $(XDM_CFLAGS)
xdm_LDADD = $(XDM_LIBS) $(XDM_LDFLAGS)
xdm_SOURCES = \
@@ -183,7 +183,7 @@ endif LINT
.PHONY: ChangeLog
ChangeLog:
- (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2)
+ $(CHANGELOG_CMD)
dist-hook: ChangeLog
diff --git a/configure.ac b/configure.ac
index c9298dd..8f67811 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,10 @@ AC_INIT(xdm,[1.1.8],[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],xd
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
+# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG
+m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.2)
+
AM_CONFIG_HEADER(config.h)
AC_PROG_CC
@@ -37,6 +41,11 @@ AM_PROG_LIBTOOL
AC_PROG_INSTALL
XORG_PROG_RAWCPP
+XORG_CWARNFLAGS
+
+XDM_CFLAGS="$CWARNFLAGS $XDM_CFLAGS"
+GREETER_CFLAGS="$CWARNFLAGS $GREETER_CFLAGS"
+CHOOSER_CFLAGS="$CWARNFLAGS $CHOOSER_CFLAGS"
# Check for mktemp to prevent security issue noted in Xorg bug #5898
# See https://bugs.freedesktop.org/show_bug.cgi?id=5898 for details.
@@ -123,7 +132,7 @@ fi
case $host_os in
linux*|gnu*|*-gnu)
- OS_CFLAGS="-D_XOPEN_SOURCE"
+ OS_CFLAGS="-D_XOPEN_SOURCE -D_BSD_SOURCE"
SU="su"
;;
darwin*)
@@ -392,7 +401,7 @@ AC_SUBST(XDM_LDFLAGS)
#
PKG_CHECK_MODULES(XT, xt)
-XDMSHELL_CFLAGS="$XDM_CFLAGS $XDM_PRINT_CFLAGS $AUTH_CFLAGS $DMCP_CFLAGS $XLIB_CFLAGS $XT_CFLAGS $OS_CFLAGS"
+XDMSHELL_CFLAGS="$XDM_CFLAGS $XDM_PRINT_CFLAGS $AUTH_CFLAGS $DMCP_CFLAGS $XLIB_CFLAGS $XT_CFLAGS"
XDMSHELL_LIBS="$XDM_LIBS $XDM_PRINT_LIBS $DMCP_LIBS"
AC_SUBST(XDMSHELL_CFLAGS)
@@ -530,5 +539,6 @@ AC_SUBST(MKTEMP_COMMAND)
XORG_WITH_LINT
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
+XORG_CHANGELOG
AC_OUTPUT([Makefile config/Makefile greeter/Makefile])
diff --git a/genauth.c b/genauth.c
index 0b54b8d..245a63f 100644
--- a/genauth.c
+++ b/genauth.c
@@ -377,7 +377,7 @@ InitXdmcpWrapper (void)
#endif
/* Try some pseudo-random number genrator daemon next */
if (prngdSocket != NULL || prngdPort != 0) {
- if (get_prngd_bytes(tmpkey, sizeof(tmpkey), prngdPort,
+ if (get_prngd_bytes((char *)tmpkey, sizeof(tmpkey), prngdPort,
prngdSocket) == 0) {
tmpkey[0] = 0;
_XdmcpWrapperToOddParity(tmpkey, key);
diff --git a/greeter/Login.c b/greeter/Login.c
index a156762..e0daf5d 100644
--- a/greeter/Login.c
+++ b/greeter/Login.c
@@ -73,6 +73,7 @@ from The Open Group.
# include <stdio.h>
# include <ctype.h>
# include <time.h>
+# include <string.h>
# include "dm.h"
# include "dm_error.h"
@@ -602,7 +603,7 @@ RedrawFail (LoginWidget w)
char *tempCopy = strdup(w->login.fail);
if (tempCopy != NULL) {
char *start, *next;
- char lastspace;
+ char lastspace = ' ';
y = PROMPT_Y(w,LAST_PROMPT) + (2 * PROMPT_Y_INC(w));
diff --git a/greeter/greet.c b/greeter/greet.c
index 852e1eb..eb0adb5 100644
--- a/greeter/greet.c
+++ b/greeter/greet.c
@@ -83,7 +83,7 @@ from The Open Group.
#include "greet.h"
#include "Login.h"
-#ifdef HAVE_OPENLOG && HAVE_SYSLOG_H
+#if defined(HAVE_OPENLOG) && defined(HAVE_SYSLOG_H)
#define USE_SYSLOG
#include <syslog.h>
#ifndef LOG_AUTHPRIV
@@ -94,6 +94,8 @@ from The Open Group.
#endif
#endif
+#include <string.h>
+
#if defined(SECURE_RPC) && defined(sun)
/* Go figure, there's no getdomainname() prototype available */
extern int getdomainname(char *name, size_t len);
@@ -699,7 +701,7 @@ static int pamconv(int num_msg,
if (*response == NULL)
return (PAM_BUF_ERR);
- m = *msg;
+ m = (struct pam_message *)*msg;
r = *response;
for (i = 0; i < num_msg; i++ , m++ , r++) {
diff --git a/prngc.c b/prngc.c
index 529fb27..bd7d168 100644
--- a/prngc.c
+++ b/prngc.c
@@ -48,7 +48,7 @@
#define INADDR_LOOPBACK 0x7F000001U
#endif
-static ssize_t atomicio(ssize_t (*)(), int, void *, size_t);
+static ssize_t atomicio(ssize_t (*)(int, void *, size_t), int, void *, size_t);
#ifndef offsetof
# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
@@ -169,7 +169,7 @@ done:
* ensure all of data on socket comes through. f==read || f==write
*/
static ssize_t
-atomicio(ssize_t (*f)(), int fd, void *_s, size_t n)
+atomicio(ssize_t (*f)(int, void *, size_t), int fd, void *_s, size_t n)
{
char *s = _s;
ssize_t res, pos = 0;
diff --git a/protodpy.c b/protodpy.c
index 38f9b9c..949c92c 100644
--- a/protodpy.c
+++ b/protodpy.c
@@ -48,8 +48,7 @@ static struct protoDisplay *protoDisplays;
#ifdef DEBUG
static
-PrintProtoDisplay (pdpy)
- struct protoDisplay *pdpy;
+PrintProtoDisplay (struct protoDisplay *pdpy)
{
Debug ("ProtoDisplay 0x%x\n", pdpy);
Debug ("\taddress: ");
@@ -137,8 +136,7 @@ NewProtoDisplay (
}
void
-DisposeProtoDisplay (pdpy)
- struct protoDisplay *pdpy;
+DisposeProtoDisplay (struct protoDisplay *pdpy)
{
struct protoDisplay *p, *prev;
diff --git a/xdmauth.c b/xdmauth.c
index b54d5ce..b578d14 100644
--- a/xdmauth.c
+++ b/xdmauth.c
@@ -182,7 +182,8 @@ XdmGetXdmcpAuth (struct protoDisplay *pdpy,
XdmPrintDataHex ("Accept packet auth", xdmcpauth->data, xdmcpauth->data_length);
XdmPrintDataHex ("Auth file auth", fileauth->data, fileauth->data_length);
/* encrypt the session key for its trip back to the server */
- XdmcpWrap (xdmcpauth->data, (unsigned char *)&pdpy->key, xdmcpauth->data, 8);
+ XdmcpWrap ((unsigned char *)xdmcpauth->data, (unsigned char *)&pdpy->key,
+ (unsigned char *)xdmcpauth->data, 8);
pdpy->fileAuthorization = fileauth;
pdpy->xdmcpAuthorization = xdmcpauth;
}
diff --git a/xdmshell.c b/xdmshell.c
index 3dd1352..a611d38 100644
--- a/xdmshell.c
+++ b/xdmshell.c
@@ -41,6 +41,7 @@ in this Software without prior written authorization from The Open Group.
#include <stdio.h>
#include "dm.h"
#include <errno.h>
+#include <unistd.h>
#ifdef macII
#define ON_CONSOLE_ONLY
@@ -65,7 +66,7 @@ in this Software without prior written authorization from The Open Group.
#define vfork() fork()
#endif
-char *ProgramName;
+static char *ProgramName;
static int exec_args (
char *filename,