projects
/
backups
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ec0fa7c
)
Cleanup
author
Carl Baldwin
<cnb@ball.(none)>
Wed, 26 Oct 2005 03:03:42 +0000
(21:03 -0600)
committer
Carl Baldwin
<cnb@ball.(none)>
Wed, 26 Oct 2005 03:03:42 +0000
(21:03 -0600)
main.cpp
patch
|
blob
|
history
diff --git
a/main.cpp
b/main.cpp
index a5518501772afaa7d180a0f07c2ff3b077991efe..2323efe3295da8031ab88a111b590f38a8a6787d 100644
(file)
--- a/
main.cpp
+++ b/
main.cpp
@@
-29,20
+29,19
@@
template<class I, class O, class INT>
bool copy_until_full( I begin, I end, O out, INT &space ) {
bool complete = true;
bool copy_until_full( I begin, I end, O out, INT &space ) {
bool complete = true;
- I i = begin;
- while( 0 != space && i != end ) {
- INT size = (*i)->getFileSize();
+ while( 0 != space && begin != end ) {
+ INT size = (*begin)->getFileSize();
INT blocksize = blocks( size ) * bytes_in_block;
if( blocksize <= space ) {
space -= blocksize;
INT blocksize = blocks( size ) * bytes_in_block;
if( blocksize <= space ) {
space -= blocksize;
- out = *
i
;
+ out = *
begin
;
++out;
} else {
// We missed a file that should be included so the backup is not complete
complete = false;
}
++out;
} else {
// We missed a file that should be included so the backup is not complete
complete = false;
}
- ++
i
;
+ ++
begin
;
}
return complete;
}
}
return complete;
}
@@
-104,7
+103,7
@@
void sizes( ITER begin, const ITER &end, INT &numblocks, INT &numbytes ) {
numbytes += filesize;
numblocks += blocks( filesize );
numbytes += filesize;
numblocks += blocks( filesize );
-
begin++
;
+
++begin
;
}
}
}
}