From c6876abae280be6f26860b370da2bc81a73c0f10 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Tue, 7 Aug 2012 14:27:57 -0400 Subject: [PATCH] Fix building with a K&R compiler. --HG-- branch : 1.7 --- env.c | 8 ++++++-- pwutil.c | 6 +++++- ttysize.c | 12 +++++++++--- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/env.c b/env.c index 7afd04620..ef7d92b8d 100644 --- a/env.c +++ b/env.c @@ -524,7 +524,9 @@ sudo_putenv(str, dupcheck, overwrite) * Merge another environment with our private copy. */ void -env_merge(char * const envp[], int overwrite) +env_merge(envp, overwrite) + char * const envp[]; + int overwrite; { char * const *ep; @@ -626,7 +628,9 @@ matches_env_keep(var) } static void -env_update_didvar(const char *ep, unsigned int *didvar) +env_update_didvar(ep, didvar) + const char *ep; + unsigned int *didvar; { switch (*ep) { case 'H': diff --git a/pwutil.c b/pwutil.c index 6c5345a0b..ba5442cc3 100644 --- a/pwutil.c +++ b/pwutil.c @@ -66,7 +66,11 @@ static int cmp_grgid __P((const void *, const void *)); #define cmp_grnam cmp_pwnam -#define ptr_to_item(p) ((struct cache_item *)((char *)p - offsetof(struct cache_item_##p, p))) +#ifdef __STDC__ +# define ptr_to_item(p) ((struct cache_item *)((char *)p - offsetof(struct cache_item_##p, p))) +#else +# define ptr_to_item(p) ((struct cache_item *)((char *)p - offsetof(struct cache_item_/**/p, p))) +#endif /* * Generic cache element. diff --git a/ttysize.c b/ttysize.c index 0e42a0888..3e365b3b1 100644 --- a/ttysize.c +++ b/ttysize.c @@ -46,7 +46,9 @@ #ifdef TIOCGWINSZ static int -get_ttysize_ioctl(int *rowp, int *colp) +get_ttysize_ioctl(rowp, colp) + int *rowp; + int *colp; { struct winsize wsize; @@ -60,14 +62,18 @@ get_ttysize_ioctl(int *rowp, int *colp) } #else static int -get_ttysize_ioctl(int *rowp, int *colp) +get_ttysize_ioctl(rowp, colp) + int *rowp; + int *colp; { return -1; } #endif /* TIOCGWINSZ */ void -get_ttysize(int *rowp, int *colp) +get_ttysize(rowp, colp) + int *rowp; + int *colp; { if (get_ttysize_ioctl(rowp, colp) == -1) { char *p; -- 2.40.0