Skip to content

Commit 3085dac

Browse files
committed
SPM12 r7771
1 parent 50b4fd3 commit 3085dac

File tree

1,465 files changed

+59182
-20783
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,465 files changed

+59182
-20783
lines changed

@file_array/double.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
% FORMAT double(fa)
44
% fa - a file_array
55
%__________________________________________________________________________
6-
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
6+
% Copyright (C) 2005-2018 Wellcome Trust Centre for Neuroimaging
77

88
%
9-
% $Id: double.m 7147 2017-08-03 14:07:01Z spm $
9+
% $Id: double.m 7501 2018-11-30 12:16:58Z guillaume $
1010

1111

12-
out = double(numeric(fa));
12+
out = double(full(fa));

@file_array/full.m

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
function out = full(fa)
2+
% Convert to numeric form
3+
% FORMAT full(fa)
4+
% fa - a file_array
5+
%__________________________________________________________________________
6+
% Copyright (C) 2018 Wellcome Trust Centre for Neuroimaging
7+
8+
%
9+
% $Id: full.m 7501 2018-11-30 12:16:58Z guillaume $
10+
11+
12+
[vo{1:ndims(fa)}] = deal(':');
13+
out = subsref(fa,struct('type','()','subs',{vo}));

@file_array/isnan.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
function out = isnan(fa)
2-
% Convert to numeric form
2+
% Logical array containing true where the elements of file_array are NaN's
33
% FORMAT isnan(fa)
44
% fa - a file_array
55
%__________________________________________________________________________
6-
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
6+
% Copyright (C) 2005-2018 Wellcome Trust Centre for Neuroimaging
77

88
%
9-
% $Id: isnan.m 7147 2017-08-03 14:07:01Z spm $
9+
% $Id: isnan.m 7501 2018-11-30 12:16:58Z guillaume $
1010

1111

1212
bs = 10240;

@file_array/numeric.m

+3-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@
33
% FORMAT numeric(fa)
44
% fa - a file_array
55
%__________________________________________________________________________
6-
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
6+
% Copyright (C) 2005-2018 Wellcome Trust Centre for Neuroimaging
77

88
%
9-
% $Id: numeric.m 7147 2017-08-03 14:07:01Z spm $
9+
% $Id: numeric.m 7501 2018-11-30 12:16:58Z guillaume $
1010

1111

12-
[vo{1:ndims(fa)}] = deal(':');
13-
out = subsref(fa,struct('type','()','subs',{vo}));
12+
out = full(fa);

@file_array/private/Makefile

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
#
44
# Copyright (C) 2013 Wellcome Trust Centre for Neuroimaging
55
#
6-
# $Id: Makefile 5459 2013-05-01 17:51:59Z guillaume $
6+
# $Id: Makefile 7532 2019-02-14 12:03:24Z guillaume $
77

88
include ../../src/Makefile.var
99

10-
SPMMEX = file2mat.$(SUF) mat2file.$(SUF) init.$(SUF)
10+
SPMMEX = file2mat.$(MEXEXT) mat2file.$(MEXEXT) init.$(MEXEXT)
1111

1212
all: $(SPMMEX)
1313
@:
1414

1515
clean:
1616
@:
17-
ifeq (mex,$(SUF))
18-
$(DEL) $(subst .$(SUF),.o,$(SPMMEX))
17+
ifeq (mex,$(MEXEXT))
18+
$(DEL) $(subst .$(MEXEXT),.o,$(SPMMEX))
1919
endif
2020

2121
distclean: clean
@@ -27,5 +27,5 @@ install:
2727
tarball: all
2828
$(TAR) cf spm_mex.tar $(SPMMEX)
2929

30-
%.$(SUF) : %.c
30+
%.$(MEXEXT) : %.c
3131
$(MEX) $< $(MEXEND)

@file_array/private/file2mat.c

+24-24
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Id: file2mat.c 7353 2018-06-19 10:39:55Z guillaume $
2+
* $Id: file2mat.c 7568 2019-04-09 11:03:59Z guillaume $
33
* John Ashburner
44
*/
55

@@ -26,7 +26,7 @@ Memory mapping is used by this module. For more information on this, see:
2626
HANDLE hFile, hMapping;
2727
typedef char *caddr_t;
2828
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
29-
#ifdef _MSC_VER_
29+
#ifdef _MSC_VER
3030
#define stat _stati64
3131
#define fstat _fstati64
3232
#endif
@@ -49,7 +49,7 @@ typedef char *caddr_t;
4949
http://en.wikipedia.org/wiki/Page_(computing)#Determining_the_page_size_in_a_program
5050
http://msdn.microsoft.com/en-us/library/aa366763(VS.85).aspx
5151
*/
52-
int page_size()
52+
static int page_size()
5353
{
5454
int size = 0;
5555

@@ -89,13 +89,13 @@ static void get_1_sat(mwSize ndim, mwSize idim[], unsigned long long *iptr[], un
8989
}
9090
}
9191

92-
void get_1(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned char idat[],
92+
static void get_1(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned char idat[],
9393
mwSize odim[], unsigned char odat[])
9494
{
9595
get_1_sat(ndim, idim, iptr, idat, odim, odat, 0, 0);
9696
}
9797

98-
void get_8(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned char idat[],
98+
static void get_8(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned char idat[],
9999
mwSize odim[], unsigned char odat[])
100100
{
101101
mwIndex i;
@@ -112,7 +112,7 @@ void get_8(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned char
112112
}
113113
}
114114

115-
void get_16(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned short idat[],
115+
static void get_16(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned short idat[],
116116
mwSize odim[], unsigned short odat[])
117117
{
118118
mwIndex i;
@@ -129,7 +129,7 @@ void get_16(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned sho
129129
}
130130
}
131131

132-
void get_32(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned int idat[],
132+
static void get_32(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned int idat[],
133133
mwSize odim[], unsigned int odat[])
134134
{
135135
mwIndex i;
@@ -146,7 +146,7 @@ void get_32(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned int
146146
}
147147
}
148148

149-
void get_64(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned long long idat[],
149+
static void get_64(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned long long idat[],
150150
mwSize odim[], unsigned long long odat[])
151151
{
152152
mwSize i;
@@ -163,7 +163,7 @@ void get_64(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned lon
163163
}
164164
}
165165

166-
void get_w8(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned char idat[],
166+
static void get_w8(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned char idat[],
167167
mwSize odim[], unsigned char odat_r[], unsigned char odat_i[])
168168
{
169169
mwIndex i;
@@ -185,7 +185,7 @@ void get_w8(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned cha
185185
}
186186
}
187187

188-
void get_w16(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned short idat[],
188+
static void get_w16(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned short idat[],
189189
mwSize odim[], unsigned short odat_r[], unsigned short odat_i[])
190190
{
191191
mwIndex i;
@@ -207,7 +207,7 @@ void get_w16(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned sh
207207
}
208208
}
209209

210-
void get_w32(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned int idat[],
210+
static void get_w32(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned int idat[],
211211
mwSize odim[], unsigned int odat_r[], unsigned int odat_i[])
212212
{
213213
mwIndex i;
@@ -229,7 +229,7 @@ void get_w32(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned in
229229
}
230230
}
231231

232-
void get_w64(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned long long idat[],
232+
static void get_w64(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned long long idat[],
233233
mwSize odim[], unsigned long long odat_r[], unsigned long long odat_i[])
234234
{
235235
mwIndex i;
@@ -251,10 +251,10 @@ void get_w64(mwSize ndim, mwSize idim[], unsigned long long *iptr[], unsigned lo
251251
}
252252
}
253253

254-
void swap8(long long n, unsigned char d[])
254+
static void swap8(long long n, unsigned char d[])
255255
{ /* DO NOTHING */}
256256

257-
void swap16(long long n, unsigned char d[])
257+
static void swap16(long long n, unsigned char d[])
258258
{
259259
unsigned char tmp, *de;
260260
for(de=d+2*n; d<de; d+=2)
@@ -263,7 +263,7 @@ void swap16(long long n, unsigned char d[])
263263
}
264264
}
265265

266-
void swap32(long long n, unsigned char d[])
266+
static void swap32(long long n, unsigned char d[])
267267
{
268268
unsigned char tmp, *de;
269269
for(de=d+4*n; d<de; d+=4)
@@ -273,7 +273,7 @@ void swap32(long long n, unsigned char d[])
273273
}
274274
}
275275

276-
void swap64(long long n, unsigned char d[])
276+
static void swap64(long long n, unsigned char d[])
277277
{
278278
unsigned char tmp, *de;
279279
for(de=d+8*n; d<de; d+=8)
@@ -294,7 +294,7 @@ typedef struct dtype {
294294
int channels;
295295
} Dtype;
296296

297-
Dtype table[] = {
297+
static Dtype table[] = {
298298
{ 1,get_1 , swap8 , mxLOGICAL_CLASS, 1,1},
299299
{ 2,get_8 , swap8 , mxUINT8_CLASS , 8,1},
300300
{ 4,get_16 , swap16, mxINT16_CLASS ,16,1},
@@ -324,7 +324,7 @@ typedef struct mtype {
324324
} MTYPE;
325325

326326
#ifdef SPM_WIN32
327-
void werror(char *where, DWORD last_error)
327+
static void werror(char *where, DWORD last_error)
328328
{
329329
char buf[512];
330330
char s[1024];
@@ -342,7 +342,7 @@ void werror(char *where, DWORD last_error)
342342
return;
343343
}
344344
#else
345-
void werror(char *where, int last_error)
345+
static void werror(char *where, int last_error)
346346
{
347347
char s[1024];
348348

@@ -352,7 +352,7 @@ void werror(char *where, int last_error)
352352
}
353353
#endif
354354

355-
void do_unmap_file(MTYPE *map)
355+
static void do_unmap_file(MTYPE *map)
356356
{
357357
int sts;
358358
if (map->addr)
@@ -370,7 +370,7 @@ void do_unmap_file(MTYPE *map)
370370
}
371371
}
372372

373-
const double *getpr(const mxArray *ptr, const char nam[], int len, int *n)
373+
static const double *getpr(const mxArray *ptr, const char nam[], int len, int *n)
374374
{
375375
char s[128];
376376
mxArray *arr;
@@ -412,7 +412,7 @@ const double *getpr(const mxArray *ptr, const char nam[], int len, int *n)
412412
return (double *)mxGetData(arr);
413413
}
414414

415-
void do_map_file(const mxArray *ptr, MTYPE *map)
415+
static void do_map_file(const mxArray *ptr, MTYPE *map)
416416
{
417417
int n;
418418
int i, dtype;
@@ -627,13 +627,13 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
627627
if (map.dtype->channels == 1)
628628
{
629629
plhs[0] = mxCreateNumericArray(ndim,odim,map.dtype->clss,mxREAL);
630-
#ifdef _MSC_VER_
630+
#ifdef _MSC_VER
631631
/* https://msdn.microsoft.com/en-us/library/windows/desktop/aa366801.aspx */
632632
__try
633633
{
634634
#endif
635635
map.dtype->func(ndim-1, idim, iptr, idat, odim, mxGetData(plhs[0]));
636-
#ifdef _MSC_VER_
636+
#ifdef _MSC_VER
637637
}
638638
__except(GetExceptionCode()==EXCEPTION_IN_PAGE_ERROR ?
639639
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)

@file_array/private/file2mat.mexa64

-133 Bytes
Binary file not shown.
-4.13 KB
Binary file not shown.

@file_array/private/file2mat.mexw32

512 Bytes
Binary file not shown.

@file_array/private/file2mat.mexw64

512 Bytes
Binary file not shown.

@file_array/private/init.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Id: init.c 6428 2015-05-06 14:09:04Z guillaume $
2+
* $Id: init.c 7523 2019-02-01 11:31:08Z guillaume $
33
* Guillaume Flandin
44
*/
55

@@ -14,6 +14,12 @@
1414
# define getFilePos fgetpos
1515
# define setFilePos fsetpos
1616
# define fpos_T fpos_t
17+
# elif defined(SPM_WIN32)
18+
# define structStat struct _stati64
19+
# define getFileFstat _fstati64
20+
# define getFilePos fgetpos
21+
# define setFilePos fsetpos
22+
# define fpos_T fpos_t
1723
# else
1824
# define structStat struct stat64
1925
# define getFileFstat fstat64

@file_array/private/init.mexw32

0 Bytes
Binary file not shown.

@file_array/private/init.mexw64

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)