diff --git a/headers/posix/assert.h b/headers/posix/assert.h index b47812abdc..6190133e00 100644 --- a/headers/posix/assert.h +++ b/headers/posix/assert.h @@ -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_ */ diff --git a/headers/posix/ctype.h b/headers/posix/ctype.h index 4bbc7a4117..1263f59df7 100644 --- a/headers/posix/ctype.h +++ b/headers/posix/ctype.h @@ -74,4 +74,4 @@ extern const int *__ctype_toupper; } #endif -#endif // _CTYPE_H +#endif /* _CTYPE_H */ diff --git a/headers/posix/fcntl.h b/headers/posix/fcntl.h index c124099a12..b5aeabbb59 100644 --- a/headers/posix/fcntl.h +++ b/headers/posix/fcntl.h @@ -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 */ diff --git a/headers/posix/inttypes.h b/headers/posix/inttypes.h index 05809495e4..a488f0d180 100644 --- a/headers/posix/inttypes.h +++ b/headers/posix/inttypes.h @@ -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 } diff --git a/headers/posix/libio.h b/headers/posix/libio.h index e24f8f862f..83caf1d45e 100644 --- a/headers/posix/libio.h +++ b/headers/posix/libio.h @@ -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 *)]; diff --git a/headers/posix/limits.h b/headers/posix/limits.h index 47fa9af3b0..4816906170 100644 --- a/headers/posix/limits.h +++ b/headers/posix/limits.h @@ -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 /* for DBL_DIG, FLT_DIG, etc */ diff --git a/headers/posix/math.h b/headers/posix/math.h index 4eb65bd227..4d4a25679d 100644 --- a/headers/posix/math.h +++ b/headers/posix/math.h @@ -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 */ diff --git a/headers/posix/net/route.h b/headers/posix/net/route.h index fce5524716..f164359b61 100644 --- a/headers/posix/net/route.h +++ b/headers/posix/net/route.h @@ -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; diff --git a/headers/posix/netinet/in.h b/headers/posix/netinet/in.h index da580fdfb5..13a6325d0b 100644 --- a/headers/posix/netinet/in.h +++ b/headers/posix/netinet/in.h @@ -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 diff --git a/headers/posix/netinet/ip_var.h b/headers/posix/netinet/ip_var.h index b59e9dda35..ff8cc26633 100644 --- a/headers/posix/netinet/ip_var.h +++ b/headers/posix/netinet/ip_var.h @@ -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 *); diff --git a/headers/posix/pthread.h b/headers/posix/pthread.h index 4e34de2952..8893ace9b7 100644 --- a/headers/posix/pthread.h +++ b/headers/posix/pthread.h @@ -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); diff --git a/headers/posix/setjmp.h b/headers/posix/setjmp.h index 2dc43c5b87..cd5877dacf 100644 --- a/headers/posix/setjmp.h +++ b/headers/posix/setjmp.h @@ -7,7 +7,7 @@ #include -// include architecture specific definitions +/* include architecture specific definitions */ #ifdef __INTEL__ #include #elif __POWERPC__ diff --git a/headers/posix/shadow.h b/headers/posix/shadow.h index 0b660d8e53..d57c5ad0e9 100644 --- a/headers/posix/shadow.h +++ b/headers/posix/shadow.h @@ -49,4 +49,4 @@ extern int fgetspent_r(FILE* file, struct spwd* spwd, char* buffer, #endif -#endif // _SHADOW_H_ +#endif /* _SHADOW_H_ */ diff --git a/headers/posix/signal.h b/headers/posix/signal.h index aa04e4a256..d516cd9e2d 100644 --- a/headers/posix/signal.h +++ b/headers/posix/signal.h @@ -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 #elif __POWERPC__ diff --git a/headers/posix/size_t.h b/headers/posix/size_t.h index d76a0b2d01..0662047f6a 100644 --- a/headers/posix/size_t.h +++ b/headers/posix/size_t.h @@ -7,7 +7,7 @@ #include -// 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_ */ diff --git a/headers/posix/stdint.h b/headers/posix/stdint.h index c6a29ec376..693862cf22 100644 --- a/headers/posix/stdint.h +++ b/headers/posix/stdint.h @@ -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 diff --git a/headers/posix/stdio.h b/headers/posix/stdio.h index 9dc66b41f7..02ccc00c81 100644 --- a/headers/posix/stdio.h +++ b/headers/posix/stdio.h @@ -10,8 +10,8 @@ #include -// 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 diff --git a/headers/posix/stdio_post.h b/headers/posix/stdio_post.h index 7418063371..8ce3b2b518 100644 --- a/headers/posix/stdio_post.h +++ b/headers/posix/stdio_post.h @@ -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 } diff --git a/headers/posix/string.h b/headers/posix/string.h index bc1b61f5ac..4800735cb4 100644 --- a/headers/posix/string.h +++ b/headers/posix/string.h @@ -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); diff --git a/headers/posix/sys/mman.h b/headers/posix/sys/mman.h index 40c98c74d4..02ea94d2ba 100644 --- a/headers/posix/sys/mman.h +++ b/headers/posix/sys/mman.h @@ -9,20 +9,20 @@ #include -// 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 */ diff --git a/headers/posix/sys/poll.h b/headers/posix/sys/poll.h index 353c3073d8..c727ab04de 100644 --- a/headers/posix/sys/poll.h +++ b/headers/posix/sys/poll.h @@ -7,7 +7,7 @@ #include - // for compatibility with legacy applications + /* for compatibility with legacy applications */ #endif /* _SYS_POLL_H */ diff --git a/headers/posix/sys/resource.h b/headers/posix/sys/resource.h index 05dbba4770..403e9c25a1 100644 --- a/headers/posix/sys/resource.h +++ b/headers/posix/sys/resource.h @@ -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 } diff --git a/headers/posix/sys/stat.h b/headers/posix/sys/stat.h index fccd7c1baf..a3110e1e06 100644 --- a/headers/posix/sys/stat.h +++ b/headers/posix/sys/stat.h @@ -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); diff --git a/headers/posix/sys/wait.h b/headers/posix/sys/wait.h index 876bf0bddb..e6b75775af 100644 --- a/headers/posix/sys/wait.h +++ b/headers/posix/sys/wait.h @@ -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 } diff --git a/headers/posix/unistd.h b/headers/posix/unistd.h index 31823f74f3..bebe2be9eb 100644 --- a/headers/posix/unistd.h +++ b/headers/posix/unistd.h @@ -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 diff --git a/headers/posix/wchar.h b/headers/posix/wchar.h index 6aa23938f8..8bfe47fe4a 100644 --- a/headers/posix/wchar.h +++ b/headers/posix/wchar.h @@ -10,8 +10,8 @@ #include #include -// 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; diff --git a/headers/posix/wchar_t.h b/headers/posix/wchar_t.h index 9572a62dc1..a0b06afdb1 100644 --- a/headers/posix/wchar_t.h +++ b/headers/posix/wchar_t.h @@ -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