Style cleanup.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34319 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
// gensyscallinfos.cpp
|
/*
|
||||||
//
|
* Copyright 2004-2009, Ingo Weinhold, [email protected].
|
||||||
// Copyright (c) 2004, Ingo Weinhold <[email protected]>
|
* Distributed under the terms of the MIT License.
|
||||||
// All rights reserved. Distributed under the terms of the OpenBeOS License.
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
@@ -14,29 +15,31 @@
|
|||||||
|
|
||||||
#include "gensyscalls_common.h"
|
#include "gensyscalls_common.h"
|
||||||
|
|
||||||
// usage
|
|
||||||
const char* kUsage =
|
const char* kUsage =
|
||||||
"Usage: gensyscallinfos <header> <syscall infos>\n"
|
"Usage: gensyscallinfos <header> <syscall infos>\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Given the (preprocessed) header file that defines the syscall prototypes the\n"
|
"Given the (preprocessed) header file that defines the syscall prototypes "
|
||||||
"command generates a source file consisting of syscall infos, which is needed\n"
|
"the\n"
|
||||||
|
"command generates a source file consisting of syscall infos, which is "
|
||||||
|
"needed\n"
|
||||||
"to build gensyscalls, which in turn generates the assembly syscall\n"
|
"to build gensyscalls, which in turn generates the assembly syscall\n"
|
||||||
"definitions and code for the kernelland syscall dispatcher.\n"
|
"definitions and code for the kernelland syscall dispatcher.\n"
|
||||||
"\n"
|
"\n"
|
||||||
" <header> - Input: The preprocessed header file with the\n"
|
" <header> - Input: The preprocessed header file with the\n"
|
||||||
" syscall prototypes.\n"
|
" syscall prototypes.\n"
|
||||||
" <syscall infos> - Output: The syscall infos source file needed to\n"
|
" <syscall infos> - Output: The syscall infos source file needed "
|
||||||
|
"to\n"
|
||||||
" build gensyscalls.";
|
" build gensyscalls.";
|
||||||
|
|
||||||
// print_usage
|
|
||||||
static
|
static void
|
||||||
void
|
|
||||||
print_usage(bool error)
|
print_usage(bool error)
|
||||||
{
|
{
|
||||||
fprintf((error ? stderr : stdout), kUsage);
|
fprintf((error ? stderr : stdout), kUsage);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Type
|
|
||||||
struct Type {
|
struct Type {
|
||||||
Type(const char* type) : type(type) {}
|
Type(const char* type) : type(type) {}
|
||||||
Type(const string& type) : type(type) {}
|
Type(const string& type) : type(type) {}
|
||||||
@@ -44,7 +47,7 @@ struct Type {
|
|||||||
string type;
|
string type;
|
||||||
};
|
};
|
||||||
|
|
||||||
// NamedType
|
|
||||||
struct NamedType : Type {
|
struct NamedType : Type {
|
||||||
NamedType(const char* type, const char* name)
|
NamedType(const char* type, const char* name)
|
||||||
: Type(type), name(name) {}
|
: Type(type), name(name) {}
|
||||||
@@ -54,7 +57,7 @@ struct NamedType : Type {
|
|||||||
string name;
|
string name;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Function
|
|
||||||
class Function {
|
class Function {
|
||||||
public:
|
public:
|
||||||
Function() : fReturnType("") {}
|
Function() : fReturnType("") {}
|
||||||
@@ -100,7 +103,7 @@ protected:
|
|||||||
Type fReturnType;
|
Type fReturnType;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Syscall
|
|
||||||
class Syscall : public Function {
|
class Syscall : public Function {
|
||||||
public:
|
public:
|
||||||
string GetKernelName() const
|
string GetKernelName() const
|
||||||
@@ -116,7 +119,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Tokenizer
|
|
||||||
class Tokenizer {
|
class Tokenizer {
|
||||||
public:
|
public:
|
||||||
Tokenizer(istream& input)
|
Tokenizer(istream& input)
|
||||||
@@ -271,7 +274,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Main
|
|
||||||
class Main {
|
class Main {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@@ -292,7 +294,6 @@ public:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _ParseSyscalls(const char* filename)
|
void _ParseSyscalls(const char* filename)
|
||||||
{
|
{
|
||||||
@@ -488,7 +489,6 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// main
|
|
||||||
int
|
int
|
||||||
main(int argc, char** argv)
|
main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
@@ -499,4 +499,3 @@ main(int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user