File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 82
82
struct CodePointError{T<: Integer } <: Exception
83
83
code:: T
84
84
end
85
- @noinline invalid_char (c:: AbstractChar ) = throw (InvalidCharError (c))
86
- @noinline code_point_err (u:: Integer ) = throw (CodePointError (u))
85
+ @noinline throw_invalid_char (c:: AbstractChar ) = throw (InvalidCharError (c))
86
+ @noinline throw_code_point_err (u:: Integer ) = throw (CodePointError (u))
87
87
88
88
function ismalformed (c:: Char )
89
89
u = reinterpret (UInt32, c)
@@ -129,7 +129,7 @@ function UInt32(c::Char)
129
129
t0 = trailing_zeros (u) & 56
130
130
(l1 == 1 ) | (8 l1 + t0 > 32 ) |
131
131
((((u & 0x00c0c0c0 ) ⊻ 0x00808080 ) >> t0 != 0 ) | is_overlong_enc (u)) &&
132
- invalid_char (c):: Union{}
132
+ throw_invalid_char (c)
133
133
u &= 0xffffffff >> l1
134
134
u >>= t0
135
135
((u & 0x0000007f ) >> 0 ) | ((u & 0x00007f00 ) >> 2 ) |
157
157
158
158
function Char (u:: UInt32 )
159
159
u < 0x80 && return reinterpret (Char, u << 24 )
160
- u < 0x00200000 || code_point_err (u):: Union{}
160
+ u < 0x00200000 || throw_code_point_err (u)
161
161
c = ((u << 0 ) & 0x0000003f ) | ((u << 2 ) & 0x00003f00 ) |
162
162
((u << 4 ) & 0x003f0000 ) | ((u << 6 ) & 0x3f000000 )
163
163
c = u < 0x00000800 ? (c << 16 ) | 0xc0800000 :
Original file line number Diff line number Diff line change @@ -963,11 +963,15 @@ end
963
963
964
964
const ENSURE_INITIALIZED_LOCK = ReentrantLock ()
965
965
966
+ @noinline function throw_negative_refcount_error (x:: Int )
967
+ error (" Negative LibGit2 REFCOUNT $x \n This shouldn't happen, please file a bug report!" )
968
+ end
969
+
966
970
function ensure_initialized ()
967
971
lock (ENSURE_INITIALIZED_LOCK) do
968
972
x = Threads. atomic_cas! (REFCOUNT, 0 , 1 )
969
973
x > 0 && return
970
- x < 0 && negative_refcount_error (x):: Union{}
974
+ x < 0 && throw_negative_refcount_error (x)
971
975
try initialize ()
972
976
catch
973
977
Threads. atomic_sub! (REFCOUNT, 1 )
@@ -978,10 +982,6 @@ function ensure_initialized()
978
982
return nothing
979
983
end
980
984
981
- @noinline function negative_refcount_error (x:: Int )
982
- error (" Negative LibGit2 REFCOUNT $x \n This shouldn't happen, please file a bug report!" )
983
- end
984
-
985
985
@noinline function initialize ()
986
986
@check ccall ((:git_libgit2_init , :libgit2 ), Cint, ())
987
987
Original file line number Diff line number Diff line change 19
19
20
20
@test widen (' a' ) === ' a'
21
21
# just check this works
22
- @test_throws Base. CodePointError Base. code_point_err (UInt32 (1 ))
22
+ @test_throws Base. CodePointError Base. throw_code_point_err (UInt32 (1 ))
23
23
end
24
24
25
25
@testset " ASCII conversion to/from Integer" begin
You can’t perform that action at this time.
0 commit comments