当前位置: 首页>>代码示例>>C++>>正文


C++ D2I函数代码示例

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


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

示例1: get_keymap_dir

/*
 * GH
 * Called from cmd4.c and a few other places. Just extracts
 * a direction from the keymap for ch (the last direction,
 * in fact) byte or char here? I'm thinking that keymaps should
 * generally only apply to single keys, which makes it no more
 * than 128, so a char should suffice... but keymap_act is 256...
 */
int get_keymap_dir(char ch)
{
	cptr act, s;
	int d = 0;

	if (isdigit(ch))
	{
		d = D2I(ch);
	}
	else
	{
		if (rogue_like_commands)
		{
			act = keymap_act[KEYMAP_MODE_ROGUE][(byte)ch];
		}
		else
		{
			act = keymap_act[KEYMAP_MODE_ORIG][(byte)ch];
		}

		if (act)
		{
			/* Convert to a direction */
			for (s = act; *s; ++s)
			{
				/* Use any digits in keymap */
				if (isdigit(*s)) d = D2I(*s);
			}
		}
	}
	return d;
}
开发者ID:jcheatham,项目名称:Zangband,代码行数:40,代码来源:ui.c

示例2: target_dir

/*
 * Extract a direction (or zero) from a character
 */
int target_dir(struct keypress ch)
{
	int d = 0;


	/* Already a direction? */
	if (isdigit((unsigned char) ch.code)) {
		d = D2I(ch.code);
	} else if (isarrow(ch.code)) {
		switch (ch.code) {
		case ARROW_DOWN:
			d = 2;
			break;
		case ARROW_LEFT:
			d = 4;
			break;
		case ARROW_RIGHT:
			d = 6;
			break;
		case ARROW_UP:
			d = 8;
			break;
		}
	} else {
		int mode;
		const struct keypress *act;

		if (OPT(rogue_like_commands))
			mode = KEYMAP_MODE_ROGUE;
		else
			mode = KEYMAP_MODE_ORIG;

		/* XXX see if this key has a digit in the keymap we can use */
		act = keymap_find(mode, ch);
		if (act) {
			const struct keypress *cur;
			for (cur = act; cur->type == EVT_KBRD; cur++) {
				if (isdigit((unsigned char) cur->code))
					d = D2I(cur->code);
			}
		}
	}

	/* Paranoia */
	if (d == 5)
		d = 0;

	/* Return direction */
	return (d);
}
开发者ID:NickMcConnell,项目名称:FAangband,代码行数:53,代码来源:xtra2.c

示例3: F820121

int F820121(TRUSERID *handle,int iRequest,ST_PACK *in_pack,int *pRetCode,char *szMsg)
{
	T_t_pif_phydevice aphydev;
	double dUniqNo=0;
	int ret=0;
	
	memset(&aphydev,0,sizeof(aphydev));
	
	//从cpack中取得相应字符串
	Strncpy_t(aphydev.dname,in_pack->sphone,sizeof(aphydev.dname));
	Strncpy_t(aphydev.dtype,in_pack->spager,sizeof(aphydev.dtype));
	Strncpy_t(aphydev.factory,in_pack->scert_no,sizeof(aphydev.factory));
	Strncpy_t(aphydev.comments,(char*)in_pack->usset1,sizeof(aphydev.comments));
	//设备标志从系统键值表中取得
	ret=getNewUniqNo(KEYTYPE_PHYDEVICE,&dUniqNo);
	if(ret)
	{
		*pRetCode=E_DB_SYSKEY_R;
		goto L_RETU;
	}
	aphydev.phytype =D2I(dUniqNo);
	ret=DB_t_pif_phydevice_add(&aphydev); 
	if(ret)
	{
		*pRetCode=E_DB_PHYDEVICE_I;
		goto L_RETU;		
	}
	return 0;
	L_RETU:
		return -1;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:31,代码来源:F820121.cpp

示例4: D2I

void CDialogParamRegion::SetKeBe(DATA_IN::EnergyType energyType)
{
	m_KE_BE = energyType;	

	m_ComboAnodeControl.EnableWindow(m_KE_BE == DATA_IN::EnergyType::BE);
	m_AnodeTxtControl.EnableWindow(m_KE_BE == DATA_IN::EnergyType::BE);

	int NewValue = D2I( ((int) 10* CRegion::h_nu_Info.Value_h_nu[m_Anode])/10.) - D2I(m_KE_Start);
	m_KE_Start = I2D(NewValue);

	NewValue = D2I( ((int) 10* CRegion::h_nu_Info.Value_h_nu[m_Anode])/10.) - D2I(m_KE_End);
	m_KE_End = I2D(NewValue);
	
	std::swap(m_KE_Start, m_KE_End);

	UpdateData(FALSE);
}
开发者ID:Alexepus,项目名称:Kratos,代码行数:17,代码来源:DialogParamRegion.cpp

示例5: record_small_serial

static int record_small_serial(ST_PACK *in_pack,T_t_tif_tradeserial *tradeserial,ST_PACK *out_pack){
	int ret =0;
	double dUniqno = 0;
	 T_t_tif_tradeserial  tPacketSerial;

	//保存充值流水
	memset(&tPacketSerial, 0, sizeof tPacketSerial);
	memcpy(&tPacketSerial, tradeserial, sizeof tPacketSerial);
	ret = getNewUniqNo(KEYTYPE_TRADESERIAL,&dUniqno);  						//获得最大流水号
	if(ret)
	{
		writelog(LOG_ERR,"ret [%d]",ret);
		return ret;
	}
	tPacketSerial.serial_no = D2I(dUniqno);
	tPacketSerial.serial_state = SERISTAT_NONEEDDEBT;
	tPacketSerial.serial_type = TXCODE_SAVING_SMALL_PACKET;
	tPacketSerial.purse_id = 33;//33扇区钱包
	tPacketSerial.in_balance = in_pack->damt2;
	tPacketSerial.trade_fee = in_pack->damt1;
	tPacketSerial.out_balance = tPacketSerial.in_balance + tPacketSerial.trade_fee;

	ret = DB_t_tif_tradeserial_add(&tPacketSerial);
	if (ret)
	{
		writelog(LOG_ERR,"ret[%d]",ret);
		if(DB_REPEAT==ret)
			ret = E_DB_TRADESERIAL_E;
		else
			ret = E_DB_TRADESERIAL_I;
		return ret;
	}

	out_pack->damt2=tPacketSerial.out_balance;
	out_pack->lvol1= D2I(dUniqno);			//流水号

	return 0;
	

}	
开发者ID:nykma,项目名称:ykt4sungard,代码行数:40,代码来源:ext_consumer.cpp

示例6: textui_get_count

/**
 * Get a command count, with the '0' key.
 */
static int textui_get_count(void)
{
	int count = 0;

	while (1)
	{
		ui_event_data ke;

		prt(format("Count: %d", count), 0, 0);

		ke = inkey_ex();
		if (ke.type != EVT_KBRD)
			continue;

		if (ke.key == ESCAPE)
			return -1;

		/* Simple editing (delete or backspace) */
		else if (ke.key == 0x7F || ke.key == KTRL('H'))
			count = count / 10;

		/* Actual numeric data */
		else if (isdigit((unsigned char) ke.key))
		{
			count = count * 10 + D2I(ke.key);

			if (count >= 9999)
			{
				bell("Invalid repeat count!");
				count = 9999;
			}
		}

		/* Anything non-numeric passes straight to command input */
		else
		{
			/* XXX nasty hardcoding of action menu key */
			if (ke.key != '\n' && ke.key != '\r')
				Term_event_push(&ke);

			break;
		}
	}

	return count;
}
开发者ID:NickMcConnell,项目名称:RePosBand,代码行数:49,代码来源:cmd0.c

示例7: textui_get_count

/**
 * Get a command count, with the '0' key.
 */
static int textui_get_count(void)
{
	int count = 0;

	while (1)
	{
		struct keypress ke;

		prt(format("Repeat: %d", count), 0, 0);

		ke = inkey();
		if (ke.code == ESCAPE)
			return -1;

		/* Simple editing (delete or backspace) */
		else if (ke.code == KC_DELETE || ke.code == KC_BACKSPACE)
			count = count / 10;

		/* Actual numeric data */
		else if (isdigit((unsigned char) ke.code))
		{
			count = count * 10 + D2I(ke.code);

			if (count >= 9999)
			{
				bell("Invalid repeat count!");
				count = 9999;
			}
		}

		/* Anything non-numeric passes straight to command input */
		else
		{
			/* XXX nasty hardcoding of action menu key */
			if (ke.code != KC_ENTER)
				Term_keypress(ke.code, ke.mods);

			break;
		}
	}

	return count;
}
开发者ID:KertaLosataure,项目名称:angband,代码行数:46,代码来源:cmd-process.c

示例8: record_serial

 int record_serial(ST_PACK *in_pack,T_t_tif_tradeserial *tradeserial,ST_PACK *out_pack){
	int ret =0;
	double dUniqno = 0;
	char sMsg[256]="";

	//	准备数据插入交易流水表
	ret = getNewUniqNo(KEYTYPE_TRADESERIAL,&dUniqno);  					//获得最大流水号
	if(ret)
	{
		writelog(LOG_ERR,"getNewUniqNo error,errcode=[%d]",ret);
		return ret;
	}						
	tradeserial->serial_no = D2I(dUniqno);			//流水号
	out_pack->damt1=tradeserial->trade_fee;		//充值金额
	out_pack->damt0=tradeserial->out_balance;	//出卡值
	out_pack->lvol0=tradeserial->serial_no;//流水号
	
	sprintf(sMsg,"交易前卡余额:%.2lf元 卡当前余额:%.2lf元",tradeserial->in_balance,tradeserial->out_balance);
	strcat(out_pack->vsmess,sMsg);
	writelog(LOG_DEBUG,out_pack->vsmess);

	ret = DB_t_tif_tradeserial_add(tradeserial);
	if (ret)
	{
		writelog(LOG_ERR,"ret[%d]",ret);
		if(DB_REPEAT==ret)
			ret = E_DB_TRADESERIAL_E;
		else
			ret = E_DB_TRADESERIAL_I;
		return ret;
	}
	ret=db_commit();
	if(ret)
	{
		writelog(LOG_ERR,"db_commit error,errcode=[%d]",ret);
		return E_DB_COMMIT;
	}
	return 0;
	

}	
开发者ID:nykma,项目名称:ykt4sungard,代码行数:41,代码来源:ext_consumer.cpp

示例9: packege_send_data

static int packege_send_data(ST_PACK *in_pack,int flag,char *send_data){
	int ret =0;
	//char cellphone[31]="";	//充值手机号
	double money=0;			//充值金额
	char sysdate[11]="";
	char systime[9]="";
	char sysdatetime[20]="";
	char serialno[20]="";
	char sMoney[20]="";
	T_t_pif_card	tCard;
//	ext_phone_trans_t phone_trans_struct;
	ext_phone_trans_t* phone_trans_struct;
	phone_trans_struct=(ext_phone_trans_t*)send_data;
	
	memset(&tCard,0,sizeof(tCard));
	memset(phone_trans_struct,0,sizeof(ext_phone_trans_t));
	
	phone_trans_struct->prix[0]=0x31;
	memcpy(phone_trans_struct->length,"0067",4);
	if(1==flag)
	{
		memcpy(phone_trans_struct->type,"0100",4);
	}
	else if(2==flag)
	{
		memcpy(phone_trans_struct->type,"0200",4);		
	}
	//memcpy(phone_trans_struct->bitery,"0000000000000000",16);
	memset(phone_trans_struct->bitery,'0',sizeof(phone_trans_struct->bitery));
	ret=DB_t_pif_card_read_by_card_id(in_pack->lvol0, &tCard);
	if(ret)
	{
		if(DB_NOTFOUND==ret)
			ret=E_CARDNO_NOT_EXIST;
		else
			ret=E_DB_CARD_R;
		return ret;
	}
	sprintf(phone_trans_struct->cutid,"%-22d",tCard.cosumer_id);	
	money = in_pack->damt1;
	int i_money=D2I(D4U5(money*100,0));
	sprintf(sMoney,"%07d",i_money);
	memcpy(phone_trans_struct->money,sMoney,sizeof(phone_trans_struct->money));
	ret=get_datetime_from_db(sysdate,systime);
	if(ret)
	{
		writelog(LOG_ERR,"get_datetime_from_db error,error code=[%d]",ret);
		getsysdate(sysdate);
		getsystime(systime);
	}
	strcpy(sysdatetime,sysdate+4);
	strcat(sysdatetime,systime);
	memcpy(phone_trans_struct->datetime,sysdatetime,10);
	memcpy(phone_trans_struct->tracenum,sysdate,8);
	sprintf(serialno,"%06d",in_pack->lvol6%1000000);
	memcpy(phone_trans_struct->tracenum+8,serialno,6);
	memcpy(phone_trans_struct->phone,in_pack->sphone,strlen(in_pack->sphone));
	memcpy(phone_trans_struct->retnum,"00",2);
	memset(phone_trans_struct->plugdata,0x20,sizeof(phone_trans_struct->plugdata));

	/*
	memcpy(send_data,phone_trans_struct->prix,1);
	memcpy(send_data+1,phone_trans_struct->length,4);
	memcpy(send_data+5,phone_trans_struct->type,4);
	memcpy(send_data+9,phone_trans_struct->bitery,16);
	memcpy(send_data+25,phone_trans_struct->cutid,22);
	memcpy(send_data+47,phone_trans_struct->money,7);
	memcpy(send_data+54,phone_trans_struct->datetime,10);
	memcpy(send_data+64,phone_trans_struct->tracenum,14);
	memcpy(send_data+78,phone_trans_struct->phone,11);
	memcpy(send_data+89,phone_trans_struct->retnum,2);
	memcpy(send_data+91,phone_trans_struct->plugdata,36);
	*/
	writelog(LOG_ERR,"package send data=[%s]",send_data);
	return 0;
	
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:77,代码来源:ext_consumer.cpp

示例10: target_dir

/*
 * Extract a direction (or zero) from a character
 */
int target_dir(char ch)
{
    int d = 0;

    int mode;

    cptr act;

    cptr s;


    /* Already a direction? */
    if (isdigit((unsigned char) ch)) {
	d = D2I(ch);
    } else if (isarrow(ch)) {
	switch (ch) {
	case ARROW_DOWN:
	    d = 2;
	    break;
	case ARROW_LEFT:
	    d = 4;
	    break;
	case ARROW_RIGHT:
	    d = 6;
	    break;
	case ARROW_UP:
	    d = 8;
	    break;
	}
    } else {
	/* Roguelike */
	if (OPT(rogue_like_commands)) {
	    mode = KEYMAP_MODE_ROGUE;
	}

	/* Original */
	else {
	    mode = KEYMAP_MODE_ORIG;
	}

	/* Extract the action (if any) */
	act = keymap_act[mode][(byte) (ch)];

	/* Analyze */
	if (act) {
	    /* Convert to a direction */
	    for (s = act; *s; ++s) {
		/* Use any digits in keymap */
		if (isdigit((unsigned char) *s))
		    d = D2I(*s);
	    }
	}
    }

    /* Paranoia */
    if (d == 5)
	d = 0;

    /* Return direction */
    return (d);
}
开发者ID:artes-liberales,项目名称:FAangband,代码行数:64,代码来源:xtra2.c

示例11: packege_elec_request

static int packege_elec_request(ST_PACK *in_pack,int flag,char *send_data){
	int ret;
	ext_elect_req_t* elect_req_t;
	elect_req_t=(ext_elect_req_t*)send_data;
	double money=0;			//充值金额
	char serialno[10]="";
	char sysdate[11]="";
	char systime[9]="";
	char sysdatetime[20]="";
	unsigned char buf[106]="";
	unsigned char soutmd5[16]="";
	char outmd5[32]="";
	T_t_pif_card	tCard;
	memset(&tCard,0,sizeof(tCard));
	if(flag==1){//房间查询不加密
		memcpy(elect_req_t->prix,"0",1);
	}else{
		memcpy(elect_req_t->prix,"1",1);
	}
	
	memcpy(elect_req_t->length,"0141",4);	
	
	if(flag==1){
		memcpy(elect_req_t->type,"0001",4);
		
	}else if(flag==2){
		memcpy(elect_req_t->type,"0002",4);
	}

	memset(elect_req_t->bitery,'0',sizeof(elect_req_t->bitery));
	sprintf(elect_req_t->room,"%-20s",in_pack->saddr);
	ret=DB_t_pif_card_read_by_card_id(in_pack->lvol0, &tCard);
	if(ret)
	{
		if(DB_NOTFOUND==ret)
			ret=E_CARDNO_NOT_EXIST;
		else
			ret=E_DB_CARD_R;
		return ret;
	}
	sprintf(elect_req_t->cutid,"%-22d",tCard.cosumer_id);	
	money = in_pack->damt1;
	int i_money=D2I(D4U5(money*100,0));
	sprintf(elect_req_t->money,"%07d",i_money);
	ret=get_datetime_from_db(sysdate,systime);
	if(ret)
	{
		writelog(LOG_ERR,"get_datetime_from_db error,error code=[%d]",ret);
		getsysdate(sysdate);
		getsystime(systime);
	}
	strcpy(sysdatetime,sysdate+4);
	strcat(sysdatetime,systime);
	memcpy(elect_req_t->datetime,sysdatetime,10);
	memcpy(elect_req_t->tracenum,sysdate,8);
	sprintf(serialno,"%010d",in_pack->lvol6);
	memcpy(elect_req_t->tracenum+8,serialno,10);
	memcpy(elect_req_t->retnum,"0000",4);
	memcpy(elect_req_t->clientid,"0001",4);
	memset(outmd5,'0',32);
	if(flag==1){
		sprintf(elect_req_t->signcheck,"%s",outmd5);
	}else if(flag==2){
		memcpy(buf,elect_req_t->type,105);	
		writelog(LOG_ERR,"buf data=[%s]",buf);
		CalcMD5(buf,105,soutmd5);
		dec2hex(soutmd5,16,outmd5);
		writelog(LOG_ERR,"outmd5 data=[%s]",outmd5);
		sprintf(elect_req_t->signcheck,"%s",outmd5);
	}	
	
	
	return 0;
	
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:75,代码来源:ext_consumer.cpp

示例12: tend_to_enter_account


//.........这里部分代码省略.........
		else
		{
			tCustomer.fee_type=tSpeFee.fee_type;
		}
		//更新客户表的收费类别字段
		ret=DB_t_cif_customer_update_lock_by_cur(&tCustomer);
		if(ret)
		{
			if(DB_NOTFOUND==ret)
				ret= E_CUSTOMER_NOT_EXIST;
			else
				ret= E_DB_CUSTOMER_U;
			return ret;
		}
	}
	DB_t_cif_customer_free_lock_cur();

	des2src(Operator,in_pack->scust_no);												//操作员号								//采集设备标识

	//	准备数据插入交易流水表
	ret = getNewUniqNo(KEYTYPE_TRADESERIAL,&dUniqno);  					//获得最大流水号
	if(ret)
	{
		writelog(LOG_ERR,"getNewUniqNo error,errcode=[%d]",ret);
		return ret;
	}
	
	strncpy(tradeserial->operate_date,sysdate,sizeof(sysdate)-1);				//发生日期
	strncpy(tradeserial->operate_time,systime,sizeof(systime)-1);
	des2src(tradeserial->collect_date,tradeserial->operate_date);								//采集日期
	des2src(tradeserial->collect_time,tradeserial->operate_time);								//采集时间
	des2src(tradeserial->enteract_date,logicdate);							//处理日期
	des2src(tradeserial->enteract_time,tradeserial->operate_time);							//处理时间
	tradeserial->serial_no = D2I(dUniqno);									//流水号
	tradeserial->serial_type = trade_code;						//流水类型
	tradeserial->purse_id = PURSE_NO_ONE;					//钱包号
	tradeserial->serial_state = SERISTAT_NODEBT;								//流水状态
	tradeserial->maindevice_id = maindevice_id;						//上传工作站标识
	tradeserial->device_id = device_id;										//采集设备标识
	tradeserial->card_id = card_id;										//交易卡号
	tradeserial->customer_id=tCard.cosumer_id;								//客户号
	des2src(tradeserial->oper_code,Operator);
	tradeserial->trade_count=in_pack->lvol1+1;		//交易次数
	tradeserial->in_balance=in_pack->damt0;			//入卡值
	tradeserial->trade_fee=in_pack->damt1;				//交易金额
	strncpy(tradeserial->reserve_2,in_pack->vsmess,sizeof(tradeserial->reserve_2)-1);

	IA->iCardNo=tCard.card_id;
	IA->iFeeType=tCustomer.fee_type;
	IA->dArrInAmt[0]=tradeserial->trade_fee;
	IA->iMainDevId=tradeserial->maindevice_id;				//工作站标识
	IA->iDevId=tradeserial->device_id;						//设备ID
	IA->iSerialNo=tradeserial->serial_no;					//流水号
	IA->iTradeNo=tradeserial->serial_type;					//交易码
	strcpy(IA->sTxDate,tradeserial->operate_date);			//交易日期
	strcpy(IA->sTxTime,tradeserial->operate_time);			//交易时间
	strcpy(IA->sTxCollectDate,tradeserial->collect_date);		//采集日期
	strcpy(IA->sTxCollectTime,tradeserial->collect_time);		//采集时间
	strcpy(IA->sTxAccDate,tradeserial->enteract_date);		//记账日期
	strcpy(IA->sTxAccTime,tradeserial->enteract_time);		//记账时间
	strcpy(IA->sMdeOper,tradeserial->oper_code);			//操作员
	strcpy(IA->sChkOper,tradeserial->reserve_1);			//复核操作员

	IA->iUseCardFlag=USE_CARD_TYPE_ONLINE;		//联机交易
	IA->iTxCnt=tradeserial->trade_count;					//交易次数
	IA->dInCardBala=tradeserial->in_balance;				//入卡值
开发者ID:nykma,项目名称:ykt4sungard,代码行数:67,代码来源:ext_consumer.cpp

示例13: F847102


//.........这里部分代码省略.........
		goto L_RETU;
	}
	DB_t_pif_card_free_lock_by_cur();

	//	插入卡挂失有效期限表
/*
	ret=GetLostCardValiddate(sysdate,enddate);											//获得挂失有效期限
	if (ret)
	{
		*pRetCode = ret;
		goto L_RETU;
	}
	cardlossinfo.card_id = card_id;													//卡号
	des2src(cardlossinfo.begin_date,sysdate);											//起始日期
	des2src(cardlossinfo.end_date,enddate);											//截至日期
	des2src(cardlossinfo.operate_date,sysdate);										//操作日期
	des2src(cardlossinfo.operate_time,systime);										//操作时间
	cardlossinfo.state_id=STATE_VALID;												//有效
	ret = DB_t_pif_cardlossinfo_add(&cardlossinfo);
	if (ret)
	{
		*pRetCode = E_DB_CARDLOSSINFO_I;
		writelog(LOG_ERR,"errcode[%d] ",ret);
		goto L_RETU;
	}
*/
	//如果该卡号被冻结,则挂失时对黑名单不处理
	if(STATE_FALSE==tCard.state_id[CARDSTAT_TYPE_FREEZE])
	{
		//	插入黑名单表
		ret=DB_t_tif_black_sheet_del_by_card_id_and_is_ad(tCard.card_id,DELETE_BLACKLIST);
		if(ret)
		{
			if(ret!=DB_NOTFOUND)
			{
				*pRetCode=ret;
				goto L_RETU;
			}
		}
		ret=InsertToBlkList(tCard.card_id,ADD_BLACKLIST);
		if(ret)
		{
			*pRetCode=ret;
			writelog(LOG_ERR,"InsertToBlkList err[%d]",ret);
			goto L_RETU;
		}
		//广播黑名单
		AddXmlItemInt(tMesList.incontent, XML_KEY_CARDID,card_id);
		AddXmlItemInt(tMesList.incontent, XML_KEY_ADDDELSIGN,ADD_BLACKLIST);	//增删标志

		tMesList.funid = 930005;
		tMesList.pfunid = 930003;
		tMesList.max_send_cnt = 10;
		tMesList.level = MESLIST_PRIORITY_REALTIME;
		tMesList.msgtype = MESLIST_TYPE_ORDER;
		ret=AddMsgLst(&tMesList);
		if(ret)
		{
			*pRetCode=ret;
			writelog(LOG_ERR,"AddMsgLst err[%d]",ret);
			goto L_RETU;
		}
	}
	//	准备数据插入交易流水表
	ret = getNewUniqNo(KEYTYPE_TRADESERIAL,&dUniqno);  					//获得最大流水号
	if(ret)
	{
		*pRetCode = ret;
		writelog(LOG_ERR,"ERRCODE = [%d]",ret);
		goto L_RETU;
	}
	des2src(tradeserial.operate_date,sysdate);											//发生日期
	des2src(tradeserial.operate_time,systime);											//发生时间
	des2src(tradeserial.collect_date,sysdate);												//采集日期
	des2src(tradeserial.collect_time,systime);												//采集时间
	des2src(tradeserial.enteract_date,logicdate);											//处理日期
	des2src(tradeserial.enteract_time,systime);											//处理时间
	tradeserial.serial_no = D2I(dUniqno);										//流水号
	tradeserial.serial_type = TXCODE_CARD_LOSS;								//挂失
	tradeserial.serial_state = SERISTAT_NONEEDDEBT;							//流水状态
	tradeserial.maindevice_id = maindevice_id;									//上传工作站标识
	tradeserial.device_id = device_id;											//采集设备标识
	tradeserial.card_id = card_id;											//交易卡号
	tradeserial.customer_id=tCard.cosumer_id;									//客户号
	des2src(tradeserial.oper_code,Operator);

	ret = DB_t_tif_tradeserial_add(&tradeserial);
	if (ret)
	{
		writelog(LOG_ERR,"ret[%d]",ret);
		if(DB_REPEAT==ret)
			*pRetCode = E_DB_TRADESERIAL_E;
		else
			*pRetCode = E_DB_TRADESERIAL_I;
		goto L_RETU;
	}
	return 0;
L_RETU:
	return -1;
}
开发者ID:nykma,项目名称:ykt4sungard,代码行数:101,代码来源:F847102.c

示例14: F950041

int F950041(TRUSERID *handle,int iRequest,ST_PACK *rPack,int *pRetCode,char *szMsg)
{
	int ret;
	T_t_pif_device tDevice;
	T_t_cif_shop_pos tShopPos;
	T_t_cif_shop tShop;
	T_t_tif_meslist tMsg;
	T_t_pif_feetype tFeeType;
	int rate = 0;
	int retries = 0;
	int msgid;
	unsigned char buf[32] = "";
	char cardlist[100] = "";
	int rows = 0;
	int i,j;

	memset(&tDevice,0,sizeof tDevice);
	memset(&tFeeType,0,sizeof tFeeType);
	
	ST_CPACK aPack;
	ST_PACK *out_pack = &(aPack.pack);
	memset(&aPack,0,sizeof aPack);

	ResetNormalCPack(&aPack,0,1);
	SetCol(handle,0);
	SetCol(handle,F_VSVARSTR0,F_VSMESS,0);
	
	if(rPack->lcert_code < 1)
	{
		*pRetCode = E_DEVICE_NOT_EXIST;
	}
	else if((ret = DB_t_pif_device_read_by_device_id(rPack->lcert_code,&tDevice)))
	{
		if(DB_NOTFOUND == ret)
			*pRetCode = E_DB_DEVICE_N;
		else
			*pRetCode = E_DB_DEVICE_R;

	}
	else if(tDevice.state_id == DEVISTAT_LOGOUT)
	{
		*pRetCode = E_DEVICE_NOT_EXIST;
	}
	// 如果是 39 的充值机
	else if(strcmp(tDevice.devtype,"0201") == 0 && tDevice.phytype == 1000)
	{
		des2src(rPack->sdate0,tDevice.devphy999_id);
		ret = F930006(handle,iRequest,rPack,pRetCode,szMsg);
		if(ret)	
		{
			goto LRet;
		}
		return 0;
	}
	else if((ret = DB_t_cif_shop_pos_open_select_by_c0_and_device_id(rPack->lcert_code)))
	{
		*pRetCode = E_DB_SHOP_POS_R;
	}
	else
	{
		
		while(1)
		{
			memset(&tShopPos,0,sizeof tShopPos);
			memset(&tShop,0,sizeof tShop);
			if((ret = DB_t_cif_shop_pos_fetch_select_by_c0(&tShopPos)))
			{
				if(ret == DB_NOTFOUND)
				{
					writelog(LOG_DEBUG,"shop doesn't find [%d]!");
					*pRetCode  = 0;
				}
				else
					*pRetCode = E_DB_SHOP_POS_R;
				break;
			}
			writelog(LOG_DEBUG,"find shop [%d]",tShopPos.shop_id);
			if((ret = DB_t_cif_shop_read_by_shop_id(tShopPos.shop_id,&tShop)))
			{
				*pRetCode = ret;
				break;
			}
			if('1' == tShop.is_leaf[0] && '1' == tShop.is_getfee[0]
				&& amtcmp(tShop.ratio,0.00)>0 )
			{
				writelog(LOG_DEBUG,"shop rate [%.02f]",tShop.ratio);
				int newrate = D2I(tShop.ratio * 100);
				if(newrate > rate)
					rate = newrate;
			}
		}
		
	}
	if(*pRetCode)
		return -1;
	
	ret = DB_t_pif_feetype_open_select_by_cur1();
	if(ret)
	{
		if(DB_NOTFOUND == ret)
//.........这里部分代码省略.........
开发者ID:nykma,项目名称:ykt4sungard,代码行数:101,代码来源:F950041.cpp

示例15: CONV_FUNC


//.........这里部分代码省略.........
          k4 = pk[4]; k5 = pk[5]; k6 = pk[6];
          pk += kw;

          if (kw == 7) {

            if (l < (n - 1) || off < m) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
              for (i = 0; i <= (wid - 2); i += 2) {
                p0 = p2; p1 = p3; p2 = p4; p3 = p5; p4 = p6; p5 = p7;

                p6 = buff[i + 6]; p7 = buff[i + 7];

                buffd[i    ] += p0*k0 + p1*k1 + p2*k2 + p3*k3 + p4*k4 + p5*k5 + p6*k6;
                buffd[i + 1] += p1*k0 + p2*k1 + p3*k2 + p4*k3 + p5*k4 + p6*k5 + p7*k6;
              }

            } else {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
              for (i = 0; i <= (wid - 2); i += 2) {
                p0 = p2; p1 = p3; p2 = p4; p3 = p5; p4 = p6; p5 = p7;

                p6 = buff[i + 6]; p7 = buff[i + 7];

                LOAD_BUFF(buffi);

                dd.d64 = *(FTYPE   *)(buffi + i);
                buffn[i    ] = (FTYPE)dd.i32s.i0;
                buffn[i + 1] = (FTYPE)dd.i32s.i1;

                d0 = D2I(p0*k0 + p1*k1 + p2*k2 + p3*k3 + p4*k4 + p5*k5 + p6*k6 + buffd[i    ]);
                d1 = D2I(p1*k0 + p2*k1 + p3*k2 + p4*k3 + p5*k4 + p6*k5 + p7*k6 + buffd[i + 1]);

                dp[0    ] = FROM_S32(d0);
                dp[chan1] = FROM_S32(d1);

                buffd[i    ] = 0.0;
                buffd[i + 1] = 0.0;

                sp += chan2;
                dp += chan2;
              }
            }

          } else if (kw == 6) {

            if (l < (n - 1) || off < m) {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
              for (i = 0; i <= (wid - 2); i += 2) {
                p0 = p2; p1 = p3; p2 = p4; p3 = p5; p4 = p6;

                p5 = buff[i + 5]; p6 = buff[i + 6];

                buffd[i    ] += p0*k0 + p1*k1 + p2*k2 + p3*k3 + p4*k4 + p5*k5;
                buffd[i + 1] += p1*k0 + p2*k1 + p3*k2 + p4*k3 + p5*k4 + p6*k5;
              }

            } else {
#ifdef __SUNPRO_C
#pragma pipeloop(0)
#endif /* __SUNPRO_C */
开发者ID:lmsf,项目名称:jdk9-dev,代码行数:67,代码来源:mlib_ImageConv_8nw.c


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