From e78c7c2b77b2c65156557c603bc9e30ad42c4954 Mon Sep 17 00:00:00 2001 From: Pavel Cherenkov <pcherenkov@gmail.com> Date: Mon, 30 Jan 2012 13:57:18 +0400 Subject: [PATCH] minor stylistic changes --- core/cpu_feature.m | 19 +++++++++---------- core/tarantool.m | 6 +++--- include/cpu_feature.h | 2 +- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/core/cpu_feature.m b/core/cpu_feature.m index 3dbf7f47bb..092bc3463d 100644 --- a/core/cpu_feature.m +++ b/core/cpu_feature.m @@ -101,7 +101,7 @@ crc32c_hw_intel(u_int32_t crc, unsigned char const *buf, size_t len) /* Toggle x86 flag-register bits, as per mask. */ static void -toggle_x86_flags (long mask, long* orig, long* toggled) +toggle_x86_flags(long mask, long* orig, long* toggled) { long forig = 0, fres = 0; @@ -121,7 +121,7 @@ toggle_x86_flags (long mask, long* orig, long* toggled) ); #endif - if (orig) *orig = forig; + if (orig) *orig = forig; if (toggled) *toggled = fres; return; } @@ -129,27 +129,27 @@ toggle_x86_flags (long mask, long* orig, long* toggled) /* Is CPUID instruction available ? */ static int -can_cpuid () +can_cpuid() { long of = -1, tf = -1; /* x86 flag register masks */ enum { cpuf_AC = (1 << 18), /* bit 18 */ - cpuf_ID = (1 << 21) /* bit 21 */ + cpuf_ID = (1 << 21) /* bit 21 */ }; /* Check if AC (alignment) flag could be toggled: if not - it's i386, thus no CPUID. */ - toggle_x86_flags (cpuf_AC, &of, &tf); + toggle_x86_flags(cpuf_AC, &of, &tf); if ((of & cpuf_AC) == (tf & cpuf_AC)) { return 0; } /* Next try toggling CPUID (ID) flag. */ - toggle_x86_flags (cpuf_ID, &of, &tf); + toggle_x86_flags(cpuf_ID, &of, &tf); if ((of & cpuf_ID) == (tf & cpuf_ID)) { return 0; } @@ -189,13 +189,13 @@ cpu_has (unsigned int feature) { long info = 1, reg[4] = {0,0,0,0}; - if (!can_cpuid ()) + if (!can_cpuid()) return -EINVAL; if (feature > LEN_cpu_mask) return -ERANGE; - get_cpuid (info, ®[eAX], ®[eBX], ®[eCX], ®[eDX]); + get_cpuid(info, ®[eAX], ®[eBX], ®[eCX], ®[eDX]); return (reg[cpu_mask[feature].ri] & cpu_mask[feature].bitmask) ? 1 : 0; } @@ -220,7 +220,7 @@ u_int32_t crc32c_hw(u_int32_t crc, const unsigned char *buf, unsigned int len) { (void)crc; (void)buf, (void)len; - assert (false); + assert(false); return 0; } @@ -228,6 +228,5 @@ crc32c_hw(u_int32_t crc, const unsigned char *buf, unsigned int len) #endif /* defined (__i386__) || defined (__x86_64__) */ - /* __EOF__ */ diff --git a/core/tarantool.m b/core/tarantool.m index 2aee4e539c..8c079a07b1 100644 --- a/core/tarantool.m +++ b/core/tarantool.m @@ -394,9 +394,9 @@ initialize_minimal() } inline static void -mach_init () +mach_init() { - mach_setup_crc32 (); + mach_setup_crc32(); } int @@ -419,7 +419,7 @@ main(int argc, char **argv) master_pid = getpid(); stat_init(); palloc_init(); - mach_init (); + mach_init(); #ifdef HAVE_BFD symbols_load(argv[0]); diff --git a/include/cpu_feature.h b/include/cpu_feature.h index e3b74f70db..34cef8040e 100644 --- a/include/cpu_feature.h +++ b/include/cpu_feature.h @@ -42,7 +42,7 @@ enum { * @return 1 if feature is available, 0 if unavailable, * -EINVAL if unsupported CPU, -ERANGE if invalid feature */ -int cpu_has (unsigned int feature); +int cpu_has(unsigned int feature); /* Hardware-calculate CRC32 for the given data buffer. -- GitLab