Skip to content

Commit

Permalink
Fix lint issues discovered after bumping lints_core dep
Browse files Browse the repository at this point in the history
  • Loading branch information
achilleasa committed Nov 3, 2022
1 parent 84331f1 commit 38bd579
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions lib/src/protocol/io/frame_writer.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
part of dart_amqp.protocol;

final Uint8List FRAME_TERMINATOR_SEQUENCE =
final Uint8List frameTerminatorSequence =
Uint8List.fromList([RawFrameParser.FRAME_TERMINATOR]);

class FrameWriter {
Expand Down Expand Up @@ -34,7 +34,7 @@ class FrameWriter {

_outputEncoder.writer
..addFirst(_bufferEncoder.writer.joinChunks())
..addLast(FRAME_TERMINATOR_SEQUENCE);
..addLast(frameTerminatorSequence);

_bufferEncoder.writer.clear();

Expand Down Expand Up @@ -78,7 +78,7 @@ class FrameWriter {
_outputEncoder.writer
..addLast(_bufferEncoder.writer.joinChunks())
..addLast(serializedContentHeader)
..addLast(FRAME_TERMINATOR_SEQUENCE);
..addLast(frameTerminatorSequence);
_bufferEncoder.writer.clear();

// Emit the payload data split in ceil( length / maxFrameLength ) chunks
Expand All @@ -96,7 +96,7 @@ class FrameWriter {
_outputEncoder.writer
..addLast(Uint8List.view(
serializedContent.buffer, offset, _frameHeader.size))
..addLast(FRAME_TERMINATOR_SEQUENCE);
..addLast(frameTerminatorSequence);
}
}
}
Expand Down
18 changes: 9 additions & 9 deletions lib/src/protocol/messages/bindings/basic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ class BasicDeliver implements Message {
BasicDeliver.fromStream(TypeDecoder decoder) {
consumerTag = decoder.readShortString();
deliveryTag = decoder.readUInt64();
int _bitmask;
_bitmask = decoder.readUInt8();
redelivered = _bitmask & 0x1 != 0;
int bitmask;
bitmask = decoder.readUInt8();
redelivered = bitmask & 0x1 != 0;
exchange = decoder.readShortString();
routingKey = decoder.readShortString();
}
Expand All @@ -244,9 +244,9 @@ class BasicAck implements Message {

BasicAck.fromStream(TypeDecoder decoder) {
deliveryTag = decoder.readUInt64();
int _bitmask;
_bitmask = decoder.readUInt8();
multiple = _bitmask & 0x1 != 0;
int bitmask;
bitmask = decoder.readUInt8();
multiple = bitmask & 0x1 != 0;
}

@override
Expand Down Expand Up @@ -275,9 +275,9 @@ class BasicNack implements Message {

BasicNack.fromStream(TypeDecoder decoder) {
deliveryTag = decoder.readUInt64();
int _bitmask;
_bitmask = decoder.readUInt8();
multiple = _bitmask & 0x1 != 0;
int bitmask;
bitmask = decoder.readUInt8();
multiple = bitmask & 0x1 != 0;
}

@override
Expand Down
12 changes: 6 additions & 6 deletions lib/src/protocol/messages/bindings/channel.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,9 @@ class ChannelFlow implements Message {

ChannelFlow();
ChannelFlow.fromStream(TypeDecoder decoder) {
int _bitmask;
_bitmask = decoder.readUInt8();
active = _bitmask & 0x1 != 0;
int bitmask;
bitmask = decoder.readUInt8();
active = bitmask & 0x1 != 0;
}
@override
void serialize(TypeEncoder encoder) {
Expand All @@ -88,9 +88,9 @@ class ChannelFlowOk implements Message {

ChannelFlowOk();
ChannelFlowOk.fromStream(TypeDecoder decoder) {
int _bitmask;
_bitmask = decoder.readUInt8();
active = _bitmask & 0x1 != 0;
int bitmask;
bitmask = decoder.readUInt8();
active = bitmask & 0x1 != 0;
}
@override
void serialize(TypeEncoder encoder) {
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ dev_dependencies:
mockito: ^5.0.9
http: ^0.13.3
xml: ^5.1.1
lints: ^1.0.1
lints: ^2.0.1
false_secrets:
- test/lib/mocks/certs/*.pem
12 changes: 6 additions & 6 deletions tool/generate_bindings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -273,30 +273,30 @@ ${String.fromCharCodes(List<int>.filled(className.length + methodName.length + 1
// Declare a temp var for parsing bitmasks in c-tor and reset bit offset
if (!declaredBitVar && implementedByClient) {
ctors.write("""
int _bitmask;
int bitmask;
""");
declaredBitVar = true;
}
if (implementedByClient) {
ctors.write("""
_bitmask = decoder.readUInt8();
bitmask = decoder.readUInt8();
""");
}

// Unserialize field value from read _bitmask
// Unserialize field value from read bitmask
bitOffset = 0;
if (implementedByClient) {
ctors.write(
" $fieldName = _bitmask & 0x${(1 << bitOffset).toRadixString(16)} != 0;\n");
" $fieldName = bitmask & 0x${(1 << bitOffset).toRadixString(16)} != 0;\n");
}
bitOffset++;
} else {
serializerMethod.write(", $fieldName");

// Unserialize field value from read _bitmask
// Unserialize field value from read bitmask
if (implementedByClient) {
ctors.write(
" $fieldName = _bitmask & 0x${(1 << bitOffset).toRadixString(16)} != 0;\n");
" $fieldName = bitmask & 0x${(1 << bitOffset).toRadixString(16)} != 0;\n");
}
bitOffset++;
}
Expand Down

0 comments on commit 38bd579

Please sign in to comment.