Skip to content

Commit bcb1810

Browse files
committed
a good version
1 parent ff73dc4 commit bcb1810

13 files changed

Lines changed: 62 additions & 55 deletions

File tree

.clangd

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,27 @@ CompileFlags:
55
- "-D_GNU_SOURCE"
66
- "-Wall"
77
- "-Wextra"
8-
- "-Werror"
9-
- "-fsanitize=address"
8+
- "-Wpedantic"
109
- "-xc"
10+
Remove:
11+
- "-Werror"
1112

1213
Diagnostics:
1314
ClangTidy:
14-
Add: [bugprone-*, clang-analyzer-*, performance-*, readability-*]
15-
Remove: [abseil-*, llvm-*, readability-identifier-length, bugprone-easily-swappable-parameters]
15+
Add:
16+
- "bugprone-*"
17+
- "clang-analyzer-*"
18+
- "performance-*"
19+
- "readability-*"
20+
- "cert-*"
21+
CheckOptions:
22+
cert-err33-c.CheckedFunctions: "-::fprintf;-::printf;-::sprintf"
23+
Remove:
24+
- "abseil-*"
25+
- "llvm-*"
26+
- "readability-identifier-length"
27+
- "readability-isolate-declaration"
28+
- "bugprone-easily-swappable-parameters"
1629

1730
Index:
1831
Background: Build

.github/workflows/test.yml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,37 @@
1-
name: C CI
2-
31
on: [push]
42

53
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v6
8+
- run: git submodule update --init --recursive
9+
- name: Install GCC 15
10+
run: |
11+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
12+
sudo apt-get update
13+
sudo apt-get install -y gcc-15 g++-15
14+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-15 100
15+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-15 100
16+
- run: make test -s
17+
618
build:
719
runs-on: ubuntu-latest
820
steps:
9-
- uses: actions/checkout@v5
21+
- uses: actions/checkout@v6
22+
- run: git submodule update --init --recursive
23+
- name: Install GCC 15
24+
run: |
25+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
26+
sudo apt-get update
27+
sudo apt-get install -y gcc-15 g++-15
28+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-15 100
29+
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-15 100
30+
- run: make build -s
31+
32+
build_mac:
33+
runs-on: macos-latest
34+
steps:
35+
- uses: actions/checkout@v6
1036
- run: git submodule update --init --recursive
11-
- run: make build -s
37+
- run: make build -s

.vscode/c_cpp_properties.json

Lines changed: 0 additions & 20 deletions
This file was deleted.

cache_del/numbers/.gitkeep

Whitespace-only changes.

cache_del/pieces/.gitkeep

Whitespace-only changes.

cache_del/res/.gitkeep

Whitespace-only changes.

clean_cache.sh

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/big/code.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121

2222

23-
#define PIECE_SIZE 16
23+
#define PIECE_SIZE 20
2424
// #define CACHE "/mnt/wsl/wsl_data/cache"
2525
#define CACHE "cache"
2626
#define PATH_MAX_LEN 256
@@ -62,7 +62,6 @@ static void split_sig(sig_num_t out[3], uint64_t i_0, uint64_t span)
6262
return;
6363
}
6464

65-
// NOLINTNEXTLINE(readability-isolate-declaration)
6665
sig_num_t res_1[3], res_2[3];
6766
split_sig(res_1, i_0 , span - 1);
6867
split_sig(res_2, i_0 + B(span - 1), span - 1);
@@ -75,7 +74,6 @@ static void split_sig(sig_num_t out[3], uint64_t i_0, uint64_t span)
7574
static void sig_res_path_set(char path[PATH_MAX_LEN], uint64_t i_0, uint64_t span)
7675
{
7776
uint64_t i_max = i_0 + B(span) - 1;
78-
span = span - PIECE_SIZE;
7977
snprintf(path, PATH_MAX_LEN, CACHE "/pieces/p_" U64P(015) "_" U64P(02) "_" U64P(015) ".bin", i_0, span, i_max);
8078
}
8179

@@ -551,6 +549,7 @@ flt_num_t pi_big(uint64_t size)
551549

552550
flt_pi = flt_num_add(flt_pi, flt_num_wrap(3, size));
553551
pi_save(size, flt_pi);
552+
union_res_delete(size, 1, index_max, 0);
554553
return flt_pi;
555554
}
556555

lib/union/.clangd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Diagnostics:
2+
ClangTidy:
3+
Remove:
4+
- "bugprone-switch-missing-default-case"

lib/union/code.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#include <stdio.h>
22
#include <stdlib.h>
33

4-
#include "debug.h"
5-
#include "../../mods/clu/header.h"
6-
#include "../../mods/macros/assert.h"
4+
#include "debug.h" // IWYU pragma: keep
5+
#include "../../mods/clu/header.h" // IWYU pragma: keep
76
#include "../../mods/macros/uint.h"
87
#include "../../mods/number/lib/num/struct.h"
98

0 commit comments

Comments
 (0)