mirror of
https://github.com/upx/upx.git
synced 2025-08-11 22:52:30 +08:00
all: add support for clang-tidy
This commit is contained in:
6
.clang-tidy
Normal file
6
.clang-tidy
Normal file
@ -0,0 +1,6 @@
|
||||
# for clang-tidy-16 from https://clang.llvm.org/extra/clang-tidy/
|
||||
---
|
||||
Checks: 'bugprone-exception-*,clang-analyzer-*,-clang-analyzer-optin.performance.Padding,-clang-analyzer-security.insecureAPI.strcpy,clang-diagnostics-*'
|
||||
FormatStyle: file
|
||||
HeaderFilterRegex: '.*'
|
||||
...
|
@ -52,7 +52,9 @@
|
||||
#pragma clang diagnostic ignored "-Wtautological-constant-compare"
|
||||
#endif
|
||||
|
||||
// NOLINTBEGIN(bugprone-exception-escape)
|
||||
#include <doctest/doctest/parts/doctest.cpp>
|
||||
// NOLINTEND(bugprone-exception-escape)
|
||||
|
||||
#endif // DOCTEST_CONFIG_DISABLE
|
||||
|
||||
|
@ -207,9 +207,12 @@ error:
|
||||
**************************************************************************/
|
||||
|
||||
// ensure proper nullptr usage
|
||||
// TODO later: examine why we need this in the first place
|
||||
#include <cstddef>
|
||||
#undef NULL
|
||||
// NOLINTBEGIN(clang-analyzer-optin.cplusplus.*)
|
||||
#define NULL nullptr
|
||||
// NOLINTEND(clang-analyzer-optin.cplusplus.*)
|
||||
#if defined(__GNUC__)
|
||||
#undef __null
|
||||
#define __null nullptr
|
||||
|
@ -27,8 +27,10 @@
|
||||
#include "../conf.h"
|
||||
#include "compress.h"
|
||||
#include "../util/membuffer.h"
|
||||
// NOLINTBEGIN(clang-analyzer-optin.performance.Padding)
|
||||
#include <zlib/zlib.h>
|
||||
#include <zlib/deflate.h>
|
||||
// NOLINTEND(clang-analyzer-optin.performance.Padding)
|
||||
|
||||
void zlib_compress_config_t::reset() noexcept {
|
||||
mem_clear(this);
|
||||
|
18
src/pefile.h
18
src/pefile.h
@ -417,16 +417,16 @@ protected:
|
||||
struct upx_rleaf;
|
||||
|
||||
MemBuffer mb_start;
|
||||
const byte *start;
|
||||
byte *newstart;
|
||||
upx_rnode *root;
|
||||
upx_rleaf *head;
|
||||
upx_rleaf *current;
|
||||
unsigned dsize;
|
||||
unsigned ssize;
|
||||
const byte *start = nullptr;
|
||||
byte *newstart = nullptr;
|
||||
upx_rnode *root = nullptr;
|
||||
upx_rleaf *head = nullptr;
|
||||
upx_rleaf *current = nullptr;
|
||||
unsigned dsize = 0;
|
||||
unsigned ssize = 0;
|
||||
|
||||
const byte *ibufstart;
|
||||
const byte *ibufend;
|
||||
const byte *ibufstart = nullptr;
|
||||
const byte *ibufend = nullptr;
|
||||
|
||||
void check(const res_dir *, unsigned);
|
||||
upx_rnode *convert(const void *, upx_rnode *, unsigned);
|
||||
|
Reference in New Issue
Block a user