Skip to content

Commit

Permalink
Fix more build warnings. (eclipse-paho#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
networkfusion authored Mar 31, 2021
1 parent 42b23a4 commit ff5aa09
Show file tree
Hide file tree
Showing 36 changed files with 223 additions and 169 deletions.
2 changes: 1 addition & 1 deletion M2Mqtt/IMqttNetworkChannel.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
/*
Copyright (c) 2019 The nanoFramework project contributors
Copyright (c) 2013, 2014 Paolo Patierno
All rights reserved. This program and the accompanying materials
Expand All @@ -13,6 +12,7 @@ and the Eclipse Distribution License is available at
Contributors:
Paolo Patierno - initial API and implementation and/or initial documentation
.NET Foundation and Contributors - nanoFramework support
*/

using System;
Expand Down
2 changes: 1 addition & 1 deletion M2Mqtt/Messages/MqttMsgBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ protected int encodeRemainingLength(int remainingLength, byte[] buffer, int inde
digit = remainingLength % 128;
remainingLength /= 128;
if (remainingLength > 0)
digit = digit | 0x80;
digit |= 0x80;
buffer[index++] = (byte)digit;
} while (remainingLength > 0);
return index;
Expand Down
2 changes: 1 addition & 1 deletion M2Mqtt/Messages/MqttMsgConnack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ public override byte[] GetBytes(byte ProtocolVersion)
do
{
fixedHeaderSize++;
temp = temp / 128;
temp /= 128;
} while (temp > 0);

// allocate buffer for message
Expand Down
2 changes: 1 addition & 1 deletion M2Mqtt/Messages/MqttMsgConnect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ public override byte[] GetBytes(byte protocolVersion)
do
{
fixedHeaderSize++;
temp = temp / 128;
temp /= 128;
} while (temp > 0);

// allocate buffer for message
Expand Down
1 change: 1 addition & 0 deletions M2Mqtt/Messages/MqttMsgConnectEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and the Eclipse Distribution License is available at
Contributors:
Paolo Patierno - initial API and implementation and/or initial documentation
.NET Foundation and Contributors - nanoFramework support
*/

#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4)
Expand Down
2 changes: 1 addition & 1 deletion M2Mqtt/Messages/MqttMsgDisconnect.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public static MqttMsgDisconnect Parse(byte fixedHeaderFirstByte, byte protocolVe
/// <summary>
/// Returns the bytes that represents the current object.
/// </summary>
/// <param name="ProtocolVersion">MQTT protocol version</param>
/// <param name="protocolVersion">MQTT protocol version</param>
/// <returns>An array of bytes that represents the current object.</returns>
public override byte[] GetBytes(byte protocolVersion)
{
Expand Down
2 changes: 1 addition & 1 deletion M2Mqtt/Messages/MqttMsgPingReq.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public MqttMsgPingReq()
/// <summary>
/// Returns the bytes that represents the current object.
/// </summary>
/// <param name="ProtocolVersion">MQTT protocol version</param>
/// <param name="protocolVersion">MQTT protocol version</param>
/// <returns>An array of bytes that represents the current object.</returns>
public override byte[] GetBytes(byte protocolVersion)
{
Expand Down
2 changes: 1 addition & 1 deletion M2Mqtt/Messages/MqttMsgPingResp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static MqttMsgPingResp Parse(byte fixedHeaderFirstByte, byte protocolVers
/// <summary>
/// Returns the bytes that represents the current object.
/// </summary>
/// <param name="ProtocolVersion">MQTT protocol version</param>
/// <param name="protocolVersion">MQTT protocol version</param>
/// <returns>An array of bytes that represents the current object.</returns>
public override byte[] GetBytes(byte protocolVersion)
{
Expand Down
4 changes: 2 additions & 2 deletions M2Mqtt/Messages/MqttMsgPuback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public MqttMsgPuback()
/// <summary>
/// Returns the bytes that represents the current object.
/// </summary>
/// <param name="ProtocolVersion">MQTT protocol version</param>
/// <param name="protocolVersion">MQTT protocol version</param>
/// <returns>An array of bytes that represents the current object.</returns>
public override byte[] GetBytes(byte protocolVersion)
{
Expand All @@ -59,7 +59,7 @@ public override byte[] GetBytes(byte protocolVersion)
do
{
fixedHeaderSize++;
temp = temp / 128;
temp /= 128;
} while (temp > 0);

// allocate buffer for message
Expand Down
4 changes: 2 additions & 2 deletions M2Mqtt/Messages/MqttMsgPubcomp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public MqttMsgPubcomp()
/// <summary>
/// Returns the bytes that represents the current object.
/// </summary>
/// <param name="ProtocolVersion">MQTT protocol version</param>
/// <param name="protocolVersion">MQTT protocol version</param>
/// <returns>An array of bytes that represents the current object.</returns>
public override byte[] GetBytes(byte protocolVersion)
{
Expand All @@ -59,7 +59,7 @@ public override byte[] GetBytes(byte protocolVersion)
do
{
fixedHeaderSize++;
temp = temp / 128;
temp /= 128;
} while (temp > 0);

// allocate buffer for message
Expand Down
4 changes: 2 additions & 2 deletions M2Mqtt/Messages/MqttMsgPublish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public MqttMsgPublish(string topic,
/// <summary>
/// Returns the bytes that represents the current object.
/// </summary>
/// <param name="ProtocolVersion">MQTT protocol version</param>
/// <param name="protocolVersion">MQTT protocol version</param>
/// <returns>An array of bytes that represents the current object.</returns>
public override byte[] GetBytes(byte protocolVersion)
{
Expand Down Expand Up @@ -148,7 +148,7 @@ public override byte[] GetBytes(byte protocolVersion)
do
{
fixedHeaderSize++;
temp = temp / 128;
temp /= 128;
} while (temp > 0);

// allocate buffer for message
Expand Down
1 change: 1 addition & 0 deletions M2Mqtt/Messages/MqttMsgPublishEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and the Eclipse Distribution License is available at
Contributors:
Paolo Patierno - initial API and implementation and/or initial documentation
.NET Foundation and Contributors - nanoFramework support
*/

#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4)
Expand Down
1 change: 1 addition & 0 deletions M2Mqtt/Messages/MqttMsgPublishedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and the Eclipse Distribution License is available at
Contributors:
Paolo Patierno - initial API and implementation and/or initial documentation
.NET Foundation and Contributors - nanoFramework support
*/

#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4)
Expand Down
4 changes: 2 additions & 2 deletions M2Mqtt/Messages/MqttMsgPubrec.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public MqttMsgPubrec()
/// <summary>
/// Returns the bytes that represents the current object.
/// </summary>
/// <param name="ProtocolVersion">MQTT protocol version</param>
/// <param name="protocolVersion">MQTT protocol version</param>
/// <returns>An array of bytes that represents the current object.</returns>
public override byte[] GetBytes(byte protocolVersion)
{
Expand All @@ -59,7 +59,7 @@ public override byte[] GetBytes(byte protocolVersion)
do
{
fixedHeaderSize++;
temp = temp / 128;
temp /= 128;
} while (temp > 0);

// allocate buffer for message
Expand Down
4 changes: 2 additions & 2 deletions M2Mqtt/Messages/MqttMsgPubrel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public MqttMsgPubrel()
/// <summary>
/// Returns the bytes that represents the current object.
/// </summary>
/// <param name="ProtocolVersion">MQTT protocol version</param>
/// <param name="protocolVersion">MQTT protocol version</param>
/// <returns>An array of bytes that represents the current object.</returns>
public override byte[] GetBytes(byte protocolVersion)
{
Expand All @@ -61,7 +61,7 @@ public override byte[] GetBytes(byte protocolVersion)
do
{
fixedHeaderSize++;
temp = temp / 128;
temp /= 128;
} while (temp > 0);

// allocate buffer for message
Expand Down
4 changes: 2 additions & 2 deletions M2Mqtt/Messages/MqttMsgSuback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public static MqttMsgSuback Parse(byte fixedHeaderFirstByte, byte protocolVersio
/// <summary>
/// Returns the bytes that represents the current object.
/// </summary>
/// <param name="ProtocolVersion">MQTT protocol version</param>
/// <param name="protocolVersion">MQTT protocol version</param>
/// <returns>An array of bytes that represents the current object.</returns>
public override byte[] GetBytes(byte protocolVersion)
{
Expand Down Expand Up @@ -124,7 +124,7 @@ public override byte[] GetBytes(byte protocolVersion)
do
{
fixedHeaderSize++;
temp = temp / 128;
temp /= 128;
} while (temp > 0);

// allocate buffer for message
Expand Down
9 changes: 5 additions & 4 deletions M2Mqtt/Messages/MqttMsgSubscribe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ and the Eclipse Distribution License is available at
Contributors:
Paolo Patierno - initial API and implementation and/or initial documentation
.NET Foundation and Contributors - nanoFramework support
*/

using System;
// if NOT .Net Micro Framework
#if (!MF_FRAMEWORK_VERSION_V4_2 && !MF_FRAMEWORK_VERSION_V4_3 && !NANOFRAMEWORK_1_0)
#if (!MF_FRAMEWORK_VERSION_V4_2 && !MF_FRAMEWORK_VERSION_V4_3 && !MF_FRAMEWORK_VERSION_V4_4 && !NANOFRAMEWORK_1_0)
using System.Collections.Generic;
#endif
using System.Collections;
Expand Down Expand Up @@ -130,7 +131,7 @@ public static MqttMsgSubscribe Parse(byte fixedHeaderFirstByte, byte protocolVer
// NOTE : before, I don't know how many topics will be in the payload (so use List)

// if .Net Micro Framework
#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || NANOFRAMEWORK_1_0)
#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4 || NANOFRAMEWORK_1_0)
IList tmpTopics = new ArrayList();
IList tmpQosLevels = new ArrayList();
// else other frameworks (.Net, .Net Compact, Mono, Windows Phone)
Expand Down Expand Up @@ -168,7 +169,7 @@ public static MqttMsgSubscribe Parse(byte fixedHeaderFirstByte, byte protocolVer
/// <summary>
/// Returns the bytes that represents the current object.
/// </summary>
/// <param name="ProtocolVersion">MQTT protocol version</param>
/// <param name="protocolVersion">MQTT protocol version</param>
/// <returns>An array of bytes that represents the current object.</returns>
public override byte[] GetBytes(byte protocolVersion)
{
Expand Down Expand Up @@ -220,7 +221,7 @@ public override byte[] GetBytes(byte protocolVersion)
do
{
fixedHeaderSize++;
temp = temp / 128;
temp /= 128;
} while (temp > 0);

// allocate buffer for message
Expand Down
3 changes: 2 additions & 1 deletion M2Mqtt/Messages/MqttMsgSubscribeEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ and the Eclipse Distribution License is available at
Contributors:
Paolo Patierno - initial API and implementation and/or initial documentation
.NET Foundation and Contributors - nanoFramework support
*/

#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4)
#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4 || MF_FRAMEWORK_VERSION_V4_4)
using Microsoft.SPOT;
#else
using System;
Expand Down
3 changes: 2 additions & 1 deletion M2Mqtt/Messages/MqttMsgSubscribedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ and the Eclipse Distribution License is available at
Contributors:
Paolo Patierno - initial API and implementation and/or initial documentation
.NET Foundation and Contributors - nanoFramework support
*/

#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4)
#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4 || MF_FRAMEWORK_VERSION_V4_4)
using Microsoft.SPOT;
#else
using System;
Expand Down
4 changes: 2 additions & 2 deletions M2Mqtt/Messages/MqttMsgUnsuback.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public static MqttMsgUnsuback Parse(byte fixedHeaderFirstByte, byte protocolVers
/// <summary>
/// Returns the bytes that represents the current object.
/// </summary>
/// <param name="ProtocolVersion">MQTT protocol version</param>
/// <param name="protocolVersion">MQTT protocol version</param>
/// <returns>An array of bytes that represents the current object.</returns>
public override byte[] GetBytes(byte protocolVersion)
{
Expand All @@ -94,7 +94,7 @@ public override byte[] GetBytes(byte protocolVersion)
do
{
fixedHeaderSize++;
temp = temp / 128;
temp /= 128;
} while (temp > 0);

// allocate buffer for message
Expand Down
9 changes: 5 additions & 4 deletions M2Mqtt/Messages/MqttMsgUnsubscribe.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ and the Eclipse Distribution License is available at
Contributors:
Paolo Patierno - initial API and implementation and/or initial documentation
.NET Foundation and Contributors - nanoFramework support
*/

using System;
// if NOT .Net Micro Framework
#if (!MF_FRAMEWORK_VERSION_V4_2 && !MF_FRAMEWORK_VERSION_V4_3 && !NANOFRAMEWORK_1_0)
#if (!MF_FRAMEWORK_VERSION_V4_2 && !MF_FRAMEWORK_VERSION_V4_3 && !MF_FRAMEWORK_VERSION_V4_4 && !NANOFRAMEWORK_1_0)
using System.Collections.Generic;
#endif
using System.Collections;
Expand Down Expand Up @@ -117,7 +118,7 @@ public static MqttMsgUnsubscribe Parse(byte fixedHeaderFirstByte, byte protocolV
// NOTE : before, I don't know how many topics will be in the payload (so use List)

// if .Net Micro Framework
#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || NANOFRAMEWORK_1_0)
#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4 || NANOFRAMEWORK_1_0)
IList tmpTopics = new ArrayList();
// else other frameworks (.Net, .Net Compact, Mono, Windows Phone)
#else
Expand Down Expand Up @@ -147,7 +148,7 @@ public static MqttMsgUnsubscribe Parse(byte fixedHeaderFirstByte, byte protocolV
/// <summary>
/// Returns the bytes that represents the current object.
/// </summary>
/// <param name="ProtocolVersion">MQTT protocol version</param>
/// <param name="protocolVersion">MQTT protocol version</param>
/// <returns>An array of bytes that represents the current object.</returns>
public override byte[] GetBytes(byte protocolVersion)
{
Expand Down Expand Up @@ -190,7 +191,7 @@ public override byte[] GetBytes(byte protocolVersion)
do
{
fixedHeaderSize++;
temp = temp / 128;
temp /= 128;
} while (temp > 0);

// allocate buffer for message
Expand Down
1 change: 1 addition & 0 deletions M2Mqtt/Messages/MqttMsgUnsubscribeEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and the Eclipse Distribution License is available at
Contributors:
Paolo Patierno - initial API and implementation and/or initial documentation
.NET Foundation and Contributors - nanoFramework support
*/

#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4)
Expand Down
1 change: 1 addition & 0 deletions M2Mqtt/Messages/MqttMsgUnsubscribedEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and the Eclipse Distribution License is available at
Contributors:
Paolo Patierno - initial API and implementation and/or initial documentation
.NET Foundation and Contributors - nanoFramework support
*/

#if (MF_FRAMEWORK_VERSION_V4_2 || MF_FRAMEWORK_VERSION_V4_3 || MF_FRAMEWORK_VERSION_V4_4)
Expand Down
Loading

0 comments on commit ff5aa09

Please sign in to comment.