Skip to content

Commit 68ca377

Browse files
committed
compilation warnings
1 parent d1f6344 commit 68ca377

File tree

3 files changed

+26
-21
lines changed

3 files changed

+26
-21
lines changed

bindings/rust/src/bindings/generated.rs

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindings/rust/src/bindings/mod.rs

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,16 +184,21 @@ impl KZGSettings {
184184
/// attempt to free memory it doesn't own)
185185
#[inline]
186186
pub(crate) fn from_raw(raw: &'static RawKzgSettings) -> Result<Self, bytemuck::PodCastError> {
187-
let x_ext_fft_columns = raw.x_ext_fft_columns.as_ptr() as *const _;
187+
let x_ext_fft_columns = raw.x_ext_fft_columns.as_ptr() as *mut _;
188188
Ok(Self {
189-
roots_of_unity: try_cast_slice(&raw.roots_of_unity)?.as_ptr(),
190-
brp_roots_of_unity: try_cast_slice(&raw.brp_roots_of_unity)?.as_ptr(),
191-
reverse_roots_of_unity: try_cast_slice(&raw.reverse_roots_of_unity)?.as_ptr(),
192-
g1_values_monomial: try_cast_slice(&raw.g1_values_monomial)?.as_ptr(),
193-
g1_values_lagrange_brp: try_cast_slice(&raw.g1_values_lagrange_brp)?.as_ptr(),
194-
g2_values_monomial: try_cast_slice(&raw.g2_values_monomial)?.as_ptr(),
189+
roots_of_unity: try_cast_slice::<_, fr_t>(&raw.roots_of_unity)?.as_ptr() as *mut fr_t,
190+
brp_roots_of_unity: try_cast_slice::<_, fr_t>(&raw.brp_roots_of_unity)?.as_ptr()
191+
as *mut fr_t,
192+
reverse_roots_of_unity: try_cast_slice::<_, fr_t>(&raw.reverse_roots_of_unity)?.as_ptr()
193+
as *mut fr_t,
194+
g1_values_monomial: try_cast_slice::<_, g1_t>(&raw.g1_values_monomial)?.as_ptr()
195+
as *mut g1_t,
196+
g1_values_lagrange_brp: try_cast_slice::<_, g1_t>(&raw.g1_values_lagrange_brp)?.as_ptr()
197+
as *mut g1_t,
198+
g2_values_monomial: try_cast_slice::<_, g2_t>(&raw.g2_values_monomial)?.as_ptr()
199+
as *mut g2_t,
195200
x_ext_fft_columns,
196-
tables: ptr::null(),
201+
tables: ptr::null_mut(),
197202
wbits: raw.wbits,
198203
scratch_size: raw.scratch_size,
199204
})

src/setup/settings.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ typedef struct {
3131
* The array contains `FIELD_ELEMENTS_PER_EXT_BLOB + 1` elements.
3232
* The array starts and ends with Fr::one().
3333
*/
34-
const fr_t *roots_of_unity;
34+
fr_t *roots_of_unity;
3535
/**
3636
* Roots of unity for the subgroup of size `FIELD_ELEMENTS_PER_EXT_BLOB` in bit-reversed order.
3737
*
@@ -41,7 +41,7 @@ typedef struct {
4141
*
4242
* The array contains `FIELD_ELEMENTS_PER_EXT_BLOB` elements.
4343
*/
44-
const fr_t *brp_roots_of_unity;
44+
fr_t *brp_roots_of_unity;
4545
/**
4646
* Roots of unity for the subgroup of size `FIELD_ELEMENTS_PER_EXT_BLOB` in reversed order.
4747
*
@@ -57,17 +57,17 @@ typedef struct {
5757
* G1 group elements from the trusted setup in monomial form.
5858
* The array contains `NUM_G1_POINTS = FIELD_ELEMENTS_PER_BLOB` elements.
5959
*/
60-
const g1_t *g1_values_monomial;
60+
g1_t *g1_values_monomial;
6161
/**
6262
* G1 group elements from the trusted setup in Lagrange form and bit-reversed order.
6363
* The array contains `NUM_G1_POINTS = FIELD_ELEMENTS_PER_BLOB` elements.
6464
*/
65-
const g1_t *g1_values_lagrange_brp;
65+
g1_t *g1_values_lagrange_brp;
6666
/**
6767
* G2 group elements from the trusted setup in monomial form.
6868
* The array contains `NUM_G2_POINTS` elements.
6969
*/
70-
const g2_t *g2_values_monomial;
70+
g2_t *g2_values_monomial;
7171
/** Data used during FK20 proof generation. */
7272
g1_t **x_ext_fft_columns;
7373
/** The precomputed tables for fixed-base MSM. */

0 commit comments

Comments
 (0)