Skip to content

Commit 17e7d68

Browse files
committed
[Cleanup] Use of "byte" as a type. uint8_t or (C++17) std::byte are better
As discussed here: esp8266/Arduino#8089 (comment)
1 parent 92ca4d5 commit 17e7d68

File tree

178 files changed

+1081
-1081
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+1081
-1081
lines changed

src/ESPEasy-Globals.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ struct pinStatesStruct
6060
{
6161
pinStatesStruct() : value(0), plugin(0), index(0), mode(0) {}
6262
uint16_t value;
63-
byte plugin;
64-
byte index;
65-
byte mode;
63+
uint8_t plugin;
64+
uint8_t index;
65+
uint8_t mode;
6666
} pinStates[PINSTATE_TABLE_MAX];
6767
*/
6868

src/_Plugin_Helper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ String getPluginCustomArgName(int varNr) {
8686
// if the regular values should also be displayed.
8787
// The call to PLUGIN_WEBFORM_SHOW_VALUES should only return success = true when no regular values should be displayed
8888
// Note that the varNr of the custom values should not conflict with the existing variable numbers (e.g. start at VARS_PER_TASK)
89-
void pluginWebformShowValue(taskIndex_t taskIndex, byte varNr, const __FlashStringHelper * label, const String& value, bool addTrailingBreak) {
89+
void pluginWebformShowValue(taskIndex_t taskIndex, uint8_t varNr, const __FlashStringHelper * label, const String& value, bool addTrailingBreak) {
9090
pluginWebformShowValue(taskIndex, varNr, String(label), value, addTrailingBreak);
9191
}
9292

9393
void pluginWebformShowValue(taskIndex_t taskIndex,
94-
byte varNr,
94+
uint8_t varNr,
9595
const String& label,
9696
const String& value,
9797
bool addTrailingBreak) {
@@ -123,7 +123,7 @@ void pluginWebformShowValue(const String& valName, const String& valName_id, con
123123
}
124124
}
125125

126-
bool pluginOptionalTaskIndexArgumentMatch(taskIndex_t taskIndex, const String& string, byte paramNr) {
126+
bool pluginOptionalTaskIndexArgumentMatch(taskIndex_t taskIndex, const String& string, uint8_t paramNr) {
127127
if (!validTaskIndex(taskIndex)) {
128128
return false;
129129
}

src/_Plugin_Helper.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ String getPluginCustomArgName(int varNr);
114114
// The call to PLUGIN_WEBFORM_SHOW_VALUES should only return success = true when no regular values should be displayed
115115
// Note that the varNr of the custom values should not conflict with the existing variable numbers (e.g. start at VARS_PER_TASK)
116116
void pluginWebformShowValue(taskIndex_t taskIndex,
117-
byte varNr,
117+
uint8_t varNr,
118118
const __FlashStringHelper * label,
119119
const String& value,
120120
bool addTrailingBreak = false);
121121

122122
void pluginWebformShowValue(taskIndex_t taskIndex,
123-
byte varNr,
123+
uint8_t varNr,
124124
const String& label,
125125
const String& value,
126126
bool addTrailingBreak = false);
@@ -141,7 +141,7 @@ void pluginWebformShowValue(const String& valName,
141141
// Return if parameter at given paramNr matches given taskIndex.
142142
bool pluginOptionalTaskIndexArgumentMatch(taskIndex_t taskIndex,
143143
const String& string,
144-
byte paramNr);
144+
uint8_t paramNr);
145145

146146
bool pluginWebformShowGPIOdescription(taskIndex_t taskIndex, const String& newline);
147147

src/src/Commands/Blynk.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ bool Blynk_get(const String& command, controllerIndex_t controllerIndex, float *
143143
if (data && line.startsWith("["))
144144
{
145145
String strValue = line;
146-
byte pos = strValue.indexOf('"', 2);
146+
uint8_t pos = strValue.indexOf('"', 2);
147147
strValue = strValue.substring(2, pos);
148148
strValue.trim();
149149
*data = 0.0f;

src/src/Commands/Common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const __FlashStringHelper * return_see_serial(struct EventStruct *event)
6262
String Command_GetORSetIP(struct EventStruct *event,
6363
const String & targetDescription,
6464
const char *Line,
65-
byte *IP,
65+
uint8_t *IP,
6666
const IPAddress & dhcpIP,
6767
int arg)
6868
{

src/src/Commands/Common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ bool IsNumeric(const char *source);
2222
String Command_GetORSetIP(struct EventStruct *event,
2323
const String & targetDescription,
2424
const char *Line,
25-
byte *IP,
25+
uint8_t *IP,
2626
const IPAddress& dhcpIP,
2727
int arg);
2828

src/src/Commands/Diagnostic.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ const __FlashStringHelper * Command_Debug(struct EventStruct *event, const char
159159

160160
const __FlashStringHelper * Command_logentry(struct EventStruct *event, const char *Line)
161161
{
162-
byte level = LOG_LEVEL_INFO;
162+
uint8_t level = LOG_LEVEL_INFO;
163163
// An extra optional parameter to set log level.
164164
if (event->Par2 > LOG_LEVEL_NONE && event->Par2 <= LOG_LEVEL_DEBUG_MORE) { level = event->Par2; }
165165
addLog(level, tolerantParseStringKeepCase(Line, 2));

0 commit comments

Comments
 (0)