Skip to content

Commit 0a82659

Browse files
deftioclaude
andcommitted
Fix clang-tidy misc-no-recursion, dead store bug, and improve site styling
Disable misc-no-recursion check — recursion is fundamental to trie traversal and JSON parsing. Fix silent error in extract_entries() where TP_ERR_JSON_DEPTH was set but never returned (dead store). Add custom SCSS overrides to widen site content area and use consistent sans-serif fonts. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 35886a8 commit 0a82659

3 files changed

Lines changed: 88 additions & 0 deletions

File tree

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Checks: >
99
misc-*,
1010
-misc-unused-parameters,
1111
-misc-include-cleaner,
12+
-misc-no-recursion,
1213
performance-*,
1314
portability-*,
1415
readability-inconsistent-declaration-parameter-name,

docs/assets/css/style.scss

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
---
3+
4+
$content-width: 1100px;
5+
$on-large: 1200px;
6+
7+
@import "minima";
8+
9+
/* ── Wider content area ──────────────────────────────────────────────── */
10+
11+
.wrapper {
12+
max-width: $content-width;
13+
}
14+
15+
/* ── Consistent sans-serif fonts ─────────────────────────────────────── */
16+
17+
.site-title,
18+
.site-title:visited {
19+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
20+
Helvetica, Arial, sans-serif;
21+
font-weight: 600;
22+
letter-spacing: -0.5px;
23+
}
24+
25+
/* ── Headings ────────────────────────────────────────────────────────── */
26+
27+
h2 {
28+
border-bottom: 1px solid #e8e8e8;
29+
padding-bottom: 0.3em;
30+
}
31+
32+
/* ── Navigation ──────────────────────────────────────────────────────── */
33+
34+
.site-header {
35+
border-bottom: 2px solid #424242;
36+
}
37+
38+
.site-nav .page-link {
39+
margin-left: 20px;
40+
}
41+
42+
/* ── Tables ──────────────────────────────────────────────────────────── */
43+
44+
table {
45+
width: 100%;
46+
border-collapse: collapse;
47+
margin-bottom: 1em;
48+
}
49+
50+
th,
51+
td {
52+
padding: 0.5em 0.75em;
53+
border: 1px solid #e8e8e8;
54+
text-align: left;
55+
}
56+
57+
th {
58+
background-color: #f7f7f7;
59+
font-weight: 600;
60+
}
61+
62+
/* ── Code blocks ─────────────────────────────────────────────────────── */
63+
64+
pre,
65+
code {
66+
font-size: 0.9em;
67+
border-radius: 4px;
68+
}
69+
70+
pre {
71+
padding: 12px 16px;
72+
overflow-x: auto;
73+
}
74+
75+
/* ── Footer ──────────────────────────────────────────────────────────── */
76+
77+
.site-footer {
78+
border-top: 2px solid #e8e8e8;
79+
}

src/json/json_decode.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,14 @@ static tp_result extract_entries(const uint8_t *buf, size_t buf_len, flat_entry
781781
}
782782
}
783783

784+
if (rc != TP_OK) {
785+
tp_bs_reader_destroy(&reader);
786+
free(stack);
787+
free(entries);
788+
tp_dict_close(&dict);
789+
return rc;
790+
}
791+
784792
done:
785793
tp_bs_reader_destroy(&reader);
786794
free(stack);

0 commit comments

Comments
 (0)