Skip to content

Commit 89207d5

Browse files
author
Grok Compression
committed
cppcheck corrections
1 parent 17948d1 commit 89207d5

File tree

4 files changed

+62
-61
lines changed

4 files changed

+62
-61
lines changed

src/lib/core/canvas/tile/TileComponent.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,8 +235,9 @@ struct TileComponent : public Rect32
235235
dealloc();
236236
window_ = new TileComponentWindow<int32_t>(
237237
isCompressor_, tccp_->qmfbid_ == 1, wholeTileDecompress_,
238-
Rect32(resolutions_ + num_resolutions_ - 1), Rect32(this), Rect32(unreducedTileCompOrImageCompWindow),
239-
num_resolutions_, isCompressor_ ? num_resolutions_ : resolutions_to_decompress_);
238+
Rect32(resolutions_ + num_resolutions_ - 1), Rect32(this),
239+
Rect32(unreducedTileCompOrImageCompWindow), num_resolutions_,
240+
isCompressor_ ? num_resolutions_ : resolutions_to_decompress_);
240241
}
241242

242243
/**

src/lib/core/tile_processor/TileProcessor.h

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -49,44 +49,44 @@ struct TileProcessor : virtual public ITileProcessor
4949
*/
5050
virtual ~TileProcessor();
5151

52-
void setProcessors(MarkerParser* parser);
52+
void setProcessors(MarkerParser* parser) override;
5353

54-
void emplaceBlockTask(tf::Task& t);
54+
void emplaceBlockTask(tf::Task& t) override;
5555

5656
/**
5757
* @brief Initializes a TileProcessor
5858
*/
59-
virtual bool init(void);
59+
virtual bool init(void) override;
6060

61-
void setStream(IStream* stream, bool ownsStream);
61+
void setStream(IStream* stream, bool ownsStream) override;
6262

6363
bool decompressWithTLM(const std::shared_ptr<TPFetchSeq>& tilePartFetchSeq, CoderPool* streamPool,
6464
Rect32 unreducedImageBounds, std::function<void()> post,
65-
TileFutureManager& futures);
65+
TileFutureManager& futures) override;
6666

67-
bool decompressPrepareWithTLM(const std::shared_ptr<TPFetchSeq>& tilePartFetchSeq);
67+
bool decompressPrepareWithTLM(const std::shared_ptr<TPFetchSeq>& tilePartFetchSeq) override;
6868

6969
/**
7070
* @brief Performs post T1 processing
7171
* @return true if successful
7272
*/
73-
bool doPostT1(void);
73+
bool doPostT1(void) override;
7474

7575
/**
7676
* @brief Prepares for decompresion
7777
*
7878
* If this fails, then TileProcessor doesn't get initialized.
7979
*
8080
*/
81-
void prepareForDecompression(void);
81+
void prepareForDecompression(void) override;
8282

8383
/**
8484
* @brief Parses tile part
8585
*
8686
* @return true if successful
8787
*/
8888
bool parseTilePart(std::vector<std::unique_ptr<MarkerParser>>* parsers, IStream* bifurcatedStream,
89-
uint16_t mainMarkerId, TilePartInfo tilePartInfo);
89+
uint16_t mainMarkerId, TilePartInfo tilePartInfo) override;
9090

9191
/**
9292
* @brief Reads SOT marker
@@ -98,7 +98,7 @@ struct TileProcessor : virtual public ITileProcessor
9898
* @return true
9999
*/
100100
bool readSOT(IStream* stream, uint8_t* headerData, uint16_t headerSize,
101-
TilePartInfo& tilePartInfo, bool needToReadIndexAndLength);
101+
TilePartInfo& tilePartInfo, bool needToReadIndexAndLength) override;
102102

103103
/**
104104
* @brief Schedule T2/T1 decompression
@@ -110,13 +110,13 @@ struct TileProcessor : virtual public ITileProcessor
110110
* @return true if successful
111111
*/
112112
bool scheduleT2T1(CoderPool* coderPool, Rect32 unreducedImageBounds, std::function<void()> post,
113-
TileFutureManager& futures);
113+
TileFutureManager& futures) override;
114114
/**
115115
* @brief Performs post T2+T1 processing
116116
*
117117
* @param scratch
118118
*/
119-
void post_decompressT2T1(GrkImage* scratch);
119+
void post_decompressT2T1(GrkImage* scratch) override;
120120

121121
/**
122122
* @brief Updates differential decompress state
@@ -125,62 +125,62 @@ struct TileProcessor : virtual public ITileProcessor
125125
* @return true
126126
* @return false
127127
*/
128-
bool differentialUpdate(Rect32 unreducedImageBounds);
128+
bool differentialUpdate(Rect32 unreducedImageBounds) override;
129129

130130
/**
131131
* @brief Gets the tile @ref GrkImage
132132
*
133133
* @return GrkImage*
134134
*/
135-
GrkImage* getImage(void);
135+
GrkImage* getImage(void) override;
136136

137137
/**
138138
* @brief Gets the tile @ref GrkImage
139139
*
140140
* @param img @ref GrkImage
141141
*/
142-
void setImage(GrkImage* img);
142+
void setImage(GrkImage* img) override;
143143

144144
/**
145145
* @brief Get the Unreduced Tile Window object
146146
*
147147
* @return Rect32
148148
*/
149-
Rect32 getUnreducedTileWindow(void);
149+
Rect32 getUnreducedTileWindow(void) override;
150150

151151
/**
152152
* @brief
153153
*
154154
* @return TileCodingParams*
155155
*/
156-
TileCodingParams* getTCP(void);
156+
TileCodingParams* getTCP(void) override;
157157

158158
/**
159159
* @brief Get the Max Num Decompress Resolutions object
160160
*
161161
* @return uint8_t
162162
*/
163-
uint8_t getMaxNumDecompressResolutions(void);
163+
uint8_t getMaxNumDecompressResolutions(void) override;
164164

165165
/**
166166
* @brief Get the Stream object
167167
*
168168
* @return IStream*
169169
*/
170-
IStream* getStream(void);
170+
IStream* getStream(void) override;
171171

172172
/**
173173
* @brief Get the Index object
174174
*
175175
* @return uint16_t
176176
*/
177-
uint16_t getIndex(void) const;
177+
uint16_t getIndex(void) const override;
178178

179179
/**
180180
* @brief
181181
*
182182
*/
183-
void incrementIndex(void);
183+
void incrementIndex(void) override;
184184

185185
/**
186186
* @brief Get the Tile object
@@ -189,90 +189,90 @@ struct TileProcessor : virtual public ITileProcessor
189189
*/
190190
Tile* getTile(void);
191191

192-
grk_progression_state getProgressionState();
192+
grk_progression_state getProgressionState() override;
193193

194194
/**
195195
* @brief Get the Scheduler object
196196
*
197197
* @return CodecScheduler*
198198
*/
199-
CodecScheduler* getScheduler(void);
199+
CodecScheduler* getScheduler(void) override;
200200

201201
/**
202202
* @brief
203203
*
204204
* @return true
205205
* @return false
206206
*/
207-
bool isCompressor(void);
207+
bool isCompressor(void) override;
208208

209209
/**
210210
* @brief Get the Num Processed Packets object
211211
*
212212
* @return uint64_t
213213
*/
214-
uint64_t getNumProcessedPackets(void);
214+
uint64_t getNumProcessedPackets(void) override;
215215

216216
/**
217217
* @brief
218218
*
219219
*/
220-
void incNumProcessedPackets(void);
220+
void incNumProcessedPackets(void) override;
221221

222222
/**
223223
* @brief
224224
*
225225
* @param numPackets
226226
*/
227-
void incNumProcessedPackets(uint64_t numPackets);
227+
void incNumProcessedPackets(uint64_t numPackets) override;
228228

229229
/**
230230
* @brief
231231
*
232232
*/
233-
void incNumReadDataPackets(void);
233+
void incNumReadDataPackets(void) override;
234234

235235
/**
236236
* @brief Gets the Tile Cache Strategy object
237237
*
238238
* @return uint32_t
239239
*/
240-
uint32_t getTileCacheStrategy(void);
240+
uint32_t getTileCacheStrategy(void) override;
241241

242242
/**
243243
* @brief Gets the Current Plugin Tile object
244244
*
245245
* @return grk_plugin_tile*
246246
*/
247-
grk_plugin_tile* getCurrentPluginTile(void) const;
247+
grk_plugin_tile* getCurrentPluginTile(void) const override;
248248

249249
/**
250250
* @brief Set the Current Plugin Tile object
251251
*
252252
* @param tile
253253
*/
254-
void setCurrentPluginTile(grk_plugin_tile* tile);
254+
void setCurrentPluginTile(grk_plugin_tile* tile) override;
255255

256256
/**
257257
* @brief Get the Coding Params object
258258
*
259259
* @return CodingParams*
260260
*/
261-
CodingParams* getCodingParams(void);
261+
CodingParams* getCodingParams(void) override;
262262

263263
/**
264264
* @brief Get the Header Image object
265265
*
266266
* @return GrkImage*
267267
*/
268-
GrkImage* getHeaderImage(void);
268+
GrkImage* getHeaderImage(void) override;
269269

270270
/**
271271
* @brief Get the Packet Length Cache object
272272
*
273273
* @return std::shared_ptr<PacketLengthCache<uint32_t>>
274274
*/
275-
std::shared_ptr<PacketLengthCache<uint32_t>> getPacketLengthCache(void);
275+
std::shared_ptr<PacketLengthCache<uint32_t>> getPacketLengthCache(void) override;
276276

277277
/**
278278
* @brief
@@ -281,43 +281,43 @@ struct TileProcessor : virtual public ITileProcessor
281281
* @return true
282282
* @return false
283283
*/
284-
bool needsMctDecompress(uint16_t compno);
284+
bool needsMctDecompress(uint16_t compno) override;
285285

286286
/**
287287
* @brief
288288
*
289289
* @return true
290290
* @return false
291291
*/
292-
bool needsMctDecompress(void);
292+
bool needsMctDecompress(void) override;
293293

294294
/**
295295
* @brief gets @ref Mct
296296
*
297297
* @return Mct*
298298
*/
299-
Mct* getMCT(void);
299+
Mct* getMCT(void) override;
300300

301301
/**
302302
* @brief Releases resources - image and tile
303303
*
304304
*/
305-
void release(void);
305+
void release(void) override;
306306

307307
/**
308308
* @brief release select resources
309309
*
310310
* @param strategy tile cache strategy
311311
*/
312-
void release(uint32_t strategy);
312+
void release(uint32_t strategy) override;
313313

314314
/**
315315
* @brief Reads a PLT marker (Packet length, tile-part header)
316316
* @param headerData header data
317317
* @param headerSize size of header data
318318
* @return true if successful
319319
*/
320-
bool readPLT(uint8_t* headerData, uint16_t headerSize);
320+
bool readPLT(uint8_t* headerData, uint16_t headerSize) override;
321321

322322
/**
323323
* @brief Checks if tile is completely parsed.
@@ -326,18 +326,18 @@ struct TileProcessor : virtual public ITileProcessor
326326
*
327327
* @return true if completely parsed, otherwise false
328328
*/
329-
bool allSOTMarkersParsed();
329+
bool allSOTMarkersParsed() override;
330330

331331
/**
332332
* @brief Sets processor to truncated if not all tile parts have
333333
* been parsed
334334
*
335335
*/
336-
void setTruncated(void);
336+
void setTruncated(void) override;
337337

338-
bool hasError(void);
338+
bool hasError(void) override;
339339

340-
bool isInitialized(void);
340+
bool isInitialized(void) override;
341341

342342
protected:
343343
/**

src/lib/core/tile_processor/TileProcessorCompress.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,23 @@ struct TileProcessorCompress : public ITileProcessorCompress, public TileProcess
4444
/**
4545
* @brief Destroys a TileProcessorCompress
4646
*/
47-
~TileProcessorCompress();
47+
~TileProcessorCompress() override;
4848

4949
bool init(void) override;
5050

51-
PacketTracker* getPacketTracker(void);
52-
bool preCompressTile(size_t thread_id);
53-
bool canWritePocMarker(void);
54-
bool writeTilePartT2(uint32_t* tileBytesWritten);
55-
bool doCompress(void);
56-
bool ingestUncompressedData(uint8_t* p_src, uint64_t src_length);
57-
bool needsRateControl(void);
58-
uint32_t getPreCalculatedTileLen(void);
59-
bool canPreCalculateTileLen(void);
60-
void setFirstPocTilePart(bool res);
61-
void setProgIterNum(uint32_t num);
62-
uint8_t getTilePartCounter(void) const;
63-
void incTilePartCounter(void);
51+
PacketTracker* getPacketTracker(void) override;
52+
bool preCompressTile(size_t thread_id) override;
53+
bool canWritePocMarker(void) override;
54+
bool writeTilePartT2(uint32_t* tileBytesWritten) override;
55+
bool doCompress(void) override;
56+
bool ingestUncompressedData(uint8_t* p_src, uint64_t src_length) override;
57+
bool needsRateControl(void) override;
58+
uint32_t getPreCalculatedTileLen(void) override;
59+
bool canPreCalculateTileLen(void) override;
60+
void setFirstPocTilePart(bool res) override;
61+
void setProgIterNum(uint32_t num) override;
62+
uint8_t getTilePartCounter(void) const override;
63+
void incTilePartCounter(void) override;
6464

6565
private:
6666
void transferTileDataFromImage(void);

src/lib/core/util/buffer.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ struct Buffer2d : protected Buffer<T, A>, public Rect32
379379
}
380380
return *this;
381381
}
382-
virtual ~Buffer2d() = default;
382+
virtual ~Buffer2d() override = default;
383383
size_t length(void)
384384
{
385385
return this->num_elts();

0 commit comments

Comments
 (0)