Skip to content

Commit

Permalink
Merge pull request #21 from 0xPolygonID/warnings_remove
Browse files Browse the repository at this point in the history
Remove some compilation and CI warnings
  • Loading branch information
olomix authored Mar 4, 2024
2 parents 31e5dda + 14b20e4 commit a111361
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
submodules: "recursive"

- name: Cache gmp build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
depends/gmp
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
cd ../
- name: Cache circuits
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
circuits
Expand All @@ -126,23 +126,23 @@ jobs:
./run_tests.sh
- name: upload macOS arm64 artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: witnesscalc-macOS-arm64
path: |
package
if-no-files-found: error

- name: upload iOS artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: witnesscalc-iOS
path: |
package_ios
if-no-files-found: error

- name: upload iOS Simulator artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: witnesscalc-iOS-Simulator
path: |
Expand All @@ -163,7 +163,7 @@ jobs:
version: 1.0

- name: Cache gmp build
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
depends/gmp
Expand All @@ -189,23 +189,23 @@ jobs:
run: make android_x86_64

- name: upload Linux amd64 artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: witnesscalc-linux-amd64
path: |
package
if-no-files-found: error

- name: upload Android artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: witnesscalc-Android
path: |
package_android
if-no-files-found: error

- name: upload Android x86_64 artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: witnesscalc-Android-x86_64
path: |
Expand Down
5 changes: 3 additions & 2 deletions build/fr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ char *Fr_element2str(PFrElement pE) {
mpz_t r;
if (!(pE->type & Fr_LONG)) {
if (pE->shortVal>=0) {
char *r = new char[32];
sprintf(r, "%d", pE->shortVal);
const size_t rLn = 32;
char *r = new char[rLn];
snprintf(r, rLn, "%d", pE->shortVal);
return r;
} else {
mpz_init_set_si(r, pE->shortVal);
Expand Down
5 changes: 3 additions & 2 deletions src/calcwit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ void Circom_CalcWit::setInputSignal(u64 h, uint i, FrElement & val){
uint si = circuit->InputHashMap[pos].signalid+i;
if (inputSignalAssigned[si-get_main_input_signal_start()]) {
fprintf(stderr, "Signal assigned twice: %d\n", si);
char err[256];
sprintf(err, "Signal assigned twice: %d", si);
const size_t errLn = 256;
char err[errLn];
snprintf(err, errLn, "Signal assigned twice: %d", si);
throw std::runtime_error(err);
}
signalValues[si] = val;
Expand Down
2 changes: 1 addition & 1 deletion src/witnesscalc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Circom_Circuit* loadCircuit(const void *buffer, unsigned long buffer_size) {
templateInsId2IOSignalInfo1[index[i]] = p;
}
}
circuit->templateInsId2IOSignalInfo = move(templateInsId2IOSignalInfo1);
circuit->templateInsId2IOSignalInfo = std::move(templateInsId2IOSignalInfo1);

return circuit;
}
Expand Down

0 comments on commit a111361

Please sign in to comment.