diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-02-27 03:11:54 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-03-13 13:58:45 +0100 |
commit | c3ccac9232c2684b15f75fa8622a9a290aeca123 (patch) | |
tree | 26f100be934b8d63ac2d325406b8411ce69cda8d /test | |
parent | e788a834ce421042e727b72e43177edaa47e53a7 (diff) | |
download | apt-c3ccac9232c2684b15f75fa8622a9a290aeca123.tar.gz |
warning: no previous declaration for foobar() [-Wmissing-declarations]
Git-Dch: Ignore
Reported-By: gcc -Wmissing-declarations
Diffstat (limited to 'test')
-rw-r--r-- | test/interactive-helper/aptwebserver.cc | 30 | ||||
-rw-r--r-- | test/interactive-helper/extract-control.cc | 2 | ||||
-rw-r--r-- | test/interactive-helper/testdeb.cc | 2 | ||||
-rw-r--r-- | test/libapt/assert.h | 9 | ||||
-rw-r--r-- | test/libapt/compareversion_test.cc | 6 | ||||
-rw-r--r-- | test/libapt/sourcelist_test.cc | 2 | ||||
-rw-r--r-- | test/libapt/tagfile_test.cc | 2 |
7 files changed, 31 insertions, 22 deletions
diff --git a/test/interactive-helper/aptwebserver.cc b/test/interactive-helper/aptwebserver.cc index 992f802a6..7ed984fa9 100644 --- a/test/interactive-helper/aptwebserver.cc +++ b/test/interactive-helper/aptwebserver.cc @@ -23,7 +23,7 @@ #include <dirent.h> #include <signal.h> -char const * const httpcodeToStr(int const httpcode) /*{{{*/ +static char const * const httpcodeToStr(int const httpcode) /*{{{*/ { switch (httpcode) { @@ -77,7 +77,7 @@ char const * const httpcodeToStr(int const httpcode) /*{{{*/ return NULL; } /*}}}*/ -void addFileHeaders(std::list<std::string> &headers, FileFd &data) /*{{{*/ +static void addFileHeaders(std::list<std::string> &headers, FileFd &data)/*{{{*/ { std::ostringstream contentlength; contentlength << "Content-Length: " << data.FileSize(); @@ -88,14 +88,14 @@ void addFileHeaders(std::list<std::string> &headers, FileFd &data) /*{{{*/ headers.push_back(lastmodified); } /*}}}*/ -void addDataHeaders(std::list<std::string> &headers, std::string &data) /*{{{*/ +static void addDataHeaders(std::list<std::string> &headers, std::string &data)/*{{{*/ { std::ostringstream contentlength; contentlength << "Content-Length: " << data.size(); headers.push_back(contentlength.str()); } /*}}}*/ -bool sendHead(int const client, int const httpcode, std::list<std::string> &headers)/*{{{*/ +static bool sendHead(int const client, int const httpcode, std::list<std::string> &headers)/*{{{*/ { std::string response("HTTP/1.1 "); response.append(httpcodeToStr(httpcode)); @@ -128,7 +128,7 @@ bool sendHead(int const client, int const httpcode, std::list<std::string> &head return Success; } /*}}}*/ -bool sendFile(int const client, FileFd &data) /*{{{*/ +static bool sendFile(int const client, FileFd &data) /*{{{*/ { bool Success = true; char buffer[500]; @@ -144,7 +144,7 @@ bool sendFile(int const client, FileFd &data) /*{{{*/ return Success; } /*}}}*/ -bool sendData(int const client, std::string const &data) /*{{{*/ +static bool sendData(int const client, std::string const &data) /*{{{*/ { if (FileFd::Write(client, data.c_str(), data.size()) == false) { @@ -154,7 +154,7 @@ bool sendData(int const client, std::string const &data) /*{{{*/ return true; } /*}}}*/ -void sendError(int const client, int const httpcode, std::string const &request,/*{{{*/ +static void sendError(int const client, int const httpcode, std::string const &request,/*{{{*/ bool content, std::string const &error = "") { std::list<std::string> headers; @@ -179,13 +179,13 @@ void sendError(int const client, int const httpcode, std::string const &request, if (content == true) sendData(client, response); } -void sendSuccess(int const client, std::string const &request, +static void sendSuccess(int const client, std::string const &request, bool content, std::string const &error = "") { sendError(client, 200, request, content, error); } /*}}}*/ -void sendRedirect(int const client, int const httpcode, std::string const &uri,/*{{{*/ +static void sendRedirect(int const client, int const httpcode, std::string const &uri,/*{{{*/ std::string const &request, bool content) { std::list<std::string> headers; @@ -222,7 +222,7 @@ void sendRedirect(int const client, int const httpcode, std::string const &uri,/ sendData(client, response); } /*}}}*/ -int filter_hidden_files(const struct dirent *a) /*{{{*/ +static int filter_hidden_files(const struct dirent *a) /*{{{*/ { if (a->d_name[0] == '.') return 0; @@ -236,7 +236,7 @@ int filter_hidden_files(const struct dirent *a) /*{{{*/ #endif return 1; } -int grouped_alpha_case_sort(const struct dirent **a, const struct dirent **b) { +static int grouped_alpha_case_sort(const struct dirent **a, const struct dirent **b) { #ifdef _DIRENT_HAVE_D_TYPE if ((*a)->d_type == DT_DIR && (*b)->d_type == DT_DIR); else if ((*a)->d_type == DT_DIR && (*b)->d_type == DT_REG) @@ -260,7 +260,7 @@ int grouped_alpha_case_sort(const struct dirent **a, const struct dirent **b) { return strcasecmp((*a)->d_name, (*b)->d_name); } /*}}}*/ -void sendDirectoryListing(int const client, std::string const &dir, /*{{{*/ +static void sendDirectoryListing(int const client, std::string const &dir,/*{{{*/ std::string const &request, bool content) { std::list<std::string> headers; @@ -312,7 +312,7 @@ void sendDirectoryListing(int const client, std::string const &dir, /*{{{*/ sendData(client, response); } /*}}}*/ -bool parseFirstLine(int const client, std::string const &request, /*{{{*/ +static bool parseFirstLine(int const client, std::string const &request,/*{{{*/ std::string &filename, std::string ¶ms, bool &sendContent, bool &closeConnection) { @@ -432,7 +432,7 @@ bool parseFirstLine(int const client, std::string const &request, /*{{{*/ return true; } /*}}}*/ -bool handleOnTheFlyReconfiguration(int const client, std::string const &request, std::vector<std::string> const &parts)/*{{{*/ +static bool handleOnTheFlyReconfiguration(int const client, std::string const &request, std::vector<std::string> const &parts)/*{{{*/ { size_t const pcount = parts.size(); if (pcount == 4 && parts[1] == "set") @@ -475,7 +475,7 @@ bool handleOnTheFlyReconfiguration(int const client, std::string const &request, return false; } /*}}}*/ -void * handleClient(void * voidclient) /*{{{*/ +static void * handleClient(void * voidclient) /*{{{*/ { int client = *((int*)(voidclient)); std::clog << "ACCEPT client " << client << std::endl; diff --git a/test/interactive-helper/extract-control.cc b/test/interactive-helper/extract-control.cc index 3f7feabcb..94fe9dca8 100644 --- a/test/interactive-helper/extract-control.cc +++ b/test/interactive-helper/extract-control.cc @@ -7,7 +7,7 @@ using namespace std; -bool ExtractMember(const char *File,const char *Member) +static bool ExtractMember(const char *File,const char *Member) { FileFd Fd(File,FileFd::ReadOnly); debDebFile Deb(Fd); diff --git a/test/interactive-helper/testdeb.cc b/test/interactive-helper/testdeb.cc index d28f20114..89375af13 100644 --- a/test/interactive-helper/testdeb.cc +++ b/test/interactive-helper/testdeb.cc @@ -9,7 +9,7 @@ class NullStream : public pkgDirStream virtual bool DoItem(Item &Itm,int &Fd) {return true;}; }; -bool Test(const char *File) +static bool Test(const char *File) { FileFd Fd(File,FileFd::ReadOnly); debDebFile Deb(Fd); diff --git a/test/libapt/assert.h b/test/libapt/assert.h index 113c057ed..cde6a6351 100644 --- a/test/libapt/assert.h +++ b/test/libapt/assert.h @@ -1,6 +1,11 @@ #include <iostream> #include <cstdlib> +#if __GNUC__ >= 4 + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wmissing-declarations" +#endif + #define equals(x,y) assertEquals(y, x, __LINE__) #define equalsNot(x,y) assertEqualsNot(y, x, __LINE__) @@ -111,3 +116,7 @@ void dumpVector(X vec) { v != vec.end(); ++v) std::cout << *v << std::endl; } + +#if __GNUC__ >= 4 + #pragma GCC diagnostic pop +#endif diff --git a/test/libapt/compareversion_test.cc b/test/libapt/compareversion_test.cc index fdb1d5674..44f8e9d78 100644 --- a/test/libapt/compareversion_test.cc +++ b/test/libapt/compareversion_test.cc @@ -31,7 +31,7 @@ using namespace std; -bool callDPkg(const char *val, const char *ref, const char &op) { +static bool callDPkg(const char *val, const char *ref, const char &op) { pid_t Process = ExecFork(); if (Process == 0) { @@ -50,7 +50,7 @@ bool callDPkg(const char *val, const char *ref, const char &op) { return WIFEXITED(Ret) == true && WEXITSTATUS(Ret) == 0; } -void assertVersion(int const &CurLine, string const &A, string const &B, int const &Expected) { +static void assertVersion(int const &CurLine, string const &A, string const &B, int const &Expected) { int Res = debVS.CmpVersion(A.c_str(), B.c_str()); bool const dpkg = callDPkg(A.c_str(),B.c_str(), Expected); Res = (Res < 0) ? -1 : ( (Res > 0) ? 1 : Res); @@ -61,7 +61,7 @@ void assertVersion(int const &CurLine, string const &A, string const &B, int con _error->Error("DPkg differ with line: %u. '%s' '%s' '%s' == false",CurLine,A.c_str(),((Expected == 1) ? "<<" : ( (Expected == 0) ? "=" : ">>")),B.c_str()); } -bool RunTest(const char *File) +static bool RunTest(const char *File) { if (FileExists(File) == false) return _error->Error("Versiontestfile %s doesn't exist!", File); diff --git a/test/libapt/sourcelist_test.cc b/test/libapt/sourcelist_test.cc index 0300ce929..e79b6d65e 100644 --- a/test/libapt/sourcelist_test.cc +++ b/test/libapt/sourcelist_test.cc @@ -9,7 +9,7 @@ char *tempfile = NULL; int tempfile_fd = -1; -void remove_tmpfile(void) +static void remove_tmpfile(void) { if (tempfile_fd > 0) close(tempfile_fd); diff --git a/test/libapt/tagfile_test.cc b/test/libapt/tagfile_test.cc index d12c74c95..effc3244b 100644 --- a/test/libapt/tagfile_test.cc +++ b/test/libapt/tagfile_test.cc @@ -9,7 +9,7 @@ char *tempfile = NULL; int tempfile_fd = -1; -void remove_tmpfile(void) +static void remove_tmpfile(void) { if (tempfile_fd > 0) close(tempfile_fd); |