Skip to content

Commit 56e2ee9

Browse files
authored
Merge pull request #233 from kojix2/fix-compiler-warnings
Fix compiler warnings
2 parents 3fb55ca + 3daaa9c commit 56e2ee9

File tree

12 files changed

+14
-18
lines changed

12 files changed

+14
-18
lines changed

ext/numo/narray/array.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ na_ary_composition_for_struct(VALUE nstruct, VALUE ary)
620620

621621

622622
void
623-
Init_nary_array()
623+
Init_nary_array(void)
624624
{
625625
rb_define_singleton_method(cNArray, "array_shape", na_s_array_shape, 1);
626626
rb_define_singleton_method(cNArray, "array_type", na_s_array_type, 1);

ext/numo/narray/data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ numo_na_dot(VALUE self, VALUE other)
945945
#endif
946946

947947
void
948-
Init_nary_data()
948+
Init_nary_data(void)
949949
{
950950
rb_define_method(cNArray, "copy", na_copy, 0); // deprecated
951951

ext/numo/narray/gen/tmpl/qsort.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,7 @@
7676
(es) % sizeof(long) ? 2 : (es) == sizeof(long)? 0 : 1;
7777

7878
static inline void
79-
swapfunc(a, b, n, swaptype)
80-
char *a,
81-
*b;
82-
size_t n;
83-
int swaptype;
79+
swapfunc(char *a, char *b, size_t n, int swaptype)
8480
{
8581
if (swaptype <= 1)
8682
swapcode(long, a, b, n);

ext/numo/narray/gen/tmpl_bit/mask.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static void
7575
#define cIndex numo_cInt32
7676
#endif
7777

78-
static void shape_error() {
78+
static void shape_error(void) {
7979
rb_raise(nary_eShapeError,"mask and masked arrays must have the same shape");
8080
}
8181

ext/numo/narray/index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1144,7 +1144,7 @@ static VALUE na_at(int argc, VALUE *argv, VALUE self)
11441144
}
11451145

11461146
void
1147-
Init_nary_index()
1147+
Init_nary_index(void)
11481148
{
11491149
rb_define_method(cNArray, "slice", na_slice, -1);
11501150
rb_define_method(cNArray, "[]", na_aref, -1);

ext/numo/narray/math.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static VALUE nary_math_method_missing(int argc, VALUE *argv, VALUE mod)
109109

110110

111111
void
112-
Init_nary_math()
112+
Init_nary_math(void)
113113
{
114114
VALUE hCast;
115115

ext/numo/narray/narray.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1987,7 +1987,7 @@ na_equal(VALUE self, volatile VALUE other)
19871987

19881988
/* initialization of NArray Class */
19891989
void
1990-
Init_narray()
1990+
Init_narray(void)
19911991
{
19921992
#ifdef HAVE_RB_EXT_RACTOR_SAFE
19931993
rb_ext_ractor_safe(true);

ext/numo/narray/ndloop.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1965,7 +1965,7 @@ na_ndloop_with_index(nf, argc, va_alist)
19651965

19661966

19671967
void
1968-
Init_nary_ndloop()
1968+
Init_nary_ndloop(void)
19691969
{
19701970
id_cast = rb_intern("cast");
19711971
id_extract = rb_intern("extract");

ext/numo/narray/numo/types/complex.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ static inline dtype NUM2COMP(VALUE v) {
4747
(isinf(IMAG(x)) && signbit(IMAG(x))))
4848
#define c_isfinite(x) (isfinite(REAL(x)) && isfinite(IMAG(x)))
4949

50-
static inline dtype c_zero() {
50+
static inline dtype c_zero(void) {
5151
dtype z;
5252
REAL(z) = 0;
5353
IMAG(z) = 0;
5454
return z;
5555
}
5656

57-
static inline dtype c_one() {
57+
static inline dtype c_one(void) {
5858
dtype z;
5959
REAL(z) = 1;
6060
IMAG(z) = 0;

ext/numo/narray/rand.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#endif
1212

1313
static u_int64_t
14-
random_seed()
14+
random_seed(void)
1515
{
1616
static int n = 0;
1717
struct timeval tv;
@@ -39,7 +39,7 @@ nary_s_srand(int argc, VALUE *argv, VALUE obj)
3939
}
4040

4141
void
42-
Init_nary_rand() {
42+
Init_nary_rand(void) {
4343
rb_define_singleton_method(cNArray, "srand", nary_s_srand, -1);
4444
init_gen_rand(0);
4545
}

0 commit comments

Comments
 (0)