Skip to content

Commit e1a52dd

Browse files
committed
A number of tweaks to avoid GCC warnings in the current code. One warning is left for BEW to remedy.
1 parent b01627d commit e1a52dd

File tree

4 files changed

+61
-61
lines changed

4 files changed

+61
-61
lines changed

source/Adapt_It.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -35244,9 +35244,9 @@ enum Reparse reparseDoc)
3524435244
wxString xMkr = _T("\\x ");
3524535245
wxString xtMkr = _T("\\xt ");
3524635246
int indexOfXTmarker;
35247-
int indexOfXmarker;
35247+
//int indexOfXmarker;
3524835248
indexOfXTmarker = FindArrayStringUsingSubString(xtMkr, pUsfmFilterPageCommon->pSfmMarkerAndDescriptionsDoc, 0);
35249-
indexOfXmarker = FindArrayStringUsingSubString(xMkr, pUsfmFilterPageCommon->pSfmMarkerAndDescriptionsDoc, 0);
35249+
//indexOfXmarker = FindArrayStringUsingSubString(xMkr, pUsfmFilterPageCommon->pSfmMarkerAndDescriptionsDoc, 0);
3525035250
m_bMkr_xt_WasFilteredBeforeFilteringChange = (bool)pUsfmFilterPageCommon->m_filterFlagsDocBeforeEdit.Item(indexOfXTmarker);
3525135251
m_bMkr_xt_WasUnfilteredBeforeFilteringChange = !m_bMkr_xt_WasFilteredBeforeFilteringChange;
3525235252
//m_bMkr_x_WasFilteredBeforeFilteringChange = (bool)pUsfmFilterPageCommon->m_filterFlagsDocBeforeEdit.Item(indexOfXmarker);

source/Adapt_ItDoc.cpp

+47-47
Original file line numberDiff line numberDiff line change
@@ -9836,7 +9836,7 @@ bool CAdapt_ItDoc::ReconstituteAfterFilteringChange(CAdapt_ItView* pView,
98369836
// to their assignments below.
98379837

98389838
SPList::Node* saveNextPos = NULL;
9839-
SPList::Node* prevPos = NULL;
9839+
//SPList::Node* prevPos = NULL;
98409840
SPList::Node* follPos = NULL; // whm 26Nov2023 added but unused.
98419841
follPos = follPos; // avoid gcc set but not used warning
98429842

@@ -9848,7 +9848,7 @@ bool CAdapt_ItDoc::ReconstituteAfterFilteringChange(CAdapt_ItView* pView,
98489848
// test data the unfiltering of an \x...\x* span was skipped because it was stored
98499849
// on the first node/pSrcPhrase. Therefore I'm removing the bIsFirstNode block below
98509850
// and the bIsFirsNode flag.
9851-
prevPos = saveNextPos; // RHS was set before moving to next Node ptr, so is 'previous' still
9851+
//prevPos = saveNextPos; // RHS was set before moving to next Node ptr, so is 'previous' still
98529852
saveNextPos = pos_pList; // now we can update it to current Node
98539853
SPList::Node* insertPos = NULL;
98549854
CSourcePhrase* pInsertSP = NULL;
@@ -9947,8 +9947,8 @@ bool CAdapt_ItDoc::ReconstituteAfterFilteringChange(CAdapt_ItView* pView,
99479947
wxString nextWholeMkrInFilterBrackets; nextWholeMkrInFilterBrackets.Empty();
99489948
wxString previousWholeMkrInFilterBrackets; previousWholeMkrInFilterBrackets.Empty();
99499949
bool bThisMkrToBeUnfiltered;
9950-
bool bNextMkrToBeUnfiltered;
9951-
bool bPreviousMkrWasUnfiltered;
9950+
//bool bNextMkrToBeUnfiltered;
9951+
//bool bPreviousMkrWasUnfiltered;
99529952
bool bAnyPreviousMkrWasUnfiltered = FALSE;
99539953
filteredStrItemsWithBrackets = GetFilteredInfoSegments(theFilteredInfo);
99549954
int nTotFilterItems = (int)filteredStrItemsWithBrackets.GetCount();
@@ -9971,16 +9971,16 @@ bool CAdapt_ItDoc::ReconstituteAfterFilteringChange(CAdapt_ItView* pView,
99719971
bThisMkrToBeUnfiltered = TRUE;
99729972
else
99739973
bThisMkrToBeUnfiltered = FALSE;
9974-
int posNextFilteredMkr = nextWholeMkrInFilterBrackets.Find(augMkrWithInitialFilterBracket);
9975-
if (posNextFilteredMkr != wxNOT_FOUND)
9976-
bNextMkrToBeUnfiltered = TRUE;
9977-
else
9978-
bNextMkrToBeUnfiltered = FALSE;
9979-
int posPrevFilteredMkr = previousWholeMkrInFilterBrackets.Find(augMkrWithInitialFilterBracket);
9980-
if (posPrevFilteredMkr != wxNOT_FOUND)
9981-
bPreviousMkrWasUnfiltered = TRUE;
9982-
else
9983-
bPreviousMkrWasUnfiltered = FALSE;
9974+
//int posNextFilteredMkr = nextWholeMkrInFilterBrackets.Find(augMkrWithInitialFilterBracket);
9975+
//if (posNextFilteredMkr != wxNOT_FOUND)
9976+
// bNextMkrToBeUnfiltered = TRUE;
9977+
//else
9978+
// bNextMkrToBeUnfiltered = FALSE;
9979+
//int posPrevFilteredMkr = previousWholeMkrInFilterBrackets.Find(augMkrWithInitialFilterBracket);
9980+
//if (posPrevFilteredMkr != wxNOT_FOUND)
9981+
// bPreviousMkrWasUnfiltered = TRUE;
9982+
//else
9983+
// bPreviousMkrWasUnfiltered = FALSE;
99849984
if (!bThisMkrToBeUnfiltered)
99859985
{
99869986
// This marker was in m_filteredInfo, but NOT currently to be unfiltered, so it should be
@@ -10000,14 +10000,14 @@ bool CAdapt_ItDoc::ReconstituteAfterFilteringChange(CAdapt_ItView* pView,
1000010000
{
1000110001
// A previous marker was unfiltered, so scan backwards in the filterStatusOfProcessedMkrs
1000210002
// array and locate the most recent marker item in there with a non-NULL value, if any.
10003-
bool bFound = FALSE;
10003+
//bool bFound = FALSE;
1000410004
int itemIndex = -1;
1000510005
int startIndex = itemCt; // don't allow itemCt to change here!
1000610006
for (int i = startIndex; i > 0; i--)
1000710007
{
1000810008
if (LastWordSrcPhrofUnfilteredMkrsArr.Item(i) != NULL)
1000910009
{
10010-
bFound = TRUE;
10010+
//bFound = TRUE;
1001110011
itemIndex = i;
1001210012
break; // Don't iterate back any further. We want the last SP that wasn't NULL
1001310013
}
@@ -10276,12 +10276,12 @@ bool CAdapt_ItDoc::ReconstituteAfterFilteringChange(CAdapt_ItView* pView,
1027610276
}
1027710277
#endif
1027810278
CSourcePhrase* pSP_SubList = NULL;
10279-
SPList::Node* pos_LastInSubList = pSublist->GetLast();
10280-
CSourcePhrase* pSP_LastInSubList = NULL;
10279+
//SPList::Node* pos_LastInSubList = pSublist->GetLast();
10280+
//CSourcePhrase* pSP_LastInSubList = NULL;
1028110281
SPList::Node* pos_FirstInSubList = pSublist->GetFirst(); // used in a block below
1028210282
CSourcePhrase* pSP_FirstInSubList = NULL;
10283-
if (pos_LastInSubList != NULL)
10284-
pSP_LastInSubList = pos_LastInSubList->GetData();
10283+
//if (pos_LastInSubList != NULL)
10284+
// pSP_LastInSubList = pos_LastInSubList->GetData();
1028510285
if (pos_FirstInSubList != NULL)
1028610286
pSP_FirstInSubList = pos_FirstInSubList->GetData();
1028710287
pos_SubList = pSublist->GetFirst();
@@ -10740,12 +10740,12 @@ bool CAdapt_ItDoc::ReconstituteAfterFilteringChange(CAdapt_ItView* pView,
1074010740
// whm 6Nov2023 provide a pointer to the previous source phrase. We'll use
1074110741
// this to store filtered info from a previously unfiltered char attribute
1074210742
// marker.
10743-
CSourcePhrase* pPrevSrcPhrase = NULL;
10743+
//CSourcePhrase* pPrevSrcPhrase = NULL;
1074410744
SPList::Node* prevPos = pos_pList->GetPrevious();
10745-
if (prevPos != NULL)
10746-
{
10747-
pPrevSrcPhrase = (CSourcePhrase*)prevPos->GetData();
10748-
}
10745+
//if (prevPos != NULL)
10746+
//{
10747+
// pPrevSrcPhrase = (CSourcePhrase*)prevPos->GetData();
10748+
//}
1074910749

1075010750
pos_pList = pos_pList->GetNext();
1075110751
curSequNum = pSrcPhrase->m_nSequNumber;
@@ -12511,10 +12511,10 @@ g: bIsUnknownMkr = FALSE;
1251112511
// conditional - we may or may not need to use it below.
1251212512
// See more notes/comments below where we assign preStr to the m_markers
1251312513
// member.
12514-
SPList::Node* follPos = prevPos->GetNext();
12515-
CSourcePhrase* pFollSrcPhase = NULL;
12516-
if (follPos != NULL)
12517-
pFollSrcPhase = follPos->GetData();
12514+
//SPList::Node* follPos = prevPos->GetNext();
12515+
//CSourcePhrase* pFollSrcPhase = NULL;
12516+
//if (follPos != NULL)
12517+
// pFollSrcPhase = follPos->GetData();
1251812518

1251912519
// whm 19Mar2024 added. Filtered material is now being stored on a previous SP.
1252012520
// Here we need to ensure that the pPrevSrcPhrase is not a placeholder source
@@ -46334,7 +46334,7 @@ int CAdapt_ItDoc::TokenizeText(int nStartingSequNum, SPList* pList, wxString& rB
4633446334
// and appended to the end of the list of CSourcePhrase instances, and that one
4633546335
// gets the data prepared for filtering appended to its m_filteredInfo member.
4633646336
// The boolean is defined now, and a caching wxString after it:
46337-
bool bDelayStoringFilteredInfo = FALSE;
46337+
//bool bDelayStoringFilteredInfo = FALSE;
4633846338
wxString strCacheDelayedFilteredContent = wxEmptyString;
4633946339
// BEW 30Dec22 make sure a Doc member variables are initialised to FALSE
4634046340
m_bWidowedParenth = FALSE;
@@ -46906,7 +46906,7 @@ int CAdapt_ItDoc::TokenizeText(int nStartingSequNum, SPList* pList, wxString& rB
4690646906
bIsToBeFiltered = FALSE; // BEW 18Aug23 init to FALSE, otherwise it's 205 which is bogus TRUE
4690746907
// BEW 14Aug23 here is where to declare booleans to use in contentless USFM parsing loop
4690846908
bool bProcessEmptyMarker;
46909-
bool bExitEmptyMkrsLoop;
46909+
//bool bExitEmptyMkrsLoop;
4691046910

4691146911
while (!bSuppressBackwardSearchForWordBreakChar && IsMarker(ptr))
4691246912
{
@@ -46929,7 +46929,7 @@ int CAdapt_ItDoc::TokenizeText(int nStartingSequNum, SPList* pList, wxString& rB
4692946929
// test bool EnterEmptyMkrsLoop returns TRUE.
4693046930

4693146931
// ptr is at a beginMkr, so test for entry and set up the alternate parsing loop
46932-
bExitEmptyMkrsLoop = FALSE; // init
46932+
//bExitEmptyMkrsLoop = FALSE; // init
4693346933
wxString atMkr = wxEmptyString;
4693446934
wxString mkrTag = wxEmptyString;
4693546935
wxString strVerseNum = wxEmptyString; wxString strChapterNum = wxEmptyString;
@@ -47408,7 +47408,7 @@ int CAdapt_ItDoc::TokenizeText(int nStartingSequNum, SPList* pList, wxString& rB
4740847408
//pPrevSrcPhrase->AddToFilteredInfo(temp);
4740947409
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
4741047410
strCacheDelayedFilteredContent = temp; // temp is local and can now die
47411-
bDelayStoringFilteredInfo = TRUE; // BEW 17Dec22 need this TRUE value, because
47411+
//bDelayStoringFilteredInfo = TRUE; // BEW 17Dec22 need this TRUE value, because
4741247412
// if strCacheDelayedFilteredContent wxString is non-empty when control gets
4741347413
// to doc end, the an extra pSrcPhrase will be automatically created to have
4741447414
// a place to store it - see Doc lines 20,702++ for where that's done
@@ -47544,8 +47544,8 @@ int CAdapt_ItDoc::TokenizeText(int nStartingSequNum, SPList* pList, wxString& rB
4754447544
//pSrcPhrase->m_bFirstOfType = TRUE;
4754547545
//pSrcPhrase->m_bBoundary = TRUE;
4754647546
}
47547-
wxChar period;
47548-
period = _T('.');
47547+
//wxChar period;
47548+
//period = _T('.');
4754947549
int wholeMkrLength;
4755047550
wholeMkrLength = 0;
4755147551
wxString strTest;
@@ -47603,8 +47603,8 @@ int CAdapt_ItDoc::TokenizeText(int nStartingSequNum, SPList* pList, wxString& rB
4760347603

4760447604
ptr += awholemkrlen + eolLen;
4760547605

47606-
wxChar* pAux;
47607-
pAux = ptr;
47606+
//wxChar* pAux;
47607+
//pAux = ptr;
4760847608
#if defined (_DEBUG) && !defined (NOLOGS)
4760947609
{
4761047610
wxString strPointAt = wxString(ptr, 16);
@@ -48203,8 +48203,8 @@ int CAdapt_ItDoc::TokenizeText(int nStartingSequNum, SPList* pList, wxString& rB
4820348203
}
4820448204
}
4820548205
#endif
48206-
wxChar period;
48207-
period = _T('.');
48206+
//wxChar period;
48207+
//period = _T('.');
4820848208
wxString strTest;
4820948209
strTest = wxEmptyString;
4821048210
if (wholeMkr != verseMkr)
@@ -48299,7 +48299,7 @@ int CAdapt_ItDoc::TokenizeText(int nStartingSequNum, SPList* pList, wxString& rB
4829948299
// m_inform text ("Filtered Info Carrier") are displayed
4830048300
// in the nav text region at doc end
4830148301
strCacheDelayedFilteredContent = temp; // temp is local and can now die
48302-
bDelayStoringFilteredInfo = TRUE; // BEW 17Dec22 need this TRUE value, because
48302+
//bDelayStoringFilteredInfo = TRUE; // BEW 17Dec22 need this TRUE value, because
4830348303
// if strCacheDelayedFilteredContent wxString is non-empty when control gets
4830448304
// to doc end, the an extra pSrcPhrase will be automatically created to have
4830548305
// a place to store it - see Doc lines 20,702++ for where that's done
@@ -50519,7 +50519,7 @@ int CAdapt_ItDoc::TokenizeText(int nStartingSequNum, SPList* pList, wxString& rB
5051950519
// m_inform text ("Filtered Info Carrier") are displayed
5052050520
// in the nav text region at doc end
5052150521
strCacheDelayedFilteredContent = temp; // temp is local and can now die
50522-
bDelayStoringFilteredInfo = TRUE; // BEW 17Dec22 need this TRUE value, because
50522+
//bDelayStoringFilteredInfo = TRUE; // BEW 17Dec22 need this TRUE value, because
5052350523
// if strCacheDelayedFilteredContent wxString is non-empty when control gets
5052450524
// to doc end, the an extra pSrcPhrase will be automatically created to have
5052550525
// a place to store it - see Doc lines 20,702++ for where that's done
@@ -52605,14 +52605,14 @@ int CAdapt_ItDoc::TokenizeText(int nStartingSequNum, SPList* pList, wxString& rB
5260552605
// been reached, m_key in pSrcPhrase will be empty. So, providing m_precPunct is
5260652606
// empty, pSrcPhrase is not a valid CSourcePhrase instance. We need to check and
5260752607
// remove it.
52608-
bool bPrecedingPunctIsEmpty;
52609-
bPrecedingPunctIsEmpty = pSrcPhrase->m_precPunct.IsEmpty();
52610-
bool bHasNonEndMarkers;
52611-
bHasNonEndMarkers = !pSrcPhrase->m_markers.IsEmpty();
52608+
//bool bPrecedingPunctIsEmpty;
52609+
//bPrecedingPunctIsEmpty = pSrcPhrase->m_precPunct.IsEmpty();
52610+
//bool bHasNonEndMarkers;
52611+
//bHasNonEndMarkers = !pSrcPhrase->m_markers.IsEmpty();
5261252612
wxString someFilteredInfo;
5261352613
someFilteredInfo = pSrcPhrase->GetFilteredInfo(); // could be empty
52614-
bool bHasFilteredInfo;
52615-
bHasFilteredInfo = !someFilteredInfo.IsEmpty();
52614+
//bool bHasFilteredInfo;
52615+
//bHasFilteredInfo = !someFilteredInfo.IsEmpty();
5261652616

5261752617
/*
5261852618
// whm 12Jan2024 removed the following two if tests below entirely.

source/KB.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -4323,7 +4323,7 @@ bool CKB::StoreText(CSourcePhrase* pSrcPhrase, wxString& tgtPhrase, bool bSuppor
43234323
#endif
43244324
if (pSrcPhrase->m_nSequNumber >= 44)
43254325
{
4326-
int halt_here = 1;
4326+
int halt_here = 1; wxUnusedVar(halt_here);
43274327
}
43284328
}
43294329
#endif

source/helpers.cpp

+11-11
Original file line numberDiff line numberDiff line change
@@ -8469,7 +8469,7 @@ wxString FromSingleMakeSstr(CSourcePhrase* pSingleSrcPhrase)
84698469

84708470
} // end of else block for test: if (!bEndPuntsModified)
84718471

8472-
/* BEW, commented out - the caller will do this when appropriate
8472+
// BEW, commented out - the caller will do this when appropriate
84738473
pSingleSrcPhrase->m_srcPhrase = pSingleSrcPhrase->m_srcSinglePattern; // that's the word plus what follows
84748474

84758475
if (!pSingleSrcPhrase->m_precPunct.IsEmpty())
@@ -13628,7 +13628,7 @@ here2: dlgReturnCode = dlg.ShowModal();
1362813628
{ // 4
1362913629
// We must assume the src/gloss codes are wrong or incomplete, or that the
1363013630
// user has changed his mind about KB Sharing being on - so turn it off
13631-
/* BEW 25Sep20, deprecate, codes are no longer wanted, names instead
13631+
//BEW 25Sep20, deprecate, codes are no longer wanted, names instead
1363213632
HandleBadGlossingLangCodeOrCancel(pApp->m_saveOldIpAddrStr,
1363313633
pApp->m_saveOldHostnameStr, pApp->m_saveOldUsernameStr,
1363413634
pApp->m_savePassword, pApp->m_saveSharingAdaptationsFlag,
@@ -15642,7 +15642,7 @@ bool AnalyseSstr(wxString s, wxArrayString& arrItems, wxString separator, wxStri
1564215642
numWhites = 0;
1564315643
itsPuncts = wxEmptyString;
1564415644
space = _T(' '); // there might be a space before the punctuation in mkrSpan
15645-
CAdapt_ItDoc* pDoc = gpApp->GetDocument();
15645+
//CAdapt_ItDoc* pDoc = gpApp->GetDocument();
1564615646
wxString prefixPunct; prefixPunct.Empty();
1564715647

1564815648
// whm 14Feb2024 the original coding of the for loop below ignores any tokens that
@@ -15663,10 +15663,10 @@ bool AnalyseSstr(wxString s, wxArrayString& arrItems, wxString separator, wxStri
1566315663
// punctuation, and if so call GetConvertedPunct() to convert it to
1566415664
// target punctuation equivalents, and then put it as the first part
1566515665
// of CopiedTstr.
15666-
wxChar chFirst;
15666+
//wxChar chFirst;
1566715667
if (!mkrSpan.IsEmpty())
1566815668
{
15669-
chFirst = mkrSpan.GetChar(0);
15669+
//chFirst = mkrSpan.GetChar(0);
1567015670
if (FindOneOf(mkrSpan, tgtPuncts) != wxNOT_FOUND)
1567115671
{
1567215672
// mkrSpan contains at least one char in tgtPuncts set
@@ -15708,13 +15708,13 @@ bool AnalyseSstr(wxString s, wxArrayString& arrItems, wxString separator, wxStri
1570815708
// Found the offset to the backslash of a marker (begin or end marker)
1570915709
// Is the marker in this span a begin marker or end marker?
1571015710
// Set up the pointers we need for scanning itemStr's data buffer
15711-
bool bIsBeginMkr;
15712-
bool bIsEndMkr;
15713-
const wxChar* pBuffStart = mkrSpan.GetData();
15714-
wxChar* ptr = (wxChar*)pBuffStart; // for iterating forward
15715-
wxChar* pEnd = ptr + (size_t)mkrSpanLen; // points to null
15711+
//bool bIsBeginMkr;
15712+
//bool bIsEndMkr;
15713+
//const wxChar* pBuffStart = mkrSpan.GetData();
15714+
//wxChar* ptr = (wxChar*)pBuffStart; // for iterating forward
15715+
//wxChar* pEnd = ptr + (size_t)mkrSpanLen; // points to null
1571615716
//wholeMkr = mkrSpan.Left(offset + 1);
15717-
bIsBeginMkr = pDoc->IsBeginMarker(ptr, pEnd, wholeMkr, bIsEndMkr); // returns wholMkr
15717+
//bIsBeginMkr = pDoc->IsBeginMarker(ptr, pEnd, wholeMkr, bIsEndMkr); // returns wholMkr
1571815718
int lenMarker = (int)wholeMkr.Length();
1571915719
remainder = mkrSpan.Mid(lenMarker);
1572015720
if (!prefixPunct.IsEmpty())

0 commit comments

Comments
 (0)