From 7200c6f499191933e4b04e1f9c9a269d10fc92c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Fri, 19 Jun 2009 10:17:42 +0000 Subject: [PATCH] * Fixed warnings. * Automatic whitespace cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31114 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/tools/gensyscalls/gensyscalls.cpp | 57 ++++++++++++++------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/src/tools/gensyscalls/gensyscalls.cpp b/src/tools/gensyscalls/gensyscalls.cpp index 2703ee4891..95090f53e6 100644 --- a/src/tools/gensyscalls/gensyscalls.cpp +++ b/src/tools/gensyscalls/gensyscalls.cpp @@ -19,30 +19,33 @@ using std::vector; -// usage -const char *kUsage = -"Usage: gensyscalls [ -c ] [ -d ] [ -n ]\n" -" [ -t ] [ -s ]\n" -"\n" -"The command is able to generate several syscalls related source files.\n" -"\n" -" - Output: The assembly source file implementing the\n" -" actual syscalls.\n" -" - Output: The C source file to be included by the\n" -" syscall dispatcher source file.\n" -" - Output: The C/assembly include files defining the\n" -" syscall numbers.\n" -"
- Output: A C source file containing an array with\n" -" infos about the syscalls\n" -" - Output: A C source file for strace support.\n" -; // print_usage -static -void +static void print_usage(bool error) { - fprintf((error ? stderr : stdout), kUsage); + fprintf(error ? stderr : stdout, + "Usage: gensyscalls [ -c ] [ -d ] [ -n " + "]\n" + " [ -t
] [ -s ]\n" + "\n" + "The command is able to generate several syscalls related source " + "files.\n" + "\n" + " - Output: The assembly source file " + "implementing the\n" + " actual syscalls.\n" + " - Output: The C source file to be included by " + "the\n" + " syscall dispatcher source file.\n" + " - Output: The C/assembly include files " + "defining the\n" + " syscall numbers.\n" + "
- Output: A C source file containing an array " + "with\n" + " infos about the syscalls\n" + " - Output: A C source file for strace " + "support.\n"); } @@ -90,7 +93,7 @@ Syscall::Syscall(const char* name, const char* kernelName) Syscall::~Syscall() { delete fReturnType; - + int count = CountParameters(); for (int i = 0; i < count; i++) delete ParameterAt(i); @@ -278,7 +281,7 @@ public: ofstream file(filename, ofstream::out | ofstream::trunc); if (!file.is_open()) throw IOException(string("Failed to open `") + filename + "'."); - + // output the syscalls definitions for (int i = 0; i < fSyscallCount; i++) { const Syscall* syscall = fSyscallVector->SyscallAt(i); @@ -466,7 +469,7 @@ public: << "(void)handler;" << endl; int chunkSize = (fSyscallCount + 19) / 20; - + // iterate through the syscalls for (int i = 0; i < fSyscallCount; i++) { const Syscall* syscall = fSyscallVector->SyscallAt(i); @@ -535,14 +538,14 @@ public: // pointer type // check, if it is a string constant ("const char *" or // "char const *") - if (_GetTypeCodeTokenize(typeName) == "const" + if ((_GetTypeCodeTokenize(typeName) == "const" && _GetTypeCodeTokenize(typeName) == "char" && _GetTypeCodeTokenize(typeName) == "*" - && _GetTypeCodeTokenize(typeName) == "" - || _GetTypeCodeTokenize(typeName) == "char" + && _GetTypeCodeTokenize(typeName) == "") + || (_GetTypeCodeTokenize(typeName) == "char" && _GetTypeCodeTokenize(typeName) == "const" && _GetTypeCodeTokenize(typeName) == "*" - && _GetTypeCodeTokenize(typeName) == "") { + && _GetTypeCodeTokenize(typeName) == "")) { return "B_STRING_TYPE"; }