summaryrefslogtreecommitdiff
path: root/popt
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2001-10-16 17:42:18 +0000
committerjbj <devnull@localhost>2001-10-16 17:42:18 +0000
commit96a3f7a55d444296f97c3e28c8d810e220e1cb9f (patch)
tree01eb83731cd7193dda21a7ab3d8e741c41c0914f /popt
parent9f45bcd3ecf3f3548ed7a8490b882a6ca9ffeb94 (diff)
downloadrpm-96a3f7a55d444296f97c3e28c8d810e220e1cb9f.tar.gz
rpm-96a3f7a55d444296f97c3e28c8d810e220e1cb9f.tar.bz2
rpm-96a3f7a55d444296f97c3e28c8d810e220e1cb9f.zip
Factor -type problems into explicit code annotations.
CVS patchset: 5117 CVS date: 2001/10/16 17:42:18
Diffstat (limited to 'popt')
-rw-r--r--popt/popt.h10
-rw-r--r--popt/poptconfig.c7
-rw-r--r--popt/popthelp.c2
3 files changed, 15 insertions, 4 deletions
diff --git a/popt/popt.h b/popt/popt.h
index 436f9f4f5..bb6a867b6 100644
--- a/popt/popt.h
+++ b/popt/popt.h
@@ -9,10 +9,6 @@
#ifndef H_POPT
#define H_POPT
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdio.h> /* for FILE * */
#define POPT_OPTION_DEPTH 10
@@ -184,6 +180,11 @@ enum poptCallbackReason { POPT_CALLBACK_REASON_PRE,
POPT_CALLBACK_REASON_POST,
POPT_CALLBACK_REASON_OPTION };
+#ifdef __cplusplus
+extern "C" {
+#endif
+/*@-type@*/
+
/** \ingroup popt
* Table callback prototype.
* @param con context
@@ -437,6 +438,7 @@ int poptStrippedArgv(poptContext con, int argc, char ** argv)
/*@modifies *argv @*/;
/*@=fcnuse@*/
+/*@=type@*/
#ifdef __cplusplus
}
#endif
diff --git a/popt/poptconfig.c b/popt/poptconfig.c
index bc902d4e7..e553f86de 100644
--- a/popt/poptconfig.c
+++ b/popt/poptconfig.c
@@ -13,7 +13,9 @@
static void configLine(poptContext con, char * line)
/*@modifies con @*/
{
+ /*@-type@*/
int nameLength = strlen(con->appName);
+ /*@=type@*/
const char * entryType;
const char * opt;
poptItem item = alloca(sizeof(*item));
@@ -21,7 +23,10 @@ static void configLine(poptContext con, char * line)
memset(item, 0, sizeof(*item));
+ /*@-type@*/
if (strncmp(line, con->appName, nameLength)) return;
+ /*@=type@*/
+
line += nameLength;
if (*line == '\0' || !isspace(*line)) return;
@@ -151,7 +156,9 @@ int poptReadDefaultConfig(poptContext con, /*@unused@*/ int useEnv) {
char * fn, * home;
int rc;
+ /*@-type@*/
if (!con->appName) return 0;
+ /*@=type@*/
rc = poptReadConfigFile(con, "/etc/popt");
if (rc) return rc;
diff --git a/popt/popthelp.c b/popt/popthelp.c
index 853f5299a..e2e2eef9a 100644
--- a/popt/popthelp.c
+++ b/popt/popthelp.c
@@ -1,5 +1,6 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*@-type@*/
/** \ingroup popt
* \file popt/popthelp.c
*/
@@ -650,3 +651,4 @@ void poptSetOtherOptionHelp(poptContext con, const char * text)
con->otherHelp = _free(con->otherHelp);
con->otherHelp = xstrdup(text);
}
+/*@=type@*/