From: Guillem Jover Date: Thu, 29 Nov 2007 02:17:58 +0000 (+0200) Subject: Define several private functions and variables as static X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=151d780cc8c06fa45253ff04b3660c955a09843c;p=dpkg Define several private functions and variables as static --- diff --git a/ChangeLog b/ChangeLog index a6f5935d..e0f3c53d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-11-29 Guillem Jover + + * dpkg-deb/build.c (arbitrary_fields): Define as static. + * lib/dbmodify.c (fnis): Likewise. + * lib/fields.c (conffvalue_lastword): Likewise. + * lib/tarfn.c (StoC): Likewise. + * src/packages.c (breaks_check_target): Likewise. + * utils/start-stop-daemon.c (siglist): Likewise. + 2007-11-28 Raphael Hertzog * scripts/dpkg-gensymbols.pl: The environment variable diff --git a/debian/changelog b/debian/changelog index b7036b79..89e97d15 100644 --- a/debian/changelog +++ b/debian/changelog @@ -14,6 +14,9 @@ dpkg (1.14.12) UNRELEASED; urgency=low * The environment variable DPKG_GENSYMBOLS_CHECK_LEVEL can be used to force dpkg-gensymbols to use a precise level of checks. Closes: #452022 + [ Guillem Jover ] + * Define several private functions and variables as static. + -- Guillem Jover Sat, 24 Nov 2007 07:38:13 +0200 dpkg (1.14.11) unstable; urgency=low diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c index da1dd68e..4c700364 100644 --- a/dpkg-deb/build.c +++ b/dpkg-deb/build.c @@ -56,7 +56,7 @@ struct _finfo { struct _finfo* next; }; -const char *arbitrary_fields[]= { +static const char *arbitrary_fields[] = { "Package-Type", "Subarchitecture", "Kernel-Version", diff --git a/lib/dbmodify.c b/lib/dbmodify.c index 4a410661..d13cc10f 100644 --- a/lib/dbmodify.c +++ b/lib/dbmodify.c @@ -122,7 +122,10 @@ static void createimptmp(void) { onerr_abort--; } -const struct fni { const char *suffix; char **store; } fnis[]= { +static const struct fni { + const char *suffix; + char **store; +} fnis[] = { { STATUSFILE, &statusfile }, { AVAILFILE, &availablefile }, { UPDATESDIR IMPORTANTTMP, &importanttmpfile }, diff --git a/lib/fields.c b/lib/fields.c index aa01b277..b5dfae75 100644 --- a/lib/fields.c +++ b/lib/fields.c @@ -224,12 +224,13 @@ void f_configversion(struct pkginfo *pigp, struct pkginfoperfile *pifp, "in Config-Version string `%.250s': %.250s"),value,emsg); } -void conffvalue_lastword(const char *value, const char *from, - const char *endent, - const char **word_start_r, int *word_len_r, - const char **new_from_r, - const char *filename, int lno, - FILE *warnto, int *warncount, struct pkginfo *pigp) { +static void conffvalue_lastword(const char *value, const char *from, + const char *endent, + const char **word_start_r, int *word_len_r, + const char **new_from_r, + const char *filename, int lno, FILE *warnto, + int *warncount, struct pkginfo *pigp) +{ /* the code in f_conffiles ensures that value[-1]==' ', which is helpful */ const char *lastspc; diff --git a/lib/tarfn.c b/lib/tarfn.c index 2112b60d..68901d88 100644 --- a/lib/tarfn.c +++ b/lib/tarfn.c @@ -54,7 +54,7 @@ OtoL(const char * s, int size) } /* String block to C null-terminated string */ -char * +static char * StoC(const char *s, int size) { int len; diff --git a/src/packages.c b/src/packages.c index 467a6d48..a88d81b4 100644 --- a/src/packages.c +++ b/src/packages.c @@ -381,10 +381,10 @@ static void breaks_check_one(struct varbuf *aemsgs, int *ok, *ok= 0; } -void breaks_check_target(struct varbuf *aemsgs, int *ok, - struct pkginfo *broken, - struct pkginfo *target, - struct pkginfo *virtbroken) { +static void breaks_check_target(struct varbuf *aemsgs, int *ok, + struct pkginfo *broken, + struct pkginfo *target, + struct pkginfo *virtbroken) { struct deppossi *possi; for (possi= target->installed.depended; possi; possi= possi->nextrev) { diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c index be4885c5..a1ef7490 100644 --- a/utils/start-stop-daemon.c +++ b/utils/start-stop-daemon.c @@ -371,7 +371,7 @@ struct sigpair { int signal; }; -const struct sigpair siglist[] = { +static const struct sigpair siglist[] = { { "ABRT", SIGABRT }, { "ALRM", SIGALRM }, { "FPE", SIGFPE },