mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
Part 5 of C-style cast cppcheck (#289)
Fixes some cstyleCasts part 5 closes some: #252
This commit is contained in:
commit
cebc6541c1
@ -53,9 +53,11 @@ void hwlmGenerateDumpFiles(const HWLM *h, const string &base) {
|
|||||||
|
|
||||||
switch (h->type) {
|
switch (h->type) {
|
||||||
case HWLM_ENGINE_NOOD:
|
case HWLM_ENGINE_NOOD:
|
||||||
|
// cppcheck-suppress cstyleCast
|
||||||
noodPrintStats(reinterpret_cast<const noodTable *>(HWLM_C_DATA(h)), f);
|
noodPrintStats(reinterpret_cast<const noodTable *>(HWLM_C_DATA(h)), f);
|
||||||
break;
|
break;
|
||||||
case HWLM_ENGINE_FDR:
|
case HWLM_ENGINE_FDR:
|
||||||
|
// cppcheck-suppress cstyleCast
|
||||||
fdrPrintStats(reinterpret_cast<const FDR *>(HWLM_C_DATA(h)), f);
|
fdrPrintStats(reinterpret_cast<const FDR *>(HWLM_C_DATA(h)), f);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -123,7 +123,7 @@ void describeNode(const NFA *n, const mcclellan *m, u16 i, FILE *f) {
|
|||||||
|
|
||||||
if (aux->accel_offset) {
|
if (aux->accel_offset) {
|
||||||
dumpAccelDot(f, i,
|
dumpAccelDot(f, i,
|
||||||
&((const gough_accel *)(reinterpret_cast<const char *>(m) + aux->accel_offset))->accel);
|
&(reinterpret_cast<const gough_accel *>(reinterpret_cast<const char *>(m) + aux->accel_offset))->accel);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aux->accept_eod) {
|
if (aux->accept_eod) {
|
||||||
|
@ -126,8 +126,8 @@ void nfaExecLbrTruf_dump(const NFA *nfa, const string &base) {
|
|||||||
const lbr_truf *lt = reinterpret_cast<const lbr_truf *>(getImplNfa(nfa));
|
const lbr_truf *lt = reinterpret_cast<const lbr_truf *>(getImplNfa(nfa));
|
||||||
lbrDumpCommon(<->common, f);
|
lbrDumpCommon(<->common, f);
|
||||||
|
|
||||||
CharReach cr = truffle2cr((const u8 *)(<->mask1),
|
CharReach cr = truffle2cr(reinterpret_cast<const u8 *>(<->mask1),
|
||||||
(const u8 *)(<->mask2));
|
reinterpret_cast<const u8 *>(<->mask2));
|
||||||
fprintf(f, "TRUFFLE model, scanning for: %s (%zu chars)\n",
|
fprintf(f, "TRUFFLE model, scanning for: %s (%zu chars)\n",
|
||||||
describeClass(cr, 20, CC_OUT_TEXT).c_str(), cr.count());
|
describeClass(cr, 20, CC_OUT_TEXT).c_str(), cr.count());
|
||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
|
@ -237,7 +237,7 @@ unichar readUtf8CodePoint2c(const char *s) {
|
|||||||
|
|
||||||
static
|
static
|
||||||
unichar readUtf8CodePoint3c(const char *s) {
|
unichar readUtf8CodePoint3c(const char *s) {
|
||||||
auto *ts = (const u8 *)s;
|
auto *ts = reinterpret_cast<const u8 *>(s);
|
||||||
assert(ts[0] >= 0xe0 && ts[0] < 0xf0);
|
assert(ts[0] >= 0xe0 && ts[0] < 0xf0);
|
||||||
assert(ts[1] >= 0x80 && ts[1] < 0xc0);
|
assert(ts[1] >= 0x80 && ts[1] < 0xc0);
|
||||||
assert(ts[2] >= 0x80 && ts[2] < 0xc0);
|
assert(ts[2] >= 0x80 && ts[2] < 0xc0);
|
||||||
@ -253,7 +253,7 @@ unichar readUtf8CodePoint3c(const char *s) {
|
|||||||
|
|
||||||
static
|
static
|
||||||
unichar readUtf8CodePoint4c(const char *s) {
|
unichar readUtf8CodePoint4c(const char *s) {
|
||||||
auto *ts = (const u8 *)s;
|
auto *ts = reinterpret_cast<const u8 *>(s);
|
||||||
assert(ts[0] >= 0xf0 && ts[0] < 0xf8);
|
assert(ts[0] >= 0xf0 && ts[0] < 0xf8);
|
||||||
assert(ts[1] >= 0x80 && ts[1] < 0xc0);
|
assert(ts[1] >= 0x80 && ts[1] < 0xc0);
|
||||||
assert(ts[2] >= 0x80 && ts[2] < 0xc0);
|
assert(ts[2] >= 0x80 && ts[2] < 0xc0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user