summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-09-18 23:07:26 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-09-18 23:07:26 +0200
commit93f8a2e834eed69aff7ef3be8c2baba14bab0658 (patch)
tree347b5239f26d3b5f526fffcf7afe151e83124a61 /libc/misc
parent21730caa6647f645974e132ca8afec79b4eeab2b (diff)
convert // comments to /**/; remove empty #if/#endif pairs. no code changes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/ctype/ctype.c21
-rw-r--r--libc/misc/dirent/opendir.c8
-rw-r--r--libc/misc/fnmatch/fnmatch.c9
-rw-r--r--libc/misc/ftw/ftw.c3
-rw-r--r--libc/misc/glob/glob-susv3.c6
-rw-r--r--libc/misc/glob/glob.c3
-rw-r--r--libc/misc/internals/__uClibc_main.c6
-rw-r--r--libc/misc/internals/errno.c2
-rw-r--r--libc/misc/internals/tempname.c3
-rw-r--r--libc/misc/locale/locale.c6
-rw-r--r--libc/misc/regex/regcomp.c3
-rw-r--r--libc/misc/regex/regex_old.c23
-rw-r--r--libc/misc/statfs/fstatvfs64.c4
-rw-r--r--libc/misc/statfs/statvfs64.c3
-rw-r--r--libc/misc/ttyent/getttyent.c6
-rw-r--r--libc/misc/utmp/utent.c19
-rw-r--r--libc/misc/wctype/_wctype.c15
-rw-r--r--libc/misc/wordexp/wordexp.c5
18 files changed, 42 insertions, 103 deletions
diff --git a/libc/misc/ctype/ctype.c b/libc/misc/ctype/ctype.c
index 6abb49ac4..e46f66b58 100644
--- a/libc/misc/ctype/ctype.c
+++ b/libc/misc/ctype/ctype.c
@@ -35,13 +35,10 @@
#include <stdint.h>
#include <assert.h>
#include <locale.h>
-#ifdef __UCLIBC_HAS_XLOCALE__
-#elif defined __UCLIBC_HAS_CTYPE_TABLES__
-#endif
#ifdef __UCLIBC_HAS_XLOCALE__
-#include <xlocale.h>
-#endif /* __UCLIBC_HAS_XLOCALE__ */
+# include <xlocale.h>
+#endif
/**********************************************************************/
#ifdef __UCLIBC_HAS_CTYPE_TABLES__
@@ -276,9 +273,6 @@ IS_FUNC_BODY(xdigit);
#ifdef L_tolower
#undef tolower
-#ifdef __UCLIBC_HAS_XLOCALE__
-#elif defined __UCLIBC_HAS_CTYPE_TABLES__
-#endif
#ifdef __UCLIBC_HAS_CTYPE_TABLES__
int tolower(int c)
@@ -312,17 +306,14 @@ int tolower_l(int c, __locale_t l)
return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_tolower[c] : c;
}
libc_hidden_def(tolower_l)
-//remove after 0.9.31. See ctype.h for why.
-//weak_alias (tolower_l, __tolower_l)
+/*remove after 0.9.31. See ctype.h for why.
+ *weak_alias (tolower_l, __tolower_l) */
#endif
/**********************************************************************/
#ifdef L_toupper
#undef toupper
-#ifdef __UCLIBC_HAS_XLOCALE__
-#elif defined __UCLIBC_HAS_CTYPE_TABLES__
-#endif
#ifdef __UCLIBC_HAS_CTYPE_TABLES__
int toupper(int c)
@@ -356,8 +347,8 @@ int toupper_l(int c, __locale_t l)
return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_toupper[c] : c;
}
libc_hidden_def(toupper_l)
-//remove after 0.9.31. See ctype.h for why.
-//weak_alias (toupper_l, __toupper_l)
+/*remove after 0.9.31. See ctype.h for why.
+ *weak_alias (toupper_l, __toupper_l) */
#endif
/**********************************************************************/
diff --git a/libc/misc/dirent/opendir.c b/libc/misc/dirent/opendir.c
index 672ef15a4..e85dd3003 100644
--- a/libc/misc/dirent/opendir.c
+++ b/libc/misc/dirent/opendir.c
@@ -93,11 +93,11 @@ DIR *opendir(const char *name)
* to worry about it right now (if ever). */
if (fstat(fd, &statbuf) < 0) {
- // this close() never fails
- //int saved_errno;
- //saved_errno = errno;
+ /* this close() never fails
+ *int saved_errno;
+ *saved_errno = errno; */
close(fd);
- //__set_errno(saved_errno);
+ /*__set_errno(saved_errno);*/
return NULL;
}
diff --git a/libc/misc/fnmatch/fnmatch.c b/libc/misc/fnmatch/fnmatch.c
index 28f744a26..f069e5cea 100644
--- a/libc/misc/fnmatch/fnmatch.c
+++ b/libc/misc/fnmatch/fnmatch.c
@@ -61,10 +61,7 @@
#endif
#ifdef __UCLIBC__
-#define __memset memset
-#ifdef __UCLIBC_HAS_XLOCALE__
-#elif defined __UCLIBC_HAS_CTYPE_TABLES__
-#endif
+# define __memset memset
#endif
/* For platform which support the ISO C amendement 1 functionality we
@@ -73,10 +70,6 @@
/* Solaris 2.5 has a bug: <wchar.h> must be included before <wctype.h>. */
# include <wchar.h>
# include <wctype.h>
-# ifdef __UCLIBC__
-# ifdef __UCLIBC_HAS_LOCALE__
-# endif
-# endif
#endif
/* We need some of the locale data (the collation sequence information)
diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c
index 74f6e1354..70607fd4e 100644
--- a/libc/misc/ftw/ftw.c
+++ b/libc/misc/ftw/ftw.c
@@ -83,9 +83,6 @@ char *alloca ();
# include <sys/stat.h>
#endif
-#ifdef __UCLIBC_HAS_LFS__
-#endif
-
#if !defined _LIBC && !HAVE_DECL_STPCPY && !defined stpcpy
char *stpcpy ();
#endif
diff --git a/libc/misc/glob/glob-susv3.c b/libc/misc/glob/glob-susv3.c
index b242a45fa..1d64249c7 100644
--- a/libc/misc/glob/glob-susv3.c
+++ b/libc/misc/glob/glob-susv3.c
@@ -209,9 +209,6 @@ int __glob_sort(const void *a, const void *b)
}
#endif /* !__GLOB64 */
-#ifdef __GLOB64
-#else
-#endif
int glob(const char *pat, int flags, int (*errfunc)(const char *path, int err), glob_t *g)
{
const char *p=pat, *d;
@@ -285,9 +282,6 @@ libc_hidden_def(glob64)
libc_hidden_def(glob)
#endif
-#ifdef __GLOB64
-#else
-#endif
void globfree(glob_t *g)
{
size_t i;
diff --git a/libc/misc/glob/glob.c b/libc/misc/glob/glob.c
index 8f27443ff..488f22970 100644
--- a/libc/misc/glob/glob.c
+++ b/libc/misc/glob/glob.c
@@ -469,9 +469,6 @@ static int glob_in_dir (const char *pattern, const char *directory, int flags,
return GLOB_NOSPACE;
}
-#ifdef COMPILE_GLOB64
-#else
-#endif
/* Do glob searching for PATTERN, placing results in PGLOB.
The bits defined above may be set in FLAGS.
If a directory cannot be opened or read and ERRFUNC is not nil,
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 3588768a3..b166aaaa7 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -28,12 +28,6 @@
#include <sys/sysmacros.h>
-#ifdef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__
-#endif
-#ifndef __ARCH_HAS_NO_LDSO__
-
-#endif
-
#ifndef SHARED
void *__libc_stack_end = NULL;
diff --git a/libc/misc/internals/errno.c b/libc/misc/internals/errno.c
index 65728f863..029fdcfde 100644
--- a/libc/misc/internals/errno.c
+++ b/libc/misc/internals/errno.c
@@ -1,7 +1,5 @@
#include "internal_errno.h"
-#ifdef __UCLIBC_HAS_THREADS__
-#endif
int errno = 0;
int h_errno = 0;
diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c
index e0bf922c4..cbd4ced7a 100644
--- a/libc/misc/internals/tempname.c
+++ b/libc/misc/internals/tempname.c
@@ -45,9 +45,6 @@
#include <sys/time.h>
#include "tempname.h"
-#ifdef __UCLIBC_HAS_LFS__
-#endif
-
/* Return nonzero if DIR is an existent directory. */
static int direxists (const char *dir)
{
diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c
index a9fd952f9..52055a2d2 100644
--- a/libc/misc/locale/locale.c
+++ b/libc/misc/locale/locale.c
@@ -58,9 +58,6 @@
#include <ctype.h>
#include <stdio.h>
-#ifdef __UCLIBC_HAS_CTYPE_TABLES__
-#endif
-
#ifdef __UCLIBC_MJN3_ONLY__
#ifdef L_setlocale
#warning TODO: Make the link_warning()s a config option?
@@ -351,9 +348,6 @@ libc_hidden_def(localeconv)
/**********************************************************************/
#if defined(L__locale_init) && !defined(__LOCALE_C_ONLY)
-#ifndef __UCLIBC_HAS_XLOCALE__
-#endif
-
struct __uclibc_locale_struct __global_locale_data;
__locale_t __global_locale = &__global_locale_data;
diff --git a/libc/misc/regex/regcomp.c b/libc/misc/regex/regcomp.c
index ada380632..8f2e18ce4 100644
--- a/libc/misc/regex/regcomp.c
+++ b/libc/misc/regex/regcomp.c
@@ -791,9 +791,6 @@ re_compile_internal (regex_t *preg, const char * pattern, size_t length,
/* Initialize DFA. We use the length of the regular expression PAT_LEN
as the initial length of some arrays. */
-#ifdef __UCLIBC_HAS_WCHAR__
-#endif
-
static reg_errcode_t
init_dfa (re_dfa_t *dfa, size_t pat_len)
{
diff --git a/libc/misc/regex/regex_old.c b/libc/misc/regex/regex_old.c
index fc51610c8..3550698d3 100644
--- a/libc/misc/regex/regex_old.c
+++ b/libc/misc/regex/regex_old.c
@@ -6035,17 +6035,18 @@ byte_re_match_2_internal (
{ /* No. So allocate them with malloc. We need one
extra element beyond `num_regs' for the `-1' marker
GNU code uses. */
-// regex specs say:
-// "If REGS_UNALLOCATED, allocate space in the regs structure
-// for max(RE_NREGS, re_nsub + 1) groups"
-// but real-world testsuites fail with contrived examples
-// with lots of groups.
-// I don't see why we can't just allocate exact needed number.
-// Incidentally, it makes RE_NREGS unused.
-//
-// regs->num_regs = MAX (RE_NREGS, num_regs + 1); - VERY WRONG
-// regs->num_regs = MIN (RE_NREGS, num_regs + 1); - slightly less wrong
-// good one which passes uclibc test/regex/tst-regex2.c:
+/* regex specs say:
+ * "If REGS_UNALLOCATED, allocate space in the regs structure
+ * for max(RE_NREGS, re_nsub + 1) groups"
+ * but real-world testsuites fail with contrived examples
+ * with lots of groups.
+ * I don't see why we can't just allocate exact needed number.
+ * Incidentally, it makes RE_NREGS unused.
+ *
+ * regs->num_regs = MAX (RE_NREGS, num_regs + 1); - VERY WRONG
+ * regs->num_regs = MIN (RE_NREGS, num_regs + 1); - slightly less wrong
+ * good one which passes uclibc test/regex/tst-regex2.c:
+ */
regs->num_regs = num_regs + 1;
regs->start = TALLOC (regs->num_regs, regoff_t);
regs->end = TALLOC (regs->num_regs, regoff_t);
diff --git a/libc/misc/statfs/fstatvfs64.c b/libc/misc/statfs/fstatvfs64.c
index efaea03c2..f57e9d9bb 100644
--- a/libc/misc/statfs/fstatvfs64.c
+++ b/libc/misc/statfs/fstatvfs64.c
@@ -29,12 +29,8 @@
#include <sys/statvfs.h>
-
#undef stat
#define stat stat64
-#if !defined __UCLIBC_LINUX_SPECIFIC__
-#else
-#endif
int fstatvfs64 (int fd, struct statvfs64 *buf)
{
diff --git a/libc/misc/statfs/statvfs64.c b/libc/misc/statfs/statvfs64.c
index 8716b1517..9923e66a4 100644
--- a/libc/misc/statfs/statvfs64.c
+++ b/libc/misc/statfs/statvfs64.c
@@ -31,9 +31,6 @@
#undef stat
#define stat stat64
-#if defined __UCLIBC_LINUX_SPECIFIC__
-#else
-#endif
int statvfs64 (const char *file, struct statvfs64 *buf)
{
diff --git a/libc/misc/ttyent/getttyent.c b/libc/misc/ttyent/getttyent.c
index f28385d35..474f7f098 100644
--- a/libc/misc/ttyent/getttyent.c
+++ b/libc/misc/ttyent/getttyent.c
@@ -35,11 +35,7 @@
#include <string.h>
#include <stdlib.h>
#ifdef __UCLIBC_HAS_THREADS__
-#include <pthread.h>
-#endif
-
-#ifdef __UCLIBC_HAS_XLOCALE__
-#elif defined __UCLIBC_HAS_CTYPE_TABLES__
+# include <pthread.h>
#endif
static char zapchar;
diff --git a/libc/misc/utmp/utent.c b/libc/misc/utmp/utent.c
index 7d8a2d3c1..beb00591c 100644
--- a/libc/misc/utmp/utent.c
+++ b/libc/misc/utmp/utent.c
@@ -47,15 +47,16 @@ static void __setutent(void)
if (O_CLOEXEC == 0) {
/* Make sure the file will be closed on exec() */
fcntl(static_fd, F_SETFD, FD_CLOEXEC);
- // thus far, {G,S}ETFD only has this single flag,
- // and setting it never fails.
- //int ret = fcntl(static_fd, F_GETFD, 0);
- //if (ret >= 0) {
- // ret = fcntl(static_fd, F_SETFD, ret | FD_CLOEXEC);
- //}
- //if (ret < 0) {
- // static_fd = -1;
- //}
+ /* thus far, {G,S}ETFD only has this single flag,
+ * and setting it never fails.
+ *int ret = fcntl(static_fd, F_GETFD, 0);
+ *if (ret >= 0) {
+ * ret = fcntl(static_fd, F_SETFD, ret | FD_CLOEXEC);
+ *}
+ *if (ret < 0) {
+ * static_fd = -1;
+ *}
+ */
}
return;
}
diff --git a/libc/misc/wctype/_wctype.c b/libc/misc/wctype/_wctype.c
index 6ab6bab77..6340281c7 100644
--- a/libc/misc/wctype/_wctype.c
+++ b/libc/misc/wctype/_wctype.c
@@ -44,10 +44,6 @@
#ifdef __UCLIBC_HAS_XLOCALE__
#include <xlocale.h>
-#elif defined __UCLIBC_HAS_CTYPE_TABLES__
-#endif /* __UCLIBC_HAS_XLOCALE__ */
-
-#ifdef __UCLIBC_HAS_CTYPE_TABLES__
#endif
/* We know wide char support is enabled. We wouldn't be here otherwise. */
@@ -682,11 +678,12 @@ wint_t towctrans(wint_t wc, wctrans_t desc)
{
if ((unsigned int)(desc - _CTYPE_tolower) <= (_CTYPE_toupper - _CTYPE_tolower)) {
/* Transliteration is either tolower or toupper. */
-// I think it's wrong: _toupper(c) assumes that c is a *lowercase* *letter* -
-// it is defined as ((c) ^ 0x20)!
-// if ((__uwchar_t) wc <= 0x7f) {
-// return (desc == _CTYPE_tolower) ? _tolower(wc) : _toupper(wc);
-// }
+/* I think it's wrong: _toupper(c) assumes that c is a *lowercase* *letter* -
+ * it is defined as ((c) ^ 0x20)!
+ * if ((__uwchar_t) wc <= 0x7f) {
+ * return (desc == _CTYPE_tolower) ? _tolower(wc) : _toupper(wc);
+ * }
+ */
__uwchar_t c = wc | 0x20; /* lowercase if it's a letter */
if (c >= 'a' && c <= 'z') {
if (desc == _CTYPE_toupper)
diff --git a/libc/misc/wordexp/wordexp.c b/libc/misc/wordexp/wordexp.c
index b573b2e14..1737ccc48 100644
--- a/libc/misc/wordexp/wordexp.c
+++ b/libc/misc/wordexp/wordexp.c
@@ -36,15 +36,14 @@
#include <wordexp.h>
#define __WORDEXP_FULL
-//#undef __WORDEXP_FULL
/*
* This is a recursive-descent-style word expansion routine.
*/
/* These variables are defined and initialized in the startup code. */
-//extern int __libc_argc;
-//extern char **__libc_argv;
+/*extern int __libc_argc;*/
+/*extern char **__libc_argv;*/
/* FIXME!!!! */
int attribute_hidden __libc_argc;