Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Update to prevent some compiler warnings #4

Merged
merged 2 commits into from
Feb 15, 2017

Conversation

sergiotomasello
Copy link
Contributor

No description provided.

src/lib/mqtt.cpp Outdated
@@ -15,7 +15,7 @@ MQTT::MQTT(ESP *esp8266)
boolean MQTT::begin(const char* client_id, const char* user, const char* pass, uint16_t keep_alive, boolean clean_seasion)
{
uint16_t crc;
uint32_t wait, cb_data;
uint32_t /*wait,*/ cb_data;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is wait unused everywhere or only in this implementation?

return msg_split[index];
}

bool isEmpty(){
//if (atoi( get(1) ) > 0)
if (get(2) != "")
//if (get(2) != "")
if ( strcmp(get(2), "") != 0)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

strcmp is unsafe, it's better if you use strncmp (or something even easier, based on what is the expected result of get(2))

@@ -30,11 +30,31 @@ class ArduinoWifiClass : public WifiData

class CiaoClass : public WifiData
{
private:
const char* DEF_DATA = "";
const char* DEF_METH = "GET";

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these strings hidden as defines really needed?

@@ -239,8 +224,13 @@ CiaoData PassThroughWrite(char* connector,char* hostname, String data, char* met
ciao_data.msg_split[2]="Protocol Error";
return ciao_data;
}
}

CiaoData PassThroughWrite(const char* connector, const char* hostname, String data, const char* method){

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for this rewrite

@sergiotomasello sergiotomasello merged commit d52adb2 into arduino-libraries:master Feb 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants