From 96a3f7a55d444296f97c3e28c8d810e220e1cb9f Mon Sep 17 00:00:00 2001 From: jbj Date: Tue, 16 Oct 2001 17:42:18 +0000 Subject: Factor -type problems into explicit code annotations. CVS patchset: 5117 CVS date: 2001/10/16 17:42:18 --- popt/popt.h | 10 ++++++---- popt/poptconfig.c | 7 +++++++ popt/popthelp.c | 2 ++ 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'popt') 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 /* 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@*/ -- cgit v1.2.3