repo_name
stringlengths
2
55
dataset
stringclasses
1 value
owner
stringlengths
3
31
lang
stringclasses
10 values
func_name
stringlengths
1
104
code
stringlengths
20
96.7k
docstring
stringlengths
1
4.92k
url
stringlengths
94
241
sha
stringlengths
40
40
FluentUI
github_2023
zhuzichu520
cpp
QCPAxis::setRange
void QCPAxis::setRange(double lower, double upper) { if (lower == mRange.lower && upper == mRange.upper) return; if (!QCPRange::validRange(lower, upper)) return; QCPRange oldRange = mRange; mRange.lower = lower; mRange.upper = upper; if (mScaleType == stLogarithmic) { mRange = mRange.sanitizedF...
/*! \overload Sets the lower and upper bound of the axis range. To invert the direction of an axis, use \ref setRangeReversed. There is also a slot to set a range, see \ref setRange(const QCPRange &range). */
https://github.com/zhuzichu520/FluentUI/blob/09e04302930883c06d87a0c0e304d527f4e8c6cc/src/qmlcustomplot/qcustomplot.cpp#L8459-L8477
09e04302930883c06d87a0c0e304d527f4e8c6cc
FluentUI
github_2023
zhuzichu520
cpp
QCPTextElement::QCPTextElement
QCPTextElement::QCPTextElement(QCustomPlot *parentPlot, const QString &text, double pointSize) : QCPLayoutElement(parentPlot), mText(text), mTextFlags(Qt::AlignCenter), mFont(QFont(QLatin1String("sans serif"), int(pointSize))), // will be taken from parentPlot if available, see below mTextColor(Qt::black), ...
/*! \overload Creates a new QCPTextElement instance and sets default values. The initial text is set to \a text with \a pointSize. */
https://github.com/zhuzichu520/FluentUI/blob/09e04302930883c06d87a0c0e304d527f4e8c6cc/src/qmlcustomplot/qcustomplot.cpp#L19729-L19749
09e04302930883c06d87a0c0e304d527f4e8c6cc
FluentUI
github_2023
zhuzichu520
cpp
QCPFinancial::setChartStyle
void QCPFinancial::setChartStyle(QCPFinancial::ChartStyle style) { mChartStyle = style; }
/*! Sets which representation style shall be used to display the OHLC data. */
https://github.com/zhuzichu520/FluentUI/blob/09e04302930883c06d87a0c0e304d527f4e8c6cc/src/qmlcustomplot/qcustomplot.cpp#L27156-L27159
09e04302930883c06d87a0c0e304d527f4e8c6cc
FluentUI
github_2023
zhuzichu520
cpp
QCPItemCurve::mainPen
QPen QCPItemCurve::mainPen() const { return mSelected ? mSelectedPen : mPen; }
/*! \internal Returns the pen that should be used for drawing lines. Returns mPen when the item is not selected and mSelectedPen when it is. */
https://github.com/zhuzichu520/FluentUI/blob/09e04302930883c06d87a0c0e304d527f4e8c6cc/src/qmlcustomplot/qcustomplot.cpp#L29426-L29429
09e04302930883c06d87a0c0e304d527f4e8c6cc
FluentUI
github_2023
zhuzichu520
cpp
QCPPolarAxisRadial::subTickLengthOut
int QCPPolarAxisRadial::subTickLengthOut() const { return mSubTickLengthOut; }
/* No documentation as it is a property getter */
https://github.com/zhuzichu520/FluentUI/blob/09e04302930883c06d87a0c0e304d527f4e8c6cc/src/qmlcustomplot/qcustomplot.cpp#L31207-L31210
09e04302930883c06d87a0c0e304d527f4e8c6cc
srsRAN_Project
github_2023
srsran
cpp
rx_timing_window_params_us_to_symbols
static ofh::rx_window_timing_parameters rx_timing_window_params_us_to_symbols(std::chrono::microseconds Ta4_max, std::chrono::microseconds Ta4_min, std::chrono::duration<double, std::nano> symbol_duration) { ofh:...
/// Converts reception window timing parameters from microseconds to number of symbols given the symbol duration.
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/apps/units/flexible_o_du/split_7_2/helpers/ru_ofh_config_translator.cpp#L46-L56
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
ran_param_definition_choice_c::set
void ran_param_definition_choice_c::set(types::options e) { type_ = e; switch (type_) { case types::choice_list: c = ran_param_definition_choice_list_s{}; break; case types::choice_structure: c = ran_param_definition_choice_structure_s{}; break; case types::nulltype: break;...
// RANParameter-Definition-Choice ::= CHOICE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/e2sm/e2sm_rc_ies.cpp#L320-L335
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
ran_param_value_type_choice_elem_false_s::pack
SRSASN_CODE ran_param_value_type_choice_elem_false_s::pack(bit_ref& bref) const { bref.pack(ext, 1); HANDLE_CODE(bref.pack(ran_param_value_present, 1)); if (ran_param_value_present) { HANDLE_CODE(ran_param_value.pack(bref)); } return SRSASN_SUCCESS; }
// RANParameter-ValueType-Choice-ElementFalse ::= SEQUENCE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/e2sm/e2sm_rc_ies.cpp#L8579-L8589
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
active_ul_bwp_s::pack
SRSASN_CODE active_ul_bwp_s::pack(bit_ref& bref) const { HANDLE_CODE(bref.pack(shift7dot5k_hz_present, 1)); HANDLE_CODE(bref.pack(ie_exts_present, 1)); HANDLE_CODE(pack_integer(bref, location_and_bw, (uint16_t)0u, (uint16_t)37949u, true, true)); HANDLE_CODE(subcarrier_spacing.pack(bref)); HANDLE_CODE(cp.pack...
// ActiveULBWP ::= SEQUENCE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/f1ap/f1ap_ies.cpp#L5856-L5874
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
broadcast_m_rbs_failed_to_be_modified_item_s::pack
SRSASN_CODE broadcast_m_rbs_failed_to_be_modified_item_s::pack(bit_ref& bref) const { bref.pack(ext, 1); HANDLE_CODE(bref.pack(cause_present, 1)); HANDLE_CODE(bref.pack(ie_exts_present, 1)); HANDLE_CODE(pack_integer(bref, mrb_id, (uint16_t)1u, (uint16_t)512u, true, true)); if (cause_present) { HANDLE_COD...
// BroadcastMRBs-FailedToBeModified-Item ::= SEQUENCE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/f1ap/f1ap_ies.cpp#L14385-L14400
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
prs_cfg_s::pack
SRSASN_CODE prs_cfg_s::pack(bit_ref& bref) const { HANDLE_CODE(bref.pack(ie_exts_present, 1)); HANDLE_CODE(pack_dyn_seq_of(bref, prs_res_set_list, 1, 8, true)); if (ie_exts_present) { HANDLE_CODE(ie_exts.pack(bref)); } return SRSASN_SUCCESS; }
// PRSConfiguration ::= SEQUENCE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/f1ap/f1ap_ies.cpp#L35129-L35139
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
multicast_distribution_setup_request_ies_o::idx_to_id
uint32_t multicast_distribution_setup_request_ies_o::idx_to_id(uint32_t idx) { static const uint32_t names[] = {451, 452, 502, 503}; return map_enum_number(names, 4, idx, "id"); }
// MulticastDistributionSetupRequestIEs ::= OBJECT SET OF F1AP-PROTOCOL-IES
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/f1ap/f1ap_pdu_contents.cpp#L19058-L19062
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
sl_drbs_failed_to_be_modified_item_ies_o::idx_to_id
uint32_t sl_drbs_failed_to_be_modified_item_ies_o::idx_to_id(uint32_t idx) { static const uint32_t names[] = {313}; return map_enum_number(names, 1, idx, "id"); }
// SLDRBs-FailedToBeModified-ItemIEs ::= OBJECT SET OF F1AP-PROTOCOL-IES
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/f1ap/f1ap_pdu_items.cpp#L5570-L5574
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
intersys_son_cfg_transfer_s::pack
SRSASN_CODE intersys_son_cfg_transfer_s::pack(bit_ref& bref) const { bref.pack(ext, 1); HANDLE_CODE(bref.pack(ie_exts_present, 1)); HANDLE_CODE(transfer_type.pack(bref)); HANDLE_CODE(intersys_son_info.pack(bref)); if (ie_exts_present) { HANDLE_CODE(ie_exts.pack(bref)); } return SRSASN_SUCCESS; }
// IntersystemSONConfigurationTransfer ::= SEQUENCE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/ngap/ngap_ies.cpp#L17882-L17894
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
ran_cp_relocation_ind_ies_o::value_c::set
void ran_cp_relocation_ind_ies_o::value_c::set(types::options e) { type_ = e; switch (type_) { case types::ran_ue_ngap_id: c = uint64_t{}; break; case types::five_g_s_tmsi: c = five_g_s_tmsi_s{}; break; case types::eutra_cgi: c = eutra_cgi_s{}; break; case types::...
// Value ::= OPEN TYPE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/ngap/ngap_pdu_contents.cpp#L28248-L28272
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
feature_combination_r17_s::pack
SRSASN_CODE feature_combination_r17_s::pack(bit_ref& bref) const { HANDLE_CODE(bref.pack(red_cap_r17_present, 1)); HANDLE_CODE(bref.pack(small_data_r17_present, 1)); HANDLE_CODE(bref.pack(nsag_r17.size() > 0, 1)); HANDLE_CODE(bref.pack(msg3_repeats_r17_present, 1)); HANDLE_CODE(bref.pack(spare4_present, 1)); ...
// FeatureCombination-r17 ::= SEQUENCE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/bwp_cfg.cpp#L428-L444
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
pucch_res_ext_v1610_s::pack
SRSASN_CODE pucch_res_ext_v1610_s::pack(bit_ref& bref) const { bref.pack(ext, 1); HANDLE_CODE(bref.pack(interlace_alloc_r16_present, 1)); HANDLE_CODE(bref.pack(format_v1610_present, 1)); if (interlace_alloc_r16_present) { HANDLE_CODE(pack_integer(bref, interlace_alloc_r16.rb_set_idx_r16, (uint8_t)0u, (uint...
// PUCCH-ResourceExt-v1610 ::= SEQUENCE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/bwp_cfg.cpp#L7530-L7564
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
meas_trigger_quant_offset_c::destroy_
void meas_trigger_quant_offset_c::destroy_() {}
// MeasTriggerQuantityOffset ::= CHOICE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/meas_cfg.cpp#L738-L738
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
var_conn_est_fail_report_list_r17_s::pack
SRSASN_CODE var_conn_est_fail_report_list_r17_s::pack(bit_ref& bref) const { HANDLE_CODE(pack_dyn_seq_of(bref, conn_est_fail_report_list_r17, 1, 4)); return SRSASN_SUCCESS; }
// VarConnEstFailReportList-r17 ::= SEQUENCE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/nr_ue_variables.cpp#L491-L496
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
dummy_a_s::pack
SRSASN_CODE dummy_a_s::pack(bit_ref& bref) const { HANDLE_CODE(pack_integer(bref, max_num_nzp_csi_rs_per_cc, (uint8_t)1u, (uint8_t)32u)); HANDLE_CODE(max_num_ports_across_nzp_csi_rs_per_cc.pack(bref)); HANDLE_CODE(max_num_cs_im_per_cc.pack(bref)); HANDLE_CODE(max_num_simul_csi_rs_act_bwp_all_cc.pack(bref)); H...
// DummyA ::= SEQUENCE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/ue_cap.cpp#L19179-L19188
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
reestab_ue_id_s::pack
SRSASN_CODE reestab_ue_id_s::pack(bit_ref& bref) const { HANDLE_CODE(pack_integer(bref, c_rnti, (uint32_t)0u, (uint32_t)65535u)); HANDLE_CODE(pack_integer(bref, pci, (uint16_t)0u, (uint16_t)1007u)); HANDLE_CODE(short_mac_i.pack(bref)); return SRSASN_SUCCESS; }
// ReestabUE-Identity ::= SEQUENCE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/ul_ccch_msg_ies.cpp#L222-L229
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
sl_qos_info_r16_s::pack
SRSASN_CODE sl_qos_info_r16_s::pack(bit_ref& bref) const { HANDLE_CODE(bref.pack(sl_qos_profile_r16_present, 1)); HANDLE_CODE(pack_integer(bref, sl_qos_flow_id_r16, (uint16_t)1u, (uint16_t)2048u)); if (sl_qos_profile_r16_present) { HANDLE_CODE(sl_qos_profile_r16.pack(bref)); } return SRSASN_SUCCESS; }
// SL-QoS-Info-r16 ::= SEQUENCE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/ul_dcch_msg_ies.cpp#L1761-L1771
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
scg_fail_info_ies_s::pack
SRSASN_CODE scg_fail_info_ies_s::pack(bit_ref& bref) const { HANDLE_CODE(bref.pack(fail_report_scg_present, 1)); HANDLE_CODE(bref.pack(non_crit_ext_present, 1)); if (fail_report_scg_present) { HANDLE_CODE(fail_report_scg.pack(bref)); } if (non_crit_ext_present) { HANDLE_CODE(non_crit_ext.pack(bref));...
// SCGFailureInformation-IEs ::= SEQUENCE
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/asn1/rrc_nr/ul_dcch_msg_ies.cpp#L18424-L18437
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
fill_format_2_3_4_harq
static void fill_format_2_3_4_harq(fapi::uci_pucch_pdu_format_2_3_4_builder& builder, const pucch_uci_message& message) { units::bits harq_len = units::bits(message.get_expected_nof_harq_ack_bits()); if (harq_len.value() == 0) { return; } uci_pusch_or_pucch_f2_3_4_detection_status status = to_fapi_uc...
/// Fills the HARQ parameters for PUCCH Format 2/3/4 using the given builder and message.
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/lib/fapi_adaptor/phy/phy_to_fapi_results_event_translator.cpp#L429-L449
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
TEST
TEST(validate_dl_tti_request, valid_request_passes) { dl_tti_request_message msg = build_valid_dl_tti_request(); const auto& result = validate_dl_tti_request(msg); ASSERT_TRUE(result); }
/// Tests that a valid UL_TTI.request message validates correctly.
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/tests/unittests/fapi/validators/dl_tti_request_test.cpp#L77-L84
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
TEST_F
TEST_F(DciValidatorFallbackFixture, SupplementaryUplinkNotSupported) { dci_size_config config = get_base_dci_config(); config.sul_configured = true; std::string assert_message = fmt::format("SUL is not currently supported by the DCI size alignment procedure."); test_validator(config, assert_message); ...
// SUL not configured check.
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/tests/unittests/ran/pdcch/dci_packing_validator_test.cpp#L273-L280
a041e3162d7ea94a7963437f32df372fae5d21ea
srsRAN_Project
github_2023
srsran
cpp
get_next_candidate_alloc_slot
slot_point get_next_candidate_alloc_slot(slot_point sched_slot, unsigned nof_slot_grid_occupancy) const { if (nof_slot_grid_occupancy == 0) { return sched_slot; } unsigned occupy_grid_slot_cnt = 0; // The allocation must be on a DL slot. do { sched_slot++; if (bench->cell_cfg.i...
// Returns the next candidate slot at which the SRB0 scheduler is expected to allocate a grant.
https://github.com/srsran/srsRAN_Project/blob/a041e3162d7ea94a7963437f32df372fae5d21ea/tests/unittests/scheduler/ue_scheduling/fallback_scheduler_test.cpp#L748-L778
a041e3162d7ea94a7963437f32df372fae5d21ea
clr
github_2023
ROCm
cpp
OCLPerfAtomicSpeed::SetKernelArguments
void OCLPerfAtomicSpeed::SetKernelArguments(const AtomicType atomicType) { int Arg = 0; int localSize = 0; int itemsPerThread = 1; cl_int status = CL_SUCCESS; switch (atomicType) { case LocalHistogram: // Set arguments for the local atomics histogram kernel status = _wrapper->clSetKernelArg(_...
// Sets the kernel arguments based on the current test type.
https://github.com/ROCm/clr/blob/a8edb8d467ebb5678d2f4506bd01efd3aaeddcab/opencl/tests/ocltst/module/perf/OCLPerfAtomicSpeed.cpp#L381-L459
a8edb8d467ebb5678d2f4506bd01efd3aaeddcab
Zygisk-ImGui-Menu
github_2023
fedes1to
cpp
ImGui::PushColumnsBackground
void ImGui::PushColumnsBackground() { ImGuiWindow* window = GetCurrentWindowRead(); ImGuiOldColumns* columns = window->DC.CurrentColumns; if (columns->Count == 1) return; // Optimization: avoid SetCurrentChannel() + PushClipRect() columns->HostBackupClipRect = window->ClipRect; SetWindo...
// Get into the columns background draw command (which is generally the same draw command as before we called BeginColumns)
https://github.com/fedes1to/Zygisk-ImGui-Menu/blob/faffb17a4ba56d2d208cd25b912260c79cd99089/module/src/main/cpp/ImGui/imgui_tables.cpp#L4071-L4082
faffb17a4ba56d2d208cd25b912260c79cd99089
flatburn
github_2023
MIT-Senseable-City-Lab
cpp
Sd2Card::readEnd
void Sd2Card::readEnd(void) { if (inBlock_) { // skip data and crc #ifdef OPTIMIZE_HARDWARE_SPI // optimize skip for hardware SPDR = 0XFF; while (offset_++ < 513) { while (!(SPSR & (1 << SPIF))) ; SPDR = 0XFF; } // wait for last crc byte while (!(SPSR & (1 << SPIF))...
//------------------------------------------------------------------------------ /** Skip remaining data in a block when in partial block read mode. */
https://github.com/MIT-Senseable-City-Lab/flatburn/blob/dc5bdbfeb53ac85cb26f27325326cbd7c868c9a3/Build/Firmware/lib/sdcard/src/utility/Sd2Card.cpp#L475-L497
dc5bdbfeb53ac85cb26f27325326cbd7c868c9a3
nanotube
github_2023
Xilinx
cpp
main
int main(int argc, char *argv[]) { llvm::InitLLVM init_llvm(argc, argv); // Initialize passes. See llvm/tools/opt/opt.cpp llvm::PassRegistry &registry = *llvm::PassRegistry::getPassRegistry(); llvm::initializeCore(registry); llvm::initializeAnalysis(registry); llvm::initializeTransformUtils(registry); ...
/////////////////////////////////////////////////////////////////////////// // The main program.
https://github.com/Xilinx/nanotube/blob/9ff2e920b02eb1b7df55811cf8b25f1dd410f61c/back_end/back_end_main.cpp#L110-L147
9ff2e920b02eb1b7df55811cf8b25f1dd410f61c
risam
github_2023
rpl-cmu
cpp
RISAM2::dot
void RISAM2::dot(std::ostream& s, sharedClique clique, const KeyFormatter& keyFormatter, int parentnum) const { static int num = 0; bool first = true; std::stringstream out; out << num; std::string parent = out.str(); parent += "[label=\""; for (Key key : clique->conditional_->frontals()) { if (!firs...
/* ************************************************************************* */
https://github.com/rpl-cmu/risam/blob/a6f9b4459e6820f81f6d2d113d57d43638ae32a3/risam/src/RISAM2.cpp#L769-L820
a6f9b4459e6820f81f6d2d113d57d43638ae32a3
nostr-signing-device
github_2023
lnbits
cpp
main
int main() { DynamicJsonDocument doc(1024); doc["dummy"].as<char>(); }
// See issue #1498
https://github.com/lnbits/nostr-signing-device/blob/1956e5933b3da5e49d30db9b8597497b157a5cbc/libraries/ArduinoJson/extras/tests/FailingBuilds/variant_as_char.cpp#L9-L12
1956e5933b3da5e49d30db9b8597497b157a5cbc
nostr-signing-device
github_2023
lnbits
cpp
TFT_eSPI::begin_tft_write
inline void TFT_eSPI::begin_tft_write(void){ if (locked) { locked = false; // Flag to show SPI access now unlocked #if defined (SPI_HAS_TRANSACTION) && defined (SUPPORT_TRANSACTIONS) && !defined(TFT_PARALLEL_8_BIT) && !defined(RP2040_PIO_INTERFACE) spi.beginTransaction(SPISettings(SPI_FREQUENCY, MSBFIRST, TFT...
/*************************************************************************************** ** Function name: begin_tft_write (was called spi_begin) ** Description: Start SPI transaction for writes and select TFT ***************************************************************************************/
https://github.com/lnbits/nostr-signing-device/blob/1956e5933b3da5e49d30db9b8597497b157a5cbc/libraries/TFT_eSPI/TFT_eSPI.cpp#L74-L83
1956e5933b3da5e49d30db9b8597497b157a5cbc
nostr-signing-device
github_2023
lnbits
cpp
Cipher
static void Cipher(state_t* state, const uint8_t* RoundKey) { uint8_t round = 0; // Add the First round key to the state before starting the rounds. AddRoundKey(0, state, RoundKey); // There will be Nr rounds. // The first Nr-1 rounds are identical. // These Nr rounds are executed in the loop below. // ...
// #if (defined(CBC) && CBC == 1) || (defined(ECB) && ECB == 1) // Cipher is the main function that encrypts the PlainText.
https://github.com/lnbits/nostr-signing-device/blob/1956e5933b3da5e49d30db9b8597497b157a5cbc/libraries/tiny-AES-c/aes.cpp#L413-L436
1956e5933b3da5e49d30db9b8597497b157a5cbc
llama.cpp
github_2023
ggerganov
cpp
dequantize_mul_mat_vec_q5_k
static void dequantize_mul_mat_vec_q5_k(const void *__restrict__ vx, const float *__restrict__ yy, float *__restrict__ dst, const int ncols, const sycl::nd_item...
/* DPCT1110:7: The total declared local variable size in device function dequantize_mul_mat_vec_q5_k exceeds 128 bytes and may cause high register pressure. Consult with your hardware vendor to find the total register size available and adjust the code, or use smaller sub-group size to avoid high register pressure. */
https://github.com/ggerganov/llama.cpp/blob/4078c77f9891831f29ffc7c315c8ec6695ba5ce7/ggml/src/ggml-sycl/dmmv.cpp#L520-L645
4078c77f9891831f29ffc7c315c8ec6695ba5ce7
llama.cpp
github_2023
ggerganov
cpp
vars
std::string vars() override { return VARS_TO_STR6(type, n, m, r, b, v); }
// view (non-contiguous src1)
https://github.com/ggerganov/llama.cpp/blob/4078c77f9891831f29ffc7c315c8ec6695ba5ce7/tests/test-backend-ops.cpp#L1086-L1088
4078c77f9891831f29ffc7c315c8ec6695ba5ce7
AutoDriving-Planning-Control-Algorithm-Simulation-Carla
github_2023
L5Player
cpp
DriveWidget::leaveEvent
void DriveWidget::leaveEvent(QEvent *event) { stop(); }
// When the mouse leaves the widget but the button is still held down, // we don't get the leaveEvent() because the mouse is "grabbed" (by // default from Qt). However, when the mouse drags out of the widget // and then other buttons are pressed (or possibly other // window-manager things happen), we will get a leaveE...
https://github.com/L5Player/AutoDriving-Planning-Control-Algorithm-Simulation-Carla/blob/cf02ec2e9d7df21f2a021a11880e382d654de5d8/src/ros-bridge/rviz_carla_plugin/src/drive_widget.cpp#L209-L212
cf02ec2e9d7df21f2a021a11880e382d654de5d8
JsonAsAsset
github_2023
JsonAsAsset
cpp
detexDecompressBlockBPTC_SIGNED_FLOAT
bool detexDecompressBlockBPTC_SIGNED_FLOAT(const uint8_t * DETEX_RESTRICT bitstring, uint32_t mode_mask, uint32_t flags, uint8_t * DETEX_RESTRICT pixel_buffer) { return DecompressBlockBPTCFloatShared(bitstring, mode_mask, flags, true, pixel_buffer); }
/* Decompress a 128-bit 4x4 pixel texture block compressed using the */ /* BPTC_FLOAT (BC6H_FLOAT) format. The output format is */ /* DETEX_PIXEL_FORMAT_SIGNED_FLOAT_RGBX16. */
https://github.com/JsonAsAsset/JsonAsAsset/blob/75767cc02d79923d7411546856e75e956da46d47/Source/Detex/ThirdParty/detex/decompress-bptc-float.cpp#L640-L644
75767cc02d79923d7411546856e75e956da46d47
JsonAsAsset
github_2023
JsonAsAsset
cpp
BlockATI1::flip4
void BlockATI1::flip4() { alpha.flip4(); }
/// Flip ATI1 block vertically.
https://github.com/JsonAsAsset/JsonAsAsset/blob/75767cc02d79923d7411546856e75e956da46d47/Source/NVTT/ThirdParty/nvtt/nvimage/BlockDXT.cpp#L504-L507
75767cc02d79923d7411546856e75e956da46d47
moonray
github_2023
dreamworksanimation
cpp
TileWorkQueue::clampToPass
void TileWorkQueue::clampToPass(unsigned passIdx) { MNRY_ASSERT(mNumPasses); passIdx = std::min(passIdx, mNumPasses - 1u); mGroupClampIdx = mPassInfos[passIdx].mEndGroupIdx; }
// Executes the up until and including this pass and then stops.
https://github.com/dreamworksanimation/moonray/blob/540f3e757ec334bf68a0a47222ad204ed2e3de04/lib/rendering/rndr/TileWorkQueue.cc#L165-L171
540f3e757ec334bf68a0a47222ad204ed2e3de04
dillo-plus
github_2023
crossbowerbt
cpp
CharIterator::CharIterator
CharIterator::CharIterator () { it = NULL; }
// ----------------- // CharIterator // -----------------
https://github.com/crossbowerbt/dillo-plus/blob/7d093e6bddcb3338938ea5959844e62ff1f9b76f/dw/iterator.cc#L736-L739
7d093e6bddcb3338938ea5959844e62ff1f9b76f
dillo-plus
github_2023
crossbowerbt
cpp
a_Menu_bugmeter_popup
void a_Menu_bugmeter_popup(BrowserWindow *bw, const DilloUrl *url) { static Fl_Menu_Item pm[] = { {"Validate URL with W3C", 0, Menu_bugmeter_validate_w3c_cb,0,0,0,0,0,0}, {"Validate URL with WDG", 0, Menu_bugmeter_validate_wdg_cb, 0, FL_MENU_DIVIDER,0,0,0,0}, {"About bug meter", 0, Menu_bugm...
/* * Bugmeter popup menu (construction & popup) */
https://github.com/crossbowerbt/dillo-plus/blob/7d093e6bddcb3338938ea5959844e62ff1f9b76f/src/menu.cc#L614-L631
7d093e6bddcb3338938ea5959844e62ff1f9b76f
ai.deploy.box
github_2023
TalkUHulk
cpp
ClipperBase::PopScanbeam
bool ClipperBase::PopScanbeam(cInt &Y) { if (m_Scanbeam.empty()) return false; Y = m_Scanbeam.top(); m_Scanbeam.pop(); while (!m_Scanbeam.empty() && Y == m_Scanbeam.top()) { m_Scanbeam.pop(); } // Pop duplicates. return true; }
//------------------------------------------------------------------------------
https://github.com/TalkUHulk/ai.deploy.box/blob/f937195eab6de38078d1524dae598fd5f142c8c8/source/utility/clipper.cpp#L1283-L1292
f937195eab6de38078d1524dae598fd5f142c8c8
Love-Babbar-CPP-DSA-Course
github_2023
kishanrajput23
cpp
insertAtTail
void insertAtTail(Node* &tail, int d) { Node* temp = new Node(d); tail->next = temp; tail = temp; }
// inserting new node at tail or ending
https://github.com/kishanrajput23/Love-Babbar-CPP-DSA-Course/blob/1876e75344fe102245dd18802d2c9540e70f5525/Lectures/Lecture_44/Lecture_Codes/Singly_Linked_List/05_deleting_node.cpp#L34-L38
1876e75344fe102245dd18802d2c9540e70f5525
VkDoom
github_2023
dpjudas
cpp
main
int main(int argc, char** argv) { std::vector<std::string> inputFiles; std::vector<std::string> outputDirOrFiles; std::string whiteListFile; int opts; int verbosity; // handle errors by exiting spv::spirvbin_t::registerErrorHandler(errH...
// namespace
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/libraries/ZVulkan/src/glslang/StandAlone/spirv-remap.cpp#L365-L402
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
TShader::setHlslIoMapping
void TShader::setHlslIoMapping(bool hlslIoMap) { intermediate->setHlslIoMapping(hlslIoMap); }
// See comment above TDefaultHlslIoMapper in iomapper.cpp:
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/libraries/ZVulkan/src/glslang/glslang/MachineIndependent/ShaderLang.cpp#L1854-L1854
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
TIntermediate::addUsedLocation
int TIntermediate::addUsedLocation(const TQualifier& qualifier, const TType& type, bool& typeCollision) { typeCollision = false; int set; if (qualifier.isPipeInput()) set = 0; else if (qualifier.isPipeOutput()) set = 1; else if (qualifier.storage == EvqUniform) set = 2; ...
// Accumulate locations used for inputs, outputs, and uniforms, payload, callable data, and tileImageEXT // and check for collisions as the accumulation is done. // // Returns < 0 if no collision, >= 0 if collision and the value returned is a colliding value. // // typeCollision is set to true if there is no direct col...
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/libraries/ZVulkan/src/glslang/glslang/MachineIndependent/linkValidate.cpp#L1617-L1738
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
SetupGenMidi
static void SetupGenMidi() { // The OPL renderer should not care about where this comes from. // Note: No I_Error here - this needs to be consistent with the rest of the music code. auto lump = fileSystem.CheckNumForName("GENMIDI", ns_global); if (lump < 0) { Printf("No GENMIDI lump found. OPL playback not avail...
//========================================================================== // // Pass some basic working data to the music backend // We do this once at startup for everything available. // //==========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/audio/music/i_music.cpp#L173-L187
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
SoundEngine::UnlinkChannel
void SoundEngine::UnlinkChannel(FSoundChan *chan) { *(chan->PrevChan) = chan->NextChan; if (chan->NextChan != NULL) { chan->NextChan->PrevChan = chan->PrevChan; } }
//========================================================================== // // S_UnlinkChannel // //==========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/audio/sound/s_sound.cpp#L252-L259
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
InterplayDecoder::DecodeBlock7
void InterplayDecoder::DecodeBlock7(int32_t offset) { uint8_t* pBuffer = GetCurrentFrame() + (intptr_t)offset; uint32_t flags = 0; uint8_t P[2]; P[0] = *ChunkPtr++; P[1] = *ChunkPtr++; // 2-color encoding if (P[0] <= P[1]) { // need 8 more bytes from the stream for (int...
// Block6 is unknown and skipped
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/cutscenes/playmve.cpp#L822-L862
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
Atomic
static void Atomic() { // Flip current white CurrentWhite = OtherWhite(); SweepPos = &Root; State = GCS_Sweep; Estimate = AllocBytes; }
//========================================================================== // // Atomic // // If there were any propagations that needed to be done atomicly, they // would go here. It also sets things up for the sweep state. // //==========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/objects/dobjgc.cpp#L419-L426
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
FRawMouse::~FRawMouse
FRawMouse::~FRawMouse() { Ungrab(); }
//========================================================================== // // FRawMouse - Destructor // //==========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/platform/win32/i_mouse.cpp#L491-L494
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
FDInputMouse::Ungrab
void FDInputMouse::Ungrab() { Device->Unacquire(); Grabbed = false; SetCursorState(true); ClearButtonState(); }
//========================================================================== // // FDInputMouse :: Ungrab // //==========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/platform/win32/i_mouse.cpp#L862-L868
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
FRawPS2Manager::GetDevices
void FRawPS2Manager::GetDevices(TArray<IJoystickConfig *> &sticks) { for (unsigned i = 0; i < Devices.Size(); ++i) { if (Devices[i]->IsConnected()) { sticks.Push(Devices[i]); } } }
//=========================================================================== // // FRawPS2Manager :: GetJoysticks // // Adds the IJoystick interfaces for each device we created to the sticks // array, if they are detected as connected. // //===========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/platform/win32/i_rawps2.cpp#L979-L988
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
FxBoolCast::Emit
ExpEmit FxBoolCast::Emit(VMFunctionBuilder *build) { ExpEmit from = basex->Emit(build); if(from.Konst && from.RegType == REGT_INT) { // this is needed here because the int const assign optimization returns a constant ExpEmit to; to.Konst = true; to.RegType = REGT_INT; to.RegNum = build->GetConstantInt(!!bu...
//========================================================================== // // // //==========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/scripting/backend/codegen.cpp#L926-L954
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
DStatusBarCore::StatusbarToRealCoords
void DStatusBarCore::StatusbarToRealCoords(double& x, double& y, double& w, double& h) const { if (SBarScale.X == -1 || ForcedScale) { int hres = HorizontalResolution; int vres = VerticalResolution; ValidateResolution(hres, vres); VirtualToRealCoords(twod, x, y, w, h, hres, vres, true, true); } else { x...
//============================================================================ // // draw stuff // //============================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/statusbar/base_sbar.cpp#L447-L464
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
MD5Context::Final
void MD5Context::Final(uint8_t digest[16]) { int count = bytes[0] & 0x3f; /* Number of bytes in ctx->in */ uint8_t *p = (uint8_t *)in + count; /* Set the first char of padding to 0x80. There is always room. */ *p++ = 0x80; /* Bytes of padding needed to make 56 bytes (-8..55) */ count = 56 - 1 - count; if (co...
/* * Final wrapup - pad to 64-byte boundary with the bit pattern * 1 0* (64-bit count of bits processed, MSB-first) */
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/common/thirdparty/md5.cpp#L100-L130
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
FMugShot::Reset
void FMugShot::Reset() { FaceHealthNow = FaceHealthLast = -1; bEvilGrin = false; bNormal = true; bDamageFaceActive = false; bOuchActive = false; CurrentState = NULL; RampageTimer = 0; LastDamageAngle = 1; }
//=========================================================================== // // FMugShot :: Reset // //===========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/g_statusbar/sbar_mugshot.cpp#L223-L233
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
DBaseStatusBar::DrawBottomStuff
void DBaseStatusBar::DrawBottomStuff (EHudState state) { primaryLevel->localEventManager->RenderUnderlay(state); DrawMessages (HUDMSGLayer_UnderHUD, (state == HUD_StatusBar) ? GetTopOfStatusbar() : twod->GetHeight()); }
//--------------------------------------------------------------------------- // // DrawBottomStuff // //---------------------------------------------------------------------------
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/g_statusbar/shared_sbar.cpp#L1187-L1191
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
FTextureAnimator::UpdateAnimations
void FTextureAnimator::UpdateAnimations (uint64_t mstime) { for (unsigned int i = 0; i < mFireTextures.Size(); i++) { FFireTexture* fire = &mFireTextures[i]; bool updated = false; if (fire->SwitchTime == 0) { fire->SwitchTime = mstime + fire->Duration; } else while (fire->SwitchTime <= mstime) { ...
//========================================================================== // // FTextureAnimator :: UpdateAnimations // // Updates texture translations for each animation and scrolls the skies. // //==========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/gamedata/textures/animations.cpp#L1130-L1188
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
DBaseDecal::SetShade
void DBaseDecal::SetShade (int r, int g, int b) { AlphaColor = MAKEARGB(ColorMatcher.Pick (r, g, b), r, g, b); }
//---------------------------------------------------------------------------- // // // //----------------------------------------------------------------------------
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/playsim/a_decals.cpp#L245-L248
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
CheckForPushSpecial
static void CheckForPushSpecial(line_t *line, int side, AActor *mobj, DVector2 *posforwindowcheck) { if (line->special && !(mobj->flags6 & MF6_NOTRIGGER)) { if (posforwindowcheck && !(mobj->Level->i_compatflags2 & COMPATF2_PUSHWINDOW) && line->backsector != NULL) { // Make sure this line actually blocks us and is...
//=========================================================================== // // CheckForPushSpecial // //===========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/playsim/p_map.cpp#L2265-L2324
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
P_MoveThing
bool P_MoveThing(AActor *source, const DVector3 &pos, bool fog) { DVector3 old = source->Pos(); source->SetOrigin (pos, true); if (P_TestMobjLocation (source)) { if (fog) { P_SpawnTeleportFog(source, pos, false, true); P_SpawnTeleportFog(source, old, true, true); } source->ClearInterpolation(); sou...
// [BC] Added // [RH] Fixed
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/playsim/p_things.cpp#L117-L138
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
FPolyObj::CheckMobjBlocking
bool FPolyObj::CheckMobjBlocking (side_t *sd) { static TArray<AActor *> checker; FBlockNode *block; AActor *mobj; int i, j, k; int left, right, top, bottom; line_t *ld; bool blocked; bool performBlockingThrust; int bmapwidth = Level->blockmap.bmapwidth; int bmapheight = Level->blockmap.bmapheight; ld = sd->...
//========================================================================== // // CheckMobjBlocking // //==========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/playsim/po_man.cpp#L1028-L1149
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
HWDrawInfo::AddLines
void HWDrawInfo::AddLines(subsector_t * sub, sector_t * sector, FRenderState& state) { currentsector = sector; currentsubsector = sub; ClipWall.Clock(); if (sub->polys != nullptr) { AddPolyobjs(sub, state); } else { int count = sub->numlines; seg_t * seg = sub->firstline; while (count--) { if (se...
//========================================================================== // // // //==========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/rendering/hwrenderer/scene/hw_bsp.cpp#L517-L546
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
isLinePortal
static int isLinePortal(line_t *self) { return self->isLinePortal(); }
//=========================================================================== // // line_t exports // //===========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/scripting/vmthunks.cpp#L1215-L1218
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
ParseActor
static void ParseActor(FScanner &sc, PNamespace *ns) { PClassActor *info = NULL; Baggage bag; bag.Namespace = ns; bag.Version = { 2, 0, 0 }; bag.fromDecorate = true; bag.ScriptPosition = sc; info = ParseActorHeader(sc, &bag); sc.MustGetToken('{'); while (sc.MustGetAnyToken(), sc.TokenType != '}') { switch...
//========================================================================== // // Reads an actor definition // //==========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/scripting/decorate/thingdef_parse.cpp#L1153-L1212
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
VkDoom
github_2023
dpjudas
cpp
S_PrecacheLevel
void S_PrecacheLevel(FLevelLocals* Level) { if (GSnd && Level == primaryLevel) { soundEngine->MarkAllUnused(); AActor* actor; auto iterator = Level->GetThinkerIterator<AActor>(); // Precache all sounds known to be used by the currently spawned actors. while ((actor = iterator.Next()) != nullptr) { IF...
//========================================================================== // // S_PrecacheLevel // // Like R_PrecacheLevel, but for sounds. // //==========================================================================
https://github.com/dpjudas/VkDoom/blob/bbaaa9a49db3e22e5c31787faaf790b46b8c87c4/src/sound/s_doomsound.cpp#L328-L357
bbaaa9a49db3e22e5c31787faaf790b46b8c87c4
channeld-ue-plugin
github_2023
channeldorg
cpp
FastDecodeTag
static uint32_t FastDecodeTag(uint16_t coded_tag) { uint32_t result = coded_tag; result += static_cast<int8_t>(coded_tag); return result >> 1; }
// On the fast path, a (matching) 2-byte tag always needs to be decoded.
https://github.com/channeldorg/channeld-ue-plugin/blob/624a5f6c51dbb898fe29a11c6afcd3eb0aaa2408/Source/ProtobufUE/ThirdParty/include/google/protobuf/generated_message_tctable_lite.cc#L150-L154
624a5f6c51dbb898fe29a11c6afcd3eb0aaa2408
ReverseKit
github_2023
zer0condition
cpp
ImGuiIO::AddInputCharacterUTF16
void ImGuiIO::AddInputCharacterUTF16(ImWchar16 c) { if (c == 0 && InputQueueSurrogate == 0) return; if ((c & 0xFC00) == 0xD800) // High surrogate, must save { if (InputQueueSurrogate != 0) InputQueueCharacters.push_back(IM_UNICODE_CODEPOINT_INVALID); InputQueueSurrogate ...
// UTF16 strings use surrogate pairs to encode codepoints >= 0x10000, so // we should save the high surrogate.
https://github.com/zer0condition/ReverseKit/blob/853adbea5c13dba18cca535c28650821570ea55c/ReverseKit/ImGui/imgui.cpp#L1155-L1187
853adbea5c13dba18cca535c28650821570ea55c
lidar-slam-detection
github_2023
w111liang222
cpp
BowVector::saveM
void BowVector::saveM(const std::string &filename, size_t W) const { std::fstream f(filename.c_str(), std::ios::out); WordId last = 0; BowVector::const_iterator bit; for(bit = this->begin(); bit != this->end(); ++bit) { for(; last < bit->first; ++last) { f << "0 "; } f << bit->second ...
// --------------------------------------------------------------------------
https://github.com/w111liang222/lidar-slam-detection/blob/d57a923b3972d0a0bfdfc0016c32de53c26b9f9f/slam/common/DBoW2/DBoW2/BowVector.cpp#L105-L125
d57a923b3972d0a0bfdfc0016c32de53c26b9f9f
cs2-sdk
github_2023
bruhmoment21
cpp
ImGuiIO::AddInputCharacterUTF16
void ImGuiIO::AddInputCharacterUTF16(ImWchar16 c) { if ((c == 0 && InputQueueSurrogate == 0) || !AppAcceptingEvents) return; if ((c & 0xFC00) == 0xD800) // High surrogate, must save { if (InputQueueSurrogate != 0) AddInputCharacter(IM_UNICODE_CODEPOINT_INVALID); InputQue...
// UTF16 strings use surrogate pairs to encode codepoints >= 0x10000, so // we should save the high surrogate.
https://github.com/bruhmoment21/cs2-sdk/blob/3fdb26b0eba5a7335f011c68bb5c7ef5a3171144/cs2-sdk/libs/imgui/imgui.cpp#L1346-L1378
3fdb26b0eba5a7335f011c68bb5c7ef5a3171144
cs2-sdk
github_2023
bruhmoment21
cpp
ImGui::OpenPopupEx
void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags) { ImGuiContext& g = *GImGui; ImGuiWindow* parent_window = g.CurrentWindow; const int current_stack_size = g.BeginPopupStack.Size; if (popup_flags & ImGuiPopupFlags_NoOpenOverExistingPopup) if (IsPopupOpen((ImGuiID)0, ImGuiPopupFla...
// Mark popup as open (toggle toward open state). // Popups are closed when user click outside, or activate a pressable item, or CloseCurrentPopup() is called within a BeginPopup()/EndPopup() block. // Popup identifiers are relative to the current ID-stack (so OpenPopup and BeginPopup needs to be at the same level). //...
https://github.com/bruhmoment21/cs2-sdk/blob/3fdb26b0eba5a7335f011c68bb5c7ef5a3171144/cs2-sdk/libs/imgui/imgui.cpp#L10544-L10589
3fdb26b0eba5a7335f011c68bb5c7ef5a3171144
DS
github_2023
beixiaocai
cpp
Document::isRowHidden
bool Document::isRowHidden(int row) { if (Worksheet *sheet = currentWorksheet()) return sheet->isRowHidden(row); return false; }
/*! Returns true if \a row is hidden. */
https://github.com/beixiaocai/DS/blob/25458ea1f0dbabade10969d462f3770f4b3a08a9/3rdparty/QXlsx/source/xlsxdocument.cpp#L941-L946
25458ea1f0dbabade10969d462f3770f4b3a08a9
DS
github_2023
beixiaocai
cpp
Worksheet::saveToXmlFile
void Worksheet::saveToXmlFile(QIODevice *device) const { Q_D(const Worksheet); d->relationships->clear(); QXmlStreamWriter writer(device); writer.writeStartDocument(QStringLiteral("1.0"), true); writer.writeStartElement(QStringLiteral("worksheet")); writer.writeAttribute(QStringLiteral("xmlns"), QStringLiteral(...
/*! * \internal */
https://github.com/beixiaocai/DS/blob/25458ea1f0dbabade10969d462f3770f4b3a08a9/3rdparty/QXlsx/source/xlsxworksheet.cpp#L1308-L1515
25458ea1f0dbabade10969d462f3770f4b3a08a9
Calibration-Is-All-You-Need
github_2023
linClubs
cpp
Mutex::ThreadSafeLazyInit
void Mutex::ThreadSafeLazyInit() { // Dynamic mutexes are initialized in the constructor. if (type_ == kStatic) { switch ( ::InterlockedCompareExchange(&critical_section_init_phase_, 1L, 0L)) { case 0: // If critical_section_init_phase_ was 0 before the exchange, we // are the firs...
// Initializes owner_thread_id_ and critical_section_ in static mutexes.
https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/Thirdparty/ceres-solver-1.14.0/internal/ceres/gmock_gtest_all.cc#L8832-L8870
efdad7d51644258a63ab831171576d5330024e40
Calibration-Is-All-You-Need
github_2023
linClubs
cpp
ValidateRegex
bool ValidateRegex(const char* regex) { if (regex == NULL) { // TODO(wan@google.com): fix the source file location in the // assertion failures to match where the regex is used in user // code. ADD_FAILURE() << "NULL is not a valid simple regular expression."; return false; } bool is_valid = ...
// Generates non-fatal failures and returns false if regex is invalid; // otherwise returns true.
https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/Thirdparty/ceres-solver-1.14.0/internal/ceres/gmock_gtest_all.cc#L9230-L9284
efdad7d51644258a63ab831171576d5330024e40
Calibration-Is-All-You-Need
github_2023
linClubs
cpp
Cardinality AtLeast
GTEST_API_ Cardinality AtLeast(int n) { return Between(n, INT_MAX); }
// Creates a cardinality that allows at least n calls.
https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/Thirdparty/ceres-solver-1.14.0/internal/ceres/gmock_gtest_all.cc#L10582-L10582
efdad7d51644258a63ab831171576d5330024e40
Calibration-Is-All-You-Need
github_2023
linClubs
cpp
LogIsVisible
GTEST_API_ bool LogIsVisible(LogSeverity severity) { if (GMOCK_FLAG(verbose) == kInfoVerbosity) { // Always show the log if --gmock_verbose=info. return true; } else if (GMOCK_FLAG(verbose) == kErrorVerbosity) { // Always hide it if --gmock_verbose=error. return false; } else { // If --gmock_v...
// Returns true iff a log with the given severity is visible according // to the --gmock_verbose flag.
https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/Thirdparty/ceres-solver-1.14.0/internal/ceres/gmock_gtest_all.cc#L10704-L10716
efdad7d51644258a63ab831171576d5330024e40
Calibration-Is-All-You-Need
github_2023
linClubs
cpp
TEST
TEST(Rotation, UnitQuaternionToAngleAxis) { double quaternion[4] = { 1, 0, 0, 0 }; double axis_angle[3]; double expected[3] = { 0, 0, 0 }; QuaternionToAngleAxis(quaternion, axis_angle); EXPECT_THAT(axis_angle, IsNearAngleAxis(expected)); }
// Transforms a unit quaternion to an axis angle.
https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/Thirdparty/ceres-solver-1.14.0/internal/ceres/rotation_test.cc#L271-L277
efdad7d51644258a63ab831171576d5330024e40
Calibration-Is-All-You-Need
github_2023
linClubs
cpp
UncertainBackProjection::UncertainBackProjection
UncertainBackProjection::UncertainBackProjection( const sm::kinematics::UncertainVector3 & ray) : ray(ray) { }
/// \brief the view origin is set to zero
https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/kalibr/aslam_cv/aslam_cameras/src/BackProjection.cpp#L34-L37
efdad7d51644258a63ab831171576d5330024e40
Calibration-Is-All-You-Need
github_2023
linClubs
cpp
RotationExpression::inverse
RotationExpression RotationExpression::inverse() { boost::shared_ptr<RotationExpressionNode> newRoot( new RotationExpressionNodeInverse(_root) ); return RotationExpression(newRoot); }
/// \brief return the expression that inverts the rotation.
https://github.com/linClubs/Calibration-Is-All-You-Need/blob/efdad7d51644258a63ab831171576d5330024e40/kalibr/aslam_optimizer/aslam_backend_expressions/src/RotationExpression.cpp#L39-L43
efdad7d51644258a63ab831171576d5330024e40
AstroSharp
github_2023
deepskydetail
cpp
function_namespace_env
Function function_namespace_env(){ Environment ns = Environment::namespace_env( "stats" ) ; Function fun = ns[".asSparse"] ; // accesses a non-exported function return fun; }
// [[Rcpp::export]]
https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Mac/library/Rcpp/unitTests/cpp/Function.cpp#L74-L78
b632424fa2e9749d008851cf40f49b5fcec490d3
AstroSharp
github_2023
deepskydetail
cpp
runit_SubMatrix
NumericMatrix runit_SubMatrix( ){ NumericMatrix xx(4, 5); xx(0,0) = 3; xx(0,1) = 4; xx(0,2) = 5; xx(1,_) = xx(0,_); xx(_,3) = xx(_,2); SubMatrix<REALSXP> yy = xx( Range(0,2), Range(0,3) ) ; NumericMatrix res = yy ; return res; }
// [[Rcpp::export]]
https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Mac/library/Rcpp/unitTests/cpp/Matrix.cpp#L249-L259
b632424fa2e9749d008851cf40f49b5fcec490d3
AstroSharp
github_2023
deepskydetail
cpp
list_erase
List list_erase( List list ){ list.erase( list.begin() ) ; return list ; }
// [[Rcpp::export]]
https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Mac/library/Rcpp/unitTests/cpp/Vector.cpp#L408-L411
b632424fa2e9749d008851cf40f49b5fcec490d3
AstroSharp
github_2023
deepskydetail
cpp
vec_print_character
String vec_print_character(CharacterVector v) { std::ostringstream buf; buf << v; return buf.str(); }
// [[Rcpp::export]]
https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Mac/library/Rcpp/unitTests/cpp/Vector.cpp#L834-L838
b632424fa2e9749d008851cf40f49b5fcec490d3
AstroSharp
github_2023
deepskydetail
cpp
runit_dt
List runit_dt( NumericVector xx){ return List::create( _["false"] = dt( xx, 5), _["true"] = dt( xx, 5, true )); }
// [[Rcpp::export]]
https://github.com/deepskydetail/AstroSharp/blob/b632424fa2e9749d008851cf40f49b5fcec490d3/resources/app/R-Portable-Mac/library/Rcpp/unitTests/cpp/stats.cpp#L83-L87
b632424fa2e9749d008851cf40f49b5fcec490d3
XPKeygen
github_2023
Endermanch
cpp
formatXP
void formatXP(BOOL bUpgrade, WCHAR *pBSection, WCHAR *pCSection, WCHAR *pText) { WCHAR pDashedKey[PK_LENGTH + 4 + NULL_TERMINATOR]{}; INT pSSection = 0; for (int i = 0; i < wcslen(pCSection); i++) pSSection -= pCSection[i] - '0'; while (pSSection < 0) pSSection += 7; CHAR pKey[...
/* Formats Windows XP key output. */
https://github.com/Endermanch/XPKeygen/blob/f0df34a8222c38ffce8a02bb107106b3d85af0f9/src/key.cpp#L76-L124
f0df34a8222c38ffce8a02bb107106b3d85af0f9
Maim
github_2023
ArdenButterfield
cpp
CMpegAudEncPropertyPageAdv::SetDirty
void CMpegAudEncPropertyPageAdv::SetDirty() { m_bDirty = TRUE; if (m_pPageSite) m_pPageSite->OnStatusChange(PROPPAGESTATUS_DIRTY); }
// // SetDirty // // notifies the property page site of changes
https://github.com/ArdenButterfield/Maim/blob/7f2e5f87f3e3bd7b06916343f336d94fee5f9b85/lib/lame/dshow/PropPage_adv.cpp#L361-L366
7f2e5f87f3e3bd7b06916343f336d94fee5f9b85
picoTracker
github_2023
xiphonics
cpp
isBusyFifoRead
static bool isBusyFifoRead() { return !(SDHC_PRSSTAT & SDHC_PRSSTAT_BREN); }
//------------------------------------------------------------------------------
https://github.com/xiphonics/picoTracker/blob/fa317182a9fe6642b20184a850a4ae0061263a3f/sources/Externals/SdFat/src/SdCard/SdioTeensy.cpp#L490-L492
fa317182a9fe6642b20184a850a4ae0061263a3f
ark
github_2023
microsoft
cpp
abs
ark::bfloat16_t abs(ark::bfloat16_t const& h) { return ark::abs(h); }
/////////////////////////////////////////////////////////////////////////////////////////////////// // // Standard Library operations and definitions // ///////////////////////////////////////////////////////////////////////////////////////////////////
https://github.com/microsoft/ark/blob/d8bbaebd552f47f01b7f0b1ecde3512142435833/ark/bfloat16.cpp#L133-L133
d8bbaebd552f47f01b7f0b1ecde3512142435833
DIY-Sim-Racing-Active-Pedal
github_2023
tjfenwick
cpp
FastAccelStepperEngine::setDebugLed
void FastAccelStepperEngine::setDebugLed(uint8_t ledPin) { fas_ledPin = ledPin; pinMode(fas_ledPin, OUTPUT); digitalWrite(fas_ledPin, LOW); }
//*************************************************************************************************
https://github.com/tjfenwick/DIY-Sim-Racing-Active-Pedal/blob/b6dcceeb2a92c99b51f9b90c2f4379765486d204/Arduino/Library/FastAccelStepper/src/FastAccelStepper.cpp#L92-L96
b6dcceeb2a92c99b51f9b90c2f4379765486d204
oss-arch-gym
github_2023
srivatsankrishnan
cpp
ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter
ScopedFakeTestPartResultReporter::~ScopedFakeTestPartResultReporter() { internal::UnitTestImpl* const impl = internal::GetUnitTestImpl(); if (intercept_mode_ == INTERCEPT_ALL_THREADS) { impl->SetGlobalTestPartResultReporter(old_reporter_); } else { impl->SetTestPartResultReporterForCurrentThread(old_repor...
// The d'tor restores the test part result reporter used by Google Test // before.
https://github.com/srivatsankrishnan/oss-arch-gym/blob/fab6d1442541b5cdf40daf24e64e63261da2d846/sims/AstraSim/protobuf-3.12.4/third_party/googletest/googletest/fused-src/gtest/gtest-all.cc#L2096-L2103
fab6d1442541b5cdf40daf24e64e63261da2d846
oss-arch-gym
github_2023
srivatsankrishnan
cpp
TestEventListeners::SetDefaultResultPrinter
void TestEventListeners::SetDefaultResultPrinter(TestEventListener* listener) { if (default_result_printer_ != listener) { // It is an error to pass this method a listener that is already in the // list. delete Release(default_result_printer_); default_result_printer_ = listener; if (listener != n...
// Sets the default_result_printer attribute to the provided listener. // The listener is also added to the listener list and previous // default_result_printer is removed from it and deleted. The listener can // also be NULL in which case it will not be added to the list. Does // nothing if the previous and the curren...
https://github.com/srivatsankrishnan/oss-arch-gym/blob/fab6d1442541b5cdf40daf24e64e63261da2d846/sims/AstraSim/protobuf-3.12.4/third_party/googletest/googletest/fused-src/gtest/gtest-all.cc#L5970-L5978
fab6d1442541b5cdf40daf24e64e63261da2d846
oss-arch-gym
github_2023
srivatsankrishnan
cpp
CaptureStderr
void CaptureStderr() { CaptureStream(kStdErrFileno, "stderr", &g_captured_stderr); }
// Starts capturing stderr.
https://github.com/srivatsankrishnan/oss-arch-gym/blob/fab6d1442541b5cdf40daf24e64e63261da2d846/sims/AstraSim/protobuf-3.12.4/third_party/googletest/googletest/fused-src/gtest/gtest-all.cc#L10800-L10802
fab6d1442541b5cdf40daf24e64e63261da2d846
oss-arch-gym
github_2023
srivatsankrishnan
cpp
TEST_F
TEST_F(ASSERT_PRED_FORMAT4Test, FunctionOnUserTypeSuccess) { ASSERT_PRED_FORMAT4(PredFormatFunction4, Bool(++n1_), Bool(++n2_), Bool(++n3_), Bool(++n4_)); finished_ = true; }
// Tests a successful ASSERT_PRED_FORMAT4 where the // predicate-formatter is a function on a user-defined type (Bool).
https://github.com/srivatsankrishnan/oss-arch-gym/blob/fab6d1442541b5cdf40daf24e64e63261da2d846/sims/AstraSim/protobuf-3.12.4/third_party/googletest/googletest/test/gtest_pred_impl_unittest.cc#L1787-L1794
fab6d1442541b5cdf40daf24e64e63261da2d846
heir
github_2023
google
cpp
getNonUnitDimension
FailureOr<std::pair<unsigned, int64_t>> getNonUnitDimension( RankedTensorType tensorTy) { auto shape = tensorTy.getShape(); if (llvm::count_if(shape, [](auto dim) { return dim != 1; }) != 1) { return failure(); } unsigned nonUnitIndex = std::distance( shape.begin(), llvm::find_if(shape, [&](auto...
// Returns the unique non-unit dimension of a tensor and its rank. // Returns failure if the tensor has more than one non-unit dimension.
https://github.com/google/heir/blob/fae5e9552a2d177da41381101d4a6c0f426eb2ee/lib/Transforms/SecretInsertMgmt/SecretInsertMgmtCKKS.cpp#L45-L57
fae5e9552a2d177da41381101d4a6c0f426eb2ee
oxware
github_2023
oxiKKK
cpp
DetourUpdateProcessWithDll
BOOL WINAPI DetourUpdateProcessWithDll(_In_ HANDLE hProcess, _In_reads_(nDlls) LPCSTR *rlpDlls, _In_ DWORD nDlls) { // Find the next memory region that contains a mapped PE image. // BOOL bHas64BitDll = FALSE; BOOL bHas32BitEx...
// DETOURS_64BIT ////////////////////////////////////////////////////////////////////////////// //
https://github.com/oxiKKK/oxware/blob/eb81ecf3fe839b0ca01a19c41ae7e5381d13102d/src/external/detours/creatwth.cpp#L516-L582
eb81ecf3fe839b0ca01a19c41ae7e5381d13102d
oxware
github_2023
oxiKKK
cpp
get_appdata_dir
static std::filesystem::path get_appdata_dir() { PWSTR pwstr_appdata_directory; HRESULT result = SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_DEFAULT, NULL, &pwstr_appdata_directory); assert(SUCCEEDED(result)); std::filesystem::path ret = pwstr_appdata_directory; CoTaskMemFree(pwstr_appdata_directory); r...
// just a little hack over the fact that this code already exists inside the FileSystem code.. since we // want to have the console ready right as soon as the application starts, we cannot just use the appdata manager // or the filesystem, so yeah.. this kinda sucks but whatever, its worth it so that we can log as soon...
https://github.com/oxiKKK/oxware/blob/eb81ecf3fe839b0ca01a19c41ae7e5381d13102d/src/public/DeveloperConsole.cpp#L488-L496
eb81ecf3fe839b0ca01a19c41ae7e5381d13102d