if (_queue_is_empty(&surface_queue->free_queue)) {
if (wait &&
- _tbm_surface_queue_get_node_count(surface_queue,QUEUE_NODE_TYPE_ACQUIRE)) {
+ _tbm_surface_queue_get_node_count(surface_queue, QUEUE_NODE_TYPE_ACQUIRE)) {
pthread_cond_wait(&surface_queue->free_cond, &surface_queue->lock);
pthread_mutex_unlock(&surface_queue->lock);
if (_queue_is_empty(&surface_queue->dirty_queue)) {
if (wait &&
- _tbm_surface_queue_get_node_count(surface_queue,QUEUE_NODE_TYPE_DEQUEUE)) {
+ _tbm_surface_queue_get_node_count(surface_queue, QUEUE_NODE_TYPE_DEQUEUE)) {
if (!_queue_has_node_type(surface_queue, QUEUE_NODE_TYPE_DEQUEUE)) {
TBM_LOG_E("Deosn't have dequeue type node\n");
FILE *ut_fopen(const char *filename, const char *mode)
{
- if (!filename || !mode) {
+ if (!filename || !mode)
return NULL;
- }
- if (!strcmp(filename, "/proc/111/cmdline")) {
+ if (!strcmp(filename, "/proc/111/cmdline"))
return NULL;
- }
- if (!strcmp(filename, "/proc/222/cmdline")) {
+ if (!strcmp(filename, "/proc/222/cmdline"))
return &g_error_file;
- }
return &g_file;
}
char *ut_fgets(char *str, int num, FILE *stream)
{
- if (!str || num < 1 || !stream) {
+ if (!str || num < 1 || !stream)
return NULL;
- }
- if (stream == &g_error_file) {
+ if (stream == &g_error_file)
return NULL;
- }
strncpy(str, "application", 255);
int dup2(int old_handle, int new_handle)
{
- if (old_handle == new_handle) {
+ if (old_handle == new_handle)
return -1;
- }
+
return 0;
}
int dup(int handle)
{
- if (1 == handle) {
+ if (1 == handle)
return -1;
- }
+
return 0;
}
int ioctl(int fd, unsigned long int request, ...)
{
- if (IOCTL_FD_ERROR == fd) {
+ if (IOCTL_FD_ERROR == fd)
return 1;
- }
if (IOCTL_FD_GET == fd) {
va_list argList;
void *ut_calloc(size_t nmemb, size_t size)
{
- if (CALLOC_ERROR) {
+ if (CALLOC_ERROR)
return NULL;
- }
return calloc(nmemb, size);
}
tbm_bo_handle() {}
tbm_bo_handle(const uint64_t v)
{
- if (v == 0) {
+ if (v == 0)
ptr = NULL;
- } else {
+ else
ptr = &u64;
- }
+
s32 = v;
u32 = v;
s64 = v;
static int ut_pthread_mutex_init(pthread_mutex_t * __mutex,
const pthread_mutexattr_t * __mutexattr)
{
- if (PTHREAD_MUTEX_INIT_ERROR) {
+ if (PTHREAD_MUTEX_INIT_ERROR)
return PTHREAD_MUTEX_INIT_ERROR;
- }
return 0;
}
static void *ut_bo_alloc(tbm_bo bo, int size, int flags)
{
- if (TBM_BO_ALLOC_ERROR) {
+ if (TBM_BO_ALLOC_ERROR)
return NULL;
- }
return ret_bo;
}
static void *ut_bo_import(tbm_bo bo, unsigned int key)
{
- if (TBM_BO_IMPORT_ERROR) {
+ if (TBM_BO_IMPORT_ERROR)
return NULL;
- }
return ret_bo;
}
static void *ut_bo_import_fd(tbm_bo bo, tbm_fd fd)
{
- if (TBM_BO_IMPORT_ERROR) {
+ if (TBM_BO_IMPORT_ERROR)
return NULL;
- }
return ret_bo;
}
static unsigned int ut_bo_export(tbm_bo bo)
{
- if (UT_TBM_ERROR) {
+ if (UT_TBM_ERROR)
return 0;
- }
return 1;
}
static tbm_fd ut_bo_export_fd(tbm_bo bo)
{
- if (UT_TBM_ERROR) {
+ if (UT_TBM_ERROR)
return -1;
- }
return 1;
}
{
tbm_bo_handle ret;
- if (UT_TBM_ERROR) {
+ if (UT_TBM_ERROR)
ret.ptr = NULL;
- } else {
+ else
ret.ptr = (void *)12;
- }
return ret;
}
{
tbm_bo_handle ret;
- if (UT_TBM_ERROR) {
+ if (UT_TBM_ERROR)
ret.ptr = NULL;
- } else {
+ else
ret.ptr = (void *)12;
- }
return ret;
}
static int ut_bo_unmap(tbm_bo bo)
{
- if (UT_TBM_ERROR) {
+ if (UT_TBM_ERROR)
return 0;
- }
return 1;
}
static int ut_bufmgr_bind_native_display(tbm_bufmgr bufmgr, void *NativeDisplay)
{
- if (UT_TBM_ERROR) {
+ if (UT_TBM_ERROR)
return 0;
- }
return 1;
}