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

C++ CheckInit函数代码示例

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

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



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

示例1: yflash_WriteChunkWithTagsToNAND

int yflash_WriteChunkWithTagsToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data, yaffs_ExtendedTags *tags)
{
	int blk;
	int pg;
	

	CheckInit(dev);
	
	blk = chunkInNAND/32;
	pg = chunkInNAND%32;
	
	
	if(data)
	{
		memcpy(ramdisk.block[blk]->page[pg].data,data,512);
	}
	
	
	if(tags)
	{
		yaffs_PackedTags pt;
		yaffs_PackTags(&pt,tags);
		memcpy(&ramdisk.block[blk]->page[pg].data[512],&pt,sizeof(pt));
	}

	return YAFFS_OK;	

}
开发者ID:deepikateriar,项目名称:Onlive-Source-Backup,代码行数:28,代码来源:yaffs_flashif.c


示例2: yflash_ReadChunkWithTagsFromNAND

int yflash_ReadChunkWithTagsFromNAND(yaffs_Device *dev,int chunkInNAND, __u8 *data, yaffs_Tags *tags)
{
	int blk;
	int pg;

	
	CheckInit(dev);
	
	blk = chunkInNAND/32;
	pg = chunkInNAND%32;
	
	
	if(data)
	{
		memcpy(data,ramdisk.block[blk]->page[pg].data,512);
	}
	
	
	if(tags)
	{
		yaffs_PackedTags pt;
		memcpy(&pt,&ramdisk.block[blk]->page[pg].data[512],sizeof(yaffs_PackedTags));
		yaffs_UnpackTags(tags,&pt);
	}

	return YAFFS_OK;
}
开发者ID:deepikateriar,项目名称:Onlive-Source-Backup,代码行数:27,代码来源:yaffs_flashif.c


示例3: camltk_add_file_output

CAMLprim value camltk_add_file_output(value fd, value cbid)
{
  CheckInit();
  Tcl_CreateFileHandler(tcl_filehandle(fd), TCL_WRITABLE,
                       FileProc, (ClientData) (Long_val(cbid)));
  return Val_unit;
}
开发者ID:retired-camels,项目名称:ocaml,代码行数:7,代码来源:cltkFile.c


示例4: sync

void NetworkTable::Initialize() {
    NTSynchronized sync(STATIC_LOCK);
    CheckInit();
    printf("[NT] NetworkTable::Initialize()...\n");
    staticProvider = new NetworkTableProvider(*(staticNode = mode->CreateNode(ipAddress.c_str(), port, threadManager, streamFactory, streamDeleter, typeManager)));
    printf("[NT] ...NetworkTable::Initialize().\n");
}
开发者ID:robotpy,项目名称:wpilib-cpp-crio,代码行数:7,代码来源:NetworkTable.cpp


示例5: camltk_add_timer

CAMLprim value camltk_add_timer(value milli, value cbid)
{
  CheckInit();
  /* look at tkEvent.c , Tk_Token is an int */
  return (Val_int(Tcl_CreateTimerHandler(Int_val(milli), TimerProc,
                                       (ClientData) (Long_val(cbid)))));
}
开发者ID:Chris00,项目名称:ocaml,代码行数:7,代码来源:cltkTimer.c


示例6: SDL_CDOpen

SDL_CD *
SDL_CDOpen(int drive)
{
    struct SDL_CD *cdrom;

    if (!CheckInit(0, NULL)) {
        return (NULL);
    }
    if (drive >= SDL_numcds) {
        SDL_SetError("Invalid CD-ROM drive index");
        return (NULL);
    }
    cdrom = (SDL_CD *) SDL_malloc(sizeof(*cdrom));
    if (cdrom == NULL) {
        SDL_OutOfMemory();
        return (NULL);
    }
    SDL_memset(cdrom, 0, sizeof(*cdrom));
    cdrom->id = SDL_CDcaps.Open(drive);
    if (cdrom->id < 0) {
        SDL_free(cdrom);
        return (NULL);
    }
    default_cdrom = cdrom;
    return (cdrom);
}
开发者ID:Bananattack,项目名称:verge3,代码行数:26,代码来源:SDL_cdrom.c


示例7: CheckInit

void
MinstrelWifiManager::DoReportDataOk (WifiRemoteStation *st,
                                     double ackSnr, WifiMode ackMode, double dataSnr)
{
  MinstrelWifiRemoteStation *station = (MinstrelWifiRemoteStation *) st;

  station->m_isSampling = false;
  station->m_sampleRateSlower = false;

  CheckInit (station);
  if (!station->m_initialized)
    {
      return;
    }

  m_minstrelTable[station->m_txrate].numRateSuccess++;
  m_minstrelTable[station->m_txrate].numRateAttempt++;

  UpdateRetry (station);

  m_minstrelTable[station->m_txrate].numRateAttempt += station->m_retry;
  station->m_packetCount++;

  if (m_nsupported >= 1)
    {
      station->m_txrate = FindRate (station);
    }
}
开发者ID:shuiziliuBUPT,项目名称:HelloWorld,代码行数:28,代码来源:minstrel-wifi-manager.cpp


示例8: camltk_return

/* Callbacks are always of type _ -> unit, to simplify storage
 * But a callback can nevertheless return something (to Tcl) by
 * using the following. TCL_VOLATILE ensures that Tcl will make
 * a copy of the string
 */
CAMLprim value camltk_return (value v)
{
  CheckInit();

  Tcl_SetResult(cltclinterp, String_val(v), TCL_VOLATILE);
  return Val_unit;
}
开发者ID:Chris00,项目名称:ocaml,代码行数:12,代码来源:cltkCaml.c


示例9: yflash_ReadChunkFromNAND

int yflash_ReadChunkFromNAND(yaffs_Device *dev,int chunkInNAND, __u8 *data, yaffs_Spare *spare)
{
    int nread;

    CheckInit(dev);



    if(data)
    {
        lseek(filedisk.handle,chunkInNAND * 528,SEEK_SET);
        nread = read(filedisk.handle,data,512);

        if(nread != 512) return YAFFS_FAIL;
    }

    if(spare)
    {
        lseek(filedisk.handle,chunkInNAND * 528 + 512,SEEK_SET);
        nread= read(filedisk.handle,spare,16);

        if(nread != 16) return YAFFS_FAIL;
    }


    return YAFFS_OK;

}
开发者ID:jamesyan84,项目名称:mt36k_android_4.0.4,代码行数:28,代码来源:yaffs_fileem.c


示例10: yflash_WriteChunkToNAND

int yflash_WriteChunkToNAND(yaffs_Device *dev,int chunkInNAND,const __u8 *data, const yaffs_Spare *spare)
{
    int written;

    CheckInit(dev);



    if(data)
    {
        lseek(filedisk.handle,chunkInNAND * 528,SEEK_SET);
        written = write(filedisk.handle,data,512);

        if(written != 512) return YAFFS_FAIL;
    }

    if(spare)
    {
        lseek(filedisk.handle,chunkInNAND * 528 + 512,SEEK_SET);
        written = write(filedisk.handle,spare,16);

        if(written != 16) return YAFFS_FAIL;
    }


    return YAFFS_OK;

}
开发者ID:jamesyan84,项目名称:mt36k_android_4.0.4,代码行数:28,代码来源:yaffs_fileem.c


示例11: yflash2_EraseBlock

static int yflash2_EraseBlock(struct yaffs_dev *dev, int block_no)
{
	int i;
	int h;

	CheckInit();

	if(block_no < 0 || block_no >= filedisk.nBlocks)
	{
		yaffs_trace(YAFFS_TRACE_ALWAYS,"Attempt to erase non-existant block %d",block_no);
		return YAFFS_FAIL;
	}
	else
	{

		u8 pg[PAGE_SIZE];
		int syz = PAGE_SIZE;
		int pos;

		memset(pg,0xff,syz);


		h = filedisk.handle[(block_no / ( BLOCKS_PER_HANDLE))];
		lseek(h,((block_no % BLOCKS_PER_HANDLE) * dev->param.chunks_per_block) * PAGE_SIZE,SEEK_SET);
		for(i = 0; i < dev->param.chunks_per_block; i++)
		{
			write(h,pg,PAGE_SIZE);
		}
		pos = lseek(h, 0,SEEK_CUR);

		return YAFFS_OK;
	}
}
开发者ID:Blackrose,项目名称:yaffs2,代码行数:33,代码来源:yaffs_fileem2k.c


示例12: yflash_EraseBlockInNAND

int yflash_EraseBlockInNAND(yaffs_Device *dev, int blockNumber)
{

    int i;

    CheckInit(dev);

    if(blockNumber < 0 || blockNumber >= filedisk.nBlocks)
    {
        T(YAFFS_TRACE_ALWAYS,("Attempt to erase non-existant block %d\n",blockNumber));
        return YAFFS_FAIL;
    }
    else
    {

        yflash_Page pg;

        memset(&pg,0xff,sizeof(yflash_Page));

        lseek(filedisk.handle, blockNumber * 32 * 528, SEEK_SET);

        for(i = 0; i < 32; i++)
        {
            write(filedisk.handle,&pg,528);
        }
        return YAFFS_OK;
    }

}
开发者ID:jamesyan84,项目名称:mt36k_android_4.0.4,代码行数:29,代码来源:yaffs_fileem.c


示例13: camltk_setvar

CAMLprim value camltk_setvar(value var, value contents)
{
  char *s;
  char *stable_var = NULL;
  char *utf_contents;
  CheckInit();

  /* SetVar makes a copy of the contents. */
  /* In case we have write traces in OCaml, it's better to make sure that
     var doesn't move... */
  stable_var = string_to_c(var);
  utf_contents = caml_string_to_tcl(contents);
  s = (char *)Tcl_SetVar(cltclinterp,stable_var, utf_contents,
                         TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG);
  stat_free(stable_var);
  if( s == utf_contents ){
    tk_error("camltk_setvar: Tcl_SetVar returned strange result. Call the author of mlTk!");
  }
  stat_free(utf_contents);

  if (s == NULL)
    tk_error(Tcl_GetStringResult(cltclinterp));
  else 
    return(Val_unit);
}
开发者ID:nextAaron,项目名称:ocaml4-mingw64-win64,代码行数:25,代码来源:cltkVar.c


示例14: SDL_CDNumDrives

int SDL_CDNumDrives(void)
{
	if ( ! CheckInit(0, NULL) ) {
		return(-1);
	}
	return(SDL_numcds);
}
开发者ID:foreverlikeyou9999,项目名称:kos-ports,代码行数:7,代码来源:SDL_cdrom.c


示例15: camltk_tcl_eval

/*
 * Calling Tcl from Caml
 *   this version works on an arbitrary Tcl command,
 *   and does parsing and substitution
 */
CAMLprim value camltk_tcl_eval(value str)
{
  int code;
  char *cmd = NULL;

  CheckInit();

  /* Tcl_Eval may write to its argument, so we take a copy
   * If the evaluation raises a Caml exception, we have a space
   * leak
   */
  Tcl_ResetResult(cltclinterp);
  cmd = caml_string_to_tcl(str);
  code = Tcl_Eval(cltclinterp, cmd);
  stat_free(cmd);

  switch (code) {
  case TCL_OK:
    return tcl_string_to_caml(Tcl_GetStringResult(cltclinterp));
  case TCL_ERROR:
    tk_error(Tcl_GetStringResult(cltclinterp));
  default:  /* TCL_BREAK, TCL_CONTINUE, TCL_RETURN */
    tk_error("bad tcl result");
  }
}
开发者ID:OCamlPro,项目名称:OCamlPro-OCaml-Branch,代码行数:30,代码来源:cltkEval.c


示例16: yflash2_Initialise

static int yflash2_Initialise(struct yaffs_dev *dev)
{
	(void) dev;

	CheckInit();

	return YAFFS_OK;
}
开发者ID:Blackrose,项目名称:yaffs2,代码行数:8,代码来源:yaffs_fileem2k.c


示例17: SDL_CDEject

int SDL_CDEject(SDL_CD *cdrom)
{
	
	if ( ! CheckInit(1, &cdrom) ) {
		return(CD_ERROR);
	}
	return(SDL_CDcaps.Eject(cdrom));
}
开发者ID:qtekfun,项目名称:htcDesire820Kernel,代码行数:8,代码来源:SDL_cdrom.c


示例18: SDL_CDEject

int SDL_CDEject(SDL_CD *cdrom)
{
	/* Check if the CD-ROM subsystem has been initialized */
	if ( ! CheckInit(1, &cdrom) ) {
		return(CD_ERROR);
	}
	return(SDL_CDcaps.Eject(cdrom));
}
开发者ID:foreverlikeyou9999,项目名称:kos-ports,代码行数:8,代码来源:SDL_cdrom.c


示例19: GUI_X_GetKey

int GUI_X_GetKey(void)
{
    int r;
    r = KeyPressed;
    CheckInit();
    KeyPressed = 0;
    return (r);
}
开发者ID:Seok-Jung,项目名称:STM32F207,代码行数:8,代码来源:GUI_X_uCOS.c


示例20: SDL_CDPlay

int SDL_CDPlay(SDL_CD *cdrom, int sframe, int length)
{
	/* Check if the CD-ROM subsystem has been initialized */
	if ( ! CheckInit(1, &cdrom) ) {
		return(CD_ERROR);
	}

	return(SDL_CDcaps.Play(cdrom, sframe, length));
}
开发者ID:foreverlikeyou9999,项目名称:kos-ports,代码行数:9,代码来源:SDL_cdrom.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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