mirror of
https://github.com/DCC-EX/CommandStation-EX.git
synced 2025-03-31 18:50:12 +02:00
INT16_MAX is a better end of array marker than -1
This commit is contained in:
parent
fdbcbdf418
commit
951a6637f0
@ -47,7 +47,7 @@
|
|||||||
#define SENDFLASHLIST(stream,flashList) \
|
#define SENDFLASHLIST(stream,flashList) \
|
||||||
for (int16_t i=0;;i+=sizeof(flashList[0])) { \
|
for (int16_t i=0;;i+=sizeof(flashList[0])) { \
|
||||||
int16_t value=GETHIGHFLASHW(flashList,i); \
|
int16_t value=GETHIGHFLASHW(flashList,i); \
|
||||||
if (value<0) break; \
|
if (value==INT16_MAX) break; \
|
||||||
StringFormatter::send(stream,F(" %d"),value); \
|
StringFormatter::send(stream,F(" %d"),value); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -81,14 +81,14 @@ void exrailHalSetup() {
|
|||||||
#define ROUTE(id, description) id,
|
#define ROUTE(id, description) id,
|
||||||
const int16_t HIGHFLASH RMFT2::routeIdList[]= {
|
const int16_t HIGHFLASH RMFT2::routeIdList[]= {
|
||||||
#include "myAutomation.h"
|
#include "myAutomation.h"
|
||||||
-1};
|
INT16_MAX};
|
||||||
// Pass 2a create throttle automation list
|
// Pass 2a create throttle automation list
|
||||||
#include "EXRAIL2MacroReset.h"
|
#include "EXRAIL2MacroReset.h"
|
||||||
#undef AUTOMATION
|
#undef AUTOMATION
|
||||||
#define AUTOMATION(id, description) id,
|
#define AUTOMATION(id, description) id,
|
||||||
const int16_t HIGHFLASH RMFT2::automationIdList[]= {
|
const int16_t HIGHFLASH RMFT2::automationIdList[]= {
|
||||||
#include "myAutomation.h"
|
#include "myAutomation.h"
|
||||||
-1};
|
INT16_MAX};
|
||||||
|
|
||||||
// Pass 3 Create route descriptions:
|
// Pass 3 Create route descriptions:
|
||||||
#undef ROUTE
|
#undef ROUTE
|
||||||
@ -201,7 +201,7 @@ const byte RMFT2::rosterNameCount=0
|
|||||||
#define ROSTER(cabid,name,funcmap...) cabid,
|
#define ROSTER(cabid,name,funcmap...) cabid,
|
||||||
const int16_t HIGHFLASH RMFT2::rosterIdList[]={
|
const int16_t HIGHFLASH RMFT2::rosterIdList[]={
|
||||||
#include "myAutomation.h"
|
#include "myAutomation.h"
|
||||||
-1};
|
INT16_MAX};
|
||||||
|
|
||||||
// Pass 7: Roster names getter
|
// Pass 7: Roster names getter
|
||||||
#include "EXRAIL2MacroReset.h"
|
#include "EXRAIL2MacroReset.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user