STYLE: fix line length

This commit is contained in:
Ken Martin 2006-05-10 15:01:22 -04:00
parent a5ed047d4b
commit 14781101fd
4 changed files with 49 additions and 39 deletions

View File

@ -39,7 +39,9 @@ cmDependsJavaParserHelper::~cmDependsJavaParserHelper()
this->CleanupParser(); this->CleanupParser();
} }
void cmDependsJavaParserHelper::CurrentClass::AddFileNamesForPrinting(std::vector<cmStdString> *files, const char* prefix, const char* sep) void cmDependsJavaParserHelper::CurrentClass
::AddFileNamesForPrinting(std::vector<cmStdString> *files,
const char* prefix, const char* sep)
{ {
cmStdString rname = ""; cmStdString rname = "";
if ( prefix ) if ( prefix )
@ -66,11 +68,8 @@ void cmDependsJavaParserHelper::DeallocateParserType(char** pt)
} }
if (!*pt) if (!*pt)
{ {
//*pt = 0;
return; return;
} }
// std::cout << (void*) *pt << " " << *pt << " this->DeallocateParserType" << std::endl;
//delete [] *pt;
*pt = 0; *pt = 0;
this->UnionsAvailable --; this->UnionsAvailable --;
} }
@ -109,11 +108,11 @@ void cmDependsJavaParserHelper::AddPackagesImport(const char* sclass)
this->PackagesImport.push_back(sclass); this->PackagesImport.push_back(sclass);
} }
void cmDependsJavaParserHelper::SafePrintMissing(const char* str, int line, int cnt) void cmDependsJavaParserHelper::SafePrintMissing(const char* str,
int line, int cnt)
{ {
if ( str ) if ( str )
{ {
//std::cout << (void*) str << " JPSafePrintMissing" << std::endl;
std::cout << line << " String " << cnt << " exists: "; std::cout << line << " String " << cnt << " exists: ";
unsigned int cc; unsigned int cc;
for ( cc = 0; cc < strlen(str); cc ++ ) for ( cc = 0; cc < strlen(str); cc ++ )
@ -140,8 +139,9 @@ void cmDependsJavaParserHelper::Print(const char* place, const char* str)
} }
} }
void cmDependsJavaParserHelper::CombineUnions(char** out, const char* in1, char** in2, void cmDependsJavaParserHelper::CombineUnions(char** out,
const char* sep) const char* in1, char** in2,
const char* sep)
{ {
size_t len = 1; size_t len = 1;
if ( in1 ) if ( in1 )
@ -174,11 +174,11 @@ void cmDependsJavaParserHelper::CombineUnions(char** out, const char* in1, char*
{ {
this->DeallocateParserType(in2); this->DeallocateParserType(in2);
} }
// std::cout << (void*) *out << " " << *out << " JPAllocateParserType" << std::endl;
this->UnionsAvailable ++; this->UnionsAvailable ++;
} }
void cmDependsJavaParserHelper::CheckEmpty(int line, int cnt, cmDependsJavaParserHelper::ParserType* pt) void cmDependsJavaParserHelper
::CheckEmpty(int line, int cnt, cmDependsJavaParserHelper::ParserType* pt)
{ {
int cc; int cc;
int kk = -cnt + 1; int kk = -cnt + 1;
@ -190,14 +190,16 @@ void cmDependsJavaParserHelper::CheckEmpty(int line, int cnt, cmDependsJavaParse
} }
} }
void cmDependsJavaParserHelper::PrepareElement(cmDependsJavaParserHelper::ParserType* me) void cmDependsJavaParserHelper
::PrepareElement(cmDependsJavaParserHelper::ParserType* me)
{ {
// Inititalize self // Inititalize self
me->str = 0; me->str = 0;
} }
void cmDependsJavaParserHelper::AllocateParserType(cmDependsJavaParserHelper::ParserType* pt, void cmDependsJavaParserHelper
const char* str, int len) ::AllocateParserType(cmDependsJavaParserHelper::ParserType* pt,
const char* str, int len)
{ {
pt->str = 0; pt->str = 0;
if ( len == 0 ) if ( len == 0 )
@ -213,7 +215,6 @@ void cmDependsJavaParserHelper::AllocateParserType(cmDependsJavaParserHelper::Pa
strncpy(pt->str, str, len); strncpy(pt->str, str, len);
pt->str[len] = 0; pt->str[len] = 0;
this->Allocates.push_back(pt->str); this->Allocates.push_back(pt->str);
// std::cout << (void*) pt->str << " " << pt->str << " JPAllocateParserType" << std::endl;
} }
void cmDependsJavaParserHelper::StartClass(const char* cls) void cmDependsJavaParserHelper::StartClass(const char* cls)
@ -289,8 +290,6 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
{ {
return 0; return 0;
} }
//printf("Do some parsing: %s\n", str);
this->Verbose = verb; this->Verbose = verb;
this->InputBuffer = str; this->InputBuffer = str;
this->InputBufferPos = 0; this->InputBufferPos = 0;
@ -312,7 +311,8 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
{ {
if ( this->CurrentPackage.size() > 0 ) if ( this->CurrentPackage.size() > 0 )
{ {
std::cout << "Current package is: " << this->CurrentPackage.c_str() << std::endl; std::cout << "Current package is: " <<
this->CurrentPackage.c_str() << std::endl;
} }
std::cout << "Imports packages:"; std::cout << "Imports packages:";
if ( this->PackagesImport.size() > 0 ) if ( this->PackagesImport.size() > 0 )
@ -342,8 +342,8 @@ int cmDependsJavaParserHelper::ParseString(const char* str, int verb)
this->PrintClasses(); this->PrintClasses();
if ( this->UnionsAvailable != 0 ) if ( this->UnionsAvailable != 0 )
{ {
std::cout << "There are still " << this->UnionsAvailable << " unions available" << std::endl; std::cout << "There are still " <<
//return 0; this->UnionsAvailable << " unions available" << std::endl;
} }
} }
this->CleanupParser(); this->CleanupParser();
@ -365,9 +365,6 @@ void cmDependsJavaParserHelper::CleanupParser()
int cmDependsJavaParserHelper::LexInput(char* buf, int maxlen) int cmDependsJavaParserHelper::LexInput(char* buf, int maxlen)
{ {
//std::cout << "JPLexInput ";
//std::cout.write(buf, maxlen);
//std::cout << std::endl;
if ( maxlen < 1 ) if ( maxlen < 1 )
{ {
return 0; return 0;
@ -390,18 +387,21 @@ int cmDependsJavaParserHelper::LexInput(char* buf, int maxlen)
void cmDependsJavaParserHelper::Error(const char* str) void cmDependsJavaParserHelper::Error(const char* str)
{ {
unsigned long pos = static_cast<unsigned long>(this->InputBufferPos); unsigned long pos = static_cast<unsigned long>(this->InputBufferPos);
fprintf(stderr, "JPError: %s (%lu / Line: %d)\n", str, pos, this->CurrentLine); fprintf(stderr, "JPError: %s (%lu / Line: %d)\n",
str, pos, this->CurrentLine);
int cc; int cc;
std::cerr << "String: ["; std::cerr << "String: [";
for ( cc = 0; cc < 30 && *(this->InputBuffer.c_str() + this->InputBufferPos + cc); for ( cc = 0;
cc ++ ) cc < 30 && *(this->InputBuffer.c_str() + this->InputBufferPos + cc);
cc ++ )
{ {
std::cerr << *(this->InputBuffer.c_str() + this->InputBufferPos + cc); std::cerr << *(this->InputBuffer.c_str() + this->InputBufferPos + cc);
} }
std::cerr << "]" << std::endl; std::cerr << "]" << std::endl;
} }
void cmDependsJavaParserHelper::UpdateCombine(const char* str1, const char* str2) void cmDependsJavaParserHelper::UpdateCombine(const char* str1,
const char* str2)
{ {
if ( this->CurrentCombine == "" && str1 != 0) if ( this->CurrentCombine == "" && str1 != 0)
{ {

View File

@ -99,7 +99,8 @@ private:
void PrintClasses(); void PrintClasses();
void Print(const char* place, const char* str); void Print(const char* place, const char* str);
void CombineUnions(char** out, const char* in1, char** in2, const char* sep); void CombineUnions(char** out, const char* in1, char** in2,
const char* sep);
void SafePrintMissing(const char* str, int line, int cnt); void SafePrintMissing(const char* str, int line, int cnt);
void CleanupParser(); void CleanupParser();

View File

@ -170,7 +170,8 @@ bool cmDocumentation::PrintCopyright(std::ostream& os)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmDocumentation::PrintVersion(std::ostream& os) bool cmDocumentation::PrintVersion(std::ostream& os)
{ {
os << this->GetNameString() << " version " << cmVersion::GetCMakeVersion() << "\n"; os << this->GetNameString() << " version "
<< cmVersion::GetCMakeVersion() << "\n";
return true; return true;
} }
@ -200,8 +201,10 @@ bool cmDocumentation::PrintDocumentation(Type ht, std::ostream& os)
switch (ht) switch (ht)
{ {
case cmDocumentation::Usage: return this->PrintDocumentationUsage(os); case cmDocumentation::Usage: return this->PrintDocumentationUsage(os);
case cmDocumentation::Single: return this->PrintDocumentationSingle(os); case cmDocumentation::Single:
case cmDocumentation::SingleModule: return this->PrintDocumentationSingleModule(os); return this->PrintDocumentationSingle(os);
case cmDocumentation::SingleModule:
return this->PrintDocumentationSingleModule(os);
case cmDocumentation::List: return this->PrintDocumentationList(os); case cmDocumentation::List: return this->PrintDocumentationList(os);
case cmDocumentation::ModuleList: return this->PrintModuleList(os); case cmDocumentation::ModuleList: return this->PrintModuleList(os);
case cmDocumentation::Full: return this->PrintDocumentationFull(os); case cmDocumentation::Full: return this->PrintDocumentationFull(os);
@ -242,7 +245,8 @@ bool cmDocumentation::CreateModulesSection()
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmDocumentation::CreateSingleModule(const char* fname, const char* moduleName) bool cmDocumentation::CreateSingleModule(const char* fname,
const char* moduleName)
{ {
std::ifstream fin(fname); std::ifstream fin(fname);
if(!fin) if(!fin)
@ -510,7 +514,8 @@ void cmDocumentation::SetUsageSection(const cmDocumentationEntry* section)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmDocumentation::SetDescriptionSection(const cmDocumentationEntry* section) void cmDocumentation
::SetDescriptionSection(const cmDocumentationEntry* section)
{ {
this->SetSection(0, section, 0, this->DescriptionSection); this->SetSection(0, section, 0, this->DescriptionSection);
} }
@ -530,7 +535,8 @@ void cmDocumentation::SetCommandsSection(const cmDocumentationEntry* section)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmDocumentation::SetGeneratorsSection(const cmDocumentationEntry* section) void cmDocumentation
::SetGeneratorsSection(const cmDocumentationEntry* section)
{ {
this->SetSection(cmDocumentationGeneratorsHeader, section, 0, this->SetSection(cmDocumentationGeneratorsHeader, section, 0,
this->GeneratorsSection); this->GeneratorsSection);
@ -787,7 +793,8 @@ void cmDocumentation::PrintParagraph(std::ostream& os, const char* text)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmDocumentation::PrintPreformattedText(std::ostream& os, const char* text) void cmDocumentation
::PrintPreformattedText(std::ostream& os, const char* text)
{ {
bool newline = true; bool newline = true;
for(const char* ptr = text; *ptr; ++ptr) for(const char* ptr = text; *ptr; ++ptr)
@ -815,7 +822,8 @@ void cmDocumentation::PrintParagraphText(std::ostream& os, const char* text)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmDocumentation::PrintPreformattedHTML(std::ostream& os, const char* text) void cmDocumentation
::PrintPreformattedHTML(std::ostream& os, const char* text)
{ {
os << "<pre>"; os << "<pre>";
this->PrintHTMLEscapes(os, text); this->PrintHTMLEscapes(os, text);
@ -1085,7 +1093,8 @@ bool cmDocumentation::PrintDocumentationMan(std::ostream& os)
this->CreateManDocumentation(); this->CreateManDocumentation();
os << ".TH " << this->GetNameString() << " 1 \"" os << ".TH " << this->GetNameString() << " 1 \""
<< cmSystemTools::GetCurrentDateTime("%B %d, %Y").c_str() << cmSystemTools::GetCurrentDateTime("%B %d, %Y").c_str()
<< "\" \"" << this->GetNameString() << " " << cmVersion::GetCMakeVersion() << "\" \"" << this->GetNameString()
<< " " << cmVersion::GetCMakeVersion()
<< "\"\n"; << "\"\n";
this->Print(ManForm, os); this->Print(ManForm, os);
return true; return true;
@ -1251,7 +1260,6 @@ const char* cmDocumentation::GetNameString()
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmDocumentation::IsOption(const char* arg) bool cmDocumentation::IsOption(const char* arg)
{ {
return ((arg[0] == '-') || return ((arg[0] == '-') || (strcmp(arg, "/V") == 0) ||
(strcmp(arg, "/V") == 0) ||
(strcmp(arg, "/?") == 0)); (strcmp(arg, "/?") == 0));
} }

View File

@ -51,7 +51,8 @@ static const cmDocumentationEntry cmDocumentationDescription[] =
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static const cmDocumentationEntry cmDocumentationOptions[] = static const cmDocumentationEntry cmDocumentationOptions[] =
{ {
{"--all-for-coverage", "Dump all documentation to stdout. For testing.", 0}, {"--all-for-coverage",
"Dump all documentation to stdout. For testing.", 0},
{0,0,0} {0,0,0}
}; };