您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ EVENT函数代码示例

51自学网 2021-06-01 20:34:26
  C++
这篇教程C++ EVENT函数代码示例写得很实用,希望能帮到您。

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

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

示例1: apply_deltas

/** Applies delta files to create an upgraded package file. * * All intermediate files are deleted, leaving only the starting and * ending package files. * * @param handle the context handle * * @return 0 if all delta files were able to be applied, 1 otherwise. */static int apply_deltas(alpm_handle_t *handle){	alpm_list_t *i;	int ret = 0;	const char *cachedir = _alpm_filecache_setup(handle);	alpm_trans_t *trans = handle->trans;	for(i = trans->add; i; i = i->next) {		alpm_pkg_t *spkg = i->data;		alpm_list_t *delta_path = spkg->delta_path;		alpm_list_t *dlts = NULL;		if(!delta_path) {			continue;		}		for(dlts = delta_path; dlts; dlts = dlts->next) {			alpm_delta_t *d = dlts->data;			char *delta, *from, *to;			char command[PATH_MAX];			size_t len = 0;			delta = _alpm_filecache_find(handle, d->delta);			/* the initial package might be in a different cachedir */			if(dlts == delta_path) {				from = _alpm_filecache_find(handle, d->from);			} else {				/* len = cachedir len + from len + '/' + null */				len = strlen(cachedir) + strlen(d->from) + 2;				CALLOC(from, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, 1));				snprintf(from, len, "%s/%s", cachedir, d->from);			}			len = strlen(cachedir) + strlen(d->to) + 2;			CALLOC(to, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, 1));			snprintf(to, len, "%s/%s", cachedir, d->to);			/* build the patch command */			if(endswith(to, ".gz")) {				/* special handling for gzip : we disable timestamp with -n option */				snprintf(command, PATH_MAX, "xdelta3 -d -q -R -c -s %s %s | gzip -n > %s", from, delta, to);			} else {				snprintf(command, PATH_MAX, "xdelta3 -d -q -s %s %s %s", from, delta, to);			}			_alpm_log(handle, ALPM_LOG_DEBUG, "command: %s/n", command);			EVENT(trans, ALPM_TRANS_EVT_DELTA_PATCH_START, d->to, d->delta);			int retval = system(command);			if(retval == 0) {				EVENT(trans, ALPM_TRANS_EVT_DELTA_PATCH_DONE, NULL, NULL);				/* delete the delta file */				unlink(delta);				/* Delete the 'from' package but only if it is an intermediate				 * package. The starting 'from' package should be kept, just				 * as if deltas were not used. */				if(dlts != delta_path) {					unlink(from);				}			}			FREE(from);			FREE(to);			FREE(delta);			if(retval != 0) {				/* one delta failed for this package, cancel the remaining ones */				EVENT(trans, ALPM_TRANS_EVT_DELTA_PATCH_FAILED, NULL, NULL);				handle->pm_errno = ALPM_ERR_DLT_PATCHFAILED;				ret = 1;				break;			}		}	}	return ret;}
开发者ID:matthewbauer,项目名称:unipkg-pacman,代码行数:87,


示例2: alpm_trans_commit

/** Commit a transaction. */int SYMEXPORT alpm_trans_commit(alpm_handle_t *handle, alpm_list_t **data){	alpm_trans_t *trans;	alpm_event_any_t event;	/* Sanity checks */	CHECK_HANDLE(handle, return -1);	trans = handle->trans;	ASSERT(trans != NULL, RET_ERR(handle, ALPM_ERR_TRANS_NULL, -1));	ASSERT(trans->state == STATE_PREPARED, RET_ERR(handle, ALPM_ERR_TRANS_NOT_PREPARED, -1));	ASSERT(!(trans->flags & ALPM_TRANS_FLAG_NOLOCK), RET_ERR(handle, ALPM_ERR_TRANS_NOT_LOCKED, -1));	/* If there's nothing to do, return without complaining */	if(trans->add == NULL && trans->remove == NULL) {		return 0;	}	if(trans->add) {		if(_alpm_sync_load(handle, data) != 0) {			/* pm_errno is set by _alpm_sync_load() */			return -1;		}		if(trans->flags & ALPM_TRANS_FLAG_DOWNLOADONLY) {			return 0;		}		if(_alpm_sync_check(handle, data) != 0) {			/* pm_errno is set by _alpm_sync_check() */			return -1;		}	}	if(_alpm_hook_run(handle, ALPM_HOOK_PRE_TRANSACTION) != 0) {		RET_ERR(handle, ALPM_ERR_TRANS_HOOK_FAILED, -1);	}	trans->state = STATE_COMMITING;	alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction started/n");	event.type = ALPM_EVENT_TRANSACTION_START;	EVENT(handle, (void *)&event);	if(trans->add == NULL) {		if(_alpm_remove_packages(handle, 1) == -1) {			/* pm_errno is set by _alpm_remove_packages() */			alpm_errno_t save = handle->pm_errno;			alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction failed/n");			handle->pm_errno = save;			return -1;		}	} else {		if(_alpm_sync_commit(handle) == -1) {			/* pm_errno is set by _alpm_sync_commit() */			alpm_errno_t save = handle->pm_errno;			alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction failed/n");			handle->pm_errno = save;			return -1;		}	}	if(trans->state == STATE_INTERRUPTED) {		alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction interrupted/n");	} else {		event.type = ALPM_EVENT_TRANSACTION_DONE;		EVENT(handle, (void *)&event);		alpm_logaction(handle, ALPM_CALLER_PREFIX, "transaction completed/n");		_alpm_hook_run(handle, ALPM_HOOK_POST_TRANSACTION);	}	trans->state = STATE_COMMITED;	return 0;}
开发者ID:andrewgregory,项目名称:pacman,代码行数:76,


示例3: _alpm_sync_prepare

int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data){	alpm_list_t *i, *j;	alpm_list_t *deps = NULL;	alpm_list_t *unresolvable = NULL;	int from_sync = 0;	int ret = 0;	alpm_trans_t *trans = handle->trans;	alpm_event_t event;	if(data) {		*data = NULL;	}	for(i = trans->add; i; i = i->next) {		alpm_pkg_t *spkg = i->data;		if (spkg->origin == ALPM_PKG_FROM_SYNCDB){			from_sync = 1;			break;		}	}	/* ensure all sync database are valid if we will be using them */	for(i = handle->dbs_sync; i; i = i->next) {		const alpm_db_t *db = i->data;		if(db->status & DB_STATUS_INVALID) {			RET_ERR(handle, ALPM_ERR_DB_INVALID, -1);		}		/* missing databases are not allowed if we have sync targets */		if(from_sync && db->status & DB_STATUS_MISSING) {			RET_ERR(handle, ALPM_ERR_DB_NOT_FOUND, -1);		}	}	if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {		alpm_list_t *resolved = NULL;		alpm_list_t *remove = alpm_list_copy(trans->remove);		alpm_list_t *localpkgs;		/* Build up list by repeatedly resolving each transaction package */		/* Resolve targets dependencies */		event.type = ALPM_EVENT_RESOLVEDEPS_START;		EVENT(handle, &event);		_alpm_log(handle, ALPM_LOG_DEBUG, "resolving target's dependencies/n");		/* build remove list for resolvedeps */		for(i = trans->add; i; i = i->next) {			alpm_pkg_t *spkg = i->data;			for(j = spkg->removes; j; j = j->next) {				remove = alpm_list_add(remove, j->data);			}		}		/* Compute the fake local database for resolvedeps (partial fix for the		 * phonon/qt issue) */		localpkgs = alpm_list_diff(_alpm_db_get_pkgcache(handle->db_local),				trans->add, _alpm_pkg_cmp);		/* Resolve packages in the transaction one at a time, in addition		   building up a list of packages which could not be resolved. */		for(i = trans->add; i; i = i->next) {			alpm_pkg_t *pkg = i->data;			if(_alpm_resolvedeps(handle, localpkgs, pkg, trans->add,						&resolved, remove, data) == -1) {				unresolvable = alpm_list_add(unresolvable, pkg);			}			/* Else, [resolved] now additionally contains [pkg] and all of its			   dependencies not already on the list */		}		alpm_list_free(localpkgs);		alpm_list_free(remove);		/* If there were unresolvable top-level packages, prompt the user to		   see if they'd like to ignore them rather than failing the sync */		if(unresolvable != NULL) {			alpm_question_remove_pkgs_t question = {				.type = ALPM_QUESTION_REMOVE_PKGS,				.skip = 0,				.packages = unresolvable			};			QUESTION(handle, &question);			if(question.skip) {				/* User wants to remove the unresolvable packages from the				   transaction. The packages will be removed from the actual				   transaction when the transaction packages are replaced with a				   dependency-reordered list below */				handle->pm_errno = 0;				if(data) {					alpm_list_free_inner(*data,							(alpm_list_fn_free)alpm_depmissing_free);					alpm_list_free(*data);					*data = NULL;				}			} else {				/* pm_errno was set by resolvedeps, callback may have overwrote it */				handle->pm_errno = ALPM_ERR_UNSATISFIED_DEPS;				alpm_list_free(resolved);				alpm_list_free(unresolvable);				ret = -1;				goto cleanup;//.........这里部分代码省略.........
开发者ID:danilogr,项目名称:MSYS2-pacman,代码行数:101,


示例4: BindTexImage

// EGL 1.1EGLBoolean EGLAPIENTRY BindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer){    EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLint buffer = %d)", dpy, surface, buffer);    Display *display = static_cast<Display*>(dpy);    Surface *eglSurface = static_cast<Surface*>(surface);    Error error = ValidateSurface(display, eglSurface);    if (error.isError())    {        SetGlobalError(error);        return EGL_FALSE;    }    if (buffer != EGL_BACK_BUFFER)    {        SetGlobalError(Error(EGL_BAD_PARAMETER));        return EGL_FALSE;    }    if (surface == EGL_NO_SURFACE || eglSurface->getType() == EGL_WINDOW_BIT)    {        SetGlobalError(Error(EGL_BAD_SURFACE));        return EGL_FALSE;    }    if (eglSurface->getBoundTexture())    {        SetGlobalError(Error(EGL_BAD_ACCESS));        return EGL_FALSE;    }    if (eglSurface->getTextureFormat() == EGL_NO_TEXTURE)    {        SetGlobalError(Error(EGL_BAD_MATCH));        return EGL_FALSE;    }    gl::Context *context = GetGlobalContext();    if (context)    {        gl::Texture *textureObject = context->getTargetTexture(GL_TEXTURE_2D);        ASSERT(textureObject != NULL);        if (textureObject->getImmutableFormat())        {            SetGlobalError(Error(EGL_BAD_MATCH));            return EGL_FALSE;        }        error = eglSurface->bindTexImage(textureObject, buffer);        if (error.isError())        {            SetGlobalError(error);            return EGL_FALSE;        }    }    SetGlobalError(Error(EGL_SUCCESS));    return EGL_TRUE;}
开发者ID:MoonchildProductions,项目名称:Pale-Moon,代码行数:62,


示例5: asylum_load

static int asylum_load(struct module_data *m, HIO_HANDLE *f, const int start){	struct xmp_module *mod = &m->mod;	struct xmp_event *event;	int i, j;	LOAD_INIT();	hio_seek(f, 32, SEEK_CUR);			/* skip magic */	mod->spd = hio_read8(f);			/* initial speed */	mod->bpm = hio_read8(f);			/* initial BPM */	mod->ins = hio_read8(f);			/* number of instruments */	mod->pat = hio_read8(f);			/* number of patterns */	mod->len = hio_read8(f);			/* module length */	hio_read8(f);	hio_read(mod->xxo, 1, mod->len, f);	/* read orders */	hio_seek(f, start + 294, SEEK_SET);	mod->chn = 8;	mod->smp = mod->ins;	mod->trk = mod->pat * mod->chn;	snprintf(mod->type, XMP_NAME_SIZE, "Asylum Music Format v1.0");	MODULE_INFO();	if (instrument_init(mod) < 0)		return -1;	/* Read and convert instruments and samples */	for (i = 0; i < mod->ins; i++) {		uint8 insbuf[37];		if (subinstrument_alloc(mod, i, 1) < 0)				return -1;		hio_read(insbuf, 1, 37, f);		instrument_name(mod, i, insbuf, 22);		mod->xxi[i].sub[0].fin = (int8)(insbuf[22] << 4);		mod->xxi[i].sub[0].vol = insbuf[23];		mod->xxi[i].sub[0].xpo = (int8)insbuf[24];		mod->xxi[i].sub[0].pan = 0x80;		mod->xxi[i].sub[0].sid = i;		mod->xxs[i].len = readmem32l(insbuf + 25);		mod->xxs[i].lps = readmem32l(insbuf + 29);		mod->xxs[i].lpe = mod->xxs[i].lps + readmem32l(insbuf + 33);				mod->xxs[i].flg = mod->xxs[i].lpe > 2 ? XMP_SAMPLE_LOOP : 0;		D_(D_INFO "[%2X] %-22.22s %04x %04x %04x %c V%02x %d", i,		   mod->xxi[i].name, mod->xxs[i].len, mod->xxs[i].lps,		   mod->xxs[i].lpe,		   mod->xxs[i].flg & XMP_SAMPLE_LOOP ? 'L' : ' ',		   mod->xxi[i].sub[0].vol, mod->xxi[i].sub[0].fin);	}	hio_seek(f, 37 * (64 - mod->ins), SEEK_CUR);	D_(D_INFO "Module length: %d", mod->len);	if (pattern_init(mod) < 0)		return -1;	/* Read and convert patterns */	D_(D_INFO "Stored patterns: %d", mod->pat);	for (i = 0; i < mod->pat; i++) {		if (pattern_tracks_alloc(mod, i, 64) < 0)			return -1;		for (j = 0; j < 64 * mod->chn; j++) {			uint8 note;			event = &EVENT(i, j % mod->chn, j / mod->chn);			memset(event, 0, sizeof(struct xmp_event));			note = hio_read8(f);			if (note != 0) {				event->note = note + 13;			}			event->ins = hio_read8(f);			event->fxt = hio_read8(f);			event->fxp = hio_read8(f);		}	}	/* Read samples */	D_(D_INFO "Stored samples: %d", mod->smp);	for (i = 0; i < mod->ins; i++) {		if (mod->xxs[i].len > 1) {			if (load_sample(m, f, 0, &mod->xxs[i], NULL) < 0)				return -1;			mod->xxi[i].nsm = 1;		}	}//.........这里部分代码省略.........
开发者ID:GCrean,项目名称:libxmp,代码行数:101,


示例6: GetProcAddress

__eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char *procname){    EVENT("(const char *procname = /"%s/")", procname);    typedef std::map<std::string, __eglMustCastToProperFunctionPointerType> ProcAddressMap;    auto generateProcAddressMap = []()    {        ProcAddressMap map;#define INSERT_PROC_ADDRESS(ns, proc) /    map[#ns #proc] = reinterpret_cast<__eglMustCastToProperFunctionPointerType>(ns::proc)        // GLES2 core        INSERT_PROC_ADDRESS(gl, ActiveTexture);        INSERT_PROC_ADDRESS(gl, AttachShader);        INSERT_PROC_ADDRESS(gl, BindAttribLocation);        INSERT_PROC_ADDRESS(gl, BindBuffer);        INSERT_PROC_ADDRESS(gl, BindFramebuffer);        INSERT_PROC_ADDRESS(gl, BindRenderbuffer);        INSERT_PROC_ADDRESS(gl, BindTexture);        INSERT_PROC_ADDRESS(gl, BlendColor);        INSERT_PROC_ADDRESS(gl, BlendEquation);        INSERT_PROC_ADDRESS(gl, BlendEquationSeparate);        INSERT_PROC_ADDRESS(gl, BlendFunc);        INSERT_PROC_ADDRESS(gl, BlendFuncSeparate);        INSERT_PROC_ADDRESS(gl, BufferData);        INSERT_PROC_ADDRESS(gl, BufferSubData);        INSERT_PROC_ADDRESS(gl, CheckFramebufferStatus);        INSERT_PROC_ADDRESS(gl, Clear);        INSERT_PROC_ADDRESS(gl, ClearColor);        INSERT_PROC_ADDRESS(gl, ClearDepthf);        INSERT_PROC_ADDRESS(gl, ClearStencil);        INSERT_PROC_ADDRESS(gl, ColorMask);        INSERT_PROC_ADDRESS(gl, CompileShader);        INSERT_PROC_ADDRESS(gl, CompressedTexImage2D);        INSERT_PROC_ADDRESS(gl, CompressedTexSubImage2D);        INSERT_PROC_ADDRESS(gl, CopyTexImage2D);        INSERT_PROC_ADDRESS(gl, CopyTexSubImage2D);        INSERT_PROC_ADDRESS(gl, CreateProgram);        INSERT_PROC_ADDRESS(gl, CreateShader);        INSERT_PROC_ADDRESS(gl, CullFace);        INSERT_PROC_ADDRESS(gl, DeleteBuffers);        INSERT_PROC_ADDRESS(gl, DeleteFramebuffers);        INSERT_PROC_ADDRESS(gl, DeleteProgram);        INSERT_PROC_ADDRESS(gl, DeleteRenderbuffers);        INSERT_PROC_ADDRESS(gl, DeleteShader);        INSERT_PROC_ADDRESS(gl, DeleteTextures);        INSERT_PROC_ADDRESS(gl, DepthFunc);        INSERT_PROC_ADDRESS(gl, DepthMask);        INSERT_PROC_ADDRESS(gl, DepthRangef);        INSERT_PROC_ADDRESS(gl, DetachShader);        INSERT_PROC_ADDRESS(gl, Disable);        INSERT_PROC_ADDRESS(gl, DisableVertexAttribArray);        INSERT_PROC_ADDRESS(gl, DrawArrays);        INSERT_PROC_ADDRESS(gl, DrawElements);        INSERT_PROC_ADDRESS(gl, Enable);        INSERT_PROC_ADDRESS(gl, EnableVertexAttribArray);        INSERT_PROC_ADDRESS(gl, Finish);        INSERT_PROC_ADDRESS(gl, Flush);        INSERT_PROC_ADDRESS(gl, FramebufferRenderbuffer);        INSERT_PROC_ADDRESS(gl, FramebufferTexture2D);        INSERT_PROC_ADDRESS(gl, FrontFace);        INSERT_PROC_ADDRESS(gl, GenBuffers);        INSERT_PROC_ADDRESS(gl, GenerateMipmap);        INSERT_PROC_ADDRESS(gl, GenFramebuffers);        INSERT_PROC_ADDRESS(gl, GenRenderbuffers);        INSERT_PROC_ADDRESS(gl, GenTextures);        INSERT_PROC_ADDRESS(gl, GetActiveAttrib);        INSERT_PROC_ADDRESS(gl, GetActiveUniform);        INSERT_PROC_ADDRESS(gl, GetAttachedShaders);        INSERT_PROC_ADDRESS(gl, GetAttribLocation);        INSERT_PROC_ADDRESS(gl, GetBooleanv);        INSERT_PROC_ADDRESS(gl, GetBufferParameteriv);        INSERT_PROC_ADDRESS(gl, GetError);        INSERT_PROC_ADDRESS(gl, GetFloatv);        INSERT_PROC_ADDRESS(gl, GetFramebufferAttachmentParameteriv);        INSERT_PROC_ADDRESS(gl, GetIntegerv);        INSERT_PROC_ADDRESS(gl, GetProgramiv);        INSERT_PROC_ADDRESS(gl, GetProgramInfoLog);        INSERT_PROC_ADDRESS(gl, GetRenderbufferParameteriv);        INSERT_PROC_ADDRESS(gl, GetShaderiv);        INSERT_PROC_ADDRESS(gl, GetShaderInfoLog);        INSERT_PROC_ADDRESS(gl, GetShaderPrecisionFormat);        INSERT_PROC_ADDRESS(gl, GetShaderSource);        INSERT_PROC_ADDRESS(gl, GetString);        INSERT_PROC_ADDRESS(gl, GetTexParameterfv);        INSERT_PROC_ADDRESS(gl, GetTexParameteriv);        INSERT_PROC_ADDRESS(gl, GetUniformfv);        INSERT_PROC_ADDRESS(gl, GetUniformiv);        INSERT_PROC_ADDRESS(gl, GetUniformLocation);        INSERT_PROC_ADDRESS(gl, GetVertexAttribfv);        INSERT_PROC_ADDRESS(gl, GetVertexAttribiv);        INSERT_PROC_ADDRESS(gl, GetVertexAttribPointerv);        INSERT_PROC_ADDRESS(gl, Hint);        INSERT_PROC_ADDRESS(gl, IsBuffer);        INSERT_PROC_ADDRESS(gl, IsEnabled);        INSERT_PROC_ADDRESS(gl, IsFramebuffer);        INSERT_PROC_ADDRESS(gl, IsProgram);        INSERT_PROC_ADDRESS(gl, IsRenderbuffer);        INSERT_PROC_ADDRESS(gl, IsShader);        INSERT_PROC_ADDRESS(gl, IsTexture);//.........这里部分代码省略.........
开发者ID:MoonchildProductions,项目名称:Pale-Moon,代码行数:101,


示例7: GetDisplay

EGLDisplay EGLAPIENTRY GetDisplay(EGLNativeDisplayType display_id){    EVENT("(EGLNativeDisplayType display_id = 0x%0.8p)", display_id);    return Display::getDisplay(display_id, AttributeMap());}
开发者ID:MoonchildProductions,项目名称:Pale-Moon,代码行数:6,


示例8: rtm_load

//.........这里部分代码省略.........		if (read_object_header(f, &oh, "RTND") < 0) {			D_(D_CRIT "Error reading pattern %d", i);			return -1;		}			rp.flags = hio_read16l(f);		rp.ntrack = hio_read8(f);		rp.nrows = hio_read16l(f);		rp.datasize = hio_read32l(f);		/* Sanity check */		if (rp.ntrack > rh.ntrack || rp.nrows > 256) {			return -1;		}		offset += 42 + oh.headerSize + rp.datasize;		if (libxmp_alloc_pattern_tracks(mod, i, rp.nrows) < 0)			return -1;		for (r = 0; r < rp.nrows; r++) {			for (j = 0; /*j < rp.ntrack */; j++) {				c = hio_read8(f);				if (c == 0)		/* next row */					break;				/* Sanity check */				if (j >= rp.ntrack) {					return -1;				}				event = &EVENT(i, j, r);				if (c & 0x01) {		/* set track */					j = hio_read8(f);					/* Sanity check */					if (j >= rp.ntrack) {						return -1;					}					event = &EVENT(i, j, r);				}				if (c & 0x02) {		/* read note */					event->note = hio_read8(f) + 1;					if (event->note == 0xff) {						event->note = XMP_KEY_OFF;					} else {						event->note += 12;					}				}				if (c & 0x04)		/* read instrument */					event->ins = hio_read8(f);				if (c & 0x08)		/* read effect */					event->fxt = hio_read8(f);				if (c & 0x10)		/* read parameter */					event->fxp = hio_read8(f);				if (c & 0x20)		/* read effect 2 */					event->f2t = hio_read8(f);				if (c & 0x40)		/* read parameter 2 */					event->f2p = hio_read8(f);			}		}	}
开发者ID:wothke,项目名称:libxmp-4.3.0,代码行数:67,


示例9: eglCreateWindowSurface

EGLSurface __stdcall eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list){    EVENT("(EGLDisplay dpy = 0x%0.8p, EGLConfig config = 0x%0.8p, EGLNativeWindowType win = 0x%0.8p, "          "const EGLint *attrib_list = 0x%0.8p)", dpy, config, win, attrib_list);    try    {        egl::Display *display = static_cast<egl::Display*>(dpy);        if (!validate(display, config))        {            return EGL_NO_SURFACE;        }        HWND window = (HWND)win;        if (!IsWindow(window))        {            return error(EGL_BAD_NATIVE_WINDOW, EGL_NO_SURFACE);        }        if (attrib_list)        {            while (*attrib_list != EGL_NONE)            {                switch (attrib_list[0])                {                  case EGL_RENDER_BUFFER:                    switch (attrib_list[1])                    {                      case EGL_BACK_BUFFER:                        break;                      case EGL_SINGLE_BUFFER:                        return error(EGL_BAD_MATCH, EGL_NO_SURFACE);   // Rendering directly to front buffer not supported                      default:                        return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);                    }                    break;                  case EGL_VG_COLORSPACE:                    return error(EGL_BAD_MATCH, EGL_NO_SURFACE);                  case EGL_VG_ALPHA_FORMAT:                    return error(EGL_BAD_MATCH, EGL_NO_SURFACE);                  default:                    return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);                }                attrib_list += 2;            }        }        if (display->hasExistingWindowSurface(window))        {            return error(EGL_BAD_ALLOC, EGL_NO_SURFACE);        }        EGLSurface surface = (EGLSurface)display->createWindowSurface(window, config);        return success(surface);    }    catch(std::bad_alloc&)    {        return error(EGL_BAD_ALLOC, EGL_NO_SURFACE);    }    return EGL_NO_SURFACE;}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:66,


示例10: ACE_NEW_THROW_EX

CUTS_CCM_Event_T <EVENT>::CUTS_CCM_Event_T (void){  _ptr_type ev = 0;  ACE_NEW_THROW_EX (ev, EVENT (), ::CORBA::NO_MEMORY ());  this->event_ = ev;}
开发者ID:SEDS,项目名称:CUTS,代码行数:6,


示例11: mod_load

//.........这里部分代码省略.........	goto skip_test;    }    /* Test for Protracker song files     */    else if ((ptsong = (!strncmp((char *)magic, "M.K.", 4) &&		(0x43c + mod->pat * 0x400 == m->size)))) {	tracker = "Protracker";	goto skip_test;    }    /* Test Protracker-like files     */    if (mod->chn == 4 && mh.restart == mod->pat) {	tracker = "Soundtracker";    } else if (mod->chn == 4 && mh.restart == 0x78) {	tracker = "Noisetracker" /*" (0x78)"*/;	ptkloop = 1;    } else if (mh.restart < 0x7f) {	if (mod->chn == 4) {	    tracker = "Noisetracker";	    ptkloop = 1;	} else {	    tracker = "unknown tracker";	    ptkloop = 0;	}	mod->rst = mh.restart;    }    if (mod->chn != 4 && mh.restart == 0x7f) {	tracker = "Scream Tracker 3 MOD";	ptkloop = 0;	m->quirk &= ~QUIRK_MODRNG;	m->read_event_type = READ_EVENT_ST3;    }    if (mod->chn == 4 && mh.restart == 0x7f) {	for (i = 0; i < 31; i++) {	    if (mh.ins[i].loop_size == 0)		break;	}	if (i < 31) {	    tracker = "Protracker clone";	    ptkloop = 0;	}    }    if (mh.restart != 0x78 && mh.restart < 0x7f) {	for (i = 0; i < 31; i++) {	    if (mh.ins[i].loop_size == 0)		break;	}	if (i == 31) {	/* All loops are size 2 or greater */	    for (i = 0; i < 31; i++) {		if (mh.ins[i].size == 1 && mh.ins[i].volume == 0) {		    tracker = "Probably converted";		    ptkloop = 0;		    goto skip_test;		}	    }	    for (i = 0; i < 31; i++) {	        if (is_st_ins((char *)mh.ins[i].name))		    break;	    }	    if (i == 31) {	/* No st- instruments */
开发者ID:cmatsuoka,项目名称:chiptune.js,代码行数:67,


示例12: stc_load

//.........这里部分代码省略.........        stc_pat[i].ch[0] = hio_read16l(f);        stc_pat[i].ch[1] = hio_read16l(f);        stc_pat[i].ch[2] = hio_read16l(f);    }    for (i = 0; i < mod->len; i++) {		/* pattern */        int src = stc_ord[i].pattern - 1;        int dest = mod->xxo[i];        int trans = stc_ord[i].height;        if (decoded[dest])            continue;        //printf("%d/%d) Read pattern %d -> %d/n", i, mod->len, src, dest);        if (pattern_tracks_alloc(mod, dest, 64) < 0)            return -1;        for (j = 0; j < 3; j++) {		/* row */            int row = 0;            int x;            int rowinc = 0;            hio_seek(f, stc_pat[src].ch[j], SEEK_SET);            do {                for (;;) {                    x = hio_read8(f);                    if (x == 0xff)                        break;//printf("pat %d, channel %d, row %d, x = %02x/n", dest, j, row, x);                    event = &EVENT(dest, j, row);                    if (x <= 0x5f) {                        event->note = x + 18 + trans;                        row += 1 + rowinc;                        break;                    }                    if (x <= 0x6f) {                        event->ins = x - 0x5f - 1;                    } else if (x <= 0x7f) {                        /* ornament*/                        event->fxt = FX_SYNTH_0;                        event->fxp = x - 0x70;                    } else if (x == 0x80) {                        event->note = XMP_KEY_OFF;                        row += 1 + rowinc;                        break;                    } else if (x == 0x81) {                        /* ? */                        row += 1 + rowinc;                    } else if (x == 0x82) {                        /* disable ornament/envelope */                        event->fxt = FX_SYNTH_0;                        event->fxp = 0;                        event->f2t = FX_SYNTH_2;                        event->f2p = 0;                    } else if (x <= 0x8e) {                        /* envelope */                        event->fxt = FX_SYNTH_0 +                                     x - 0x80;      /* R13 */                        event->fxp = hio_read8(f); /* R11 */                        event->f2t = FX_SYNTH_1;
开发者ID:rikolous,项目名称:gideros,代码行数:67,


示例13: _alpm_sync_commit

int _alpm_sync_commit(alpm_handle_t *handle, alpm_list_t **data){	alpm_list_t *i;	alpm_list_t *deltas = NULL;	size_t numtargs, current = 0, replaces = 0;	int errors;	alpm_trans_t *trans = handle->trans;	if(download_files(handle, &deltas)) {		alpm_list_free(deltas);		return -1;	}	if(validate_deltas(handle, deltas, data)) {		alpm_list_free(deltas);		return -1;	}	alpm_list_free(deltas);	/* Check integrity of packages */	numtargs = alpm_list_count(trans->add);	EVENT(trans, ALPM_TRANS_EVT_INTEGRITY_START, NULL, NULL);	errors = 0;	for(i = trans->add; i; i = i->next, current++) {		alpm_pkg_t *spkg = i->data;		int percent = (current * 100) / numtargs;		const char *filename;		char *filepath;		alpm_siglevel_t level;		PROGRESS(trans, ALPM_TRANS_PROGRESS_INTEGRITY_START, "", percent,				numtargs, current);		if(spkg->origin == PKG_FROM_FILE) {			continue; /* pkg_load() has been already called, this package is valid */		}		filename = alpm_pkg_get_filename(spkg);		filepath = _alpm_filecache_find(handle, filename);		alpm_db_t *sdb = alpm_pkg_get_db(spkg);		level = alpm_db_get_siglevel(sdb);		/* load the package file and replace pkgcache entry with it in the target list */		/* TODO: alpm_pkg_get_db() will not work on this target anymore */		_alpm_log(handle, ALPM_LOG_DEBUG,				"replacing pkgcache entry with package file for target %s/n",				spkg->name);		alpm_pkg_t *pkgfile =_alpm_pkg_load_internal(handle, filepath, 1, spkg->md5sum,				spkg->base64_sig, level);		if(!pkgfile) {			errors++;			*data = alpm_list_add(*data, strdup(filename));			FREE(filepath);			continue;		}		FREE(filepath);		pkgfile->reason = spkg->reason; /* copy over install reason */		i->data = pkgfile;		_alpm_pkg_free_trans(spkg); /* spkg has been removed from the target list */	}	PROGRESS(trans, ALPM_TRANS_PROGRESS_INTEGRITY_START, "", 100,			numtargs, current);	EVENT(trans, ALPM_TRANS_EVT_INTEGRITY_DONE, NULL, NULL);	if(errors) {		RET_ERR(handle, ALPM_ERR_PKG_INVALID, -1);	}	if(trans->flags & ALPM_TRANS_FLAG_DOWNLOADONLY) {		return 0;	}	trans->state = STATE_COMMITING;	replaces = alpm_list_count(trans->remove);	/* fileconflict check */	if(!(trans->flags & ALPM_TRANS_FLAG_FORCE)) {		EVENT(trans, ALPM_TRANS_EVT_FILECONFLICTS_START, NULL, NULL);		_alpm_log(handle, ALPM_LOG_DEBUG, "looking for file conflicts/n");		alpm_list_t *conflict = _alpm_db_find_fileconflicts(handle,				trans->add, trans->remove);		if(conflict) {			if(data) {				*data = conflict;			} else {				alpm_list_free_inner(conflict, (alpm_list_fn_free)_alpm_fileconflict_free);				alpm_list_free(conflict);			}			RET_ERR(handle, ALPM_ERR_FILE_CONFLICTS, -1);		}		EVENT(trans, ALPM_TRANS_EVT_FILECONFLICTS_DONE, NULL, NULL);	}	/* check available disk space *///.........这里部分代码省略.........
开发者ID:matthewbauer,项目名称:unipkg-pacman,代码行数:101,


示例14: download_files

static int download_files(alpm_handle_t *handle, alpm_list_t **deltas){	const char *cachedir;	alpm_list_t *i, *j;	alpm_list_t *files = NULL;	int errors = 0;	cachedir = _alpm_filecache_setup(handle);	handle->trans->state = STATE_DOWNLOADING;	/* Total progress - figure out the total download size if required to	 * pass to the callback. This function is called once, and it is up to the	 * frontend to compute incremental progress. */	if(handle->totaldlcb) {		off_t total_size = (off_t)0;		/* sum up the download size for each package and store total */		for(i = handle->trans->add; i; i = i->next) {			alpm_pkg_t *spkg = i->data;			total_size += spkg->download_size;		}		handle->totaldlcb(total_size);	}	/* group sync records by repository and download */	for(i = handle->dbs_sync; i; i = i->next) {		alpm_db_t *current = i->data;		for(j = handle->trans->add; j; j = j->next) {			alpm_pkg_t *spkg = j->data;			if(spkg->origin != PKG_FROM_FILE && current == spkg->origin_data.db) {				alpm_list_t *delta_path = spkg->delta_path;				if(delta_path) {					/* using deltas */					alpm_list_t *dlts;					for(dlts = delta_path; dlts; dlts = dlts->next) {						alpm_delta_t *delta = dlts->data;						if(delta->download_size != 0) {							struct dload_payload *dpayload;							CALLOC(dpayload, 1, sizeof(*dpayload), RET_ERR(handle, ALPM_ERR_MEMORY, -1));							STRDUP(dpayload->filename, delta->delta, RET_ERR(handle, ALPM_ERR_MEMORY, -1));							dpayload->max_size = delta->download_size;							files = alpm_list_add(files, dpayload);						}						/* keep a list of all the delta files for md5sums */						*deltas = alpm_list_add(*deltas, delta);					}				} else if(spkg->download_size != 0) {					struct dload_payload *payload;					ASSERT(spkg->filename != NULL, RET_ERR(handle, ALPM_ERR_PKG_INVALID_NAME, -1));					CALLOC(payload, 1, sizeof(*payload), RET_ERR(handle, ALPM_ERR_MEMORY, -1));					STRDUP(payload->filename, spkg->filename, RET_ERR(handle, ALPM_ERR_MEMORY, -1));					payload->max_size = alpm_pkg_get_size(spkg);					files = alpm_list_add(files, payload);				}			}		}		if(files) {			EVENT(handle->trans, ALPM_TRANS_EVT_RETRIEVE_START, current->treename, NULL);			for(j = files; j; j = j->next) {				struct dload_payload *payload = j->data;				alpm_list_t *server;				int ret = -1;				for(server = current->servers; server; server = server->next) {					const char *server_url = server->data;					size_t len;					/* print server + filename into a buffer */					len = strlen(server_url) + strlen(payload->filename) + 2;					CALLOC(payload->fileurl, len, sizeof(char), RET_ERR(handle, ALPM_ERR_MEMORY, -1));					snprintf(payload->fileurl, len, "%s/%s", server_url, payload->filename);					payload->handle = handle;					payload->allow_resume = 1;					ret = _alpm_download(payload, cachedir, NULL);					if(ret != -1) {						break;					}				}				if(ret == -1) {					errors++;				}			}			alpm_list_free_inner(files, (alpm_list_fn_free)_alpm_dload_payload_free);			alpm_list_free(files);			files = NULL;			if(errors) {				_alpm_log(handle, ALPM_LOG_WARNING, _("failed to retrieve some files from %s/n"),						current->treename);				if(handle->pm_errno == 0) {					handle->pm_errno = ALPM_ERR_RETRIEVE;				}//.........这里部分代码省略.........
开发者ID:matthewbauer,项目名称:unipkg-pacman,代码行数:101,


示例15: GetPlatformDisplayEXT

// EGL_EXT_platform_baseEGLDisplay EGLAPIENTRY GetPlatformDisplayEXT(EGLenum platform, void *native_display, const EGLint *attrib_list){    EVENT("(EGLenum platform = %d, void* native_display = 0x%0.8p, const EGLint* attrib_list = 0x%0.8p)",          platform, native_display, attrib_list);    const ClientExtensions &clientExtensions = Display::getClientExtensions();    switch (platform)    {      case EGL_PLATFORM_ANGLE_ANGLE:        if (!clientExtensions.platformANGLE)        {            SetGlobalError(Error(EGL_BAD_PARAMETER));            return EGL_NO_DISPLAY;        }        break;      default:        SetGlobalError(Error(EGL_BAD_CONFIG));        return EGL_NO_DISPLAY;    }    EGLint platformType = EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE;    EGLint deviceType = EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE;    bool majorVersionSpecified = false;    bool minorVersionSpecified = false;    bool enableAutoTrimSpecified = false;    bool deviceTypeSpecified = false;    bool requestedAllowRenderToBackBuffer = false;#if defined(ANGLE_ENABLE_WINDOWS_STORE)    requestedAllowRenderToBackBuffer = true;#endif    if (attrib_list)    {        for (const EGLint *curAttrib = attrib_list; curAttrib[0] != EGL_NONE; curAttrib += 2)        {            switch (curAttrib[0])            {              case EGL_PLATFORM_ANGLE_TYPE_ANGLE:                switch (curAttrib[1])                {                  case EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE:                    break;                  case EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE:                  case EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE:                    if (!clientExtensions.platformANGLED3D)                    {                        SetGlobalError(Error(EGL_BAD_ATTRIBUTE));                        return EGL_NO_DISPLAY;                    }                    break;                  case EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE:                  case EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE:                    if (!clientExtensions.platformANGLEOpenGL)                    {                        SetGlobalError(Error(EGL_BAD_ATTRIBUTE));                        return EGL_NO_DISPLAY;                    }                    break;                  default:                    SetGlobalError(Error(EGL_BAD_ATTRIBUTE));                    return EGL_NO_DISPLAY;                }                platformType = curAttrib[1];                break;              case EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE:                if (curAttrib[1] != EGL_DONT_CARE)                {                    majorVersionSpecified = true;                }                break;              case EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE:                if (curAttrib[1] != EGL_DONT_CARE)                {                    minorVersionSpecified = true;                }                break;              case EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE:                switch (curAttrib[1])                {                  case EGL_TRUE:                  case EGL_FALSE:                    break;                  default:                    SetGlobalError(Error(EGL_BAD_ATTRIBUTE));                    return EGL_NO_DISPLAY;                }                enableAutoTrimSpecified = true;                break;              case EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE://.........这里部分代码省略.........
开发者ID:dreamsxin,项目名称:bombyx3d,代码行数:101,


示例16: eglCreatePbufferSurface

EGLSurface __stdcall eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list){    EVENT("(EGLDisplay dpy = 0x%0.8p, EGLConfig config = 0x%0.8p, const EGLint *attrib_list = 0x%0.8p)",          dpy, config, attrib_list);    try    {        egl::Display *display = static_cast<egl::Display*>(dpy);        EGLint width = 0, height = 0;        if (!validate(display, config))        {            return EGL_NO_SURFACE;        }        if (attrib_list)        {            while (*attrib_list != EGL_NONE)            {                switch (attrib_list[0])                {                  case EGL_WIDTH:                    width = attrib_list[1];                    break;                  case EGL_HEIGHT:                    height = attrib_list[1];                    break;                  case EGL_LARGEST_PBUFFER:                    if (attrib_list[1] != EGL_FALSE)                      UNIMPLEMENTED(); // FIXME                    break;                  case EGL_TEXTURE_FORMAT:                  case EGL_TEXTURE_TARGET:                    switch (attrib_list[1])                    {                      case EGL_NO_TEXTURE:                        break;                      default:                        return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);                    }                    break;                  case EGL_MIPMAP_TEXTURE:                    if (attrib_list[1] != EGL_FALSE)                      return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);                    break;                  case EGL_VG_COLORSPACE:                    return error(EGL_BAD_MATCH, EGL_NO_SURFACE);                  case EGL_VG_ALPHA_FORMAT:                    return error(EGL_BAD_MATCH, EGL_NO_SURFACE);                  default:                    return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);                }                attrib_list += 2;            }        }        if (width == 0 || height == 0)          return error(EGL_BAD_ATTRIBUTE, EGL_NO_SURFACE);        EGLSurface surface = (EGLSurface)display->createOffscreenSurface(width, height, config);        return success(surface);    }    catch(std::bad_alloc&)    {        return error(EGL_BAD_ALLOC, EGL_NO_SURFACE);    }    return EGL_NO_SURFACE;}
开发者ID:LittleForker,项目名称:mozilla-central,代码行数:71,


示例17: polly_load

static int polly_load(struct module_data *m, FILE *f, const int start){	struct xmp_module *mod = &m->mod;	struct xmp_event *event;	uint8 *buf;	int i, j, k;	LOAD_INIT();	read8(f);			/* skip 0xae */	/*	 * File is RLE-encoded, escape is 0xAE (Aleksi Eeben's initials).	 * Actual 0xAE is encoded as 0xAE 0x01	 */	if ((buf = calloc(1, 0x10000)) == NULL)		return -1;	decode_rle(buf, f, 0x10000);	for (i = 0; buf[ORD_OFS + i] != 0 && i < 128; i++)		mod->xxo[i] = buf[ORD_OFS + i] - 0xe0;	mod->len = i;	memcpy(mod->name, buf + ORD_OFS + 160, 16);	/* memcpy(m->author, buf + ORD_OFS + 176, 16); */	set_type(m, "Polly Tracker");	MODULE_INFO();	mod->spd = 0x03;	mod->bpm = 0x7d * buf[ORD_OFS + 193] / 0x88;#if 0	for (i = 0; i < 1024; i++) {		if ((i % 16) == 0) printf("/n");		printf("%02x ", buf[ORD_OFS + i]);	}#endif	mod->pat = 0;	for (i = 0; i < mod->len; i++) {		if (mod->xxo[i] > mod->pat)			mod->pat = mod->xxo[i];	}	mod->pat++;		mod->chn = 4;	mod->trk = mod->pat * mod->chn;	PATTERN_INIT();	D_(D_INFO "Stored patterns: %d", mod->pat);	for (i = 0; i < mod->pat; i++) {		PATTERN_ALLOC(i);		mod->xxp[i]->rows = 64;		TRACK_ALLOC(i);		for (j = 0; j < 64; j++) {			for (k = 0; k < 4; k++) {				uint8 x = buf[i * PAT_SIZE + j * 4 + k];				event = &EVENT(i, k, j);				if (x == 0xf0) {					event->fxt = FX_BREAK;					event->fxp = 0;					continue;				}				event->note = LSN(x);				if (event->note)					event->note += 48;				event->ins = MSN(x);			}		}	}	mod->ins = mod->smp = 15;	INSTRUMENT_INIT();	for (i = 0; i < 15; i++) {		mod->xxi[i].sub = calloc(sizeof (struct xmp_subinstrument), 1);		mod->xxs[i].len = buf[ORD_OFS + 129 + i] < 0x10 ? 0 :					256 * buf[ORD_OFS + 145 + i];		mod->xxi[i].sub[0].fin = 0;		mod->xxi[i].sub[0].vol = 0x40;		mod->xxs[i].lps = 0;		mod->xxs[i].lpe = 0;		mod->xxs[i].flg = 0;		mod->xxi[i].sub[0].pan = 0x80;		mod->xxi[i].sub[0].sid = i;		mod->xxi[i].nsm = !!(mod->xxs[i].len);		mod->xxi[i].rls = 0xfff;                D_(D_INFO "[%2X] %04x %04x %04x %c V%02x",                       		i, mod->xxs[i].len, mod->xxs[i].lps,                        	mod->xxs[i].lpe, ' ', mod->xxi[i].sub[0].vol);	}	/* Convert samples from 6 to 8 bits */	for (i = SMP_OFS; i < 0x10000; i++)		buf[i] = buf[i] << 2;	/* Read samples *///.........这里部分代码省略.........
开发者ID:cmatsuoka,项目名称:chiptune.js,代码行数:101,


示例18: coco_load

static int coco_load(struct module_data *m, HIO_HANDLE *f, const int start){	struct xmp_module *mod = &m->mod;	struct xmp_event *event;	int i, j;	int seq_ptr, pat_ptr, smp_ptr[100];	LOAD_INIT();	mod->chn = hio_read8(f) & 0x3f;	libxmp_read_title(f, mod->name, 20);	for (i = 0; i < 20; i++) {		if (mod->name[i] == 0x0d)			mod->name[i] = 0;	}	libxmp_set_type(m, "Coconizer");	mod->ins = mod->smp = hio_read8(f);	mod->len = hio_read8(f);	mod->pat = hio_read8(f);	mod->trk = mod->pat * mod->chn;	seq_ptr = hio_read32l(f);	pat_ptr = hio_read32l(f);	MODULE_INFO();	if (libxmp_init_instrument(m) < 0)		return -1;	m->vol_table = (int *)arch_vol_table;	m->volbase = 0xff;	for (i = 0; i < mod->ins; i++) {		if (libxmp_alloc_subinstrument(mod, i, 1) < 0)			return -1;		smp_ptr[i] = hio_read32l(f);		mod->xxs[i].len = hio_read32l(f);		mod->xxi[i].sub[0].vol = 0xff - hio_read32l(f);		mod->xxi[i].sub[0].pan = 0x80;		mod->xxs[i].lps = hio_read32l(f);                mod->xxs[i].lpe = mod->xxs[i].lps + hio_read32l(f);		if (mod->xxs[i].lpe)			mod->xxs[i].lpe -= 1;		mod->xxs[i].flg = mod->xxs[i].lps > 0 ?  XMP_SAMPLE_LOOP : 0;		hio_read(mod->xxi[i].name, 1, 11, f);		for (j = 0; j < 11; j++) {			if (mod->xxi[i].name[j] == 0x0d)				mod->xxi[i].name[j] = 0;		}		hio_read8(f);	/* unused */		mod->xxi[i].sub[0].sid = i;		if (mod->xxs[i].len > 0)			mod->xxi[i].nsm = 1;		D_(D_INFO "[%2X] %-10.10s  %05x %05x %05x %c V%02x",				i, mod->xxi[i].name,				mod->xxs[i].len, mod->xxs[i].lps, mod->xxs[i].lpe,				mod->xxs[i].flg & XMP_SAMPLE_LOOP ? 'L' : ' ',				mod->xxi[i].sub[0].vol);	}	/* Sequence */	hio_seek(f, start + seq_ptr, SEEK_SET);	for (i = 0; ; i++) {		uint8 x = hio_read8(f);		if (x == 0xff)			break;		mod->xxo[i] = x;	}	for (i++; i % 4; i++)	/* for alignment */		hio_read8(f);	/* Patterns */	if (libxmp_init_pattern(mod) < 0)		return -1;	D_(D_INFO "Stored patterns: %d", mod->pat);	for (i = 0; i < mod->pat; i++) {		if (libxmp_alloc_pattern_tracks(mod, i, 64) < 0)			return -1;		for (j = 0; j < (64 * mod->chn); j++) {			event = &EVENT (i, j % mod->chn, j / mod->chn);			event->fxp = hio_read8(f);			event->fxt = hio_read8(f);			event->ins = hio_read8(f);			event->note = hio_read8(f);			if (event->note)				event->note += 12;			fix_effect(event);//.........这里部分代码省略.........
开发者ID:cmatsuoka,项目名称:libxmp,代码行数:101,


示例19: QuerySurface

EGLBoolean EGLAPIENTRY QuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value){    EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLint attribute = %d, EGLint *value = 0x%0.8p)",          dpy, surface, attribute, value);    Display *display = static_cast<Display*>(dpy);    Surface *eglSurface = (Surface*)surface;    Error error = ValidateSurface(display, eglSurface);    if (error.isError())    {        SetGlobalError(error);        return EGL_FALSE;    }    if (surface == EGL_NO_SURFACE)    {        SetGlobalError(Error(EGL_BAD_SURFACE));        return EGL_FALSE;    }    switch (attribute)    {      case EGL_VG_ALPHA_FORMAT:        UNIMPLEMENTED();   // FIXME        break;      case EGL_VG_COLORSPACE:        UNIMPLEMENTED();   // FIXME        break;      case EGL_CONFIG_ID:        *value = eglSurface->getConfig()->configID;        break;      case EGL_HEIGHT:        *value = eglSurface->getHeight();        break;      case EGL_HORIZONTAL_RESOLUTION:        UNIMPLEMENTED();   // FIXME        break;      case EGL_LARGEST_PBUFFER:        UNIMPLEMENTED();   // FIXME        break;      case EGL_MIPMAP_TEXTURE:        UNIMPLEMENTED();   // FIXME        break;      case EGL_MIPMAP_LEVEL:        UNIMPLEMENTED();   // FIXME        break;      case EGL_MULTISAMPLE_RESOLVE:        UNIMPLEMENTED();   // FIXME        break;      case EGL_PIXEL_ASPECT_RATIO:        *value = eglSurface->getPixelAspectRatio();        break;      case EGL_RENDER_BUFFER:        *value = eglSurface->getRenderBuffer();        break;      case EGL_SWAP_BEHAVIOR:        *value = eglSurface->getSwapBehavior();        break;      case EGL_TEXTURE_FORMAT:        *value = eglSurface->getTextureFormat();        break;      case EGL_TEXTURE_TARGET:        *value = eglSurface->getTextureTarget();        break;      case EGL_VERTICAL_RESOLUTION:        UNIMPLEMENTED();   // FIXME        break;      case EGL_WIDTH:        *value = eglSurface->getWidth();        break;      case EGL_POST_SUB_BUFFER_SUPPORTED_NV:        if (!display->getExtensions().postSubBuffer)        {            SetGlobalError(Error(EGL_BAD_ATTRIBUTE));            return EGL_FALSE;        }        *value = eglSurface->isPostSubBufferSupported();        break;      case EGL_FIXED_SIZE_ANGLE:        if (!display->getExtensions().windowFixedSize)        {            SetGlobalError(Error(EGL_BAD_ATTRIBUTE));            return EGL_FALSE;        }        *value = eglSurface->isFixedSize();        break;      default:        SetGlobalError(Error(EGL_BAD_ATTRIBUTE));        return EGL_FALSE;    }    SetGlobalError(Error(EGL_SUCCESS));    return EGL_TRUE;}
开发者ID:MoonchildProductions,项目名称:Pale-Moon,代码行数:95,


示例20: eglQuerySurface

EGLBoolean __stdcall eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value){    EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLint attribute = %d, EGLint *value = 0x%0.8p)",          dpy, surface, attribute, value);    ANGLE_TRY    {        egl::Display *display = static_cast<egl::Display*>(dpy);        egl::Surface *eglSurface = (egl::Surface*)surface;        if (!validateSurface(display, eglSurface))        {            return EGL_FALSE;        }        if (surface == EGL_NO_SURFACE)        {            return egl::error(EGL_BAD_SURFACE, EGL_FALSE);        }        switch (attribute)        {          case EGL_VG_ALPHA_FORMAT:            UNIMPLEMENTED();   // FIXME            break;          case EGL_VG_COLORSPACE:            UNIMPLEMENTED();   // FIXME            break;          case EGL_CONFIG_ID:            *value = eglSurface->getConfigID();            break;          case EGL_HEIGHT:            *value = eglSurface->getHeight();            break;          case EGL_HORIZONTAL_RESOLUTION:            UNIMPLEMENTED();   // FIXME            break;          case EGL_LARGEST_PBUFFER:            UNIMPLEMENTED();   // FIXME            break;          case EGL_MIPMAP_TEXTURE:            UNIMPLEMENTED();   // FIXME            break;          case EGL_MIPMAP_LEVEL:            UNIMPLEMENTED();   // FIXME            break;          case EGL_MULTISAMPLE_RESOLVE:            UNIMPLEMENTED();   // FIXME            break;          case EGL_PIXEL_ASPECT_RATIO:            *value = eglSurface->getPixelAspectRatio();            break;          case EGL_RENDER_BUFFER:            *value = eglSurface->getRenderBuffer();            break;          case EGL_SWAP_BEHAVIOR:            *value = eglSurface->getSwapBehavior();            break;          case EGL_TEXTURE_FORMAT:            *value = eglSurface->getTextureFormat();            break;          case EGL_TEXTURE_TARGET:            *value = eglSurface->getTextureTarget();            break;          case EGL_VERTICAL_RESOLUTION:            UNIMPLEMENTED();   // FIXME            break;          case EGL_WIDTH:            *value = eglSurface->getWidth();            break;          case EGL_POST_SUB_BUFFER_SUPPORTED_NV:            *value = eglSurface->isPostSubBufferSupported();            break;          case EGL_FIXED_SIZE_ANGLE:            *value = eglSurface->isFixedSize();            break;          default:            return egl::error(EGL_BAD_ATTRIBUTE, EGL_FALSE);        }        return egl::success(EGL_TRUE);    }    ANGLE_CATCH_ALL    {        return egl::error(EGL_BAD_ALLOC, EGL_FALSE);    }}
开发者ID:rtwf,项目名称:skia-externals,代码行数:87,


示例21: MakeCurrent

EGLBoolean EGLAPIENTRY MakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx){    EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface draw = 0x%0.8p, EGLSurface read = 0x%0.8p, EGLContext ctx = 0x%0.8p)",          dpy, draw, read, ctx);    Display *display = static_cast<Display*>(dpy);    gl::Context *context = static_cast<gl::Context*>(ctx);    // If ctx is EGL_NO_CONTEXT and either draw or read are not EGL_NO_SURFACE, an EGL_BAD_MATCH    // error is generated.    if (ctx == EGL_NO_CONTEXT && (draw != EGL_NO_SURFACE || read != EGL_NO_SURFACE))    {        SetGlobalError(Error(EGL_BAD_MATCH));        return EGL_FALSE;    }    if (ctx != EGL_NO_CONTEXT && draw == EGL_NO_SURFACE && read == EGL_NO_SURFACE)    {        SetGlobalError(Error(EGL_BAD_MATCH));        return EGL_FALSE;    }    // If either of draw or read is a valid surface and the other is EGL_NO_SURFACE, an    // EGL_BAD_MATCH error is generated.    if ((read == EGL_NO_SURFACE) != (draw == EGL_NO_SURFACE))    {        SetGlobalError(Error(            EGL_BAD_MATCH, "read and draw must both be valid surfaces, or both be EGL_NO_SURFACE"));        return EGL_FALSE;    }    if (dpy == EGL_NO_DISPLAY || !Display::isValidDisplay(display))    {        SetGlobalError(Error(EGL_BAD_DISPLAY, "'dpy' not a valid EGLDisplay handle"));        return EGL_FALSE;    }    // EGL 1.5 spec: dpy can be uninitialized if all other parameters are null    if (!display->isInitialized() && (ctx != EGL_NO_CONTEXT || draw != EGL_NO_SURFACE || read != EGL_NO_SURFACE))    {        SetGlobalError(Error(EGL_NOT_INITIALIZED, "'dpy' not initialized"));        return EGL_FALSE;    }    if (ctx != EGL_NO_CONTEXT)    {        Error error = ValidateContext(display, context);        if (error.isError())        {            SetGlobalError(error);            return EGL_FALSE;        }    }    if (display->isInitialized())    {        if (display->testDeviceLost())        {            display->notifyDeviceLost();            return EGL_FALSE;        }        if (display->isDeviceLost())        {            SetGlobalError(Error(EGL_CONTEXT_LOST));            return EGL_FALSE;        }    }    Surface *drawSurface = static_cast<Surface*>(draw);    if (draw != EGL_NO_SURFACE)    {        Error error = ValidateSurface(display, drawSurface);        if (error.isError())        {            SetGlobalError(error);            return EGL_FALSE;        }    }    Surface *readSurface = static_cast<Surface*>(read);    if (read != EGL_NO_SURFACE)    {        Error error = ValidateSurface(display, readSurface);        if (error.isError())        {            SetGlobalError(error);            return EGL_FALSE;        }    }    if (readSurface)    {        Error readCompatError = ValidateCompatibleConfigs(readSurface->getConfig(), context->getConfig(), readSurface->getType());        if (readCompatError.isError())        {            SetGlobalError(readCompatError);            return EGL_FALSE;        }    }//.........这里部分代码省略.........
开发者ID:MoonchildProductions,项目名称:Pale-Moon,代码行数:101,


示例22: eglCreateContext

EGLContext __stdcall eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list){    EVENT("(EGLDisplay dpy = 0x%0.8p, EGLConfig config = 0x%0.8p, EGLContext share_context = 0x%0.8p, "          "const EGLint *attrib_list = 0x%0.8p)", dpy, config, share_context, attrib_list);    ANGLE_TRY    {        // Get the requested client version (default is 1) and check it is 2 or 3.        EGLint client_version = 1;        bool reset_notification = false;        bool robust_access = false;        if (attrib_list)        {            for (const EGLint* attribute = attrib_list; attribute[0] != EGL_NONE; attribute += 2)            {                switch (attribute[0])                {                  case EGL_CONTEXT_CLIENT_VERSION:                    client_version = attribute[1];                    break;                  case EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT:                    if (attribute[1] == EGL_TRUE)                    {                        return egl::error(EGL_BAD_CONFIG, EGL_NO_CONTEXT);   // Unimplemented                        // robust_access = true;                    }                    else if (attribute[1] != EGL_FALSE)                        return egl::error(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);                    break;                  case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT:                    if (attribute[1] == EGL_LOSE_CONTEXT_ON_RESET_EXT)                        reset_notification = true;                    else if (attribute[1] != EGL_NO_RESET_NOTIFICATION_EXT)                        return egl::error(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);                    break;                  default:                    return egl::error(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);                }            }        }        if (client_version != 2 && client_version != 3)        {            return egl::error(EGL_BAD_CONFIG, EGL_NO_CONTEXT);        }        egl::Display *display = static_cast<egl::Display*>(dpy);        if (share_context)        {            gl::Context* sharedGLContext = static_cast<gl::Context*>(share_context);            if (sharedGLContext->isResetNotificationEnabled() != reset_notification)            {                return egl::error(EGL_BAD_MATCH, EGL_NO_CONTEXT);            }            if (sharedGLContext->getClientVersion() != client_version)            {                return egl::error(EGL_BAD_CONTEXT, EGL_NO_CONTEXT);            }            // Can not share contexts between displays            if (sharedGLContext->getRenderer() != display->getRenderer())            {                return egl::error(EGL_BAD_MATCH, EGL_NO_CONTEXT);            }        }        if (!validateConfig(display, config))        {            return EGL_NO_CONTEXT;        }        return display->createContext(config, client_version, static_cast<gl::Context*>(share_context), reset_notification, robust_access);    }    ANGLE_CATCH_ALL    {        return egl::error(EGL_BAD_ALLOC, EGL_NO_CONTEXT);    }}
开发者ID:rtwf,项目名称:skia-externals,代码行数:82,


示例23: mod_load

//.........这里部分代码省略.........    strncpy(mod->name, (char *) mh.name, 20);    mod->len = mh.len;    /* mod->rst = mh.restart; */    if (mod->rst >= mod->len)	mod->rst = 0;    memcpy(mod->xxo, mh.order, 128);    for (i = 0; i < 128; i++) {	/* This fixes dragnet.mod (garbage in the order list) */	if (mod->xxo[i] > 0x7f)		break;	if (mod->xxo[i] > mod->pat)	    mod->pat = mod->xxo[i];    }    mod->pat++;    if (instrument_init(mod) < 0)	return -1;    for (i = 0; i < mod->ins; i++) {	if (subinstrument_alloc(mod, i, 1) < 0)	    return -1;	mod->xxs[i].len = 2 * mh.ins[i].size;	mod->xxs[i].lps = 2 * mh.ins[i].loop_start;	mod->xxs[i].lpe = mod->xxs[i].lps + 2 * mh.ins[i].loop_size;	if (mod->xxs[i].lpe > mod->xxs[i].len)		mod->xxs[i].lpe = mod->xxs[i].len;	mod->xxs[i].flg = (mh.ins[i].loop_size > 1 && mod->xxs[i].lpe >= 4) ?		XMP_SAMPLE_LOOP : 0;	mod->xxi[i].sub[0].fin = (int8)(mh.ins[i].finetune << 4);	mod->xxi[i].sub[0].vol = mh.ins[i].volume;	mod->xxi[i].sub[0].pan = 0x80;	mod->xxi[i].sub[0].sid = i;	instrument_name(mod, i, mh.ins[i].name, 22);	if (mod->xxs[i].len > 0)		mod->xxi[i].nsm = 1;    }    mod->trk = mod->chn * mod->pat;    set_type(m, mod->chn == 4 ? "Protracker" : "Fasttracker");    MODULE_INFO();    for (i = 0; i < mod->ins; i++) {	D_(D_INFO "[%2X] %-22.22s %04x %04x %04x %c V%02x %+d %c/n",		i, mod->xxi[i].name,		mod->xxs[i].len, mod->xxs[i].lps, mod->xxs[i].lpe,		(mh.ins[i].loop_size > 1 && mod->xxs[i].lpe > 8) ?			'L' : ' ', mod->xxi[i].sub[0].vol,		mod->xxi[i].sub[0].fin >> 4,		ptkloop && mod->xxs[i].lps == 0 && mh.ins[i].loop_size > 1 &&			mod->xxs[i].len > mod->xxs[i].lpe ? '!' : ' ');    }    if (pattern_init(mod) < 0)	return -1;    /* Load and convert patterns */    D_(D_INFO "Stored patterns: %d", mod->pat);    for (i = 0; i < mod->pat; i++) {	if (pattern_tracks_alloc(mod, i, 64) < 0)	    return -1;	for (j = 0; j < (64 * mod->chn); j++) {	    event = &EVENT (i, j % mod->chn, j / mod->chn);	    hio_read (mod_event, 1, 4, f);	    decode_protracker_event(event, mod_event);	}    }    /* Load samples */    D_(D_INFO "Stored samples: %d", mod->smp);    for (i = 0; i < mod->smp; i++) {	int flags;	if (!mod->xxs[i].len)	    continue;	flags = ptkloop ? SAMPLE_FLAG_FULLREP : 0;	if (load_sample(m, f, flags, &mod->xxs[i], NULL) < 0)	    return -1;    }    if (mod->chn > 4) {	m->quirk &= ~QUIRK_MODRNG;	m->quirk |= QUIRKS_FT2;	m->read_event_type = READ_EVENT_FT2;    }    return 0;}
开发者ID:Nlcke,项目名称:gideros,代码行数:101,


示例24: hsc_load

static int hsc_load(struct module_data *m, xmp_file f, const int start){    struct xmp_module *mod = &m->mod;    int pat, i, r, c;    struct xmp_event *event;    uint8 *x, *sid, e[2], buf[128 * 12];    LOAD_INIT();    xmp_fread(buf, 1, 128 * 12, f);    x = buf;    for (i = 0; i < 128; i++, x += 12) {	if (x[9] & ~0x3 || x[10] & ~0x3)	/* Test waveform register */	    break;	if (x[8] & ~0xf)			/* Test feedback & algorithm */	    break;    }    mod->ins = i;    xmp_fseek(f, start + 0, SEEK_SET);    mod->chn = 9;    mod->bpm = 135;    mod->spd = 6;    mod->smp = mod->ins;    m->quirk |= QUIRK_LINEAR;    set_type(m, "HSC-Tracker");    MODULE_INFO();    /* Read instruments */    INSTRUMENT_INIT();    xmp_fread (buf, 1, 128 * 12, f);    sid = buf;    for (i = 0; i < mod->ins; i++, sid += 12) {	mod->xxi[i].sub = calloc(sizeof (struct xmp_subinstrument), 1);	mod->xxi[i].nsm = 1;	mod->xxi[i].sub[0].vol = 0x40;	mod->xxi[i].sub[0].fin = (int8)sid[11] / 4;	mod->xxi[i].sub[0].pan = 0x80;	mod->xxi[i].sub[0].xpo = 0;	mod->xxi[i].sub[0].sid = i;	mod->xxi[i].rls = LSN(sid[7]) * 32;	/* carrier release */	load_sample(m, f, SAMPLE_FLAG_ADLIB | SAMPLE_FLAG_HSC,					&mod->xxs[i], (char *)sid);    }    /* Read orders */    for (pat = i = 0; i < 51; i++) {	xmp_fread (&mod->xxo[i], 1, 1, f);	if (mod->xxo[i] & 0x80)	    break;			/* FIXME: jump line */	if (mod->xxo[i] > pat)	    pat = mod->xxo[i];    }    xmp_fseek(f, 50 - i, SEEK_CUR);    mod->len = i;    mod->pat = pat + 1;    mod->trk = mod->pat * mod->chn;    D_(D_INFO "Module length: %d", mod->len);    D_(D_INFO "Instruments: %d", mod->ins);    D_(D_INFO "Stored patterns: %d", mod->pat);    PATTERN_INIT();    /* Read and convert patterns */    for (i = 0; i < mod->pat; i++) {	int ins[9] = { 1, 2, 3, 4, 5, 6, 7, 8, 9 };	PATTERN_ALLOC (i);	mod->xxp[i]->rows = 64;	TRACK_ALLOC (i);        for (r = 0; r < mod->xxp[i]->rows; r++) {            for (c = 0; c < 9; c++) {	        xmp_fread (e, 1, 2, f);	        event = &EVENT (i, c, r);		if (e[0] & 0x80) {		    ins[c] = e[1] + 1;		} else if (e[0] == 0x7f) {		    event->note = XMP_KEY_OFF;		} else if (e[0] > 0) {		    event->note = e[0] + 25;		    event->ins = ins[c];		}		event->fxt = 0;		event->fxp = 0;		if (e[1] == 0x01) {		    event->fxt = 0x0d;		    event->fxp = 0;		}	    }//.........这里部分代码省略.........
开发者ID:bithorder,项目名称:libxmp,代码行数:101,


示例25: stx_load

//.........这里部分代码省略.........	mod->xxs[i].lpe = sih.loopend;	if (mod->xxs[i].lpe == 0xffff)	    mod->xxs[i].lpe = 0;	mod->xxs[i].flg = mod->xxs[i].lpe > 0 ? XMP_SAMPLE_LOOP : 0;	mod->xxi[i].sub[0].vol = sih.vol;	mod->xxi[i].sub[0].pan = 0x80;	mod->xxi[i].sub[0].sid = i;	copy_adjust(mod->xxi[i].name, sih.name, 12);	D_(D_INFO "[%2X] %-14.14s %04x %04x %04x %c V%02x %5d/n", i,		mod->xxi[i].name, mod->xxs[i].len, mod->xxs[i].lps, mod->xxs[i].lpe,		mod->xxs[i].flg & XMP_SAMPLE_LOOP ? 'L' : ' ',		mod->xxi[i].sub[0].vol, sih.c2spd);	sih.c2spd = 8363 * sih.c2spd / 8448;	c2spd_to_note(sih.c2spd, &mod->xxi[i].sub[0].xpo, &mod->xxi[i].sub[0].fin);    }    PATTERN_INIT();    /* Read and convert patterns */    D_(D_INFO "Stored patterns: %d", mod->pat);    for (i = 0; i < mod->pat; i++) {	PATTERN_ALLOC (i);	mod->xxp[i]->rows = 64;	TRACK_ALLOC (i);	if (!pp_pat[i])	    continue;	xmp_fseek(f, start + (pp_pat[i] << 4), SEEK_SET);	if (broken)	    xmp_fseek(f, 2, SEEK_CUR);	for (r = 0; r < 64; ) {	    b = read8(f);	    if (b == S3M_EOR) {		r++;		continue;	    }	    c = b & S3M_CH_MASK;	    event = c >= mod->chn ? &dummy : &EVENT (i, c, r);	    if (b & S3M_NI_FOLLOW) {		n = read8(f);		switch (n) {		case 255:		    n = 0;		    break;	/* Empty note */		case 254:		    n = XMP_KEY_OFF;		    break;	/* Key off */		default:		    n = 37 + 12 * MSN (n) + LSN (n);		}		event->note = n;		event->ins = read8(f);;	    }	    if (b & S3M_VOL_FOLLOWS) {		event->vol = read8(f) + 1;	    }	    if (b & S3M_FX_FOLLOWS) {		event->fxt = fx[read8(f)];		event->fxp = read8(f);		switch (event->fxt) {		case FX_SPEED:		    event->fxp = MSN (event->fxp);		    break;		case FX_NONE:		    event->fxp = event->fxt = 0;		    break;		}	    }	}    }    free (pp_pat);    free (pp_ins);    /* Read samples */    D_(D_INFO "Stored samples: %d", mod->smp);    for (i = 0; i < mod->ins; i++) {	load_sample(m, f, 0, &mod->xxs[mod->xxi[i].sub[0].sid], NULL);    }    m->quirk |= QUIRK_VSALL | QUIRKS_ST3;    m->read_event_type = READ_EVENT_ST3;    return 0;}
开发者ID:bithorder,项目名称:libxmp,代码行数:101,


示例26: eglQuerySurface

EGLBoolean __stdcall eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value){    EVENT("(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLint attribute = %d, EGLint *value = 0x%0.8p)",          dpy, surface, attribute, value);    try    {        egl::Display *display = static_cast<egl::Display*>(dpy);        egl::Surface *eglSurface = (egl::Surface*)surface;        if (!validateSurface(display, eglSurface))        {            return EGL_FALSE;        }        if (surface == EGL_NO_SURFACE)        {            return error(EGL_BAD_SURFACE, EGL_FALSE);        }        switch (attribute)        {          case EGL_VG_ALPHA_FORMAT:            UNIMPLEMENTED();   // FIXME            break;          case EGL_VG_COLORSPACE:            UNIMPLEMENTED();   // FIXME            break;          case EGL_CONFIG_ID:            UNIMPLEMENTED();   // FIXME            break;          case EGL_HEIGHT:            *value = eglSurface->getHeight();            break;          case EGL_HORIZONTAL_RESOLUTION:            UNIMPLEMENTED();   // FIXME            break;          case EGL_LARGEST_PBUFFER:            UNIMPLEMENTED();   // FIXME            break;          case EGL_MIPMAP_TEXTURE:            UNIMPLEMENTED();   // FIXME            break;          case EGL_MIPMAP_LEVEL:            UNIMPLEMENTED();   // FIXME            break;          case EGL_MULTISAMPLE_RESOLVE:            UNIMPLEMENTED();   // FIXME            break;          case EGL_PIXEL_ASPECT_RATIO:            UNIMPLEMENTED();   // FIXME            break;          case EGL_RENDER_BUFFER:            UNIMPLEMENTED();   // FIXME            break;          case EGL_SWAP_BEHAVIOR:            UNIMPLEMENTED();   // FIXME            break;          case EGL_TEXTURE_FORMAT:            UNIMPLEMENTED();   // FIXME            break;          case EGL_TEXTURE_TARGET:            UNIMPLEMENTED();   // FIXME            break;          case EGL_VERTICAL_RESOLUTION:            UNIMPLEMENTED();   // FIXME            break;          case EGL_WIDTH:            *value = eglSurface->getWidth();            break;          case EGL_POST_SUB_BUFFER_SUPPORTED_NV:            *value = eglSurface->isPostSubBufferSupported();            break;          default:            return error(EGL_BAD_ATTRIBUTE, EGL_FALSE);        }        return success(EGL_TRUE);    }    catch(std::bad_alloc&)    {        return error(EGL_BAD_ALLOC, EGL_FALSE);    }    return EGL_FALSE;}
开发者ID:Anachid,项目名称:mozilla-central,代码行数:86,


示例27: EVENT

#include <string.h>#include "timestamp.h"struct event_name {	const char* 	name;	cmd_t	 	id;};#define EVENT(name)					/	{#name "_START", TS_ ## name ## _START},	/	{#name "_END", TS_ ## name ## _END}static struct event_name event_table[] ={	EVENT(SCHED),	EVENT(SCHED2),	EVENT(TICK),	EVENT(RELEASE),	EVENT(PLUGIN_SCHED),	EVENT(PLUGIN_TICK),	EVENT(CXS),	EVENT(SEND_RESCHED),	{"RELEASE_LATENCY", TS_RELEASE_LATENCY},	EVENT(SYSCALL_IN),	EVENT(SYSCALL_OUT),	EVENT(LOCK),	EVENT(UNLOCK),	{"LOCK_SUSPEND", TS_LOCK_SUSPEND},	{"LOCK_RESUME", TS_LOCK_RESUME},
开发者ID:brandenburg,项目名称:rt_schedtest,代码行数:31,


示例28: eglCreateContext

EGLContext __stdcall eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list){    EVENT("(EGLDisplay dpy = 0x%0.8p, EGLConfig config = 0x%0.8p, EGLContext share_context = 0x%0.8p, "          "const EGLint *attrib_list = 0x%0.8p)", dpy, config, share_context, attrib_list);    try    {        // Get the requested client version (default is 1) and check it is two.        EGLint client_version = 1;        bool reset_notification = false;        bool robust_access = false;        if (attrib_list)        {            for (const EGLint* attribute = attrib_list; attribute[0] != EGL_NONE; attribute += 2)            {                switch (attribute[0])                {                  case EGL_CONTEXT_CLIENT_VERSION:                    client_version = attribute[1];                    break;                  case EGL_CONTEXT_OPENGL_ROBUST_ACCESS_EXT:                    if (attribute[1] == EGL_TRUE)                    {                        return error(EGL_BAD_CONFIG, EGL_NO_CONTEXT);   // Unimplemented                        robust_access = true;                    }                    else if (attribute[1] != EGL_FALSE)                        return error(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);                    break;                  case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_EXT:                    if (attribute[1] == EGL_LOSE_CONTEXT_ON_RESET_EXT)                        reset_notification = true;                    else if (attribute[1] != EGL_NO_RESET_NOTIFICATION_EXT)                        return error(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);                    break;                  default:                    return error(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);                }            }        }        if (client_version != 2)        {            return error(EGL_BAD_CONFIG, EGL_NO_CONTEXT);        }        if (share_context && static_cast<gl::Context*>(share_context)->isResetNotificationEnabled() != reset_notification)        {            return error(EGL_BAD_MATCH, EGL_NO_CONTEXT);        }        egl::Display *display = static_cast<egl::Display*>(dpy);        if (!validateConfig(display, config))        {            return EGL_NO_CONTEXT;        }        EGLContext context = display->createContext(config, static_cast<gl::Context*>(share_context), reset_notification, robust_access);        if (context)            return success(context);        else            return error(EGL_CONTEXT_LOST, EGL_NO_CONTEXT);    }    catch(std::bad_alloc&)    {        return error(EGL_BAD_ALLOC, EGL_NO_CONTEXT);    }    return EGL_NO_CONTEXT;}
开发者ID:Anachid,项目名称:mozilla-central,代码行数:73,


示例29: ptm_load

//.........这里部分代码省略.........	    report ("[%2X] %-28.28s %05x%c%05x %05x %c V%02x %5d/n",		i, m->xxih[i].name, m->xxs[i].len, pih.type & 0x10 ? '+' : ' ',		m->xxs[i].lps, m->xxs[i].lpe, m->xxs[i].flg & WAVE_LOOPING ? 'L' : ' ',		m->xxi[i][0].vol, pih.c4spd);	/* Convert C4SPD to relnote/finetune */	c2spd_to_note (pih.c4spd, &m->xxi[i][0].xpo, &m->xxi[i][0].fin);    }    PATTERN_INIT();    /* Read patterns */    reportv(ctx, 0, "Stored patterns: %d ", m->xxh->pat);    for (i = 0; i < m->xxh->pat; i++) {	if (!pfh.patseg[i])	    continue;	PATTERN_ALLOC (i);	m->xxp[i]->rows = 64;	TRACK_ALLOC (i);	fseek(f, start + 16L * pfh.patseg[i], SEEK_SET);	r = 0;	while (r < 64) {	    fread (&b, 1, 1, f);	    if (!b) {		r++;		continue;	    }	    c = b & PTM_CH_MASK;	    if (c >= m->xxh->chn)		continue;	    event = &EVENT (i, c, r);	    if (b & PTM_NI_FOLLOW) {		fread (&n, 1, 1, f);		switch (n) {		case 255:		    n = 0;		    break;	/* Empty note */		case 254:		    n = XMP_KEY_OFF;		    break;	/* Key off */		}		event->note = n;		fread (&n, 1, 1, f);		event->ins = n;	    }	    if (b & PTM_FX_FOLLOWS) {		event->fxt = read8(f);		event->fxp = read8(f);		if (event->fxt > 0x17)			event->fxt = event->fxp = 0;		switch (event->fxt) {		case 0x0e:	/* Extended effect */		    if (MSN(event->fxp) == 0x8) {	/* Pan set */			event->fxt = FX_SETPAN;			event->fxp = LSN (event->fxp) << 4;		    }		    break;		case 0x10:	/* Set global volume */		    event->fxt = FX_GLOBALVOL;		    break;		case 0x11:	/* Multi retrig */
开发者ID:ProjectZeroSlackr,项目名称:XMP,代码行数:67,


示例30: _alpm_sync_prepare

int _alpm_sync_prepare(alpm_handle_t *handle, alpm_list_t **data){	alpm_list_t *i, *j;	alpm_list_t *deps = NULL;	alpm_list_t *unresolvable = NULL;	alpm_list_t *remove = NULL;	int ret = 0;	alpm_trans_t *trans = handle->trans;	if(data) {		*data = NULL;	}	/* ensure all sync database are valid since we will be using them */	for(i = handle->dbs_sync; i; i = i->next) {		const alpm_db_t *db = i->data;		if(!(db->status & DB_STATUS_VALID)) {			RET_ERR(handle, ALPM_ERR_DB_INVALID, -1);		}	}	if(!(trans->flags & ALPM_TRANS_FLAG_NODEPS)) {		alpm_list_t *resolved = NULL; /* target list after resolvedeps */		/* Build up list by repeatedly resolving each transaction package */		/* Resolve targets dependencies */		EVENT(trans, ALPM_TRANS_EVT_RESOLVEDEPS_START, NULL, NULL);		_alpm_log(handle, ALPM_LOG_DEBUG, "resolving target's dependencies/n");		/* build remove list for resolvedeps */		for(i = trans->add; i; i = i->next) {			alpm_pkg_t *spkg = i->data;			for(j = spkg->removes; j; j = j->next) {				remove = alpm_list_add(remove, j->data);			}		}		/* Compute the fake local database for resolvedeps (partial fix for the		 * phonon/qt issue) */		alpm_list_t *localpkgs = alpm_list_diff(_alpm_db_get_pkgcache(handle->db_local),				trans->add, _alpm_pkg_cmp);		/* Resolve packages in the transaction one at a time, in addition		   building up a list of packages which could not be resolved. */		for(i = trans->add; i; i = i->next) {			alpm_pkg_t *pkg = i->data;			if(_alpm_resolvedeps(handle, localpkgs, pkg, trans->add,						&resolved, remove, data) == -1) {				unresolvable = alpm_list_add(unresolvable, pkg);			}			/* Else, [resolved] now additionally contains [pkg] and all of its			   dependencies not already on the list */		}		alpm_list_free(localpkgs);		/* If there were unresolvable top-level packages, prompt the user to		   see if they'd like to ignore them rather than failing the sync */		if(unresolvable != NULL) {			int remove_unresolvable = 0;			QUESTION(trans, ALPM_TRANS_CONV_REMOVE_PKGS, unresolvable,					NULL, NULL, &remove_unresolvable);			if(remove_unresolvable) {				/* User wants to remove the unresolvable packages from the				   transaction. The packages will be removed from the actual				   transaction when the transaction packages are replaced with a				   dependency-reordered list below */				handle->pm_errno = 0; /* pm_errno was set by resolvedeps */				if(data) {					alpm_list_free_inner(*data, (alpm_list_fn_free)_alpm_depmiss_free);					alpm_list_free(*data);					*data = NULL;				}			} else {				/* pm_errno is set by resolvedeps */				alpm_list_free(resolved);				ret = -1;				goto cleanup;			}		}		/* Set DEPEND reason for pulled packages */		for(i = resolved; i; i = i->next) {			alpm_pkg_t *pkg = i->data;			if(!_alpm_pkg_find(trans->add, pkg->name)) {				pkg->reason = ALPM_PKG_REASON_DEPEND;			}		}		/* Unresolvable packages will be removed from the target list, so		   we free the transaction specific fields */		alpm_list_free_inner(unresolvable, (alpm_list_fn_free)_alpm_pkg_free_trans);		/* re-order w.r.t. dependencies */		alpm_list_free(trans->add);		trans->add = _alpm_sortbydeps(handle, resolved, 0);		alpm_list_free(resolved);		EVENT(trans, ALPM_TRANS_EVT_RESOLVEDEPS_DONE, NULL, NULL);	}//.........这里部分代码省略.........
开发者ID:matthewbauer,项目名称:unipkg-pacman,代码行数:101,



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


C++ EVENT_DEBUG函数代码示例
C++ EVEN函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。