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

C++ prg函数代码示例

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

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



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

示例1: doprof1

void
doprof1(void)
{
#if 0
	Sym *s;
	int32 n;
	Prog *p, *q;

	if(debug['v'])
		Bprint(&bso, "%5.2f profile 1\n", cputime());
	Bflush(&bso);
	s = lookup("__mcount", 0);
	n = 1;
	for(cursym = textp; cursym != nil; cursym = cursym->next) {
		p = cursym->text;
		q = prg();
		q->line = p->line;
		q->link = datap;
		datap = q;
		q->as = ADATA;
		q->from.type = D_EXTERN;
		q->from.offset = n*4;
		q->from.sym = s;
		q->from.scale = 4;
		q->to = p->from;
		q->to.type = D_CONST;

		q = prg();
		q->line = p->line;
		q->pc = p->pc;
		q->link = p->link;
		p->link = q;
		p = q;
		p->as = AADDL;
		p->from.type = D_CONST;
		p->from.offset = 1;
		p->to.type = D_EXTERN;
		p->to.sym = s;
		p->to.offset = n*4 + 4;

		n += 2;
	}
	q = prg();
	q->line = 0;
	q->link = datap;
	datap = q;

	q->as = ADATA;
	q->from.type = D_EXTERN;
	q->from.sym = s;
	q->from.scale = 4;
	q->to.type = D_CONST;
	q->to.offset = n;

	s->type = SBSS;
	s->size = n*4;
#endif
}
开发者ID:Ahmah2009,项目名称:golang,代码行数:58,代码来源:prof.c


示例2: py_glIsProgram

static PyObject* py_glIsProgram(PyObject *, PyObject *args) {
  CHECK_ARG_COUNT(args, 1);
  Uint prg(PyTuple_GetItem(args, 0));
  PyObject *rv = (glIsProgram(prg) == GL_TRUE ? Py_True : Py_False);
  Py_INCREF(rv);
  return rv;
}
开发者ID:gatgui,项目名称:pygl,代码行数:7,代码来源:gl_2_0.cpp


示例3: testSingleFact

	void testSingleFact() {
		std::stringstream prg("1 1 0 0 \n0\n1 a\n0\nB+\n0\nB-\n0\n1\n");
		CPPUNIT_ASSERT_EQUAL(true, parseLparse(prg, api));
		api.endProgram();
		CPPUNIT_ASSERT_EQUAL(0u, ctx.numVars());
		CPPUNIT_ASSERT_EQUAL('a', ctx.symTab()[1].name[0]);
	}
开发者ID:domoritz,项目名称:clasp-pb,代码行数:7,代码来源:lparse_reader_test.cpp


示例4: prg

bool SociContainer::begin(void)
{
	mRecordCount = 0;
	Progress prg("Open database", "Connecting ...");
	prg->setMaximum(prg->maximum()+2);

	if(!getSession())
	{
		prg->setValue(prg->value()+2);
		ErrorMessage(spt::logging::LoggingItem::LOG_ERROR, MODULENAME, "Unable to open database.");
		return false;
	}
	prg->setValue(prg->value()+1);
	if(isReader())
	{
		if(!prepareStatement(selectorToQuery()))
			return false;
	}
	prg->setValue(prg->value()+1);


	if(mSQLToFile)
	{
		mSQLFile.open(mSQLFilename, std::ios::out | std::ios::trunc);
		if(!mSQLFile.is_open())
		{
			ErrorMessage(spt::logging::LoggingItem::LOG_ERROR, MODULENAME, StdString("Unable to open the file: ")+mSQLFilename);
			return false;
		}
	}

	return true;
}
开发者ID:skeetor,项目名称:datinator,代码行数:33,代码来源:soci_container.cpp


示例5: updateObjectsInList

void CMtbRobotDialog::refresh()
{
	inRefreshRoutine=true;
	// Get handle of last selected object:
	int lastSel=simGetObjectLastSelection();

	updateObjectsInList();

	// Now initialized other dialog elements:
	CMtbRobot* taggedObj=NULL;
	ui->qqRobotProgram->setPlainText("");

	ui->qqAutomatic->setChecked(false);
	if (lastSel!=-1)
	{
		taggedObj=CAccess::mtbRobotContainer->getFromAssociatedObject(lastSel);
		if (taggedObj==NULL)
			selectObjectInList(-1);
		else
		{ // The last selected object is the base object of a MTB model!
			selectObjectInList(taggedObj->getID());
			std::string prg(taggedObj->getProgram());
			ui->qqRobotProgram->setPlainText(prg.c_str());
			ui->qqAutomatic->setChecked((taggedObj->getOptions()&1)!=0);
		}
	}
	else
		selectObjectInList(-1);
	ui->qqRobotProgram->setEnabled((taggedObj!=NULL)&&(simGetSimulationState()==sim_simulation_stopped));
	ui->qqAutomatic->setEnabled((taggedObj!=NULL)&&(simGetSimulationState()==sim_simulation_stopped));
	inRefreshRoutine=false;
}
开发者ID:ehsan1384,项目名称:Vrep,代码行数:32,代码来源:mtbrobotdialog.cpp


示例6: RETURN_ERR

blargg_err_t Nes_Cart::load_ines( Auto_File_Reader in )
{
	RETURN_ERR( in.open() );
	
	ines_header_t h;
	RETURN_ERR( in->read( &h, sizeof h ) );
	
	if ( 0 != memcmp( h.signature, "NES\x1A", 4 ) )
		return not_ines_file;
	
	if ( h.zero [7] ) // handle header defaced by a fucking idiot's handle
		h.flags2 = 0;
	
	set_mapper( h.flags, h.flags2 );
	
	if ( h.flags & 0x04 ) // skip trainer
		RETURN_ERR( in->skip( 512 ) );
	
	RETURN_ERR( resize_prg( h.prg_count * 16 * 1024L ) );
	RETURN_ERR( resize_chr( h.chr_count * 8 * 1024L ) );
	
	RETURN_ERR( in->read( prg(), prg_size() ) );
	RETURN_ERR( in->read( chr(), chr_size() ) );
	
	return 0;
}
开发者ID:Bindernews,项目名称:HeadlessQuickNes,代码行数:26,代码来源:Nes_Cart.cpp


示例7: UNUSED

void SociContainer::handleNotification(Dispatcher<SQLPreview::ActionEvent, QVariant, int> *oSource, SQLPreview::ActionEvent nEvent, QVariant oData, int nRows)
{
	UNUSED(oSource);

	Progress prg("Fetch columns...");
	StdString query;

	if(nEvent == SQLPreview::ActionEvent::EVENT_SQL_EXECUTE)
	{
		setTablename("");
		query = oData.value<StdString>();
		mPreviewLimit = nRows;
		setQuery(query);
		refreshPreview(query, mPreviewLimit);
	}
	else if(nEvent == SQLPreview::ActionEvent::EVENT_SQL_TOGGLE)
	{
		bool enabled = oData.value<bool>();
		if(enabled)
		{
			setTablename("");
			mPreviewLimit = mPreviewPanel->getPreviewLimit();
			query = mPreviewPanel->getQuery();
			setQuery(query);
			refreshPreview(query, mPreviewLimit);
		}
	}
}
开发者ID:skeetor,项目名称:datinator,代码行数:28,代码来源:soci_container.cpp


示例8: py_glGetVertexAttribPointer

static PyObject* py_glGetVertexAttribPointer(PyObject *, PyObject *args) {
  CHECK_ARG_COUNT(args, 2);
  Uint prg(PyTuple_GetItem(args, 0));
  Enum param(PyTuple_GetItem(args, 1));
  GLvoid *ptr = 0;
  glGetVertexAttribPointerv(prg, param, &ptr);
  return PyCObject_FromVoidPtr(ptr, NULL);
}
开发者ID:gatgui,项目名称:pygl,代码行数:8,代码来源:gl_2_0.cpp


示例9: copyp

Prog*
copyp(Prog *q)
{
	Prog *p;

	p = prg();
	*p = *q;
	return p;
}
开发者ID:machinaut,项目名称:go,代码行数:9,代码来源:obj.c


示例10: py_glGetProgramInfoLog

static PyObject* py_glGetProgramInfoLog(PyObject *, PyObject *args) {
  CHECK_ARG_COUNT(args, 1);
  Uint prg(PyTuple_GetItem(args, 0));
  GLint len=0;
  glGetProgramiv(prg, GL_INFO_LOG_LENGTH, &len);
  //GLchar *log = new GLchar[len+1];
  Array1D<Char> log(len+1);
  glGetProgramInfoLog(prg, len, NULL, log);
  return PyString_FromString(log);
  //delete[] log;
}
开发者ID:gatgui,项目名称:pygl,代码行数:11,代码来源:gl_2_0.cpp


示例11: appendp

Prog*
appendp(Prog *q)
{
	Prog *p;

	p = prg();
	p->link = q->link;
	q->link = p;
	p->line = q->line;
	return p;
}
开发者ID:machinaut,项目名称:go,代码行数:11,代码来源:obj.c


示例12: byteq

Prog*
byteq(int v)
{
	Prog *p;

	p = prg();
	p->as = ABYTE;
	p->from.type = D_CONST;
	p->from.offset = v&0xff;
	return p;
}
开发者ID:krasin,项目名称:go-deflate,代码行数:11,代码来源:pass.c


示例13: py_glGetAttachedShaders

static PyObject* py_glGetAttachedShaders(PyObject *, PyObject *args) {
  CHECK_ARG_COUNT(args, 1);
  Uint prg(PyTuple_GetItem(args, 0));
  GLint count=0;
  glGetProgramiv(prg, GL_ATTACHED_SHADERS, &count);
  if (count == 0) {
    return PyList_New(0);
  } else {
    Array1D<Uint> shaders(count);
    glGetAttachedShaders(prg, count, NULL, shaders);
    return shaders.toPy();
  }
}
开发者ID:gatgui,项目名称:pygl,代码行数:13,代码来源:gl_2_0.cpp


示例14: follow

void
follow(void)
{

    if(debug['v'])
        Bprint(&bso, "%5.2f follow\n", cputime());
    Bflush(&bso);
    firstp = prg();
    lastp = firstp;
    xfol(textp);
    lastp->link = P;
    firstp = firstp->link;
}
开发者ID:99years,项目名称:plan9,代码行数:13,代码来源:pass.c


示例15: clCreateProgramWithSource

CLWProgram CLWProgram::CreateFromSource(char const* sourcecode, size_t sourcesize, CLWContext context)
{
    cl_int status = CL_SUCCESS;
    
    cl_program program = clCreateProgramWithSource(context, 1, (const char**)&sourcecode, &sourcesize, &status);
    
    ThrowIf(status != CL_SUCCESS, status, "clCreateProgramWithSource failed");
    
    std::vector<cl_device_id> deviceIds(context.GetDeviceCount());
    for(unsigned int i = 0; i < context.GetDeviceCount(); ++i)
    {
        deviceIds[i] = context.GetDevice(i);
    }

    char const* buildopts = 
#if defined(__APPLE__)
        "-D APPLE -cl-mad-enable -cl-fast-relaxed-math -cl-std=CL1.2 -I ."
#elif defined(_WIN32) || defined (WIN32)
        "-D WIN32 -cl-mad-enable -cl-std=CL1.2 -I."
#elif defined(__linux__)
        "-D __linux__ -I."
#else
        nullptr
#endif
        ;

    status = clBuildProgram(program, context.GetDeviceCount(), &deviceIds[0], buildopts, nullptr, nullptr);

    if(status != CL_SUCCESS)
    {
        std::vector<char> buildLog;
        size_t logSize;
        clGetProgramBuildInfo(program, deviceIds[0], CL_PROGRAM_BUILD_LOG, 0, nullptr, &logSize);

        buildLog.resize(logSize);
        clGetProgramBuildInfo(program, deviceIds[0], CL_PROGRAM_BUILD_LOG, logSize, &buildLog[0], nullptr);
        
#ifdef _DEBUG
        std::cout << &buildLog[0] << "\n";
#endif
        
        throw CLWException(status, std::string(&buildLog[0]));
    }
    
    CLWProgram prg(program);
    
    clReleaseProgram(program);

    return prg;
}
开发者ID:biofag,项目名称:FireRays_SDK,代码行数:50,代码来源:CLWProgram.cpp


示例16: addnop

void
addnop(Prog *p)
{
	Prog *q;

	q = prg();
	q->as = ANOR;
	q->line = p->line;
	q->from.type = D_REG;
	q->from.reg = REGZERO;
	q->to.type = D_REG;
	q->to.reg = REGZERO;

	q->link = p->link;
	p->link = q;
}
开发者ID:AustenConrad,项目名称:plan-9,代码行数:16,代码来源:noop.c


示例17: follow

void
follow(void)
{
	Prog *firstp, *lastp;

	if(debug['v'])
		Bprint(&bso, "%5.2f follow\n", cputime());
	Bflush(&bso);
	
	for(cursym = textp; cursym != nil; cursym = cursym->next) {
		firstp = prg();
		lastp = firstp;
		xfol(cursym->text, &lastp);
		lastp->link = nil;
		cursym->text = firstp->link;
	}
}
开发者ID:pipul,项目名称:lab,代码行数:17,代码来源:pass.c


示例18: getConnectString

bool SociContainer::connect(StdString const &oConnectString)
{
	StdString con = getConnectString();

	if(oConnectString.length() > 0)
	{
		if(con != oConnectString)
		{
			disconnect();
			con = oConnectString;
		}
	}

	if(mSession != NULL) // Same connect string and session already exists.
		return true;

	if(con.length() == 0)
		return false;

	setConnectString(con);

	bool rc = true;
	Progress prg("Connecting to database");
	prg->setLabelText("Connecting to database ...");
	prg->setMaximum(prg->maximum()+1);

	QApplication::processEvents();
	StdString connectStr = sociConnectString(con);

	try
	{
		mSession = new soci::session(sociFactory(), connectStr);
		mSociConnectString = connectStr;
		refreshTables();
	}
	catch(std::runtime_error const &e)
	{
		mSociConnectString = "";
		ErrorMessage(spt::logging::LoggingItem::LOG_ERROR, MODULENAME, e.what());
		rc = false;
	}
	prg->setValue(prg->value()+1);

	return rc;
}
开发者ID:skeetor,项目名称:datinator,代码行数:45,代码来源:soci_container.cpp


示例19: prg

/**
 * Public function which begins the parsing
 */
void RecursiveDescentParser::start() {
	token = scanner->getToken();
	prg();

#if DEBUG_PARSER
	if(errorCondition) {
		std::cout << "Parsing did not complete successfully." << std::endl;
	} else {
		std::cout << "Parsing completed successfully!" << std::endl;
	}
#endif
	
	if( errorCount == 0 ) { // don't attempt to generate target code unless everything went well
		codeGenerator->setCharacterConsts( litTab.getCharacterConstants() );
		codeGenerator->setNumericalConsts( litTab.getNumericalConstants() );
		codeGenerator->generateTargetCode();
	}
}
开发者ID:abrunet,项目名称:quiz-manager-0d,代码行数:21,代码来源:RecursiveDescentParser.cpp


示例20: py_glGetActiveUniform

static PyObject* py_glGetActiveUniform(PyObject *, PyObject *args) {
  CHECK_ARG_COUNT(args, 2);
  Uint prg(PyTuple_GetItem(args, 0));
  Uint idx(PyTuple_GetItem(args, 1));
  GLint len = 0;
  glGetProgramiv(prg, GL_ACTIVE_UNIFORM_MAX_LENGTH, &len);
  //GLchar *name = new GLchar[len+1];
  Array1D<Char> name(len+1);
  GLint size;
  GLenum type;
  glGetActiveUniform(prg, idx, len, NULL, &size, &type, name);
  PyObject *rv = PyTuple_New(3);
  PyTuple_SetItem(rv, 0, PyInt_FromLong(size));
  PyTuple_SetItem(rv, 1, PyInt_FromLong(type));
  PyTuple_SetItem(rv, 2, PyString_FromString(name));
  //delete[] name;
  return rv;
}
开发者ID:gatgui,项目名称:pygl,代码行数:18,代码来源:gl_2_0.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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