Skip to content

Commit 0baa0b8

Browse files
committed
convert to UTF-8
1 parent 0c2d8ec commit 0baa0b8

File tree

4 files changed

+60
-60
lines changed

4 files changed

+60
-60
lines changed

ext/bytedata.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ mm_open(struct MmapByteData *mm, const char *fname)
353353
HANDLE hFile;
354354
HANDLE hMap;
355355

356-
/* set parameters
356+
/* set parameters
357357
if (mode == SA_MMAP_RO) {
358358
mode1 = GENERIC_READ;
359359
mode2 = PAGE_READONLY;
@@ -369,7 +369,7 @@ mm_open(struct MmapByteData *mm, const char *fname)
369369
mode1 = GENERIC_READ | GENERIC_WRITE;
370370
mode2 = PAGE_READWRITE;
371371
mode3 = FILE_MAP_ALL_ACCESS;
372-
372+
373373
//mm->other = sa_malloc(sizeof(MMAP_HANDLES));
374374
//if (mm->other == NULL)
375375
// return 1;
@@ -389,7 +389,7 @@ mm_open(struct MmapByteData *mm, const char *fname)
389389
rb_raise(rb_eIOError,"CreateFileMapping error");
390390
return 1;
391391
}
392-
392+
393393
mm->bd.ptr = MapViewOfFile(hMap, mode3, 0, 0, 0);
394394
if (mm->bd.ptr == NULL) {
395395
CloseHandle(hFile);
@@ -442,8 +442,8 @@ mm_open(struct MmapByteData *mm, const char *fname)
442442
struct stat stat_buf;
443443
int flag;
444444
int prot;
445-
446-
/* set parameters
445+
446+
/* set parameters
447447
if (mode == SA_MMAP_RO) {
448448
flag = O_RDONLY;
449449
prot = PROT_READ;
@@ -458,20 +458,20 @@ mm_open(struct MmapByteData *mm, const char *fname)
458458
*/
459459
flag = O_RDWR;
460460
prot = PROT_READ | PROT_WRITE;
461-
461+
462462
/* open the addressed file */
463463
if ((fd = open(fname, flag)) == -1) {
464464
rb_raise(rb_eIOError,"open(2) error");
465465
return 1;
466466
}
467-
467+
468468
/* size of the file */
469469
if (fstat(fd, &stat_buf) != 0) {
470470
close(fd);
471471
rb_raise(rb_eIOError,"fstat(2) error");
472472
return 1;
473473
}
474-
474+
475475
mm->bd.len = stat_buf.st_size;
476476
mm->prot = prot;
477477
mm->flag = flag;
@@ -590,5 +590,5 @@ map_anonymous
590590
?
591591
sync
592592
shared
593-
File object¤«¤éºîÀ®¡©
593+
File objectから作成?
594594
*/

ext/loop.c

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ void ndfunc_init_md_loop(
199199
}
200200
}
201201

202-
// 数チェック itr[dim][0...nargs].n が同じ、または 1
203-
// 繰り返し次元 if (itr[dim][j].n==1) itr[dim][j].step=0;
202+
// 数チェック itr[dim][0...nargs].n が同じ、または 1
203+
// 繰り返し次元 if (itr[dim][j].n==1) itr[dim][j].step=0;
204204
// check the number of iteration for each dimension
205205
shape = ALLOC_N( size_t, max_nd );
206206
for (dim=0; dim < loop_nd ; dim++) {
@@ -232,7 +232,7 @@ void ndfunc_init_md_loop(
232232
//u_len = 1;
233233
for (dim=0; dim<max_nd; dim++) {
234234
shape[dim] = itr[dim][0].n;
235-
//u_len *= itr[dim][0].n; //n[i];
235+
//u_len *= itr[dim][0].n; //n[i];
236236
//printf("shape[%ld]=%ld\n",dim,shape[dim]);
237237
}
238238

@@ -338,9 +338,9 @@ void ndfunc_init_md_loop(
338338

339339
//printf("itr[0][0].step=%ld\n", 0, itr[0][0].step);
340340

341-
// 縮約次元 itr[dim][j].n *= itr[dim-1][j].n; itr[dim-1][j].n = 1;
342-
// 条件: itr[dim-1][j].step == itr[dim][j].n * itr[dim][j].step
343-
// step==0 でもこの条件でオケ
341+
// 縮約次元 itr[dim][j].n *= itr[dim-1][j].n; itr[dim-1][j].n = 1;
342+
// 条件: itr[dim-1][j].step == itr[dim][j].n * itr[dim][j].step
343+
// step==0 でもこの条件でオケ
344344
// itr[dim][j].pos == 0
345345
// itr[dim][j].idx == NULL
346346
// itr[dim-1][j].idx == NULL
@@ -458,7 +458,7 @@ static void ndfunc_md_loop(
458458
// ..
459459
// pos[0] = 32 pos[1] = 56
460460
// pos[0] = 64 pos[1] = 64
461-
//
461+
//
462462
// pos = beg + step*i
463463
// ofs[dim+1] = ofs[dim] + step[dim] * i
464464

@@ -533,7 +533,7 @@ VALUE ndfunc_execute_reduce_main( ndfunc_t *nf, VALUE mark, VALUE args )
533533
ndim = nd-arg_dim;
534534
if (ndim==0)
535535
ni = nd+2;
536-
else
536+
else
537537
ni = nd+1;
538538

539539
itr = ALLOC_N( na_iterator_t*, ni );
@@ -993,7 +993,7 @@ ndfunc_execute_io( VALUE ary, na_simple_func_t func, VALUE io )
993993
}
994994

995995

996-
VALUE
996+
VALUE
997997
na_info_str( VALUE ary )
998998
{
999999
int nd, i;
@@ -1129,9 +1129,9 @@ ndfunc_execute_inspect( VALUE ary, VALUE str, na_text_func_t func, VALUE opt )
11291129

11301130

11311131
// #if 0
1132-
//
1133-
// // cast rule を使わない場合??→ 引数を強制castする
1134-
//
1132+
//
1133+
// // cast rule を使わない場合??→ 引数を強制castする
1134+
//
11351135
// VALUE
11361136
// ndfunc_arg_type( VALUE a )
11371137
// {
@@ -1144,21 +1144,21 @@ ndfunc_execute_inspect( VALUE ary, VALUE str, na_text_func_t func, VALUE opt )
11441144
// case T_BIGNUM:
11451145
// type = rb_cInteger;
11461146
// break;
1147-
// // 整数の値の大きさで分類しなくてよいか?
1147+
// // 整数の値の大きさで分類しなくてよいか?
11481148
// default:
11491149
// type = CLASS_OF(a);
11501150
// }
11511151
// }
11521152
// return type;
11531153
// }
1154-
//
1155-
//
1154+
//
1155+
//
11561156
// VALUE
11571157
// ndfunc_execute_w_cast( ndfunc_t *func, int argc, VALUE *argv )
11581158
// {
11591159
// int i;
11601160
// VALUE a, a_type, f_type;
1161-
//
1161+
//
11621162
// for (i=0; i<argc; i++) {
11631163
// a_type = ndfunc_arg_type(argv[i]);
11641164
// f_type = func->args[i].type;
@@ -1167,25 +1167,25 @@ ndfunc_execute_inspect( VALUE ary, VALUE str, na_text_func_t func, VALUE opt )
11671167
// }
11681168
// return ndfunc_execute( func, argc, argv );
11691169
// }
1170-
//
1171-
//
1172-
//
1170+
//
1171+
//
1172+
//
11731173
// VALUE
11741174
// ndfunc_execute_binary( ndfunc_t *func, VALUE a1, VALUE a2 )
11751175
// {
11761176
// VALUE args[2];
11771177
// VALUE a1_elem, a2_elem;
11781178
// VALUE e1, e2, e3;
1179-
//
1179+
//
11801180
// a1_elem = ndfunc_arg_type(a1);
11811181
// a2_elem = ndfunc_arg_type(a2);
11821182
// e1 = func->args[0].type;
11831183
// e2 = func->args[1].type;
11841184
// e3 = func->args[2].type;
1185-
//
1186-
// // 引数の型が関数定義と異なる場合
1185+
//
1186+
// // 引数の型が関数定義と異なる場合
11871187
// if (a1_elem!=e1 || a2_elem!=e2) {
1188-
// // cast rule を調べる
1188+
// // cast rule を調べる
11891189
// // elem = NElement::CAST_RULE[[a1_elem,a2_elem]]
11901190
// VALUE h = rb_const_get( mNElement, rb_intern("CAST_RULE") );
11911191
// VALUE k = rb_assoc_new( a1_elem, a2_elem );
@@ -1194,11 +1194,11 @@ ndfunc_execute_inspect( VALUE ary, VALUE str, na_text_func_t func, VALUE opt )
11941194
// rb_raise("cast rule not found");
11951195
// return Qnil;
11961196
// } else if (result_type != e3) {
1197-
// // 結果型が異なる場合
1197+
// // 結果型が異なる場合
11981198
// return rb_funcall(result_type, func->name, 2, a1, a2);
11991199
// }
12001200
// /*
1201-
// // 結果が DFloatの場合、引数をキャストして実行
1201+
// // 結果が DFloatの場合、引数をキャストして実行
12021202
// a1 = rb_funcall(e1, "cast", 1, a1);
12031203
// a2 = rb_funcall(e2, "cast", 1, a2);
12041204
// */
@@ -1208,5 +1208,5 @@ ndfunc_execute_inspect( VALUE ary, VALUE str, na_text_func_t func, VALUE opt )
12081208
// //return ndfunc_execute( func, 2, args );
12091209
// return ndfunc_execute_w_cast( func, 2, args );
12101210
// }
1211-
//
1211+
//
12121212
// #endif

ext/narray.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,15 @@ VALUE na_column_major_p( VALUE self )
131131
{
132132
if (TEST_COLUMN_MAJOR(self))
133133
return Qtrue;
134-
else
134+
else
135135
return Qfalse;
136136
}
137137

138138
VALUE na_row_major_p( VALUE self )
139139
{
140140
if (TEST_ROW_MAJOR(self))
141141
return Qtrue;
142-
else
142+
else
143143
return Qfalse;
144144
}
145145

@@ -187,7 +187,7 @@ VALUE na_in_place_p( VALUE self )
187187
{
188188
if (TEST_INPLACE(self))
189189
return Qtrue;
190-
else
190+
else
191191
return Qfalse;
192192
}
193193

@@ -200,7 +200,7 @@ VALUE na_out_of_place_bang( VALUE self )
200200
/*
201201
order_to_internal: initialize reshape [] slice
202202
order_to_external: shape each_with_index
203-
position_to_int: transpose newdim sum avg .. min max sort mean
203+
position_to_int: transpose newdim sum avg .. min max sort mean
204204
*/
205205

206206
void
@@ -419,7 +419,7 @@ na_assign_data( VALUE self, VALUE data, size_t offset )
419419
* call-seq:
420420
* Num::NArray.new( datatype, shape ) => narray
421421
* Num::NArray.new( datatype, size ) => narray
422-
*
422+
*
423423
* Constructs a narray using the given <i>datatype</i> and <i>shape</i> or .
424424
* <i>size</i>. If the second argument is an integer, returns 1-d array.
425425
*/
@@ -476,8 +476,8 @@ na_initialize( int argc, VALUE *argv, VALUE self )
476476
data = v;
477477
} else if (TYPE(v) == T_HASH) {
478478
rb_scan_kw_args( v,
479-
"offset", &offset,
480-
"inplace", &inplace,
479+
"offset", &offset,
480+
"inplace", &inplace,
481481
"column_major", &column_major,
482482
"byte_swapped", &byte_swapped,
483483
NULL );
@@ -524,7 +524,7 @@ na_copy_flags( VALUE src, VALUE dst )
524524
}
525525

526526

527-
/*
527+
/*
528528
VALUE
529529
rb_narray_view( VALUE self )
530530
{
@@ -1143,7 +1143,7 @@ na_transpose(int argc, VALUE *argv, VALUE self)
11431143
//printf("r=%d\n",r);
11441144
}
11451145
}
1146-
1146+
11471147
new_object:
11481148
// view = na_dup( self );
11491149
// stride = na_get_stride(view);
@@ -1261,7 +1261,7 @@ na_reshape_self(int argc, VALUE *argv, VALUE self)
12611261

12621262
na_index_arg_to_internal_order( argc, argv, self );
12631263

1264-
// get shape from argument
1264+
// get shape from argument
12651265
shape = ALLOC_N(size_t,argc);
12661266
for (i=0,total=1; i<argc; i++)
12671267
switch(TYPE(argv[i])) {
@@ -1275,7 +1275,7 @@ na_reshape_self(int argc, VALUE *argv, VALUE self)
12751275
default:
12761276
rb_raise(rb_eArgError,"illegal type");
12771277
}
1278-
1278+
12791279
if (unfixed>=0) {
12801280
if (na->size % total != 0)
12811281
rb_raise(rb_eArgError, "Total size size must be divisor");
@@ -1292,7 +1292,7 @@ na_reshape_self(int argc, VALUE *argv, VALUE self)
12921292
stride[--i] = st;
12931293
st *= shape[i];
12941294
}
1295-
1295+
12961296
// exchange data
12971297
FREE_STRIDE(na);
12981298
FREE_SHAPE(na);

ext/narray.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
# include <sys/types.h>
2121
#endif
2222

23-
#define NARRAY_VERSION "0.7.0"
24-
#define NARRAY_VERSION_CODE 700
23+
#define NARRAY_VERSION "0.7.1"
24+
#define NARRAY_VERSION_CODE 701
2525

2626
/*
2727
Data types used in NArray :
@@ -158,19 +158,19 @@ extern ID id_contiguous_stride;
158158

159159
//typedef struct NARRAY {
160160
typedef struct RNArray {
161-
//VALUE type; // data type 途中ですりかわってはならない
162-
VALUE data; // byte data object
163-
int ndim; // # of dimension
164-
size_t size; // # of total element
165-
size_t offset; // dataポインタから先頭データの位置へのオフセット
166-
// : elm.unit_bits を単位とする
161+
//VALUE type; // data type 途中ですりかわってはならない
162+
VALUE data; // byte data object
163+
int ndim; // # of dimension
164+
size_t size; // # of total element
165+
size_t offset; // dataポインタから先頭データの位置へのオフセット
166+
// : elm.unit_bits を単位とする
167167
// address_unit pointer_unit access_unit data_unit
168168
// elm.step_unit = elm.bit_size / elm.access_unit
169169
// elm.step_unit = elm.size_bits / elm.unit_bits
170-
size_t *shape; // 各次元の要素数
171-
ssize_t *stride; // 各次元におけるデータポインタの増分
172-
// : elm.unit_bits を単位とする
173-
ssize_t **index; // インデクスアクセス配列
170+
size_t *shape; // 各次元の要素数
171+
ssize_t *stride; // 各次元におけるデータポインタの増分
172+
// : elm.unit_bits を単位とする
173+
ssize_t **index; // インデクスアクセス配列
174174
VALUE mark;
175175
} narray_t;
176176

@@ -183,7 +183,7 @@ typedef struct RNArray {
183183
- matrix or not
184184
*/
185185
#define FL_NA_INPLACE FL_USER0
186-
#define FL_NA_INDEX_ORDER FL_USER1 // column_major/row_major
186+
#define FL_NA_INDEX_ORDER FL_USER1 // column_major/row_major
187187
#define FL_NA_BYTE_SWAPPED FL_USER2 // big_endian/little_endian
188188

189189
#define TEST_COLUMN_MAJOR(x) FL_TEST((x),FL_NA_INDEX_ORDER)

0 commit comments

Comments
 (0)