]> git.proxmox.com Git - wasi-libc.git/commitdiff
Format changes to musl code to fit musl's style.
authorDan Gohman <sunfish@mozilla.com>
Mon, 15 Apr 2019 17:51:44 +0000 (10:51 -0700)
committerDan Gohman <sunfish@mozilla.com>
Mon, 22 Apr 2019 18:41:22 +0000 (11:41 -0700)
The whitespace diffs are converting from spaces to tabs.

libc-top-half/musl/src/conf/sysconf.c
libc-top-half/musl/src/internal/libm.h
libc-top-half/musl/src/locale/newlocale.c
libc-top-half/musl/src/misc/uname.c
libc-top-half/musl/src/stdio/fopen.c
libc-top-half/musl/src/stdio/freopen.c
libc-top-half/musl/src/stdio/getc.h
libc-top-half/musl/src/stdio/putc.h
libc-top-half/musl/src/stdio/vfprintf.c
libc-top-half/musl/src/stdio/vfwprintf.c
libc-top-half/musl/src/stdlib/strtod.c

index 5f56ad718445e685c222cfb99d74ea3d1dd20c2b..7e3f2906794d1bd1cfd02b24f7f05ea2fdfe41eb 100644 (file)
@@ -33,7 +33,7 @@ long sysconf(int name)
 #ifdef __wasilibc_unmodified_upstream // WASI has no processes
                [_SC_CHILD_MAX] = RLIM(NPROC),
 #else
-                // Not supported on wasi.
+               // Not supported on wasi.
                [_SC_CHILD_MAX] = -1,
 #endif
                [_SC_CLK_TCK] = 100,
@@ -76,7 +76,7 @@ long sysconf(int name)
 #ifdef __wasilibc_unmodified_upstream // WASI has no realtime signals
                [_SC_RTSIG_MAX] = _NSIG - 1 - 31 - 3,
 #else
-                // Not supported on wasi.
+               // Not supported on wasi.
                [_SC_RTSIG_MAX] = -1,
 #endif
 #ifdef __wasilibc_unmodified_upstream // WASI has no semaphores
@@ -220,7 +220,7 @@ long sysconf(int name)
                        return -1;
                return lim.rlim_cur > LONG_MAX ? LONG_MAX : lim.rlim_cur;
 #else
-                // Not supported on wasi.
+               // Not supported on wasi.
                errno = EINVAL;
                return -1;
 #endif
@@ -253,7 +253,7 @@ long sysconf(int name)
                        for (; set[i]; set[i]&=set[i]-1, cnt++);
                return cnt;
 #else
-                // With no thread support, just say there's 1 processor.
+               // With no thread support, just say there's 1 processor.
                return 1;
 #endif
 #ifdef __wasilibc_unmodified_upstream // WASI has no sysinfo
index b0e404cff17195ee3d186566e12bf5092c89b38f..22e4d9210bf4aff5175a3e6bd100be8e1cde0647 100644 (file)
@@ -85,10 +85,8 @@ union ldshape {
        }                                         \
 } while(0)
 #else
-/*
- * WebAssembly doesn't have floating-point status flags, so there's no reason
- * to force evaluations.
- * */
+/* WebAssembly doesn't have floating-point status flags, so there's no reason
+ * to force evaluations. */
 #define FORCE_EVAL(x) ((void)(x))
 #endif
 
index 823e418710fb117f06b4f73cf42b296ad93c616f..be8fe44f7fc64f3ff41489ea3a4e19c21253d2d2 100644 (file)
@@ -51,13 +51,13 @@ locale_t __newlocale(int mask, const char *name, locale_t loc)
         * variant of the C locale honoring the default locale's encoding. */
        pthread_once(&default_locale_once, default_locale_init);
 #else
-        {
-            static int called;
-            if (called == 0) {
-               default_locale_init();
-                called = 1;
-            }
-        }
+       {
+               static int called;
+               if (called == 0) {
+                       default_locale_init();
+                       called = 1;
+               }
+       }
 #endif
        if (!memcmp(&tmp, &default_locale, sizeof tmp)) return &default_locale;
        if (!memcmp(&tmp, &default_ctype_locale, sizeof tmp))
index 03682e264aea06017957be6407b1293275b40022..b6163c34677434cb5e88854613ca7dae9191fba5 100644 (file)
@@ -10,23 +10,23 @@ int uname(struct utsname *uts)
 #ifdef __wasilibc_unmodified_upstream // Implement uname with placeholders
        return syscall(SYS_uname, uts);
 #else
-        // Just fill in the fields with placeholder values.
+       // Just fill in the fields with placeholder values.
        strcpy(uts->sysname, "wasi");
        strcpy(uts->nodename, "(none)");
        strcpy(uts->release, "0.0.0");
        strcpy(uts->version, "0.0.0");
 #if defined(__wasm32__)
-        strcpy(uts->machine, "wasm32");
+       strcpy(uts->machine, "wasm32");
 #elif defined(__wasm64__)
-        strcpy(uts->machine, "wasm64");
+       strcpy(uts->machine, "wasm64");
 #else
-        strcpy(uts->machine, "unknown");
+       strcpy(uts->machine, "unknown");
 #endif
 #ifdef _GNU_SOURCE
-        strcpy(uts->domainname, "(none)");
+       strcpy(uts->domainname, "(none)");
 #else
-        strcpy(uts->__domainname, "(none)");
+       strcpy(uts->__domainname, "(none)");
 #endif
-        return 0;
+       return 0;
 #endif
 }
index 1befe0308a65a23b8f9048148d2683514a8e7692..07f035d0864af45d6e722d8883c67b97f98fc5ef 100644 (file)
@@ -41,7 +41,7 @@ FILE *fopen(const char *restrict filename, const char *restrict mode)
 #ifdef __wasilibc_unmodified_upstream // WASI has no syscall
        __syscall(SYS_close, fd);
 #else
-        close(fd);
+       close(fd);
 #endif
        return 0;
 }
index f12cd7d181428f201ccd8238653de9da56990046..5331db0d24fcb99cc9ffb115f1054224e279b065 100644 (file)
@@ -50,12 +50,12 @@ FILE *freopen(const char *restrict filename, const char *restrict mode, FILE *re
 #ifdef __wasilibc_unmodified_upstream // WASI has no dup
                else if (__dup3(f2->fd, f->fd, fl&O_CLOEXEC)<0) goto fail2;
 #else
-                // WASI doesn't have dup3, but does have a way to renumber
-                // an existing file descriptor.
+               // WASI doesn't have dup3, but does have a way to renumber
+               // an existing file descriptor.
                else {
-                    if (__wasilibc_fd_renumber(f2->fd, f->fd)<0) goto fail2;
-                    f2->fd = -1; /* avoid closing in fclose */
-                }
+                       if (__wasilibc_fd_renumber(f2->fd, f->fd)<0) goto fail2;
+                       f2->fd = -1; /* avoid closing in fclose */
+               }
 #endif
 
                f->flags = (f->flags & F_PERM) | f2->flags;
index c61dd64230df5fee6a2f70890106622030428874..e62e3f0dab3b55d1524ec3d8dce101b381c34226 100644 (file)
@@ -23,7 +23,7 @@ static inline int do_getc(FILE *f)
                return getc_unlocked(f);
        return locking_getc(f);
 #else
-        // With no threads, locking is unnecessary.
+       // With no threads, locking is unnecessary.
        return getc_unlocked(f);
 #endif
 }
index 6173fd48e1c0ed6e3217bb6efc79e4c4c946acea..2cc63d2dbe3d3e0e80530097b1913d2605a512f0 100644 (file)
@@ -23,7 +23,7 @@ static inline int do_putc(int c, FILE *f)
                return putc_unlocked(c, f);
        return locking_putc(c, f);
 #else
-        // With no threads, locking is unnecessary.
+       // With no threads, locking is unnecessary.
        return putc_unlocked(c, f);
 #endif
 }
index 91d9a69984b2fd028a931a88f26abd2ecfc93a12..7da2e50491ed3e6cd074c44561ee01bb3095006d 100644 (file)
@@ -138,7 +138,7 @@ static void pop_arg(union arg *arg, int type, va_list *ap)
 #if defined(__wasilibc_printscan_no_floating_point)
        break; case DBL:
               case LDBL:
-        floating_point_not_supported();
+       floating_point_not_supported();
 #else
        break; case DBL:        arg->f = va_arg(*ap, double);
 #if defined(__wasilibc_printscan_no_long_double)
index 4c935c3c7ebdbfb1e2dce768fbfdd6c66cd9f821..e418d255ad20ca0669500e6566490b6af7ff4e05 100644 (file)
@@ -320,7 +320,7 @@ static int wprintf_core(FILE *f, const wchar_t *fmt, va_list *ap, union arg *nl_
 
                if (xp && p<0) goto overflow;
 #if defined(__wasilibc_printscan_no_long_double)
-                // Omit the 'L' modifier for floating-point cases.
+               // Omit the 'L' modifier for floating-point cases.
                switch (t|32) {
                case 'a': case 'e': case 'f': case 'g':
                        snprintf(charfmt, sizeof charfmt, "%%%s%s%s%s%s*.*%c",
index 4e2ea8791bf825ea90b1950161e0e892bb7e0159..60158291df629e1709d2e14a9d928df1e391c7e1 100644 (file)
@@ -58,12 +58,12 @@ weak_alias(strtold, __strtold_l);
 // WebAssembly doesn't permit signature-changing aliases, so use wrapper
 // functions instead.
 weak float strtof_l(const char *restrict s, char **restrict p, locale_t loc) {
-    return strtof(s, p);
+       return strtof(s, p);
 }
 weak double strtod_l(const char *restrict s, char **restrict p, locale_t loc) {
-    return strtod(s, p);
+       return strtod(s, p);
 }
 weak long double strtold_l(const char *restrict s, char **restrict p, locale_t loc) {
-    return strtold(s, p);
+       return strtold(s, p);
 }
 #endif