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


C++ setMemory函数代码示例

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


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

示例1: SurfaceFlags

void QWSSharedMemSurface::setPermanentState(const QByteArray &data)
{
    int memId;
    int width;
    int height;
    int lockId;
    QImage::Format format;
    SurfaceFlags flags;

    const int *ptr = reinterpret_cast<const int*>(data.constData());

    memId = ptr[0];
    width = ptr[1];
    height = ptr[2];
    lockId = ptr[3];
    format = QImage::Format(ptr[4]);
    flags = SurfaceFlags(ptr[5]);

    setSurfaceFlags(flags);
    setMemory(memId);
    setLock(lockId);

#ifdef QT_QWS_CLIENTBLIT
    uchar *base = static_cast<uchar*>(mem.address()) + sizeof(uint);
#else
    uchar *base = static_cast<uchar*>(mem.address());
#endif
    const int bpl = nextMulOf4(bytesPerPixel(format) * width);
    QWSMemorySurface::img = QImage(base, width, height, bpl, format);
}
开发者ID:AlekSi,项目名称:phantomjs,代码行数:30,代码来源:qwindowsurface_qws.cpp

示例2: mutation_test

bool mutation_test()
{
	uint32 memory_temp[1] = {0x0ABBCFF1};
	setMemory(memory_temp, 1);
	uint32 result = kuuga(0);
	return (result == 0x0ABBCFF1);
}
开发者ID:jonathanrainer,项目名称:serial_processors_project,代码行数:7,代码来源:kuuga_testbench.cpp

示例3: generated_and_test

bool generated_and_test()
{
  uint32 mem_temp[87] =
      { 0x1384c004, 0x1304d008, 0x1405000c, 0x1344b010, 0x12c50014,
	  0x12c4b018, 0x1304c01c, 0x1344d020, 0x1104c024, 0x1304d028,
	  0x1585602c, 0x1344b030, 0x12c56034, 0x12c4b038, 0x1304c03c,
	  0x1344d040, 0x118500d8, 0x10c4c048, 0x1304d04c, 0x14451050,
	  0x1344b054, 0x12c51058, 0x12c4b05c, 0x1304c060, 0x1344d064,
	  0x1104c068, 0x1304d06c, 0x14852070, 0x1344b074, 0x12c52078,
	  0x12c4b07c, 0x1304c080, 0x1344d084, 0x14c47088, 0x11c5308c,
	  0x11c47090, 0x13c510c0, 0x13c520cc, 0x1184709c, 0x11c530a0,
	  0x11c470a4, 0x10c470a8, 0x11c430ac, 0x11c470b0, 0x110470b4,
	  0x11c440b8, 0x11c470bc, 0x11445040, 0x150540c4, 0x14454094,
	  0x150540a4, 0x154550d0, 0x14855098, 0x154550a4, 0x10c430dc,
	  0x14c4b0e0, 0x12c430e4, 0x12c4b0e8, 0x110440ec, 0x1584b0f0,
	  0x12c440f4, 0x12c4b0f8, 0x140500fc, 0x14451100, 0x14852104,
	  0x14c53108, 0x00000001, 0xCFFFFFFF, 0x0000025F, 0x00000000,
	  0x00000001, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
	  0x00000000, 0x00000000, 0x00000000, 0x00000021, 0x80000000,
	  0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
	  0x00000000, 0x00000000 };
  	setMemory(mem_temp, 87);
  	uint32 result = kuuga(67);
  	return (result == 0x25F && memory[68] == 0x25F);
}
开发者ID:jonathanrainer,项目名称:serial_processors_project,代码行数:25,代码来源:kuuga_testbench.cpp

示例4: generated_asr64_test

bool generated_asr64_test()
{
  uint32 mem_temp[93] =
      { 0x12c57004, 0x15c4a008, 0x15c5700c, 0x13858010, 0x16059014,
	  0x14050018, 0x1645a01c, 0x16850020, 0x1685a024, 0x16058028,
	  0x1645902c, 0x13058030, 0x16059034, 0x15856038, 0x1645a03c,
	  0x16856040, 0x1685a044, 0x16058048, 0x1645904c, 0x16c500e4,
	  0x12058054, 0x16059058, 0x1445105c, 0x1645a060, 0x16851064,
	  0x1685a068, 0x1605806c, 0x16459070, 0x13058074, 0x16059078,
	  0x1485207c, 0x1645a080, 0x16852084, 0x1685a088, 0x1605808c,
	  0x16459090, 0x14c57094, 0x15c53098, 0x15c5709c, 0x13c510cc,
	  0x13c520d8, 0x16c570a8, 0x15c530ac, 0x15c570b0, 0x120570b4,
	  0x15c480b8, 0x15c570bc, 0x130570c0, 0x15c4c0c4, 0x15c570c8,
	  0x1705c04c, 0x150540d0, 0x144540a0, 0x150540b0, 0x154550dc,
	  0x148550a4, 0x154550b0, 0x120480e8, 0x14c5a0ec, 0x168480f0,
	  0x1685a0f4, 0x1304c0f8, 0x1585a0fc, 0x1684c100, 0x1685a104,
	  0x14050108, 0x1445110c, 0x14852110, 0x14c53114, 0x00000001,
	  0x00000014, 0x00000022, 0x00000055, 0x00000750, 0x00000050,
	  0x00000008, 0x0000003f, 0x0000001F, 0x00000021, 0x80000000,
	  0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
	  0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
	  0x00000000, 0x00000001, 0x00000000 };
  setMemory(mem_temp, 93);
  kuuga(0);
  return (memory[72] == 0x15);

}
开发者ID:jonathanrainer,项目名称:serial_processors_project,代码行数:27,代码来源:kuuga_testbench.cpp

示例5: currentAssembly

/*
 * push命令
 * スタックフレーム + 現在のスタックポインタ + プッシュ回数分だけずらした位置にメモリを配置する。
 */
void VMDriver::_push(){
	size_t stackFrame = currentAssembly()->stackFrame();
	Memory& m = this->createOrGetMemory();
	Memory& set = getLocal( stackFrame + m_push + m_localAddr );
	m_push++;
	setMemory( set , m );
}
开发者ID:SenchaK,项目名称:ScriptEngine,代码行数:11,代码来源:vm_assembler.cpp

示例6: testCheckMem

void testCheckMem()	{

    GameProperties testGame;
    testGame = getGame(NULL);
    setMemory(0);
    addMemory(10);
    sput_fail_unless(checkMem(10,testGame) == 1,"boundary Testing enough memory");
    useMemory(testGame,10);
    sput_fail_unless(checkMem(50,testGame) == 0,"Testing not enough memory");
    addMemory(100);
    sput_fail_unless(checkMem(100,testGame) == 1,"Testing enough memory");
    setMemory(0);
    test_KillAnEnemy();
    sput_fail_unless(getAvailableMemory() > 0, "Valid: More memory available after killing an enemy");
    freeAllEnemies();
}
开发者ID:mtalu,项目名称:Bash_Defender_Group_Project,代码行数:16,代码来源:actionQueueDataStructure.c

示例7: stop_

Player::Player() :
  stop_(false)
#ifdef USE_HASH
  ,hash_(20)
  ,ehash_(20)
#endif
{
  setMemory(256);

  g_deltaPosCounter = new DeltaPosCounter;
  g_betweenMasks = new BetweenMask(g_deltaPosCounter);
  g_distanceCounter = new DistanceCounter;
  g_movesTable = new MovesTable;
  g_figureDir = new FigureDir;
  g_pawnMasks_ = new PawnMasks;

  for (int i = 0; i < sizeof(scontexts_)/sizeof(SearchContext); ++i)
  {
#ifdef USE_HASH
    scontexts_[i].eval_.initialize(&scontexts_[i].board_, &ehash_);
#else
    scontexts_[i].eval_.initialize(&scontexts_[i].board_, 0);
#endif

    scontexts_[i].board_.set_MovesTable(g_movesTable);
    scontexts_[i].board_.set_FigureDir(g_figureDir);
    scontexts_[i].board_.set_DeltaPosCounter(g_deltaPosCounter);
    scontexts_[i].board_.set_DistanceCounter(g_distanceCounter);
    scontexts_[i].board_.set_BetweenMask(g_betweenMasks);
    scontexts_[i].board_.set_PawnMasks(g_pawnMasks_);
  }
}
开发者ID:dimock,项目名称:chess,代码行数:32,代码来源:Player.cpp

示例8: switch

status_t BnQService::onTransact(
    uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{
    // IPC should be from mediaserver only
    IPCThreadState* ipc = IPCThreadState::self();
    const int callerPid = ipc->getCallingPid();
    const int callerUid = ipc->getCallingUid();

    const bool permission = (callerUid == AID_MEDIA);

    switch(code) {
        case CONNECT: {
            CHECK_INTERFACE(IQService, data, reply);

            sp<IQClient> client =
                interface_cast<IQClient>(data.readStrongBinder());
            connect(client);
            return NO_ERROR;
        } break;
		case SETMEM: {
            CHECK_INTERFACE(IQService, data, reply);

            sp<IMemory> sharedBuffer =
                interface_cast<IMemory>(data.readStrongBinder());
            setMemory(sharedBuffer);
            return NO_ERROR;
        } break;
        default:
            return BBinder::onTransact(code, data, reply, flags);
    }
}
开发者ID:yuguihu,项目名称:Binder_example,代码行数:31,代码来源:IQService.cpp

示例9: setMemory

/*
 * 否定演算
 */
void VMDriver::_not(){
	bool result = false;
	Memory& src = this->createOrGetMemory();
	if( src.value == 0 ){
		result = true;
	}
	setMemory( src , Memory( result , "" ) );
}
开发者ID:SenchaK,项目名称:ScriptEngine,代码行数:11,代码来源:vm_assembler.cpp

示例10: setMemory

int32_t OTPassword::setMemory(const OTData& data)
{
    const uint32_t dataSize = data.GetSize();
    uint32_t returnedSize = dataSize;

    bool memorySet = setMemory(data.GetPointer(), returnedSize);
    // TODO maybe we should check for truncation?
    return memorySet;
}
开发者ID:Kodachi75,项目名称:opentxs,代码行数:9,代码来源:OTPassword.cpp

示例11: generated_divu_test

bool generated_divu_test()
{
  uint32 mem_temp[7] =
      { 0x01805004, 0x00000001, 0x00000010, 0x00000025, 0x00000007,
	  0x80000000, 0x00000001 };
  	setMemory(mem_temp, 7);
  	kuuga(0);
  	return (memory[5] == 0x7FFFFFFF && memory[6] == 0x1);
}
开发者ID:jonathanrainer,项目名称:serial_processors_project,代码行数:9,代码来源:kuuga_testbench.cpp

示例12: generated_atoi_test

bool generated_atoi_test()
{
  uint32 mem_temp[9] =
      { 0x01c08004, 0x02004008, 0x0200800c, 0x00000001, 0x00000050,
	  0x00000020, 0x00000025, 0x00000010, 0x00000000 };
  	setMemory(mem_temp, 9);
  	kuuga(0);
  	return (memory[4] == 0x60 && memory[7] == 0x10);
}
开发者ID:jonathanrainer,项目名称:serial_processors_project,代码行数:9,代码来源:kuuga_testbench.cpp

示例13: generated_add_mp_test

bool generated_add_mp_test()
{
  uint32 mem_temp[7] =
      { 0x01406004, 0x01804008, 0x0180600c, 0x00000001, 0x00000020,
	  0x00000025, 0x00000000 };
  	setMemory(mem_temp, 7);
  	kuuga(0);
  	return (memory[4] == 0x45 && memory[5] == 0x25);
}
开发者ID:jonathanrainer,项目名称:serial_processors_project,代码行数:9,代码来源:kuuga_testbench.cpp

示例14: m_nPasswordSize

// ---------------------------------------------------------
OTPassword::OTPassword(const void * vInput, uint32_t nInputSize, OTPassword::BlockSize theBlockSize/*=DEFAULT_SIZE*/)
:	m_nPasswordSize(0),
    m_bIsText(false),
    m_bIsBinary(true),
    m_bIsPageLocked(false),
    m_theBlockSize(theBlockSize) // The buffer has this size+1 as its static size.
{
	setMemory(vInput, nInputSize);
}
开发者ID:Hangman-65,项目名称:Open-Transactions,代码行数:10,代码来源:OTPassword.cpp

示例15: subleq_test

bool subleq_test()
{
	uint32 mem_temp[4] = {
	     0x00803004, 0x00000001, 0x00000004, 0x00000005
	};
	setMemory(mem_temp, 4);
	uint32 result = kuuga(3);
	return (result == 0x00000001);
}
开发者ID:jonathanrainer,项目名称:serial_processors_project,代码行数:9,代码来源:kuuga_testbench.cpp


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