Skip to content

Commit

Permalink
add support for crystal 0.35
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Jun 12, 2020
1 parent 069a80c commit 523756d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: bacnet
version: 0.9.0
version: 0.9.1

dependencies:
bindata:
Expand Down
12 changes: 6 additions & 6 deletions src/bacnet/ip4_message.cr
Original file line number Diff line number Diff line change
Expand Up @@ -73,17 +73,17 @@ module BACnet
end
end

def to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::BigEndian) : IO
def to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::BigEndian) : Int64
format = IO::ByteFormat::BigEndian
io.write_bytes(@data_link, format)
wrote = io.write_bytes(@data_link, format)
if net = @network
io.write_bytes(net, format)
wrote += io.write_bytes(net, format)
if app = @application
io.write_bytes(app, format)
objects.each { |object| io.write_bytes(object, format) }
wrote += io.write_bytes(app, format)
objects.each { |object| wrote += io.write_bytes(object, format) }
end
end
io
wrote
end

def to_slice
Expand Down
12 changes: 6 additions & 6 deletions src/bacnet/secure_message.cr
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ module BACnet
end
end

def to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::BigEndian) : IO
def to_io(io : IO, format : IO::ByteFormat = IO::ByteFormat::BigEndian) : Int64
format = IO::ByteFormat::BigEndian
io.write_bytes(@data_link, format)
wrote = io.write_bytes(@data_link, format)
if network = @network
io.write_bytes(network, format)
wrote += io.write_bytes(network, format)
if app = @application
io.write_bytes(app, format)
objects.each { |object| io.write_bytes(object, format) }
wrote += io.write_bytes(app, format)
objects.each { |object| wrote += io.write_bytes(object, format) }
end
end
io
wrote
end

def to_slice
Expand Down

0 comments on commit 523756d

Please sign in to comment.