本文整理匯總了C++中ERROR0函數的典型用法代碼示例。如果您正苦於以下問題:C++ ERROR0函數的具體用法?C++ ERROR0怎麽用?C++ ERROR0使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了ERROR0函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: Java_com_sun_media_sound_MixerSynth_nDestroySynthesizer
JNIEXPORT void JNICALL
Java_com_sun_media_sound_MixerSynth_nDestroySynthesizer(JNIEnv* e, jobject thisObj, jlong id)
{
GM_Song *pSong = (GM_Song *) (INT_PTR) id;
TRACE0("Java_com_sun_media_sound_MixerSynth_nDestroySynthesizer.\n");
if (pSong) {
GM_KillSongNotes(pSong);
pSong->disposeSongDataWhenDone = TRUE; // free our midi pointer
GM_FreeSong((void *)e, pSong);
} else {
ERROR0("pSong is NULL\n");
}
TRACE0("Java_com_sun_media_sound_MixerSynth_nDestroySynthesizer completed.\n");
}
示例2: anongame_wol_matchlist_destroy
extern int anongame_wol_matchlist_destroy(void)
{
t_anongame_wol_player * player;
t_elem * curr;
if (anongame_wol_matchlist_head) {
LIST_TRAVERSE(anongame_wol_matchlist_head,curr) {
if (!(player = (t_anongame_wol_player*)elem_get_data(curr))) { /* should not happen */
ERROR0("wol_matchlist contains NULL item");
continue;
}
anongame_wol_player_destroy(player,&curr);
}
if (list_destroy(anongame_wol_matchlist_head)<0)
return -1;
anongame_wol_matchlist_head = NULL;
}
return 0;
}
示例3: Java_com_sun_media_sound_MidiInDevice_nOpen
JNIEXPORT jlong JNICALL
Java_com_sun_media_sound_MidiInDevice_nOpen(JNIEnv* e, jobject thisObj, jint index) {
MidiDeviceHandle* deviceHandle = NULL;
TRACE1("Java_com_sun_media_sound_MidiInDevice_nOpen: index: %d\n", index);
#if USE_PLATFORM_MIDI_IN == TRUE
deviceHandle = MIDI_IN_OpenDevice((INT32) index);
#endif
// if we didn't get a valid handle, throw a MidiUnavailableException
// $$kk: 06.24.99: should be getting more information here!
if ( !deviceHandle ) {
char *msg = "Failed to open the device.\0";
ERROR0("Java_com_sun_media_sound_MidiInDevice_nOpen: Failed to open the device\n");
ThrowJavaMessageException(e, JAVA_MIDI_PACKAGE_NAME"/MidiUnavailableException", msg);
}
TRACE0("Java_com_sun_media_sound_MidiInDevice_nOpen succeeded\n");
return (jlong) (UINT_PTR) deviceHandle;
}
示例4: apireglist_destroy
extern int apireglist_destroy(void)
{
t_apiregmember * apiregmember;
t_elem * curr;
if (apireglist_head) {
LIST_TRAVERSE(apireglist_head,curr) {
if (!(apiregmember = (t_apiregmember*)elem_get_data(curr))) {
ERROR0("channel list contains NULL item");
continue;
}
apiregmember_destroy(apiregmember,&curr);
}
if (list_destroy(apireglist_head)<0)
return -1;
apireglist_head = NULL;
}
return 0;
}
示例5: switch
char const *
Directory::read() const
{
const char * result;
#ifdef WIN32
switch (status) {
default:
case -1: /* couldn't rewind */
ERROR0("got status -1");
return 0;
case 0: /* freshly opened */
status = 1;
if (lFindHandle < 0) return 0;
result = fileinfo.name;
break;
case 1: /* reading */
if (lFindHandle < 0) return 0;
if (_findnext(lFindHandle, &fileinfo) < 0) {
status = 2;
return 0;
}
else result = fileinfo.name;
break;
case 2: /* EOF */
return 0;
}
#else /* POSIX */
struct dirent *dentry = dir ? readdir(dir) : 0;
if (!dentry) return 0;
result = dentry->d_name;
#endif /* WIN32-POSIX */
if (!(strcmp(result, ".") && strcmp(result, "..")))
/* here we presume we don't get an infinite number of "." or ".." ;) */
return read();
return result;
}
示例6: DAUDIO_Write
// returns -1 on error
int DAUDIO_Write(void* id, char* data, int byteSize) {
AlsaPcmInfo* info = (AlsaPcmInfo*) id;
int ret, count;
snd_pcm_sframes_t frameSize, writtenFrames;
TRACE1("> DAUDIO_Write %d bytes\n", byteSize);
/* sanity */
if (byteSize <= 0 || info->frameSize <= 0) {
ERROR2(" DAUDIO_Write: byteSize=%d, frameSize=%d!\n",
(int) byteSize, (int) info->frameSize);
TRACE0("< DAUDIO_Write returning -1\n");
return -1;
}
count = 2; // maximum number of trials to recover from underrun
//frameSize = snd_pcm_bytes_to_frames(info->handle, byteSize);
frameSize = (snd_pcm_sframes_t) (byteSize / info->frameSize);
do {
writtenFrames = snd_pcm_writei(info->handle, (const void*) data, (snd_pcm_uframes_t) frameSize);
if (writtenFrames < 0) {
ret = xrun_recovery(info, (int) writtenFrames);
if (ret <= 0) {
TRACE1("DAUDIO_Write: xrun recovery returned %d -> return.\n", ret);
return ret;
}
if (count-- <= 0) {
ERROR0("DAUDIO_Write: too many attempts to recover from xrun/suspend\n");
return -1;
}
} else {
break;
}
} while (TRUE);
//ret = snd_pcm_frames_to_bytes(info->handle, writtenFrames);
ret = (int) (writtenFrames * info->frameSize);
TRACE1("< DAUDIO_Write: returning %d bytes.\n", ret);
return ret;
}
示例7: _handle_stats_request
static void _handle_stats_request(connection_t *con,
http_parser_t *parser, char *uri)
{
stats_connection_t *stats;
stats_event_inc(NULL, "stats_connections");
if (!connection_check_admin_pass(parser)) {
ERROR0("Bad password for stats connection");
connection_close(con);
httpp_destroy(parser);
return;
}
stats_event_inc(NULL, "stats");
/* create stats connection and create stats handler thread */
stats = (stats_connection_t *)malloc(sizeof(stats_connection_t));
stats->parser = parser;
stats->con = con;
thread_create("Stats Connection", stats_connection, (void *)stats, THREAD_DETACHED);
}
示例8: _parse_directory
static int _parse_directory (xmlNodePtr node, void *arg)
{
ice_config_t *config = arg;
struct cfg_tag icecast_tags[] =
{
{ "yp-url", config_get_str, &config->yp_url [config->num_yp_directories]},
{ "yp-url-timeout", config_get_int, &config->yp_url_timeout [config->num_yp_directories]},
{ "touch-interval", config_get_int, &config->yp_touch_interval [config->num_yp_directories]},
{ NULL, NULL, NULL }
};
if (config->num_yp_directories >= MAX_YP_DIRECTORIES)
{
ERROR0("Maximum number of yp directories exceeded!");
return -1;
}
if (parse_xml_tags (node, icecast_tags))
return -1;
config->num_yp_directories++;
return 0;
}
示例9: Java_com_sun_media_sound_MixerSynth_nStartSynthesizer
JNIEXPORT jboolean JNICALL
Java_com_sun_media_sound_MixerSynth_nStartSynthesizer(JNIEnv* e, jobject thisObj, jlong id)
{
OPErr opErr = NO_ERR;
GM_Song *pSong = (GM_Song *) (INT_PTR) id;
TRACE0("Java_com_sun_media_sound_MixerSynth_nStartSynthesizer.\n");
// $$kk: 03.23.98: hard coding instrument loading here
opErr = GM_StartLiveSong(pSong, 1);
if (opErr)
{
ERROR0("FAILED TO START MIDI DIRECT: error on GM_StartLiveSong\n");
// $$kk: 09.17.98: what to do here?
return (jboolean)FALSE;
}
TRACE0("Java_com_sun_media_sound_MixerSynth_nStartSynthesizer.completed\n");
return (jboolean)TRUE;
}
示例10: sizeof
int
FDWEpollBackend::add(int idx, unsigned rw)
{
// eventlog(eventlog_level_trace, __FUNCTION__, "called fd: %d rw: %d", fd, rw);
struct epoll_event tmpev;
std::memset(&tmpev, 0, sizeof(tmpev));
tmpev.events = 0;
if (rw & fdwatch_type_read)
tmpev.events |= EPOLLIN;
if (rw & fdwatch_type_write)
tmpev.events |= EPOLLOUT;
int op = fdw_rw(fdw_fds + idx) ? EPOLL_CTL_MOD : EPOLL_CTL_ADD;
tmpev.data.fd = idx;
if (epoll_ctl(epfd, op, fdw_fd(fdw_fds + idx), &tmpev)) {
ERROR0("got error from epoll_ctl()");
return -1;
}
return 0;
}
示例11: MIDI_Utils_StopDevice
INT32 MIDI_Utils_StopDevice(MacMidiDeviceHandle* handle) {
OSStatus err = noErr;
if (!handle || !handle->h.deviceHandle) {
ERROR0("ERROR: MIDI_Utils_StopDevice: handle or native handle is NULL\n");
return MIDI_INVALID_HANDLE;
}
if (handle->isStarted) {
/* set the flag that we don't want to receive messages anymore */
handle->isStarted = FALSE;
if (handle->direction == MIDI_IN) {
err = MIDIPortDisconnectSource(inPort, (MIDIEndpointRef) (intptr_t) (handle->h.deviceHandle));
} else if (handle->direction == MIDI_OUT) {
// Unschedules previously-sent packets.
err = MIDIFlushOutput((MIDIEndpointRef) (intptr_t) handle->h.deviceHandle);
}
MIDI_CHECK_ERROR;
}
return MIDI_SUCCESS;
}
示例12: CreatePortControl
// returns java control
static void* CreatePortControl(PortMixer *mixer, PortControlCreator *creator, PortControl::ControlType type,
AudioControl **audioControls, int offset, int len) {
void *jControl = NULL;
PortControl *control = (PortControl *)calloc(1, sizeof(PortControl));
float precision = 0.01;
control->type = type;
control->controlCount = len;
control->audioControls = (AudioControl **)malloc(len * sizeof(AudioControl *));
memcpy(control->audioControls, audioControls + offset, len * sizeof(AudioControl *));
switch (control->type) {
case PortControl::Volume:
jControl = creator->newFloatControl(creator, control, CONTROL_TYPE_VOLUME, 0, 1, precision, "");
break;
case PortControl::Mute:
jControl = creator->newBooleanControl(creator, control, CONTROL_TYPE_MUTE);
break;
case PortControl::Balance:
jControl = creator->newFloatControl(creator, control, CONTROL_TYPE_BALANCE, -1, 1, precision, "");
break;
};
if (jControl == NULL) {
ERROR0("CreatePortControl: javaControl was not created\n");
free(control->audioControls);
free(control);
return NULL;
}
// add the control to mixer control list;
control->next = mixer->portControls;
mixer->portControls = control;
return jControl;
}
示例13: DAUDIO_Flush
int DAUDIO_Flush(void* id, int isSource) {
DS_Info* info = (DS_Info*) id;
//TRACE0("DAUDIO_Flush\n");
if (info->isSource) {
info->playBuffer->Stop();
DS_clearBuffer(info, false /* entire buffer */);
} else {
DWORD captureCursor, readCursor;
/* set the read pointer to the current read position */
if (FAILED(info->captureBuffer->GetCurrentPosition(&captureCursor, &readCursor))) {
ERROR0("DAUDIO_Flush: ERROR: Failed to get current position.");
return false;
}
DS_clearBuffer(info, false /* entire buffer */);
/* SHOULD set to *captureCursor*,
* but that would be detected as overflow
* in a subsequent GetAvailable() call.
*/
info->writePos = (int) readCursor;
}
return true;
}
示例14: process_initial_page
/* a new BOS page has been seen so check which codec it is */
static int process_initial_page (format_plugin_t *plugin, ogg_page *page)
{
ogg_state_t *ogg_info = plugin->_state;
ogg_codec_t *codec;
if (ogg_info->bos_completed)
{
ogg_info->bitrate = 0;
ogg_info->codec_sync = NULL;
/* need to zap old list of codecs when next group of BOS pages appear */
free_ogg_codecs (ogg_info);
}
do
{
codec = initial_vorbis_page (plugin, page);
if (codec)
break;
#ifdef HAVE_THEORA
codec = initial_theora_page (plugin, page);
if (codec)
break;
#endif
/* any others */
ERROR0 ("Seen BOS page with unknown type");
return -1;
} while (0);
if (codec)
{
/* add codec to list */
codec->next = ogg_info->codecs;
ogg_info->codecs = codec;
}
return 0;
}
示例15: _parse_directory
static void _parse_directory(xmlDocPtr doc, xmlNodePtr node,
ice_config_t *configuration)
{
char *tmp;
if (configuration->num_yp_directories >= MAX_YP_DIRECTORIES) {
ERROR0("Maximum number of yp directories exceeded!");
return;
}
do {
if (node == NULL) break;
if (xmlIsBlankNode(node)) continue;
if (xmlStrcmp (node->name, XMLSTR("yp-url")) == 0) {
if (configuration->yp_url[configuration->num_yp_directories])
xmlFree(configuration->yp_url[configuration->num_yp_directories]);
configuration->yp_url[configuration->num_yp_directories] =
(char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
} else if (xmlStrcmp (node->name, XMLSTR("yp-url-timeout")) == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->yp_url_timeout[configuration->num_yp_directories] =
atoi(tmp);
if (tmp) xmlFree(tmp);
} else if (xmlStrcmp (node->name, XMLSTR("server")) == 0) {
_add_server(doc, node->xmlChildrenNode, configuration);
} else if (xmlStrcmp (node->name, XMLSTR("touch-interval")) == 0) {
tmp = (char *)xmlNodeListGetString(doc, node->xmlChildrenNode, 1);
configuration->yp_touch_interval[configuration->num_yp_directories] =
atoi(tmp);
if (tmp) xmlFree(tmp);
}
} while ((node = node->next));
if (configuration->yp_url [configuration->num_yp_directories] == NULL)
return;
configuration->num_yp_directories++;
}