[Haiku-commits] r31114 - haiku/trunk/src/tools/gensyscalls
axeld at BerliOS
axeld at mail.berlios.de
Fri Jun 19 12:17:43 CEST 2009
Author: axeld
Date: 2009-06-19 12:17:42 +0200 (Fri, 19 Jun 2009)
New Revision: 31114
ViewCVS: http://svn.berlios.de/viewcvs/haiku?rev=31114&view=rev
Modified:
haiku/trunk/src/tools/gensyscalls/gensyscalls.cpp
Log:
* Fixed warnings.
* Automatic whitespace cleanup.
Modified: haiku/trunk/src/tools/gensyscalls/gensyscalls.cpp
===================================================================
--- haiku/trunk/src/tools/gensyscalls/gensyscalls.cpp 2009-06-19 08:23:11 UTC (rev 31113)
+++ haiku/trunk/src/tools/gensyscalls/gensyscalls.cpp 2009-06-19 10:17:42 UTC (rev 31114)
@@ -19,30 +19,33 @@
using std::vector;
-// usage
-const char *kUsage =
-"Usage: gensyscalls [ -c <calls> ] [ -d <dispatcher> ] [ -n <numbers> ]\n"
-" [ -t <table> ] [ -s <strace> ]\n"
-"\n"
-"The command is able to generate several syscalls related source files.\n"
-"\n"
-" <calls> - Output: The assembly source file implementing the\n"
-" actual syscalls.\n"
-" <dispatcher> - Output: The C source file to be included by the\n"
-" syscall dispatcher source file.\n"
-" <numbers> - Output: The C/assembly include files defining the\n"
-" syscall numbers.\n"
-" <table> - Output: A C source file containing an array with\n"
-" infos about the syscalls\n"
-" <strace> - 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 <calls> ] [ -d <dispatcher> ] [ -n <numbers> "
+ "]\n"
+ " [ -t <table> ] [ -s <strace> ]\n"
+ "\n"
+ "The command is able to generate several syscalls related source "
+ "files.\n"
+ "\n"
+ " <calls> - Output: The assembly source file "
+ "implementing the\n"
+ " actual syscalls.\n"
+ " <dispatcher> - Output: The C source file to be included by "
+ "the\n"
+ " syscall dispatcher source file.\n"
+ " <numbers> - Output: The C/assembly include files "
+ "defining the\n"
+ " syscall numbers.\n"
+ " <table> - Output: A C source file containing an array "
+ "with\n"
+ " infos about the syscalls\n"
+ " <strace> - Output: A C source file for strace "
+ "support.\n");
}
@@ -90,7 +93,7 @@
Syscall::~Syscall()
{
delete fReturnType;
-
+
int count = CountParameters();
for (int i = 0; i < count; i++)
delete ParameterAt(i);
@@ -278,7 +281,7 @@
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 @@
<< "(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 @@
// 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";
}
More information about the Haiku-commits
mailing list