Patch by Andreas Faerber:

Replaced single-line comments by multi-line comments for ANSI C
compliance.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25433 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold 2008-05-10 21:30:34 +00:00
parent bb90c2a603
commit b932012815
27 changed files with 76 additions and 76 deletions

View File

@ -7,7 +7,7 @@
#undef assert
#ifndef NDEBUG
// defining NDEBUG disables assert() functionality
/* defining NDEBUG disables assert() functionality */
#ifdef __cplusplus
extern "C" {
@ -26,8 +26,8 @@ extern void __assert_perror_fail(int error, const char *file,
#define assert(assertion) \
((assertion) ? (void)0 : __assert_fail(#assertion, __FILE__, __LINE__, __PRETTY_FUNCTION__))
#else // NDEBUG
# define assert(condition) ;
#else /* NDEBUG */
# define assert(condition) ((void)0)
#endif
#endif /* _ASSERT_H_ */

View File

@ -74,4 +74,4 @@ extern const int *__ctype_toupper;
}
#endif
#endif // _CTYPE_H
#endif /* _CTYPE_H */

View File

@ -53,7 +53,7 @@
#define O_RSYNC 0x00020000 /* read synchronized I/O file integrity */
#define O_DSYNC 0x00040000 /* write synchronized I/O data integrity */
// TODO: currently not implemented additions:
/* TODO: currently not implemented additions: */
#define O_NOFOLLOW 0x00080000
/* should we implement this? it's similar to O_NOTRAVERSE but will fail on symlinks */
#define O_NOCACHE 0x00100000 /* doesn't use the file system cache if possible */

View File

@ -204,8 +204,8 @@ extern imaxdiv_t imaxdiv(intmax_t numer, intmax_t denom);
extern intmax_t strtoimax(const char *string, char **_end, int base);
extern uintmax_t strtoumax(const char *string, char **_end, int base);
//extern intmax_t wcstoimax(const __wchar_t *, __wchar_t **, int);
//extern uintmax_t wcstoumax(const __wchar_t *, __wchar_t **, int);
/* extern intmax_t wcstoimax(const __wchar_t *, __wchar_t **, int); */
/* extern uintmax_t wcstoumax(const __wchar_t *, __wchar_t **, int); */
#ifdef __cplusplus
}

View File

@ -138,7 +138,7 @@ typedef struct _IO_FILE {
struct _IO_FILE *_chain;
int _fileno;
// int _blksize;
/* int _blksize; */
int _flags2;
off_t _old_offset; /* This used to be _offset but it's too small. */
/* -> not true on BeOS, but who cares */
@ -151,14 +151,14 @@ typedef struct _IO_FILE {
_IO_lock_t *_lock;
off_t _offset;
//#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
/* #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T */
/* Wide character stream stuff. */
struct _IO_codecvt *_codecvt;
struct _IO_wide_data *_wide_data;
//#else
// void *__pad1;
// void *__pad2;
//#endif
/* #else
* void *__pad1;
* void *__pad2;
* #endif */
int _mode;
/* Make sure we don't get into trouble again. */
char _unused2[15 * sizeof (int) - 2 * sizeof (void *)];

View File

@ -1,6 +1,6 @@
#ifndef _LIBC_LIMITS_H_
#define _LIBC_LIMITS_H_
// Note: The header guard is checked in gcc's limits.h.
/* Note: The header guard is checked in gcc's limits.h. */
#include <float.h> /* for DBL_DIG, FLT_DIG, etc */

View File

@ -34,7 +34,7 @@
#define __huge_valf_t union { unsigned char __c[4]; long __l; float __f; }
#define HUGE_VALF (((__huge_valf_t) { __l: __HUGE_VALF_v }).__f)
// ToDo: define HUGE_VALL for long doubles
/* ToDo: define HUGE_VALL for long doubles */
#define __NAN_VALF_v 0x7fc00000L
#define NAN (((__huge_valf_t) { __l: __NAN_VALF_v }).__f)
@ -146,7 +146,7 @@ extern double trunc(double x);
extern long double roundl(long double x);
extern long lroundl(long double x);
// TODO: add and fix those!
/* TODO: add and fix those! */
extern /*long*/ double lgamma(/*long*/ double x);
/* some BSD non-ANSI or POSIX math functions */

View File

@ -20,8 +20,8 @@
#define RTF_BLACKHOLE 0x00001000
#define RTF_LOCAL 0x00200000
// This structure is used to pass routes to and from the network stack
// (via struct ifreq)
/* This structure is used to pass routes to and from the network stack
* (via struct ifreq) */
struct route_entry {
struct sockaddr *destination;

View File

@ -22,7 +22,7 @@ typedef uint32_t in_addr_t;
* and we are not allowed to import all the BeOS types here.
*/
#ifndef htonl
// extern uint32_t __swap_int32(uint32_t); /* private */
/* extern uint32_t __swap_int32(uint32_t); */ /* private */
extern unsigned long __swap_int32(unsigned long); /* private */
extern uint16_t __swap_int16(uint16_t); /* private */
#if BYTE_ORDER == LITTLE_ENDIAN

View File

@ -138,7 +138,7 @@ struct ipstat {
int32_t ips_outhwcsum; /* hardware checksummed on output */
};
//#ifdef _KERNEL_MODE
/* #ifdef _KERNEL_MODE */
#define IP_FORWARDING 0x1 /* most of ip header exists */
#define IP_ALLOWBROADCAST SO_BROADCAST /* can send broadcast packets */
@ -147,7 +147,7 @@ struct ipstat {
#define IP_MTUDISC 0x10 /* pmtu discovery, set DF */
#if 0
//struct ipstat ipstat;
/* struct ipstat ipstat; */
void ipv4_input(struct mbuf *, int);
int ipv4_output(struct mbuf *, struct mbuf *, struct route *, int, void *);

View File

@ -72,7 +72,7 @@ enum pthread_process_shared {
#define PTHREAD_PRIO_INHERIT 1
#define PTHREAD_PRIO_PROTECT 2
//extern pthread_mutexattr_t pthread_mutexattr_default;
/* extern pthread_mutexattr_t pthread_mutexattr_default; */
/* private structure */
struct __pthread_cleanup_handler {
@ -176,13 +176,13 @@ extern int pthread_attr_setstacksize(pthread_attr_t *attr, size_t stacksize);
#if 0 /* Unimplemented attribute functions: */
// mandatory!
/* mandatory! */
extern int pthread_attr_getschedparam(const pthread_attr_t *attr,
struct sched_param *param);
extern int pthread_attr_setschedparam(pthread_attr_t *attr,
const struct sched_param *param);
// [TPS]
/* [TPS] */
extern int pthread_attr_getinheritsched(const pthread_attr_t *attr,
int *inheritsched);
extern int pthread_attr_setinheritsched(pthread_attr_t *attr, int inheritsched);
@ -194,17 +194,17 @@ extern int pthread_attr_getscope(const pthread_attr_t *attr,
int *contentionscope);
extern int pthread_attr_setscope(pthread_attr_t *attr, int contentionscope);
// [XSI]
/* [XSI] */
extern int pthread_attr_getguardsize(const pthread_attr_t *attr,
size_t *guardsize);
extern int pthread_attr_setguardsize(pthread_attr_t *attr, size_t guardsize);
// [TSA]
/* [TSA] */
extern int pthread_attr_getstackaddr(const pthread_attr_t *attr,
void **stackaddr);
extern int pthread_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr);
// [TSA TSS]
/* [TSA TSS] */
extern int pthread_attr_getstack(const pthread_attr_t *attr,
void **stackaddr, size_t *stacksize);
extern int pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr, size_t stacksize);

View File

@ -7,7 +7,7 @@
#include <signal.h>
// include architecture specific definitions
/* include architecture specific definitions */
#ifdef __INTEL__
#include <arch/x86/arch_setjmp.h>
#elif __POWERPC__

View File

@ -49,4 +49,4 @@ extern int fgetspent_r(FILE* file, struct spwd* spwd, char* buffer,
#endif
#endif // _SHADOW_H_
#endif /* _SHADOW_H_ */

View File

@ -25,9 +25,9 @@ typedef void (*__signal_func_ptr)(int);
#define SIG_ERR ((sighandler_t)-1) /* an error occurred during signal processing */
#define SIG_HOLD ((sighandler_t)3) /* the signal was hold */
// TODO: Support this structure, or more precisely the SA_SIGINFO flag. To do
// this properly we need real-time signal support. Both are commented out for
// the time being to not make "configure" scripts think we do support them.
/* TODO: Support this structure, or more precisely the SA_SIGINFO flag. To do
* this properly we need real-time signal support. Both are commented out for
* the time being to not make "configure" scripts think we do support them. */
#if 0
typedef struct {
int si_signo; /* signal number */
@ -61,7 +61,7 @@ struct sigaction {
#define SA_NODEFER 0x08
#define SA_RESTART 0x10
#define SA_ONSTACK 0x20
//#define SA_SIGINFO 0x40
/* #define SA_SIGINFO 0x40 */
#define SA_NOMASK SA_NODEFER
#define SA_STACK SA_ONSTACK
#define SA_ONESHOT SA_RESETHAND
@ -248,7 +248,7 @@ int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset);
typedef struct vregs vregs;
// include architecture specific definitions
/* include architecture specific definitions */
#ifdef __INTEL__
#include <arch/x86/signal.h>
#elif __POWERPC__

View File

@ -7,7 +7,7 @@
#include <stddef.h>
// TODO: ATM gcc's stddef.h defines ssize_t for BeOS.h. We should fix this.
//typedef long signed int ssize_t;
/* TODO: ATM gcc's stddef.h defines ssize_t for BeOS.h. We should fix this.
* typedef long signed int ssize_t; */
#endif /* _SIZE_T_H_ */

View File

@ -131,7 +131,7 @@ typedef unsigned long long uintmax_t;
#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS)
// Macros of Integer Constant Expressions
/* Macros of Integer Constant Expressions */
#define INT8_C(value) value
#define INT16_C(value) value
#define INT32_C(value) value
@ -142,7 +142,7 @@ typedef unsigned long long uintmax_t;
#define UINT32_C(value) value ## U
#define UINT64_C(value) value ## ULL
// Macros for greatest-width integer constant expressions
/* Macros for greatest-width integer constant expressions */
#define INTMAX_C(value) value ## LL
#define UINTMAX_C(value) value ## ULL

View File

@ -10,8 +10,8 @@
#include <stdarg.h>
// Dodge gcc 2.95.3's fixincludes hack stdio_va_list by including this string:
// __gnuc_va_list
/* Dodge gcc 2.95.3's fixincludes hack stdio_va_list by including this string:
* __gnuc_va_list */
#define BUFSIZ 1024

View File

@ -4,11 +4,11 @@
#ifndef _STDIO_POST_H_
#define _STDIO_POST_H_
// "Private"/inline functions of our BeOS compatible stdio implementation
/* "Private"/inline functions of our BeOS compatible stdio implementation */
// ToDo: this is a work in progress to make our stdio
// BeOS' GNU/libio (almost) binary compatible
// We may not yet be compatible!
/* ToDo: this is a work in progress to make our stdio
* BeOS' GNU/libio (almost) binary compatible
* We may not yet be compatible! */
#ifndef _STDIO_H_
# error "This file must be included from stdio.h!"
@ -19,9 +19,9 @@ extern "C" {
#endif
extern char _single_threaded;
// this boolean value is true (1) if there is only the main thread
// running - as soon as you spawn the first thread, it's set to
// false (0)
/* this boolean value is true (1) if there is only the main thread
* running - as soon as you spawn the first thread, it's set to
* false (0) */
#ifdef __cplusplus
}

View File

@ -37,7 +37,7 @@ extern char *strrchr(const char *string, int character);
extern char *strstr(const char *string, const char *searchString);
extern char *strchrnul(const char *string, int character);
// this is a GNU extension
/* this is a GNU extension */
extern char *strpbrk(const char *string, const char *set);
extern char *strtok(char *string, const char *set);
@ -66,10 +66,10 @@ extern size_t strlcpy(char *dest, const char *source, size_t length);
extern size_t strnlen(const char *string, size_t count);
//extern char *strlwr(char *string);
//extern char *strupr(char *string);
/* extern char *strlwr(char *string); */
/* extern char *strupr(char *string); */
//extern char *strsep(char **stringPointer, const char *delimiter);
/* extern char *strsep(char **stringPointer, const char *delimiter); */
extern const char *strsignal(int signal);

View File

@ -9,20 +9,20 @@
#include <sys/types.h>
// memory protection for mmap() and others
/* memory protection for mmap() and others */
#define PROT_READ 0x01
#define PROT_WRITE 0x02
#define PROT_EXEC 0x04
#define PROT_NONE 0x00
// mmap() flags
/* mmap() flags */
#define MAP_SHARED 0x01 /* changes are seen by others */
#define MAP_PRIVATE 0x02 /* changes are only seen by caller */
#define MAP_FIXED 0x04 /* require mapping to specified addr */
#define MAP_ANONYMOUS 0x08 /* no underlying object */
#define MAP_ANON MAP_ANONYMOUS
// mmap() error return code
/* mmap() error return code */
#define MAP_FAILED ((void*)-1)
@ -38,4 +38,4 @@ int shm_unlink(const char* name);
__END_DECLS
#endif // _SYS_MMAN_H
#endif /* _SYS_MMAN_H */

View File

@ -7,7 +7,7 @@
#include <poll.h>
// for compatibility with legacy applications
/* for compatibility with legacy applications */
#endif /* _SYS_POLL_H */

View File

@ -17,7 +17,7 @@ struct rlimit {
rlim_t rlim_max; /* hard limit */
};
// ToDo: the only supported mode is RLIMIT_NOFILE right now
/* ToDo: the only supported mode is RLIMIT_NOFILE right now */
#define RLIMIT_CORE 0 /* size of the core file */
#define RLIMIT_CPU 1 /* CPU time per team */
#define RLIMIT_DATA 2 /* data segment size */
@ -62,9 +62,9 @@ extern int getrusage(int who, struct rusage *rusage);
extern int getrlimit(int resource, struct rlimit * rlp);
extern int setrlimit(int resource, const struct rlimit * rlp);
// ToDo: The following POSIX calls are missing (in BeOS as well):
//int getpriority(int which, id_t who);
//int setpriority(int which, id_t who, int priority);
/* ToDo: The following POSIX calls are missing (in BeOS as well):
* int getpriority(int which, id_t who);
* int setpriority(int which, id_t who, int priority); */
#ifdef __cplusplus
}

View File

@ -24,10 +24,10 @@ struct stat {
time_t st_ctime; /* last change time, not creation time */
time_t st_crtime; /* creation time */
// Haiku extensions:
// TODO: we might also define special types for files and TTYs
// TODO: we should find another solution for this, as BStatable::GetStat()
// can only retrieve the R5 stat structure
/* Haiku extensions:
* TODO: we might also define special types for files and TTYs
* TODO: we should find another solution for this, as BStatable::GetStat()
* can only retrieve the R5 stat structure */
unsigned int st_type; /* attribute/index type */
};
@ -110,13 +110,13 @@ extern int mkdir(const char *path, mode_t mode);
extern int mkfifo(const char *path, mode_t mode);
extern mode_t umask(mode_t cmask);
// This achieves backwards compatibility with R5
#if 0 //def HAIKU_TARGET_PLATFORM_HAIKU
/* This achieves backwards compatibility with R5 */
#if 0 /* def HAIKU_TARGET_PLATFORM_HAIKU */
#define stat(fd, st) _stat(fd, st, sizeof(struct stat))
#define fstat(fd, st) _fstat(fd, st, sizeof(struct stat))
#define lstat(fd, st) _lstat(fd, st, sizeof(struct stat))
#else
// ... and this fixes the build for R5 for now
/* ... and this fixes the build for R5 for now */
extern int stat(const char *path, struct stat *st);
extern int fstat(int fd, struct stat *st);
extern int lstat(const char *path, struct stat *st);

View File

@ -27,8 +27,8 @@
#define WIFCORED(value) ((value) & 0x10000)
#define WIFCONTINUED(value) ((value) & 0x20000)
// TODO: waitid() is part of the real-time signal extension. Uncomment when
// implemented!
/* TODO: waitid() is part of the real-time signal extension. Uncomment when
* implemented! */
#if 0
/* ID types for waitid() */
typedef enum {
@ -36,7 +36,7 @@ typedef enum {
P_PID, /* wait for the child whose process ID matches */
P_PGID /* wait for any child whose process group ID matches */
} idtype_t;
#endif // 0
#endif /* 0 */
#ifdef __cplusplus
@ -45,7 +45,7 @@ extern "C" {
extern pid_t wait(int *_status);
extern pid_t waitpid(pid_t pid, int *_status, int options);
//extern int waitid(idtype_t idType, id_t id, siginfo_t *info, int options);
/* extern int waitid(idtype_t idType, id_t id, siginfo_t *info, int options); */
#ifdef __cplusplus
}

View File

@ -208,7 +208,7 @@ extern void swab(const void *src, void *dest, ssize_t nbytes);
extern char *optarg;
extern int optind, opterr, optopt;
// ToDo: should be moved to stdlib.h
/* ToDo: should be moved to stdlib.h */
extern char **environ;
#ifdef __cplusplus

View File

@ -10,8 +10,8 @@
#include <stddef.h>
#include <stdio.h>
// stddef.h is not supposed to define wint_t, but gcc 2.95.3's one does.
// In all other cases we will do that.
/* stddef.h is not supposed to define wint_t, but gcc 2.95.3's one does.
* In all other cases we will do that. */
#ifndef _WINT_T
#define _WINT_T
@ -21,7 +21,7 @@
typedef __WINT_TYPE__ wint_t;
#endif // _WINT_T
#endif /* _WINT_T */
typedef int wctype_t;

View File

@ -3,5 +3,5 @@
* Distributed under the terms of the MIT License.
*/
// Include GCC's stddef.h. It defines wchar_t.
/* Include GCC's stddef.h. It defines wchar_t. */
#include <stddef.h>