Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/dist/openpam/lib Fix debugging compilation.



details:   https://anonhg.NetBSD.org/src/rev/25e497b0a804
branches:  trunk
changeset: 572568:25e497b0a804
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Jan 08 07:58:02 2005 +0000

description:
Fix debugging compilation.

diffstat:

 dist/openpam/lib/openpam_borrow_cred.c  |   1 +
 dist/openpam/lib/openpam_dispatch.c     |   1 +
 dist/openpam/lib/openpam_findenv.c      |   1 +
 dist/openpam/lib/openpam_get_option.c   |   1 +
 dist/openpam/lib/openpam_impl.h         |  65 ++++++++++++++++----------------
 dist/openpam/lib/openpam_nullconv.c     |   1 +
 dist/openpam/lib/openpam_restore_cred.c |   1 +
 dist/openpam/lib/openpam_set_option.c   |   1 +
 dist/openpam/lib/openpam_ttyconv.c      |   1 +
 dist/openpam/lib/pam_acct_mgmt.c        |   1 +
 dist/openpam/lib/pam_authenticate.c     |   1 +
 dist/openpam/lib/pam_chauthtok.c        |   1 +
 dist/openpam/lib/pam_close_session.c    |   1 +
 dist/openpam/lib/pam_end.c              |   1 +
 dist/openpam/lib/pam_get_authtok.c      |   1 +
 dist/openpam/lib/pam_get_data.c         |   1 +
 dist/openpam/lib/pam_get_item.c         |   2 +
 dist/openpam/lib/pam_get_user.c         |   1 +
 dist/openpam/lib/pam_getenv.c           |   1 +
 dist/openpam/lib/pam_getenvlist.c       |   1 +
 dist/openpam/lib/pam_open_session.c     |   1 +
 dist/openpam/lib/pam_putenv.c           |   1 +
 dist/openpam/lib/pam_set_data.c         |   1 +
 dist/openpam/lib/pam_set_item.c         |   1 +
 dist/openpam/lib/pam_setcred.c          |   1 +
 dist/openpam/lib/pam_setenv.c           |   1 +
 dist/openpam/lib/pam_start.c            |   1 +
 dist/openpam/lib/pam_vprompt.c          |   1 +
 28 files changed, 60 insertions(+), 33 deletions(-)

diffs (truncated from 382 to 300 lines):

diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/openpam_borrow_cred.c
--- a/dist/openpam/lib/openpam_borrow_cred.c    Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/openpam_borrow_cred.c    Sat Jan 08 07:58:02 2005 +0000
@@ -96,6 +96,7 @@
                RETURNC(PAM_SYSTEM_ERR);
        }
        RETURNC(PAM_SUCCESS);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/openpam_dispatch.c
--- a/dist/openpam/lib/openpam_dispatch.c       Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/openpam_dispatch.c       Sat Jan 08 07:58:02 2005 +0000
@@ -172,6 +172,7 @@
        if (!fail && err != PAM_NEW_AUTHTOK_REQD)
                err = PAM_SUCCESS;
        RETURNC(err);
+       /*NOTREACHED*/
 }
 
 #if !defined(OPENPAM_RELAX_CHECKS)
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/openpam_findenv.c
--- a/dist/openpam/lib/openpam_findenv.c        Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/openpam_findenv.c        Sat Jan 08 07:58:02 2005 +0000
@@ -61,6 +61,7 @@
                    pamh->env[i][len] == '=')
                        RETURNN(i);
        RETURNN(-1);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/openpam_get_option.c
--- a/dist/openpam/lib/openpam_get_option.c     Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/openpam_get_option.c     Sat Jan 08 07:58:02 2005 +0000
@@ -71,6 +71,7 @@
                }
        }
        RETURNS(NULL);
+       /*NOTREACHED*/
 }
 
 /**
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/openpam_impl.h
--- a/dist/openpam/lib/openpam_impl.h   Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/openpam_impl.h   Sat Jan 08 07:58:02 2005 +0000
@@ -136,46 +136,45 @@
 
 #ifdef DEBUG
 #define ENTER() openpam_log(PAM_LOG_DEBUG, "entering")
-#define ENTERI(i) do { \
-       if ((i) > 0 && (i) < PAM_NUM_ITEMS) \
-               openpam_log(PAM_LOG_DEBUG, "entering: %s", _pam_item_name[i]); \
+#define ENTERI(iv) do { \
+       if (/*CONSTCOND*/(iv) > 0 && (iv) < PAM_NUM_ITEMS) \
+               openpam_log(PAM_LOG_DEBUG, "entering: %s", \
+                   _pam_item_name[(iv)]); \
        else \
-               openpam_log(PAM_LOG_DEBUG, "entering: %d", (i)); \
+               openpam_log(PAM_LOG_DEBUG, "entering: %d", (iv)); \
 } while (/*CONSTCOND*/0)
-#define ENTERN(n) do { \
-       openpam_log(PAM_LOG_DEBUG, "entering: %d", (n)); \
-} while (0)
-#define ENTERS(s) do { \
-       if ((s) == NULL) \
-               openpam_log(PAM_LOG_DEBUG, "entering: NULL"); \
-       else \
-               openpam_log(PAM_LOG_DEBUG, "entering: '%s'", (s)); \
+#define ENTERN(num) do { \
+       openpam_log(PAM_LOG_DEBUG, "entering: %d", (num)); \
+} while (/*CONSTCOND*/0)
+#define ENTERS(str) do { \
+       openpam_log(PAM_LOG_DEBUG, "entering: '%s'", \
+           /*CONSTCOND*/(str) ? (str) : "(null)"); \
 } while (/*CONSTCOND*/0)
 #define        RETURNV() openpam_log(PAM_LOG_DEBUG, "returning")
-#define RETURNC(c) do { \
-       if ((c) >= 0 && (c) < PAM_NUM_ERRORS) \
-               openpam_log(PAM_LOG_DEBUG, "returning %s", _pam_err_name[c]); \
+#define RETURNC(chr) do { \
+       if (/*CONSTCOND*/(chr) >= 0 && (chr) < PAM_NUM_ERRORS) \
+               openpam_log(PAM_LOG_DEBUG, "returning %s", \
+                   _pam_err_name[(chr)]); \
        else \
-               openpam_log(PAM_LOG_DEBUG, "returning %d!", (c)); \
-       return (c); \
-} while (/*CONSTCOND*/0)
-#define        RETURNN(n) do { \
-       openpam_log(PAM_LOG_DEBUG, "returning %d", (n)); \
-       return (n); \
+               openpam_log(PAM_LOG_DEBUG, "returning %d!", (chr)); \
+       return (chr); \
+       /*NOTREACHED*/ \
 } while (/*CONSTCOND*/0)
-#define        RETURNP(p) do { \
-       if ((p) == NULL) \
-               openpam_log(PAM_LOG_DEBUG, "returning NULL"); \
-       else \
-               openpam_log(PAM_LOG_DEBUG, "returning %p", (p)); \
-       return (p); \
+#define        RETURNN(num) do { \
+       openpam_log(PAM_LOG_DEBUG, "returning %d", (num)); \
+       return (num); \
+       /*NOTREACHED*/ \
 } while (/*CONSTCOND*/0)
-#define        RETURNS(s) do { \
-       if ((s) == NULL) \
-               openpam_log(PAM_LOG_DEBUG, "returning NULL"); \
-       else \
-               openpam_log(PAM_LOG_DEBUG, "returning '%s'", (s)); \
-       return (s); \
+#define        RETURNP(ptr) do { \
+       openpam_log(PAM_LOG_DEBUG, "returning %p", (ptr)); \
+       return (ptr); \
+       /*NOTREACHED*/ \
+} while (/*CONSTCOND*/0)
+#define        RETURNS(str) do { \
+       openpam_log(PAM_LOG_DEBUG, "returning '%s'", \
+           /*CONSTCOND*/(str) ? (str) : "(null)"); \
+       return (str); \
+       /*NOTREACHED*/ \
 } while (/*CONSTCOND*/0)
 #else
 #define ENTER()
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/openpam_nullconv.c
--- a/dist/openpam/lib/openpam_nullconv.c       Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/openpam_nullconv.c       Sat Jan 08 07:58:02 2005 +0000
@@ -63,6 +63,7 @@
        /*LINTED unused*/
        (void)data;
        RETURNC(PAM_CONV_ERR);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/openpam_restore_cred.c
--- a/dist/openpam/lib/openpam_restore_cred.c   Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/openpam_restore_cred.c   Sat Jan 08 07:58:02 2005 +0000
@@ -74,6 +74,7 @@
        }
        pam_set_data(pamh, PAM_SAVED_CRED, NULL, NULL);
        RETURNC(PAM_SUCCESS);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/openpam_set_option.c
--- a/dist/openpam/lib/openpam_set_option.c     Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/openpam_set_option.c     Sat Jan 08 07:58:02 2005 +0000
@@ -101,6 +101,7 @@
                cur->optv[i] = opt;
        }
        RETURNC(PAM_SUCCESS);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/openpam_ttyconv.c
--- a/dist/openpam/lib/openpam_ttyconv.c        Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/openpam_ttyconv.c        Sat Jan 08 07:58:02 2005 +0000
@@ -220,6 +220,7 @@
        FREE(aresp);
        *resp = NULL;
        RETURNC(PAM_CONV_ERR);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/pam_acct_mgmt.c
--- a/dist/openpam/lib/pam_acct_mgmt.c  Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_acct_mgmt.c  Sat Jan 08 07:58:02 2005 +0000
@@ -56,6 +56,7 @@
        ENTER();
        r = openpam_dispatch(pamh, PAM_SM_ACCT_MGMT, flags);
        RETURNC(r);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/pam_authenticate.c
--- a/dist/openpam/lib/pam_authenticate.c       Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_authenticate.c       Sat Jan 08 07:58:02 2005 +0000
@@ -59,6 +59,7 @@
        r = openpam_dispatch(pamh, PAM_SM_AUTHENTICATE, flags);
        pam_set_item(pamh, PAM_AUTHTOK, NULL);
        RETURNC(r);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/pam_chauthtok.c
--- a/dist/openpam/lib/pam_chauthtok.c  Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_chauthtok.c  Sat Jan 08 07:58:02 2005 +0000
@@ -64,6 +64,7 @@
        pam_set_item(pamh, PAM_OLDAUTHTOK, NULL);
        pam_set_item(pamh, PAM_AUTHTOK, NULL);
        RETURNC(r);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/pam_close_session.c
--- a/dist/openpam/lib/pam_close_session.c      Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_close_session.c      Sat Jan 08 07:58:02 2005 +0000
@@ -58,6 +58,7 @@
                RETURNC(PAM_SYMBOL_ERR);
        r = openpam_dispatch(pamh, PAM_SM_CLOSE_SESSION, flags);
        RETURNC(r);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/pam_end.c
--- a/dist/openpam/lib/pam_end.c        Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_end.c        Sat Jan 08 07:58:02 2005 +0000
@@ -84,6 +84,7 @@
        FREE(pamh);
 
        RETURNC(PAM_SUCCESS);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/pam_get_authtok.c
--- a/dist/openpam/lib/pam_get_authtok.c        Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_get_authtok.c        Sat Jan 08 07:58:02 2005 +0000
@@ -128,6 +128,7 @@
                RETURNC(r);
        r = pam_get_item(pamh, item, (const void **)authtok);
        RETURNC(r);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/pam_get_data.c
--- a/dist/openpam/lib/pam_get_data.c   Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_get_data.c   Sat Jan 08 07:58:02 2005 +0000
@@ -65,6 +65,7 @@
                }
        }
        RETURNC(PAM_NO_MODULE_DATA);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/pam_get_item.c
--- a/dist/openpam/lib/pam_get_item.c   Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_get_item.c   Sat Jan 08 07:58:02 2005 +0000
@@ -87,8 +87,10 @@
        case PAM_REPOSITORY:
                *item = pamh->item[item_type];
                RETURNC(PAM_SUCCESS);
+               /*NOTREACHED*/
        default:
                RETURNC(PAM_SYMBOL_ERR);
+               /*NOTREACHED*/
        }
 }
 
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/pam_get_user.c
--- a/dist/openpam/lib/pam_get_user.c   Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_get_user.c   Sat Jan 08 07:58:02 2005 +0000
@@ -83,6 +83,7 @@
                RETURNC(r);
        r = pam_get_item(pamh, PAM_USER, (const void **)user);
        RETURNC(r);
+       /*NOTREACHED*/
 }
 
 /*
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/pam_getenv.c
--- a/dist/openpam/lib/pam_getenv.c     Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_getenv.c     Sat Jan 08 07:58:02 2005 +0000
@@ -69,6 +69,7 @@
                }
        }
        RETURNS(str);
+       /*NOTREACHED*/
 }
 
 /**
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/pam_getenvlist.c
--- a/dist/openpam/lib/pam_getenvlist.c Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_getenvlist.c Sat Jan 08 07:58:02 2005 +0000
@@ -77,6 +77,7 @@
        }
        envlist[i] = NULL;
        RETURNP(envlist);
+       /*NOTREACHED*/
 }
 
 /**
diff -r ebebaed8a57d -r 25e497b0a804 dist/openpam/lib/pam_open_session.c
--- a/dist/openpam/lib/pam_open_session.c       Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_open_session.c       Sat Jan 08 07:58:02 2005 +0000
@@ -58,6 +58,7 @@
                RETURNC(PAM_SYMBOL_ERR);
        r = openpam_dispatch(pamh, PAM_SM_OPEN_SESSION, flags);



Home | Main Index | Thread Index | Old Index