* Cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30722 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2009-05-12 19:15:06 +00:00
parent 3cd0b14d0b
commit 9f3591f267
+19 -13
View File
@@ -104,10 +104,10 @@ const supported_attribute_type kSupportedAttributeTypes[] = {
// AttributeFilter // AttributeFilter
struct AttributeFilter { struct AttributeFilter {
AttributeFilter() AttributeFilter()
: fName(NULL), :
fType(B_ANY_TYPE) fName(NULL),
fType(B_ANY_TYPE)
{ {
} }
@@ -133,10 +133,11 @@ private:
// Parameters // Parameters
struct Parameters { struct Parameters {
Parameters() Parameters()
: copy_data(false), :
recursive(false), copy_data(false),
move_files(false), recursive(false),
verbose(false) move_files(false),
verbose(false)
{ {
} }
@@ -169,6 +170,7 @@ print_usage(bool error)
fprintf((error ? stderr : stdout), kUsage, commandName); fprintf((error ? stderr : stdout), kUsage, commandName);
} }
// print_usage_and_exit // print_usage_and_exit
static void static void
print_usage_and_exit(bool error) print_usage_and_exit(bool error)
@@ -177,6 +179,7 @@ print_usage_and_exit(bool error)
exit(error ? 1 : 0); exit(error ? 1 : 0);
} }
// next_arg // next_arg
static const char * static const char *
next_arg(int &argi, bool optional = false) next_arg(int &argi, bool optional = false)
@@ -190,11 +193,11 @@ next_arg(int &argi, bool optional = false)
return kArgv[argi++]; return kArgv[argi++];
} }
// copy_attributes // copy_attributes
static void static void
copy_attributes(const char *sourcePath, BNode &source, copy_attributes(const char *sourcePath, BNode &source, const char *destPath,
const char *destPath, BNode &destination, BNode &destination, const Parameters &parameters)
const Parameters &parameters)
{ {
char attrName[B_ATTR_NAME_LENGTH]; char attrName[B_ATTR_NAME_LENGTH];
while (source.GetNextAttrName(attrName) == B_OK) { while (source.GetNextAttrName(attrName) == B_OK) {
@@ -249,10 +252,11 @@ copy_attributes(const char *sourcePath, BNode &source,
} }
} }
// copy_file_data // copy_file_data
static void static void
copy_file_data(const char *sourcePath, BFile &source, copy_file_data(const char *sourcePath, BFile &source, const char *destPath,
const char *destPath, BFile &destination, const Parameters &parameters) BFile &destination, const Parameters &parameters)
{ {
char buffer[kCopyBufferSize]; char buffer[kCopyBufferSize];
off_t offset = 0; off_t offset = 0;
@@ -280,6 +284,7 @@ copy_file_data(const char *sourcePath, BFile &source,
} }
} }
// copy_entry // copy_entry
static void static void
copy_entry(const char *sourcePath, const char *destPath, copy_entry(const char *sourcePath, const char *destPath,
@@ -299,7 +304,7 @@ copy_entry(const char *sourcePath, const char *destPath,
// stat destination // stat destination
struct stat destStat; struct stat destStat;
bool destExists = (lstat(destPath, &destStat) == 0); bool destExists = lstat(destPath, &destStat) == 0;
if (!destExists && !parameters.copy_data) { if (!destExists && !parameters.copy_data) {
fprintf(stderr, "Error: Destination file \"%s\" does not exist.\n", fprintf(stderr, "Error: Destination file \"%s\" does not exist.\n",
@@ -611,6 +616,7 @@ copy_files(const char **sourcePaths, int sourceCount,
} }
} }
// main // main
int int
main(int argc, const char *const *argv) main(int argc, const char *const *argv)