Rename variables to remove warnings

This commit is contained in:
Andy Cedilnik 2002-10-17 10:51:23 -04:00
parent a465ee3c6b
commit c3007233ec
8 changed files with 259 additions and 259 deletions

View File

@ -34,7 +34,7 @@ inline int ctrl(int z)
} }
cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args, cmCursesMainForm::cmCursesMainForm(std::vector<std::string> const& args,
int initWidth) : int initWidth) :
m_Args(args), m_InitialWidth(initWidth) m_Args(args), m_InitialWidth(initWidth)
{ {
m_NumberOfPages = 0; m_NumberOfPages = 0;
@ -119,7 +119,7 @@ void cmCursesMainForm::InitializeUI()
!i.IsAtEnd(); i.Next()) !i.IsAtEnd(); i.Next())
{ {
if ( i.GetType() != cmCacheManager::INTERNAL && if ( i.GetType() != cmCacheManager::INTERNAL &&
i.GetType() != cmCacheManager::STATIC && i.GetType() != cmCacheManager::STATIC &&
i.GetType() != cmCacheManager::UNINITIALIZED) i.GetType() != cmCacheManager::UNINITIALIZED)
{ {
++count; ++count;
@ -148,19 +148,19 @@ void cmCursesMainForm::InitializeUI()
{ {
const char* key = i.GetName(); const char* key = i.GetName();
if ( i.GetType() == cmCacheManager::INTERNAL || if ( i.GetType() == cmCacheManager::INTERNAL ||
i.GetType() == cmCacheManager::STATIC || i.GetType() == cmCacheManager::STATIC ||
i.GetType() == cmCacheManager::UNINITIALIZED ) i.GetType() == cmCacheManager::UNINITIALIZED )
{ {
continue; continue;
} }
if (!this->LookForCacheEntry(key)) if (!this->LookForCacheEntry(key))
{ {
newEntries->push_back(new cmCursesCacheEntryComposite(key, i, newEntries->push_back(new cmCursesCacheEntryComposite(key, i,
true, 30, true, 30,
entrywidth)); entrywidth));
m_OkToGenerate = false; m_OkToGenerate = false;
} }
} }
// then add entries which are old // then add entries which are old
@ -170,18 +170,18 @@ void cmCursesMainForm::InitializeUI()
{ {
const char* key = i.GetName(); const char* key = i.GetName();
if ( i.GetType() == cmCacheManager::INTERNAL || if ( i.GetType() == cmCacheManager::INTERNAL ||
i.GetType() == cmCacheManager::STATIC || i.GetType() == cmCacheManager::STATIC ||
i.GetType() == cmCacheManager::UNINITIALIZED ) i.GetType() == cmCacheManager::UNINITIALIZED )
{ {
continue; continue;
} }
if (this->LookForCacheEntry(key)) if (this->LookForCacheEntry(key))
{ {
newEntries->push_back(new cmCursesCacheEntryComposite(key, i, newEntries->push_back(new cmCursesCacheEntryComposite(key, i,
false, 30, false, 30,
entrywidth)); entrywidth));
} }
} }
} }
@ -228,9 +228,9 @@ void cmCursesMainForm::RePost()
cmCacheManager::CacheIterator mit = cmCacheManager::CacheIterator mit =
this->m_CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); this->m_CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue());
if (mit.IsAtEnd() || !m_AdvancedMode && mit.GetPropertyAsBool("ADVANCED")) if (mit.IsAtEnd() || !m_AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))
{ {
continue; continue;
} }
m_NumberOfVisibleEntries++; m_NumberOfVisibleEntries++;
} }
} }
@ -270,8 +270,8 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
(field_userptr(currentField)); (field_userptr(currentField));
// If in edit mode, get out of it // If in edit mode, get out of it
if ( cw->GetType() == cmCacheManager::STRING || if ( cw->GetType() == cmCacheManager::STRING ||
cw->GetType() == cmCacheManager::PATH || cw->GetType() == cmCacheManager::PATH ||
cw->GetType() == cmCacheManager::FILEPATH ) cw->GetType() == cmCacheManager::FILEPATH )
{ {
cmCursesStringWidget* sw = static_cast<cmCursesStringWidget*>(cw); cmCursesStringWidget* sw = static_cast<cmCursesStringWidget*>(cw);
sw->SetInEdit(false); sw->SetInEdit(false);
@ -308,8 +308,8 @@ void cmCursesMainForm::Render(int left, int top, int width, int height)
this->m_CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue()); this->m_CMakeInstance->GetCacheManager()->GetCacheIterator((*it)->GetValue());
if (mit.IsAtEnd() || !m_AdvancedMode && mit.GetPropertyAsBool("ADVANCED")) if (mit.IsAtEnd() || !m_AdvancedMode && mit.GetPropertyAsBool("ADVANCED"))
{ {
continue; continue;
} }
m_NumberOfVisibleEntries++; m_NumberOfVisibleEntries++;
} }
} }
@ -439,9 +439,9 @@ void cmCursesMainForm::UpdateStatusBar()
curses_move(0,0); curses_move(0,0);
char fmt[] = "Window is too small. A size of at least %dx%d is required."; char fmt[] = "Window is too small. A size of at least %dx%d is required.";
printw(fmt, printw(fmt,
(cmCursesMainForm::MIN_WIDTH < m_InitialWidth ? (cmCursesMainForm::MIN_WIDTH < m_InitialWidth ?
m_InitialWidth : cmCursesMainForm::MIN_WIDTH), m_InitialWidth : cmCursesMainForm::MIN_WIDTH),
cmCursesMainForm::MIN_HEIGHT); cmCursesMainForm::MIN_HEIGHT);
touchwin(stdscr); touchwin(stdscr);
wrefresh(stdscr); wrefresh(stdscr);
return; return;
@ -449,11 +449,11 @@ void cmCursesMainForm::UpdateStatusBar()
// Get the key of the current entry // Get the key of the current entry
FIELD* cur = current_field(m_Form); FIELD* cur = current_field(m_Form);
int index = field_index(cur); int findex = field_index(cur);
cmCursesWidget* lbl = 0; cmCursesWidget* lbl = 0;
if ( index >= 0 ) if ( findex >= 0 )
{ {
lbl = reinterpret_cast<cmCursesWidget*>(field_userptr(m_Fields[index-2])); lbl = reinterpret_cast<cmCursesWidget*>(field_userptr(m_Fields[findex-2]));
} }
char help[128] = ""; char help[128] = "";
const char* curField = ""; const char* curField = "";
@ -531,7 +531,7 @@ void cmCursesMainForm::UpdateStatusBar()
char version[cmCursesMainForm::MAX_WIDTH]; char version[cmCursesMainForm::MAX_WIDTH];
char vertmp[128]; char vertmp[128];
sprintf(vertmp,"CMake Version %d.%d - %s", cmake::GetMajorVersion(), sprintf(vertmp,"CMake Version %d.%d - %s", cmake::GetMajorVersion(),
cmake::GetMinorVersion(),cmake::GetReleaseVersion()); cmake::GetMinorVersion(),cmake::GetReleaseVersion());
int sideSpace = (width-strlen(vertmp)); int sideSpace = (width-strlen(vertmp));
for(i=0; i<sideSpace; i++) { version[i] = ' '; } for(i=0; i<sideSpace; i++) { version[i] = ' '; }
sprintf(version+sideSpace, "%s", vertmp); sprintf(version+sideSpace, "%s", vertmp);
@ -550,8 +550,8 @@ void cmCursesMainForm::UpdateStatusBar()
int cmCursesMainForm::Configure() int cmCursesMainForm::Configure()
{ {
int x,y; int xi,yi;
getmaxyx(stdscr, y, x); getmaxyx(stdscr, yi, xi);
curses_clear(); curses_clear();
curses_move(1,1); curses_move(1,1);
@ -578,7 +578,7 @@ int cmCursesMainForm::Configure()
noecho(); /* Echo off */ noecho(); /* Echo off */
cbreak(); /* nl- or cr not needed */ cbreak(); /* nl- or cr not needed */
keypad(stdscr,TRUE); /* Use key symbols as keypad(stdscr,TRUE); /* Use key symbols as
KEY_DOWN*/ KEY_DOWN*/
if( retVal != 0 || !m_Errors.empty()) if( retVal != 0 || !m_Errors.empty())
{ {
@ -589,12 +589,12 @@ int cmCursesMainForm::Configure()
} }
// reset error condition // reset error condition
cmSystemTools::ResetErrorOccuredFlag(); cmSystemTools::ResetErrorOccuredFlag();
int x,y; int xx,yy;
getmaxyx(stdscr, y, x); getmaxyx(stdscr, yy, xx);
cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(m_Errors, cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(m_Errors,
"Errors occurred during the last pass."); "Errors occurred during the last pass.");
CurrentForm = msgs; CurrentForm = msgs;
msgs->Render(1,1,x,y); msgs->Render(1,1,xx,yy);
msgs->HandleInput(); msgs->HandleInput();
// If they typed the wrong source directory, we report // If they typed the wrong source directory, we report
// an error and exit // an error and exit
@ -603,19 +603,19 @@ int cmCursesMainForm::Configure()
return retVal; return retVal;
} }
CurrentForm = this; CurrentForm = this;
this->Render(1,1,x,y); this->Render(1,1,xx,yy);
} }
this->InitializeUI(); this->InitializeUI();
this->Render(1, 1, x, y); this->Render(1, 1, xi, yi);
return 0; return 0;
} }
int cmCursesMainForm::Generate() int cmCursesMainForm::Generate()
{ {
int x,y; int xi,yi;
getmaxyx(stdscr, y, x); getmaxyx(stdscr, yi, xi);
curses_clear(); curses_clear();
curses_move(1,1); curses_move(1,1);
@ -634,7 +634,7 @@ int cmCursesMainForm::Generate()
noecho(); /* Echo off */ noecho(); /* Echo off */
cbreak(); /* nl- or cr not needed */ cbreak(); /* nl- or cr not needed */
keypad(stdscr,TRUE); /* Use key symbols as keypad(stdscr,TRUE); /* Use key symbols as
KEY_DOWN*/ KEY_DOWN*/
if( retVal != 0 || !m_Errors.empty()) if( retVal != 0 || !m_Errors.empty())
{ {
@ -645,12 +645,12 @@ int cmCursesMainForm::Generate()
} }
// reset error condition // reset error condition
cmSystemTools::ResetErrorOccuredFlag(); cmSystemTools::ResetErrorOccuredFlag();
int x,y; int xx,yy;
getmaxyx(stdscr, y, x); getmaxyx(stdscr, yy, xx);
cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(m_Errors, cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(m_Errors,
"Errors occurred during the last pass."); "Errors occurred during the last pass.");
CurrentForm = msgs; CurrentForm = msgs;
msgs->Render(1,1,x,y); msgs->Render(1,1,xx,yy);
msgs->HandleInput(); msgs->HandleInput();
// If they typed the wrong source directory, we report // If they typed the wrong source directory, we report
// an error and exit // an error and exit
@ -659,11 +659,11 @@ int cmCursesMainForm::Generate()
return retVal; return retVal;
} }
CurrentForm = this; CurrentForm = this;
this->Render(1,1,x,y); this->Render(1,1,xx,yy);
} }
this->InitializeUI(); this->InitializeUI();
this->Render(1, 1, x, y); this->Render(1, 1, xi, yi);
return 0; return 0;
} }
@ -702,19 +702,19 @@ void cmCursesMainForm::FillCacheManagerFromUI()
{ {
cmCacheManager::CacheIterator it = cmCacheManager::CacheIterator it =
this->m_CMakeInstance->GetCacheManager()->GetCacheIterator( this->m_CMakeInstance->GetCacheManager()->GetCacheIterator(
(*m_Entries)[i]->m_Key.c_str()); (*m_Entries)[i]->m_Key.c_str());
if (!it.IsAtEnd()) if (!it.IsAtEnd())
{ {
tmpString = (*m_Entries)[i]->m_Entry->GetValue(); tmpString = (*m_Entries)[i]->m_Entry->GetValue();
// Remove trailing spaces, convert path to unix slashes // Remove trailing spaces, convert path to unix slashes
std::string tmpSubString = std::string tmpSubString =
tmpString.substr(0,tmpString.find_last_not_of(" ")+1); tmpString.substr(0,tmpString.find_last_not_of(" ")+1);
if ( it.GetType() == cmCacheManager::PATH || if ( it.GetType() == cmCacheManager::PATH ||
it.GetType() == cmCacheManager::FILEPATH ) it.GetType() == cmCacheManager::FILEPATH )
{ {
cmSystemTools::ConvertToUnixSlashes(tmpSubString); cmSystemTools::ConvertToUnixSlashes(tmpSubString);
} }
it.SetValue(tmpSubString.c_str()); it.SetValue(tmpSubString.c_str());
} }
} }
@ -743,17 +743,17 @@ void cmCursesMainForm::HandleInput()
getmaxyx(stdscr, y, x); getmaxyx(stdscr, y, x);
// If window too small, handle 'q' only // If window too small, handle 'q' only
if ( x < cmCursesMainForm::MIN_WIDTH || if ( x < cmCursesMainForm::MIN_WIDTH ||
y < cmCursesMainForm::MIN_HEIGHT ) y < cmCursesMainForm::MIN_HEIGHT )
{ {
// quit // quit
if ( key == 'q' ) if ( key == 'q' )
{ {
break; break;
} }
else else
{ {
continue; continue;
} }
} }
currentField = current_field(m_Form); currentField = current_field(m_Form);
@ -781,207 +781,207 @@ void cmCursesMainForm::HandleInput()
cmCursesForm::LogMessage(debugMessage); cmCursesForm::LogMessage(debugMessage);
// quit // quit
if ( key == 'q' ) if ( key == 'q' )
{ {
break; break;
} }
// if not end of page, next field otherwise next page // if not end of page, next field otherwise next page
// each entry consists of fields: label, isnew, value // each entry consists of fields: label, isnew, value
// therefore, the label field for the prev. entry is index-5 // therefore, the label field for the prev. entry is index-5
// and the label field for the next entry is index+1 // and the label field for the next entry is index+1
// (index always corresponds to the value field) // (index always corresponds to the value field)
else if ( key == KEY_DOWN || key == ctrl('n') ) else if ( key == KEY_DOWN || key == ctrl('n') )
{ {
FIELD* cur = current_field(m_Form); FIELD* cur = current_field(m_Form);
int index = field_index(cur); int findex = field_index(cur);
if ( index == 3*m_NumberOfVisibleEntries-1 ) if ( findex == 3*m_NumberOfVisibleEntries-1 )
{ {
continue; continue;
} }
if (new_page(m_Fields[index+1])) if (new_page(m_Fields[findex+1]))
{ {
form_driver(m_Form, REQ_NEXT_PAGE); form_driver(m_Form, REQ_NEXT_PAGE);
} }
else else
{ {
form_driver(m_Form, REQ_NEXT_FIELD); form_driver(m_Form, REQ_NEXT_FIELD);
} }
} }
// if not beginning of page, previous field, otherwise previous page // if not beginning of page, previous field, otherwise previous page
// each entry consists of fields: label, isnew, value // each entry consists of fields: label, isnew, value
// therefore, the label field for the prev. entry is index-5 // therefore, the label field for the prev. entry is index-5
// and the label field for the next entry is index+1 // and the label field for the next entry is index+1
// (index always corresponds to the value field) // (index always corresponds to the value field)
else if ( key == KEY_UP || key == ctrl('p') ) else if ( key == KEY_UP || key == ctrl('p') )
{ {
FIELD* cur = current_field(m_Form); FIELD* cur = current_field(m_Form);
int index = field_index(cur); int findex = field_index(cur);
if ( index == 2 ) if ( findex == 2 )
{ {
continue; continue;
} }
if ( new_page(m_Fields[index-2]) ) if ( new_page(m_Fields[findex-2]) )
{ {
form_driver(m_Form, REQ_PREV_PAGE); form_driver(m_Form, REQ_PREV_PAGE);
set_current_field(m_Form, m_Fields[index-3]); set_current_field(m_Form, m_Fields[findex-3]);
} }
else else
{ {
form_driver(m_Form, REQ_PREV_FIELD); form_driver(m_Form, REQ_PREV_FIELD);
} }
} }
// pg down // pg down
else if ( key == KEY_NPAGE || key == ctrl('d') ) else if ( key == KEY_NPAGE || key == ctrl('d') )
{ {
form_driver(m_Form, REQ_NEXT_PAGE); form_driver(m_Form, REQ_NEXT_PAGE);
} }
// pg up // pg up
else if ( key == KEY_PPAGE || key == ctrl('u') ) else if ( key == KEY_PPAGE || key == ctrl('u') )
{ {
form_driver(m_Form, REQ_PREV_PAGE); form_driver(m_Form, REQ_PREV_PAGE);
} }
// configure // configure
else if ( key == 'c' ) else if ( key == 'c' )
{ {
this->Configure(); this->Configure();
} }
// display help // display help
else if ( key == 'h' ) else if ( key == 'h' )
{ {
getmaxyx(stdscr, y, x); getmaxyx(stdscr, y, x);
FIELD* cur = current_field(m_Form); FIELD* cur = current_field(m_Form);
int index = field_index(cur); int findex = field_index(cur);
cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>(field_userptr( cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>(field_userptr(
m_Fields[index-2])); m_Fields[findex-2]));
const char* curField = lbl->GetValue(); const char* curField = lbl->GetValue();
const char* helpString=0; const char* helpString=0;
cmCacheManager::CacheIterator it = cmCacheManager::CacheIterator it =
this->m_CMakeInstance->GetCacheManager()->GetCacheIterator(curField); this->m_CMakeInstance->GetCacheManager()->GetCacheIterator(curField);
if (!it.IsAtEnd()) if (!it.IsAtEnd())
{ {
helpString = it.GetProperty("HELPSTRING"); helpString = it.GetProperty("HELPSTRING");
} }
if (helpString) if (helpString)
{ {
char* message = new char[strlen(curField)+strlen(helpString) char* message = new char[strlen(curField)+strlen(helpString)
+strlen("Current option is: \n Help string for this option is: \n")+10]; +strlen("Current option is: \n Help string for this option is: \n")+10];
sprintf(message,"Current option is: %s\nHelp string for this option is: %s\n", curField, helpString); sprintf(message,"Current option is: %s\nHelp string for this option is: %s\n", curField, helpString);
m_HelpMessage[1] = message; m_HelpMessage[1] = message;
delete[] message; delete[] message;
} }
else else
{ {
m_HelpMessage[1] = ""; m_HelpMessage[1] = "";
} }
cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(m_HelpMessage, cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(m_HelpMessage,
"Help."); "Help.");
CurrentForm = msgs; CurrentForm = msgs;
msgs->Render(1,1,x,y); msgs->Render(1,1,x,y);
msgs->HandleInput(); msgs->HandleInput();
CurrentForm = this; CurrentForm = this;
this->Render(1,1,x,y); this->Render(1,1,x,y);
} }
// display last errors // display last errors
else if ( key == 'l' ) else if ( key == 'l' )
{ {
getmaxyx(stdscr, y, x); getmaxyx(stdscr, y, x);
cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(m_Errors, cmCursesLongMessageForm* msgs = new cmCursesLongMessageForm(m_Errors,
"Errors occurred during the last pass."); "Errors occurred during the last pass.");
CurrentForm = msgs; CurrentForm = msgs;
msgs->Render(1,1,x,y); msgs->Render(1,1,x,y);
msgs->HandleInput(); msgs->HandleInput();
CurrentForm = this; CurrentForm = this;
this->Render(1,1,x,y); this->Render(1,1,x,y);
} }
// switch advanced on/off // switch advanced on/off
else if ( key == 't' ) else if ( key == 't' )
{ {
if (m_AdvancedMode) if (m_AdvancedMode)
{ {
m_AdvancedMode = false; m_AdvancedMode = false;
} }
else else
{ {
m_AdvancedMode = true; m_AdvancedMode = true;
} }
getmaxyx(stdscr, y, x); getmaxyx(stdscr, y, x);
this->RePost(); this->RePost();
this->Render(1, 1, x, y); this->Render(1, 1, x, y);
} }
// generate and exit // generate and exit
else if ( key == 'g' ) else if ( key == 'g' )
{ {
if ( m_OkToGenerate ) if ( m_OkToGenerate )
{ {
this->Generate(); this->Generate();
break; break;
} }
} }
// delete cache entry // delete cache entry
else if ( key == 'd' ) else if ( key == 'd' )
{ {
m_OkToGenerate = false; m_OkToGenerate = false;
FIELD* cur = current_field(m_Form); FIELD* cur = current_field(m_Form);
int index = field_index(cur); int findex = field_index(cur);
// make the next or prev. current field after deletion // make the next or prev. current field after deletion
// each entry consists of fields: label, isnew, value // each entry consists of fields: label, isnew, value
// therefore, the label field for the prev. entry is index-5 // therefore, the label field for the prev. entry is findex-5
// and the label field for the next entry is index+1 // and the label field for the next entry is findex+1
// (index always corresponds to the value field) // (findex always corresponds to the value field)
FIELD* nextCur; FIELD* nextCur;
if ( index == 2 ) if ( findex == 2 )
{ {
nextCur=0; nextCur=0;
} }
else if ( index == 3*m_NumberOfVisibleEntries-1 ) else if ( findex == 3*m_NumberOfVisibleEntries-1 )
{ {
nextCur = m_Fields[index-5]; nextCur = m_Fields[findex-5];
} }
else else
{ {
nextCur = m_Fields[index+1]; nextCur = m_Fields[findex+1];
} }
// Get the label widget // Get the label widget
// each entry consists of fields: label, isnew, value // each entry consists of fields: label, isnew, value
// therefore, the label field for the is index-2 // therefore, the label field for the is findex-2
// (index always corresponds to the value field) // (findex always corresponds to the value field)
cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>(field_userptr( cmCursesWidget* lbl = reinterpret_cast<cmCursesWidget*>(field_userptr(
m_Fields[index-2])); m_Fields[findex-2]));
this->m_CMakeInstance->GetCacheManager()->RemoveCacheEntry(lbl->GetValue()); this->m_CMakeInstance->GetCacheManager()->RemoveCacheEntry(lbl->GetValue());
std::string nextVal; std::string nextVal;
if (nextCur) if (nextCur)
{ {
nextVal = (reinterpret_cast<cmCursesWidget*>(field_userptr(nextCur))->GetValue()); nextVal = (reinterpret_cast<cmCursesWidget*>(field_userptr(nextCur))->GetValue());
} }
getmaxyx(stdscr, y, x); getmaxyx(stdscr, y, x);
this->RemoveEntry(lbl->GetValue()); this->RemoveEntry(lbl->GetValue());
this->RePost(); this->RePost();
this->Render(1, 1, x, y); this->Render(1, 1, x, y);
if (nextCur) if (nextCur)
{ {
// make the next or prev. current field after deletion // make the next or prev. current field after deletion
nextCur = 0; nextCur = 0;
std::vector<cmCursesCacheEntryComposite*>::iterator it; std::vector<cmCursesCacheEntryComposite*>::iterator it;
for (it = m_Entries->begin(); it != m_Entries->end(); ++it) for (it = m_Entries->begin(); it != m_Entries->end(); ++it)
{ {
if (nextVal == (*it)->m_Key) if (nextVal == (*it)->m_Key)
{ {
nextCur = (*it)->m_Entry->m_Field; nextCur = (*it)->m_Entry->m_Field;
} }
} }
if (nextCur) if (nextCur)
{ {
set_current_field(m_Form, nextCur); set_current_field(m_Form, nextCur);
} }
} }
} }
} }
touchwin(stdscr); touchwin(stdscr);

View File

@ -289,13 +289,13 @@ bool cmCreateTestSourceList::InitialPass(std::vector<std::string> const& argsIn)
for(i = testsBegin; i != tests.end(); ++i) for(i = testsBegin; i != tests.end(); ++i)
{ {
cmSourceFile cfile; cmSourceFile icfile;
cfile.SetProperty("ABSTRACT","0"); icfile.SetProperty("ABSTRACT","0");
cfile.SetName(i->c_str(), icfile.SetName(i->c_str(),
m_Makefile->GetCurrentDirectory(), m_Makefile->GetCurrentDirectory(),
m_Makefile->GetSourceExtensions(), m_Makefile->GetSourceExtensions(),
m_Makefile->GetHeaderExtensions()); m_Makefile->GetHeaderExtensions());
m_Makefile->AddSource(cfile); m_Makefile->AddSource(icfile);
sourceListValue += ";"; sourceListValue += ";";
sourceListValue += *i; sourceListValue += *i;
} }

View File

@ -50,7 +50,7 @@ cmDirectory
buf = new char[n + 2 + 1]; buf = new char[n + 2 + 1];
sprintf(buf, "%s/*", name); sprintf(buf, "%s/*", name);
} }
struct _finddata_t data; // data of current file struct _finddata_t data; // data of current file
// Now put them into the file array // Now put them into the file array
size_t srchHandle = _findfirst(buf, &data); size_t srchHandle = _findfirst(buf, &data);
@ -109,13 +109,13 @@ cmDirectory
*/ */
const char* const char*
cmDirectory cmDirectory
::GetFile(size_t index) ::GetFile(size_t dindex)
{ {
if ( index >= m_Files.size() ) if ( dindex >= m_Files.size() )
{ {
cmSystemTools::Error("Bad index for GetFile on cmDirectory\n", 0); cmSystemTools::Error("Bad index for GetFile on cmDirectory\n", 0);
return 0; return 0;
} }
return m_Files[index].c_str(); return m_Files[dindex].c_str();
} }

View File

@ -125,11 +125,11 @@ bool cmFindProgramCommand::InitialPass(std::vector<std::string> const& argsIn)
cmSystemTools::GlobDirs(exp.c_str(), path); cmSystemTools::GlobDirs(exp.c_str(), path);
} }
} }
for(std::vector<std::string>::iterator i = names.begin(); for(std::vector<std::string>::iterator it = names.begin();
i != names.end() ; ++i) it != names.end() ; ++it)
{ {
// Try to find the program. // Try to find the program.
std::string result = cmSystemTools::FindProgram(i->c_str(), std::string result = cmSystemTools::FindProgram(it->c_str(),
path, path,
no_system_path); no_system_path);
if(result != "") if(result != "")

View File

@ -71,8 +71,8 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
= mf->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION"); = mf->GetDefinition("CMAKE_MINIMUM_REQUIRED_VERSION");
if (!versionValue || atof(versionValue) <= 1.4) if (!versionValue || atof(versionValue) <= 1.4)
{ {
std::string fpath = root + "/Modules/CMakeBackwardCompatibilityC.cmake"; std::string ifpath = root + "/Modules/CMakeBackwardCompatibilityC.cmake";
mf->ReadListFile(0,fpath.c_str()); mf->ReadListFile(0,ifpath.c_str());
} }
} }
} }

View File

@ -1212,12 +1212,12 @@ OutputSubDirectoryVars(std::ostream& fout,
} }
fout << "# Variable for making " << target << " in subdirectories.\n"; fout << "# Variable for making " << target << " in subdirectories.\n";
fout << var << " = \\\n"; fout << var << " = \\\n";
unsigned int i; unsigned int ii;
for(i =0; i < SubDirectories.size(); i++) for(ii =0; ii < SubDirectories.size(); ii++)
{ {
std::string subdir = FixDirectoryName(SubDirectories[i].c_str()); std::string subdir = FixDirectoryName(SubDirectories[ii].c_str());
fout << target << "_" << subdir.c_str(); fout << target << "_" << subdir.c_str();
if(i == SubDirectories.size()-1) if(ii == SubDirectories.size()-1)
{ {
fout << " \n\n"; fout << " \n\n";
} }
@ -1228,15 +1228,15 @@ OutputSubDirectoryVars(std::ostream& fout,
} }
fout << "# Targets for making " << target << " in subdirectories.\n"; fout << "# Targets for making " << target << " in subdirectories.\n";
std::string last = ""; std::string last = "";
for(unsigned int i =0; i < SubDirectories.size(); i++) for(unsigned int cc =0; cc < SubDirectories.size(); cc++)
{ {
std::string subdir = FixDirectoryName(SubDirectories[i].c_str()); std::string subdir = FixDirectoryName(SubDirectories[cc].c_str());
fout << target << "_" << subdir.c_str() << ": " << depend; fout << target << "_" << subdir.c_str() << ": " << depend;
// Make each subdirectory depend on previous one. This forces // Make each subdirectory depend on previous one. This forces
// parallel builds (make -j 2) to build in same order as a single // parallel builds (make -j 2) to build in same order as a single
// threaded build to avoid dependency problems. // threaded build to avoid dependency problems.
if(i > 0) if(cc > 0)
{ {
fout << " " << target << "_" << last.c_str(); fout << " " << target << "_" << last.c_str();
} }
@ -1245,7 +1245,7 @@ OutputSubDirectoryVars(std::ostream& fout,
last = subdir; last = subdir;
std::string dir = m_Makefile->GetCurrentOutputDirectory(); std::string dir = m_Makefile->GetCurrentOutputDirectory();
dir += "/"; dir += "/";
dir += SubDirectories[i]; dir += SubDirectories[cc];
this->BuildInSubDirectory(fout, dir.c_str(), this->BuildInSubDirectory(fout, dir.c_str(),
target1, target2, silent); target1, target2, silent);
} }
@ -1384,10 +1384,10 @@ void cmLocalUnixMakefileGenerator::OutputCheckDepends(std::ostream& fout)
} }
fout << "\n\n"; fout << "\n\n";
fout << "# if a .h file is removed then run make dependlocal\n\n"; fout << "# if a .h file is removed then run make dependlocal\n\n";
for(std::set<std::string>::iterator i = emitted.begin(); for(std::set<std::string>::iterator it = emitted.begin();
i != emitted.end(); ++i) it != emitted.end(); ++it)
{ {
fout << *i << ":\n" fout << *it << ":\n"
<< "\t$(MAKE) $(MAKESILENT) dependlocal\n\n"; << "\t$(MAKE) $(MAKESILENT) dependlocal\n\n";
} }
} }

View File

@ -846,8 +846,8 @@ bool cmSystemTools::ParseFunction(std::ifstream& fin,
if(lastLine.find(inbuffer)) if(lastLine.find(inbuffer))
{ {
done = true; done = true;
std::string args = lastLine.match(1); std::string gargs = lastLine.match(1);
cmSystemTools::GetArguments(args, arguments); cmSystemTools::GetArguments(gargs, arguments);
} }
else else
{ {

View File

@ -109,8 +109,8 @@ CopyAndFullPathMesaHeader(const char* source,
std::string includeFile = includeLine.match(1); std::string includeFile = includeLine.match(1);
if(glDirLine.find(includeFile.c_str())) if(glDirLine.find(includeFile.c_str()))
{ {
std::string file = glDirLine.match(3); std::string gfile = glDirLine.match(3);
fout << "#include \"" << outdir << "/" << file.c_str() << "\"\n"; fout << "#include \"" << outdir << "/" << gfile.c_str() << "\"\n";
} }
else if(glLine.find(includeFile.c_str())) else if(glLine.find(includeFile.c_str()))
{ {