From 504d40a328c496a738e459fae4339fd78c59426f Mon Sep 17 00:00:00 2001 From: grischka Date: Thu, 1 May 2014 15:33:29 +0200 Subject: [PATCH] Attention: never use hard tabs other than 8 (eight) wide The attached fix (libcrt.c) is just one example. There seem many more such introduced from latest commits that look badly formatted in anyone else's editors and should be fixed. General recommended policy: - if possible, do not add new hard tabs ('\t') at all. Use spaces (soft tabs) instead - in any case, configure your editor to read/write hard tabs with width of 8 (eight) Also: - Avoid merge commits (unless for very good reason). Instead use "git cherry-pick" or "git rebase" to put your commits on top of the public branch. ref: 2a8905c93b4f67a21e3dbf297c3e93c598831528 Also: - jiang: please explain what you are doing, in the commit message and on the list. Subscribe to the mailing list to receive feedback from people for your work. For example, what was wrong with 'parse_number'? Show a test case and how your version fixes it (it is slower btw). --- lib/libcrt.c | 130 +++++++++++++++++++++++++++++------------------------------ 1 file changed, 65 insertions(+), 65 deletions(-) diff --git a/lib/libcrt.c b/lib/libcrt.c index d7d895af..642927ab 100644 --- a/lib/libcrt.c +++ b/lib/libcrt.c @@ -530,77 +530,77 @@ long double __floatundixf(unsigned long long a) unsigned long long __fixunssfdi (float a1) { - register union float_long fl1; - register int exp; - register unsigned long l; - int s; - fl1.f = a1; - - if (fl1.l == 0) - return 0; - - exp = EXP (fl1.l) - EXCESS - 24; - - l = MANT(fl1.l); - s = SIGN(fl1.l)? -1: 1; - if (exp >= 64) - return (unsigned long long)-1; - else if (exp >= 0) - return ((unsigned long long)l << exp)*s; - else if (exp >= -23) - return (l >> -exp)*s; - else - return 0; + register union float_long fl1; + register int exp; + register unsigned long l; + int s; + fl1.f = a1; + + if (fl1.l == 0) + return 0; + + exp = EXP (fl1.l) - EXCESS - 24; + + l = MANT(fl1.l); + s = SIGN(fl1.l)? -1: 1; + if (exp >= 64) + return (unsigned long long)-1; + else if (exp >= 0) + return ((unsigned long long)l << exp)*s; + else if (exp >= -23) + return (l >> -exp)*s; + else + return 0; } unsigned long long __fixunsdfdi (double a1) { - register union double_long dl1; - register int exp; - register unsigned long long l; - int s; - dl1.d = a1; - - if (dl1.ll == 0) - return (0); - - exp = EXPD (dl1) - EXCESSD - 53; - - l = MANTD_LL(dl1); - s = SIGND(dl1)? -1: 1; - if (exp >= 64) - return (unsigned long long)-1; - else if (exp >= 0) - return (l << exp)*s; - else if (exp >= -52) - return (l >> -exp)*s; - else - return 0; + register union double_long dl1; + register int exp; + register unsigned long long l; + int s; + dl1.d = a1; + + if (dl1.ll == 0) + return (0); + + exp = EXPD (dl1) - EXCESSD - 53; + + l = MANTD_LL(dl1); + s = SIGND(dl1)? -1: 1; + if (exp >= 64) + return (unsigned long long)-1; + else if (exp >= 0) + return (l << exp)*s; + else if (exp >= -52) + return (l >> -exp)*s; + else + return 0; } unsigned long long __fixunsxfdi (long double a1) { - register union ldouble_long dl1; - register int exp; - register unsigned long long l; - int s; - dl1.ld = a1; - - if (dl1.l.lower == 0 && dl1.l.upper == 0) - return (0); - - exp = EXPLD (dl1) - EXCESSLD - 64; - s = SIGNLD(dl1)? -1: 1; - l = dl1.l.lower; - - if (exp >= 64) - return (unsigned long long)-1; - else if (exp >= 0) - return ((unsigned long long)l << exp)*s; - else if (exp >= -64) - return (l >> -exp)*s; - else - return 0; + register union ldouble_long dl1; + register int exp; + register unsigned long long l; + int s; + dl1.ld = a1; + + if (dl1.l.lower == 0 && dl1.l.upper == 0) + return (0); + + exp = EXPLD (dl1) - EXCESSLD - 64; + s = SIGNLD(dl1)? -1: 1; + l = dl1.l.lower; + + if (exp >= 64) + return (unsigned long long)-1; + else if (exp >= 0) + return ((unsigned long long)l << exp)*s; + else if (exp >= -64) + return (l >> -exp)*s; + else + return 0; } long long __fixsfdi (float a1) @@ -640,7 +640,7 @@ extern void abort(void); #endif enum __va_arg_type { - __va_gen_reg, __va_float_reg, __va_ld_reg, __va_stack + __va_gen_reg, __va_float_reg, __va_ld_reg, __va_stack }; //This should be in sync with the declaration on our include/stdarg.h @@ -691,7 +691,7 @@ void *__va_arg(__va_list_struct *ap, size = 8; goto use_overflow_area; - case __va_ld_reg: + case __va_ld_reg: ap->overflow_arg_area = (char*)((intptr_t)(ap->overflow_arg_area + align - 1) & -(intptr_t)align); case __va_stack: use_overflow_area: -- 2.11.4.GIT