• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ISNULL函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ISNULL函数的典型用法代码示例。如果您正苦于以下问题:C++ ISNULL函数的具体用法?C++ ISNULL怎么用?C++ ISNULL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ISNULL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: rdbi_col_actW

int rdbi_col_actW(
    rdbi_context_def *context,
    const wchar_t *owner,
    const wchar_t *object_name,
    const wchar_t *dbaselink
)
{
    int     status;
    int     tran_begun = FALSE;


    debug_on2("rdbi_col_actW", "owner='%ls', object='%ls'", ISNULL(owner), ISNULL(object_name));

    if (context->rdbi_cnct->autocommit_on) {
        rdbi_tran_begin(context, tran_id);
        tran_begun = TRUE;
    }

    status = (*(context->dispatch.col_actW))(context->drvr, owner, object_name, dbaselink);

    context->rdbi_last_status = status;

    /* ingdr_col_act prefetches all columns so its safe to end the transaction
    *   here without getting fetch across commit problems.
    */

    if ( tran_begun ) {
        rdbi_tran_end(context, tran_id);
    }

    debug_return(NULL, status);
}
开发者ID:johanvdw,项目名称:fdo-git-mirror,代码行数:32,代码来源:col_.c


示例2: get_refresh

char * get_refresh( char * line )
{
	char	* ret = NULL;
	char 	* ptr = NULL;
	char	* tmp = NULL;

	if ( ISNULL(line) )
		return NULL;

	if ( (tmp = ptr = xstrdup(line)) && (ptr = xstrstr( ptr, REFRESH )) )
	{
		if ( (ptr = xstrstr( ptr, URLTAG )) )
		{
			if ( (ptr += strlen(URLTAG)) )
			{
				NEXTFIELD( ptr );

				if ( ptr ) TRUNC( ptr, "\"' >\r\n");
				if ( !ISNULL(ptr) ) ret = xstrdup( ptr );
			}
		}
		xfree( tmp );
	}
	return( ret );
}
开发者ID:foreni-packages,项目名称:webfuzzer,代码行数:25,代码来源:header.c


示例3: rdbi_col_getW

int rdbi_col_getW(
	rdbi_context_def *context,
    wchar_t *column_name,
    wchar_t *type,
    int  *length,
    int  *scale,
    int  *nullable,
    int  *is_autoincrement,
    int  *position,
    int  *eof)
{
    int   status;

    debug_on("rdbi_col_getW");

    status = (*(context->dispatch.col_getW))(context->drvr, column_name, type, length, scale, nullable, is_autoincrement,
                            position, eof);

    context->rdbi_last_status = status;

    debug_area()
    {
        if (*eof)
        {
            debug0("eof=TRUE");
        }
        else
        {
            debug6("column='%ls', type='%ls', length=%d, scale=%d, nullable=%s, position=%d",
                ISNULL(column_name), ISNULL(type), *length, *scale, ISTRUE(*nullable), *position);
        }
    }
    debug_return(NULL, status);
}
开发者ID:johanvdw,项目名称:fdo-git-mirror,代码行数:34,代码来源:col_.c


示例4: bst_help_marked

void bst_help_marked(node_t* pred, operation_t* pred_op, node_t* curr/*, node_t* root*/){

	//fprintf(stderr, "bst help marked\n");
	node_t* new_ref;
	if (ISNULL(curr->left)) {
		if (ISNULL(curr->right)) {
			new_ref = (node_t*)SETNULL(curr);
		} else {
			new_ref = curr->right;
		}
	} else {
		new_ref = curr->left;
	}

	// allocate memory
	// operation_t* cas_op = new child_cas_op(curr==pred->left, curr, new_ref);
	operation_t* cas_op = (operation_t*) ssalloc_alloc(1, sizeof(operation_t));
	cas_op->child_cas_op.is_left = (curr == pred->left);
	cas_op->child_cas_op.expected = curr;
	cas_op->child_cas_op.update = new_ref;

		// fprintf(stderr, "cas_op address: %p, is_left address: %p, expected addr: %p, update addr: %p\n", (unsigned long)cas_op, &(cas_op->child_cas_op.is_left), &(cas_op->child_cas_op.expected), &(cas_op->child_cas_op.update)
	 // );

	if (CAS_PTR(&(pred->op), pred_op, FLAG(cas_op, STATE_OP_CHILDCAS)) == pred_op) {
		bst_help_child_cas(cas_op, pred/*, root*/);
	}
}
开发者ID:LPD-EPFL,项目名称:ASCYLIB,代码行数:28,代码来源:bst_howley.c


示例5: contact_update

/**
 * @brief	Update a user contact entry in the database.
 * @param	contactnum		the numerical id of the contact entry to be modified.
 * @param	usernum			the numerical id of the user to whom the specified contact entry belongs.
 * @param	cur_folder		the numerical id of the parent contact containing the specified contact entry.
 * @param	target_folder	if not 0, sets the new parent contact folder to which the specified contact entry will belong.
 * @param	name			if not NULL, sets the new name of the specified contact entry.
 * @return	-1 on error, 0 if the specified contact entry was not found in the database, or 1 if the contact entry was successfully updated.
 */
int_t contact_update(uint64_t contactnum, uint64_t usernum, uint64_t cur_folder, uint64_t target_folder, stringer_t *name) {

	int64_t affected;
	MYSQL_BIND parameters[5];

	mm_wipe(parameters, sizeof(parameters));

	// Destination Folder
	if (target_folder) {
		parameters[0].buffer_type = MYSQL_TYPE_LONGLONG;
		parameters[0].buffer_length = sizeof(uint64_t);
		parameters[0].buffer = &target_folder;
		parameters[0].is_unsigned = true;
	}
	else {
		parameters[0].buffer_type = MYSQL_TYPE_LONGLONG;
		parameters[0].is_null = ISNULL(true);
	}

	// Name
	if (!st_empty(name)) {
		parameters[1].buffer_type = MYSQL_TYPE_STRING;
		parameters[1].buffer_length = st_length_get(name);
		parameters[1].buffer = st_char_get(name);
	}
	else {
		parameters[1].buffer_type = MYSQL_TYPE_LONGLONG;
		parameters[1].is_null = ISNULL(true);
	}

	// Contact Number
	parameters[2].buffer_type = MYSQL_TYPE_LONGLONG;
	parameters[2].buffer_length = sizeof(uint64_t);
	parameters[2].buffer = &contactnum;
	parameters[2].is_unsigned = true;

	// User Number
	parameters[3].buffer_type = MYSQL_TYPE_LONGLONG;
	parameters[3].buffer_length = sizeof(uint64_t);
	parameters[3].buffer = &usernum;
	parameters[3].is_unsigned = true;

	// Current Folder
	parameters[4].buffer_type = MYSQL_TYPE_LONGLONG;
	parameters[4].buffer_length = sizeof(uint64_t);
	parameters[4].buffer = &cur_folder;
	parameters[4].is_unsigned = true;

	// Since the updated column is always updated this function should only return 0 if the query doesn't match any rows, otherwise 1 to indicate success.
	if ((affected = stmt_exec_affected(stmts.update_contact, parameters)) == -1) {
		log_pedantic("The contact entry update triggered an error. { usernum = %lu / foldernum = %lu / contact = %lu }", usernum, cur_folder, contactnum);
		return -1;
	}

	log_check(affected > 2);

	return (int_t)affected;
}
开发者ID:lavabit,项目名称:magma,代码行数:67,代码来源:datatier.c


示例6: bst_remove

bool_t bst_remove(bst_key_t k, node_t* root, int id){
	//fprintf(stderr, "bst remove\n");
	// node_t* pred;
	// node_t* curr;
	node_t* replace = NULL;
	// operation_t* pred_op;
	// operation_t* curr_op;
	operation_t* replace_op = NULL;
	operation_t* reloc_op = NULL;
	bst_search_result_t* my_result;

	while(TRUE) {
		//root is now a global pointer to a node, not a node
		my_result = bst_find(k, /*&pred, &pred_op, &curr, &curr_op,*/ root, root, id);
		if (my_result->result != FOUND) {
			return FALSE;
		}

		if (ISNULL(my_result->curr->right) || ISNULL(my_result->curr->left)) { // node has less than two children
			if (CAS_PTR(&(my_result->curr->op), my_result->curr_op, FLAG(my_result->curr_op, STATE_OP_MARK)) == my_result->curr_op) {
				bst_help_marked(my_result->pred, my_result->pred_op, my_result->curr/*, root*/);
				return TRUE;
			}
		} else { // node has two children
			node_t* curr = my_result->curr;
			my_search_result[id]->pred = my_result->pred;
			my_search_result[id]->pred_op = my_result->pred_op;
			my_search_result[id]->curr = replace;
			my_search_result[id]->curr_op = replace_op;

			// my_result = bst_find(k, &pred, &pred_op, &replace, &replace_op, curr, root, id);
			my_result = bst_find(k, curr, root, id);
			if ((my_result->result == ABORT) || (my_result->curr->op != my_result->curr_op)) {
				continue;
			} 

			//allocate memory
			//reloc_op = new RelocateOP(curr, curr_op, k, replace->key);
			reloc_op = (operation_t*) ssalloc_alloc(1, sizeof(operation_t));
			reloc_op->relocate_op.state = STATE_OP_ONGOING;
			reloc_op->relocate_op.dest = my_result->curr;
			reloc_op->relocate_op.dest_op = my_result->curr_op;
			reloc_op->relocate_op.remove_key = k;
			reloc_op->relocate_op.replace_key = replace->key;

			// fprintf(stderr, "reloc_op address: %p, state address: %p, dest addr: %p, dest_op addr: %p, remove_key addr: %p, replace_key addr: %p \n", (unsigned long)reloc_op,  &(reloc_op->relocate_op.state), &(reloc_op->relocate_op.dest), &(reloc_op->relocate_op.dest_op), &(reloc_op->relocate_op.remove_key), &(reloc_op->relocate_op.replace_key)
	 	// 	);

			if (CAS_PTR(&(replace->op), replace_op, FLAG(reloc_op, STATE_OP_RELOCATE)) == replace_op) {
				if (bst_help_relocate(reloc_op, my_result->pred, my_result->pred_op, replace/*, root*/)) {
					return TRUE;
				}
			}
		}
	}
}
开发者ID:LPD-EPFL,项目名称:ASCYLIB,代码行数:56,代码来源:bst_howley.c


示例7: hfsQueueItem

HFS_STATUS
hfsQueueItem(PHFS_QUEUE_PROCESSOR pQueueProcessor,
             PHFS_QUEUE_ITEM  pQueueItem)
{
    HFS_STATUS ret=HFS_STATUS_SUCCESS;

    HFS_ENTRY(hfsQueueItem);
    if (ISNULL(pQueueItem) || ISNULL(pQueueProcessor)) {
        ret = HFS_STATUS_PRE_CONDITION_FAILS;
        goto leave;
    }

    if (!list_empty(&pQueueItem->listHead)) {
        HFS_LOG_ERROR("Item %p is alread on some list",
                      pQueueItem);
        ret = HFS_STATUS_PRE_CONDITION_FAILS;
        goto leave;
    }

    if (QUEUE_STATE_STARTED!=hfsQueueGetState(pQueueProcessor)) {
        HFS_LOG_ERROR("Queue Not started cannot insert elements now %p",
                      pQueueProcessor);
        ret = HFS_STATUS_QUEUE_NOT_STARTED;
        goto leave;
    }

    //- Lock the Queue -//
    ret = hfsMutexLock(&pQueueProcessor->queueLock);
    if (!HFS_SUCCESS(ret)) {
        ret = HFS_STATUS_LOCKING_ERROR;
        goto leave;
    }
    //- Insert the element -//
    list_add_tail(&pQueueItem->listHead, &pQueueProcessor->lstAnchorPendingCmds);
    ret = hfsSempost(&pQueueProcessor->semPendingItems);
    if (ret) {
        HFS_LOG_ERROR("Queue threads cannot be woken up");
        ret = HFS_INTERNAL_ERROR;
        goto removeItem;
    }

    ret = HFS_STATUS_SUCCESS;
    goto unlock;


    //- Cleanups -//
 removeItem:
    list_del_init(&pQueueItem->listHead);
 unlock:
    //- Unlock the Queue -//
    hfsMutexUnlock(&pQueueProcessor->queueLock);
 leave:
    HFS_LEAVE(hfsQueueItem);
    return ret;
}
开发者ID:FarazShaikh,项目名称:ParallelFS,代码行数:55,代码来源:utils_common.c


示例8: core

  Traits *DomainObject::getTraits (Atom a)
  {
      if (ISNULL(a)) {
          return core()->traits.null_itraits;
      }
      if (a == kSpecialType) {
          return core()->traits.void_itraits;
      }
      switch (a & 7) {
      case kObjectType:
          return AvmCore::atomToScriptObject(a)->traits();
      case kNamespaceType:
          return core()->traits.namespace_itraits;
      case kStringType:
          return core()->traits.string_itraits;
      case kBooleanType:
          return core()->traits.boolean_itraits;
      case kIntegerType:
          return core()->traits.int_itraits; 
      case kDoubleType:
          return core()->traits.number_itraits;
      }
      toplevel()->throwArgumentError(kNotImplementedError, core()->toErrorString("value")); 
      return core()->traits.void_itraits;
 }
开发者ID:FlowShift,项目名称:thane,代码行数:25,代码来源:DomainClass.cpp


示例9: assert

BOOL CNameEvent::Wait()
{
	assert(ISNOTNULL(m_hEvent));
	if (ISNULL(m_hEvent))
	{
		DOLOG("can't wait null event handle!");
		return FALSE;
	}
	DWORD retCode = 0;
	retCode = WaitForSingleObject(m_hEvent, BLOCKOUTTIMEMSEC);

	BOOL isOK = FALSE;
	switch (retCode)
	{
	case WAIT_FAILED:
		DOLOG("wait event failed! " + GetLastError());
		isOK = FALSE;
		break;
	case WAIT_OBJECT_0:
		isOK = TRUE;
		break;
	case WAIT_TIMEOUT:
		DOLOG(" waitforSingleObject Timeout !");
		isOK = FALSE;
	default:
		DOLOG("waitforSingleObject unknown conidtion ! " + GetLastError());
		isOK = FALSE;
	};
	return isOK;
}
开发者ID:wp4398151,项目名称:MiniServer,代码行数:30,代码来源:CNameEvent.cpp


示例10: dump_stager_cfg

/*
 * write the stager config to an alternate location and skip verification.
 */
int
dump_stager_cfg(
const stager_cfg_t *cfg,	/* cfg to dump */
const char *location)		/* location at which to write the file */
{

	int err = 0;

	Trace(TR_FILES, "dump stager cfg to %s",
	    location ? location : "NULL");

	if (ISNULL(cfg, location)) {
		Trace(TR_OPRMSG, "dump stager cfg failed: %s", samerrmsg);
		return (-1);
	}
	if (strcmp(location, STAGE_CFG) == 0) {
		samerrno = SE_INVALID_DUMP_LOCATION;

		/* Cannot dump the file to %s */
		snprintf(samerrmsg, MAX_MSG_LEN,
		    GetCustMsg(SE_INVALID_DUMP_LOCATION), location);

		Trace(TR_OPRMSG, "dump stager cfg failed: %s", samerrmsg);
		return (-1);
	}

	err = write_stager_cmd(location, cfg);

	Trace(TR_OPRMSG, "dumped stager cfg");

	return (err);
}
开发者ID:BackupTheBerlios,项目名称:samqfs,代码行数:35,代码来源:cfg_stager.c


示例11: redirect_get_location

/**
 **	checks for redirect and returns location value
 **/
char * redirect_get_location( const char * header )
{
	char	* ret = NULL ;
	char	* ptr = NULL ;
   char  * tmp = NULL ;

	if ( ISNULL( header ) ) 
		return NULL;	

	if ( (tmp = xstrdup( header )) )
		ptr = strstr( tmp, "Location: " );

	if ( ptr )
	{
		ptr += strlen( "Location: " );
		NEXTFIELD( ptr );
		if ( ptr )
		{
			TRUNC( ptr, " \t\r\n" );
			if ( *ptr ) ret = xstrdup(ptr);
		}
	}
	xfree( tmp );
	return ret;
}
开发者ID:foreni-packages,项目名称:webfuzzer,代码行数:28,代码来源:header.c


示例12: url_get_port

unsigned short url_get_port( const char * url )
{
	char  * tmp = NULL;
   char 	* ptr = NULL;
   unsigned short port = 80;

	if ( ISNULL(url) )
		return port;

	if ( (tmp = xstrdup( url )) )
		ptr = strstr( tmp, "://" );

   if ( ptr )
   {
      char * slash = NULL;
      ptr += strlen( "://" );
      if ( ptr )
			slash = strchr( ptr, '/' );
      if ( slash )
      {
         char * colon;
         *slash = 0;
         colon = strchr( ptr, ':' );
         if ( colon++ )
         {
				port = (unsigned short)atoi( colon );
            debug( "URL port: %s\n", ptr );
         }
      }
   }
	xfree( tmp );
	return port;
}
开发者ID:foreni-packages,项目名称:webfuzzer,代码行数:33,代码来源:header.c


示例13: calling_host

/*
 * Function to update the job struct when a host has been called
 * asynchronously and did not return an error on the initial call.
 * Note: this function is in job_control because it needs access to the
 * samrlock mutex.
 */
int
calling_host(char *job_id, char *host, int host_num) {

	samrthread_t *ptr;
	dispatch_job_t *dj;

	if (ISNULL(job_id, host)) {
		Trace(TR_ERR, "failed to find the job: %d %s",
		    samerrno, samerrmsg);
		return (-1);
	}

	Trace(TR_MISC, "updating dispatch job %s with response from %s", job_id,
	    host);

	pthread_mutex_lock(samrlock);	/* ++ LOCK samrtlist */
	ptr = find_this_activity(job_id);

	/* If we didn't find the job, return an error */
	if (ptr == NULL) {
		pthread_mutex_unlock(samrlock);	/* ++ UNLOCK */
		samrerr(SE_NO_SUCH_ACTIVITY, job_id);
		Trace(TR_ERR, "failed to find the job: %d %s",
		    samerrno, samerrmsg);
		return (-1);
	}

	if (ptr->type != SAMA_DISPATCH_JOB) {
		pthread_mutex_unlock(samrlock);	/* ++ UNLOCK */
		setsamerr(SE_INVALID_ACTIVITY_TYPE);
		Trace(TR_ERR, "failed to find the job: %d %s",
		    samerrno, samerrmsg);
		return (-1);
	}

	dj = (dispatch_job_t *)ptr->args->db.job;
	if (host_num >= dj->host_count) {
		pthread_mutex_unlock(samrlock);	/* ++ UNLOCK */
		setsamerr(SE_INVALID_HOST_ID_IN_RESPONSE);
		Trace(TR_ERR, "Host number outside of range");
		return (-1);
	}
	dj->hosts_called++;


	/*
	 * Only upgrade the status if a higher status has not been set.
	 * Otherwise leave it alone since there is no guarantee that host_called
	 * will be executed prior to receiving an asychronous response.
	 */
	if (dj->responses[host_num].status == OP_NOT_YET_CALLED) {
		dj->responses[host_num].status = OP_PENDING;
	}
	if (dj->overall_status == DJ_INITIALIZING) {
		dj->overall_status = DJ_PENDING;
	}
	pthread_mutex_unlock(samrlock);	/* ++ UNLOCK */

	return (0);
}
开发者ID:BackupTheBerlios,项目名称:samqfs,代码行数:66,代码来源:job_control.c


示例14: cns_get_public_key

/*
 * Get a public key to be used to generate a secret key to
 * encrypt passwords for the cns_register rpc call
 *
 * server_pub_key is a 1024 bit DH public key in a null-terminated hex
 * string. The lifecycle of this key is the same as the lifecycle of
 * the fsmgmtd. When fsmgmtd is restarted a new key is generated.
 *
 * signature is a digital signature calculated using the mgmt daemon's
 * private signature key. It should be used along with mgmt daemon's
 * public signature key by the client to verify that the
 * server_pub_key is from the daemon prior to trusting the server_pub_key.
 */
int
cns_get_public_key(
ctx_t *c,	/* ARGSUSED */
char **server_pub_key,
crypt_str_t **sig) {

	unsigned char *buf;
	int buf_len;
	int retval;

	Trace(TR_MISC, "get public key");
	if (ISNULL(server_pub_key, sig)) {
		Trace(TR_ERR, "getting public key failed failed %d %s",
		    samerrno, samerrmsg);
		return (-1);
	}
	*sig = NULL;
	if ((retval = get_public_key(server_pub_key, &buf, &buf_len)) != 0) {
		set_registration_error(retval);
		Trace(TR_ERR, "getting public key failed failed %d %s",
		    samerrno, samerrmsg);

		return (-1);
	}
	*sig = (crypt_str_t *)mallocer(sizeof (crypt_str_t));
	if (*sig == NULL) {
		Trace(TR_ERR, "getting public key failed failed %d %s",
		    samerrno, samerrmsg);
		return (-1);
	}
	(*sig)->str = buf;
	(*sig)->str_len = buf_len;
	Trace(TR_MISC, "got public key");
	return (0);
}
开发者ID:BackupTheBerlios,项目名称:samqfs,代码行数:48,代码来源:csn.c


示例15: get_all_rl_fs_directives

/*
 *	get_all_rl_fs_directives()
 *	Function to get all file system directive of releaser.cmd.
 */
int
get_all_rl_fs_directives(
ctx_t *ctx,			/* ARGSUSED */
sqm_lst_t **rl_fs_directives)	/* must be freed by caller */
{
	releaser_cfg_t *releaser;

	Trace(TR_MISC, "get all releaser's file system directives");
	*rl_fs_directives = NULL;
	if (ISNULL(rl_fs_directives)) {
		Trace(TR_ERR, "%s", samerrmsg);
		return (-1);
	}
	/*
	 *	read releaser.cmd file to get all
	 *	releaser.cmd information.
	 */
	if (read_releaser_cfg(&releaser) != 0) {
		Trace(TR_ERR, "Read of %s failed with error: %s",
		    releaser_file, samerrmsg);
		return (-1);
	}
	*rl_fs_directives = releaser->rl_fs_dir_list;
	releaser->rl_fs_dir_list = NULL;
	free_releaser_cfg(releaser);
	Trace(TR_MISC, "get all releaser's file system directives success");
	return (0);
}
开发者ID:BackupTheBerlios,项目名称:samqfs,代码行数:32,代码来源:releaser.c


示例16: create_arch_set

/*
 * Function to create an archive set. The criteria will be added to the
 * end of any file system for which they are specified. Can not be used to
 * create a default arch set. This function will fail if the set already
 * exists.
 */
int
create_arch_set(
ctx_t *ctx,		/* contains optional dump path */
arch_set_t *set)	/* archive set to create */
{
	int ret_val;
	arch_set_arg_t arg;
	samrpc_result_t result;
	char *func_name = "rpc:create archive set";
	char *err_msg;
	enum clnt_stat stat;
	PTRACE(2, "%s entry", func_name);

	CHECK_CLIENT_HANDLE(ctx, func_name);
	if (ISNULL(set)) {
		PTRACE(2, "%s exit %s", func_name, samerrmsg);
		return (-1);
	}
	PTRACE(3, " %s calling RPC...", func_name);

	memset((char *)&result, 0, sizeof (result));
	arg.ctx = ctx;
	arg.set = set;

	SAMRPC_CLNT_CALL(samrpc_create_arch_set, arch_set_arg_t);

	CHECK_FUNCTION_FAILURE(result, func_name);

	ret_val = result.status;

	PTRACE(2, "%s returning with status [%d]...", func_name, ret_val);
	PTRACE(2, "%s exit", func_name);

	return (ret_val);
}
开发者ID:BackupTheBerlios,项目名称:samqfs,代码行数:41,代码来源:arch_set_clnt.c


示例17: ldc_set_tile

static void ldc_set_tile(struct device *device, 
												struct ldc_tile_param_s *tile)
{
	u32 flags, base;

	dev_dbg(ldc_dev, __FUNCTION__ "E\n");

	if (ISNULL((void *)tile)) {
		dev_err(ldc_dev, "frame config arg ptr is null\n");
		return;
	}
	
	spin_lock_irqsave(&ldcdev->lock, flags);

	/* read/write frame base */
	base = (virt_to_phys((void*) tile->frm_params.readbase)
					- DAVINCI_DDR_BASE) >> 5;
	ldc_regw(base, DAVINCI_LDC_RD_BASE);

	base = (virt_to_phys((void*) tile->frm_params.writebase)
					- DAVINCI_DDR_BASE) >> 5;
	ldc_regw(base, DAVINCI_LDC_WR_BASE);

	/* 420C read/write base */
	if (ldcdev->ldc_config.mode == LDC_MODE_YC420) {
		base = (virt_to_phys((void*) tile->frm_params.readbase420c)
					- DAVINCI_DDR_BASE) >> 5;
		ldc_regw(base,  DAVINCI_LDC_420C_RD_BASE);

		base = (virt_to_phys((void*) tile->frm_params.writebase420c)
					- DAVINCI_DDR_BASE) >> 5;
		ldc_regw(base, DAVINCI_LDC_420C_WR_BASE);
	}
开发者ID:mrtos,项目名称:Logitech-Revue,代码行数:33,代码来源:dm365_ldc.c


示例18: imp_get_preview_config

int imp_get_preview_config(struct device *dev,
			   struct imp_logical_channel *channel,
			   struct prev_channel_config *chan_config)
{
	if (channel->mode == IMP_MODE_INVALID) {
		dev_err(dev, "Channel mode is not set. \n");
		return -EINVAL;
	}

	if (channel->mode != chan_config->oper_mode) {
		dev_err(dev,
			"mode mis-match, chan mode = %d, config mode = %d\n",
			channel->mode, chan_config->oper_mode);
		return -EINVAL;
	}

	if (channel->config_state != STATE_CONFIGURED) {
		dev_err(dev, "channel not configured\n");
		return -EINVAL;
	}

	if (ISNULL(chan_config->config)) {
		dev_err(dev, "NULL ptr\n");
		return -EINVAL;
	}

	if (copy_to_user((void *)chan_config->config,
			 (void *)channel->user_config,
			 channel->user_config_size)) {
		dev_err(dev, "Error in copy to user\n");
		return -EFAULT;
	}
	return 0;
}
开发者ID:mrtos,项目名称:Logitech-Revue,代码行数:34,代码来源:imp_common.c


示例19: ldc_get_affine

static void ldc_get_affine(struct device *device, 
													struct ldc_affine_param_s *arg)
{
	u32 ret, flags;
	dev_dbg(ldc_dev, __FUNCTION__ "E\n");

	if (ISNULL((void *)arg)) {
		dev_err(ldc_dev, "frame config arg ptr is null\n");
		return;
	}

	memset(arg, 0, sizeof(struct ldc_affine_param_s));
	spin_lock_irqsave(&ldcdev->lock, flags);
	ret = ldc_regr(DAVINCI_LDC_AB);

	arg->affine_a = ret & 0x3FFF;
	arg->affine_b = (ret >> 16) & 0x3FFF;
	
	ret = ldc_regr(DAVINCI_LDC_CD);
	arg->affine_c = ret & 0xFFFF;
	arg->affine_d = (ret >> 16) & 0x3FFF;

	ret = ldc_regr(DAVINCI_LDC_EF);
	spin_unlock_irqrestore(&ldcdev->lock, flags);
	arg->affine_e = ret & 0x3FFF;
	arg->affine_f = (ret >> 16) & 0xFFFF;

	dev_dbg(ldc_dev, __FUNCTION__ "L\n");
}
开发者ID:mrtos,项目名称:Logitech-Revue,代码行数:29,代码来源:dm365_ldc.c


示例20: ldc_set_affine

static int ldc_set_affine(struct device *device, 
													struct ldc_affine_param_s *arg)
{
	int ret = 0, flags;
	struct ldc_affine_param_s *aff = &ldcdevice.ldc_affine_param;
	dev_dbg(ldc_dev, __FUNCTION__ "E\n");

	if (ISNULL((void *)arg)) {
		dev_err(ldc_dev, "frame config arg ptr is null\n");
		return 1;
	}

	memcpy(aff, arg, sizeof(struct ldc_affine_param_s));

	spin_lock_irqsave(&ldcdev->lock, flags);
	ldc_regw(aff->affine_a, DAVINCI_LDC_AB);
	ldc_regm(aff->affine_b << LDC_AFFINE_SHIFT, 
					 0x3FFF << LDC_AFFINE_SHIFT,
					 DAVINCI_LDC_AB);
	ldc_regw(aff->affine_c, DAVINCI_LDC_CD);
	ldc_regm(aff->affine_d << LDC_AFFINE_SHIFT, 
					 0x3FFF << LDC_AFFINE_SHIFT,
					 DAVINCI_LDC_CD);
	ldc_regw(aff->affine_e, DAVINCI_LDC_EF);
	ldc_regm(aff->affine_f << LDC_AFFINE_SHIFT, 
					 0x3FFF << LDC_AFFINE_SHIFT,
					 DAVINCI_LDC_EF);
	spin_unlock_irqrestore(&ldcdev->lock, flags);

	dev_dbg(ldc_dev, __FUNCTION__ "L\n");
	return ret;
}
开发者ID:mrtos,项目名称:Logitech-Revue,代码行数:32,代码来源:dm365_ldc.c



注:本文中的ISNULL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ISOBJ_TYPE_assert函数代码示例发布时间:2022-05-30
下一篇:
C++ ISNA函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap