With --Wall, add DECLFILENAME warning on modules not matching filename.

This commit is contained in:
Wilson Snyder
2010-12-25 16:31:22 -05:00
parent fedf347b1a
commit 3e4e8feb29
13 changed files with 96 additions and 12 deletions
+9 -3
View File
@@ -167,13 +167,19 @@ const string FileLine::filebasename() const {
return name;
}
const string FileLine::profileFuncname() const {
// Return string that is OK as a function name - for profiling
string name = filebasename();
const string FileLine::filebasenameNoExt() const {
string name = filebasename();
string::size_type pos;
if ((pos = name.find(".")) != string::npos) {
name = name.substr(0,pos);
}
return name;
}
const string FileLine::profileFuncname() const {
// Return string that is OK as a function name - for profiling
string name = filebasenameNoExt();
string::size_type pos;
while ((pos = name.find_first_not_of("abcdefghijlkmnopqrstuvwxyzABCDEFGHIJLKMNOPQRSTUVWXYZ0123456789_"))
!= string::npos) {
name.replace(pos, 1, "_");