summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2015-11-04 21:08:55 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2015-11-05 12:21:33 +0100
commit258b9e512c4001e806c5c0966acecd3d742ec6e9 (patch)
treec8bdbb43dd9e1b5d54b90e4845065a653d585ca5 /methods
parent9fb4e6510faaa9c84b88d4cb567bf3deebf8e0b7 (diff)
apply various suggestions made by cppcheck
Reported-By: cppcheck Git-Dch: Ignore
Diffstat (limited to 'methods')
-rw-r--r--methods/ftp.h2
-rw-r--r--methods/gzip.cc2
-rw-r--r--methods/http.h2
-rw-r--r--methods/https.cc4
-rw-r--r--methods/https.h4
-rw-r--r--methods/rred.cc4
-rw-r--r--methods/rsh.h4
7 files changed, 10 insertions, 12 deletions
diff --git a/methods/ftp.h b/methods/ftp.h
index c5165782d..de2c232bd 100644
--- a/methods/ftp.h
+++ b/methods/ftp.h
@@ -68,7 +68,7 @@ class FTPConn
Hashes &MD5,bool &Missing, unsigned long long MaximumSize,
pkgAcqMethod *Owner);
- FTPConn(URI Srv);
+ explicit FTPConn(URI Srv);
~FTPConn();
};
diff --git a/methods/gzip.cc b/methods/gzip.cc
index fbfd3bbac..c470807ac 100644
--- a/methods/gzip.cc
+++ b/methods/gzip.cc
@@ -36,7 +36,7 @@ class GzipMethod : public aptMethod
public:
- GzipMethod(std::string const &pProg) : aptMethod(pProg.c_str(),"1.1",SingleInstance | SendConfig), Prog(pProg) {};
+ explicit GzipMethod(std::string const &pProg) : aptMethod(pProg.c_str(),"1.1",SingleInstance | SendConfig), Prog(pProg) {};
};
// GzipMethod::Fetch - Decompress the passed URI /*{{{*/
diff --git a/methods/http.h b/methods/http.h
index 7b7e78b64..9e2b1da5c 100644
--- a/methods/http.h
+++ b/methods/http.h
@@ -87,7 +87,7 @@ class CircleBuf
// Dump everything
void Stats();
- CircleBuf(unsigned long long Size);
+ explicit CircleBuf(unsigned long long Size);
~CircleBuf();
};
diff --git a/methods/https.cc b/methods/https.cc
index 8d9454545..a99b1861b 100644
--- a/methods/https.cc
+++ b/methods/https.cc
@@ -49,7 +49,7 @@ size_t
HttpsMethod::parse_header(void *buffer, size_t size, size_t nmemb, void *userp)
{
size_t len = size * nmemb;
- CURLUserPointer *me = (CURLUserPointer *)userp;
+ CURLUserPointer *me = static_cast<CURLUserPointer *>(userp);
std::string line((char*) buffer, len);
for (--len; len > 0; --len)
if (isspace(line[len]) == 0)
@@ -115,7 +115,7 @@ HttpsMethod::parse_header(void *buffer, size_t size, size_t nmemb, void *userp)
size_t
HttpsMethod::write_data(void *buffer, size_t size, size_t nmemb, void *userp)
{
- HttpsMethod *me = (HttpsMethod *)userp;
+ HttpsMethod *me = static_cast<HttpsMethod *>(userp);
size_t buffer_size = size * nmemb;
// we don't need to count the junk here, just drop anything we get as
// we don't always know how long it would be, e.g. in chunked encoding.
diff --git a/methods/https.h b/methods/https.h
index 0147f96a0..4d50c5a04 100644
--- a/methods/https.h
+++ b/methods/https.h
@@ -68,21 +68,19 @@ class HttpsMethod : public ServerMethod
double ultotal, double ulnow);
void SetupProxy();
CURL *curl;
- std::unique_ptr<ServerState> Server;
// Used by ServerMethods unused by https
virtual void SendReq(FetchItem *) APT_OVERRIDE { exit(42); }
virtual void RotateDNS() APT_OVERRIDE { exit(42); }
public:
- FileFd *File;
virtual bool Configuration(std::string Message) APT_OVERRIDE;
virtual std::unique_ptr<ServerState> CreateServerState(URI const &uri) APT_OVERRIDE;
using pkgAcqMethod::FetchResult;
using pkgAcqMethod::FetchItem;
- HttpsMethod() : ServerMethod("https","1.2",Pipeline | SendConfig), File(NULL)
+ HttpsMethod() : ServerMethod("https","1.2",Pipeline | SendConfig)
{
curl = curl_easy_init();
};
diff --git a/methods/rred.cc b/methods/rred.cc
index b379d384d..bb801cb4e 100644
--- a/methods/rred.cc
+++ b/methods/rred.cc
@@ -39,7 +39,7 @@ class MemBlock {
char *free;
MemBlock *next;
- MemBlock(size_t size) : size(size), next(NULL)
+ explicit MemBlock(size_t size) : size(size), next(NULL)
{
free = start = new char[size];
}
@@ -118,7 +118,7 @@ struct Change {
size_t add_len; /* bytes */
char *add;
- Change(size_t off)
+ explicit Change(size_t off)
{
offset = off;
del_cnt = add_cnt = add_len = 0;
diff --git a/methods/rsh.h b/methods/rsh.h
index 9ca14425f..35cbee3e0 100644
--- a/methods/rsh.h
+++ b/methods/rsh.h
@@ -49,7 +49,7 @@ class RSHConn
bool Get(const char *Path,FileFd &To,unsigned long long Resume,
Hashes &Hash,bool &Missing, unsigned long long Size);
- RSHConn(URI Srv);
+ explicit RSHConn(URI Srv);
~RSHConn();
};
@@ -71,7 +71,7 @@ class RSHMethod : public aptMethod
public:
- RSHMethod(std::string const &Prog);
+ explicit RSHMethod(std::string const &Prog);
};
#endif