这篇教程C++ HANDLE_ERROR函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中HANDLE_ERROR函数的典型用法代码示例。如果您正苦于以下问题:C++ HANDLE_ERROR函数的具体用法?C++ HANDLE_ERROR怎么用?C++ HANDLE_ERROR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了HANDLE_ERROR函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: checkTriggerReadyFlyCaptureErrorcheckTriggerReady( FlyCaptureContext context ){ FlyCaptureError error; unsigned long ulValue; // // Do our check to make sure the camera is ready to be triggered // by looking at bits 30-31. Any value other than 1 indicates // the camera is not ready to be triggered. // error = flycaptureGetCameraRegister( context, SOFT_ASYNC_TRIGGER, &ulValue ); HANDLE_ERROR( "flycaptureGetCameraRegister()", error ); while( ulValue != 0x80000001 ) { error = flycaptureGetCameraRegister( context, SOFT_ASYNC_TRIGGER, &ulValue ); HANDLE_ERROR( "flycaptureGetCameraRegister()", error ); } return FLYCAPTURE_OK;}
开发者ID:PrincetonPAVE,项目名称:old_igvc,代码行数:26,
示例2: assertdouble HackRFSource::set_sample_rate( double rate ){ assert(this->m_dev != nullptr); int status = HACKRF_SUCCESS; double _sample_rates[] = { 8e6, 10e6, 12.5e6, 16e6, 20e6}; bool found_supported_rate = false; for( unsigned int i = 0; i < sizeof(_sample_rates)/sizeof(double); i++ ) { if(_sample_rates[i] == rate) { found_supported_rate = true; break; } } if (!found_supported_rate) { status = HACKRF_ERROR_OTHER; HANDLE_ERROR("Unsupported samplerate: %gMsps", rate/1e6); } status = hackrf_set_sample_rate( this->m_dev, rate); HANDLE_ERROR("Error setting sample rate to %gMsps: %%s/n", rate/1e6);}
开发者ID:wpats,项目名称:scanner,代码行数:28,
示例3: raise_messagevoid raise_message(ErrorMode mode, bool skipTop, const std::string &msg) { if (mode == ErrorMode::ERROR) { HANDLE_ERROR(false, Always, "/nFatal error: ", skipTop); not_reached(); } if (mode == ErrorMode::RECOVERABLE_ERROR) { HANDLE_ERROR(true, IfUnhandled, "/nCatchable fatal error: ", skipTop); return; } if (!g_context->errorNeedsHandling(static_cast<int>(mode), true, ExecutionContext::ErrorThrowMode::Never)) { return; } if (mode == ErrorMode::WARNING) { if (RuntimeOption::WarningFrequency <= 0 || (g_warning_counter++) % RuntimeOption::WarningFrequency != 0) { return; } HANDLE_ERROR(true, Never, "/nWarning: ", skipTop); return; } if (RuntimeOption::NoticeFrequency <= 0 || (g_notice_counter++) % RuntimeOption::NoticeFrequency != 0) { return; } raise_notice_helper(mode, skipTop, msg);}
开发者ID:swtaarrs,项目名称:hhvm,代码行数:34,
示例4: hackrf_start_rxbool HackRFSource::Start(){ if (this->m_streamingState != Streaming) { this->m_streamingState = Streaming; int status = hackrf_start_rx(this->m_dev, _hackRF_rx_callback, (void *)this); HANDLE_ERROR("Failed to start RX streaming: %%s/n"); uint16_t frequencies[2]; frequencies[0] = this->m_scanStartFrequency; frequencies[1] = this->m_scanStopFrequency; status = hackrf_init_sweep(this->m_dev, frequencies, 1, // num_ranges this->m_scanNumBytes, this->m_scanStepWidth, // TUNE_STEP * FREQ_ONE_MHZ, this->m_scanOffset, // OFFSET, LINEAR); HANDLE_ERROR("Failed to set sweep parameters: %%s/n"); } return true;}
开发者ID:wpats,项目名称:scanner,代码行数:25,
示例5: HANDLE_ERRORvoid glcu::init_cuda(){ cudaDeviceProp prop = {0}; int dev; prop.major = 1; prop.minor = 0; HANDLE_ERROR(cudaChooseDevice(&dev, &prop)); HANDLE_ERROR(cudaGLSetGLDevice(dev));}
开发者ID:Answeror,项目名称:cg,代码行数:9,
示例6: HANDLE_ERRORfloat gpuNUFFT::GpuNUFFTOperator::stopTiming(){ float time; HANDLE_ERROR( cudaEventRecord(stop, 0) ); HANDLE_ERROR( cudaEventSynchronize(stop) ); HANDLE_ERROR( cudaEventElapsedTime(&time, start, stop) ); return time;}
开发者ID:davidssmith,项目名称:TRON,代码行数:9,
示例7: get_o_paramvoid get_o_param(int argc, char **argv, const char *module_getopt_string, const struct option *long_options){ /* backup global variables */ int bck_optind = optind, bck_optopt = optopt, bck_opterr = opterr; char *bck_optarg = optarg; signed char opt; // Add "i:" to getopt_string /* This is necessary because getopt rearragnes arguments in such a way that all positional agruments (i.e. not options) are put at the end of argv. If it wouldn't know about "-i" and that it requires argument, it would move the argument (ifc specifier) to the end of argv (but doesn't move the "-i"). trap_parse_params (within TRAP_DEFAULT_INITIALIZATION) would than fail. */ char *getopt_string_with_i = malloc(strlen(module_getopt_string) + 3); sprintf(getopt_string_with_i, "%s%s", module_getopt_string, "i:"); opterr = 0; /* disable getopt error output */ while ((opt = TRAP_GETOPT(argc, argv, getopt_string_with_i, long_options)) != -1) { switch (opt) { case 'o': { char *endptr; long int tmp_interval; errno = 0; tmp_interval = strtol(optarg, &endptr, 0); if (errno) { HANDLE_PERROR("-o"); } else if (*optarg == '/0') { HANDLE_ERROR("-o: missing argument"); } else if (*endptr != '/0') { HANDLE_ERROR("-o: bad argument"); } else if (tmp_interval <= 0 || tmp_interval >= INTERVAL_LIMIT) { HANDLE_ERROR("-o: bad interval range"); } send_interval = tmp_interval; break; } default: if (optopt == 'o') { HANDLE_ERROR("-o: missing argument"); } break; } } free(getopt_string_with_i); /* restore global variables */ optind = bck_optind; optopt = bck_optopt; opterr = bck_opterr; optarg = bck_optarg;}
开发者ID:Dragonn,项目名称:Nemea-Modules,代码行数:56,
示例8: hackrf_stop_rxHackRFSource::~HackRFSource(){ if (this->m_dev != nullptr) { int status = hackrf_stop_rx(this->m_dev); double centerFrequency = this->GetCurrentFrequency(); HANDLE_ERROR("Failed to stop RX streaming at %u: %%s/n", centerFrequency); status = hackrf_close(this->m_dev); HANDLE_ERROR("Error closing hackrf: %%s/n"); }}
开发者ID:wpats,项目名称:scanner,代码行数:10,
示例9: HANDLE_ERROR/* * Initialize an OS timer. The initialization steps are: * * create priority queue * install signal handler * * We also initialize the timer_block_mask if it has not been initialized yet. */ostimer_s *__ostimer_init(timer_s *tp, enum timer_types type){#ifndef NO_POSIX_SIGS struct sigaction sa ;#else struct sigvec sv ;#endif ostimer_s *otp ; struct timer_q *tqp ; /* * Find the corresponding ostimer */ if ( ( otp = ostimer_find( type ) ) == OSTIMER_NULL ) HANDLE_ERROR( tp->t_flags, OSTIMER_NULL, tp->t_errnop, TIMER_ENOTAVAILABLE, "TIMER __ostimer_init: requested timer type not available/n" ) ; /* * We use the value of ost_timerq to determine if the os_timer * has been initialized. */ tqp = &otp->ost_timerq ; if ( tqp->tq_handle ) return( otp ) ; tqp->tq_handle = pq_create( time_compare, tp->t_flags & TIMER_RETURN_ERROR ? PQ_RETURN_ERROR : PQ_NOFLAGS, &tqp->tq_errno ) ; if ( tqp->tq_handle == NULL ) { *tp->t_errnop = TIMER_ENOMEM ; return( OSTIMER_NULL ) ; } if ( ! timer_block_mask_set ) set_timer_block_mask() ;#ifndef NO_POSIX_SIGS sa.sa_handler = otp->ost_handler ; sa.sa_mask = timer_block_mask ; sa.sa_flags = 0 ; if ( sigaction( otp->ost_signal, &sa, SIGACTION_NULL ) == -1 )#else sv.sv_handler = otp->ost_handler ; sv.sv_mask = timer_block_mask ; sv.sv_flags = 0 ; if ( sigvec( otp->ost_signal, &sv, SIGVEC_NULL ) == -1 )#endif HANDLE_ERROR( tp->t_flags, OSTIMER_NULL, tp->t_errnop, TIMER_ESIGPROBLEM, "TIMER __ostimer_init: signal handler installation failed/n" ) ; return( otp ) ;}
开发者ID:SethRobertson,项目名称:libclc,代码行数:61,
示例10: whilevoid SwiftReader::readResults(QTextStream& stream){ QString line; int lineNum = 0; while (!stream.atEnd()) { line = stream.readLine(); ++lineNum; if (lineParser.exactMatch(line)) { QStringList decimals = lineParser.capturedTexts(); Orbit d; bool ok = true; #define HANDLE_ERROR(index) / if (!ok) { / std::ostringstream os; / os << "Could not decode decimal " << decimals.at(index).toAscii().data(); / throw std::runtime_error(os.str()); / } d.time = decimals.at(1).toDouble(&ok); HANDLE_ERROR(1); d.particleID = decimals.at(2).toDouble(&ok); HANDLE_ERROR(2); d.axis = decimals.at(3).toDouble(&ok) * 25559; HANDLE_ERROR(3); d.e = decimals.at(4).toDouble(&ok); HANDLE_ERROR(4); d.i = decimals.at(5).toDouble(&ok); HANDLE_ERROR(5); d.Omega = decimals.at(6).toDouble(&ok); HANDLE_ERROR(6); d.w = decimals.at(7).toDouble(&ok); HANDLE_ERROR(7); d.f = decimals.at(8).toDouble(&ok); HANDLE_ERROR(8); d.hasOrbEls = true; data[d.particleID].push_back(d); } }}
开发者ID:dtamayo,项目名称:OGRE,代码行数:32,
示例11: checkSoftwareTriggerPresence//=============================================================================// Function Definitions//=============================================================================FlyCaptureErrorcheckSoftwareTriggerPresence( FlyCaptureContext context, unsigned int uiRegister ){ FlyCaptureError error; unsigned long ulValue; switch( uiRegister ) { case SOFT_ASYNC_TRIGGER: error = flycaptureGetCameraRegister( context, SOFT_ASYNC_TRIGGER, &ulValue ); HANDLE_ERROR( "flycaptureGetCameraRegister()", error ); // // Check the Presence_Inq field of the register; bit 0 == 1 indicates // presence of this feature. // if( ( ulValue & 0x80000000 ) == 0x80000000 ) { return FLYCAPTURE_OK; } else { return FLYCAPTURE_NOT_IMPLEMENTED; } case SOFTWARE_TRIGGER: error = flycaptureGetCameraRegister( context, TRIGGER_INQ, &ulValue ); HANDLE_ERROR( "flycaptureGetCameraRegister()", error ); // // Check the Software_Trigger_Inq field of the register; bit 15 == 1 // indicates presence of this feature. // if( ( ulValue & 0x10000 ) == 0x10000 ) { return FLYCAPTURE_OK; } else { return FLYCAPTURE_NOT_IMPLEMENTED; } default: return FLYCAPTURE_INVALID_ARGUMENT; }}
开发者ID:PrincetonPAVE,项目名称:old_igvc,代码行数:52,
示例12: whilevoid HackRFSource::ThreadWorker(){ while (true) { StreamingState state = this->m_streamingState; switch (state) { case Streaming: case Done: break; case DoRetune: { double nextFrequency = this->GetNextFrequency(); this->Retune(nextFrequency); this->m_didRetune = true; //struct timeval increment = {0, 5000}, currentTime; //gettimeofday(¤tTime, nullptr); //timeradd(¤tTime, &increment, &this->m_nextValidStreamTime); this->m_dropPacketCount = ceil(this->m_sampleRate * this->m_retuneTime / 131072); StreamingState expected = DoRetune; while (!this->m_streamingState.compare_exchange_strong(expected, Streaming)) { } } break; } if (state == Done) { break; } } int status = hackrf_stop_rx(this->m_dev); HANDLE_ERROR("Failed to stop RX streaming: %%s/n");}
开发者ID:wpats,项目名称:scanner,代码行数:30,
示例13: mainint main(int argc, char** argv) { if (Device::isCuda()) { gpu::GLUTImageViewers::init(argc, argv); // Device::printAll(); Device::printAllSimple(); // Server Cuda1: in [0,5] // Server Cuda2: in [0,2] int deviceId = 0; initCuda(deviceId); int isOk = start(); //cudaDeviceReset causes the driver to clean up all state. // While not mandatory in normal operation, it is good practice. HANDLE_ERROR(cudaDeviceReset()); return isOk; } else { return EXIT_FAILURE; } }
开发者ID:Drakesinger,项目名称:CUDA-OMP-GPGPU,代码行数:28,
示例14: testConnectionint64_t PDOPgSqlConnection::doer(const String& sql){ testConnection(); const char* query = sql.data(); PQ::Result res = m_server->exec(query); if(!res){ // I think this error should be handled in a different way perhaps? handleError(nullptr, "XX000", "Invalid result data"); return -1; } ExecStatusType status = m_lastExec = res.status(); int64_t ret; if(status == PGRES_COMMAND_OK){ ret = (int64_t)res.cmdTuples(); } else if(status == PGRES_TUPLES_OK) { ret = 0L; } else { HANDLE_ERROR(nullptr, res); return -1L; } this->pgoid = res.oidValue(); return ret;}
开发者ID:HilayPatel,项目名称:hhvm,代码行数:30,
示例15: obs_register_encoder_svoid obs_register_encoder_s(const struct obs_encoder_info *info, size_t size){ if (find_encoder(info->id)) { encoder_warn("Encoder id '%s' already exists! " "Duplicate library?", info->id); goto error; }#define CHECK_REQUIRED_VAL_(info, val, func) / CHECK_REQUIRED_VAL(struct obs_encoder_info, info, val, func) CHECK_REQUIRED_VAL_(info, get_name, obs_register_encoder); CHECK_REQUIRED_VAL_(info, create, obs_register_encoder); CHECK_REQUIRED_VAL_(info, destroy, obs_register_encoder); CHECK_REQUIRED_VAL_(info, encode, obs_register_encoder); if (info->type == OBS_ENCODER_AUDIO) CHECK_REQUIRED_VAL_(info, get_frame_size, obs_register_encoder);#undef CHECK_REQUIRED_VAL_ REGISTER_OBS_DEF(size, obs_encoder_info, obs->encoder_types, info); return;error: HANDLE_ERROR(size, obs_encoder_info, info);}
开发者ID:AhmedAbdulSalam5,项目名称:obs-studio,代码行数:25,
示例16: obs_register_output_svoid obs_register_output_s(const struct obs_output_info *info, size_t size){ if (find_output(info->id)) { output_warn("Output id '%s' already exists! " "Duplicate library?", info->id); goto error; }#define CHECK_REQUIRED_VAL_(info, val, func) / CHECK_REQUIRED_VAL(struct obs_output_info, info, val, func) CHECK_REQUIRED_VAL_(info, get_name, obs_register_output); CHECK_REQUIRED_VAL_(info, create, obs_register_output); CHECK_REQUIRED_VAL_(info, destroy, obs_register_output); CHECK_REQUIRED_VAL_(info, start, obs_register_output); CHECK_REQUIRED_VAL_(info, stop, obs_register_output); if (info->flags & OBS_OUTPUT_ENCODED) { CHECK_REQUIRED_VAL_(info, encoded_packet, obs_register_output); } else { if (info->flags & OBS_OUTPUT_VIDEO) CHECK_REQUIRED_VAL_(info, raw_video, obs_register_output); if (info->flags & OBS_OUTPUT_AUDIO) CHECK_REQUIRED_VAL_(info, raw_audio, obs_register_output); }#undef CHECK_REQUIRED_VAL_ REGISTER_OBS_DEF(size, obs_output_info, obs->output_types, info); return;error: HANDLE_ERROR(size, obs_output_info, info);}
开发者ID:AhmedAbdulSalam5,项目名称:obs-studio,代码行数:35,
示例17: flapbool Omegle_client::stop(){ if (parent->isOffline()) return true; HANDLE_ENTRY; std::string data = "id=" + this->chat_id_; http::response resp = flap(OMEGLE_REQUEST_STOP, &data); if (hConnection) Netlib_CloseHandle(hConnection); hConnection = NULL; if (hEventsConnection) Netlib_CloseHandle(hEventsConnection); hEventsConnection = NULL; if (resp.data == "win") { return HANDLE_SUCCESS; } else { return HANDLE_ERROR(false); } /* switch ( resp.code ) { case HTTP_CODE_OK: case HTTP_CODE_FOUND: default: }*/}
开发者ID:kxepal,项目名称:miranda-ng,代码行数:35,
示例18: copyDeviceToDeviceinline void copyDeviceToDevice(TypeName *device_ptr_src, TypeName *device_ptr_dest, IndType num_elements){ HANDLE_ERROR(cudaMemcpy(device_ptr_dest, device_ptr_src, num_elements * sizeof(TypeName), cudaMemcpyDeviceToDevice));}
开发者ID:andyschwarzl,项目名称:gpuNUFFT,代码行数:7,
示例19: raise_notice_helperstatic void raise_notice_helper(ErrorMode mode, bool skipTop, const std::string& msg) { switch (mode) { case ErrorMode::STRICT: HANDLE_ERROR(true, Never, "/nStrict Warning: ", skipTop); break; case ErrorMode::NOTICE: HANDLE_ERROR(true, Never, "/nNotice: ", skipTop); break; case ErrorMode::PHP_DEPRECATED: HANDLE_ERROR(true, Never, "/nDeprecated: ", skipTop); break; default: always_assert(!"Unhandled type of error"); }}
开发者ID:swtaarrs,项目名称:hhvm,代码行数:16,
示例20: ofp_rt_lookup_init_globalint ofp_rt_lookup_init_global(void){ int i; HANDLE_ERROR(ofp_rt_lookup_alloc_shared_memory()); memset(shm, 0, sizeof(*shm)); for (i = 0; i < NUM_NODES; i++) shm->small_list[i][0].next = (i == NUM_NODES - 1) ? NULL : &(shm->small_list[i+1][0]); shm->free_small = shm->small_list[0]; for (i = 0; i < NUM_NODES_LARGE; i++) shm->large_list[i][0].next = (i == NUM_NODES_LARGE - 1) ? NULL : &(shm->large_list[i+1][0]); shm->free_large = shm->large_list[0]; for (i = 0; i < NUM_NODES_6; i++) { shm->node_list6[i].left = (i == 0) ? NULL : &(shm->node_list6[i-1]); shm->node_list6[i].right = (i == NUM_NODES_6 - 1) ? NULL : &(shm->node_list6[i+1]); } shm->free_nodes6 = &(shm->node_list6[0]); return 0;}
开发者ID:chyyuu,项目名称:ofp,代码行数:28,
示例21: obs_register_source_svoid obs_register_source_s(const struct obs_source_info *info, size_t size){ struct obs_source_info data = {0}; struct darray *array; if (info->type == OBS_SOURCE_TYPE_INPUT) { array = &obs->input_types.da; } else if (info->type == OBS_SOURCE_TYPE_FILTER) { array = &obs->filter_types.da; } else if (info->type == OBS_SOURCE_TYPE_TRANSITION) { array = &obs->transition_types.da; } else { blog(LOG_ERROR, "Tried to register unknown source type: %u", info->type); goto error; } if (find_source(array, info->id)) { blog(LOG_WARNING, "Source d '%s' already exists! " "Duplicate library?", info->id); goto error; }#define CHECK_REQUIRED_VAL_(info, val, func) / CHECK_REQUIRED_VAL(struct obs_source_info, info, val, func) CHECK_REQUIRED_VAL_(info, get_name, obs_register_source); CHECK_REQUIRED_VAL_(info, create, obs_register_source); CHECK_REQUIRED_VAL_(info, destroy, obs_register_source); if (info->type == OBS_SOURCE_TYPE_INPUT && (info->output_flags & OBS_SOURCE_VIDEO) != 0 && (info->output_flags & OBS_SOURCE_ASYNC) == 0) { CHECK_REQUIRED_VAL_(info, get_width, obs_register_source); CHECK_REQUIRED_VAL_(info, get_height, obs_register_source); }#undef CHECK_REQUIRED_VAL_ if (size > sizeof(data)) { blog(LOG_ERROR, "Tried to register obs_source_info with size " "%llu which is more than libobs currently " "supports (%llu)", (long long unsigned)size, (long long unsigned)sizeof(data)); goto error; } memcpy(&data, info, size); /* mark audio-only filters as an async filter categorically */ if (data.type == OBS_SOURCE_TYPE_FILTER) { if ((data.output_flags & OBS_SOURCE_VIDEO) == 0) data.output_flags |= OBS_SOURCE_ASYNC; } darray_push_back(sizeof(struct obs_source_info), array, &data); return;error: HANDLE_ERROR(size, obs_source_info, info);}
开发者ID:Excalibur201010,项目名称:obs-studio,代码行数:59,
示例22: ofp_stat_init_globalint ofp_stat_init_global(void){ HANDLE_ERROR(ofp_stat_alloc_shared_memory()); memset(shm_stat, 0, sizeof(*shm_stat)); return 0;}
开发者ID:babubalu,项目名称:ofp,代码行数:8,
示例23: ofp_hook_init_globalint ofp_hook_init_global(ofp_pkt_hook *pkt_hook_init){ HANDLE_ERROR(ofp_hook_alloc_shared_memory()); memcpy(&shm_hook->pkt_hook[0], pkt_hook_init, OFP_HOOK_MAX * sizeof(ofp_pkt_hook)); return 0;}
开发者ID:bogdanPricope,项目名称:ofp,代码行数:8,
示例24: SetDirectoryWintptr_t WINAPI SetDirectoryW(const SetDirectoryInfo* info) { PluginInstance* plugin = (PluginInstance*) info->hPanel; bool show_error = (info->OpMode & (OPM_SILENT | OPM_FIND | OPM_QUICKVIEW)) == 0; try { return set_dir(plugin, info->Dir, show_error); } HANDLE_ERROR(FALSE, TRUE);}
开发者ID:FarManagerLegacy,项目名称:farplug,代码行数:8,
示例25: cpyH2D_SparseVctvoid cpyH2D_SparseVct( int * const vctId_devi, T * const vctVal_devi, int const * const vctId_host, T const * const vctVal_host, int const vctNnz) { memcpyH2DAsync<int>(vctId_devi, vctId_host, vctNnz); memcpyH2DAsync<T>( vctVal_devi, vctVal_host, vctNnz); HANDLE_ERROR(cudaDeviceSynchronize());}
开发者ID:m-zacharias,项目名称:raptr,代码行数:8,
示例26: splitpathbool RageMovieTexture::GetFourCC( RString fn, RString &handler, RString &type ){ RString ignore, ext; splitpath( fn, ignore, ignore, ext); if( !ext.CompareNoCase(".mpg") || !ext.CompareNoCase(".mpeg") || !ext.CompareNoCase(".mpv") || !ext.CompareNoCase(".mpe") ) { handler = type = "MPEG"; return true; } if( !ext.CompareNoCase(".ogv") ) { handler = type = "Ogg"; return true; } //Not very pretty but should do all the same error checking without iostream#define HANDLE_ERROR(x) { / LOG->Warn( "Error reading %s: %s", fn.c_str(), x ); / handler = type = ""; / return false; / } RageFile file; if( !file.Open(fn) ) HANDLE_ERROR("Could not open file."); if( !file.Seek(0x70) ) HANDLE_ERROR("Could not seek."); type = " "; if( file.Read((char *)type.c_str(), 4) != 4 ) HANDLE_ERROR("Could not read."); ForceToAscii( type ); if( file.Seek(0xBC) != 0xBC ) HANDLE_ERROR("Could not seek."); handler = " "; if( file.Read((char *)handler.c_str(), 4) != 4 ) HANDLE_ERROR("Could not read."); ForceToAscii( handler ); return true;#undef HANDLE_ERROR}
开发者ID:Ancaro,项目名称:stepmania,代码行数:45,
示例27: initCudavoid initCuda(int deviceId) { // Check deviceId area int nbDevice = Device::getDeviceCount(); assert(deviceId >= 0 && deviceId < nbDevice); // Choose current device (state of host-thread) HANDLE_ERROR(cudaSetDevice(deviceId)); // Enable Interoperabilité OpenGL: // - Create a cuda specifique contexte, shared between Cuda and GL // - To be called before first call to kernel // - cudaSetDevice ou cudaGLSetGLDevice are mutualy exclusive HANDLE_ERROR(cudaGLSetGLDevice(deviceId)); // It can be usefull to preload driver, by example to practice benchmarking! (sometimes slow under linux) Device::loadCudaDriver(deviceId); // Device::loadCudaDriverAll();// Force driver to be load for all GPU }
开发者ID:Drakesinger,项目名称:CUDA-OMP-GPGPU,代码行数:19,
示例28: hackrf_set_freqdouble HackRFSource::Retune(double centerFrequency){ int status; // printf("Retuning to %.0f/n", centerFrequency); status = hackrf_set_freq(this->m_dev, uint64_t(centerFrequency)); HANDLE_ERROR("Failed to tune to %.0f Hz: %%s/n", centerFrequency); // printf("Retuned to %.0f/n", centerFrequency); return centerFrequency;}
开发者ID:wpats,项目名称:scanner,代码行数:10,
示例29: mainint main(int ac, char *av[]){ if (ac != 3) { fprintf(stderr, "Usage: %s <input_file> <output_file>/n %d", av[0],ac); exit(1); } libraw_data_t *iprc = libraw_init(0); if (!iprc) { fprintf(stderr, "Cannot create libraw handle/n"); exit(1); } iprc->params.half_size = 1; /* dcraw -h */ iprc->params.use_camera_wb = 1; /* dcraw -w */ char outfn[1024]; int ret = libraw_open_file(iprc, av[1]); HANDLE_ERROR(ret); printf("Processing %s (%s %s)/n", av[1], iprc->idata.make, iprc->idata.model); ret = libraw_unpack(iprc); HANDLE_ERROR(ret); ret = libraw_dcraw_process(iprc); HANDLE_ERROR(ret); strcpy(outfn, av[2]); printf("Writing to %s/n", outfn); ret = libraw_dcraw_ppm_tiff_writer(iprc, outfn); HANDLE_ERROR(ret); libraw_close(iprc); return 0;}
开发者ID:pgaertig,项目名称:metador,代码行数:42,
注:本文中的HANDLE_ERROR函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ HANDLE_GET_KIND函数代码示例 C++ HANDLE_EINTR函数代码示例 |