Fix debugging compilation. trunk
authorchristos <christos@NetBSD.org>
Sat, 08 Jan 2005 07:58:02 +0000
branchtrunk
changeset 132899 5ec87fe84f92
parent 132898 9ada1496235a
child 132900 c71e8f1fefd0
Fix debugging compilation.
dist/openpam/lib/openpam_borrow_cred.c
dist/openpam/lib/openpam_dispatch.c
dist/openpam/lib/openpam_findenv.c
dist/openpam/lib/openpam_get_option.c
dist/openpam/lib/openpam_impl.h
dist/openpam/lib/openpam_nullconv.c
dist/openpam/lib/openpam_restore_cred.c
dist/openpam/lib/openpam_set_option.c
dist/openpam/lib/openpam_ttyconv.c
dist/openpam/lib/pam_acct_mgmt.c
dist/openpam/lib/pam_authenticate.c
dist/openpam/lib/pam_chauthtok.c
dist/openpam/lib/pam_close_session.c
dist/openpam/lib/pam_end.c
dist/openpam/lib/pam_get_authtok.c
dist/openpam/lib/pam_get_data.c
dist/openpam/lib/pam_get_item.c
dist/openpam/lib/pam_get_user.c
dist/openpam/lib/pam_getenv.c
dist/openpam/lib/pam_getenvlist.c
dist/openpam/lib/pam_open_session.c
dist/openpam/lib/pam_putenv.c
dist/openpam/lib/pam_set_data.c
dist/openpam/lib/pam_set_item.c
dist/openpam/lib/pam_setcred.c
dist/openpam/lib/pam_setenv.c
dist/openpam/lib/pam_start.c
dist/openpam/lib/pam_vprompt.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*/
 }
 
 /*
--- 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)
--- 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*/
 }
 
 /*
--- 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*/
 }
 
 /**
--- 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()
--- 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*/
 }
 
 /*
--- 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*/
 }
 
 /*
--- 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*/
 }
 
 /*
--- 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*/
 }
 
 /*
--- 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*/
 }
 
 /*
--- 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*/
 }
 
 /*
--- 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*/
 }
 
 /*
--- 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*/
 }
 
 /*
--- 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*/
 }
 
 /*
--- 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*/
 }
 
 /*
--- 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*/
 }
 
 /*
--- 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*/
 	}
 }
 
--- 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*/
 }
 
 /*
--- 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*/
 }
 
 /**
--- 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*/
 }
 
 /**
--- 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);
 	RETURNC(r);
+	/*NOTREACHED*/
 }
 
 /*
--- a/dist/openpam/lib/pam_putenv.c	Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_putenv.c	Sat Jan 08 07:58:02 2005 +0000
@@ -88,6 +88,7 @@
 		RETURNC(PAM_BUF_ERR);
 	++pamh->env_count;
 	RETURNC(PAM_SUCCESS);
+	/*NOTREACHED*/
 }
 
 /*
--- a/dist/openpam/lib/pam_set_data.c	Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_set_data.c	Sat Jan 08 07:58:02 2005 +0000
@@ -81,6 +81,7 @@
 	dp->next = pamh->module_data;
 	pamh->module_data = dp;
 	RETURNC(PAM_SUCCESS);
+	/*NOTREACHED*/
 }
 
 /*
--- a/dist/openpam/lib/pam_set_item.c	Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_set_item.c	Sat Jan 08 07:58:02 2005 +0000
@@ -101,6 +101,7 @@
 	}
 	*slot = tmp;
 	RETURNC(PAM_SUCCESS);
+	/*NOTREACHED*/
 }
 
 /*
--- a/dist/openpam/lib/pam_setcred.c	Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_setcred.c	Sat Jan 08 07:58:02 2005 +0000
@@ -60,6 +60,7 @@
 	/* XXX enforce exclusivity */
 	r = openpam_dispatch(pamh, PAM_SM_SETCRED, flags);
 	RETURNC(r);
+	/*NOTREACHED*/
 }
 
 /*
--- a/dist/openpam/lib/pam_setenv.c	Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_setenv.c	Sat Jan 08 07:58:02 2005 +0000
@@ -76,6 +76,7 @@
 	r = pam_putenv(pamh, env);
 	FREE(env);
 	RETURNC(r);
+	/*NOTREACHED*/
 }
 
 /*
--- a/dist/openpam/lib/pam_start.c	Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_start.c	Sat Jan 08 07:58:02 2005 +0000
@@ -77,6 +77,7 @@
  fail:
 	pam_end(ph, r);
 	RETURNC(r);
+	/*NOTREACHED*/
 }
 
 /*
--- a/dist/openpam/lib/pam_vprompt.c	Sat Jan 08 06:43:16 2005 +0000
+++ b/dist/openpam/lib/pam_vprompt.c	Sat Jan 08 07:58:02 2005 +0000
@@ -81,6 +81,7 @@
 	*resp = rsp == NULL ? NULL : rsp->resp;
 	FREE(rsp);
 	RETURNC(r);
+	/*NOTREACHED*/
 }
 
 /*