Fix Warnings

This commit is contained in:
Mathieu Maret 2016-04-07 16:14:19 +02:00
parent 08a02651a6
commit 85196a7563
4 changed files with 8 additions and 8 deletions

View File

@ -25,7 +25,7 @@ int EepromSaveConfig(uint8_t bootMode, String ssid, String password, String host
SKETCH_DEBUG_PRINTLN("Saving " + eeprom);
for (int i = 0; i < eeprom.length() && i < CONFIG_EEPROM_SIZE; i++) {
for (uint i = 0; i < eeprom.length() && i < CONFIG_EEPROM_SIZE; i++) {
EEPROM.write(i, eeprom.charAt(i));
}
@ -63,7 +63,7 @@ void EepromReadConfig(uint8_t &bootMode, char **ssid, char **password, char **ho
int i = 2;
uint8_t boot = EEPROM.read(0);
char *tmpString = "";
char *tmpString;
if (boot == '1') {
bootMode = BOOTMODE_NORMAL;

View File

@ -49,7 +49,7 @@ int MqttSetup(char *server, char *user, char *passwd, int port, char * hostname)
isMqttConfigured = server[0] != '\0';
for (int i = 0 ; i < NB_ELEMENTS(gpioWatched) && i < MAXSUBSCRIPTIONS; i++) {
for (uint i = 0 ; i < NB_ELEMENTS(gpioWatched) && i < MAXSUBSCRIPTIONS; i++) {
snprintf(GPIO_FEED[i], FEED_MAX_SIZE, GPIO_FEED_FORMAT, mqttId, gpioWatched[i]);
snprintf(GPIO_SET_FEED[i], FEED_MAX_SIZE, GPIO_SET_FEED_FORMAT, mqttId, gpioWatched[i]);
@ -126,7 +126,7 @@ int getGpioFromSubscription(Adafruit_MQTT_Subscribe *subscription) {
}
int getGpioWatchedIndex(int gpio) {
for ( int i = 0; i < NB_ELEMENTS(gpioWatched); i++) {
for ( uint i = 0; i < NB_ELEMENTS(gpioWatched); i++) {
if (gpio == gpioWatched[i])
return i;
}

View File

@ -37,7 +37,7 @@ void WebHandleRoot() {
);
}
void WebSendError(String error) {
void WebSendError(const char *error) {
server.send(500, "text/plain", error);
}
@ -96,7 +96,7 @@ void WebHandleGpio() {
server.send(200, "text/html", "<h1>GPIO" + server.arg("gpio") + " changed to " + server.arg("value") + "</h1>");
}
boolean WebSetIp(IPAddress &addr, char *id, String error) {
boolean WebSetIp(IPAddress &addr, const char *id, const char *error) {
if (server.arg(id) != "" && !addr.fromString(server.arg(id).c_str())) {
WebSendError(error);
return false;
@ -171,7 +171,7 @@ void WebHandleReboot() {
ESP.restart();
}
void WebSetupServer(int bootmode) {
void WebSetupServer(int ) {
server.on("/", WebHandleRoot);
server.on("/setup", WebHandleSetup);
server.on("/save", WebHandleSave);

View File

@ -57,7 +57,7 @@ char eeprom[CONFIG_EEPROM_SIZE];
double temp, pressure;
float dhtTemp, dhtHumidity;
uint8_t mode;
char *hostName = "";
const char *hostName = "";
/* Set these to your desired credentials. */
const char *ssid = CONFIG_SSID_NAME;