id
stringlengths
21
25
content
stringlengths
164
2.33k
codereview_cpp_data_10871
* the multiples. */ void sieve(uint32_t N, bool *isprime) { - isprime[0] = false; - isprime[1] = false; for (uint32_t i = 2; i * i <= N; i++) { - if (isprime[i]) { for (uint32_t j = i * i; j <= N; j = j + i) { - isprime[j] = false; } } } The...
codereview_cpp_data_10882
void GenericConstraintProblem::freeConstraintResolutions() { - for(unsigned int i=0; i<constraintsResolutions.size(); i++) { - if (constraintsResolutions[i] != nullptr) - { - delete constraintsResolutions[i]; - constraintsResolutions[i] = nullptr; - } } } Mayb...
codereview_cpp_data_10890
if (len == 1) { /* bind=src */ m->dest = construct_path(mntarray[0], false); } else if (len == 2) { /* bind=src:option or bind=src:dest */ - if (!strncmp(mntarray[1], "rw", strlen(mntarray[1]))) m->options = strdup("rw"); - if (!strncmp(mntarray[1], "ro", strlen(mntarray[1]))) m->options = strdup("ro")...
codereview_cpp_data_10896
struct jx *result = NULL; //Capture expression for select query before it gets evaluated - if(!strcmp("select", jx_print_string(o->left))) select_expr = jx_array_index(o->right, 0); right = jx_eval(o->right,context); if (jx_istype(right, JX_ERROR)) { If I'm reading this right, the goal here is to quote (...
codereview_cpp_data_10901
statusBar.SetCenter( dst_pt.x + bar.width() / 2, dst_pt.y + 12 ); // redraw resource panel - const Rect rectResource = RedrawResourcePanel( cur_pt ); // button exit dst_pt.x = cur_pt.x + 553; Please use `const reference`. statusBar.SetCenter( dst_pt.x + bar.width() / 2, dst_pt.y + 12 ); ...
codereview_cpp_data_10905
wlr_log(L_INFO, "Found %zu GPUs", num_gpus); for (size_t i = 0; i < num_gpus; ++i) { - struct wlr_backend *drm = wlr_drm_backend_create(display, session, gpus[i]); if (!drm) { wlr_log(L_ERROR, "Failed to open DRM device"); continue; Something that might be useful in the future is to specify a list of G...
codereview_cpp_data_10916
std::shared_ptr<MockOrderingServicePersistentState> fake_persistent_state; }; TEST_F(OrderingGateServiceTest, SplittingBunchTransactions) { // 8 transaction -> proposal -> 2 transaction -> proposal Add given, when, then std::shared_ptr<MockOrderingServicePersistentState> fake_persistent_state; }; +/** + *...
codereview_cpp_data_10919
} } -void launchKernel(float* C, float* A, float* B, int N, bool manual){ hipDeviceProp_t devProp; HIP_CHECK(hipGetDeviceProperties(&devProp, 0)); We are effectively only checking if there are errors in the output of the 2nd kernel execution. Maybe we should either move the verification into the laun...
codereview_cpp_data_10927
EXPECT_FAILURE_WITH_ERRNO(s2n_find_security_policy_from_version("PQ-SIKE-TEST-TLS-1-0-2019-11", &security_policy), S2N_ERR_INVALID_SECURITY_POLICY); EXPECT_FAILURE_WITH_ERRNO(s2n_find_security_policy_from_version("PQ-SIKE-TEST-TLS-1-0-2020-02", &security_policy), S2N_ERR_INVALID_SECURITY_POLICY); ...
codereview_cpp_data_10941
Status ClusterAdminClient::MasterLeaderStepDown( const string& leader_uuid, - const string& new_leader_uuid = std::string()) { auto master_proxy = std::make_unique<ConsensusServiceProxy>(proxy_cache_.get(), leader_addr_); - return LeaderStepDown(leader_uuid, yb::master::kSysCatalogTabletId, new_leader_uuid...
codereview_cpp_data_10949
EXPECT_SUCCESS(s2n_connection_free(conn)); } - /* The default s2n socket read/write setup can be used with a user-defined send/recv context */ { static const int READFD = 1; static const int WRITEFD = 2; A customer doesn't have access to the internal structure we expect for the ...
codereview_cpp_data_10952
for (int i = 0; i < numLoop; ++i) { model.setStateVariableValues(s, stateValues); - // Direct set values for coordinates does not ensure they // satisfy kinematic constraints. Explicitly enforce constraints - // by performing and assembly, now. model.assemble(s); } -...
codereview_cpp_data_10957
return 0; if (tsc != NULL) { if (tsc->option&hide_flag - && !is_boss - && (tsd->special_state.perfect_hiding || !is_detect || tsc->data[SC_CLOAKINGEXCEED] != NULL || tsc->data[SC_NEWMOON] != NULL) ) return 0; if (tsc->data[SC_CAMOUFLAGE] && !(is_boss || is_detect) && flag == 0) th...
codereview_cpp_data_10971
{ if (result) { - printf("ScaFaCoS Error: Caught error on task %d.\n", comm_rank); std::string err_msg; std::stringstream ss; Please don't use `printf()`, but `fprintf(screen,...)` and `fprintf(logfile, ...)` provided either FILE pointer is non-NULL. Please note, that calling error->all() requires...
codereview_cpp_data_10973
t << endl << "clean:" << endl - << "\trm -f " - << "rm -f $(CLEAN_FILES)" << endl; } static void writeMakeBat() Look a bit double here, shouldn't this just be `\t"rm -f $(CLEAN_FILES)" << endl;` t << endl << "clean:" << endl + << "\trm -f $(CLEAN_FILES)" << endl; } static void writeMakeB...
codereview_cpp_data_10979
return [=](const curried_predicate&) { return row_ids; }; }); } - // Predicate of form "&time == ..." if (ex.attr == system::time_atom::value) { VAST_ASSERT(caf::holds_alternative<timestamp>(x)); // Find the column with attribute 'time'. Is this really always an equality? It seems the `if`...
codereview_cpp_data_10981
label->setStyleSheet("QLabel { font: bold; }"); vLayout->addWidget(label); m_northAxisEdit = new OSQuantityEdit(m_isIP); - bool isConnected = connect(this, SIGNAL(toggleUnitsClicked(bool)), m_northAxisEdit, SLOT(onUnitSystemChange(bool))); OS_ASSERT(isConnected); vLayout->addWidget(m_northAxisEdit); @a...
codereview_cpp_data_10987
if ( !needRedraw && !listbox.IsNeedRedraw() ) { continue; } - currentPressedButton->press(); listbox.Redraw(); buttonOk.draw(); This needs a bit of explanation as I see such change as a hack. Could you please provide more information why we need to this? ...
codereview_cpp_data_10991
} for ( kc = sf->kerns; kc!=NULL; kc=kc->next ) { - firsts = malloc(kc->first_cnt*sizeof(SplineChar *)); map1 = calloc(kc->first_cnt,sizeof(int)); seconds = malloc(kc->second_cnt*sizeof(SplineChar **)); map2 = calloc(kc->second_cnt,sizeof(int)); `firsts` and `seconds` have the same type and are first a...
codereview_cpp_data_11005
--throughput_publisher_.data_discovery_count_; } - lock.unlock(); - if (throughput_publisher_.data_discovery_count_ == static_cast<int>(throughput_publisher_.subscribers_)) { throughput_publisher_.data_discovery_cv_.notify_one(); } } // ****************************************...
codereview_cpp_data_11006
/* Store public key at cert_chain to cut down expensive use of s2n_asn1der_to_public_key_and_type */ chain_and_key->cert_chain->head->public_key = public_key; /* Populate name information from the SAN/CN for the leaf certificate */ POSIX_GUARD(s2n_cert_chain_and_key_set_names(chain_and_key, &chain_a...
codereview_cpp_data_11022
// the location of the point in the inertial reference frame. upd_location() = currentFrame.findLocationInAnotherFrame(s, get_location(), body); - // now assign this point's body to point to aBody setParentFrame(body); } Perhaps clearer as `// now make "body" this PathPoint's parent Frame` // ...
codereview_cpp_data_11023
} else { track_sendmsg_success(); } - track_sendmsg_flush(ctx->loop); return 1; } I wonder if we need to log anything when there is no loss. To paraphrase, it might make sense to convert `track_sendmsg_flush` into a subroutine of `track_sendmsg_failure`. The other benefit of merging `track_...
codereview_cpp_data_11040
if(ast_childcount(params) != 1) { ast_error(opt->check.errors, params, - "A Main actor must have a create constructor which takes a single Env " "parameter"); ok = false; } How do you feel about "The Main actor" instead of "A Main actor", while we're already here changing the message? ...
codereview_cpp_data_11051
for(auto chr=s.begin();chr<=s.end(); ++chr) { if(*chr == '.' || *chr == 0) continue; - id += std::tolower(*chr); } return id; } `id += std::tolower(*chr); ` >> `id += tolower(*chr); ` Hi~, If it change like this, it might be successfully compiled on Appveyor ci. for(auto chr=s.begin();chr...
codereview_cpp_data_11055
_AssertBoosterHandleNotNull(handle); R_API_BEGIN(); CHECK_CALL(LGBM_BoosterAddValidData(R_ExternalPtrAddr(handle), R_ExternalPtrAddr(valid_data))); - R_API_END(); return R_NilValue; } SEXP LGBM_BoosterResetTrainingData_R(SEXP handle, Same question. ```suggestion _AssertBoosterHandleNotNull(handle); _Ass...
codereview_cpp_data_11087
if (is_present) { std::shared_ptr<shared_model::interface::TransactionResponse> response = - status_factory_->makeCommitted(request, "", 0, 0); cache_->addItem(request, response); return response; } else { log_->warn("Asked non-existing tx: {}", request.hex()); - retu...
codereview_cpp_data_11106
return mItems[i]->mId; } - return 0; } //------------------------------------------------------------------------------ mmmmm welcome to the fucking world of TS ids... -1 or 0 for invalid? return mItems[i]->mId; } + return -1; } //-----------------------------------------------------------...
codereview_cpp_data_11110
fheroes2::Button buttonOk( rt.x + 34, rt.y + 315, ICN::REQUEST, 1, 2 ); fheroes2::Button buttonCancel( rt.x + 244, rt.y + 315, ICN::REQUEST, 3, 4 ); - bool edit_mode = true; MapsFileInfoList lists = GetSortedMapsFileInfoList(); FileInfoListBox listbox( rt.getPosition(), edit_mode ); This change ...
codereview_cpp_data_11121
hasStatus = true; if (_textStatus) { - writer.writeAttribute("v", QString("%1").arg(n->getStatus().toTextStatus())); } else { My eyeball compiler seems to think that you could write this line as: `writer.writeAttribute("v", n->getStatus().toT...
codereview_cpp_data_11138
return mrb_funcall(mrb, mrb_top_self(mrb), "eval", 1, mrb_str_new_cstr(mrb, expr)); } -void h2o_mruby_define_callback(mrb_state *mrb, const char *name, h2o_mruby_callback callback) { h2o_mruby_shared_context_t *shared_ctx = mrb->ud; - h2o_vector_reserve(NULL, &shared_ctx->callbacks, ++shared_ctx->callbac...
codereview_cpp_data_11159
return; // helpers for combining building effects into a single line - std::vector<std::string> combinedNames; - float combinedChange = 0.0; // add label-value pairs for each alteration recorded for this meter for (auto it = maybe_info_vec->begin(); it != maybe_info_vec->end(); ++it) { ...
codereview_cpp_data_11161
for (int i = 0; i < preferences->count; ++i) { if (0 == strcmp(preferences->suites[i]->name, conn->secure.cipher_suite->name) && /* make sure we dont use a tls version lower than that configured by the version */ - conn->secure.cipher_suite->minimum_required_tls_version >= preferen...
codereview_cpp_data_11172
-// Copyright 2013 Yangqing Jia #include "caffe/common.hpp" Copyright should no longer be me :) +// Copyright 2014 Sergio Guadarrama #include "caffe/common.hpp"
codereview_cpp_data_11177
#ifdef VAST_HAVE_SNAPPY methods.push_back(compression::snappy); #endif - std::vector<size_t> block_sizes = {1, 2, 64, 256, 1_KiB, 16_MiB}; auto data = "Im Kampf zwischen dir und der Welt sekundiere der Welt."s; auto inflation = 1000; for (auto block_size : block_sizes) { Was this wrong before or did you...
codereview_cpp_data_11181
/** * Default constructor. */ -Station::Station() : Super() { setNull(); constructInfrastructure(); } Station::Station(const PhysicalFrame& frame, const SimTK::Vec3& location) - : Super() { setNull(); constructInfrastructure(); No need to change, but we don't use this convention in gene...
codereview_cpp_data_11188
m_Impl << "!" << valName << ".IsString())" << std::endl << "\t\t\t\t" << "BOOST_THROW_EXCEPTION(ValidationError(dynamic_cast<ConfigObject *>(this), { \"" - << field.Name << R"(" }, "Object '" + )" << valName << R"( + "' of type ')" - << field.Type.TypeName - << "' has an invalid name.\"));"...
codereview_cpp_data_11191
{ "UniformConstraint", Pluginized("v20.12", "SofaConstraint") }, { "UnilateralInteractionConstraint", Pluginized("v20.12", "SofaConstraint") }, - // LMConstraint was pluginized in #1592 { "BaseLMConstraint", Pluginized("v20.12", "LMConstraint") }, { "LMConstraint", Pluginized("v20.12", "LMConstra...
codereview_cpp_data_11196
return details.rewards.at(index).award_id; } - return 0; } long long MegaAchievementsDetailsPrivate::getRewardStorage(unsigned int index) Better to return -1 to signal the index was not found, so you cannot use the returned value as a valid award id return details.rewards.at(index).award_i...
codereview_cpp_data_11209
} /** - * @brief Self-test implementations to test - * the `integral_approx` function. * * @returns `void` */ ```suggestion * @brief Self-test implementations to * test the `integral_approx` function. ``` } /** + * @brief Self-test implementations to + * test the `integral_approx` function. * * @returns...
codereview_cpp_data_11210
#if !AMREX_DEVICE_COMPILE namespace { -// Having both host and device versions to avoid compiler warning -AMREX_GPU_HOST_DEVICE void write_lib_id(const char* msg) { Seems that we can remove these 2 lines now. It was added for HIP. But with the new way, it's not needed anymore. #if !AMREX_DEVICE_COMPILE namesp...
codereview_cpp_data_11211
settingsCache->setPicsPath(dataDir + "/pics"); } if (!QDir().mkpath(settingsCache->getPicsPath() + "/CUSTOM")) - qDebug("Could not create " + settingsCache->getPicsPath().toLatin1() + "/CUSTOM. Will fall back on default card images."); #ifdef Q_OS_MAC if(settingsCache->getHandBgPath().is...
codereview_cpp_data_11214
" \"http2-errors.connect\": %" PRIu64 ", \n" " \"http2-errors.enhance-your-calm\": %" PRIu64 ", \n" " \"http2-errors.inadequate-security\": %" PRIu64 ", \n" - " \"http2-errors.idle-timeout\": %" PRIu64 ", \n" ...
codereview_cpp_data_11216
g_return_val_if_fail (repo != NULL, FALSE); g_return_val_if_fail (ref != NULL, FALSE); g_return_val_if_fail (out_rev != NULL, FALSE); if (ostree_repo_resolve_rev (repo, ref, FALSE, out_rev, &my_error)) return TRUE; Shouldn't this be a `g_return_val_if_fail` at the top of the function? It is not under ...
codereview_cpp_data_11219
if (larger_leaf_histogram_array_ != nullptr && !use_subtract) { // construct larger leaf hist_t* ptr_larger_leaf_hist_data = - larger_leaf_histogram_array_[0].RawData() - kHistOffset * offset; train_data_->ConstructHistograms( is_feature_used, larger_leaf_splits_->data_indices(), ...
codereview_cpp_data_11226
// utf8 output with std::cout (since we already use cout so much and it's compatible with other platforms) // unicode input with windows ReadConsoleInput api // drag and drop filenames from explorer to the console window // upload and download unicode/utf-8 filenames to/from Mega // input a uni...
codereview_cpp_data_11242
case ATTR_AUTHCU255: // fall-through case ATTR_AUTHRSA: // fall-through case ATTR_MY_BACKUPS_FOLDER: // fall-through -#ifdef ENABLE_SYNC case ATTR_BACKUP...
codereview_cpp_data_11256
* * Once we've determined all the needed data, we make a temporary directory, and * start writing out files inside it. This temporary directory is then turned - * into the OIRPM (what looks like a plain old RPM) by invoking `rpmbuild` using * a `.spec` file. * - * The resulting "rojig set" is then that OIRPM,...
codereview_cpp_data_11258
auto signatories = wsv_query->getSignatories(qry.creatorAccountId()); const auto &sig = qry.signatures(); - return boost::range_detail::range_calculate_size(sig) == 1 && signatories | [&sig](const auto &signatories) { return validation::signaturesSubset(sig, signatories); ...
codereview_cpp_data_11259
ksAppendKey (ks, keyNew ("user/named/key", KEY_VALUE, "myvalue", KEY_END)); ksAppendKey (ks, keyNew ("system/named/syskey", KEY_VALUE, "syskey", KEY_END)); ksAppendKey (ks, keyNew ("system/sysonly/key", KEY_VALUE, "sysonlykey", KEY_END)); - ksAppendKey (ks, keyNew ("user/named/bin", KEY_BINARY, KEY_SIZE, sizeof (...
codereview_cpp_data_11273
fheroes2::Rect ArmyBar::UpgradeButtonPos( const fheroes2::Rect & itemPos ) { - return fheroes2::Rect( itemPos.x + itemPos.width - 23, itemPos.y + 3, 20, 10 ); } bool ArmyBar::CanUpgradeNow( const ArmyTroop & troop ) const :warning: **modernize\-return\-braced\-init\-list** :warning: avoid repeating the return t...
codereview_cpp_data_11276
// For simplicity, we assume f(chi) ~ f(x), and | f'''''(xi) | ~ 1. // If step size is not specified, then we choose h so that // E_fl <= sqrt(epsilon) - const EvalType epsilon = std::pow(std::numeric_limits<EvalType>::epsilon(), 0.9); - const EvalType step_size = (m_step_size > DataType{0} ? ...
codereview_cpp_data_11289
#include <inttypes.h> #include <netdb.h> #include <netinet/in.h> -#ifndef __ANDROID__ -#include <spawn.h> -#endif #include <stdio.h> #include <stdlib.h> #include <sys/socket.h> Could you please remove `#include <spawn.h>` as a whole and see what happens? I believe that this is no longer needed; it was necessary ...
codereview_cpp_data_11290
int s2n_connection_enable_quic(struct s2n_connection *conn) { - /* The QUIC RFC is not yet finalized, so all QUIC APIs are - * considered experimental and subject to change. - * They should only be used for testing purposes. - */ - ENSURE_POSIX(S2N_IN_TEST, S2N_ERR_NOT_IN_TEST); - /* The QUIC p...
codereview_cpp_data_11296
uint256 bitcoinCashForkBlockHash = uint256S("000000000000000000651ef99cb9fcbe0dadde1d424bd9f15ff20136191a5eec"); #ifdef ENABLE_MUTRACE -class PrintSomePointers { public: - PrintSomePointers() { printf("csBestBlock %p\n", &csBestBlock); printf("cvBlockChange %p\n", &cvBlockChange); sloppy ...
codereview_cpp_data_11311
ALLOCSET_DEFAULT_SIZES); OnConflictAction onconflict_action = ts_chunk_dispatch_get_on_conflict_action(dispatch); ResultRelInfo *resrelinfo, *relinfo; - bool has_compressed_chunk = (chunk->fd.compressed_chunk_id != 0); /* permissions NOT checked here; were checked at hypertable level */ if (chec...
codereview_cpp_data_11319
} void ReqRepHelloWorldRequester::init_with_latency( - eprosima::fastrtps::Duration_t latency_budget_duration_pub, - eprosima::fastrtps::Duration_t latency_budget_duration_sub) { ParticipantAttributes pattr; participant_ = Domain::createParticipant(pattr); Change arguments to const reference...
codereview_cpp_data_11322
std::string name ) { - user = user; - pass = pass; - host = host; - name = name; - uint32 errnum = 0; char errbuf[MYSQL_ERRMSG_SIZE]; if (!Open( These members need renamed, otherwise it's just local self assignment std::string name ) { uint32 errnum = 0; char errbuf[MYSQL_ERRMSG_SIZE]; if (!Op...
codereview_cpp_data_11323
{ h2o_iovec_t value; - value.base = h2o_mem_alloc_pool(&req->pool, *value.base, - prefix_len + suffix_len + - sizeof(ELEMENT_LONGEST_STR("response") DELIMITER ELEMENT_LONGEST_STR("total"))); value.len = 0; if (prefix_len != 0) ...
codereview_cpp_data_11333
// and a full read of the subtree is initiated Sync::Sync(MegaClient* cclient, SyncConfig config, string* crootpath, const char* cdebris, string* clocaldebris, Node* remotenode, fsfp_t cfsfp, bool cinshare, int ctag, void *cappdata) -: localroot{new LocalNode} -, mConfig{config} { isnetwork = false;...
codereview_cpp_data_11340
: dds::core::Reference<detail::DomainParticipant>( eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->create_participant( did, - eprosima::fastdds::dds::DomainParticipantFactory::get_instance()->get_default_participant_qos())) { } Why not using the constan...
codereview_cpp_data_11345
log_->info("Downloaded an empty chain"); continue; } else { - log_->info("Successfully downloaded {} blocks:", blocks.size()); } auto chain = I thing, this log entry should be moved under `if` below - we are not very interested in the fact of block ...
codereview_cpp_data_11346
*/ TEST_F(ChainValidationTest, ValidWhenValidateChainFromOnePeer) { // Valid previous hash, has supermajority, correct peers subset => valid - auto block = std::make_shared<BlockMock>(); - setupBlock(*block); - EXPECT_CALL(*supermajority_checker, hasSupermajority(_, _)) .WillOnce(Return(true)); Upwar...
codereview_cpp_data_11349
#include <iostream> #include <cstdint> /* Program that computes a^b in O(logN) time. Would it be possible to create some tests of the form: ```cpp #include <cassert> assert (fast_power_recursive(10, 3) == 1000); ``` that would raise an error if __fast_power_recursive()__ was modified incorrectly? Should we als...
codereview_cpp_data_11352
size_t offset = 0; UA_Connection *c = UA_NULL; UA_SecureChannel *sc = session->channel; - if(!sc) { response->responseHeader.serviceResult = UA_STATUSCODE_BADINTERNALERROR; return; } are you sure, you need to delete it? Here a connection was checked and no...
codereview_cpp_data_11376
upgrader_flags |= RPMOSTREE_SYSROOT_UPGRADER_FLAGS_ALLOW_OLDER; OstreeSysroot *sysroot = rpmostreed_transaction_get_sysroot (transaction); - glnx_unref_object RpmOstreeSysrootUpgrader *upgrader = rpmostree_sysroot_upgrader_new (sysroot, self->osname, upgrader_flags, ca...
codereview_cpp_data_11378
Py_INCREF(v); } } -#else -static CYTHON_INLINE void __Pyx_fill_sequence_from_array(PyObject *const *src, PyObject* dest, Py_ssize_t length) { - Py_ssize_t i; - for (i = 0; i < length; i++) { - PySequence_SetItem(dest, i, src[i]); - } -} -#endif static CYTHON_INLINE PyObject * __Pyx_PyTu...
codereview_cpp_data_11389
if (boost::optional<Json::Value> _standardsArr = standard.getPrimaryKey(primaryKey)) { m_standardsArr = _standardsArr.get(); } } } should print a warning or error if not found right? if (boost::optional<Json::Value> _standardsArr = standard.getPrimaryKey(primaryKey)) { m...
codereview_cpp_data_11408
makedir(dirname.c_str()); std::string rng_name; rng_name = dirname + "/rng_seq_generator"; std::ofstream rng_seq(rng_name); rng_seq << ::data_seq_generator; Apparently, we have never been saving this RNG's state correctly. makedir(dirname.c_str()); std::string rng_name; + /// @todo - Note that t...
codereview_cpp_data_11412
HandleAutoscroll(); } -#define TICK_15_INTERVAL (15 * MILLISECONDS_PER_TICK) -#define TICK_100_INTERVAL (100 * MILLISECONDS_PER_TICK) /** * Update the continuously changing contents of the windows, such as the viewports ick. Use consts instead? HandleAutoscroll(); } +static const uint TICK_15_INTERVAL = 15 *...
codereview_cpp_data_11417
peer_query, storage, crypto_provider, - std::make_shared<shared_model::validation::BlockValidator>()); } std::shared_ptr<BlockLoader> BlockLoaderInit::initBlockLoader( this is your default value peer_query, storage, crypto_provider, + std::make_shared<shared_model...
codereview_cpp_data_11425
shared_model::crypto::Keypair keypair = shared_model::crypto::DefaultCryptoAlgorithmType::generateKeypair(); - shared_model::crypto::Keypair pair = - shared_model::crypto::DefaultCryptoAlgorithmType::generateKeypair(); std::vector<shared_model::interface::types::PubkeyType> signatories = { key...
codereview_cpp_data_11431
blacklist ${HOME}/.config/Google blacklist ${HOME}/.config/Google Play Music Desktop Player blacklist ${HOME}/.config/Gpredict -blacklist ${HOME}/.config/homebank blacklist ${HOME}/.config/INRIA blacklist ${HOME}/.config/InSilmaril blacklist ${HOME}/.config/Jitsi Meet disable-programs is sorted alphabetically (a...
codereview_cpp_data_11434
if (req->proxy_stats.ssl.cipher_bits == 0) goto EmitNull; RESERVE(sizeof(H2O_INT16_LONGEST_STR)); - pos += sprintf(pos, "%" PRIu16, req->proxy_stats.ssl.cipher_bits); break; case ELEMENT_TYPE_PROXY_SSL_PROTOCOL_VERSION: APPEND_SAFE...
codereview_cpp_data_11440
{ setAuthors("Matt DeMers, Ayman Habib, Ajay Seth"); constructProperties(); - FrameGeometry* frm = new FrameGeometry(0.2); - frm->setName("frame_geometry"); - frm->set_display_radius(.004); - frm->setRepresentation(Geometry::Hide); - append_GeometrySet(*frm); } This FrameGeometry object gets...
codereview_cpp_data_11451
} } int main() { std::cout << "\nEnter the capacity of the knapsack : "; float capacity; ```suggestion } // namespace knapsack } // namespace greedy_algorithms using greedy_algorithms::knapsack::Item; using greedy_algorithms::knapsack::quickSort; ``` } } +} // namespace knapsack +} // namespa...
codereview_cpp_data_11455
*/ #include <gtest/gtest.h> -#include <ed25519/ed25519.h> -#include "backend/protobuf/common_objects/amount.hpp" #include "backend/protobuf/common_objects/proto_common_objects_factory.hpp" #include "builders/default_builders.hpp" #include "cryptography/crypto_provider/crypto_defaults.hpp" Can't it be substituted...
codereview_cpp_data_11457
aiMatrix4x4 rx, ry, rz; aiMatrix4x4::RotationX(imp.rot.x, rx); - aiMatrix4x4::RotationX(imp.rot.y, ry); - aiMatrix4x4::RotationX(imp.rot.z, rz); pOut->mRootNode->mTransformation *= rx; pOut->mRootNode->mTransformation *= ry; pOut->mRootNode->mTransformation *= rz; Is this correct? Y have alway...
codereview_cpp_data_11488
{ if (verbose > 2) { - printf("set Step selection: from %llu read %llu steps\n", s[0], - c[0]); } variable->SetStepSelection({s[0], c[0]}); } This format should be "... %" PRIu64 " steps\n", because s is uint64_t...
codereview_cpp_data_11489
num_discarded = 0; }, [=](size_t& num_discarded, const std::vector<table_slice>& slices) { - const auto num_rows - = std::transform_reduce(slices.begin(), slices.end(), size_t{}, - std::plus<>{}, [](const auto& slice) { - ...
codereview_cpp_data_11497
status_factory, cache_, tx_presence_cache_); - service_transport_ = std::make_shared<torii::CommandServiceTransportGrpc>( - servic...
codereview_cpp_data_11503
if (tables.size() > 1) { cout << "Storage: cannot read data files with multiple tables. " << "Only the first table '" << tables.begin()->first << "' will " - << "loaded as Storage." << endl; } convertTableToStorage(tables.be...
codereview_cpp_data_11520
"", 0.0, true, RangedValidator<double>(0.0, 30.0)); rules.Add<double>("RULE_PRODUCTION_QUEUE_TOPPING_UP_FACTOR", "RULE_PRODUCTION_QUEUE_TOPPING_UP_FACTOR_DESC", - "", 20.0, true, RangedValidator<double>(0.0, 30.0)); } bool...
codereview_cpp_data_11527
#include "ametsuchi/impl/postgres_ordering_service_persistent_state.hpp" #include "ametsuchi/impl/wsv_restorer_impl.hpp" #include "consensus/yac/impl/supermajority_checker_impl.hpp" using namespace iroha; using namespace iroha::ametsuchi; `algorithm` is not required here, and memory is probably already transitive...
codereview_cpp_data_11529
double Troops::GetStrength() const { double strength = 0; - for ( const Troop * troop : *this ) if ( troop && troop->isValid() ) strength += troop->GetStrength(); return strength; } Please change it into: ``` for ( const Troop * troop : *this ) { if ( troop && troop->isValid() ) s...
codereview_cpp_data_11533
#include <caf/actor_system.hpp> #include <caf/actor_system_config.hpp> #include <caf/binary_deserializer.hpp> -#include <caf/binary_serializer.hpp> #include <caf/deserializer.hpp> #include <caf/error.hpp> #include <caf/execution_unit.hpp> This one is not used in this file. #include <caf/actor_system.hpp> #inc...
codereview_cpp_data_11540
// void show(int* arr, const int size); /** - * Function to merge two sub-arrays. merge() function is called - * from mergeSort() to merge the array after it split for sorting * by the mergeSort() funtion. * * In this case the merge fuction will also count and return ```suggestion * @brief Function to merge tw...
codereview_cpp_data_11542
return { [=](const curried_predicate&) { return row_ids; }, [](atom::shutdown) { - die("received shutdown request as one-shot indexer"); }, }; }); `self->quit()` should be enough here, no need to kill the process. return { [=](const curried_predic...
codereview_cpp_data_11552
* * Memory used: 1.7MB */ -boost::scoped_ptr<CRollingBloomFilter> recentRejects GUARDED_BY(cs_recentRejects); uint256 hashRecentRejectsChainTip; /** why not using `std::unique_ptr` like we did below for `txn_recently_in_block`? * * Memory used: 1.7MB */ +std::unique_ptr<CRollingBloomFilter> recentReject...
codereview_cpp_data_11561
#define CGALPLUGIN_MESHGENERATIONFROMIMAGE_CPP #include <CGALPlugin/MeshGenerationFromImage.h> -//#include <image/ImageTypes.h> namespace cgal { you can remove the line definitively #define CGALPLUGIN_MESHGENERATIONFROMIMAGE_CPP #include <CGALPlugin/MeshGenerationFromImage.h> namespace cgal {
codereview_cpp_data_11571
} /** - * @brief Compares two integer. * * @param a first integer * @param b second integer description misleading, better to write "comparison between integers suitable as qsort callback" } /** + * @brief comparison between integers suitable as qsort callback. * * @param a first integer * @param b se...
codereview_cpp_data_11575
wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); - // ? why use these instead of ifdefs? if (strstr(pDoc->state.host_info.os_name, "Darwin")) { hostIsMac = true; } else if (strstr(pDoc->state.host_info.os_name, "Microsoft")) { I think the answer is 'because Manager could be...
codereview_cpp_data_11579
"The amount of time since the last UpdateConsensus request from the " "leader."); -METRIC_DEFINE_gauge_int32(tablet, is_leader, - "Is tablet leader", yb::MetricUnit::kUnits, - "Keeps track whether tablet i...
codereview_cpp_data_11587
std::string last_name; int save_version = CURRENT_FORMAT_VERSION; std::vector<int> reserved_vols( LOOPXX_COUNT, 0 ); - std::map<std::string, StreamBuf> map_players; namespace ObjectFadeAnimation { Please use camelCase variable naming such as mapPlayers. std::string last_name; int...
codereview_cpp_data_11588
TEST_F(SimulatorTest, ValidWhenPreviousBlock) { // proposal with height 2 => height 1 block present => new block generated - std::vector<shared_model::proto::Transaction> txs; - txs.push_back(makeTx()); - txs.push_back(makeTx()); auto validation_result = std::make_unique<iroha::validation::VerifiedProp...
codereview_cpp_data_11618
CastleIndexListBox listbox( area, result ); - listbox.SetScrollButtonUp( conf.ExtGameEvilInterface() ? ICN::LISTBOX_EVIL : ICN::LISTBOX, 3, 4, fheroes2::Point( area.x + 256, area.y + 45 ) ); - listbox.SetScrollButtonDn( conf.ExtGameEvilInterface() ? ICN::LISTBOX_EVIL : ICN::LISTBOX, 5, 6, fheroes2::Point( ar...
codereview_cpp_data_11620
bool CDlgAdvPreferences::ConfirmSetLocal() { wxString strMessage = wxEmptyString; - strMessage.Printf( - _("Changing to use the local BOINC preferences defined on this page. BOINC will ignore your web-based preferences, even if you subsequently make changes there. Do you want to proceed?") - ); ...
codereview_cpp_data_11629
return; } - for (int i = 0; i <= MAX_APPEARANCE_EFFECTS; i++) { Message(Chat::Red, "ID: %i :: App Effect ID %i :: Slot %i", i, appearance_effects_id[i], appearance_effects_slot[i]); } } You're using < max +1, <= max, etc. in other places, not sure your intentions there or here. return; } + for (int i ...
codereview_cpp_data_11632
} } -#if SOFA_NO_UPDATE_BBOX == 0 { ScopedAdvancedTimer timer("UpdateBBox"); gnode->execute<UpdateBoundingBoxVisitor>(params); } -#endif #ifdef SOFA_DUMP_VISITOR_INFO simulation::Visitor::printCloseNode("Step"); So it seems to you are doing the inverse move from what I c...
codereview_cpp_data_11633
/** @file console_cmds.cpp Implementation of the console hooks. */ -#include <time.h> #include "stdafx.h" #include "console_internal.h" #include "debug.h" There's no hard-and-fast rule for this, but standard headers are generally put at the bottom of the list on their own (but before safeguards.h) /** @file cons...