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


C++ popthenPush函数代码示例

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


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


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