1
0
mirror of https://github.com/DCC-EX/CommandStation-EX.git synced 2024-11-22 23:56:13 +01:00

INT16_MAX is a better end of array marker than -1

This commit is contained in:
Harald Barth 2023-05-23 10:57:45 +02:00
parent fdbcbdf418
commit 951a6637f0
2 changed files with 4 additions and 4 deletions

View File

@ -47,7 +47,7 @@
#define SENDFLASHLIST(stream,flashList) \
for (int16_t i=0;;i+=sizeof(flashList[0])) { \
int16_t value=GETHIGHFLASHW(flashList,i); \
if (value<0) break; \
if (value==INT16_MAX) break; \
StringFormatter::send(stream,F(" %d"),value); \
}

View File

@ -81,14 +81,14 @@ void exrailHalSetup() {
#define ROUTE(id, description) id,
const int16_t HIGHFLASH RMFT2::routeIdList[]= {
#include "myAutomation.h"
-1};
INT16_MAX};
// Pass 2a create throttle automation list
#include "EXRAIL2MacroReset.h"
#undef AUTOMATION
#define AUTOMATION(id, description) id,
const int16_t HIGHFLASH RMFT2::automationIdList[]= {
#include "myAutomation.h"
-1};
INT16_MAX};
// Pass 3 Create route descriptions:
#undef ROUTE
@ -201,7 +201,7 @@ const byte RMFT2::rosterNameCount=0
#define ROSTER(cabid,name,funcmap...) cabid,
const int16_t HIGHFLASH RMFT2::rosterIdList[]={
#include "myAutomation.h"
-1};
INT16_MAX};
// Pass 7: Roster names getter
#include "EXRAIL2MacroReset.h"