Skip to content

Commit db7dc0a

Browse files
committed
Replace a bunch of tabs with spaces
for reference, these were found using grep -n -P '\t' */*.c* */*.h* src/*/*.c* src/*/*.h* */*.jl */*/*.jl */*/*/*.jl
1 parent 55f37ac commit db7dc0a

20 files changed

+378
-378
lines changed

base/linalg/dense.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ function pinv{T}(A::StridedMatrix{T}, tol::Real)
436436
B[i,i] = one(T)/A[i,i]
437437
end
438438
end
439-
return B;
439+
return B;
440440
end
441441
end
442442
SVD = svdfact(A, thin=true)

contrib/stringreplace.c

+22-22
Original file line numberDiff line numberDiff line change
@@ -3,30 +3,30 @@
33
#include <string.h>
44

55
int main( int argc, char ** argv ) {
6-
if( argc < 5 ) {
7-
printf("Usage:\n");
8-
printf(" %s <hex offset> <string to write> <maxlen> <file>\n", argv[0] );
9-
return -1;
10-
}
6+
if( argc < 5 ) {
7+
printf("Usage:\n");
8+
printf(" %s <hex offset> <string to write> <maxlen> <file>\n", argv[0] );
9+
return -1;
10+
}
1111

12-
unsigned long offset = strtoul(argv[1], NULL, 16);
13-
char * replacement = argv[2];
14-
unsigned long maxlen = strtoul(argv[3], NULL, 10);
12+
unsigned long offset = strtoul(argv[1], NULL, 16);
13+
char * replacement = argv[2];
14+
unsigned long maxlen = strtoul(argv[3], NULL, 10);
1515

16-
FILE * f = fopen( argv[4], "r+" );
17-
if( !f ) {
18-
printf( "ERROR: Could not open %s for writing!\n", argv[4] );
19-
return -1;
20-
}
16+
FILE * f = fopen( argv[4], "r+" );
17+
if( !f ) {
18+
printf( "ERROR: Could not open %s for writing!\n", argv[4] );
19+
return -1;
20+
}
2121

22-
if( strlen(replacement) > maxlen ) {
23-
printf( "ERROR: Replacement string length (%lu) is greater than maxlen! (%lu)\n", strlen(replacement), maxlen );
24-
return -1;
25-
}
26-
27-
fseek( f, offset, SEEK_SET );
28-
fwrite( replacement, strlen(replacement)+1, 1, f );
22+
if( strlen(replacement) > maxlen ) {
23+
printf( "ERROR: Replacement string length (%lu) is greater than maxlen! (%lu)\n", strlen(replacement), maxlen );
24+
return -1;
25+
}
2926

30-
fclose( f );
31-
return 0;
27+
fseek( f, offset, SEEK_SET );
28+
fwrite( replacement, strlen(replacement)+1, 1, f );
29+
30+
fclose( f );
31+
return 0;
3232
}

deps/SuiteSparse_wrapper.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ extern size_t jl_cholmod_sizeof_long(void) {
1111

1212
extern int jl_cholmod_version(int *ver) {
1313
if (ver != (int*) NULL) {
14-
ver[0] = CHOLMOD_MAIN_VERSION;
15-
ver[1] = CHOLMOD_SUB_VERSION;
16-
ver[2] = CHOLMOD_SUBSUB_VERSION;
14+
ver[0] = CHOLMOD_MAIN_VERSION;
15+
ver[1] = CHOLMOD_SUB_VERSION;
16+
ver[2] = CHOLMOD_SUBSUB_VERSION;
1717
}
1818
return CHOLMOD_VERSION;
1919
}

src/codegen.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -4133,12 +4133,12 @@ static Function *emit_function(jl_lambda_info_t *lam, bool cstyle)
41334133
else {
41344134
prevlabel = false;
41354135
}
4136-
if (do_malloc_log && lno != prevlno) {
4137-
// Check memory allocation only after finishing a line
4138-
if (prevlno != -1)
4139-
mallocVisitLine(filename, prevlno);
4140-
prevlno = lno;
4141-
}
4136+
if (do_malloc_log && lno != prevlno) {
4137+
// Check memory allocation only after finishing a line
4138+
if (prevlno != -1)
4139+
mallocVisitLine(filename, prevlno);
4140+
prevlno = lno;
4141+
}
41424142
if (jl_is_expr(stmt) && ((jl_expr_t*)stmt)->head == return_sym) {
41434143
jl_expr_t *ex = (jl_expr_t*)stmt;
41444144
Value *retval;
@@ -4159,8 +4159,8 @@ static Function *emit_function(jl_lambda_info_t *lam, bool cstyle)
41594159
builder.CreateStore(builder.CreateBitCast(builder.CreateLoad(gcpop, false), jl_ppvalue_llvmt),
41604160
prepare_global(jlpgcstack_var));
41614161
#endif
4162-
if (do_malloc_log && lno != -1)
4163-
mallocVisitLine(filename, lno);
4162+
if (do_malloc_log && lno != -1)
4163+
mallocVisitLine(filename, lno);
41644164
if (builder.GetInsertBlock()->getTerminator() == NULL) {
41654165
if (retty == T_void)
41664166
builder.CreateRetVoid();
@@ -4716,9 +4716,9 @@ static void init_julia_llvm_env(Module *m)
47164716
add_named_global(jlgetnthfieldchecked_func, (void*)*jl_get_nth_field_checked);
47174717

47184718
diff_gc_total_bytes_func =
4719-
Function::Create(FunctionType::get(T_int64, false),
4720-
Function::ExternalLinkage,
4721-
"diff_gc_total_bytes", m);
4719+
Function::Create(FunctionType::get(T_int64, false),
4720+
Function::ExternalLinkage,
4721+
"diff_gc_total_bytes", m);
47224722
add_named_global(diff_gc_total_bytes_func, (void*)*diff_gc_total_bytes);
47234723

47244724
std::vector<Type *> execpoint_args(0);

src/dlload.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ DLLEXPORT int jl_uv_dlopen(const char *filename, jl_uv_libhandle lib_, unsigned
6161
#ifdef RTLD_FIRST
6262
| JL_RTLD(flags, FIRST)
6363
#endif
64-
);
64+
);
6565
if (lib->handle) {
6666
lib->errmsg = NULL;
6767
return 0;

src/flisp/builtins.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ static value_t fl_os_setenv(value_t *args, uint32_t nargs)
372372
#if defined (_OS_WINDOWS_)
373373
result = SetEnvironmentVariable(name,val);
374374
#else
375-
result = setenv(name, val, 1);
375+
result = setenv(name, val, 1);
376376
#endif
377377
}
378378
if (result != 0)

src/init.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -577,9 +577,9 @@ void *init_stdio_handle(uv_file fd,int readable)
577577
#if defined(_OS_WINDOWS_)
578578
_dup2(_open("NUL", O_RDWR | O_BINARY, _S_IREAD | _S_IWRITE), fd);
579579
#else
580-
dup2(open("/dev/null", O_RDWR, S_IRUSR | S_IWUSR /* 0600 */ | S_IRGRP | S_IROTH /* 0644 */), fd);
580+
dup2(open("/dev/null", O_RDWR, S_IRUSR | S_IWUSR /* 0600 */ | S_IRGRP | S_IROTH /* 0644 */), fd);
581581
#endif
582-
// ...and continue on as in the UV_FILE case
582+
// ...and continue on as in the UV_FILE case
583583
case UV_FILE:
584584
file = (jl_uv_file_t*)malloc(sizeof(jl_uv_file_t));
585585
file->loop = jl_io_loop;

src/intrinsics.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace JL_I {
3030
// functions
3131
abs_float, copysign_float, flipsign_int, select_value,
3232
ceil_llvm, floor_llvm, trunc_llvm, rint_llvm,
33-
sqrt_llvm, powi_llvm,
33+
sqrt_llvm, powi_llvm,
3434
// pointer access
3535
pointerref, pointerset, pointertoref,
3636
// c interface

src/task.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ restore_stack(jl_task_t *t, jl_jmp_buf *where, char *p)
202202
p = _x;
203203
if ((char*)&_x > _x) {
204204
p = (char*)alloca((char*)&_x - _x);
205-
}
205+
}
206206
restore_stack(t, where, p);
207207
}
208208
jl_jmp_target = where;

src/toplevel.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ jl_value_t *jl_toplevel_eval_flex(jl_value_t *e, int fast)
399399
jl_error("syntax: malformed \"importall\" statement");
400400
m = (jl_module_t*)jl_eval_global_var(m, name);
401401
if (!jl_is_module(m))
402-
jl_errorf("invalid %s statement: name exists but does not refer to a module", ex->head->name);
402+
jl_errorf("invalid %s statement: name exists but does not refer to a module", ex->head->name);
403403
jl_module_importall(jl_current_module, m);
404404
return jl_nothing;
405405
}

test/arpack.jl

+15-15
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,24 @@ begin
2525
bsym = b' + b
2626
bpd = b'*b
2727

28-
(d,v) = eigs(a, nev=3)
29-
@test_approx_eq a*v[:,2] d[2]*v[:,2]
28+
(d,v) = eigs(a, nev=3)
29+
@test_approx_eq a*v[:,2] d[2]*v[:,2]
3030
@test norm(v) > testtol # eigenvectors cannot be null vectors
3131
# (d,v) = eigs(a, b, nev=3, tol=1e-8) # not handled yet
3232
# @test_approx_eq_eps a*v[:,2] d[2]*b*v[:,2] testtol
3333
# @test norm(v) > testtol # eigenvectors cannot be null vectors
3434

35-
(d,v) = eigs(asym, nev=3)
36-
@test_approx_eq asym*v[:,1] d[1]*v[:,1]
35+
(d,v) = eigs(asym, nev=3)
36+
@test_approx_eq asym*v[:,1] d[1]*v[:,1]
3737
@test_approx_eq eigs(asym; nev=1, sigma=d[3])[1][1] d[3]
3838
@test norm(v) > testtol # eigenvectors cannot be null vectors
3939

40-
(d,v) = eigs(apd, nev=3)
41-
@test_approx_eq apd*v[:,3] d[3]*v[:,3]
40+
(d,v) = eigs(apd, nev=3)
41+
@test_approx_eq apd*v[:,3] d[3]*v[:,3]
4242
@test_approx_eq eigs(apd; nev=1, sigma=d[3])[1][1] d[3]
4343

4444
(d,v) = eigs(apd, bpd, nev=3, tol=1e-8)
45-
@test_approx_eq_eps apd*v[:,2] d[2]*bpd*v[:,2] testtol
45+
@test_approx_eq_eps apd*v[:,2] d[2]*bpd*v[:,2] testtol
4646
@test norm(v) > testtol # eigenvectors cannot be null vectors
4747

4848
# test (shift-and-)invert mode
@@ -85,21 +85,21 @@ d, = eigs(A6965,which=:SM,nev=2,ncv=4,tol=eps())
8585
import Base: size, issym, ishermitian
8686

8787
type CPM{T<:Base.LinAlg.BlasFloat}<:AbstractMatrix{T} # completely positive map
88-
kraus::Array{T,3} # kraus operator representation
88+
kraus::Array{T,3} # kraus operator representation
8989
end
9090

9191
size(Phi::CPM)=(size(Phi.kraus,1)^2,size(Phi.kraus,3)^2)
9292
issym(Phi::CPM)=false
9393
ishermitian(Phi::CPM)=false
9494

9595
function *{T<:Base.LinAlg.BlasFloat}(Phi::CPM{T},rho::Vector{T})
96-
rho=reshape(rho,(size(Phi.kraus,3),size(Phi.kraus,3)))
97-
rho2=zeros(T,(size(Phi.kraus,1),size(Phi.kraus,1)))
98-
for s=1:size(Phi.kraus,2)
99-
As=slice(Phi.kraus,:,s,:)
100-
rho2+=As*rho*As'
101-
end
102-
return reshape(rho2,(size(Phi.kraus,1)^2,))
96+
rho=reshape(rho,(size(Phi.kraus,3),size(Phi.kraus,3)))
97+
rho2=zeros(T,(size(Phi.kraus,1),size(Phi.kraus,1)))
98+
for s=1:size(Phi.kraus,2)
99+
As=slice(Phi.kraus,:,s,:)
100+
rho2+=As*rho*As'
101+
end
102+
return reshape(rho2,(size(Phi.kraus,1)^2,))
103103
end
104104
# Generate random isometry
105105
(Q,R)=qr(randn(100,50))

test/ccalltest.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
int xs[300] = {0,0,0,1,0};
44

55
int __attribute((noinline)) testUcharX(unsigned char x) {
6-
return xs[x];
6+
return xs[x];
77
}
88

99
#define xstr(s) str(s)
@@ -14,11 +14,11 @@ volatile int b;
1414

1515
int main() {
1616
printf("all of the following should be 1 except xs[259] = 0");
17-
a = 3;
17+
a = 3;
1818
b = 259;
1919
fptr = (volatile int (*)(unsigned char x))&testUcharX;
2020
if ((((long)fptr)&((long)1)<<32) == 1) fptr = NULL;
21-
printf("compiled with: '%s'\nxs[3] = %d\nxs[259] = %d\ntestUcharX(3) = %d\ntestUcharX(%d) = %d\nfptr(3) = %d\nfptr(259) = %d\n",
22-
xstr(CC), xs[a], xs[b], testUcharX(a), b, testUcharX(b), fptr(a), fptr(b));
21+
printf("compiled with: '%s'\nxs[3] = %d\nxs[259] = %d\ntestUcharX(3) = %d\ntestUcharX(%d) = %d\nfptr(3) = %d\nfptr(259) = %d\n",
22+
xstr(CC), xs[a], xs[b], testUcharX(a), b, testUcharX(b), fptr(a), fptr(b));
2323
}
2424

0 commit comments

Comments
 (0)