TC_ASSERT_EQ_CLEANUP("pthread_join", pexit_value, NULL, goto cleanup);
ret_chk = pthread_join(cid, &pexit_value);
- TC_ASSERT_EQ_CLEANUP("pthread_join", ret_chk, OK,goto cleanup);
+ TC_ASSERT_EQ_CLEANUP("pthread_join", ret_chk, OK, goto cleanup);
TC_ASSERT_EQ_CLEANUP("pthread_join", pexit_value, NULL, goto cleanup);
TC_SUCCESS_RESULT();
#define ALLOC_FREE_TIMES 5
#define TEST_TIMES 100
#define ALL_FREE 0
-#define TOTAL_ALLOC_SIZE (MM_ALIGN_UP((sizeof(int)*ALLOC_SIZE_VAL) + SIZEOF_MM_ALLOCNODE))*ALLOC_FREE_TIMES
+#define TOTAL_ALLOC_SIZE (MM_ALIGN_UP((sizeof(int) * ALLOC_SIZE_VAL) + SIZEOF_MM_ALLOCNODE)) * ALLOC_FREE_TIMES
/****************************************************************************
* Definitions
****************************************************************************/
DB_LOG_D("load index : descriptor file name : %s\n", index->descriptor_file);
fd = storage_open(index->descriptor_file, O_RDWR);
if (fd < 0) {
- DB_LOG_E("Failed opening index descriptor file :%s Error Code %d",index->descriptor_file);
+ DB_LOG_E("Failed opening index descriptor file :%s Error Code %d", index->descriptor_file);
free(tree);
return DB_STORAGE_ERROR;
}
* Pre-processor Definitions
***************************************************************************/
-#define FORCE_EVAL(x) \
- do { \
- if (sizeof(x) == sizeof(float)) { \
- volatile float __x; \
- __x = (x); \
- } else if (sizeof(x) == sizeof(double)) { \
- volatile double __x; \
- __x = (x); \
- } else { \
- volatile long double __x; \
- __x = (x); \
- } \
-} while(0)
+#define FORCE_EVAL(x) \
+ do { \
+ if (sizeof(x) == sizeof(float)) { \
+ volatile float __x; \
+ __x = (x); \
+ } else if (sizeof(x) == sizeof(double)) { \
+ volatile double __x; \
+ __x = (x); \
+ } else { \
+ volatile long double __x; \
+ __x = (x); \
+ } \
+} while (0)
/* Get two 32 bit ints from a double. */
-#define EXTRACT_WORDS(hi,lo,d) \
+#define EXTRACT_WORDS(hi, lo, d) \
do { \
- union { \
- double f; \
- uint64_t i; \
- } __u; \
- __u.f = (d); \
+ union { \
+ double f; \
+ uint64_t i; \
+ } __u; \
+ __u.f = (d); \
(hi) = __u.i >> 32; \
(lo) = (uint32_t)__u.i; \
} while (0)
/* Get the more significant 32 bit int from a double. */
-#define GET_HIGH_WORD(hi,d) \
- do { \
- union { \
- double f; \
- uint64_t i; \
- } __u; \
- __u.f = (d); \
+#define GET_HIGH_WORD(hi, d) \
+ do { \
+ union { \
+ double f; \
+ uint64_t i; \
+ } __u; \
+ __u.f = (d); \
(hi) = __u.i >> 32; \
} while (0)
/* Get the less significant 32 bit int from a double. */
-#define GET_LOW_WORD(lo,d) \
- do { \
- union { \
- double f; \
- uint64_t i; \
- } __u; \
- __u.f = (d); \
- (lo) = (uint32_t)__u.i; \
+#define GET_LOW_WORD(lo, d) \
+ do { \
+ union { \
+ double f; \
+ uint64_t i; \
+ } __u; \
+ __u.f = (d); \
+ (lo) = (uint32_t)__u.i; \
} while (0)
/* Set a double from two 32 bit ints. */
-#define INSERT_WORDS(d,hi,lo) \
- do { \
- union { \
- double f; \
- uint64_t i; \
- } __u; \
- __u.i = ((uint64_t)(hi)<<32) | (uint32_t)(lo); \
- (d) = __u.f; \
+#define INSERT_WORDS(d, hi, lo) \
+ do { \
+ union { \
+ double f; \
+ uint64_t i; \
+ } __u; \
+ __u.i = ((uint64_t)(hi) << 32) | (uint32_t)(lo);\
+ (d) = __u.f; \
} while (0)
/* Set the more significant 32 bits of a double from an int. */
-#define SET_HIGH_WORD(d,hi) \
- do { \
- union {double f; uint64_t i;} __u; \
- __u.f = (d); \
- __u.i &= 0xffffffff; \
- __u.i |= (uint64_t)(hi) << 32; \
- (d) = __u.f; \
+#define SET_HIGH_WORD(d, hi) \
+ do { \
+ union { \
+ double f; \
+ uint64_t i; \
+ } __u; \
+ __u.f = (d); \
+ __u.i &= 0xffffffff; \
+ __u.i |= (uint64_t)(hi) << 32; \
+ (d) = __u.f; \
} while (0)
/* Set the less significant 32 bits of a double from an int. */
-#define SET_LOW_WORD(d,lo) \
- do { \
- union {double f; uint64_t i;} __u; \
- __u.f = (d); \
- __u.i &= 0xffffffff00000000ull; \
- __u.i |= (uint32_t)(lo); \
+#define SET_LOW_WORD(d, lo) \
+ do { \
+ union { \
+ double f; \
+ uint64_t i; \
+ } __u; \
+ __u.f = (d); \
+ __u.i &= 0xffffffff00000000ull; \
+ __u.i |= (uint32_t)(lo); \
(d) = __u.f; \
} while (0)
/* Get a 32 bit int from a float. */
-#define GET_FLOAT_WORD(w,d) \
- do { \
- union {float f; uint32_t i;} __u; \
- __u.f = (d); \
- (w) = __u.i; \
+#define GET_FLOAT_WORD(w, d) \
+ do { \
+ union { \
+ float f; \
+ uint32_t i; \
+ } __u; \
+ __u.f = (d); \
+ (w) = __u.i; \
} while (0)
/* Set a float from a 32 bit int. */
-#define SET_FLOAT_WORD(d,w) \
- do { \
- union {float f; uint32_t i;} __u; \
- __u.i = (w); \
- (d) = __u.f; \
+#define SET_FLOAT_WORD(d, w) \
+ do { \
+ union { \
+ float f; \
+ uint32_t i; \
+ } __u; \
+ __u.i = (w); \
+ (d) = __u.f; \
} while (0)
#undef __CMPLX
#undef CMPLXF
#undef CMPLXL
-#define __CMPLX(x, y, t) \
- ((union { \
- _Complex t __z; \
- t __xy[2]; \
- }){.__xy = {(x),(y)}}.__z)
+#define __CMPLX(x, y, t) \
+ ((union { \
+ _Complex t __z; \
+ t __xy[2]; \
+ }){.__xy = {(x), (y)}}.__z)
-#define CMPLX(x, y) __CMPLX(x, y, double)
+#define CMPLX(x, y) __CMPLX(x, y, double)
#define CMPLXF(x, y) __CMPLX(x, y, float)
#define CMPLXL(x, y) __CMPLX(x, y, long double)
/****************************************************************************
* Public Types
****************************************************************************/
-struct bchlib_s
-{
+struct bchlib_s {
FAR struct inode *inode; /* I-node of the block driver */
uint32_t sectsize; /* The size of one sector on the device */
size_t nsectors; /* Number of sectors supported by the device */
* unlinked, then commit Hara-Kiri now.
*/
- if (upper->crefs == 0 && upper->unlinked)
- {
+ if (upper->crefs == 0 && upper->unlinked) {
rtc_destroy(upper);
}
return num;
}
-#define min(x,y) ({ \
- typeof(x) _x = (x); \
- typeof(y) _y = (y); \
- (void) (&_x == &_y); \
- _x < _y ? _x : _y; })
-
-#define max(x,y) ({ \
- typeof(x) _x = (x); \
- typeof(y) _y = (y); \
- (void) (&_x == &_y); \
- _x > _y ? _x : _y; })
+#define min(x, y) ({ \
+ typeof(x) _x = (x); \
+ typeof(y) _y = (y); \
+ (void) (&_x == &_y); \
+ _x < _y ? _x : _y; })
+
+#define max(x, y) ({ \
+ typeof(x) _x = (x); \
+ typeof(y) _y = (y); \
+ (void) (&_x == &_y); \
+ _x > _y ? _x : _y; })
static unsigned long find_first_bit(const unsigned long *addr, unsigned long size)
{
#define container_of(ptr, type, member) ({ \
const typeof(((type*)0)->member) *__mptr = (ptr); \
- (type *)((char *)__mptr - offsetof(type, member));})
+ (type *)((char *)__mptr - offsetof(type, member)); })
/**
* dlist_entry - get the struct for this entry
#define SLSI_REG_RULE(start, end, bw, gain, eirp, reg_flags) \
{ \
- .start_freq_khz = SLSI_MHZ_TO_KHZ(start), \
- .end_freq_khz = SLSI_MHZ_TO_KHZ(end), \
- .max_bandwidth_khz = SLSI_MHZ_TO_KHZ(bw), \
- .max_antenna_gain = SLSI_DBI_TO_MBI(gain), \
- .max_eirp = SLSI_DBM_TO_MBM(eirp), \
- .flags = reg_flags, \
+ .start_freq_khz = SLSI_MHZ_TO_KHZ(start), \
+ .end_freq_khz = SLSI_MHZ_TO_KHZ(end), \
+ .max_bandwidth_khz = SLSI_MHZ_TO_KHZ(bw), \
+ .max_antenna_gain = SLSI_DBI_TO_MBI(gain), \
+ .max_eirp = SLSI_DBM_TO_MBM(eirp), \
+ .flags = reg_flags, \
}
enum slsi_80211_eid {
#define WPA_DRIVER_SMPS_MODE_DYNAMIC 0x00000002
unsigned int smps_modes;
- unsigned int wmm_ac_supported: 1;
+ unsigned int wmm_ac_supported:1;
- unsigned int mac_addr_rand_scan_supported: 1;
- unsigned int mac_addr_rand_sched_scan_supported: 1;
+ unsigned int mac_addr_rand_scan_supported:1;
+ unsigned int mac_addr_rand_sched_scan_supported:1;
/** Maximum number of supported active probe SSIDs */
int max_scan_ssids;
* Mbps from the support rates element(s) in the Probe Request frames
* and not to transmit the frames at any of those rates.
*/
- unsigned int p2p_probe: 1;
+ unsigned int p2p_probe:1;
/**
* only_new_results - Request driver to report only new results
* been detected after this scan request has been started, i.e., to
* flush old cached BSS entries.
*/
- unsigned int only_new_results: 1;
+ unsigned int only_new_results:1;
/**
* low_priority - Requests driver to use a lower scan priority
* This is used to request the driver to use a lower scan priority
* if it supports such a thing.
*/
- unsigned int low_priority: 1;
+ unsigned int low_priority:1;
/**
* mac_addr_rand - Requests driver to randomize MAC address
*/
- unsigned int mac_addr_rand: 1;
+ unsigned int mac_addr_rand:1;
/**
* mac_addr - MAC address used with randomization. The address cannot be
*
****************************************************************************/
#if !defined(CONFIG_DISABLE_PSEUDOFS_OPERATIONS) && \
- !defined(CONFIG_DISABLE_MOUNTPOINT)
+ !defined(CONFIG_DISABLE_MOUNTPOINT)
int block_proxy(FAR const char *blkdev, int oflags);
#endif
int pthread_mutex_give(FAR struct pthread_mutex_s *mutex);
void pthread_mutex_inconsistent(FAR struct pthread_tcb_s *tcb);
#else
-#define pthread_mutex_take(m,i) pthread_sem_take(&(m)->sem,(i))
+#define pthread_mutex_take(m, i) pthread_sem_take(&(m)->sem, (i))
#define pthread_mutex_trytake(m) pthread_sem_trytake(&(m)->sem)
#define pthread_mutex_give(m) pthread_sem_give(&(m)->sem)
#endif