dlugolecki.net.pl
Dziennik
Polecane
Software
projects
/
vlp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Render README.md in doxygen properly
[vlp.git]
/
src
/
preproc
/
prep.cpp
diff --git
a/src/preproc/prep.cpp
b/src/preproc/prep.cpp
index dda3901c4149ad32f404b8ce82848306d95db08e..020b3321845d595edc32cfa84d78c13b0244c6c9 100644
(file)
--- a/
src/preproc/prep.cpp
+++ b/
src/preproc/prep.cpp
@@
-6,7
+6,6
@@
#include <string.h>
#include <QtCore/QDir>
#include <unistd.h>
#include <string.h>
#include <QtCore/QDir>
#include <unistd.h>
-#include <stdlib.h>
class IncFile
{
class IncFile
{
@@
-31,41
+30,42
@@
IncFile *findTrueLine(int ln, int *trueline)
int c1 = 0;
// int c2 = 0;
int c1 = 0;
// int c2 = 0;
- if (inc.isEmpty()) {
+ QListIterator<IncFile*> incFileIterator(inc);
+ if (!incFileIterator.hasNext()) {
*trueline = ln;
return NULL;
*trueline = ln;
return NULL;
- }
+ }
pl.clear();
pl.clear();
- pom = inc
.firs
t();
+ pom = inc
FileIterator.nex
t();
if (pom->start > ln) {
*trueline = ln;
return NULL;
}
if (pom->start > ln) {
*trueline = ln;
return NULL;
}
- while ((
pom != NULL
) && (ln > pom->start)) {
+ while ((
incFileIterator.hasNext()
) && (ln > pom->start)) {
if (ln < pom->start + pom->len) {
*trueline = ln-pom->start;
return pom;
}
pl.append(pom);
if (ln < pom->start + pom->len) {
*trueline = ln-pom->start;
return pom;
}
pl.append(pom);
- pom=inc
.takeFirs
t();
+ pom=inc
FileIterator.nex
t();
}
}
- if (
pom != NULL
) {
-
pom1 = pl.first(
);
+ if (
incFileIterator.hasNext()
) {
+
QListIterator<IncFile*> plIterator(pl
);
c1=0;
c1=0;
- while (pom1 != NULL) {
+ while (plIterator.hasNext()) {
+ pom1 = plIterator.next();
c1 += pom1->len;
c1 += pom1->len;
- pom1 = pl.takeFirst();
}
*trueline = ln - c1;
return NULL;
} else {
}
*trueline = ln - c1;
return NULL;
} else {
-
pom1 = inc.firs
t();
+
incFileIterator.toFron
t();
c1 = 0;
c1 = 0;
- while (pom1 != NULL) {
+ while (incFileIterator.hasNext()) {
+ pom1 = incFileIterator.next();
c1 += pom1->len;
c1 += pom1->len;
- pom1=inc.takeFirst();
}
*trueline = ln - c1;
return NULL;
}
*trueline = ln - c1;
return NULL;
@@
-83,7
+83,7
@@
int main(int argc,char **argv)
int currentline = 1;
int i, j, line, tline;
int currentline = 1;
int i, j, line, tline;
-
+
inc.clear();
poms.sprintf("%s", argv[1]);
i = poms.findRev('/', poms.length() - 1, FALSE);
inc.clear();
poms.sprintf("%s", argv[1]);
i = poms.findRev('/', poms.length() - 1, FALSE);
@@
-127,7
+127,7
@@
int main(int argc,char **argv)
}
if (!srcfile.open(IO_ReadOnly)) {
}
if (!srcfile.open(IO_ReadOnly)) {
- fprintf(stdout, "Cannot open file
\n"
);
+ fprintf(stdout, "Cannot open file
: %s\n", srcfile.fileName().toStdString().c_str()
);
exit(1);
}
exit(1);
}
@@
-201,7
+201,12
@@
int main(int argc,char **argv)
unlink(poms1.toStdString().c_str());
}
} else {
unlink(poms1.toStdString().c_str());
}
} else {
- fprintf(stdout, "Errors\n");
+ QString errors;
+ errors.sprintf("Errors: %s does not exists, current path: %s\n",
+ poms.toStdString().c_str(),
+ QDir::currentPath().toStdString().c_str()
+ );
+ fprintf(stdout, errors.toStdString().c_str());
poms.sprintf("%s/.cmp00", mydir);
QFile err(poms.toStdString().c_str());
poms.sprintf("%s/.cmp00", mydir);
QFile err(poms.toStdString().c_str());