Skip to content

Commit

Permalink
cpplint'ed the code, fixed minor glitches
Browse files Browse the repository at this point in the history
  • Loading branch information
suizokukan committed Nov 9, 2014
1 parent 326e1ed commit b9d7274
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 119 deletions.
2 changes: 1 addition & 1 deletion cppdipylon/build_number
Original file line number Diff line number Diff line change
@@ -1 +1 @@
607
613
82 changes: 14 additions & 68 deletions cppdipylon/cpplint_py__output
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,22 @@ Total errors found: 0
./dipydoc/notes.cpp:98: Lines should very rarely be longer than 150 characters [whitespace/line_length] [4]
Done processing ./dipydoc/notes.cpp
Total errors found: 1
./dipydoc/menunames.h:117: Lines should be <= 120 characters long [whitespace/line_length] [2]
Done processing ./dipydoc/menunames.h
Total errors found: 1
./dipydoc/dipydoc.cpp:99: Missing space before ( in while( [whitespace/parens] [5]
./dipydoc/dipydoc.cpp:1232: Redundant blank line at the end of a code block should be deleted. [whitespace/blank_line] [3]
./dipydoc/dipydoc.cpp:1275: Extra space after ( in function call [whitespace/parens] [4]
./dipydoc/dipydoc.cpp:1294: Missing space before ( in if( [whitespace/parens] [5]
./dipydoc/dipydoc.cpp:1307: Missing space before ( in if( [whitespace/parens] [5]
./dipydoc/dipydoc.cpp:1316: Extra space after ( in function call [whitespace/parens] [4]
./dipydoc/dipydoc.cpp:1379: Missing space before ( in while( [whitespace/parens] [5]
./dipydoc/dipydoc.cpp:1380: Missing spaces around == [whitespace/operators] [3]
./dipydoc/dipydoc.cpp:1394: Missing space before ( in while( [whitespace/parens] [5]
./dipydoc/dipydoc.cpp:1502: Lines should be <= 120 characters long [whitespace/line_length] [2]
./dipydoc/dipydoc.cpp:1277: Add #include <map> for map<> [build/include_what_you_use] [4]
Total errors found: 0
Done processing ./dipydoc/dipydoc.cpp
Total errors found: 11
./dipydoc/syntagmas.h:68: #endif line should be "#endif // CPPDIPYLON_DIPYDOC_SYNTAGMAS_H_" [build/header_guard] [5]
Total errors found: 0
Done processing ./dipydoc/syntagmas.h
Total errors found: 1
./dipydoc/arrowtarget.h:56: #endif line should be "#endif // CPPDIPYLON_DIPYDOC_ARROWTARGET_H_" [build/header_guard] [5]
Total errors found: 0
Done processing ./dipydoc/arrowtarget.h
Total errors found: 1
./dipydoc/syntagmas.cpp:92: Missing spaces around == [whitespace/operators] [3]
Total errors found: 0
Done processing ./dipydoc/syntagmas.cpp
Total errors found: 1
Total errors found: 0
Done processing ./dipydoc/dipydoc.h
Total errors found: 0
./dipydoc/notes.h:69: #endif line should be "#endif // CPPDIPYLON_DIPYDOC_NOTES_H_" [build/header_guard] [5]
Done processing ./dipydoc/notes.h
Total errors found: 1
./languages/languages.h:46: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2]
Total errors found: 0
Done processing ./languages/languages.h
Total errors found: 1
Total errors found: 0
Done processing ./languages/languagefromto.cpp
Total errors found: 0
Done processing ./languages/languagefromto.h
Expand Down Expand Up @@ -66,9 +49,8 @@ Done processing ./pos/posintext/vectorposintextranges.cpp
Total errors found: 0
Done processing ./pos/posintext/posintext2str.cpp
Total errors found: 0
./pos/posintext/posintextranges.h:65: At least two spaces is best between code and comments [whitespace/comments] [2]
Done processing ./pos/posintext/posintextranges.h
Total errors found: 1
Total errors found: 0
Done processing ./pos/posinaudio/posinaudiorange.h
Total errors found: 0
Done processing ./pos/posinaudio/posinaudiorange.cpp
Expand All @@ -87,13 +69,10 @@ Done processing ./qt/arrowformat.cpp
Total errors found: 0
Done processing ./qt/scsplitter.cpp
Total errors found: 0
./qt/textformat.cpp:306: Extra space after ( in function call [whitespace/parens] [4]
./qt/textformat.cpp:323: Extra space after ( in function call [whitespace/parens] [4]
Done processing ./qt/textformat.cpp
Total errors found: 2
./qt/commentaryeditor.h:61: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3]
Total errors found: 0
Done processing ./qt/commentaryeditor.h
Total errors found: 1
Total errors found: 0
Done processing ./qt/sourcezone.h
Total errors found: 0
Done processing ./qt/sourcetoolbar.h
Expand All @@ -116,35 +95,8 @@ Done processing ./qt/commentaryzone.h
Total errors found: 0
Done processing ./qt/downloaddemodipydocs.h
Total errors found: 0
./qt/sourceeditor.cpp:339: At least two spaces is best between code and comments [whitespace/comments] [2]
./qt/sourceeditor.cpp:342: Missing spaces around = [whitespace/operators] [4]
./qt/sourceeditor.cpp:346: Missing spaces around = [whitespace/operators] [4]
./qt/sourceeditor.cpp:350: Missing spaces around = [whitespace/operators] [4]
./qt/sourceeditor.cpp:367: Missing spaces around == [whitespace/operators] [3]
./qt/sourceeditor.cpp:367: Missing space before ( in while( [whitespace/parens] [5]
./qt/sourceeditor.cpp:371: Missing spaces around = [whitespace/operators] [4]
./qt/sourceeditor.cpp:421: Lines should very rarely be longer than 150 characters [whitespace/line_length] [4]
./qt/sourceeditor.cpp:429: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2]
./qt/sourceeditor.cpp:436: Missing space before ( in switch( [whitespace/parens] [5]
./qt/sourceeditor.cpp:446: Extra space after ( in function call [whitespace/parens] [4]
./qt/sourceeditor.cpp:446: Extra space before ) [whitespace/parens] [2]
./qt/sourceeditor.cpp:447: Lines should be <= 120 characters long [whitespace/line_length] [2]
./qt/sourceeditor.cpp:451: Extra space after ( in function call [whitespace/parens] [4]
./qt/sourceeditor.cpp:451: Extra space before ) [whitespace/parens] [2]
./qt/sourceeditor.cpp:452: Lines should be <= 120 characters long [whitespace/line_length] [2]
./qt/sourceeditor.cpp:466: Extra space after ( in function call [whitespace/parens] [4]
./qt/sourceeditor.cpp:466: Extra space before ) [whitespace/parens] [2]
./qt/sourceeditor.cpp:467: Lines should be <= 120 characters long [whitespace/line_length] [2]
./qt/sourceeditor.cpp:471: Extra space after ( in function call [whitespace/parens] [4]
./qt/sourceeditor.cpp:471: Extra space before ) [whitespace/parens] [2]
./qt/sourceeditor.cpp:472: Lines should be <= 120 characters long [whitespace/line_length] [2]
./qt/sourceeditor.cpp:484: Extra space after ( in function call [whitespace/parens] [4]
./qt/sourceeditor.cpp:484: Extra space before ) [whitespace/parens] [2]
./qt/sourceeditor.cpp:485: Lines should be <= 120 characters long [whitespace/line_length] [2]
./qt/sourceeditor.cpp:495: Lines should very rarely be longer than 150 characters [whitespace/line_length] [4]
./qt/sourceeditor.cpp:833: Lines should be <= 120 characters long [whitespace/line_length] [2]
Done processing ./qt/sourceeditor.cpp
Total errors found: 27
Total errors found: 0
Done processing ./qt/texteditor.h
Total errors found: 0
Done processing ./qt/commentarytoolbar.cpp
Expand All @@ -165,9 +117,8 @@ Done processing ./qt/sctabs.h
Total errors found: 0
Done processing ./qt/mainwindow.h
Total errors found: 0
./qt/mainwindow.cpp:138: Lines should very rarely be longer than 150 characters [whitespace/line_length] [4]
Done processing ./qt/mainwindow.cpp
Total errors found: 1
Total errors found: 0
Done processing ./qt/presentationscreen.cpp
Total errors found: 0
Done processing ./qt/icons.cpp
Expand All @@ -176,12 +127,7 @@ Done processing ./qt/posintextframeformat.cpp
Total errors found: 0
Done processing ./qt/commentaryzone.cpp
Total errors found: 0
./qt/sourcezone.cpp:135: Lines should be <= 120 characters long [whitespace/line_length] [2]
Done processing ./qt/sourcezone.cpp
Total errors found: 1
./qt/ui.cpp:51: Redundant blank line at the start of a code block should be deleted. [whitespace/blank_line] [2]
./qt/ui.cpp:73: Lines should be <= 120 characters long [whitespace/line_length] [2]
./qt/ui.cpp:83: Lines should be <= 120 characters long [whitespace/line_length] [2]
./qt/ui.cpp:185: Missing spaces around == [whitespace/operators] [3]
Total errors found: 0
Done processing ./qt/ui.cpp
Total errors found: 4
Total errors found: 0
2 changes: 1 addition & 1 deletion cppdipylon/dipydoc/arrowtarget.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ inline ArrowTarget::ArrowTarget(const QString& _type,
type(_type), final_position(_final_position) {
}

#endif // CPPDIPYLON_DIPYDOC_ARROWTARGET_H
#endif // CPPDIPYLON_DIPYDOC_ARROWTARGET_H_
21 changes: 11 additions & 10 deletions cppdipylon/dipydoc/dipydoc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*******************************************************************************/

#include "dipydoc/dipydoc.h"
#include <map>

const int DipyDoc::min_dipydocformat_version = fixedparameters::min_dipydocformat_version;
const int DipyDoc::max_dipydocformat_version = fixedparameters::min_dipydocformat_version;
Expand Down Expand Up @@ -96,7 +97,7 @@ DipyDoc::~DipyDoc(void) {
syntagmas/_syntagmas being filled with pointers, we have to clean up their
content manually.
*/
while(!this->notes._syntagmas.empty()) {
while (!this->notes._syntagmas.empty()) {
this->notes._syntagmas.front().reset();
this->notes._syntagmas.pop_front();
}
Expand Down Expand Up @@ -1229,7 +1230,6 @@ bool DipyDoc::read_mainfile__doctype_text(void) {
if (tokenname == "notes") {
ok &= this->read_mainfile__doctype_text__syntagma(nullptr);
}

} // ... while (this->xmlreader->readNextStartElement())

// DEBUG1 DebugMsg() << "(DipyDoc::read_mainfile__doctype_text) : exit point" << ok;
Expand Down Expand Up @@ -1272,7 +1272,7 @@ bool DipyDoc::read_mainfile__doctype_text__syntagma(Syntagma * father) {
QString(""));
int level = this->notes.syntagmas_levels.at(tag_name);

this->notes._syntagmas.push_back( std::shared_ptr<Syntagma>(new_syntagma) );
this->notes._syntagmas.push_back(std::shared_ptr<Syntagma>(new_syntagma));
if (this->notes.syntagmas.find(level) == this->notes.syntagmas.end()) {
this->notes.syntagmas[level] = std::map<PosInTextRanges, Syntagma*>();
}
Expand All @@ -1291,7 +1291,7 @@ bool DipyDoc::read_mainfile__doctype_text__syntagma(Syntagma * father) {

} else {
if (tag_name == "note") {
if(current_father == nullptr) {
if (current_father == nullptr) {
// error : pending 'textnote' tag.
ok &= !this->error(QString("[DipyDoc::read_mainfile__doctype_text__syntagma]"
"pending 'textnote' tag."),
Expand All @@ -1304,7 +1304,7 @@ bool DipyDoc::read_mainfile__doctype_text__syntagma(Syntagma * father) {
}
} else {
if (tag_name == "arrow") {
if(current_father == nullptr) {
if (current_father == nullptr) {
// error : pending 'arrow' tag.
ok &= !this->error(QString("[DipyDoc::read_mainfile__doctype_text__syntagma]"
" pending 'arrow' tag."),
Expand All @@ -1313,7 +1313,7 @@ bool DipyDoc::read_mainfile__doctype_text__syntagma(Syntagma * father) {
// let's add the arrow to its father :
QString arrow_type(this->xmlreader->attributes().value("type").toString());
PosInTextRanges arrow_final_position(this->xmlreader->attributes().value("dest").toString());
current_father->arrows.push_back( ArrowTarget(arrow_type, arrow_final_position) );
current_father->arrows.push_back(ArrowTarget(arrow_type, arrow_final_position));

this->xmlreader->skipCurrentElement();
}
Expand Down Expand Up @@ -1376,8 +1376,8 @@ bool DipyDoc::read_mainfile__doctype_text__init_and_check(void) {
// for each syntagma, the following loop searches its highest father :
for (auto & syntagma : this->notes._syntagmas) {
Syntagma* current_forefather = syntagma->father;
while(current_forefather != nullptr) {
if (current_forefather->father==nullptr) {
while (current_forefather != nullptr) {
if (current_forefather->father == nullptr) {
break;
} else {
current_forefather = current_forefather->father;
Expand All @@ -1391,7 +1391,7 @@ bool DipyDoc::read_mainfile__doctype_text__init_and_check(void) {
............................................................................*/
for (auto & syntagma : this->notes._syntagmas) {
Syntagma* current_forefather = syntagma->father;
while(current_forefather != nullptr) {
while (current_forefather != nullptr) {
syntagma->ancestors.push_back(current_forefather);
current_forefather = current_forefather->father;
}
Expand Down Expand Up @@ -1499,7 +1499,8 @@ bool DipyDoc::read_mainfile__doctype_text__init_and_check(void) {
(2.8) are the notes' types defines ?
............................................................................*/
for (auto & syntagma : this->notes._syntagmas) {
if (syntagma->type.size() > 0 && this->notes.syntagmas_types.find(syntagma->type) == this->notes.syntagmas_types.end()) {
if (syntagma->type.size() > 0 &&
this->notes.syntagmas_types.find(syntagma->type) == this->notes.syntagmas_types.end()) {
QString msg = "unknown syntagmas' type '%1' defined in name='%2'.";
ok &= !this->error(msg.arg(syntagma->type,
syntagma->name));
Expand Down
3 changes: 2 additions & 1 deletion cppdipylon/dipydoc/menunames.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ inline QString MenuNames::read_menu_name_from_a_file_within_a_directory(const QS
res = res.trimmed();
}

// DEBUG1 DebugMsg() << "MenuNames::read_menu_name_from_a_file_within_a_directory() path = " << path << "; res = " << res;
// DEBUG1 DebugMsg() << "MenuNames::read_menu_name_from_a_file_within_a_directory() path = "
// DEBUG1 << path << "; res = " << res;
return res;
}

Expand Down
2 changes: 1 addition & 1 deletion cppdipylon/dipydoc/notes.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ struct Notes {
QString repr(void) const;
};

#endif
#endif // CPPDIPYLON_DIPYDOC_NOTES_H_
2 changes: 1 addition & 1 deletion cppdipylon/dipydoc/syntagmas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ QString Syntagma::repr(void) {
this->textnote,
QString().setNum(this->arrows.size()));
} else {
if (this->highest_ancestor==nullptr) {
if (this->highest_ancestor == nullptr) {
return QString("(no forefather)(father's name=%4)"
"name=%1; type=%2; textnote=%3 arrows'num.=%5").arg(this->name,
this->type,
Expand Down
2 changes: 1 addition & 1 deletion cppdipylon/dipydoc/syntagmas.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ struct Syntagma {
QString pretty_debugmsg(int hlevel);
};

#endif // CPPDIPYLON_DIPYDOC_SYNTAGMAS_H
#endif // CPPDIPYLON_DIPYDOC_SYNTAGMAS_H_
1 change: 0 additions & 1 deletion cppdipylon/languages/languages.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
______________________________________________________________________________*/
namespace languages {
const std::map<QString, QString> known_languages = {

// ISO 639-3 names :
{ QString("ang"), QString(QObject::tr("Old English")) },
{ QString("bod"), QString(QObject::tr("Tibetan")) },
Expand Down
2 changes: 1 addition & 1 deletion cppdipylon/pos/posintext/posintextranges.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ PosInTextRanges
#include <utility>
#include <vector>

#include "debugmsg/debugmsg.h" // $$$
#include "debugmsg/debugmsg.h" // $$$
#include "pos/posintext/posintext.h"
#include "misc/hash.h"

Expand Down
2 changes: 1 addition & 1 deletion cppdipylon/qt/commentaryeditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ friend class MainWindow;
void set_the_appearance(void);
void set_the_text_formats(void);

public slots:
public slots: // NOLINT(whitespace/indent)
void update_content__translation_expected(const PosInTextRanges&);
void update_aspect_from_dipydoc_aspect_informations(void);
void update_content__commentary_expected(const QString & textnote);
Expand Down
3 changes: 2 additions & 1 deletion cppdipylon/qt/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ void MainWindow::closing(void) {

// DEBUG1 DebugMsg() << "(MainWindow::closing) about to delete all dipydocs still opened";
for (int splitter_index =0; splitter_index < this->sctabs->count(); ++splitter_index) {
// DEBUG1 DebugMsg() << "(MainWindow::closing) about to delete " << qobject_cast<SCSplitter*>(this->sctabs->widget(splitter_index))->dipydoc->menu_name;
// DEBUG1 DebugMsg() << "(MainWindow::closing) about to delete "
// DEBUG1 << qobject_cast<SCSplitter*>(this->sctabs->widget(splitter_index))->dipydoc->menu_name;
delete qobject_cast<SCSplitter*>(this->sctabs->widget(splitter_index))->dipydoc;
}

Expand Down

0 comments on commit b9d7274

Please sign in to comment.