您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ zap函数代码示例

51自学网 2021-06-03 11:55:30
  C++
这篇教程C++ zap函数代码示例写得很实用,希望能帮到您。

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

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

示例1: cbc_decr

/* Decrypt one block using CBC. */static krb5_error_codecbc_decr(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,         size_t num_data){    int              ret = 0, olen = BLOCK_SIZE;    unsigned char    iblock[BLOCK_SIZE], oblock[BLOCK_SIZE];    EVP_CIPHER_CTX   ciph_ctx;    struct iov_block_state input_pos, output_pos;    EVP_CIPHER_CTX_init(&ciph_ctx);    ret = EVP_DecryptInit_ex(&ciph_ctx, map_mode(key->keyblock.length),                             NULL, key->keyblock.contents, (ivec) ? (unsigned char*)ivec->data : NULL);    if (ret == 0)        return KRB5_CRYPTO_INTERNAL;    IOV_BLOCK_STATE_INIT(&input_pos);    IOV_BLOCK_STATE_INIT(&output_pos);    krb5int_c_iov_get_block(iblock, BLOCK_SIZE, data, num_data, &input_pos);    EVP_CIPHER_CTX_set_padding(&ciph_ctx,0);    ret = EVP_DecryptUpdate(&ciph_ctx, oblock, &olen, iblock, BLOCK_SIZE);    if (ret == 1) {        krb5int_c_iov_put_block(data, num_data, oblock, BLOCK_SIZE,                                &output_pos);    }    EVP_CIPHER_CTX_cleanup(&ciph_ctx);    zap(iblock, BLOCK_SIZE);    zap(oblock, BLOCK_SIZE);    return (ret == 1) ? 0 : KRB5_CRYPTO_INTERNAL;}
开发者ID:Brainiarc7,项目名称:pbis,代码行数:31,


示例2: cbc_decr

/* Decrypt one block using CBC. */static krb5_error_codecbc_decr(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,         size_t num_data){    int              ret = 0, olen = BLOCK_SIZE;    unsigned char    iblock[BLOCK_SIZE], oblock[BLOCK_SIZE];    EVP_CIPHER_CTX   *ctx;    struct iov_cursor cursor;    ctx = EVP_CIPHER_CTX_new();    if (ctx == NULL)        return ENOMEM;    ret = EVP_DecryptInit_ex(ctx, map_mode(key->keyblock.length),                             NULL, key->keyblock.contents, (ivec) ? (unsigned char*)ivec->data : NULL);    if (ret == 0) {        EVP_CIPHER_CTX_free(ctx);        return KRB5_CRYPTO_INTERNAL;    }    k5_iov_cursor_init(&cursor, data, num_data, BLOCK_SIZE, FALSE);    k5_iov_cursor_get(&cursor, iblock);    EVP_CIPHER_CTX_set_padding(ctx,0);    ret = EVP_DecryptUpdate(ctx, oblock, &olen, iblock, BLOCK_SIZE);    if (ret == 1)        k5_iov_cursor_put(&cursor, oblock);    EVP_CIPHER_CTX_free(ctx);    zap(iblock, BLOCK_SIZE);    zap(oblock, BLOCK_SIZE);    return (ret == 1) ? 0 : KRB5_CRYPTO_INTERNAL;}
开发者ID:mrogers950,项目名称:krb5,代码行数:33,


示例3: accumulator_reseed

/* Reseed the generator using the accumulator pools. */static voidaccumulator_reseed(struct fortuna_state *st){    unsigned int i, n;    SHA256_CTX ctx;    unsigned char hash_result[SHA256_HASHSIZE];    n = ++st->reseed_count;    /*     * Collect entropy from pools.  We use the i-th pool only 1/(2^i) of the     * time so that each pool collects twice as much entropy between uses as     * the last.     */    shad256_init(&ctx);    for (i = 0; i < NUM_POOLS; i++) {        if (n % (1 << i) != 0)            break;        /* Harvest this pool's hash result into ctx, then reset the pool. */        shad256_result(&st->pool[i], hash_result);        shad256_init(&st->pool[i]);        shad256_update(&ctx, hash_result, SHA256_HASHSIZE);    }    shad256_result(&ctx, hash_result);    generator_reseed(st, hash_result, SHA256_HASHSIZE);    zap(hash_result, SHA256_HASHSIZE);    zap(&ctx, sizeof(ctx));    /* Reset the count of bytes added to pool 0. */    st->pool0_bytes = 0;}
开发者ID:Kendra123,项目名称:krb5,代码行数:33,


示例4: forward

void forward(void){	char b;	// 600 IF F(1)>0 AND F(1)<7 THEN GOTO 660	if (f[0]==1) {		// 660 B=INT(RND(1)*3+1)		// 670 SHOOT:PRINT SPC(5) TX$(B) :WAIT8*TI:SHOOT:CLS		// 672 IF B=2 THEN ZAP:SHOOT:ZAP		shoot();		printf("     ");		b = rand()%3;		printf(message[b]);		wait(360);		shoot();		cls();		if (b==1) {			zap();shoot();zap();		}	} else if(f[0]>1 && f[0]<7) {		shoot();		printf("Prenez la porte, mais pas comme ca !");		wait(360);		cls();	} else {		s_old = s;		x_old = x;		y_old = y;		switch(s) {			case 0:				if(y>0)					y--;				break;			case 1:				if(x<XMAX)					x++;				break;			case 2:				if(y<XMAX)					y++;				break;			case 3:				if(x>0)					x--;				break;			default:				printf("erreur forward/n");		}	}	// 330 CASE=C(X,Y)	ca = c[x+y*XMAX];		prep();	drawLaby();	manageCell();}
开发者ID:hialmar,项目名称:tyrann3,代码行数:55,


示例5: cts_decr

static krb5_error_codects_decr(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,         size_t num_data, size_t dlen){    int                    ret = 0;    size_t                 size = 0;    unsigned char         *oblock = NULL;    unsigned char         *dbuf = NULL;    unsigned char          iv_cts[IV_CTS_BUF_SIZE];    struct iov_block_state input_pos, output_pos;    AES_KEY                deck;    memset(iv_cts,0,sizeof(iv_cts));    if (ivec && ivec->data){        if (ivec->length != sizeof(iv_cts))            return KRB5_CRYPTO_INTERNAL;        memcpy(iv_cts, ivec->data,ivec->length);    }    IOV_BLOCK_STATE_INIT(&input_pos);    IOV_BLOCK_STATE_INIT(&output_pos);    oblock = OPENSSL_malloc(dlen);    if (!oblock)        return ENOMEM;    dbuf = OPENSSL_malloc(dlen);    if (!dbuf){        OPENSSL_free(oblock);        return ENOMEM;    }    AES_set_decrypt_key(key->keyblock.contents,                        NUM_BITS * key->keyblock.length, &deck);    krb5int_c_iov_get_block(dbuf, dlen, data, num_data, &input_pos);    size = CRYPTO_cts128_decrypt((unsigned char *)dbuf, oblock,                                 dlen, &deck,                                 iv_cts, (cbc128_f)AES_cbc_encrypt);    if (size <= 0)        ret = KRB5_CRYPTO_INTERNAL;    else {        krb5int_c_iov_put_block(data, num_data, oblock, dlen, &output_pos);    }    if (!ret && ivec && ivec->data)        memcpy(ivec->data, iv_cts, sizeof(iv_cts));    zap(oblock, dlen);    zap(dbuf, dlen);    OPENSSL_free(oblock);    OPENSSL_free(dbuf);    return ret;}
开发者ID:Brainiarc7,项目名称:pbis,代码行数:55,


示例6: throw

void HPFUGenInternal::processBlock(bool& shouldDelete, const unsigned int blockID, const int channel) throw(){	double piOverSampleRate = UGen::getReciprocalSampleRate() * pi;	int numSamplesToProcess = uGenOutput.getBlockSize();	float* outputSamples = uGenOutput.getSampleData();	float* inputSamples = inputs[Input].processBlock(shouldDelete, blockID, channel);	float* freqSamples = inputs[Freq].processBlock(shouldDelete, blockID, channel);	float y0;	float newFreq = *freqSamples;			if(newFreq != currentFreq)	{		float slope = 1.f / numSamplesToProcess;		float pfreq = (float)(max(0.01f, newFreq) * piOverSampleRate);				float C = tan(pfreq);		float C2 = C * C;		float sqrt2C = (float)(C * sqrt2);				float next_a0 = 1.f / (1.f + sqrt2C + C2);		float next_b1 = 2.f * (1.f - C2) * next_a0 ;		float next_b2 = -(1.f - sqrt2C + C2) * next_a0;				float a0_slope = (next_a0 - a0) * slope;		float b1_slope = (next_b1 - b1) * slope;		float b2_slope = (next_b2 - b2) * slope;				while(numSamplesToProcess--)		{			y0 = *inputSamples++ + b1 * y1 + b2 * y2; 			*outputSamples++ = a0 * (y0 - 2.f * y1 + y2);			y2 = y1; 			y1 = y0;									a0 += a0_slope;			b1 += b1_slope;			b2 += b2_slope;		}			}	else	{		while(numSamplesToProcess--)		{			y0 = *inputSamples++ + b1 * y1 + b2 * y2; 			*outputSamples++ = a0 * (y0 - 2.f * y1 + y2);			y2 = y1; 			y1 = y0;					}	}		y1 = zap(y1);	y2 = zap(y2);	currentFreq = newFreq;}
开发者ID:alessandrostone,项目名称:ugen,代码行数:54,


示例7: k5_des3_encrypt

static krb5_error_codek5_des3_encrypt(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,                size_t num_data){    int ret, olen = MIT_DES_BLOCK_LENGTH;    unsigned char iblock[MIT_DES_BLOCK_LENGTH], oblock[MIT_DES_BLOCK_LENGTH];    struct iov_block_state input_pos, output_pos;    EVP_CIPHER_CTX ciph_ctx;    krb5_boolean empty;    ret = validate(key, ivec, data, num_data, &empty);    if (ret != 0 || empty)        return ret;    IOV_BLOCK_STATE_INIT(&input_pos);    IOV_BLOCK_STATE_INIT(&output_pos);    EVP_CIPHER_CTX_init(&ciph_ctx);    ret = EVP_EncryptInit_ex(&ciph_ctx, EVP_des_ede3_cbc(), NULL,                             key->keyblock.contents,                             (ivec) ? (unsigned char*)ivec->data : NULL);    if (!ret)        return KRB5_CRYPTO_INTERNAL;    EVP_CIPHER_CTX_set_padding(&ciph_ctx,0);    for (;;) {        if (!krb5int_c_iov_get_block(iblock, MIT_DES_BLOCK_LENGTH,                                     data, num_data, &input_pos))            break;        ret = EVP_EncryptUpdate(&ciph_ctx, oblock, &olen,                                (unsigned char *)iblock, MIT_DES_BLOCK_LENGTH);        if (!ret)            break;        krb5int_c_iov_put_block(data, num_data,                                oblock, MIT_DES_BLOCK_LENGTH, &output_pos);    }    if (ivec != NULL)        memcpy(ivec->data, oblock, MIT_DES_BLOCK_LENGTH);    EVP_CIPHER_CTX_cleanup(&ciph_ctx);    zap(iblock, sizeof(iblock));    zap(oblock, sizeof(oblock));    if (ret != 1)        return KRB5_CRYPTO_INTERNAL;    return 0;}
开发者ID:Brainiarc7,项目名称:pbis,代码行数:54,


示例8: throw

void FSinOscUGenInternal::processBlock(bool& shouldDelete, const unsigned int blockID, const int channel) throw(){		float* outputSamples = uGenOutput.getSampleData();	float newFreq = *(inputs[Freq].processBlock(shouldDelete, blockID, channel));	double y0;		LOCAL_DECLARE(double, b1);	LOCAL_DECLARE(double, y1);	LOCAL_DECLARE(double, y2);		if(newFreq != currentFreq)	{		currentFreq = newFreq;				double initialPhase;				if((1.0-std::abs(y1)) < 0.00001)		{			initialPhase = y1 > 0.0 ? piOverTwo : -piOverTwo;		}		else		{			initialPhase = std::asin(y1);			// based on the trajectory predict which solution of asin(y1) is correct..			if(y2 >= y1)			{				double piVersion = y1 > 0.0 ? pi : -pi;							initialPhase = piVersion - initialPhase;			}		}		double w = currentFreq * twoPi * UGen::getReciprocalSampleRate();				b1 = zap(2. * std::cos(w));		y1 = zap(std::sin(initialPhase));		y2 = zap(std::sin(initialPhase-w));	}		int numSamplesToProcess = uGenOutput.getBlockSize();	for(int i = 0; i < numSamplesToProcess; ++i)	{		y0 = b1 * y1 - y2;		outputSamples[i] = y0;// = b1 * y1 - y2; 		y2 = y1; 		y1 = y0;	}			y1 = zap(y1);	y2 = zap(y2);	LOCAL_COPY(b1);	LOCAL_COPY(y1);	LOCAL_COPY(y2);}
开发者ID:kazu2012,项目名称:ofxUGen,代码行数:53,


示例9: k5_des3_encrypt

/* * k5_des3_encrypt: Encrypt data buffer using 3DES.   *   * @key      DES key (with odd parity) * @ivec     Initialization Vector * @data     Input/Output buffer (in-place encryption, block-by-block) * @num_data Number of blocks * * Returns 0 on success, krb5_error_code on error */static krb5_error_codek5_des3_encrypt(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,                size_t num_data){    int ret;    Des3 des3;    unsigned char iv[DES_BLOCK_SIZE];    unsigned char iblock[DES_BLOCK_SIZE];    unsigned char oblock[DES_BLOCK_SIZE];    //struct iov_block_state input_pos, output_pos;    struct iov_cursor cursor;    krb5_boolean empty;    ret = validate(key, ivec, data, num_data, &empty);    if (ret != 0 || empty)        return ret;    memset(iv, 0, sizeof(iv));        /* Check if IV exists and is the correct size */    if (ivec && ivec->data) {        if (ivec->length != sizeof(iv))            return KRB5_CRYPTO_INTERNAL;        memcpy(iv, ivec->data, ivec->length);    }    Des3_SetKey(&des3, key->keyblock.contents, iv, DES_ENCRYPTION);    k5_iov_cursor_init(&cursor, data, num_data, DES_BLOCK_SIZE, FALSE);    for (;;) {        if (!k5_iov_cursor_get(&cursor, iblock))            break;        Des3_CbcEncrypt(&des3, oblock, iblock, DES_BLOCK_SIZE);        k5_iov_cursor_put(&cursor, oblock);    }    if (ivec != NULL)        memcpy(ivec->data, oblock, DES_BLOCK_SIZE);    zap(iv, sizeof(iv));    zap(iblock, sizeof(iblock));    zap(oblock, sizeof(oblock));    return 0;}
开发者ID:b055man,项目名称:krb5,代码行数:62,


示例10: cts_decr

static krb5_error_codects_decr(krb5_key key, const krb5_data *ivec, krb5_crypto_iov *data,         size_t num_data, size_t dlen){    int                    ret = 0;    size_t                 size = 0;    unsigned char         *oblock = NULL;    unsigned char         *dbuf = NULL;    unsigned char          iv_cts[IV_CTS_BUF_SIZE];    struct iov_cursor      cursor;    AES_KEY                deck;    memset(iv_cts,0,sizeof(iv_cts));    if (ivec && ivec->data) {        if (ivec->length != sizeof(iv_cts))            return KRB5_CRYPTO_INTERNAL;        memcpy(iv_cts, ivec->data,ivec->length);    }    oblock = OPENSSL_malloc(dlen);    if (!oblock)        return ENOMEM;    dbuf = OPENSSL_malloc(dlen);    if (!dbuf) {        OPENSSL_free(oblock);        return ENOMEM;    }    AES_set_decrypt_key(key->keyblock.contents,                        NUM_BITS * key->keyblock.length, &deck);    k5_iov_cursor_init(&cursor, data, num_data, dlen, FALSE);    k5_iov_cursor_get(&cursor, dbuf);    size = CRYPTO_cts128_decrypt((unsigned char *)dbuf, oblock,                                 dlen, &deck,                                 iv_cts, (cbc128_f)AES_cbc_encrypt);    if (size <= 0)        ret = KRB5_CRYPTO_INTERNAL;    else        k5_iov_cursor_put(&cursor, oblock);    if (!ret && ivec && ivec->data)        memcpy(ivec->data, iv_cts, sizeof(iv_cts));    zap(oblock, dlen);    zap(dbuf, dlen);    OPENSSL_free(oblock);    OPENSSL_free(dbuf);    return ret;}
开发者ID:mrogers950,项目名称:krb5,代码行数:52,


示例11: dct_unquantize_h263_inter_axp

static void dct_unquantize_h263_inter_axp(MpegEncContext *s, DCTELEM *block,                                    int n, int qscale){    int i, n_coeffs;    uint64_t qmul, qadd;    uint64_t correction;    qadd = WORD_VEC((qscale - 1) | 1);    qmul = qscale << 1;    /* This mask kills spill from negative subwords to the next subword.  */    correction = WORD_VEC((qmul - 1) + 1); /* multiplication / addition */    n_coeffs = s->intra_scantable.raster_end[s->block_last_index[n]];    for(i = 0; i <= n_coeffs; block += 4, i += 4) {        uint64_t levels, negmask, zeros, add;        levels = ldq(block);        if (levels == 0)            continue;#ifdef __alpha_max__        /* I don't think the speed difference justifies runtime           detection.  */        negmask = maxsw4(levels, -1); /* negative -> ffff (-1) */        negmask = minsw4(negmask, 0); /* positive -> 0000 (0) */#else        negmask = cmpbge(WORD_VEC(0x7fff), levels);        negmask &= (negmask >> 1) | (1 << 7);        negmask = zap(-1, negmask);#endif        zeros = cmpbge(0, levels);        zeros &= zeros >> 1;        /* zeros |= zeros << 1 is not needed since qadd <= 255, so           zapping the lower byte suffices.  */        levels *= qmul;        levels -= correction & (negmask << 16);        /* Negate qadd for negative levels.  */        add = qadd ^ negmask;        add += WORD_VEC(0x0001) & negmask;        /* Set qadd to 0 for levels == 0.  */        add = zap(add, zeros);        levels += add;        stq(levels, block);    }}
开发者ID:AnthonyNystrom,项目名称:MobiVU,代码行数:51,


示例12: qDebug

void DroneThread::resendImportantStuff() {    qDebug() << Q_FUNC_INFO << cameraMode << m_fly;    zap(cameraMode);    setFly(m_fly);    return;    sendCmd("AT*CONFIG=%1,/"general:navdata_demo/",/"TRUE/"/r");}
开发者ID:vranki,项目名称:DroneTaxi,代码行数:7,


示例13: dereference

/* Drop the ref count.  If it hits zero, remove the entry from the fcc_set list * and free it. */static krb5_error_code dereference(krb5_context context, fcc_data *data){    struct fcc_set **fccsp, *temp;    k5_cc_mutex_lock(context, &krb5int_cc_file_mutex);    for (fccsp = &fccs; *fccsp != NULL; fccsp = &(*fccsp)->next) {        if ((*fccsp)->data == data)            break;    }    assert(*fccsp != NULL);    assert((*fccsp)->data == data);    (*fccsp)->refcount--;    if ((*fccsp)->refcount == 0) {        data = (*fccsp)->data;        temp = *fccsp;        *fccsp = (*fccsp)->next;        free(temp);        k5_cc_mutex_unlock(context, &krb5int_cc_file_mutex);        k5_cc_mutex_assert_unlocked(context, &data->lock);        free(data->filename);        zap(data->buf, sizeof(data->buf));        if (data->fd >= 0) {            k5_cc_mutex_lock(context, &data->lock);            close_cache_file(context, data);            k5_cc_mutex_unlock(context, &data->lock);        }        k5_cc_mutex_destroy(&data->lock);        free(data);    } else {        k5_cc_mutex_unlock(context, &krb5int_cc_file_mutex);    }    return 0;}
开发者ID:arkadiyg,项目名称:krb5,代码行数:35,


示例14: main

int main (){	int *p, *p1, *p2, i;	clock_t cl_start, cl_finish;	double sek;	p = NULL;	p1 = NULL;	p2 = NULL;	scanf ("%d", &kvanto); 	p = (int*) malloc(kvanto * sizeof(int)); 	p1 = (int*) malloc(kvanto * sizeof(int));	p2 = (int*) malloc(kvanto * sizeof(int));	if ((p != NULL)&&(p1 != NULL)&&(p2 != NULL))	{		zap(p,p1,p2,kvanto);		cl_start = clock();		podschet(p,kvanto);		cl_finish = clock();		sek = cl_finish - cl_start;		sek = sek / CLOCKS_PER_SEC;		printf("%f/n",sek);		cl_start = clock();		rascheska(p1,kvanto);		cl_finish = clock();		sek = cl_finish - cl_start;		sek = sek / CLOCKS_PER_SEC;		printf("%f/n",sek);		cl_start = clock();		puzyrok(p2,kvanto);		cl_finish = clock();		sek = cl_finish - cl_start;		sek = sek / CLOCKS_PER_SEC;		printf("%f/n",sek);	}	if (p != NULL)	{		free(p);	}	if (p1 != NULL)	{		free(p1);	}	if (p2 != NULL)	{		free(p2);	}	getch();	return 0;}
开发者ID:PavelKev,项目名称:Homework,代码行数:60,


示例15: k5_prng_cleanup

voidk5_prng_cleanup(void){    have_entropy = FALSE;    zap(&main_state, sizeof(main_state));    k5_mutex_destroy(&fortuna_lock);}
开发者ID:Kendra123,项目名称:krb5,代码行数:7,


示例16: zap

/** Clear memory of sensitive data*/void ANSI_X919_MAC::clear()   {   m_des1->clear();   m_des2->clear();   zap(m_state);   m_position = 0;   }
开发者ID:Rohde-Schwarz-Cybersecurity,项目名称:botan,代码行数:10,


示例17: main

int main() {  Foo f;  f.waga();  zap();  f.waga();  return 0;}
开发者ID:Dastrius,项目名称:oink-stack,代码行数:7,


示例18: generator_output

/* Output pseudo-random data from the generator. */static voidgenerator_output(struct fortuna_state *st, unsigned char *dst, size_t len){    unsigned char result[AES256_BLOCKSIZE];    size_t n, count = 0;    while (len > 0) {        /* Produce bytes and copy the result into dst. */        encrypt_counter(st, result);        n = (len < AES256_BLOCKSIZE) ? len : AES256_BLOCKSIZE;        memcpy(dst, result, n);        dst += n;        len -= n;        /* Each time we reach MAX_BYTES_PER_KEY bytes, change the key. */        count += AES256_BLOCKSIZE;        if (count >= MAX_BYTES_PER_KEY) {            change_key(st);            count = 0;        }    }    zap(result, sizeof(result));    /* Change the key after each request. */    change_key(st);}
开发者ID:Kendra123,项目名称:krb5,代码行数:27,


示例19: dct_unquantize_h263_axp

static void dct_unquantize_h263_axp(DCTELEM *block, int n_coeffs,                                    uint64_t qscale, uint64_t qadd){	uint64_t qmul = qscale << 1;	uint64_t correction = WORD_VEC(qmul * 255 >> 8);	int i;	qadd = WORD_VEC(qadd);	for(i = 0; i <= n_coeffs; block += 4, i += 4)	{		uint64_t levels, negmask, zeros, add, sub;		levels = ldq(block);		if (levels == 0)			continue;#ifdef __alpha_max__		/* I don't think the speed difference justifies runtime		   detection.  */		negmask = maxsw4(levels, -1); /* negative -> ffff (-1) */		negmask = minsw4(negmask, 0); /* positive -> 0000 (0) */#else		negmask = cmpbge(WORD_VEC(0x7fff), levels);		negmask &= (negmask >> 1) | (1 << 7);		negmask = zap(-1, negmask);#endif		zeros = cmpbge(0, levels);		zeros &= zeros >> 1;		/* zeros |= zeros << 1 is not needed since qadd <= 255, so		   zapping the lower byte suffices.  */		levels *= qmul;		levels -= correction & (negmask << 16);		add = qadd & ~negmask;		sub = qadd &  negmask;		/* Set qadd to 0 for levels == 0.  */		add = zap(add, zeros);		levels += add;		levels -= sub;		stq(levels, block);	}}
开发者ID:hicks0074,项目名称:freescale_omx_framework,代码行数:46,


示例20: zap

//------ Begin of function NewsArray::reset -----////!//! Reset all news display options and clear all news in the log//!void NewsArray::reset() {    zap();                                          // clear all news in the log    last_clear_recno = 0;    news_add_flag    = 1;    default_setting();}
开发者ID:ndilday,项目名称:virtualu,代码行数:12,


示例21: ensure_space

/* * Make sure there is room for LEN more characters in BUF, in addition to the * null terminator and what's already in there.  Return true on success.  On * failure, set the error flag and return false. */static intensure_space(struct k5buf *buf, size_t len){    size_t new_space;    char *new_data;    if (buf->buftype == K5BUF_ERROR)        return 0;    if (buf->space - 1 - buf->len >= len) /* Enough room already. */        return 1;    if (buf->buftype == K5BUF_FIXED) /* Can't resize a fixed buffer. */        goto error_exit;    assert(buf->buftype == K5BUF_DYNAMIC || buf->buftype == K5BUF_DYNAMIC_ZAP);    new_space = buf->space * 2;    while (new_space - buf->len - 1 < len) {        if (new_space > SIZE_MAX / 2)            goto error_exit;        new_space *= 2;    }    if (buf->buftype == K5BUF_DYNAMIC_ZAP) {        /* realloc() could leave behind a partial copy of sensitive data. */        new_data = malloc(new_space);        if (new_data == NULL)            goto error_exit;        memcpy(new_data, buf->data, buf->len);        new_data[buf->len] = '/0';        zap(buf->data, buf->len);        free(buf->data);    } else {        new_data = realloc(buf->data, new_space);        if (new_data == NULL)            goto error_exit;    }    buf->data = new_data;    buf->space = new_space;    return 1;error_exit:    if (buf->buftype == K5BUF_DYNAMIC_ZAP)        zap(buf->data, buf->len);    if (buf->buftype == K5BUF_DYNAMIC_ZAP || buf->buftype == K5BUF_DYNAMIC)        free(buf->data);    set_error(buf);    return 0;}
开发者ID:PADL,项目名称:krb5,代码行数:50,


示例22: XXp3

int XXp3(char *arg){  int result;  printf("XXp3(): started, pid = %d, calling zap on pid 5/n", getpid());  result = zap(5);  printf("XXp3(): after call to zap, result of zap = %d/n", result);  return 0;} /* XXp3 */
开发者ID:JFitzMan,项目名称:UslossPhase1,代码行数:9,


示例23: zap

void SiteArray::deinit(){	if( size()==0 )		return;	zap();       // zap the DynArrayB	untapped_raw_count = 0;}
开发者ID:spippolatore,项目名称:7kaa,代码行数:9,


示例24: zap

//--------- Begin of function SpyArray::deinit ----------////void SpyArray::deinit(){	if( size()==0 )		return;	//-------- zap the array -----------//	zap();}
开发者ID:brianV,项目名称:7kaa,代码行数:11,


示例25: krb5_k_decrypt

krb5_error_code KRB5_CALLCONVkrb5_k_decrypt(krb5_context context, krb5_key key,               krb5_keyusage usage, const krb5_data *ivec,               const krb5_enc_data *input, krb5_data *output){    const struct krb5_keytypes *ktp;    krb5_crypto_iov iov[4];    krb5_error_code ret;    unsigned int header_len, trailer_len, plain_len;    char *scratch = NULL;    ktp = find_enctype(key->keyblock.enctype);    if (ktp == NULL)        return KRB5_BAD_ENCTYPE;    if (input->enctype != ENCTYPE_UNKNOWN && ktp->etype != input->enctype)        return KRB5_BAD_ENCTYPE;    /* Verify the input and output lengths. */    header_len = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_HEADER);    trailer_len = ktp->crypto_length(ktp, KRB5_CRYPTO_TYPE_TRAILER);    if (input->ciphertext.length < header_len + trailer_len)        return KRB5_BAD_MSIZE;    plain_len = input->ciphertext.length - header_len - trailer_len;    if (output->length < plain_len)        return KRB5_BAD_MSIZE;    scratch = k5alloc(header_len + trailer_len, &ret);    if (scratch == NULL)        return ret;    iov[0].flags = KRB5_CRYPTO_TYPE_HEADER;    iov[0].data = make_data(scratch, header_len);    memcpy(iov[0].data.data, input->ciphertext.data, header_len);    iov[1].flags = KRB5_CRYPTO_TYPE_DATA;    iov[1].data = make_data(output->data, plain_len);    memcpy(iov[1].data.data, input->ciphertext.data + header_len, plain_len);    /* Use empty padding since tokens don't indicate the padding length. */    iov[2].flags = KRB5_CRYPTO_TYPE_PADDING;    iov[2].data = empty_data();    iov[3].flags = KRB5_CRYPTO_TYPE_TRAILER;    iov[3].data = make_data(scratch + header_len, trailer_len);    memcpy(iov[3].data.data, input->ciphertext.data + header_len + plain_len,           trailer_len);    ret = ktp->decrypt(ktp, key, usage, ivec, iov, 4);    if (ret != 0)        zap(output->data, plain_len);    else        output->length = plain_len;    zapfree(scratch, header_len + trailer_len);    return ret;}
开发者ID:secure-endpoints,项目名称:mit-krb5,代码行数:56,


示例26: add_pixels_clamped_mvi

void add_pixels_clamped_mvi(const int16_t *block, uint8_t *pixels,                            ptrdiff_t line_size){    int h = 8;    /* Keep this function a leaf function by generating the constants       manually (mainly for the hack value ;-).  */    uint64_t clampmask = zap(-1, 0xaa); /* 0x00ff00ff00ff00ff */    uint64_t signmask  = zap(-1, 0x33);    signmask ^= signmask >> 1;  /* 0x8000800080008000 */    do {        uint64_t shorts0, pix0, signs0;        uint64_t shorts1, pix1, signs1;        shorts0 = ldq(block);        shorts1 = ldq(block + 4);        pix0    = unpkbw(ldl(pixels));        /* Signed subword add (MMX paddw).  */        signs0  = shorts0 & signmask;        shorts0 &= ~signmask;        shorts0 += pix0;        shorts0 ^= signs0;        /* Clamp. */        shorts0 = maxsw4(shorts0, 0);        shorts0 = minsw4(shorts0, clampmask);        /* Next 4.  */        pix1    = unpkbw(ldl(pixels + 4));        signs1  = shorts1 & signmask;        shorts1 &= ~signmask;        shorts1 += pix1;        shorts1 ^= signs1;        shorts1 = maxsw4(shorts1, 0);        shorts1 = minsw4(shorts1, clampmask);        stl(pkwb(shorts0), pixels);        stl(pkwb(shorts1), pixels + 4);        pixels += line_size;        block += 8;    } while (--h);}
开发者ID:0day-ci,项目名称:FFmpeg,代码行数:43,


示例27: main

int main() {    {	D a[10];	D x,y,z;	test();	zap();    }    if( dcount != 10+1+1+1+10 ) fail(__LINE__);    _PASS;}
开发者ID:ABratovic,项目名称:open-watcom-v2,代码行数:10,


示例28: zap

//--------------------------------------------------------------------------////    Assignmenet Operator////--------------------------------------------------------------------------RegexPattern &RegexPattern::operator = (const RegexPattern &other) {    if (this == &other) {        // Source and destination are the same.  Don't do anything.        return *this;    }    // Clean out any previous contents of object being assigned to.    zap();    // Give target object a default initialization    init();    // Copy simple fields    fPattern          = other.fPattern;    fFlags            = other.fFlags;    fLiteralText      = other.fLiteralText;    fDeferredStatus   = other.fDeferredStatus;    fMinMatchLen      = other.fMinMatchLen;    fMaxCaptureDigits = other.fMaxCaptureDigits;    fStaticSets       = other.fStaticSets;         fStartType        = other.fStartType;    fInitialStringIdx = other.fInitialStringIdx;    fInitialStringLen = other.fInitialStringLen;    *fInitialChars    = *other.fInitialChars;    *fInitialChars8   = *other.fInitialChars8;    fInitialChar      = other.fInitialChar;    //  Copy the pattern.  It's just values, nothing deep to copy.    fCompiledPat->assign(*other.fCompiledPat, fDeferredStatus);    fGroupMap->assign(*other.fGroupMap, fDeferredStatus);    //  Copy the Unicode Sets.      //    Could be made more efficient if the sets were reference counted and shared,    //    but I doubt that pattern copying will be particularly common.     //    Note:  init() already added an empty element zero to fSets    int32_t i;    int32_t  numSets = other.fSets->size();    fSets8 = new Regex8BitSet[numSets];    for (i=1; i<numSets; i++) {        if (U_FAILURE(fDeferredStatus)) {            return *this;        }        UnicodeSet *sourceSet = (UnicodeSet *)other.fSets->elementAt(i);        UnicodeSet *newSet    = new UnicodeSet(*sourceSet);        if (newSet == NULL) {            fDeferredStatus = U_MEMORY_ALLOCATION_ERROR;            break;        }        fSets->addElement(newSet, fDeferredStatus);        fSets8[i] = other.fSets8[i];    }    return *this;}
开发者ID:gitpan,项目名称:ponie,代码行数:60,



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


C++ zap_cursor_fini函数代码示例
C++ zalloc_cpumask_var函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。