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

C++ LOG_CRITICAL函数代码示例

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

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



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

示例1: LOG_CRITICAL

int OraDBRequest::selectConditionerBind()
{
    const char sql_stmt[] = "select id, tran_type, msisdn, promo_code, promo_value, promo_name, service_id, cluster_node, brand"
        " from conditioner_log where brand = :brand and cluster_node = :cluster_node and status = :status"
        " and rownum < :limit order by id";

    _sth_select_conditioner = SQLO_STH_INIT;

    if ((_sth_select_conditioner = sqlo_prepare(_dbh, sql_stmt)) < 0) {
        LOG_CRITICAL("%s: Failed to prepare statement handle for SELECT_CONDITIONER.", __func__);
        return -1;
    }

    if (SQLO_SUCCESS != (
                   sqlo_bind_by_name(_sth_select_conditioner, ":brand", SQLOT_STR, &_var_brand, sizeof(_var_brand), 0, 0)
                || sqlo_bind_by_name(_sth_select_conditioner, ":cluster_node", SQLOT_INT, &_var_cluster_node, sizeof(_var_cluster_node), 0, 0)
                || sqlo_bind_by_name(_sth_select_conditioner, ":status", SQLOT_INT, &_var_status, sizeof(_var_status), 0, 0)
                || sqlo_bind_by_name(_sth_select_conditioner, ":limit", SQLOT_INT, &_var_limit, sizeof(_var_limit), 0, 0)
                || sqlo_define_by_pos(_sth_select_conditioner, 1, SQLOT_INT, &_request.id, sizeof(_request.id), 0, 0, 0)
                || sqlo_define_by_pos(_sth_select_conditioner, 2, SQLOT_INT, &_request.tran_type, sizeof(_request.tran_type), 0, 0, 0)
                || sqlo_define_by_pos(_sth_select_conditioner, 3, SQLOT_STR, &_request.a_no, sizeof(_request.a_no), &_ind_a_no, 0, 0)
                || sqlo_define_by_pos(_sth_select_conditioner, 4, SQLOT_STR, &_request.promo_code, sizeof(_request.promo_code), &_ind_promo_code, 0, 0)
                || sqlo_define_by_pos(_sth_select_conditioner, 5, SQLOT_STR, &_request.promo_value, sizeof(_request.promo_value), &_ind_promo_value, 0, 0)
                || sqlo_define_by_pos(_sth_select_conditioner, 6, SQLOT_STR, &_request.promo_name, sizeof(_request.promo_name), &_ind_promo_name, 0, 0)
                || sqlo_define_by_pos(_sth_select_conditioner, 7, SQLOT_STR, &_request.service_id, sizeof(_request.service_id), &_ind_service_id, 0, 0)
                || sqlo_define_by_pos(_sth_select_conditioner, 8, SQLOT_INT, &_request.cluster_node, sizeof(_request.cluster_node), 0, 0, 0)
                || sqlo_define_by_pos(_sth_select_conditioner, 9, SQLOT_STR, &_request.brand, sizeof(_request.brand), &_ind_brand, 0, 0)
                )) {
        LOG_CRITICAL("%s: Failed to bind variables for SELECT_CONDITIONER statement handle.", __func__);
        return -2;
    }

    return 0;
}
开发者ID:zand3rs,项目名称:fun2,代码行数:34,代码来源:oradbrequest.cpp


示例2: SP_USURF_ACTIVATION

int OraDBRequest::usurfActivationBind()
{
    const char sql_stmt[] = "BEGIN"
        " SP_USURF_ACTIVATION(:p_retr, :p_partner, :p_exptime, :p_expdate, :p_msisdn, :p_country, :p_duration, :p_nf_status);"
        " END;";

    _sth_ua = SQLO_STH_INIT;

    if ((_sth_ua = sqlo_prepare(_dbh, sql_stmt)) < 0) {
        LOG_CRITICAL("%s: Failed to prepare statement handle for SP_USURF_ACTIVATION.", __func__);
        return -1;
    }

    if (SQLO_SUCCESS != (
                sqlo_bind_by_name(_sth_ua, ":p_retr", SQLOT_INT, &_var_retr, sizeof(_var_retr), 0, 0)
                || sqlo_bind_by_name(_sth_ua, ":p_partner", SQLOT_STR, &_var_extra_o_1, sizeof(_var_extra_o_1), &_ind_extra_1, 0)
                || sqlo_bind_by_name(_sth_ua, ":p_exptime", SQLOT_STR, &_var_extra_o_2, sizeof(_var_extra_o_2), &_ind_extra_2, 0)
                || sqlo_bind_by_name(_sth_ua, ":p_expdate", SQLOT_STR, &_var_extra_o_3, sizeof(_var_extra_o_3), &_ind_extra_3, 0)
                || sqlo_bind_by_name(_sth_ua, ":p_msisdn", SQLOT_STR, &_var_msisdn, sizeof(_var_msisdn), 0, 0)
                || sqlo_bind_by_name(_sth_ua, ":p_country", SQLOT_STR, &_var_country, sizeof(_var_country), 0, 0)
                || sqlo_bind_by_name(_sth_ua, ":p_duration", SQLOT_INT, &_var_duration, sizeof(_var_duration), 0, 0)
                || sqlo_bind_by_name(_sth_ua, ":p_nf_status", SQLOT_INT, &_var_status, sizeof(_var_status), 0, 0)
                )) {
        LOG_CRITICAL("%s: Failed to bind variables for SP_USURF_ACTIVATION statement handle.", __func__);
        return -2;
    }

    return 0;
}
开发者ID:zand3rs,项目名称:fun2,代码行数:29,代码来源:oradbrequest.cpp


示例3: LOG_SET_HANDLE

int NSN::initialize()
{
    if (_param.logh) {
        LOG_SET_HANDLE(_param.logh);
    }

    if (OraDB::init_lib(true) < 0) {
        LOG_CRITICAL("%s::%s: Unable to initialize OCI!!!", __class__, __func__);
        return -1;
    }

    *username = 0; 
    *password = 0; 
    *host = 0;
    port = 0; 
    timeout = 0;

    *nsnUsername = 0;
    *nsnExpirationDate = 0;

    buffer = (char*)malloc(buffer_size);
    if (! buffer) {
        LOG_CRITICAL("%s::%s: Unable to allocate memory fo buffer!", __class__, __func__);
        return -1;
    }
    memset(buffer, 0, buffer_size);

    LOG_INFO("%s::%s: ...", __class__, __func__);
#if 0
    LOG_INFO("%s::%s: host: %s, port: %d, nsn_user: %s, nsn_pass: %s, nsn_name: %s, nsn_expiry: %s, timeout: %d", __class__, __func__,
            host, port, username, password, nsnUsername, nsnExpirationDate, timeout);
#endif

    return 0;
}
开发者ID:zand3rs,项目名称:fun2,代码行数:35,代码来源:nsn.cpp


示例4: SP_PROCESS_TRAN

int OraDBRequest::processTranBind()
{
    const char sql_stmt[] = "BEGIN"
        " SP_PROCESS_TRAN(:p_retr, :p_extra_o_1, :p_extra_o_2, :p_extra_o_3,"
        " :p_trantype, :p_msisdn, :p_req_id, :p_ref_id, :p_extra_i_1, :p_extra_i_2, :p_extra_i_3);"
        " END;";

    _sth_pt = SQLO_STH_INIT;

    if ((_sth_pt = sqlo_prepare(_dbh, sql_stmt)) < 0) {
        LOG_CRITICAL("%s: Failed to prepare statement handle for SP_PROCESS_TRAN.", __func__);
        return -1;
    }

    if (SQLO_SUCCESS != (
                sqlo_bind_by_name(_sth_pt, ":p_retr", SQLOT_INT, &_var_retr, sizeof(_var_retr), 0, 0)
                || sqlo_bind_by_name(_sth_pt, ":p_extra_o_1", SQLOT_STR, &_var_extra_o_1, sizeof(_var_extra_o_1), &_ind_extra_1, 0)
                || sqlo_bind_by_name(_sth_pt, ":p_extra_o_2", SQLOT_STR, &_var_extra_o_2, sizeof(_var_extra_o_2), &_ind_extra_2, 0)
                || sqlo_bind_by_name(_sth_pt, ":p_extra_o_3", SQLOT_STR, &_var_extra_o_3, sizeof(_var_extra_o_3), &_ind_extra_3, 0)
                || sqlo_bind_by_name(_sth_pt, ":p_trantype", SQLOT_INT, &_var_trantype, sizeof(_var_trantype), 0, 0)
                || sqlo_bind_by_name(_sth_pt, ":p_msisdn", SQLOT_STR, &_var_msisdn, sizeof(_var_msisdn), 0, 0)
                || sqlo_bind_by_name(_sth_pt, ":p_req_id", SQLOT_INT, &_var_req_id, sizeof(_var_req_id), 0, 0)
                || sqlo_bind_by_name(_sth_pt, ":p_ref_id", SQLOT_INT, &_var_ref_id, sizeof(_var_ref_id), 0, 0)
                || sqlo_bind_by_name(_sth_pt, ":p_extra_i_1", SQLOT_STR, &_var_extra_i_1, sizeof(_var_extra_i_1), 0, 0)
                || sqlo_bind_by_name(_sth_pt, ":p_extra_i_2", SQLOT_STR, &_var_extra_i_2, sizeof(_var_extra_i_2), 0, 0)
                || sqlo_bind_by_name(_sth_pt, ":p_extra_i_3", SQLOT_STR, &_var_extra_i_3, sizeof(_var_extra_i_3), 0, 0)
                )) {
        LOG_CRITICAL("%s: Failed to bind variables for SP_PROCESS_TRAN statement handle.", __func__);
        return -2;
    }

    return 0;
}
开发者ID:zand3rs,项目名称:fun2,代码行数:33,代码来源:oradbrequest.cpp


示例5: get_random_seed

  uint64_t get_random_seed(uint64_t seed) {
    Logger::init();

    static const char* device = "/dev/urandom";

    int fd = open(device, O_RDONLY);

    if (fd < 0) {
      char buf[STRERROR_BUFSIZE_];
      char* err = strerror_r(errno, buf, sizeof(buf));
      LOG_CRITICAL("Unable to open random device (%s): %s", device, err);
      return seed;
    }

    ssize_t num_bytes = read(fd, reinterpret_cast<char*>(&seed), sizeof(seed));
    if (num_bytes < 0) {
      char buf[STRERROR_BUFSIZE_];
      char* err = strerror_r(errno, buf, sizeof(buf));
      LOG_CRITICAL("Unable to read from random device (%s): %s", device, err);
    } else if (num_bytes != sizeof(seed)) {
      char buf[STRERROR_BUFSIZE_];
      char* err = strerror_r(errno, buf, sizeof(buf));
      LOG_CRITICAL("Unable to read full seed value (expected: %u read: %u) "
                   "from random device (%s): %s",
                   static_cast<unsigned int>(sizeof(seed)),
                   static_cast<unsigned int>(num_bytes),
                   device, err);
    }

    close(fd);

    return seed;
  }
开发者ID:jut4eva,项目名称:node-cassandra-native-driver,代码行数:33,代码来源:random.cpp


示例6: SP_PROCESS_SHAMPOO

int OraDBRequest::processShampooBind()
{
    const char sql_stmt[] = "BEGIN"
        " SP_PROCESS_SHAMPOO(:p_retr, :p_type, :p_msisdn, :p_plan, :p_start, :p_end);"
        " END;";

    _sth_process_shampoo = SQLO_STH_INIT;

    if ((_sth_process_shampoo = sqlo_prepare(_dbh, sql_stmt)) < 0) {
        LOG_CRITICAL("%s: Failed to prepare statement handle for SP_PROCESS_SHAMPOO.", __func__);
        return -1;
    }

    if (SQLO_SUCCESS != (
                sqlo_bind_by_name(_sth_process_shampoo, ":p_retr", SQLOT_INT, &_var_retr, sizeof(_var_retr), 0, 0)
                || sqlo_bind_by_name(_sth_process_shampoo, ":p_type", SQLOT_STR, &_request.svc_type, sizeof(_request.svc_type), 0, 0)
                || sqlo_bind_by_name(_sth_process_shampoo, ":p_msisdn", SQLOT_STR, &_request.svc_msisdn, sizeof(_request.svc_msisdn), 0, 0)
                || sqlo_bind_by_name(_sth_process_shampoo, ":p_plan", SQLOT_STR, &_request.svc_plan, sizeof(_request.svc_plan), 0, 0)
                || sqlo_bind_by_name(_sth_process_shampoo, ":p_start", SQLOT_STR, &_request.svc_start, sizeof(_request.svc_start), 0, 0)
                || sqlo_bind_by_name(_sth_process_shampoo, ":p_end", SQLOT_STR, &_request.svc_end, sizeof(_request.svc_end), 0, 0)
                )) {
        LOG_CRITICAL("%s: Failed to bind variables for SP_PROCESS_SHAMPOO statement handle.", __func__);
        return -2;
    }

    return 0;
}
开发者ID:zand3rs,项目名称:fun2,代码行数:27,代码来源:oradbrequest.cpp


示例7: mti_GetTypeKind

int FliVariableObjHdl::initialise(std::string &name)
{
    /* Pre allocte buffers on signal type basis */
    m_fli_type = mti_GetTypeKind(mti_GetVarType(m_fli_hdl));

    switch (m_fli_type) {
        case MTI_TYPE_ENUM:
            m_val_len = 1;
            break;
        case MTI_TYPE_SCALAR:
        case MTI_TYPE_PHYSICAL:
            m_val_len = 32;
            break;
        case MTI_TYPE_ARRAY:
            m_val_len  = mti_TickLength(mti_GetVarType(m_fli_hdl));
            m_mti_buff = (mtiInt32T*)malloc(sizeof(*m_mti_buff) * m_val_len);
            if (!m_mti_buff) {
                LOG_CRITICAL("Unable to alloc mem for signal mti read buffer: ABORTING");
            }
            break;
        default:
            LOG_ERROR("Unable to handle object type for %s (%d)",
                         name.c_str(), m_fli_type);
    }

    m_val_buff = (char*)malloc(m_val_len+1);
    if (!m_val_buff) {
        LOG_CRITICAL("Unable to alloc mem for signal read buffer: ABORTING");
    }
    m_val_buff[m_val_len] = '\0';

    GpiObjHdl::initialise(name);

    return 0;
}
开发者ID:ambikeshwar1991,项目名称:cocotb,代码行数:35,代码来源:FliImpl.cpp


示例8: MemoryFill

static void MemoryFill(const Regs::MemoryFillConfig& config) {
    const PAddr start_addr = config.GetStartAddress();
    const PAddr end_addr = config.GetEndAddress();

    // TODO: do hwtest with these cases
    if (!Memory::IsValidPhysicalAddress(start_addr)) {
        LOG_CRITICAL(HW_GPU, "invalid start address 0x%08X", start_addr);
        return;
    }

    if (!Memory::IsValidPhysicalAddress(end_addr)) {
        LOG_CRITICAL(HW_GPU, "invalid end address 0x%08X", end_addr);
        return;
    }

    if (end_addr <= start_addr) {
        LOG_CRITICAL(HW_GPU, "invalid memory range from 0x%08X to 0x%08X", start_addr, end_addr);
        return;
    }

    u8* start = Memory::GetPhysicalPointer(start_addr);
    u8* end = Memory::GetPhysicalPointer(end_addr);

    // TODO: Consider always accelerating and returning vector of
    //       regions that the accelerated fill did not cover to
    //       reduce/eliminate the fill that the cpu has to do.
    //       This would also mean that the flush below is not needed.
    //       Fill should first flush all surfaces that touch but are
    //       not completely within the fill range.
    //       Then fill all completely covered surfaces, and return the
    //       regions that were between surfaces or within the touching
    //       ones for cpu to manually fill here.
    if (VideoCore::g_renderer->Rasterizer()->AccelerateFill(config))
        return;

    Memory::RasterizerFlushAndInvalidateRegion(config.GetStartAddress(),
                                               config.GetEndAddress() - config.GetStartAddress());

    if (config.fill_24bit) {
        // fill with 24-bit values
        for (u8* ptr = start; ptr < end; ptr += 3) {
            ptr[0] = config.value_24bit_r;
            ptr[1] = config.value_24bit_g;
            ptr[2] = config.value_24bit_b;
        }
    } else if (config.fill_32bit) {
        // fill with 32-bit values
        if (end > start) {
            u32 value = config.value_32bit;
            size_t len = (end - start) / sizeof(u32);
            for (size_t i = 0; i < len; ++i)
                memcpy(&start[i * sizeof(u32)], &value, sizeof(u32));
        }
    } else {
        // fill with 16-bit values
        u16 value_16bit = config.value_16bit.Value();
        for (u8* ptr = start; ptr < end; ptr += sizeof(u16))
            memcpy(ptr, &value_16bit, sizeof(u16));
    }
}
开发者ID:coconutxin,项目名称:citra,代码行数:60,代码来源:gpu.cpp


示例9: SP_PROCESS_MLP

int OraDBRequest::processMlpBind()
{
    const char sql_stmt[] = "BEGIN"
        " SP_PROCESS_MLP(:p_retr, :p_msisdn, :p_transaction_code, :p_transaction_id, :p_bill_cycle, :p_type, :p_soc, :p_effdate);"
        " END;";

    _sth_process_mlp = SQLO_STH_INIT;

    if ((_sth_process_mlp = sqlo_prepare(_dbh, sql_stmt)) < 0) {
        LOG_CRITICAL("%s: Failed to prepare statement handle for SP_PROCESS_MLP.", __func__);
        return -1;
    }

    if (SQLO_SUCCESS != (
                sqlo_bind_by_name(_sth_process_mlp, ":p_retr", SQLOT_INT, &_var_retr, sizeof(_var_retr), 0, 0)
                || sqlo_bind_by_name(_sth_process_mlp, ":p_msisdn", SQLOT_STR, &_request.svc_msisdn, sizeof(_request.svc_msisdn), 0, 0)
                || sqlo_bind_by_name(_sth_process_mlp, ":p_transaction_code", SQLOT_STR, &_request.svc_txcode, sizeof(_request.svc_txcode), 0, 0)
                || sqlo_bind_by_name(_sth_process_mlp, ":p_transaction_id", SQLOT_STR, &_request.svc_txid, sizeof(_request.svc_txid), 0, 0)
                || sqlo_bind_by_name(_sth_process_mlp, ":p_bill_cycle", SQLOT_STR, &_request.svc_bill_cycle, sizeof(_request.svc_bill_cycle), 0, 0)
                || sqlo_bind_by_name(_sth_process_mlp, ":p_type", SQLOT_STR, &_request.svc_type, sizeof(_request.svc_type), 0, 0)
                || sqlo_bind_by_name(_sth_process_mlp, ":p_soc", SQLOT_STR, &_request.svc_soc, sizeof(_request.svc_soc), 0, 0)
                || sqlo_bind_by_name(_sth_process_mlp, ":p_effdate", SQLOT_STR, &_request.svc_eff_date, sizeof(_request.svc_eff_date), 0, 0)
                )) {
        LOG_CRITICAL("%s: Failed to bind variables for SP_PROCESS_MLP statement handle.", __func__);
        return -2;
    }

    return 0;
}
开发者ID:zand3rs,项目名称:fun2,代码行数:29,代码来源:oradbrequest.cpp


示例10: LOG_CRITICAL

int VpiCbHdl::cleanup_callback(void)
{
    if (m_state == GPI_FREE)
        return 0;

    /* If the one-time callback has not come back then
     * remove it, it is has then free it. The remove is done
     * internally */

    if (m_state == GPI_PRIMED) {
        if (!m_obj_hdl) {
            LOG_CRITICAL("VPI: passed a NULL pointer : ABORTING");
        }

        if (!(vpi_remove_cb(get_handle<vpiHandle>()))) {
            LOG_CRITICAL("VPI: unbale to remove callback : ABORTING");
        }

        check_vpi_error();
    } else {
#ifndef MODELSIM
        /* This is disabled for now, causes a small leak going to put back in */
        if (!(vpi_free_object(get_handle<vpiHandle>()))) {
            LOG_CRITICAL("VPI: unbale to free handle : ABORTING");
        }
#endif
    }


    m_obj_hdl = NULL;
    m_state = GPI_FREE;

    return 0;
}
开发者ID:cpehle,项目名称:cocotb,代码行数:34,代码来源:VpiCbHdl.cpp


示例11: impl

SDL2Sink::SDL2Sink() : impl(std::make_unique<Impl>()) {
    if (SDL_Init(SDL_INIT_AUDIO) < 0) {
        LOG_CRITICAL(Audio_Sink, "SDL_Init(SDL_INIT_AUDIO) failed");
        impl->audio_device_id = 0;
        return;
    }

    SDL_AudioSpec desired_audiospec;
    SDL_zero(desired_audiospec);
    desired_audiospec.format = AUDIO_S16;
    desired_audiospec.channels = 2;
    desired_audiospec.freq = native_sample_rate;
    desired_audiospec.samples = 1024;
    desired_audiospec.userdata = impl.get();
    desired_audiospec.callback = &Impl::Callback;

    SDL_AudioSpec obtained_audiospec;
    SDL_zero(obtained_audiospec);

    impl->audio_device_id = SDL_OpenAudioDevice(nullptr, false, &desired_audiospec, &obtained_audiospec, 0);
    if (impl->audio_device_id <= 0) {
        LOG_CRITICAL(Audio_Sink, "SDL_OpenAudioDevice failed");
        return;
    }

    impl->sample_rate = obtained_audiospec.freq;

    // SDL2 audio devices start out paused, unpause it:
    SDL_PauseAudioDevice(impl->audio_device_id, 0);
}
开发者ID:Kloen,项目名称:citra,代码行数:30,代码来源:sdl2_sink.cpp


示例12: path_parser

ResultCode SaveDataArchive::DeleteFile(const Path& path) const {
    const PathParser path_parser(path);

    if (!path_parser.IsValid()) {
        LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr());
        return ERROR_INVALID_PATH;
    }

    const auto full_path = path_parser.BuildHostPath(mount_point);

    switch (path_parser.GetHostStatus(mount_point)) {
    case PathParser::InvalidMountPoint:
        LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point);
        return ERROR_FILE_NOT_FOUND;
    case PathParser::PathNotFound:
        LOG_ERROR(Service_FS, "Path not found {}", full_path);
        return ERROR_PATH_NOT_FOUND;
    case PathParser::FileInPath:
    case PathParser::DirectoryFound:
    case PathParser::NotFound:
        LOG_ERROR(Service_FS, "File not found {}", full_path);
        return ERROR_FILE_NOT_FOUND;
    case PathParser::FileFound:
        break; // Expected 'success' case
    }

    if (FileUtil::Delete(full_path)) {
        return RESULT_SUCCESS;
    }

    LOG_CRITICAL(Service_FS, "(unreachable) Unknown error deleting {}", full_path);
    return ERROR_FILE_NOT_FOUND;
}
开发者ID:Dragios,项目名称:Citra,代码行数:33,代码来源:savedata_archive.cpp


示例13: main

/// Application entry point
int main(int argc, char **argv) {
    Log::Filter log_filter(Log::Level::Debug);
    Log::SetFilter(&log_filter);

    if (argc < 2) {
        LOG_CRITICAL(Frontend, "Failed to load ROM: No ROM specified");
        return -1;
    }

    Config config;
    log_filter.ParseFilterString(Settings::values.log_filter);

    std::string boot_filename = argv[1];
    EmuWindow_GLFW* emu_window = new EmuWindow_GLFW;

    VideoCore::g_hw_renderer_enabled = Settings::values.use_hw_renderer;

    System::Init(emu_window);

    Loader::ResultStatus load_result = Loader::LoadFile(boot_filename);
    if (Loader::ResultStatus::Success != load_result) {
        LOG_CRITICAL(Frontend, "Failed to load ROM (Error %i)!", load_result);
        return -1;
    }

    while (emu_window->IsOpen()) {
        Core::RunLoop();
    }

    System::Shutdown();

    delete emu_window;

    return 0;
}
开发者ID:Corleon15,项目名称:citra,代码行数:36,代码来源:citra.cpp


示例14: LOG_DEBUG

ResultVal<std::unique_ptr<FileBackend>> SaveDataArchive::OpenFile(const Path& path,
                                                                  const Mode& mode) const {
    LOG_DEBUG(Service_FS, "called path={} mode={:01X}", path.DebugStr(), mode.hex);

    const PathParser path_parser(path);

    if (!path_parser.IsValid()) {
        LOG_ERROR(Service_FS, "Invalid path {}", path.DebugStr());
        return ERROR_INVALID_PATH;
    }

    if (mode.hex == 0) {
        LOG_ERROR(Service_FS, "Empty open mode");
        return ERROR_UNSUPPORTED_OPEN_FLAGS;
    }

    if (mode.create_flag && !mode.write_flag) {
        LOG_ERROR(Service_FS, "Create flag set but write flag not set");
        return ERROR_UNSUPPORTED_OPEN_FLAGS;
    }

    const auto full_path = path_parser.BuildHostPath(mount_point);

    switch (path_parser.GetHostStatus(mount_point)) {
    case PathParser::InvalidMountPoint:
        LOG_CRITICAL(Service_FS, "(unreachable) Invalid mount point {}", mount_point);
        return ERROR_FILE_NOT_FOUND;
    case PathParser::PathNotFound:
        LOG_ERROR(Service_FS, "Path not found {}", full_path);
        return ERROR_PATH_NOT_FOUND;
    case PathParser::FileInPath:
    case PathParser::DirectoryFound:
        LOG_ERROR(Service_FS, "Unexpected file or directory in {}", full_path);
        return ERROR_UNEXPECTED_FILE_OR_DIRECTORY;
    case PathParser::NotFound:
        if (!mode.create_flag) {
            LOG_ERROR(Service_FS, "Non-existing file {} can't be open without mode create.",
                      full_path);
            return ERROR_FILE_NOT_FOUND;
        } else {
            // Create the file
            FileUtil::CreateEmptyFile(full_path);
        }
        break;
    case PathParser::FileFound:
        break; // Expected 'success' case
    }

    FileUtil::IOFile file(full_path, mode.write_flag ? "r+b" : "rb");
    if (!file.IsOpen()) {
        LOG_CRITICAL(Service_FS, "(unreachable) Unknown error opening {}", full_path);
        return ERROR_FILE_NOT_FOUND;
    }

    std::unique_ptr<DelayGenerator> delay_generator = std::make_unique<SaveDataDelayGenerator>();
    auto disk_file = std::make_unique<DiskFile>(std::move(file), mode, std::move(delay_generator));
    return MakeResult<std::unique_ptr<FileBackend>>(std::move(disk_file));
}
开发者ID:Dragios,项目名称:Citra,代码行数:58,代码来源:savedata_archive.cpp


示例15: LOG_CRITICAL

System::ResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath) {
    app_loader = Loader::GetLoader(filepath);

    if (!app_loader) {
        LOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath);
        return ResultStatus::ErrorGetLoader;
    }
    std::pair<std::optional<u32>, Loader::ResultStatus> system_mode =
        app_loader->LoadKernelSystemMode();

    if (system_mode.second != Loader::ResultStatus::Success) {
        LOG_CRITICAL(Core, "Failed to determine system mode (Error {})!",
                     static_cast<int>(system_mode.second));

        switch (system_mode.second) {
        case Loader::ResultStatus::ErrorEncrypted:
            return ResultStatus::ErrorLoader_ErrorEncrypted;
        case Loader::ResultStatus::ErrorInvalidFormat:
            return ResultStatus::ErrorLoader_ErrorInvalidFormat;
        default:
            return ResultStatus::ErrorSystemMode;
        }
    }

    ASSERT(system_mode.first);
    ResultStatus init_result{Init(emu_window, *system_mode.first)};
    if (init_result != ResultStatus::Success) {
        LOG_CRITICAL(Core, "Failed to initialize system (Error {})!",
                     static_cast<u32>(init_result));
        System::Shutdown();
        return init_result;
    }

    std::shared_ptr<Kernel::Process> process;
    const Loader::ResultStatus load_result{app_loader->Load(process)};
    kernel->SetCurrentProcess(process);
    if (Loader::ResultStatus::Success != load_result) {
        LOG_CRITICAL(Core, "Failed to load ROM (Error {})!", static_cast<u32>(load_result));
        System::Shutdown();

        switch (load_result) {
        case Loader::ResultStatus::ErrorEncrypted:
            return ResultStatus::ErrorLoader_ErrorEncrypted;
        case Loader::ResultStatus::ErrorInvalidFormat:
            return ResultStatus::ErrorLoader_ErrorInvalidFormat;
        default:
            return ResultStatus::ErrorLoader;
        }
    }
    memory->SetCurrentPageTable(&kernel->GetCurrentProcess()->vm_manager.page_table);
    cheat_engine = std::make_unique<Cheats::CheatEngine>(*this);
    status = ResultStatus::Success;
    m_emu_window = &emu_window;
    m_filepath = filepath;
    return status;
}
开发者ID:citra-emu,项目名称:citra,代码行数:56,代码来源:core.cpp


示例16: LOG_CRITICAL

bool GMainWindow::LoadROM(const std::string& filename) {
    std::unique_ptr<Loader::AppLoader> app_loader = Loader::GetLoader(filename);
    if (!app_loader) {
        LOG_CRITICAL(Frontend, "Failed to obtain loader for %s!", filename.c_str());
        QMessageBox::critical(this, tr("Error while loading ROM!"),
                              tr("The ROM format is not supported."));
        return false;
    }

    boost::optional<u32> system_mode = app_loader->LoadKernelSystemMode();
    if (!system_mode) {
        LOG_CRITICAL(Frontend, "Failed to load ROM!");
        QMessageBox::critical(this, tr("Error while loading ROM!"),
                              tr("Could not determine the system mode."));
        return false;
    }

    if (!InitializeSystem(system_mode.get()))
        return false;

    Loader::ResultStatus result = app_loader->Load();
    if (Loader::ResultStatus::Success != result) {
        System::Shutdown();
        LOG_CRITICAL(Frontend, "Failed to load ROM!");

        switch (result) {
        case Loader::ResultStatus::ErrorEncrypted: {
            // Build the MessageBox ourselves to have clickable link
            QMessageBox popup_error;
            popup_error.setTextFormat(Qt::RichText);
            popup_error.setWindowTitle(tr("Error while loading ROM!"));
            popup_error.setText(
                tr("The game that you are trying to load must be decrypted before being used with "
                   "Citra.<br/><br/>"
                   "For more information on dumping and decrypting games, please see: <a "
                   "href='https://citra-emu.org/wiki/Dumping-Game-Cartridges'>https://"
                   "citra-emu.org/wiki/Dumping-Game-Cartridges</a>"));
            popup_error.setIcon(QMessageBox::Critical);
            popup_error.exec();
            break;
        }
        case Loader::ResultStatus::ErrorInvalidFormat:
            QMessageBox::critical(this, tr("Error while loading ROM!"),
                                  tr("The ROM format is not supported."));
            break;
        case Loader::ResultStatus::Error:

        default:
            QMessageBox::critical(this, tr("Error while loading ROM!"), tr("Unknown error!"));
            break;
        }
        return false;
    }
    return true;
}
开发者ID:SakataGintokiYT,项目名称:citra,代码行数:55,代码来源:main.cpp


示例17: ReloadSetKeymaps

EmuWindow_SDL2::EmuWindow_SDL2() {
    keyboard_id = KeyMap::NewDeviceId();

    ReloadSetKeymaps();

    SDL_SetMainReady();

    // Initialize the window
    if (SDL_Init(SDL_INIT_VIDEO) < 0) {
        LOG_CRITICAL(Frontend, "Failed to initialize SDL2! Exiting...");
        exit(1);
    }

    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
    SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
    SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
    SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 8);
    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 8);
    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8);
    SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0);

    std::string window_title =
        Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc);
    render_window = SDL_CreateWindow(
        window_title.c_str(),
        SDL_WINDOWPOS_UNDEFINED, // x position
        SDL_WINDOWPOS_UNDEFINED, // y position
        VideoCore::kScreenTopWidth, VideoCore::kScreenTopHeight + VideoCore::kScreenBottomHeight,
        SDL_WINDOW_OPENGL | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);

    if (render_window == nullptr) {
        LOG_CRITICAL(Frontend, "Failed to create SDL2 window! Exiting...");
        exit(1);
    }

    gl_context = SDL_GL_CreateContext(render_window);

    if (gl_context == nullptr) {
        LOG_CRITICAL(Frontend, "Failed to create SDL2 GL context! Exiting...");
        exit(1);
    }

    if (!gladLoadGLLoader(static_cast<GLADloadproc>(SDL_GL_GetProcAddress))) {
        LOG_CRITICAL(Frontend, "Failed to initialize GL functions! Exiting...");
        exit(1);
    }

    OnResize();
    OnMinimalClientAreaChangeRequest(GetActiveConfig().min_client_area_size);
    SDL_PumpEvents();
    SDL_GL_SetSwapInterval(Settings::values.use_vsync);

    DoneCurrent();
}
开发者ID:JamePeng,项目名称:citra,代码行数:55,代码来源:emu_window_sdl2.cpp


示例18: LOG_DEBUG

bool StorageAdapter::init()
{
    FUNCTION_CALL_TRACE;

    // ** Process properties from client/server plugin

    // ** Process properties from storage plugin
    QMap<QString, QString> pluginProperties;

    iPlugin->getProperties( pluginProperties );
    LOG_DEBUG( "StorageAdapter: dumping storage properties:" );
    LOG_DEBUG( pluginProperties );

    // Preferred format

    QString preferredFormat = pluginProperties.value( STORAGE_DEFAULT_MIME_PROP );
    QString preferredVersion = pluginProperties.value( STORAGE_DEFAULT_MIME_VERSION_PROP );
    if( preferredFormat.isEmpty() || preferredVersion.isEmpty() ) {
        LOG_CRITICAL( "No STORAGE_DEFAULT_MIME_PROP or STORAGE_DEFAULT_MIME_VERSION_PROP"
                      <<"found for storage: " << iPlugin->getPluginName() );
        return false;
    }

    // Currently we support only one format per storage
    DataSync::ContentFormat format;
    format.iType = preferredFormat;
    format.iVersion = preferredVersion;
    iFormats.setPreferredRx( format );
    iFormats.setPreferredTx( format );
    iFormats.rx().append( format );
    iFormats.tx().append( format );

    // Source URI

    iSourceDB = pluginProperties.value( STORAGE_SOURCE_URI );

    if( iSourceDB.isEmpty() ) {
        LOG_CRITICAL( "No STORAGE_SOURCE_URI prop found for storage: " << iPlugin->getPluginName() );
        return false;
    }

    // Target URI

    iTargetDB = pluginProperties[STORAGE_REMOTE_URI];

    // ** Own initialization

    iType = preferredFormat;

    QString dbFilePath = SyncMLConfig::getDatabasePath() + ADAPTERDBFILE;
    iIdMapper.init( dbFilePath, iPlugin->getPluginName() );

    return true;

}
开发者ID:amtep,项目名称:buteo-sync-plugins,代码行数:55,代码来源:StorageAdapter.cpp


示例19: MemoryFill

static void MemoryFill(const Regs::MemoryFillConfig& config) {
    const PAddr start_addr = config.GetStartAddress();
    const PAddr end_addr = config.GetEndAddress();

    // TODO: do hwtest with these cases
    if (!Memory::IsValidPhysicalAddress(start_addr)) {
        LOG_CRITICAL(HW_GPU, "invalid start address {:#010X}", start_addr);
        return;
    }

    if (!Memory::IsValidPhysicalAddress(end_addr)) {
        LOG_CRITICAL(HW_GPU, "invalid end address {:#010X}", end_addr);
        return;
    }

    if (end_addr <= start_addr) {
        LOG_CRITICAL(HW_GPU, "invalid memory range from {:#010X} to {:#010X}", start_addr,
                     end_addr);
        return;
    }

    u8* start = Memory::GetPhysicalPointer(start_addr);
    u8* end = Memory::GetPhysicalPointer(end_addr);

    if (VideoCore::g_renderer->Rasterizer()->AccelerateFill(config))
        return;

    Memory::RasterizerInvalidateRegion(config.GetStartAddress(),
                                       config.GetEndAddress() - config.GetStartAddress());

    if (config.fill_24bit) {
        // fill with 24-bit values
        for (u8* ptr = start; ptr < end; ptr += 3) {
            ptr[0] = config.value_24bit_r;
            ptr[1] = config.value_24bit_g;
            ptr[2] = config.value_24bit_b;
        }
    } else if (config.fill_32bit) {
        // fill with 32-bit values
        if (end > start) {
            u32 value = config.value_32bit;
            size_t len = (end - start) / sizeof(u32);
            for (size_t i = 0; i < len; ++i)
                memcpy(&start[i * sizeof(u32)], &value, sizeof(u32));
        }
    } else {
        // fill with 16-bit values
        u16 value_16bit = config.value_16bit.Value();
        for (u8* ptr = start; ptr < end; ptr += sizeof(u16))
            memcpy(ptr, &value_16bit, sizeof(u16));
    }
}
开发者ID:namkazt,项目名称:citra,代码行数:52,代码来源:gpu.cpp


示例20: vhpi_get_value

int VhpiSignalObjHdl::initialise(std::string &name) {
    // Determine the type of object, either scalar or vector
    m_value.format = vhpiObjTypeVal;
    m_value.bufSize = 0;
    m_value.value.str = NULL;

    vhpi_get_value(GpiObjHdl::get_handle<vhpiHandleT>(), &m_value);
    check_vhpi_error();

    switch (m_value.format) {
        case vhpiEnumVal:
        case vhpiLogicVal: {
            m_value.value.enumv = vhpi0;
            break;
        }

        case vhpiEnumVecVal:
        case vhpiLogicVecVal: {
            m_size = vhpi_get(vhpiSizeP, GpiObjHdl::get_handle<vhpiHandleT>());
            m_value.bufSize = m_size*sizeof(vhpiEnumT); 
            m_value.value.enumvs = (vhpiEnumT *)malloc(m_value.bufSize);
            if (!m_value.value.enumvs) {
                LOG_CRITICAL("Unable to alloc mem for write buffer: ABORTING");
            }

            break;
        }

        default: {
            LOG_ERROR("Unable to determine property for %s (%d) format object",
                         ((VhpiImpl*)GpiObjHdl::m_impl)->format_to_string(m_value.format), m_value.format);
        }
    }

    /* We also alloc a second value member for use with read string operations */
    m_binvalue.format = vhpiBinStrVal;
    m_binvalue.bufSize = 0;
    m_binvalue.value.str = NULL;

    int new_size = vhpi_get_value(GpiObjHdl::get_handle<vhpiHandleT>(), &m_binvalue);

    m_binvalue.bufSize = new_size*sizeof(vhpiCharT) + 1;
    m_binvalue.value.str = (vhpiCharT *)calloc(m_binvalue.bufSize, m_binvalue.bufSize);

    if (!m_value.value.str) {
        LOG_CRITICAL("Unable to alloc mem for read buffer: ABORTING");
    }

    GpiObjHdl::initialise(name);

    return 0;
}
开发者ID:ambikeshwar1991,项目名称:cocotb,代码行数:52,代码来源:VhpiCbHdl.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ LOG_D函数代码示例发布时间:2022-05-30
下一篇:
C++ LOG_BUF函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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