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

C++ popthenPush函数代码示例

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

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



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

示例1: primitiveSoundPlaySamples

primitiveSoundPlaySamples(void)
{
	// SoundPlugin>>#primitiveSoundPlaySamples
	unsigned *buf;
	sqInt frameCount;
	sqInt framesPlayed;
	sqInt startIndex;
	sqInt _return_value;

	frameCount = stackIntegerValue(2);
	success(isWords(stackValue(1)));
	buf = ((unsigned *) (firstIndexableField(stackValue(1))));
	startIndex = stackIntegerValue(0);
	if (failed()) {
		return null;
	}
	success((startIndex >= 1)
	 && (((startIndex + frameCount) - 1) <= (slotSizeOf(((sqInt)(long)(buf) - BaseHeaderSize)))));
	if (!(failed())) {
		framesPlayed = snd_PlaySamplesFromAtLength(frameCount, (void *)buf, startIndex - 1);
		success(framesPlayed >= 0);
	}
	_return_value = positive32BitIntegerFor(framesPlayed);
	if (failed()) {
		return null;
	}
	popthenPush(4, _return_value);
	return null;
}
开发者ID:JeanBaptisteArnaud,项目名称:synologyPharo,代码行数:29,代码来源:SoundPlugin.c


示例2: primitiveErrorAndLog

primitiveErrorAndLog(void)
{
	char *log;
	sqInt logLen;
	sqInt logObj;
	char *logObjData;
	sqInt resultObj;

	logLen = 0;
	log = getlog((&logLen));
	resultObj = instantiateClassindexableSize(classArray(), 2);
	if (resultObj == 0) {
		primitiveFailFor(PrimErrNoMemory);
		return null;
	}
	storePointerofObjectwithValue(0, resultObj, integerObjectOf(errorAcorn()));
	if (logLen > 0) {
		pushRemappableOop(resultObj);
		logObj = instantiateClassindexableSize(classString(), logLen);
		if (failed()) {
			popRemappableOop();
			primitiveFailFor(PrimErrNoMemory);
			return null;
		}
		resultObj = popRemappableOop();
		logObjData = arrayValueOf(logObj);
		memcpy(logObjData, log, logLen);
		storePointerofObjectwithValue(1, resultObj, logObj);
	}
	popthenPush(1, resultObj);
	if (failed()) {
		return null;
	}
	return null;
}
开发者ID:johnnyzz,项目名称:pharo-vm,代码行数:35,代码来源:GdbARMPlugin.c


示例3: primitiveGetMacintoshFileTypeAndCreatorFrom

primitiveGetMacintoshFileTypeAndCreatorFrom(void)
{
	char *aFileName;
	char creator[8];
	sqInt i;
	sqInt keyLength;
	sqInt oop;
	char *ptr;

	success(isBytes(stackValue(0)));
	aFileName = ((char *) (firstIndexableField(stackValue(0))));
	if (failed()) {
		return null;
	}
	keyLength = byteSizeOf(((sqInt)(sqIntptr_t)(aFileName) - BaseHeaderSize));
	sqInternetGetMacintoshFileTypeAndCreatorFromkeySizeinto(aFileName, keyLength, creator);
	oop = instantiateClassindexableSize(classString(), 8);
	ptr = firstIndexableField(oop);
	for (i = 0; i <= 7; i += 1) {
		ptr[i] = (creator[i]);
	}
	if (failed()) {
		return null;
	}
	popthenPush(2, oop);
	return null;
}
开发者ID:estebanlm,项目名称:pharo-vm,代码行数:27,代码来源:InternetConfigPlugin.c


示例4: primitiveResetCPU

primitiveResetCPU(void)
{
	void *cpu;
	sqInt cpuAlien;
	sqInt maybeErr;

	cpuAlien = stackValue(0);
	if (failed()) {
		return null;
	}
	if (((cpu = ((longAt(cpuAlien + BaseHeaderSize)) > 0
		? (cpuAlien + BaseHeaderSize) + BytesPerOop
		: longAt((cpuAlien + BaseHeaderSize) + BytesPerOop)))) == 0) {
		primitiveFailFor(PrimErrBadReceiver);
		return null;
	}
	maybeErr = resetCPU(cpu);
	if (maybeErr != 0) {
		primitiveFailFor(PrimErrInappropriate);
		return null;
	}
	if (failed()) {
		return null;
	}
	popthenPush(1, cpuAlien);
	return null;
}
开发者ID:johnnyzz,项目名称:pharo-vm,代码行数:27,代码来源:GdbARMPlugin.c


示例5: primitiveAtPut

primitiveAtPut(void)
{
    float *floatPtr;
    double floatValue;
    sqInt index;
    sqInt rcvr;
    sqInt value;

	value = stackValue(0);
	if (isIntegerObject(value)) {
		floatValue = ((double) (integerValueOf(value)) );
	}
	else {
		floatValue = floatValueOf(value);
	}
	index = stackIntegerValue(1);
	rcvr = stackValue(2);
	if (!((!(failed()))
		 && ((isWords(rcvr))
		 && ((index > 0)
		 && (index <= (slotSizeOf(rcvr))))))) {
		return primitiveFail();
	}
	floatPtr = firstIndexableField(rcvr);
	floatPtr[index - 1] = (((float) floatValue));
	popthenPush(3, value);
	return 0;
}
开发者ID:johnnyzz,项目名称:pharo-vm,代码行数:28,代码来源:FloatArrayPlugin.c


示例6: primitiveSerialPortRead

primitiveSerialPortRead(void)
{
	// SerialPlugin>>#primitiveSerialPortRead
	char *array;
	sqInt arrayPtr;
	sqInt bytesRead;
	sqInt count;
	sqInt portNum;
	sqInt startIndex;
	sqInt _return_value;

	portNum = stackIntegerValue(3);
	success(isBytes(stackValue(2)));
	array = ((char *) (firstIndexableField(stackValue(2))));
	startIndex = stackIntegerValue(1);
	count = stackIntegerValue(0);
	if (failed()) {
		return null;
	}
	success((startIndex >= 1)
	 && (((startIndex + count) - 1) <= (byteSizeOf(((sqInt)(long)(array) - 4)))));
	arrayPtr = ((((sqInt)array)) + startIndex) - 1;
	bytesRead = serialPortReadInto( portNum, count, arrayPtr);
	_return_value = integerObjectOf(bytesRead);
	if (failed()) {
		return null;
	}
	popthenPush(5, _return_value);
	return null;
}
开发者ID:JeanBaptisteArnaud,项目名称:RaspLocalDebug,代码行数:30,代码来源:SerialPlugin.c


示例7: primitiveSerialPortWrite

primitiveSerialPortWrite(void)
{
	char *array;
	char * arrayPtr;
	sqInt bytesWritten;
	sqInt count;
	sqInt portNum;
	sqInt startIndex;
	sqInt _return_value;

	bytesWritten = 0;
	portNum = stackIntegerValue(3);
	success(isBytes(stackValue(2)));
	array = ((char *) (firstIndexableField(stackValue(2))));
	startIndex = stackIntegerValue(1);
	count = stackIntegerValue(0);
	if (failed()) {
		return null;
	}
	success((startIndex >= 1)
	 && (((startIndex + count) - 1) <= (byteSizeOf(((sqInt)(sqIntptr_t)(array) - BaseHeaderSize)))));
	if (!(failed())) {
		arrayPtr = (array + startIndex) - 1;
		bytesWritten = serialPortWriteFrom(portNum, count, arrayPtr);
	}
	if (failed()) {
		return null;
	}
	_return_value = integerObjectOf(bytesWritten);
	popthenPush(5, _return_value);
	return null;
}
开发者ID:johnnyzz,项目名称:pharo-vm,代码行数:32,代码来源:SerialPlugin.c


示例8: primitiveSoundInsertSamples

primitiveSoundInsertSamples(void)
{
	// SoundPlugin>>#primitiveSoundInsertSamples
	unsigned *buf;
	sqInt frameCount;
	sqInt framesPlayed;
	sqInt leadTime;
	sqInt _return_value;

	frameCount = stackIntegerValue(2);
	success(isWords(stackValue(1)));
	buf = ((unsigned *) (firstIndexableField(stackValue(1))));
	leadTime = stackIntegerValue(0);
	if (failed()) {
		return null;
	}
	success(frameCount <= (slotSizeOf(((sqInt)(long)(buf) - BaseHeaderSize))));
	if (!(failed())) {
		framesPlayed = snd_InsertSamplesFromLeadTime(frameCount, (void *)buf, leadTime);
		success(framesPlayed >= 0);
	}
	_return_value = positive32BitIntegerFor(framesPlayed);
	if (failed()) {
		return null;
	}
	popthenPush(4, _return_value);
	return null;
}
开发者ID:JeanBaptisteArnaud,项目名称:synologyPharo,代码行数:28,代码来源:SoundPlugin.c


示例9: primitiveSum

primitiveSum(void)
{
	// FloatArrayPlugin>>#primitiveSum
    sqInt i;
    sqInt length;
    sqInt rcvr;
    float *rcvrPtr;
    double  sum;

	rcvr = stackObjectValue(0);
	if (failed()) {
		return null;
	}
	success(isWords(rcvr));
	if (failed()) {
		return null;
	}
	length = stSizeOf(rcvr);
	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
	sum = 0.0;
	for (i = 0; i <= (length - 1); i += 1) {
		sum += ((double) (rcvrPtr[i]));
	}
	popthenPush(1, floatObjectOf(sum));
}
开发者ID:JeanBaptisteArnaud,项目名称:RaspLocalDebug,代码行数:25,代码来源:FloatArrayPlugin.c


示例10: primitiveLength

primitiveLength(void)
{
	// FloatArrayPlugin>>#primitiveLength
    sqInt i;
    sqInt length;
    sqInt rcvr;
    float *rcvrPtr;
    double  result;

	rcvr = stackObjectValue(0);
	if (failed()) {
		return null;
	}
	success(isWords(rcvr));
	if (failed()) {
		return null;
	}
	length = stSizeOf(rcvr);
	success(1);
	rcvrPtr = ((float *) (firstIndexableField(rcvr)));
	result = 0.0;
	for (i = 0; i <= (length - 1); i += 1) {
		result += (((double) (rcvrPtr[i]))) * (((double) (rcvrPtr[i])));
	}
	result = sqrt(result);
	popthenPush(1, floatObjectOf(result));
}
开发者ID:JeanBaptisteArnaud,项目名称:RaspLocalDebug,代码行数:27,代码来源:FloatArrayPlugin.c


示例11: primitiveAtPut

primitiveAtPut(void)
{
	// FloatArrayPlugin>>#primitiveAtPut
    float *floatPtr;
    double  floatValue;
    sqInt index;
    sqInt rcvr;
    sqInt value;

	value = stackValue(0);
	if (isIntegerObject(value)) {
		floatValue = ((double) (integerValueOf(value)) );
	}
	else {
floatValue = floatValueOf(value);
	}
	index = stackIntegerValue(1);
	rcvr = stackObjectValue(2);
	if (failed()) {
		return null;
	}
	success(isWords(rcvr));
	success((index > 0)
	 && (index <= (slotSizeOf(rcvr))));
	if (failed()) {
		return null;
	}
	floatPtr = firstIndexableField(rcvr);
	floatPtr[index - 1] = (((float) floatValue));
	if (!(failed())) {
		popthenPush(3, value);
	}
}
开发者ID:JeanBaptisteArnaud,项目名称:RaspLocalDebug,代码行数:33,代码来源:FloatArrayPlugin.c


示例12: primitiveGetStringKeyedBy

primitiveGetStringKeyedBy(void)
{
	char *aKey;
	char aString[1025];
	sqInt i;
	sqInt keyLength;
	sqInt oop;
	char *ptr;
	sqInt size;

	success(isBytes(stackValue(0)));
	aKey = ((char *) (firstIndexableField(stackValue(0))));
	if (failed()) {
		return null;
	}
	keyLength = byteSizeOf(((sqInt)(sqIntptr_t)(aKey) - BaseHeaderSize));
	size = sqInternetConfigurationGetStringKeyedBykeySizeinto(aKey, keyLength, aString);
	oop = instantiateClassindexableSize(classString(), size);
	ptr = firstIndexableField(oop);
	for (i = 0; i < size; i += 1) {
		ptr[i] = (aString[i]);
	}
	if (failed()) {
		return null;
	}
	popthenPush(2, oop);
	return null;
}
开发者ID:estebanlm,项目名称:pharo-vm,代码行数:28,代码来源:InternetConfigPlugin.c


示例13: primitiveVMOffsetToUTC

primitiveVMOffsetToUTC(void)
{
	sqInt _return_value;

	_return_value = integerObjectOf((sqLocGetVMOffsetToUTC()));
	popthenPush(1, _return_value);
	return null;
}
开发者ID:estebanlm,项目名称:pharo-vm,代码行数:8,代码来源:LocalePlugin.c


示例14: primitiveTimezoneOffset

primitiveTimezoneOffset(void)
{
	sqInt _return_value;

	_return_value = integerObjectOf((sqLocGetTimezoneOffset()));
	popthenPush(1, _return_value);
	return null;
}
开发者ID:estebanlm,项目名称:pharo-vm,代码行数:8,代码来源:LocalePlugin.c


示例15: primitiveDisassembleAtInMemory

primitiveDisassembleAtInMemory(void)
{
	usqIntptr_t address;
	void *cpu;
	sqInt cpuAlien;
	sqInt instrLenOrErr;
	sqInt log;
	sqInt logLen;
	sqInt logObj;
	sqInt logObjData;
	char *memory;
	sqInt resultObj;

	logLen = 0;
	address = (BytesPerOop == 4
		? positive32BitValueOf(stackValue(1))
		: positive64BitValueOf(stackValue(1)));
	success(isWordsOrBytes(stackValue(0)));
	memory = ((char *) (firstIndexableField(stackValue(0))));
	cpuAlien = stackValue(2);
	if (failed()) {
		return null;
	}
	if (((cpu = ((longAt(cpuAlien + BaseHeaderSize)) > 0
		? (cpuAlien + BaseHeaderSize) + BytesPerOop
		: longAt((cpuAlien + BaseHeaderSize) + BytesPerOop)))) == 0) {
		primitiveFailFor(PrimErrBadReceiver);
		return null;
	}
	instrLenOrErr = disassembleForAtInSize(cpu, address, memory, byteSizeOf(((sqInt)(sqIntptr_t)(memory) - BaseHeaderSize)));
	if (instrLenOrErr < 0) {
		primitiveFailFor(PrimErrInappropriate);
		return null;
	}
	log = getlog((&logLen));
	resultObj = instantiateClassindexableSize(classArray(), 2);
	if (resultObj == 0) {
		primitiveFailFor(PrimErrNoMemory);
		return null;
	}
	pushRemappableOop(resultObj);
	logObj = instantiateClassindexableSize(classString(), logLen);
	if (failed()) {
		popRemappableOop();
		primitiveFailFor(PrimErrNoMemory);
		return null;
	}
	logObjData = arrayValueOf(logObj);
	memcpy(logObjData, log, logLen);
	resultObj = popRemappableOop();
	storePointerofObjectwithValue(0, resultObj, integerObjectOf(instrLenOrErr));
	storePointerofObjectwithValue(1, resultObj, logObj);
	if (failed()) {
		return null;
	}
	popthenPush(3, resultObj);
	return null;
}
开发者ID:johnnyzz,项目名称:pharo-vm,代码行数:58,代码来源:GdbARMPlugin.c


示例16: primitiveGSMNewState

primitiveGSMNewState(void)
{
    sqInt state;

	state = instantiateClassindexableSize(classByteArray(), gsmStateBytes());
	gsmInitState(state + BaseHeaderSize);
	popthenPush(1, state);
	return 0;
}
开发者ID:estebanlm,项目名称:opensmalltalk-vm,代码行数:9,代码来源:SoundCodecPrims.c


示例17: primitiveAsyncFileReadResult

primitiveAsyncFileReadResult(void)
{
	// AsynchFilePlugin>>#primitiveAsyncFileReadResult
	sqInt buffer;
	sqInt bufferPtr;
	sqInt bufferSize;
	sqInt count;
	AsyncFile *f;
	sqInt fhandle;
	sqInt num;
	sqInt r;
	sqInt start;
	sqInt startIndex;
	sqInt _return_value;

	fhandle = stackValue(3);
	buffer = stackValue(2);
	start = stackIntegerValue(1);
	num = stackIntegerValue(0);
	if (failed()) {
		return null;
	}
	f = asyncFileValueOf(fhandle);
	count = num;
	startIndex = start;

	/* in bytes or words */

bufferSize = slotSizeOf(buffer);
	if (isWords(buffer)) {

		/* covert word counts to byte counts */


		/* covert word counts to byte counts */

count = count * 4;
		startIndex = ((startIndex - 1) * 4) + 1;
		bufferSize = bufferSize * 4;
	}
	success((startIndex >= 1)
	 && (((startIndex + count) - 1) <= bufferSize));

	/* adjust for zero-origin indexing */

bufferPtr = ((((int) (firstIndexableField(buffer)))) + startIndex) - 1;
	if (!(failed())) {
		r = asyncFileReadResult(f, bufferPtr, count);
	}
	_return_value = integerObjectOf(r);
	if (failed()) {
		return null;
	}
	popthenPush(5, _return_value);
	return null;
}
开发者ID:JeanBaptisteArnaud,项目名称:RaspLocalDebug,代码行数:56,代码来源:AsynchFilePlugin.c


示例18: primitiveDirectoryDelimitor

primitiveDirectoryDelimitor(void)
{
	// FilePlugin>>#primitiveDirectoryDelimitor
    sqInt ascii;

	ascii = asciiDirectoryDelimiter();
	if ((interpreterProxy->minorVersion()) >= 13) {
		popthenPush(1, characterObjectOf(ascii));
	}
	else {
if ((ascii >= 0)
		 && (ascii <= 0xFF)) {
			popthenPush(1, fetchPointerofObject(ascii, characterTable()));
		}
		else {
primitiveFail();
		}
	}
}
开发者ID:JeanBaptisteArnaud,项目名称:synologyPharo,代码行数:19,代码来源:FilePlugin.c


示例19: primPCRECompile

primPCRECompile(void)
{
	/* begin loadRcvrFromStackAt: */
	rcvr = stackObjectValue(0);
	patternStrPtr = ((char *) (fetchArrayofObject(0, rcvr)));
	compileFlags = fetchIntegerofObject(1, rcvr);
	if (failed()) {
		return null;
	}
	pcrePtr = (sqInt) pcre_compile(patternStrPtr, compileFlags, &errorStrBuffer, &errorOffset, NULL);
	if (pcrePtr) {
		allocateByteArrayAndSetRcvrPCREPtrFromPCRE(pcrePtr);
		extraPtr = (sqInt) pcre_study((pcre *)pcrePtr, compileFlags, &errorStrBuffer);
		allocateByteArrayAndSetRcvrExtraPtrFrom(extraPtr);
		/* begin rePluginFree: */
		numFrees += 1;
		if ((((void *)pcrePtr)) != null) {
			free(((void *)pcrePtr));
		}
		if (extraPtr) {
			/* begin rePluginFree: */
			numFrees += 1;
			if ((((void *)extraPtr)) != null) {
				free(((void *)extraPtr));
			}
		}
		if (failed()) {
			return null;
		}
		popthenPush(1, nilObject());
	}
	else {
		errorStr = allocateStringAndSetRcvrErrorStrFromCStr(errorStrBuffer);
		/* begin rcvrErrorOffsetFrom: */
		storeIntegerofObjectwithValue(5, rcvr, errorOffset);
		if (failed()) {
			return null;
		}
		popthenPush(1, errorStr);
	}
	return 0;
}
开发者ID:estebanlm,项目名称:pharo-vm,代码行数:42,代码来源:RePlugin.c


示例20: primitiveCurrencyNotation

primitiveCurrencyNotation(void)
{
	sqInt _return_value;

	_return_value = (((sqLocCurrencyNotation())) ? trueObject() : falseObject());
	if (failed()) {
		return null;
	}
	popthenPush(1, _return_value);
	return null;
}
开发者ID:estebanlm,项目名称:pharo-vm,代码行数:11,代码来源:LocalePlugin.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ populate函数代码示例发布时间:2022-05-30
下一篇:
C++ poptab函数代码示例发布时间: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