Skip to content

Commit 1f1767b

Browse files
Fix cppcheck issues (#1028)
Rename method parameters to match declaration and definition Remove unused variables Resolves: OLPEDGE-1062 Signed-off-by: Serhii Lozynskyi <ext-serhii.lozynskyi@here.com>
1 parent 002551c commit 1f1767b

File tree

11 files changed

+22
-24
lines changed

11 files changed

+22
-24
lines changed

olp-cpp-sdk-core/src/cache/DefaultCacheImpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ int64_t DefaultCacheImpl::MaybeUpdatedProtectedKeys(
565565
} else if (prev_size > 0) {
566566
// delete key, as protected list is empty
567567
batch.Delete(kProtectedKeys);
568-
return -1 * (prev_size + strlen(kProtectedKeys));
568+
return -1 * static_cast<int64_t>((prev_size + strlen(kProtectedKeys)));
569569
}
570570
}
571571

olp-cpp-sdk-core/src/cache/SizeCountingEnv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace cache {
2626

2727
class SizeCountingEnv : public leveldb::EnvWrapper {
2828
public:
29-
SizeCountingEnv(leveldb::Env* env) : leveldb::EnvWrapper(env) {}
29+
explicit SizeCountingEnv(leveldb::Env* env) : leveldb::EnvWrapper(env) {}
3030

3131
virtual uint64_t Size() const { return 0; }
3232
};

olp-cpp-sdk-core/src/client/PendingUrlRequests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ bool PendingUrlRequests::CancelAll() {
174174
return true;
175175
}
176176

177-
bool PendingUrlRequests::CancelAllAndWait() {
177+
bool PendingUrlRequests::CancelAllAndWait() const {
178178
PendingRequestsType pending_requests;
179179
PendingRequestsType cancelled_requests;
180180

olp-cpp-sdk-core/src/client/PendingUrlRequests.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class PendingUrlRequests {
123123
bool CancelAll();
124124

125125
/// Cancel pending requests and wait for all requests to finish, blocking.
126-
bool CancelAllAndWait();
126+
bool CancelAllAndWait() const;
127127

128128
/// Get the existing pending request associated with the url or create a new
129129
/// one if not present yet.

olp-cpp-sdk-dataservice-read/src/ReleaseDependencyResolver.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,12 @@ ReleaseDependencyResolver::CheckProtectedTilesInQuad(
126126

127127
void ReleaseDependencyResolver::ProcessQuadTreeCache(
128128
const geo::TileKey& root_quad_key, const geo::TileKey& tile,
129-
bool& add_key) {
129+
bool& add_data_handle_key) {
130130
QuadTreeIndex cached_tree;
131131
if (partitions_cache_repository_.Get(layer_id_, root_quad_key, kQuadTreeDepth,
132132
version_, cached_tree)) {
133133
TilesDataKeysType protected_keys =
134-
CheckProtectedTilesInQuad(cached_tree, tile, add_key);
134+
CheckProtectedTilesInQuad(cached_tree, tile, add_data_handle_key);
135135
if (protected_keys.empty()) {
136136
// no other tiles are protected, can add quad tree to release list
137137
keys_to_release_.emplace_back(partitions_cache_repository_.CreateQuadKey(

olp-cpp-sdk-dataservice-read/src/ReleaseDependencyResolver.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class ReleaseDependencyResolver {
5757
const geo::TileKey& tile,
5858
bool& add_data_handle_key);
5959

60-
void ProcessQuadTreeCache(const geo::TileKey& root, const geo::TileKey& tile,
60+
void ProcessQuadTreeCache(const geo::TileKey& root_quad_key, const geo::TileKey& tile,
6161
bool& add_data_handle_key);
6262

6363
private:

olp-cpp-sdk-dataservice-read/src/VersionedLayerClientImpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class VersionedLayerClientImpl {
9898

9999
virtual bool Protect(const TileKeys& tiles);
100100

101-
virtual bool Release(const TileKeys& keys);
101+
virtual bool Release(const TileKeys& tiles);
102102

103103
private:
104104
CatalogVersionResponse GetVersion(boost::optional<std::string> billing_tag,

olp-cpp-sdk-dataservice-read/src/repositories/DataRepository.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ BlobApi::DataResponse DataRepository::GetVersionedData(
123123

124124
BlobApi::DataResponse DataRepository::GetBlobData(
125125
const std::string& layer, const std::string& service,
126-
const DataRequest& data_request, client::CancellationContext context) {
127-
auto fetch_option = data_request.GetFetchOption();
128-
const auto& data_handle = data_request.GetDataHandle();
126+
const DataRequest& request, client::CancellationContext context) {
127+
auto fetch_option = request.GetFetchOption();
128+
const auto& data_handle = request.GetDataHandle();
129129

130130
if (!data_handle) {
131131
return {{client::ErrorCode::PreconditionFailed, "Data handle is missing"}};
@@ -170,11 +170,11 @@ BlobApi::DataResponse DataRepository::GetBlobData(
170170
if (service == kBlobService) {
171171
storage_response = BlobApi::GetBlob(
172172
storage_api_lookup.GetResult(), layer, data_handle.value(),
173-
data_request.GetBillingTag(), boost::none, context);
173+
request.GetBillingTag(), boost::none, context);
174174
} else {
175175
auto volatile_blob = VolatileBlobApi::GetVolatileBlob(
176176
storage_api_lookup.GetResult(), layer, data_handle.value(),
177-
data_request.GetBillingTag(), context);
177+
request.GetBillingTag(), context);
178178
storage_response = BlobApi::DataResponse(volatile_blob.MoveResult());
179179
}
180180

olp-cpp-sdk-dataservice-read/src/repositories/DataRepository.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class DataRepository final {
4545
client::CancellationContext context);
4646

4747
BlobApi::DataResponse GetVersionedData(const std::string& layer_id,
48-
const DataRequest& data_request,
48+
const DataRequest& request,
4949
int64_t version,
5050
client::CancellationContext context);
5151

@@ -55,7 +55,7 @@ class DataRepository final {
5555

5656
BlobApi::DataResponse GetBlobData(const std::string& layer,
5757
const std::string& service,
58-
const DataRequest& data_request,
58+
const DataRequest& request,
5959
client::CancellationContext context);
6060

6161
private:

olp-cpp-sdk-dataservice-read/src/repositories/PartitionsCacheRepository.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class PartitionsCacheRepository final {
6565
const QuadTreeIndex& quad_tree,
6666
const boost::optional<int64_t>& version);
6767

68-
bool Get(const std::string& layer, geo::TileKey key, int32_t depth,
68+
bool Get(const std::string& layer, geo::TileKey tile_key, int32_t depth,
6969
const boost::optional<int64_t>& version, QuadTreeIndex& tree);
7070

7171
void Clear(const std::string& layer_id);

0 commit comments

Comments
 (0)