Skip to content

Commit

Permalink
Remove more compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
dfaranha committed May 8, 2024
1 parent 7120fae commit d74bced
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,14 +247,14 @@ if("$ENV{CFLAGS}" STREQUAL "")
set(CFLAGS "/Od" CACHE STRING "Default compiler flags.")
else()
# Turn off all optimizations.
set(CFLAGS "-pipe -std=c99 -O0 -fno-omit-frame-pointer" CACHE STRING "Default compiler flags.")
set(CFLAGS "-pipe -std=c99 -O0 -fno-omit-frame-pointer -Wno-stringop-overflow -Wno-stringop-overread" CACHE STRING "Default compiler flags.")
set(DFLAGS "-ggdb")
endif()
else()
if (MSVC)
set(CFLAGS "/O2" CACHE STRING "Default compiler flags.")
else()
set(CFLAGS "-pipe -std=c99 -O2 -funroll-loops -fomit-frame-pointer" CACHE STRING "Default compiler flags.")
set(CFLAGS "-pipe -std=c99 -O2 -funroll-loops -fomit-frame-pointer -Wno-stringop-overflow -Wno-stringop-overread" CACHE STRING "Default compiler flags.")
endif()
endif()
else()
Expand Down
4 changes: 2 additions & 2 deletions src/ep/relic_ep_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ TMPL_MAP_SVDW(ep, fp, dig_t);
* @param[in] map_fn - the mapping function.
*/
static void ep_map_from_field(ep_t p, const uint8_t *uniform_bytes, size_t len,
const void (*const map_fn)(ep_t, const fp_t)) {
void (*const map_fn)(ep_t, const fp_t)) {
bn_t k;
fp_t t;
ep_t q;
Expand Down Expand Up @@ -219,7 +219,7 @@ void ep_map_sswum(ep_t p, const uint8_t *msg, size_t len) {
/* figure out which hash function to use */
const int abNeq0 = (ep_curve_opt_a() != RLC_ZERO) &&
(ep_curve_opt_b() != RLC_ZERO);
const void (*const map_fn)(ep_t, const fp_t) = (void (*const))
void (*const map_fn)(ep_t, const fp_t) =
(ep_curve_is_ctmap() || abNeq0 ? ep_map_sswu : ep_map_svdw);
ep_map_from_field(p, r, 2 * elm, map_fn);
}
Expand Down
2 changes: 1 addition & 1 deletion src/epx/relic_ep2_map.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static void ep2_map_from_field(ep2_t p, const uint8_t *r, size_t len) {
/* which hash function should we use? */
const int abNeq0 = (ep2_curve_opt_a() != RLC_ZERO) &&
(ep2_curve_opt_b() != RLC_ZERO);
const void (*const map_fn)(ep2_t, fp2_t) = (void (*const))
void (*const map_fn)(ep2_t, fp2_t) = (void (*const))
(ep2_curve_is_ctmap() || abNeq0 ? ep2_map_sswu : ep2_map_svdw);

#define EP2_MAP_CONVERT_BYTES(IDX) \
Expand Down
4 changes: 2 additions & 2 deletions src/epx/relic_ep3_curve.c
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void ep3_curve_mul_a(fp3_t c, const fp3_t a) {
break;
#if FP_RDC != MONTY
case RLC_TINY:
fp3_mul_dig(c, a, ctx->ep3_a[0]);
fp3_mul_dig(c, a, ctx->ep3_a[0][0]);
break;
#endif
default:
Expand All @@ -275,7 +275,7 @@ void ep3_curve_mul_b(fp3_t c, const fp3_t a) {
break;
#if FP_RDC != MONTY
case RLC_TINY:
fp3_mul_dig(c, a, ctx->ep3_b[0]);
fp3_mul_dig(c, a, ctx->ep3_b[0][0]);
break;
#endif
default:
Expand Down

0 comments on commit d74bced

Please sign in to comment.