Skip to content

Commit f9a1256

Browse files
committed
Remove const local variables as they're deprecated
1 parent 716a5ad commit f9a1256

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

src/COFF/COFFHandle.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ end
2929
## Define creation methods
3030
function readmeta(io::IO, ::Type{H}) where {H <: COFFHandle}
3131
# This is the magic that we know we must find
32-
const PE_magic = UInt8['P','E','\0','\0']
33-
const MZ_magic = UInt8['M','Z']
32+
PE_magic = UInt8['P','E','\0','\0']
33+
MZ_magic = UInt8['M','Z']
3434

3535
# Save the starting position of `io`
3636
start = position(io)

src/COFF/COFFHeader.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export COFFHeader
1111
end
1212

1313
function coff_header_is64bit(h::COFFHeader)
14-
const wide_machines = [
14+
wide_machines = [
1515
IMAGE_FILE_MACHINE_AMD64,
1616
IMAGE_FILE_MACHINE_ARM64,
1717
IMAGE_FILE_MACHINE_IA64,

src/ELF/ELFDynEntry.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Return `true` if the given `ELFDynEntry` represents an offset within the
4444
dynamic string table, and therefore can be used in a `strtab_lookup()`
4545
"""
4646
function dyn_entry_is_string(d::ELFDynEntry)
47-
const string_types = [
47+
string_types = [
4848
DT_NEEDED,
4949
DT_SONAME,
5050
DT_RPATH,

src/ELF/ELFHandle.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ end
3232
## Define creation methods
3333
function readmeta(io::IO, ::Type{H}) where {H <: ELFHandle}
3434
# This is the magic that we know we must find
35-
const elven_magic = UInt8['\177', 'E', 'L', 'F']
35+
elven_magic = UInt8['\177', 'E', 'L', 'F']
3636

3737
# Save the starting position of `io`
3838
start = position(io)

src/MachO/MachOLoadCmd.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ find(lcs::MachOLoadCmds, lc_type::T) where {T <: Type} = find(lcs, [lc_type])
183183

184184

185185
function load_cmd_type(header::MachOLoadCmdHeader{H}) where {H <: MachOHandle}
186-
const type_mapping = Dict(
186+
type_mapping = Dict(
187187
LC_SEGMENT => MachOSegment32Cmd{H},
188188
LC_SEGMENT_64 => MachOSegment64Cmd{H},
189189
LC_LOAD_DYLIB => MachOLoadDylibCmd{H},
@@ -231,7 +231,7 @@ and ending no more than `max_size` bytes ahead, read it in and return it as a
231231
Julia-native `String`. If the given offset is bad in some way (it is negative,
232232
or begins beyond the end of `max_size`) an error string is returned.
233233
"""
234-
function unpack_lcstr{H<:ObjectHandle}(oh::H, offset, max_size)
234+
function unpack_lcstr(oh::H, offset, max_size) where {H <: MachOHandle}
235235
# Perform sanity checking on offset; if it is too small or too large,
236236
# don't try to read the lc_str, just assign it "<lc_str offset corrupt>"
237237
if offset >= 0 && offset < max_size

src/string_utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ print(io::IO, x::fixed_string) = print(io, unsafe_string(x))
3939
isempty(x::fixed_string) = (x.data & 0xff) == 0
4040
function length(x::fixed_string{T}) where {T <: Integer}
4141
for idx in 0:(sizeof(T)-1)
42-
if (x.data & (0xff << idx*8)) == 0
42+
if (x.data & (0xff << (idx*8))) == 0
4343
return idx
4444
end
4545
end

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function test_libfoo_and_fooifier(fooifier_path, libfoo_path)
88

99
# Tease out some information from the containing folder name
1010
dir_path = basename(dirname(libfoo_path))
11-
const types = Dict(
11+
types = Dict(
1212
"linux" => ELFHandle,
1313
"mac" => MachOHandle,
1414
"win" => COFFHandle,

0 commit comments

Comments
 (0)