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

C++ err_print函数代码示例

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

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



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

示例1: skip_limbo

static void
skip_limbo(void)
#line 1481 "ctangle.w"
{
char c;
while(1){
if(loc> limit&&get_line()==0)return;
*(limit+1)= '@';
while(*loc!='@')loc++;
if(loc++<=limit){
c= *loc++;
if(ccode[(eight_bits)c]==new_section)break;
switch(ccode[(eight_bits)c]){
case translit_code:/*93:*/
#line 1507 "ctangle.w"

while(xisspace(*loc)&&loc<limit)loc++;
loc+= 3;
if(loc> limit||!xisxdigit(*(loc-3))||!xisxdigit(*(loc-2))
||(*(loc-3)>='0'&&*(loc-3)<='7')||!xisspace(*(loc-1)))
err_print("! Improper hex number following @l");

else{
unsigned i;
char*beg;
sscanf(loc-3,"%x",&i);
while(xisspace(*loc)&&loc<limit)loc++;
beg= loc;
while(loc<limit&&(xisalpha(*loc)||xisdigit(*loc)||*loc=='_'))loc++;
if(loc-beg>=translit_length)
err_print("! Replacement string in @l too long");

else{
strncpy(translit[i-0200],beg,loc-beg);
translit[i-0200][loc-beg]= '\0';
}
}

/*:93*/
#line 1491 "ctangle.w"
;break;
case format_code:case'@':break;
case control_text:if(c=='q'||c=='Q'){
while((c= skip_ahead())=='@');
if(*(loc-1)!='>')
err_print("! Double @ should be used in control text");

break;
}
default:err_print("! Double @ should be used in limbo");

}
}
}
}
开发者ID:Amaterasu27,项目名称:miktex,代码行数:55,代码来源:initctangle.c


示例2: vtq_imageconv_init

int vtq_imageconv_init(struct vtq_imageconv_state **vtq_imageconv_out,
		struct vtq_vce *vtq_vce,
		struct module *module,
		struct device *device,
		struct proc_dir_entry *proc_vcedir)
{
	struct vtq_imageconv_state *out;
	int s;

	(void) proc_vcedir;

	out = kmalloc(sizeof(*out), GFP_KERNEL);
	if (out == NULL) {
		err_print("kmalloc failure\n");
		goto err_kmalloc_vtq_imageconv_state;
	}

	out->vtq = vtq_create_context(vtq_vce);
	if (out->vtq == NULL) {
		err_print("failed to create VTQ context\n");
		goto err_vtq_create_context;
	}

	/* Mark that we haven't received the blob (via
	 * request_firmware) yet */
	out->image = NULL;
	out->want_image_via_vtqinit = 0;
	atomic_set(&out->task_get_count, 0);

	out->device = device;
	s = request_firmware_nowait(module, 1,
			"bcmvtq_imageconv", out->device,
			GFP_KERNEL, out, _fw_cont);
	if (s != 0) {
		err_print("request firmware failed\n");
		goto err_request_firmware;
	}

	/* success */
	*vtq_imageconv_out = out;
	return 0;

	/* error exit paths follow */

err_request_firmware:

	vtq_destroy_context(out->vtq);
err_vtq_create_context:

	kfree(out);
err_kmalloc_vtq_imageconv_state:

	return -ENOENT;
}
开发者ID:TheNikiz,项目名称:android_kernel_samsung_hawaii,代码行数:54,代码来源:vtq_imageconv.c


示例3: P1H

void
#line 87 "./cwebdir/comm-w2c.ch"
 prime_the_change_buffer P1H(void)
#line 254 "./cwebdir/common.w"
{
change_limit= change_buffer;
/*13:*/
#line 265 "./cwebdir/common.w"

while(1){
change_line++;
if(!input_ln(change_file))return;
if(limit<buffer+2)continue;
if(buffer[0]!='@')continue;
if(xisupper(buffer[1]))buffer[1]= tolower(buffer[1]);
if(buffer[1]=='x')break;
if(buffer[1]=='y'||buffer[1]=='z'||buffer[1]=='i'){
loc= buffer+2;
err_print("! Missing @x in change file");

}
}

/*:13*/
#line 256 "./cwebdir/common.w"
;
/*14:*/
#line 282 "./cwebdir/common.w"

do{
change_line++;
if(!input_ln(change_file)){
err_print("! Change file ended after @x");

return;
}
}while(limit==buffer);

/*:14*/
#line 257 "./cwebdir/common.w"
;
/*15:*/
#line 292 "./cwebdir/common.w"

{
change_limit= change_buffer+(limit-buffer);
strncpy(change_buffer,buffer,limit-buffer+1);
}

/*:15*/
#line 258 "./cwebdir/common.w"
;
}
开发者ID:BackupTheBerlios,项目名称:texlive,代码行数:53,代码来源:cwebboot.c


示例4: DMPAPI

DMPAPI(void) uart_Close(void *vport)
{
	unsigned char lcr;
	SerialPort *port = (SerialPort *)vport;
	if (port == NULL) { err_print((char*)"%s: port is null.\n", __FUNCTION__); return; }
	
	if (port->InUse != 0)
	{
		// restore old IER & MCR
		uart_IntDisable(vport);
		io_DisableINT();
		{
			io_outpb(port->MCR, port->old_mcr); 
		}
		io_RestoreINT();
		irq_Close();
		
		// restore old LSB & MSB
#ifdef _VORTEX86EXC_UART_WORKAROUND
	/* To avoid Vortex86EX(D) write sync. issue. */
	io_DisableINT();
	{
		lcr = io_inpb(port->LCR);  
		io_outpb(port->LCR, 0x80); 
		
		do {
			io_outpb(port->DLLSB, port->old_lsb);
		} while (io_inpb(port->DLLSB) != port->old_lsb);
		
		do {
			io_outpb(port->DLMSB, port->old_msb);
		} while (io_inpb(port->DLMSB) != port->old_msb);
		
		io_inpb(0x80); // do IO delay
		io_outpb(port->LCR, lcr);  
	}
	io_RestoreINT();
#else
		_16550_DLAB_Out(port, port->DLLSB, port->old_lsb);
		_16550_DLAB_Out(port, port->DLMSB, port->old_msb);
#endif
		
		// restore old LCR & timeout
		uart_SetFormat(vport, port->old_lcr);
		uart_SetTimeOut(vport, port->old_TimeOut);
		
		vx86_uart_Close(port->com);
		if (io_Close() == false) err_print((char*)"Close IO lib error!!\n");
	}
	uart_Free(port);
}
开发者ID:brucetsao,项目名称:Print3D,代码行数:51,代码来源:uart.cpp


示例5: get_control_text

boolean get_control_text(void)
{ char c,* k=id_first=&mod_text[1]; /* points after last recorded character */
  do
    if ((*k++=*loc++)=='@')
      if ((c=*loc++)!='@')
      { if (c!='>')
	  err_print("! Control codes are forbidden in control text");
		     
	return (id_loc=k-1)==id_first;
      }
  while(loc<=limit);
  err_print("! Control text didn't end"); 
  return (id_loc=k)==id_first;
}
开发者ID:nailbiter,项目名称:atlasofliegroups,代码行数:14,代码来源:common.c


示例6: block_all_sigs

static inline void block_all_sigs(void)
{
	sigset_t set;
	
	if( sigfillset(&set) == -1 ) {
		err_print("sigfillset");
		return;
	}
	
	if( sigprocmask(SIG_BLOCK,&set,NULL) == -1) {
		err_print("sigprocmask");
		return;
	}	
}
开发者ID:Arseny-N,项目名称:bell_415,代码行数:14,代码来源:main.c


示例7: i2csw_Write

static bool i2csw_Write(int dev, unsigned char val) {
    int i, databit;

    // send data byte
    for(i=0; i<8; i++)
    {
        databit = ((val & 0x80) == 0)? 0 : 1;
        set_pins(dev, 0, databit); timer_DelayMicroseconds(I2CSW_delay[dev]);  // set data bit
        set_pins(dev, 1, databit); timer_DelayMicroseconds(I2CSW_delay[dev]);  // send a clock
        set_pins(dev, 0, databit);
        val = val << 1;
    }
    
    // read ACK
    set_pins(dev, 0, 1); timer_DelayMicroseconds(I2CSW_delay[dev]);  // set SDA as input
    set_pins(dev, 1, 1); timer_DelayMicroseconds(I2CSW_delay[dev]);  // send a clock
    if (read_sda(dev) == 1)
    {
		err_print("receive no ACK after transmitting");
        return false;
    }
    set_pins(dev, 0, 1);
    
    return true;
}
开发者ID:aquashift,项目名称:86Duino_DuinOS,代码行数:25,代码来源:i2c.cpp


示例8: isp_open

static int isp_open(struct inode *inode, struct file *filp)
{
	int ret = 0;

	isp_t *dev = kmalloc(sizeof(isp_t), GFP_KERNEL);
	if (!dev)
		return -ENOMEM;

	filp->private_data = dev;
	dev->lock = __SPIN_LOCK_UNLOCKED();
	dev->isp_status.status = 0;

	sema_init(&dev->irq_sem, 0);

	enable_isp_clock();

	ret =
	    request_irq(IRQ_ISP, isp_isr, IRQF_DISABLED | IRQF_SHARED,
			ISP_DEV_NAME, dev);
	if (ret) {
		err_print("request_irq failed ret = %d\n", ret);
		goto err;
	}

	disable_irq(IRQ_ISP);
	return 0;

err:
	if (dev)
		kfree(dev);
	return ret;
}
开发者ID:emreharbutoglu,项目名称:i9105Sammy,代码行数:32,代码来源:isp.c


示例9: _imageconv_flush

void _imageconv_flush(vce_t *user,
		      struct vce *vce)
{
	int s;

	if (user->need_to_wait_for_imageconv) {
		dbg_print("Flushing unfinished imageconversions\n");
		s = vtq_imageconv_await(vce->vtq_imageconv,
				user->last_imageconv_job_id);
		if (s == -ERESTARTSYS) {
			int retried;
			dbg_print("Wait was interrupted by signal, will poll\n")
				;
			/* TODO: might be good to make blocking version of API
			 */
			retried = 0;
			while (s == -ERESTARTSYS && retried++ < 1000) {
				usleep_range(1000, 20000);
				s = vtq_imageconv_await(vce->vtq_imageconv,
						user->last_imageconv_job_id);
			}
			dbg_print("After %d tries, s = %d\n", retried, s);
		}

		if (s != 0)
			err_print("Failed to flush imageconv -- likely FATAL\n")
				;
	}
}
开发者ID:ASAZING,项目名称:Android-Kernel-Gt-s7390l,代码行数:29,代码来源:vce.c


示例10: DMPAPI

DMPAPI(bool) usb_SetUSBPins(void *vusb, char port1, char pin1, char port2, char pin2)
{
	USB_Device *usb = (USB_Device *)vusb;
	if (usb == NULL) { err_print((char*)"%s: USB device is null.\n", __FUNCTION__); return false; }
	
	if (set_gpio_config_addr(GPIO_CONFIG_ADDR) == false)
	{
		err_print((char*)"%s: init USB-DEV DETECT and ONOFF pins fail.\n", __FUNCTION__);
		return false;
	}
	set_pin_in(port1, pin1);
	set_pin_out(port2, pin2);
	
	USB_Connect();
	return true;
}
开发者ID:jack23912,项目名称:86Duino,代码行数:16,代码来源:usb.cpp


示例11: p_expand

int
p_expand()
{
	uint64_t delta;
	uint_t nparts;
	struct dk_gpt *efi_label = cur_parts->etoc;

	if (cur_parts->etoc->efi_altern_lba == 1 ||
	    (cur_parts->etoc->efi_altern_lba >=
	    cur_parts->etoc->efi_last_lba)) {
		err_print("Warning: No expanded capacity is found.\n");
		return (0);
	}

	delta = efi_label->efi_last_lba - efi_label->efi_altern_lba;
	nparts = efi_label->efi_nparts;

	enter_critical();
	efi_label->efi_parts[nparts - 1].p_start += delta;
	efi_label->efi_last_u_lba += delta;
	efi_label->efi_altern_lba = cur_parts->etoc->efi_last_lba;
	exit_critical();

	fmt_print("The expanded capacity is added to the unallocated space.\n");
	return (0);
}
开发者ID:AlainODea,项目名称:illumos-gate,代码行数:26,代码来源:menu_partition.c


示例12: init_logging_semaphore

/*
 * Name: init_loging_semaphore
 * Zweck: Initialisieren der Logging Semaphore
 * In-Parameter: -
 * Out-Parameter: -
 * Globale Variablen: sem_t* log_sem
 * Rückgabewert: -
 */
void init_logging_semaphore(void) {
	if ((log_sem = sem_open(SEM_NAME, O_CREAT, S_IRUSR | S_IWUSR, 1))
			== SEM_FAILED) {
		err_print("cannot create named semaphore");
		exit(EXIT_FAILURE); //WARNING / TODO Does not free used memory!
	} /* end if */
} /* end of init_logging_semaphore */
开发者ID:RocketRider,项目名称:DistSys,代码行数:15,代码来源:sem_print.c


示例13: a_verify

/*
 * This routine implements the 'verify' command.  It writes the disk
 * by writing unique data for each block; after the write pass, it
 * reads the data and verifies for correctness. Note that the entire
 * disk (or the range of disk) is fully written first and then read.
 * This should eliminate any caching effect on the drives.
 * It is not ok to run this command on any data you want to keep.
 */
int
a_verify()
{
	/*
	 * The current disk must be formatted before disk analysis.
	 */
	if (!(cur_flags & DISK_FORMATTED)) {
		err_print("Current Disk is unformatted.\n");
		return (-1);
	}
	if (scan_random) {
		fmt_print("The verify command does not write random data\n");
		scan_random = 0;
	}
	if (scan_passes < 2 && !scan_loop) {
		scan_passes = 2;
		fmt_print("The verify command runs minimum of 2 passes, one"
		    " for writing and \nanother for reading and verfying."
		    " Resetting the number of passes to 2.\n");
	}

	if (check("Ready to verify (will corrupt data). This takes a long time,"
	    "\nbut is interruptable with CTRL-C. Continue")) {
		return (-1);
	}

	return (do_scan(SCAN_WRITE | SCAN_VERIFY, F_NORMAL));
}
开发者ID:alhazred,项目名称:onarm,代码行数:36,代码来源:menu_analyze.c


示例14: DMPAPI

DMPAPI(bool) i2cmaster_Start(int dev, unsigned char addr, unsigned char rwbit) {
    bool result = true;
    
    if (I2C_action[dev] != I2CACT_IDLE)
    {
        err_print("can't start a transaction because I2C%d isn't idle", dev);
        return false;
    }

    I2C_rsInfo[dev].restart = false;

    if (I2C_swMode[dev] != I2CSW_DISABLE)
        result = i2csw_Start(dev, addr, rwbit, false);
    else
    {

        if (I2C_speedMode[dev] == I2CMODE_HIGHSPEED) 
            result = i2cmaster_Start1(dev, 0x07, I2C_WRITE); //send high-speed master code

        if (result == true) result = i2cmaster_Start1(dev, addr, rwbit);
    }
    
    if (result == true)
    {
        I2C_action[dev]  = (rwbit == I2C_WRITE)? I2CACT_MASTERWRITE : I2CACT_MASTERREAD;
        I2C_curAddr[dev] = addr;
    }
    return result;
}
开发者ID:aquashift,项目名称:86Duino_DuinOS,代码行数:29,代码来源:i2c.cpp


示例15: delete_partition

/*
 * This routine deletes a partition map from the list of maps for
 * the given disk type.
 */
void
delete_partition(struct partition_info *parts)
{
	struct	partition_info *pptr;

	/*
	 * If there isn't a current map, it's an error.
	 */
	if (cur_dtype->dtype_plist == NULL) {
		err_print("Error: unexpected null partition list.\n");
		fullabort();
	}
	/*
	 * Remove the map from the list.
	 */
	if (cur_dtype->dtype_plist == parts)
		cur_dtype->dtype_plist = parts->pinfo_next;
	else {
		for (pptr = cur_dtype->dtype_plist; pptr->pinfo_next != parts;
		    pptr = pptr->pinfo_next)
			;
		pptr->pinfo_next = parts->pinfo_next;
	}
	/*
	 * Free the space it was using.
	 */
	destroy_data((char *)parts);
}
开发者ID:CoryXie,项目名称:opensolaris,代码行数:32,代码来源:partition.c


示例16: err_print

void Epoll::remove(int fd) {
    if (epoll_ctl(epfd_, EPOLL_CTL_DEL, fd, NULL) < 0) {
        err_print("could not remove fd[%d] from epoll\n", fd);
    }

    return;
}
开发者ID:RichyMong,项目名称:std,代码行数:7,代码来源:epoll.cpp


示例17: DMP_INLINE

DMP_INLINE(void) uart_Free(SerialPort *port)
{
	if (port == NULL) { err_print((char*)"%s: port is null.\n", __FUNCTION__); return; }
	DestoryQueue(port->rcvd);
	DestoryQueue(port->xmit);
	ker_Mfree((void*)port);
}
开发者ID:brucetsao,项目名称:Print3D,代码行数:7,代码来源:uart.cpp


示例18: load_binfile

/* load binary code and data from file to memory image */
int load_binfile(mem_t *m, FILE *f)
{
    int flen;

    clearerr(f);
    flen = fread(m->data, sizeof(byte_t), m->len, f);
    if (ferror(f)) {
        err_print("fread() failed (0x%x)", flen);
        return -1;
    }
    if (!feof(f)) {
        err_print("too large memory footprint (0x%x)", flen);
        return -1;
    }
    return 0;
}
开发者ID:tjgykhulj,项目名称:ICS_Lab,代码行数:17,代码来源:y86sim.c


示例19: init_vx86

static bool init_vx86(void) {
    int i;
    
    for (i=0; i<(int)(sizeof(VX86_pciDev)/sizeof(VX86_pciDev[0])); i++) VX86_pciDev[i] = NULL;

    // get North Bridge fun0 & South Bridge fun0 & IDE PCI-CFG
    if ((VX86_pciDev[VX86_NB]  = pci_Alloc(0x00, 0x00, 0x00)) == NULL) goto FAIL_INITVX86;
    if ((VX86_pciDev[VX86_SB]  = pci_Alloc(0x00, 0x07, 0x00)) == NULL) goto FAIL_INITVX86;
    if ((VX86_pciDev[VX86_IDE] = pci_Alloc(0x00, 0x0c, 0x00)) == NULL) goto FAIL_INITVX86;
    
    // now we are allowed to call get_cpuid()
    if ((VX86_cpuID = get_cpuid()) == CPU_UNSUPPORTED) goto FAIL_INITVX86;

    if (vx86_CpuID() != CPU_VORTEX86SX)
    {
        // North Bridge fun1 exists (note NB fun1 isn't a normal PCI device -- its vid & did are 0xffff)
        if ((VX86_pciDev[VX86_NB1]  = pci_Alloc(0x00, 0x00, 0x01)) == NULL) goto FAIL_INITVX86;
    }
    if (vx86_CpuID() == CPU_VORTEX86EX || vx86_CpuID() == CPU_VORTEX86DX2 || vx86_CpuID() == CPU_VORTEX86DX3)
    {
        // South Bridge fun1 exists (note SB fun1 isn't a normal PCI device -- its vid & did are 0xffff)
        if ((VX86_pciDev[VX86_SB1]  = pci_Alloc(0x00, 0x07, 0x01)) == NULL) goto FAIL_INITVX86;
    }
    return true;

FAIL_INITVX86:
    for (i=0; i<(int)(sizeof(VX86_pciDev)/sizeof(VX86_pciDev[0])); i++)
    {
        pci_Free(VX86_pciDev[i]);
        VX86_pciDev[i] = NULL;
    }
    err_print((char*)"%s: fail to setup system PCI devices!\n", __FUNCTION__);
    return false;
}
开发者ID:drbokko,项目名称:86Duino,代码行数:34,代码来源:io.cpp


示例20: DMPAPI

DMPAPI(bool) io_Free(void* handle) {
    bool result = true;
	IO_BASE_t* base;

    if ((base = (IO_BASE_t*)handle) == NULL) return false;

    switch (base->iotype)
    {
        case IO_USE_PORTIO:
            // TODO: for WinXP or Linux Kernel Mode, free Port-I/O region here
            break;
        case IO_USE_MMIO:
            #if defined     DMP_DOS_DJGPP
                dpmi_LinMapFree(base->addr);
                dpmi_SelFree(base->mmio_selector);
            #elif defined   USE_WINIO3
                UnmapPhysicalMemory(base->mmio_info);
            #elif defined   USE_PHYMEM
                UnmapPhyMem((void*)base->addr, base->size);
            #else
                // TODO: for WinXP or Linux Kernel Mode, free MMIO region here
            #endif
            break;
        default:
            err_print((char*)"%s: unknown io-type!\n", __FUNCTION__);
            result = false;
            break;
    }
    free_io_base(base);

    return result;
}
开发者ID:drbokko,项目名称:86Duino,代码行数:32,代码来源:io.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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