From 2ebf8e7d395a38ca806e8652b2ed73f9a50539b2 Mon Sep 17 00:00:00 2001 From: Tim Sterne-Weiler Date: Sun, 4 Jun 2017 22:46:01 -0700 Subject: [PATCH 1/3] initial fix to deprecated warnings in runtests.jl --- src/sais.jl | 2 +- test/runtests.jl | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sais.jl b/src/sais.jl index a972901..8d7fbff 100644 --- a/src/sais.jl +++ b/src/sais.jl @@ -361,7 +361,7 @@ function induceSA(T,SA,C,B,n,k) for i = n:-1:1 if 0 < (j = SA[i]) j -= 1 - if (c0 = T[j+1]) != c1 + if Int(c0 = T[j+1]) != Int(c1) B[Int(c1)+1] = b c1 = c0 b = B[Int(c1)+1] diff --git a/test/runtests.jl b/test/runtests.jl index 4e78854..d9b6295 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,7 +3,7 @@ using Base.Test function test_suffix(args) for file in args - T = open(readall,file) + T = open(readstring,file) tic() SA = suffixsort(T) t = toq() @@ -33,7 +33,7 @@ function sufcheck(T,SA) end end for i = 1:n - C[T[i]+1] += 1 + C[Int(T[i])+1] += 1 end p = 0 for i = 1:256 @@ -41,8 +41,8 @@ function sufcheck(T,SA) C[i] = p p += t end - q = C[T[n]+1] - C[T[n]+1] += 1 + q = C[Int(T[n])+1] + C[Int(T[n])+1] += 1 for i = 1:n p = SA[i] if 0 < p @@ -83,5 +83,5 @@ function walkdir(dir,files) return unique(files) end -files = walkdir(Pkg.dir("SuffixArrays"),{}) -test_suffix(files) \ No newline at end of file +files = walkdir(Pkg.dir("SuffixArrays"),[]) +test_suffix(files) From e7ba249a622819f44cf5edef1bfbb6f7aec8a187 Mon Sep 17 00:00:00 2001 From: Tim Sterne-Weiler Date: Sun, 4 Jun 2017 23:13:04 -0700 Subject: [PATCH 2/3] fix assignment error in cast --- src/sais.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sais.jl b/src/sais.jl index 8d7fbff..14dcffc 100644 --- a/src/sais.jl +++ b/src/sais.jl @@ -361,7 +361,8 @@ function induceSA(T,SA,C,B,n,k) for i = n:-1:1 if 0 < (j = SA[i]) j -= 1 - if Int(c0 = T[j+1]) != Int(c1) + c0 = T[j+1] + if Int(c0) != Int(c1) B[Int(c1)+1] = b c1 = c0 b = B[Int(c1)+1] From 5526d9f3d1c6652a297ab621f1cc89266f38fdcf Mon Sep 17 00:00:00 2001 From: Tim Sterne-Weiler Date: Sun, 4 Jun 2017 23:16:29 -0700 Subject: [PATCH 3/3] char to int casts for getindex, runtests.jl passes --- test/runtests.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index d9b6295..c3d8970 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -48,7 +48,7 @@ function sufcheck(T,SA) if 0 < p p -= 1 c = T[p+1] - t = C[c+1] + t = C[Int(c)+1] else p = n-1 c = T[p+1] @@ -59,9 +59,9 @@ function sufcheck(T,SA) return -4 end if t != q - C[c+1] += 1 - if n <= C[c+1] || T[SA[C[c+1]+1]+1] != c - C[c+1] = -1 + C[Int(c)+1] += 1 + if n <= C[Int(c)+1] || T[SA[C[Int(c)+1]+1]+1] != c + C[Int(c)+1] = -1 end end end