summaryrefslogtreecommitdiff
path: root/app/bin/cblock.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-12-28 20:24:50 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-12-28 20:24:50 +0100
commit09795a01ef859f072920de9df974d1b03b9ab9a4 (patch)
tree4d05907fc37f1bd781e506f5e196f7435aeec0ab /app/bin/cblock.c
parent5b4163d8c76b03f0d31b09866aa4bd06b4d8d804 (diff)
New upstream version 4.2.4aupstream/4.2.4a
Diffstat (limited to 'app/bin/cblock.c')
-rw-r--r--app/bin/cblock.c49
1 files changed, 24 insertions, 25 deletions
diff --git a/app/bin/cblock.c b/app/bin/cblock.c
index 06fd75a..5b728d0 100644
--- a/app/bin/cblock.c
+++ b/app/bin/cblock.c
@@ -1,6 +1,5 @@
-/*
- * ------------------------------------------------------------------
- * cblock.c - Implement blocks: a group of trackwork with a single occ. detector
+/** \file cblock.c
+ * Implement blocks: a group of trackwork with a single occ. detector
* Created by Robert Heller on Thu Mar 12 09:43:02 2009
* ------------------------------------------------------------------
* Modification History: $Log: not supported by cvs2svn $
@@ -22,26 +21,26 @@
* ------------------------------------------------------------------
* Contents:
* ------------------------------------------------------------------
- *
+ *
* Generic Project
* Copyright (C) 2005 Robert Heller D/B/A Deepwoods Software
* 51 Locke Hill Road
* Wendell, MA 01379-9728
- *
+ *
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
- *
+ *
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
+ *
* T_BLOCK
* $Header: /home/dmarkle/xtrkcad-fork-cvs/xtrkcad/app/bin/cblock.c,v 1.5 2009-11-23 19:46:16 rheller Exp $
*/
@@ -62,7 +61,7 @@ static int log_block = 0;
static void NoDrawLine(drawCmd_p d, coOrd p0, coOrd p1, wDrawWidth width,
wDrawColor color ) {}
static void NoDrawArc(drawCmd_p d, coOrd p, DIST_T r, ANGLE_T angle0,
- ANGLE_T angle1, BOOL_T drawCenter, wDrawWidth width,
+ ANGLE_T angle1, BOOL_T drawCenter, wDrawWidth width,
wDrawColor color ) {}
static void NoDrawString( drawCmd_p d, coOrd p, ANGLE_T a, char * s,
wFont_p fp, FONTSIZE_T fontSize, wDrawColor color ) {}
@@ -160,7 +159,7 @@ static void UpdateBlock (track_p trk, int inx, descData_p descUpd, BOOL_T needUn
}
if ( ! changed ) return;
if ( needUndoStart )
- UndoStart( _("Change Block"), "Change Block" );
+ UndoStart( _("Change block"), "Change block" );
UndoModify( trk );
if (nChanged) {
MyFree(xx->name);
@@ -202,7 +201,7 @@ static void DescribeBlock (track_p trk, char * str, CSIZE_T len )
strcpy( str, _(GetTrkTypeName( trk )) );
str++;
while (*str) {
- *str = tolower(*str);
+ *str = tolower((unsigned char)*str);
str++;
}
sprintf( str, _("(%d): Layer=%d %s"),
@@ -226,7 +225,7 @@ static void DescribeBlock (track_p trk, char * str, CSIZE_T len )
blockDesc[NM].mode =
blockDesc[SC].mode = DESC_NOREDRAW;
DoDescribe(_("Block"), trk, blockDesc, UpdateBlock );
-
+
}
static blockDebug (track_p trk)
@@ -242,7 +241,7 @@ static blockDebug (track_p trk)
LOG( log_block, 1, ("*** blockDebug(): trackList[%d] = T%d, ",iTrack,GetTrkIndex((&(xx->trackList))[iTrack])))
LOG( log_block, 1, ("%s\n",GetTrkTypeName((&(xx->trackList))[iTrack])))
}
-
+
}
static BOOL_T blockCheckContigiousPath()
@@ -293,7 +292,7 @@ static BOOL_T blockCheckContigiousPath()
}
if (!IsConnectedP && blockTrk_da.cnt > 1) return FALSE;
}
- return TRUE;
+ return TRUE;
}
static void DeleteBlock ( track_p t )
@@ -337,7 +336,7 @@ static void ReadBlock ( char * line )
}
DYNARR_RESET( track_p , blockTrk_da );
while ( (cp = GetNextLine()) != NULL ) {
- while (isspace(*cp)) cp++;
+ while (isspace((unsigned char)*cp)) cp++;
if ( strncmp( cp, "END", 3 ) == 0 ) {
break;
}
@@ -365,7 +364,7 @@ static void ReadBlock ( char * line )
LOG( log_block, 1, ("*** ReadBlock(): copying track T%d\n",GetTrkIndex(blockTrk(iTrack))))
(&(xx->trackList))[iTrack] = blockTrk(iTrack);
}
- blockDebug(trk);
+ blockDebug(trk);
}
@@ -407,7 +406,7 @@ static trackCmd_t blockCmds = {
};
-
+
#ifdef BLOCKCMD
static BOOL_T TrackInBlock (track_p trk, track_p blk) {
wIndex_t iTrack;
@@ -472,7 +471,7 @@ static void BlockOk ( void * junk )
wHide( blockW );
return;
}
- UndoStart( _("Create Block"), "Create Block" );
+ UndoStart( _("Create block"), "Create block" );
/* Create a block object */
LOG( log_block, 1, ("*** BlockOk(): %d tracks in block\n",blockTrk_da.cnt))
trk = NewTrack(0, T_BLOCK, tempEndPts_da.cnt, sizeof(blockData_t)+(sizeof(track_p)*(blockTrk_da.cnt-1))+1);
@@ -492,7 +491,7 @@ static void BlockOk ( void * junk )
UndoEnd();
}
wHide( blockW );
-
+
}
static void NewBlockDialog()
@@ -509,7 +508,7 @@ static void NewBlockDialog()
continue;
}
if ( FindBlock( trk ) != NULL ) {
- ErrorMessage( _("Selected Track is already in a block, skipped!") );
+ ErrorMessage( _("Selected track is already in a block, skipped!") );
continue;
}
blockElementCount++;
@@ -535,7 +534,7 @@ static STATUS_T CmdBlockCreate( wAction_t action, coOrd pos )
LOG( log_block, 1, ("*** CmdBlockAction(%08x,{%f,%f})\n",action,pos.x,pos.y))
switch (action & 0xFF) {
case C_START:
- fprintf(stderr,"*** CmdBlockCreate(): C_START\n");
+ fprintf(stderr,"*** CmdBlockCreate(): C_START\n");
NewBlockDialog();
return C_TERMINATE;
default:
@@ -549,7 +548,7 @@ static STATUS_T CmdBlockEdit( wAction_t action, coOrd pos )
{
track_p trk,btrk;
char msg[STR_SIZE];
-
+
switch (action) {
case C_START:
InfoMessage( _("Select a track") );
@@ -581,7 +580,7 @@ static STATUS_T CmdBlockDelete( wAction_t action, coOrd pos )
{
track_p trk,btrk;
blockData_p xx;
-
+
switch (action) {
case C_START:
InfoMessage( _("Select a track") );
@@ -598,7 +597,7 @@ static STATUS_T CmdBlockDelete( wAction_t action, coOrd pos )
/* Confirm Delete Block */
xx = GetblockData(btrk);
if ( NoticeMessage( _("Really delete block %s?"), _("Yes"), _("No"), xx->name) ) {
- UndoStart( _("Delete Block"), "delete" );
+ UndoStart( _("Delete Block"), "delete" );
DeleteTrack (btrk, FALSE);
UndoEnd();
return C_TERMINATE;
@@ -630,7 +629,7 @@ static STATUS_T CmdBlock (wAction_t action, coOrd pos )
default: return C_TERMINATE;
}
}
-
+
#include "bitmaps/blocknew.xpm"
#include "bitmaps/blockedit.xpm"
#include "bitmaps/blockdel.xpm"