diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-03-19 19:56:15 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2018-03-19 19:56:15 +0100 |
commit | 1542c122b3672fe83e027411ad2445772e2d0ed3 (patch) | |
tree | e535bc621bd7ffa9d5ce89e0d495df5d1c4ab6fd /app/bin/cswitchmotor.c | |
parent | 773810e6583142d7d15263e6481c42aebed6d7f1 (diff) | |
parent | d1a8285f818eb7e5c3d6a05709ea21a808490b8c (diff) |
Update upstream source from tag 'upstream/5.1.0'
Update to upstream version '5.1.0'
with Debian dir 93ca74b8b4602fce4c9c7740e0cfdde25f086673
Diffstat (limited to 'app/bin/cswitchmotor.c')
-rw-r--r-- | app/bin/cswitchmotor.c | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/app/bin/cswitchmotor.c b/app/bin/cswitchmotor.c index dbe006c..3d39a68 100644 --- a/app/bin/cswitchmotor.c +++ b/app/bin/cswitchmotor.c @@ -50,10 +50,17 @@ */ #include <ctype.h> -#include "track.h" -#include "trackx.h" +#include <string.h> + #include "compound.h" +#include "cundo.h" +#include "custom.h" +#include "fileio.h" #include "i18n.h" +#include "param.h" +#include "track.h" +#include "trackx.h" +#include "utility.h" EXPORT TRKTYP_T T_SWITCHMOTOR = -1; @@ -271,7 +278,7 @@ static DIST_T DistanceSwitchMotor (track_p t, coOrd * p ) { switchmotorData_p xx = GetswitchmotorData(t); if (xx->turnout == NULL) return 0; - return GetTrkDistance(xx->turnout,*p); + return GetTrkDistance(xx->turnout,p); } static void DescribeSwitchMotor (track_p trk, char * str, CSIZE_T len ) @@ -769,11 +776,11 @@ EXPORT void CheckDeleteSwitchmotor(track_p t) track_p sm; switchmotorData_p xx; - sm = FindSwitchMotor( t ); - if (sm == NULL) return; - xx = GetswitchmotorData (sm); - NoticeMessage(_("Deleting Switch Motor %s"),_("Ok"),NULL,xx->name); - DeleteTrack (sm, FALSE); + while ((sm = FindSwitchMotor( t ))) { //Cope with multiple motors for one Turnout! + xx = GetswitchmotorData (sm); + InfoMessage(_("Deleting Switch Motor %s"),xx->name); + DeleteTrack (sm, FALSE); + }; } |