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

C++ oops函数代码示例

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

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



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

示例1: handleFatalSignal

void handleFatalSignal(int signum, siginfo_t *si, void *ctx)
{
	ucontext_t *uc = (ucontext_t*)ctx;
	eDebug("KILLED BY signal %d", signum);
#ifndef NO_OOPS_SUPPORT
	oops(uc->uc_mcontext, signum == SIGSEGV || signum == SIGABRT);
#endif
	eDebug("-------");
	bsodFatal("enigma2, signal");
}
开发者ID:TitanNit,项目名称:tdt,代码行数:10,代码来源:bsod.cpp


示例2: lock_operation

void lock_operation(int fd,int op)
{
    struct flock lock;
    lock.l_whence=SEEK_SET;//start of the file
    lock.l_start=lock.l_len=0;
    lock.l_pid=getpid();
    lock.l_type=op;
    if(fcntl(fd,F_SETLK,&lock)==-1) oops("lock operation",1);
    return;
}
开发者ID:gettogetto,项目名称:LinuxProgramPractice,代码行数:10,代码来源:file_tc.c


示例3: get_compress_version

static int get_compress_version(struct compress *compress)
{
	int version = 0;

	if (ioctl(compress->fd, SNDRV_COMPRESS_IOCTL_VERSION, &version)) {
		oops(compress, errno, "cant read version");
		return -1;
	}
	return version;
}
开发者ID:MIPS,项目名称:external-tinycompress,代码行数:10,代码来源:compress.c


示例4: while

void CheckedFile::open( int access, int permission )
//--------------------------------------------------
{
    CheckedFile * closeIt;    // file to be closed when out of handles

    if( !_isOpen ) {
        _openAccess = access;
        _openPermission = permission;

        while( _openFiles->size() >= MaxOpenReadFiles ) {
            closeIt = _openFiles->back();
            closeIt->privClose();
            removeOpenFile( closeIt );
        }

        _handle = ::open( _fileName, _openAccess, _openPermission );

        while( _handle == -1 && errno == EMFILE ) {
            if( _openFiles->size() == 0 ) {
                FileExcept oops( FileExcept::Open, errno, _fileName );
                throw( oops );
            }

            closeIt = _openFiles->back();
            closeIt->privClose();
            removeOpenFile( closeIt );

            _handle = ::open( _fileName, _openAccess, _openPermission );
        }

        if( _handle == -1 ) {   // error other than out of handles
            FileExcept oops( FileExcept::Open, errno, _fileName );
            throw( oops );
        }

        _isOpen = TRUE;
        _logOpen = TRUE;
        _currOffset = 0;
        if( !( _openAccess & O_WRONLY ) ) {
            addOpenFile( this );
        }
    }
}
开发者ID:jossk,项目名称:open-watcom-v2,代码行数:43,代码来源:chfile.cpp


示例5: Substitute

void Expr::Substitute(hParam oldh, hParam newh) {
    if(op == PARAM_PTR) oops();

    if(op == PARAM && parh.v == oldh.v) {
        parh = newh;
    }
    int c = Children();
    if(c >= 1) a->Substitute(oldh, newh);
    if(c >= 2) b->Substitute(oldh, newh);
}
开发者ID:DanLipsitt,项目名称:solvespace,代码行数:10,代码来源:expr.cpp


示例6: switch

int Expr::Precedence(Expr *e) {
    if(e->op == ALL_RESOLVED) return -1; // never want to reduce this marker
    if(e->op != BINARY_OP && e->op != UNARY_OP) oops();

    switch(e->c) {
        case 'q':
        case 's':
        case 'c':
        case 'n':   return 30;

        case '*':
        case '/':   return 20;

        case '+':
        case '-':   return 10;

        default: oops();
    }
}
开发者ID:DanLipsitt,项目名称:solvespace,代码行数:19,代码来源:expr.cpp


示例7: handleFatalSignal

void handleFatalSignal(int signum, siginfo_t *si, void *ctx)
{
#ifndef NO_OOPS_SUPPORT
	ucontext_t *uc = (ucontext_t*)ctx;
	oops(uc->uc_mcontext);
#endif
	print_backtrace();
	eDebug("-------FATAL SIGNAL (%d)", signum);
	bsodFatal("enigma2, signal");
}
开发者ID:VytenisP,项目名称:enigma2-1,代码行数:10,代码来源:bsod.cpp


示例8: fetch_Single

static inline void
fetch_Single (Single_Item *item)
{
  int i;
  FT_UShort val;

  item->coverage = mycalloc (1, sizeof(Coverage_Item));
  GSUB_ptr = item->ptr;
  need(6);
  item->format = get_UShort();
  item->coverage->ptr = item->ptr + get_UShort();
  switch (item->format)
  {
    case 1:
      val = get_Short();
      item->data.delta = mycalloc (1, sizeof(FT_UShort));
      *item->data.delta = val;
#ifdef  DEBUG
      warning("Single Substitution Format=1 with Delta=%d at 0x%04x.", val, item->ptr);
#endif
      fetch_Coverage (item->coverage);
      break;
    case 2:
      val = get_UShort();
      need(2 * val);
      item->data.array = mycalloc (1, sizeof(Glyph_Array));
      item->data.array->count = val;
      item->data.array->glyphs = mycalloc (val, sizeof(FT_UShort));
      for (i = 0; i < val; i++)
        item->data.array->glyphs[i] = get_UShort();
#ifdef  DEBUG
      warning("Single Substitution Format=2 with %d Glyphs at 0x%04x.", val, item->ptr);
#endif
      val = fetch_Coverage (item->coverage);
      if (val != item->data.array->count)
        oops("Coverage at 0x%04x: covers %d glyphs (should be %d).", item->ptr, val, item->data.array->count);
      break;
    default:
      oops("Single Substitution at 0x%04x: bad Format=%d.", item->ptr, item->format);
  }
  
  add_Single (item);
}
开发者ID:MiKTeX,项目名称:miktex,代码行数:43,代码来源:ftlib.c


示例9: MakeColorTable

void TextWindow::MakeColorTable(const Color *in, float *out) {
    int i;
    for(i = 0; in[i].c != 0; i++) {
        int c = in[i].c;
        if(c < 0 || c > 255) oops();
        out[c*3 + 0] = REDf(in[i].color);
        out[c*3 + 1] = GREENf(in[i].color);
        out[c*3 + 2] = BLUEf(in[i].color);
    }
}
开发者ID:BBBSnowball,项目名称:python-solvespace,代码行数:10,代码来源:textwin.cpp


示例10: setup_socket

static int setup_socket()
{
	int socket_fd = socket(PF_INET, SOCK_STREAM, 0);
	if(socket_fd == -1) oops("socket initiating error...");

	struct sockaddr_in address;
	bzero((void *)&address, sizeof(address));
	address.sin_family = AF_INET;
	address.sin_addr.s_addr = inet_addr(SERVER_IP);
	address.sin_port =  htons(PORT);

	int bind_return =  bind(socket_fd, (struct sockaddr *)&address, sizeof(address));
	if(bind_return == -1) oops("bind error...");

	int listen_return = listen(socket_fd, 1);
	if(listen_return == -1) oops("listen error...");

	return socket_fd;
}
开发者ID:jimmycao,项目名称:workspace-info,代码行数:19,代码来源:server.c


示例11: release_lock

release_lock(int semset_id) {
    struct sembuf actions[1];
    actions[0].sem_num = 1;
    actions[0].sem_flg = SEM_UNDO;
    actions[0].sem_op = -1;


    if (semop(semset_id, actions, 1) == -1)
        oops("semop: unlocking", 10);
}
开发者ID:xegg,项目名称:JustSomeLearningNoteAndScript,代码行数:10,代码来源:shm_ts2.c


示例12: Error

void GraphicsWindow::MenuClipboard(int id) {
    if(id != MNU_DELETE && !SS.GW.LockedInWorkplane()) {
        Error("Cut, paste, and copy work only in a workplane.\n\n"
              "Select one with Sketch -> In Workplane.");
        return;
    }

    switch(id) {
        case MNU_PASTE: {   
            SS.UndoRemember();
            Vector trans = SS.GW.projRight.ScaledBy(80/SS.GW.scale).Plus(
                           SS.GW.projUp   .ScaledBy(40/SS.GW.scale));
            SS.GW.ClearSelection();
            SS.GW.PasteClipboard(trans, 0, 1);
            break;
        }

        case MNU_PASTE_TRANSFORM: {
            if(SS.clipboard.r.n == 0) {
                Error("Clipboard is empty; nothing to paste.");
                break;
            }
            
            Entity *wrkpl  = SK.GetEntity(SS.GW.ActiveWorkplane());
            Vector p = SK.GetEntity(wrkpl->point[0])->PointGetNum();
            SS.TW.shown.paste.times  = 1;
            SS.TW.shown.paste.trans  = Vector::From(0, 0, 0);
            SS.TW.shown.paste.theta  = 0;
            SS.TW.shown.paste.origin = p;
            SS.TW.shown.paste.scale  = 1;
            SS.TW.GoToScreen(TextWindow::SCREEN_PASTE_TRANSFORMED);
            SS.GW.ForceTextWindowShown();
            SS.later.showTW = true;
            break;
        }

        case MNU_COPY:
            SS.GW.CopySelection();
            SS.GW.ClearSelection();
            break;

        case MNU_CUT:
            SS.UndoRemember();
            SS.GW.CopySelection();
            SS.GW.DeleteSelection();
            break;

        case MNU_DELETE:
            SS.UndoRemember();
            SS.GW.DeleteSelection();
            break;

        default: oops();
    }
}
开发者ID:BBBSnowball,项目名称:python-solvespace,代码行数:55,代码来源:clipboard.cpp


示例13: _is_codec_supported

static bool _is_codec_supported(struct compress *compress, struct compr_config *config,
				const struct snd_compr_caps *caps)
{
	bool codec = false;
	unsigned int i;

	for (i = 0; i < caps->num_codecs; i++) {
		if (caps->codecs[i] == config->codec->id) {
			/* found the codec */
			codec = true;
			break;
		}
	}
	if (codec == false) {
		oops(compress, ENXIO, "this codec is not supported");
		return false;
	}

	if (config->fragment_size < caps->min_fragment_size) {
		oops(compress, EINVAL, "requested fragment size %d is below min supported %d",
			config->fragment_size, caps->min_fragment_size);
		return false;
	}
	if (config->fragment_size > caps->max_fragment_size) {
		oops(compress, EINVAL, "requested fragment size %d is above max supported %d",
			config->fragment_size, caps->max_fragment_size);
		return false;
	}
	if (config->fragments < caps->min_fragments) {
		oops(compress, EINVAL, "requested fragments %d are below min supported %d",
			config->fragments, caps->min_fragments);
		return false;
	}
	if (config->fragments > caps->max_fragments) {
		oops(compress, EINVAL, "requested fragments %d are above max supported %d",
			config->fragments, caps->max_fragments);
		return false;
	}

	/* TODO: match the codec properties */
	return true;
}
开发者ID:MIPS,项目名称:external-tinycompress,代码行数:42,代码来源:compress.c


示例14: main

int main(int argc,char **argv)
{
  uint16 u16;

  if (!*argv) usage();

  if (!*++argv) usage();
  if (!parsetype(*argv,type)) usage();

  if (!*++argv) usage();
  if (!dns_domain_fromdot(&q,*argv,str_len(*argv))) oops();

  if (*++argv) {
    if (!ip4_scan(*argv,ip)) usage();
  }

  if (!stralloc_copys(&out,"")) oops();
  /* uint16_unpack_big(type,&u16);
  if (!stralloc_catulong0(&out,u16,0)) oops();
  if (!stralloc_cats(&out," ")) oops();
  if (!dns_domain_todot_cat(&out,q)) oops();
  if (!stralloc_cats(&out,":\n")) oops(); */

  if (!response_query(q,type,DNS_C_IN)) oops();
  response[3] &= ~128;
  response[2] &= ~1;
  response[2] |= 4;
  case_lowerb(q,dns_domain_length(q));

  if (byte_equal(type,2,DNS_T_AXFR)) {
    response[3] &= ~15;
    response[3] |= 4;
  }
  else
    if (!respond(q,type,ip)) goto DONE;

  if (!printpacket_cat(&out,response,response_len)) oops();

  DONE:
  buffer_putflush(buffer_1,out.s,out.len);
  _exit(0);
}
开发者ID:hiro-dSn,项目名称:djbdns,代码行数:42,代码来源:tinydns-get.c


示例15: WeightControlPoints

void SSurface::SplitInHalf(bool byU, SSurface *sa, SSurface *sb) {
    sa->degm = sb->degm = degm;
    sa->degn = sb->degn = degn;

    // by de Casteljau's algorithm in a projective space; so we must work
    // on points (w*x, w*y, w*z, w)
    WeightControlPoints();

    switch(byU ? degm : degn) {
        case 1:
            sa->CopyRowOrCol (byU, 0, this, 0);
            sb->CopyRowOrCol (byU, 1, this, 1);

            sa->BlendRowOrCol(byU, 1, this, 0, this, 1);
            sb->BlendRowOrCol(byU, 0, this, 0, this, 1);
            break;

        case 2:
            sa->CopyRowOrCol (byU, 0, this, 0);
            sb->CopyRowOrCol (byU, 2, this, 2);

            sa->BlendRowOrCol(byU, 1, this, 0, this, 1);
            sb->BlendRowOrCol(byU, 1, this, 1, this, 2);

            sa->BlendRowOrCol(byU, 2, sa,   1, sb,   1);
            sb->BlendRowOrCol(byU, 0, sa,   1, sb,   1);
            break;

        case 3: {
            SSurface st;
            st.degm = degm; st.degn = degn;

            sa->CopyRowOrCol (byU, 0, this, 0);
            sb->CopyRowOrCol (byU, 3, this, 3);

            sa->BlendRowOrCol(byU, 1, this, 0, this, 1);
            sb->BlendRowOrCol(byU, 2, this, 2, this, 3);
            st. BlendRowOrCol(byU, 0, this, 1, this, 2); // scratch var

            sa->BlendRowOrCol(byU, 2, sa,   1, &st,  0);
            sb->BlendRowOrCol(byU, 1, sb,   2, &st,  0);

            sa->BlendRowOrCol(byU, 3, sa,   2, sb,   1);
            sb->BlendRowOrCol(byU, 0, sa,   2, sb,   1);
            break;
        }

        default: oops();
    }

    sa->UnWeightControlPoints();
    sb->UnWeightControlPoints();
    UnWeightControlPoints();
}
开发者ID:blondegeek,项目名称:solvespace,代码行数:54,代码来源:raycast.cpp


示例16: main

main() {
    int seg_id;
    char *mem_ptr, *ctime();
    long now;
    int n;

    seg_id = shmget(TIME_MEM_KEY, SEG_SIZE, IPC_CREAT|0777);
    if( seg_id == -1 )
        oops("shmget", 1);
    mem_ptr = shmat(seg_id, NULL, 0);
    if (mem_ptr == (void *) -1)
        oops("shmat", 2);

    for (n = 0; n < 60; n++) {
        time(&now);
        strcpy(mem_ptr, ctime(&now));
        sleep(1);
    }
    shmctl(seg_id, IPC_RMID, NULL);
}
开发者ID:xegg,项目名称:JustSomeLearningNoteAndScript,代码行数:20,代码来源:shm_ts.c


示例17: integer

/*
	attr ::= '@' text ';'

	text is 
		'a' integer (alignment)
		'p' integer (pointer class)
		'P' (packed type)
		's' integer (size of type in bits)
		'S' (string instead of array of chars)
*/
static int
parseattr(char *p, char **text, char **pp)
{
	if(*p != '@')
		return -1;
	*text = p+1;
	if((p = strchr(p, ';')) == nil)
		oops();
	*pp = p+1;
	return 0;
}
开发者ID:00001,项目名称:plan9port,代码行数:21,代码来源:stabs.c


示例18: if

Vector EntityBase::EndpointFinish() {
    if(type == LINE_SEGMENT) {
        return SK.GetEntity(point[1])->PointGetNum();
    } else if(type == CUBIC) {
        return CubicGetFinishNum();
    } else if(type == ARC_OF_CIRCLE) {
        return SK.GetEntity(point[2])->PointGetNum();
    } else {
        oops();
    }
}
开发者ID:BBBSnowball,项目名称:python-solvespace,代码行数:11,代码来源:entity.cpp


示例19: compress_get_hpointer

int compress_get_hpointer(struct compress *compress,
		unsigned int *avail, struct timespec *tstamp)
{
	struct snd_compr_avail kavail;
	__u64 time;

	if (!is_compress_ready(compress))
		return oops(compress, ENODEV, "device not ready");

	if (ioctl(compress->fd, SNDRV_COMPRESS_AVAIL, &kavail))
		return oops(compress, errno, "cannot get avail");
	if (0 == kavail.tstamp.sampling_rate)
		return oops(compress, ENODATA, "sample rate unknown");
	*avail = (unsigned int)kavail.avail;
	time = kavail.tstamp.pcm_io_frames / kavail.tstamp.sampling_rate;
	tstamp->tv_sec = time;
	time = kavail.tstamp.pcm_io_frames % kavail.tstamp.sampling_rate;
	tstamp->tv_nsec = time * 1000000000 / kavail.tstamp.sampling_rate;
	return 0;
}
开发者ID:MIPS,项目名称:external-tinycompress,代码行数:20,代码来源:compress.c


示例20: GetAxisAngleQuaternion

Quaternion EntityBase::PointGetQuaternion(void) {
    Quaternion q;

    if(type == POINT_N_ROT_AA) {
        q = GetAxisAngleQuaternion(3);
    } else if(type == POINT_N_ROT_TRANS) {
        q = Quaternion::From(param[3], param[4], param[5], param[6]);
    } else oops();

    return q;
}
开发者ID:BBBSnowball,项目名称:python-solvespace,代码行数:11,代码来源:entity.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ opt2fn函数代码示例发布时间:2022-06-01
下一篇:
Android::开机自启动C程序【转】发布时间:2022-07-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap