Skip to content

Commit cfbbbf7

Browse files
committed
Remove more unused variables in various areas
All found by Clang's -Wunused-but-set-variable.
1 parent fe6e1d2 commit cfbbbf7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+39
-158
lines changed

build/rmkdepend/parse.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,6 @@ struct symtab **fdefined(register char *symbol, struct inclist *file, struct inc
248248
register struct inclist **ip;
249249
register struct symtab **val;
250250
register int i;
251-
static int recurse_lvl = 0;
252251

253252
if (file->i_flags & DEFCHECKED)
254253
return(NULL);
@@ -268,7 +267,6 @@ struct symtab **fdefined(register char *symbol, struct inclist *file, struct inc
268267
if (val != NULL) break;
269268
}
270269
} else if (val != NULL && srcfile != NULL) *srcfile = file;
271-
recurse_lvl--;
272270
file->i_flags &= ~DEFCHECKED;
273271

274272
return(val);

core/base/src/TRemoteObject.cxx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,6 @@ TList *TRemoteObject::Browse()
139139
// allocations of new objects with the same names during browsing.
140140
TList *objects = new TList;
141141

142-
static Int_t level = 0;
143142
const char *name = GetTitle();
144143
TRemoteObject *sdir;
145144

@@ -157,7 +156,6 @@ TList *TRemoteObject::Browse()
157156
while ((file=(TSystemFile*)next())) {
158157
fname = file->GetName();
159158
if (file->IsDirectory()) {
160-
level++;
161159
TString sdirpath;
162160
if (!strcmp(fname.Data(), "."))
163161
sdirpath = name;
@@ -171,7 +169,6 @@ TList *TRemoteObject::Browse()
171169
}
172170
sdir = new TRemoteObject(fname.Data(), sdirpath.Data(), "TSystemDirectory");
173171
objects->Add(sdir);
174-
level--;
175172
}
176173
}
177174
// then files...

core/dictgen/src/LinkdefReader.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -571,9 +571,7 @@ bool LinkdefReader::ProcessOperators(std::string &pattern)
571571
int pos = -1;
572572
int pos1 = -1, pos2 = -1;
573573
int open_br = 0, close_br = 0;
574-
int i = 0;
575574
while (true) {
576-
i++;
577575
pos = pattern.find(" ", pos + 1);
578576
pos1 = pattern.find("<", pos1 + 1);
579577
pos2 = pattern.find(">", pos2 + 1);

core/dictgen/src/SelectionRules.cxx

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,6 @@ const ClassSelectionRule *SelectionRules::IsNamespaceSelected(const clang::Decl*
580580
int fImplNo = 0;
581581
const ClassSelectionRule *explicit_selector = nullptr;
582582
const ClassSelectionRule *specific_pattern_selector = nullptr;
583-
int fFileNo = 0;
584583

585584
// NOTE: should we separate namespaces from classes in the rules?
586585
std::list<ClassSelectionRule>::const_iterator it = fClassSelectionRules.begin();
@@ -609,8 +608,8 @@ const ClassSelectionRule *SelectionRules::IsNamespaceSelected(const clang::Decl*
609608
} else if (it->GetSelected() == BaseSelectionRule::kNo) {
610609
if (!IsLinkdefFile()) {
611610
// in genreflex - we could explicitly select classes from other source files
612-
if (match == BaseSelectionRule::kFile) ++fFileNo; // if we have veto because of class defined in other source file -> implicit No
613-
else {
611+
// if we have veto because of class defined in other source file -> implicit No
612+
if (match != BaseSelectionRule::kFile) {
614613

615614
#ifdef SELECTION_DEBUG
616615
std::cout<<"\tNo returned"<<std::endl;
@@ -697,7 +696,6 @@ const ClassSelectionRule *SelectionRules::IsClassSelected(const clang::Decl* D,
697696
int fImplNo = 0;
698697
const ClassSelectionRule *explicit_selector = nullptr;
699698
const ClassSelectionRule *specific_pattern_selector = nullptr;
700-
int fFileNo = 0;
701699

702700
// iterate through all class selection rles
703701
bool earlyReturn=false;
@@ -741,8 +739,8 @@ const ClassSelectionRule *SelectionRules::IsClassSelected(const clang::Decl* D,
741739

742740
if (!isLinkDefFile) {
743741
// in genreflex - we could explicitly select classes from other source files
744-
if (match == BaseSelectionRule::kFile) ++fFileNo; // if we have veto because of class defined in other source file -> implicit No
745-
else {
742+
// if we have veto because of class defined in other source file -> implicit No
743+
if (match != BaseSelectionRule::kFile) {
746744
retval = selector;
747745
earlyReturn=true; // explicit No returned
748746
}
@@ -1059,7 +1057,6 @@ const BaseSelectionRule *SelectionRules::IsLinkdefMethodSelected(const clang::De
10591057
std::cout<<"\tFunction prototype = "<<prototype<<std::endl;
10601058
#endif
10611059

1062-
int expl_Yes = 0, impl_r_Yes = 0, impl_rr_Yes = 0;
10631060
int impl_r_No = 0, impl_rr_No = 0;
10641061
const BaseSelectionRule *explicit_r = nullptr;
10651062
const BaseSelectionRule *implicit_r = nullptr;
@@ -1076,8 +1073,7 @@ const BaseSelectionRule *SelectionRules::IsLinkdefMethodSelected(const clang::De
10761073
// here I should implement my implicit/explicit thing
10771074
// I have included two levels of implicitness - "A::Get_*" is stronger than "*"
10781075
explicit_r = &(*it);
1079-
if (it->GetSelected() == BaseSelectionRule::kYes) ++expl_Yes;
1080-
else {
1076+
if (it->GetSelected() != BaseSelectionRule::kYes) {
10811077

10821078
#ifdef SELECTION_DEBUG
10831079
std::cout<<"\tExplicit rule BaseSelectionRule::kNo found"<<std::endl;
@@ -1103,7 +1099,6 @@ const BaseSelectionRule *SelectionRules::IsLinkdefMethodSelected(const clang::De
11031099
std::cout<<"Implicit_rr rule ("<<pat_value<<"), selected = "<<selected<<std::endl;
11041100
#endif
11051101

1106-
++impl_rr_Yes;
11071102
}
11081103
else {
11091104

@@ -1122,7 +1117,6 @@ const BaseSelectionRule *SelectionRules::IsLinkdefMethodSelected(const clang::De
11221117
std::cout<<"Implicit_r rule ("<<pat_value<<"), selected = "<<selected<<std::endl;
11231118
#endif
11241119

1125-
++impl_r_Yes;
11261120
}
11271121
else {
11281122

@@ -1137,7 +1131,7 @@ const BaseSelectionRule *SelectionRules::IsLinkdefMethodSelected(const clang::De
11371131
}
11381132
}
11391133
}
1140-
if (explicit_r /*&& expl_Yes > 0*/){
1134+
if (explicit_r){
11411135

11421136
#ifdef SELECTION_DEBUG
11431137
std::cout<<"\tExplicit rule BaseSelectionRule::BaseSelectionRule::kYes found"<<std::endl;
@@ -1277,7 +1271,6 @@ const BaseSelectionRule *SelectionRules::IsMemberSelected(const clang::Decl* D,
12771271
const BaseSelectionRule *selector = nullptr;
12781272
Int_t fImplNo = 0;
12791273
const BaseSelectionRule *explicit_selector = nullptr;
1280-
int fFileNo = 0;
12811274

12821275
//DEBUG std::cout<<"\n\tParent is class";
12831276
std::list<ClassSelectionRule>::const_iterator it = fClassSelectionRules.begin();
@@ -1302,8 +1295,7 @@ const BaseSelectionRule *SelectionRules::IsMemberSelected(const clang::Decl* D,
13021295
}
13031296
} else if (it->GetSelected() == BaseSelectionRule::kNo) {
13041297
if (!IsLinkdefFile()) {
1305-
if (match == BaseSelectionRule::kFile) ++fFileNo;
1306-
else {
1298+
if (match != BaseSelectionRule::kFile) {
13071299

13081300
#ifdef SELECTION_DEBUG
13091301
std::cout<<"\tNo returned"<<std::endl;

geom/geom/src/TGeoNavigator.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1122,8 +1122,6 @@ TGeoNode *TGeoNavigator::FindNextDaughterBoundary(Double_t *point, Double_t *dir
11221122

11231123
TGeoNode *TGeoNavigator::FindNextBoundaryAndStep(Double_t stepmax, Bool_t compsafe)
11241124
{
1125-
static Int_t icount = 0;
1126-
icount++;
11271125
Int_t iact = 3;
11281126
Int_t idebug = TGeoManager::GetVerboseLevel();
11291127
Int_t nextindex;

graf2d/graf/src/TLatex.cxx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2284,7 +2284,6 @@ Int_t TLatex::CheckLatexSyntax(TString &text)
22842284
Int_t length = text.Length() ;
22852285

22862286
Int_t nOfCurlyBracket, nOfKW1, nOfKW2, nOfKW3, nOfSquareCurly, nOfCurlyCurly ;
2287-
Int_t nOfExtraCurly = 0 , nOfExtraSquare = 0;
22882287
Int_t nOfSquareBracket = 0 ;
22892288
Int_t error = 0 ;
22902289
Bool_t quote1 = kFALSE , quote2 = kFALSE;
@@ -2397,19 +2396,16 @@ Int_t TLatex::CheckLatexSyntax(TString &text)
23972396
text.Insert(i,"@") ;
23982397
length++ ;
23992398
i+=2 ;
2400-
nOfExtraSquare-- ;
24012399
}
24022400
else if (text[i] == '[' ) { // not belonging to a key word, add @ in front
24032401
text.Insert(i,"@") ;
24042402
length++ ;
24052403
i+=2 ;
2406-
nOfExtraSquare++ ;
24072404
}
24082405
else if (text[i] == '{' ) { // not belonging to a key word, add @ in front
24092406
text.Insert(i,"@") ;
24102407
length++ ;
24112408
i+=2 ;
2412-
nOfExtraCurly++ ;
24132409
}
24142410
else if (text[i] == '}' ) {
24152411
if ( nOfCurlyBracket) {
@@ -2419,7 +2415,6 @@ Int_t TLatex::CheckLatexSyntax(TString &text)
24192415
text.Insert(i,"@") ;
24202416
length++ ;
24212417
i+=2 ;
2422-
nOfExtraCurly-- ;
24232418
}
24242419
} else {
24252420
i++ ;

graf3d/eve/src/TEveStraightLineSetGL.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ void TEveStraightLineSetGL::DirectDraw(TGLRnrCtx& rnrCtx) const
119119
TEveChunkManager::iterator li(mL.GetLinePlex());
120120
if (rnrCtx.SecSelection())
121121
{
122-
GLuint name = 0;
123122
glPushName(1);
124123
glPushName(0);
125124
while (li.next())
@@ -132,7 +131,6 @@ void TEveStraightLineSetGL::DirectDraw(TGLRnrCtx& rnrCtx) const
132131
glVertex3f(l.fV2[0], l.fV2[1], l.fV2[2]);
133132
glEnd();
134133
}
135-
name ++;
136134
}
137135
glPopName();
138136
glPopName();

graf3d/g3d/src/TNode.cxx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ TNode::TNode(const char *name, const char *title, const char *shapename, Double_
8787
Color_t lcolor = 16;
8888
SetLineColor(lcolor);
8989
#endif
90-
static Int_t counter = 0;
91-
counter++;
9290
fX = x;
9391
fY = y;
9492
fZ = z;

gui/gui/src/TGTextEntry.cxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,6 @@ Bool_t TGTextEntry::HandleKey(Event_t* event)
12251225

12261226
gVirtualX->LookupString(event, tmp, sizeof(tmp), keysym);
12271227
n = strlen(tmp);
1228-
Int_t unknown = 0;
12291228

12301229
if ((EKeySym)keysym == kKey_Enter || (EKeySym)keysym == kKey_Return) {
12311230

@@ -1288,8 +1287,6 @@ Bool_t TGTextEntry::HandleKey(Event_t* event)
12881287
case kKey_Left:
12891288
CursorWordBackward(event->fState & kKeyShiftMask);
12901289
break;
1291-
default:
1292-
unknown++;
12931290
}
12941291
} else if (n && keysym <127 && keysym >=32 && // printable keys
12951292
(EKeySym)keysym != kKey_Delete &&
@@ -1328,7 +1325,8 @@ Bool_t TGTextEntry::HandleKey(Event_t* event)
13281325
SetInsertMode(GetInsertMode() == kInsert ? kReplace : kInsert);
13291326
break;
13301327
default:
1331-
unknown++;
1328+
// empty case to avoid compiler warning about unhandled enum values
1329+
break;
13321330
}
13331331
}
13341332

gui/guihtml/src/TGHtmlParse.cxx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,6 @@ int TGHtml::Tokenize()
581581
int pIsInNoScript = 0;
582582
int pIsInNoFrames = 0;
583583
#endif
584-
int sawdot = 0;
585584
int inLi = 0;
586585

587586
static char null[1] = { "" };
@@ -595,7 +594,6 @@ int TGHtml::Tokenize()
595594

596595
while ((c = z[n]) != 0) {
597596

598-
sawdot--;
599597
if (c == -64 && z[n+1] == -128) {
600598
n += 2;
601599
continue;
@@ -696,16 +694,6 @@ int TGHtml::Tokenize()
696694
(c = z[n+i]) != 0 && isspace((unsigned char)c) && c != '\n' && c != '\r';
697695
i++) { }
698696
if (c == '\r' && z[n+i+1] == '\n') ++i;
699-
#if 0 // this is certainly NOT OK, since it alters pre-formatted text
700-
if (sawdot == 1) {
701-
pElem = new TGHtmlTextElement(2);
702-
strcpy(((TGHtmlTextElement *)pElem)->fZText, " ");
703-
pElem->fElId = ++fIdind;
704-
pElem->fOffs = n;
705-
pElem->fCount = 1;
706-
AppendElement(pElem);
707-
}
708-
#endif
709697
pElem = new TGHtmlSpaceElement;
710698
if (pElem == 0) goto incomplete;
711699
((TGHtmlSpaceElement *)pElem)->fW = 0;
@@ -733,7 +721,6 @@ int TGHtml::Tokenize()
733721

734722
// Ordinary text
735723
for (i = 1; (c = z[n+i]) != 0 && !isspace((unsigned char)c) && c != '<'; i++) {}
736-
if (z[n+i-1] == '.' || z[n+i-1] == '!' || z[n+i-1] == '?') sawdot = 2;
737724
if (c == 0) goto incomplete;
738725
if (fIPlaintext != 0 && z[n] == '<') {
739726
switch (fIPlaintext) {

0 commit comments

Comments
 (0)