]> granicus.if.org Git - sudo/commitdiff
Fix building with a K&R compiler.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 7 Aug 2012 18:27:57 +0000 (14:27 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 7 Aug 2012 18:27:57 +0000 (14:27 -0400)
--HG--
branch : 1.7

env.c
pwutil.c
ttysize.c

diff --git a/env.c b/env.c
index 7afd04620194e9cf39e555b9faed3eb73013d216..ef7d92b8d856ce3e2605eb400c6bef1613a5dc81 100644 (file)
--- 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':
index 6c5345a0b0823e43e15a3377128fe401bdb483bb..ba5442cc36fc779dbe27c2507c9103dfcaa40855 100644 (file)
--- 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.
index 0e42a08885e67b7912a902d83358e25f91c8c8ff..3e365b3b196e92ba5730046fa7c15a00b72fe891 100644 (file)
--- 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;