id
stringlengths
27
29
content
stringlengths
226
3.24k
codereview_new_cpp_data_6512
bool do_process_c017_delay_queue(int controller_number, const Queue_element_base continue; // Zabbix will ignore an empty key anyway } JsonObject block = data.createNestedObject(); - block[F("host")] = Settings.getUnitname(); // Zabbix hostname, Unit N...
codereview_new_cpp_data_6514
bool SettingsStruct_tmpl<N_TASKS>::isEthernetPinOptional(int8_t pin) const { #if FEATURE_ETHERNET if (pin < 0) return false; if (NetworkMedium == NetworkMedium_t::Ethernet) { - if (((ETH_Clock_Mode == EthClockMode_t::Int_50MHz_GPIO_0) && (pin == 0)) || - ((ETH_Clock_Mode == EthClockMode_t::Int_...
codereview_new_cpp_data_6515
void handle_json() stream_next_json_object_value(F("Type"), getPluginNameFromDeviceIndex(DeviceIndex)); stream_next_json_object_value(F("TaskName"), getTaskDeviceName(TaskIndex)); stream_next_json_object_value(F("TaskDeviceNumber"), Settings.TaskDeviceNumber[TaskIndex]); ...
codereview_new_cpp_data_6516
void handle_json() stream_next_json_object_value(F("Type"), getPluginNameFromDeviceIndex(DeviceIndex)); stream_next_json_object_value(F("TaskName"), getTaskDeviceName(TaskIndex)); stream_next_json_object_value(F("TaskDeviceNumber"), Settings.TaskDeviceNumber[TaskIndex]); ...
codereview_new_cpp_data_6517
void handle_json() stream_next_json_object_value(F("Type"), getPluginNameFromDeviceIndex(DeviceIndex)); stream_next_json_object_value(F("TaskName"), getTaskDeviceName(TaskIndex)); stream_next_json_object_value(F("TaskDeviceNumber"), Settings.TaskDeviceNumber[TaskIndex]); ...
codereview_new_cpp_data_6518
void handle_json() stream_next_json_object_value(F("TaskName"), getTaskDeviceName(TaskIndex)); stream_next_json_object_value(F("TaskDeviceNumber"), Settings.TaskDeviceNumber[TaskIndex]); for(int i = 0; i < 3; i++) { - if (Settings.TaskDevicePin[i][TaskIndex] != -1) { ...
codereview_new_cpp_data_6519
void addTextBox(const String & id, { addHtml(F("<input ")); addHtmlAttribute(F("class"), classname); - addHtmlAttribute(F("type"), F("text")); addHtmlAttribute(F("name"), id); if (maxlength > 0) { addHtmlAttribute(F("maxlength"), maxlength); Just curious, what is the difference betwe...
codereview_new_cpp_data_6520
bool isLoggedIn(bool mustProvideLogin) String getControllerSymbol(uint8_t index) { - String ret = F("<p style='font-size:20px; background: #00000000;line-height:21px;'>&#"); ret += 10102 + index; - ret += F(";</p>"); return ret; } What’s the line-height for? In my browser it looks actually a little b...
codereview_new_cpp_data_6521
void html_add_script(bool defer) { if (defer) { addHtml(F(" defer")); } - addHtml(F('>')); } void html_add_script_end() { The F macro can only be applied to strings not on chars, this line should be: `addHtml('>');` (that's why the build failed) void html_add_script(bool defer) { if (defer) { ...
codereview_new_cpp_data_6522
* checkI2CConfigValid_toHtml(taskIndex, onlyCheck) * Check if I2C is correctly configured and usable for this task * taskIndex: will be used in planned enhancements - * onlyCheck = true: no html output is generated * Outputs an error message and returns false if not correct **********************************...
codereview_new_cpp_data_6523
P134_data_struct::P134_data_struct(uint8_t config_port, { const ESPEasySerialPort port = static_cast<ESPEasySerialPort>(_config_port); - delete P134_Serial; - P134_Serial = new ESPeasySerial(port, _config_pin1, _config_pin2); if (P134_Serial != nullptr) { Why is delete needed in the constructor? The me...
codereview_new_cpp_data_6524
void handle_notifications() { } else { - //MFD: we display the GPIO - if (NotificationSettings.Pin1>=0){ - addHtml(F("GPIO-")); - addHtmlInt(NotificationSettings.Pin1); - } if (NotificationSettings.Pin2>=0) { html_...
codereview_new_cpp_data_6526
void getWebPageTemplateDefaultHead(WebTemplateParser& parser, bool addMeta, bool if (parser.isTail()) return; parser.process(F("<!DOCTYPE html><html lang='en'>" "<head>" - "<link rel='stylesheet' href='codemirror.css'>" "<script src='codemirror.min.js'></script>" - ...
codereview_new_cpp_data_6537
HOOT_FACTORY_REGISTER(ElementVisitor, AddElementIdVisitor) void AddElementIdVisitor::visit(const ElementPtr& pElement) { Tags& tags = pElement->getTags(); - tags[MetadataTags::HootId()] = QString::number(pElement->getId()); } } I think we need an indicator of the table (Node, Way, Relation) as well as the n...
codereview_new_cpp_data_6540
bool GenFaceNormalsProcess::GenMeshFaceNormals(aiMesh *pMesh) { const aiVector3D *pV1 = &pMesh->mVertices[face.mIndices[0]]; const aiVector3D *pV2 = &pMesh->mVertices[face.mIndices[1]]; const aiVector3D *pV3 = &pMesh->mVertices[face.mIndices[face.mNumIndices - 1]]; - if (flippedWindin...
codereview_new_cpp_data_6544
void generateOutput() Portable::getSysElapsedTime() ); g_s.print(); - bool restore=FALSE; - if (Debug::isFlagSet(Debug::Time)) - { - Debug::clearFlag("time"); - restore=TRUE; - } msg("finished...\n"); - if (restore) Debug::setFlag("time"); } else { the sa...
codereview_new_cpp_data_6545
void searchInputFiles() } if (Doxygen::inputNameLinkedMap->empty()) { - warn_uncond("No files to be processed, please check your settings, in particular INPUT, FILE_PATTERNS, and RECURSIVE\n"); } g_s.end(); } Good catch though it would be better to have such a change not hidden in another PR but in...
codereview_new_cpp_data_6546
void XmlDocVisitor::operator()(const DocImage &img) bool ambig; if (url.isEmpty() && (fd=findFileDef(Doxygen::imageNameLinkedMap,img.name(),ambig))) { - if (fd) copyFile(fd->absFilePath(),Config_getString(XML_OUTPUT)+"/"+baseName); } visitChildren(img); visitPostEnd(m_t, "image"); this extra `if ...
codereview_new_cpp_data_6547
void DocParser::defaultHandleTitleAndSize(const int cmd, DocNodeVariant *parent, } else if (tok==TK_HTMLTAG) { break; } if (!defaultHandleToken(parent,tok,children)) should we not unput the string like is done below? For a closing tag is it probably ok to ignore it, but an opening tag ...
codereview_new_cpp_data_6548
void linkifyText(const TextGeneratorIntf &out, const Definition *scope, // set next start point in the string //printf("index=%d/%d\n",index,txtStr.length()); skipIndex=index=newIndex+matchLen; - if (insideString) index++; } // add last part of the string to the result. //ol.docify(txtStr.ri...
codereview_new_cpp_data_6549
static bool stylist_validate_requirements(struct map_session_data *sd, int type, return false; if (entry->id >= 0) { - if (entry->zeny != 0 && pc->payzeny(sd, entry->zeny, LOG_TYPE_OTHER, NULL) != 0) { return false; } else if (entry->itemid != 0) { it.nameid = entry->itemid; i not sure, but may be ...
codereview_new_cpp_data_6552
class CppGenerator : public BaseGenerator { code_ += " int KeyCompareWithValue(const {{INPUT_TYPE}} *_{{FIELD_NAME}}" ") const { "; - code_ += " auto curr_{{FIELD_NAME}} = {{FIELD_NAME}}();"; code_ += " for (auto i = 0; i < curr_{{FIELD_NAME}}->size(); i++) {";...
codereview_new_cpp_data_6554
CheckedError Parser::ParseProtoFields(StructDef *struct_def, bool isextend, while (!Is(';')) { if (token_ == kTokenIntegerConstant) { if (range) { - for (voffset_t id = std::stoul(from) + 1; id <= stoul(attribute_); id++) struct_def->reserved_ids.push_back(id); ...
codereview_new_cpp_data_6555
const static FlatCOption options[] = { { "", "proto-namespace-suffix", "SUFFIX", "Add this namespace to any flatbuffers generated from protobufs." }, { "", "oneof-union", "", "Translate .proto oneofs to flatbuffer unions." }, - { "", "keep-proto-id", "", "Keep protobuf ids in generated fbs file." }, { "...
codereview_new_cpp_data_6556
void EvolutionTest(const std::string &tests_data_path) { #endif } void ConformTest() { const char ref[] = "table T { A:int; } enum E:byte { A }"; I would reduce your PRs to remove misc formatting issues. They just add noise. void EvolutionTest(const std::string &tests_data_path) { #endif } + void...
codereview_new_cpp_data_6557
class SwiftGenerator : public BaseGenerator { std::string SwiftConstant(const FieldDef& field) { const auto default_value = StringIsFlatbufferNan(field.value.constant) ? ".nan" : - StringIsFlatbufferPositiveInfinity(field.value.constant) ? "+.infinity" : StringIsFlatbufferNegativeInfin...
codereview_new_cpp_data_6558
class SwiftGenerator : public BaseGenerator { StringIsFlatbufferNan(field.value.constant) ? ".nan" : StringIsFlatbufferPositiveInfinity(field.value.constant) ? ".infinity" : StringIsFlatbufferNegativeInfinity(field.value.constant) ? "-.infinity" : - // IsEnum(field.value.type) ? (fiel...
codereview_new_cpp_data_6725
static pmix_status_t unpack_return(pmix_buffer_t *data) /* provide an opportunity to store any data (or at least how to access * any data) that was included in the fence */ - // TODO(skg) Is this peer correct? It seems to work. PMIX_GDS_RECV_MODEX_COMPLETE(rc, pmix_client_globals.myserver, dat...
codereview_new_cpp_data_6726
BaseObject::BaseObject() , l_slaves(initLink("slaves","Sub-objects used internally by this object")) , l_master(initLink("master","nullptr for regular objects, or master object for which this object is one sub-objects")) { - l_context.setValidator(std::bind(&sofa::core::objectmodel::BaseObject::changeCon...
codereview_new_cpp_data_6727
void Base::initData0( BaseData* field, BaseData::BaseInitData& res, const char* res.helpMsg = help; res.dataFlags = dataFlags; - if (strlen(name) >= 3) { std::string_view prefix = std::string_view(name).substr(0, 4); shouldnt it be `>= 4` ? void Base::initData0( BaseData* field, BaseD...
codereview_new_cpp_data_6728
int LineAxisClass = core::RegisterObject("Display scene axis") using namespace sofa::defaulttype; -void LineAxis::parse(sofa::core::objectmodel::BaseObjectDescription* arg) -{ - if (std::string(arg->getAttribute("type")) == lineAxisDeprecatedName) - { - msg_warning(lineAxisDeprecatedName) << lineAxis...
codereview_new_cpp_data_6729
ObjectElement::~ObjectElement() bool ObjectElement::init() { - [[maybe_unused]] int i=0; for (child_iterator<> it = begin(); it != end(); ++it) { - i++; it->init(); } is it actually used .. ? ObjectElement::~ObjectElement() bool ObjectElement::init() { for (child_ite...
codereview_new_cpp_data_6730
AttributeElement::~AttributeElement() bool AttributeElement::init() { - [[maybe_unused]] int i=0; for (child_iterator<> it = begin(); it != end(); ++it) { - i++; it->initNode(); } return initNode(); is it actually used .. ? AttributeElement::~AttributeElement() bool Att...
codereview_new_cpp_data_6731
void DefaultPipeline::doCollisionDetection(const type::vector<core::CollisionMod else { std::string msg = "Compute BoundingTree: " + (*it)->getName(); - ScopedAdvancedTimer tmpbboxtimer(msg.c_str()); (*it)->computeBoundingTree(used_depth); ...
codereview_new_cpp_data_6732
void DefaultPipeline::doCollisionDetection(const type::vector<core::CollisionMod else { std::string msg = "Compute BoundingTree: " + (*it)->getName(); - ScopedAdvancedTimer BoundingTreeTimer(msg.c_str()); (*it)->computeBoundingTree(used_depth);...
codereview_new_cpp_data_6733
namespace sofa Transform baseDevice_H_endDevice(pos*data.scale, quat); Transform world_H_virtualTool = data.world_H_baseDevice * baseDevice_H_endDevice * data.endDevice_H_virtualTool; lastToolPosition = world_H_virtualTool; - /* unused code Transform baseDevice_H_endDevice2 = data.world_H_baseDevic...
codereview_new_cpp_data_6734
class StdTaskAllocator : public Task::Allocator } }; -// mac clang 3.5 doesn't support thread_local vars -//static WorkerThread* WorkerThread::_workerThreadIndex = nullptr; -// SOFA_THREAD_SPECIFIC_PTR(WorkerThread, workerThreadIndex); - -// std::map< std::thread::id, WorkerThread*> DefaultTaskSchedul...
codereview_new_cpp_data_6735
void SparseGridTopology::init() } } - m_upperElementType = core::topology::TopologyElementType::HEXAHEDRON; } ```suggestion m_upperElementType = core::topology::TopologyElementType::HEXAHEDRON; ``` just a indent issue. Otherwise good to go. I'm surprised sparseGrid is not calling inherit...
codereview_new_cpp_data_6736
ConstraintAnimationLoop::ConstraintAnimationLoop(simulation::Node* gnode) , d_tol( initData(&d_tol, 0.00001_sreal, "tolerance", "Tolerance of the Gauss-Seidel")) , d_maxIt( initData(&d_maxIt, 1000, "maxIterations", "Maximum number of iterations of the Gauss-Seidel")) , d_doCollisionsFirst(initData(&d_do...
codereview_new_cpp_data_6737
void DynamicSparseGridTopologyModifier::init() if(!m_DynContainer) { - msg_error() << "DynamicSparseGridTopologyContainer not found in context"; d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid); return; } Uhh... Didn't know this guy! void DynamicS...
codereview_new_cpp_data_6738
void EdgeSetTopologyModifier::init() if(!m_container) { - msg_error() << "EdgeSetTopologyContainer not found in context"; d_componentState.setValue(sofa::core::objectmodel::ComponentState::Invalid); return; } Does "context" is enough clear for users? Or maybe "current Node" /...
codereview_new_cpp_data_6739
bool TopologicalMapping::checkTopologyInputTypes() { if (m_inputType == TopologyElementType::UNKNOWN) { - dmsg_error() << "The input TopologyElementType has not be set. Define 'm_inputType' to the correct TopologyElementType in the constructor."; return false; } if (m_outputType ...
codereview_new_cpp_data_6740
void RegularGridTopology::setPos(SReal xmin, SReal xmax, SReal ymin, SReal ymax, SReal p0x=xmin, p0y=ymin, p0z=zmin; const Vec3i _n = d_n.getValue() - Vec3i(1,1,1); - if (_n[0] > 0.0) setDx(Vector3((xmax - xmin) / _n[0], 0_sreal, 0_sreal)); else { ```suggestion if (_n[0] > 0) `...
codereview_new_cpp_data_6741
ImageCImgCreators::ImageCImgCreators() const std::string& ext = cimgSupportedExtensions[i]; if (!sofa::helper::io::Image::FactoryImage::HasKey(ext)) { - creators.push_back(std::make_unique<Creator<helper::io::Image::FactoryImage, ImageCImg>>(ext)); } } ```suggesti...
codereview_new_cpp_data_6742
void MeshTopology::init() BaseMeshTopology::init(); - const auto& hexahedra = seqHexahedra.getValue(); - const auto& tetrahedra = seqTetrahedra.getValue(); - const auto& quads = seqQuads.getValue(); - const auto& triangles = seqTriangles.getValue(); - const auto& edges = seqEdges.getValue(); ...
codereview_new_cpp_data_6743
CarvingManager::CarvingManager() void CarvingManager::init() { // Search for collision model corresponding to the tool. - if (l_toolModel.empty()) { m_toolCollisionModel = getContext()->get<core::CollisionModel>(core::objectmodel::Tag("CarvingTool"), core::objectmodel::BaseContext::SearchRoot);...
codereview_new_cpp_data_6744
const int CarvingManagerClass = core::RegisterObject("Manager handling carving o CarvingManager::CarvingManager() - : l_toolModel(initLink("toolModel", "link to the carving collision model, if not set, manager wi will search for a collision model with tag: CarvingTool")) , d_surfaceModelPath( initData(&d_...
codereview_new_cpp_data_6745
int MeshDiscreteIntersection::computeIntersection(Triangle& e1, Line& e2, Output const Line::Coord& P = e2.p1(); const Line::Coord PQ = e2.p2()-P; Mat<3, 3, Triangle::Coord::value_type> M(NOINIT); - Mat<3, 3, Triangle::Coord::value_type> Minv; Triangle::Coord right(NOINIT); for (int i=0; i<...
codereview_new_cpp_data_6746
std::istream& operator>>(std::istream& i, Tag& t) return i; } -} Usually in SOFA the namespace is repeated in a comment after the closing curly bracket. std::istream& operator>>(std::istream& i, Tag& t) return i; } +} // namespace sofa::core::objectmodel
codereview_new_cpp_data_6747
void TopologyContainer::resetTopologyHandlerList() { for (auto& topologyHandlerList : m_topologyHandlerListPerElement) { - std::for_each(topologyHandlerList.begin(), topologyHandlerList.end(), [](TopologyHandler* topoHandler) - { - topoHandler = nullptr; - }); - top...
codereview_new_cpp_data_6748
void DrawToolGL::drawLines(const std::vector<Vector3> &points, float size, const std::map<RGBAColor, std::vector<Vector3> > colorPointsMap; for (std::size_t i = 0; i < colors.size(); ++i) { - if (colorPointsMap.find(colors[i]) == colorPointsMap.end()) - { - colorPointsMap.insert...
codereview_new_cpp_data_6749
void DrawToolGL::drawLines(const std::vector<Vector3> &points, float size, const std::map<RGBAColor, std::vector<Vector3> > colorPointsMap; for (std::size_t i = 0; i < colors.size(); ++i) { - if (colorPointsMap.find(colors[i]) == colorPointsMap.end()) - { - colorPointsMap.insert...
codereview_new_cpp_data_6750
void DrawToolGL::drawLines(const std::vector<Vector3> &points, float size, const std::map<RGBAColor, std::vector<Vector3> > colorPointsMap; for (std::size_t i = 0; i < colors.size(); ++i) { - if (colorPointsMap.find(colors[i]) == colorPointsMap.end()) - { - colorPointsMap.insert...
codereview_new_cpp_data_6751
Index TopologicalChangeManager::removeItemsFromLineModel(LineCollisionModel<sofa topo_curr = model->getCollisionTopology(); if(dynamic_cast<EdgeSetTopologyContainer*>(topo_curr) == nullptr){ - msg_warning("TopologicalChangeManager") << " Topology is not an EdgeSetTopologyContainer. Only EdgeSetTopol...
codereview_new_cpp_data_6752
Index TopologicalChangeManager::removeItemsFromLineModel(LineCollisionModel<sofa std::sort(unique_indices.begin(), unique_indices.end()); unique_indices.erase(std::unique(unique_indices.begin(), unique_indices.end()), unique_indices.end()); - auto topo_mod = topo_curr->getContext()->get<sofa::core::topo...
codereview_new_cpp_data_6753
void GenericConstraintCorrection::bwdInit() { BaseContext* context = this->getContext(); - // Find linear solvers if (l_linearSolver.empty()) { msg_info() << "Link \"linearSolver\" to the desired linear solver should be set to ensure right behavior." << msgendl ```suggestion // Find...
codereview_new_cpp_data_6754
objectmodel::BaseObject::SPtr ObjectFactory::createObject(objectmodel::BaseConte using sofa::helper::lifecycle::uncreatableComponents; if(it == registry.end()) { - arg->logError("The object '"+classname+"' is not in the factory."); auto uuncreatableComponent = uncreat...
codereview_new_cpp_data_6755
const int CudaLinearSolverConstraintCorrectionClass = core::RegisterObject("Supp .add< LinearSolverConstraintCorrection< CudaVec3f1Types > >() ; -} // namespace sofa::component::constraintset ```suggestion } // namespace sofa::component::constraint::lagrangian::correction ``` const int CudaLinearSolverConstra...
codereview_new_cpp_data_6949
get_bundle_appstream_data (GFile *root, GCancellable *cancellable, GError **error) { - g_autoptr(GFile) xmls_dir = NULL; - g_autofree char *appstream_basename = NULL; g_autoptr(GFile) appstream_file = NULL; g_autoptr(GInputStream) xml_in = NU...
codereview_new_cpp_data_6950
iterate_bundle_icons (GFile *root, g_autoptr(GFile) icons_dir = g_file_resolve_relative_path (root, "files/share/app-info/icons/flatpak"); - if (!g_file_test(g_file_peek_path(icons_dir), G_FILE_TEST_IS_DIR)) { icons_dir = g_file_resolve_relative_path...
codereview_new_cpp_data_6951
void FixAmoebaBiTorsion::init() // error check that PairAmoeba or PairHiippo exist pair = nullptr; - pair = force->pair_match("amoeba",1,0); - if (!pair) pair = force->pair_match("amoeba/gpu",1,0); - if (!pair) pair = force->pair_match("hippo",1,0); - if (!pair) pair = force->pair_match("hippo/gpu",1,0); ...
codereview_new_cpp_data_6952
PPPMGPU::PPPMGPU(LAMMPS *lmp) : PPPM(lmp) PPPMGPU::~PPPMGPU() { PPPM_GPU_API(clear)(poisson_time); } /* ---------------------------------------------------------------------- This will introduce a memory leak. PPPMGPU::PPPMGPU(LAMMPS *lmp) : PPPM(lmp) PPPMGPU::~PPPMGPU() { PPPM_GPU_API(clear)(poisson_...
codereview_new_cpp_data_6953
void Atom::setup_sort_bins() } #ifdef LMP_GPU - if (userbinsize == 0.0) { - int ifix = modify->find_fix("package_gpu"); - if (ifix >= 0) { const double subx = domain->subhi[0] - domain->sublo[0]; const double suby = domain->subhi[1] - domain->sublo[1]; const double subz = domain->s...
codereview_new_cpp_data_6954
FixPair::FixPair(LAMMPS *lmp, int narg, char **arg) : if (nevery < 1) error->all(FLERR,"Illegal fix pair every value: {}", nevery); pairname = utils::strdup(arg[4]); - if(lmp->suffix) { - strcat(pairname,"/"); - strcat(pairname,lmp->suffix); } - pstyle = force->pair_match(pairname,1,0); if (p...
codereview_new_cpp_data_6955
LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : while (iarg < narg && arg[iarg][0] != '-') iarg++; } else { - std::string errmsg("Invalid command-line argument"); - errmsg += arg[iarg]; - error->universe_all(FLERR,errmsg.c_str()); } } ```suggestion std::stri...
codereview_new_cpp_data_6956
LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : while (iarg < narg && arg[iarg][0] != '-') iarg++; } else { - std::string errmsg("Invalid command-line argument"); - errmsg += arg[iarg]; - error->universe_all(FLERR,errmsg.c_str()); } } ```suggestion error->un...
codereview_new_cpp_data_6957
template<class DeviceType> PairDPDExtKokkos<DeviceType>::PairDPDExtKokkos(class LAMMPS *_lmp) : PairDPDExt(_lmp) , #ifdef DPD_USE_RAN_MARS - rand_pool(0 /* unused */, lmp) #else rand_pool() #endif @akohlmey is changing `lmp` to `_lmp` necessary? Looks like this change was missed here (for `#ifdef DPD_USE_R...
codereview_new_cpp_data_6958
void Domain::subbox_too_small_check(double thresh) this should not be used if atom has moved infinitely far outside box b/c while could iterate forever e.g. fix shake prediction of new position with highly overlapped atoms - use minimum_image_once() instead ----------------------------------------...
codereview_new_cpp_data_6959
/* ---------------------------------------------------------------------- LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator https://www.lammps.org/, Sandia National Laboratories - The LAMMPS Developers, developers@lammps.org Copyright (2003) Sandia Corporation. Under the terms of Con...
codereview_new_cpp_data_6960
void Replicate::command(int narg, char **arg) int nrep = nx*ny*nz; if (me == 0) - utils::logmesg(lmp,"Replicating atoms for a {}x{}x{} = {} times size system...\n", nx, ny, nz, nrep); int bbox_flag = 0; if (narg == 4) Replication is creating a {}x{}x{} = {}x larger system void Replicate::command(...
codereview_new_cpp_data_6961
#include <cmath> using namespace LAMMPS_NS; -using namespace MathConst; static constexpr double SMALL = 0.001; static constexpr double A_CC = 1.421; ```suggestion using MathConst::MY_PI; using MathConst::MY_2PI; ``` #include <cmath> using namespace LAMMPS_NS; +using MathConst::MY_PI; +using MathConst...
codereview_new_cpp_data_6962
enum{ISO,ANISO,TRICLINIC}; // citation info static const char cite_user_uef_package[] = - "UEF package: src:10.1063/1.4972894\n\n" "@Article{NicholsonRutledge16,\n" "author = {David A. Nicholson and Gregory C. Rutledge},\n" "title = {Molecular Simulation of Flow-Enhanced Nucleation in\n", ```suggestion ...
codereview_new_cpp_data_6963
enum{ISO,ANISO,TRICLINIC}; // citation info static const char cite_user_uef_package[] = - "UEF package: src:10.1063/1.4972894\n\n" "@Article{NicholsonRutledge16,\n" "author = {David A. Nicholson and Gregory C. Rutledge},\n" "title = {Molecular Simulation of Flow-Enhanced Nucleation in\n", ```suggestion ...
codereview_new_cpp_data_6964
static const char cite_gpu_package[] = "}\n\n" "@Article{Trung17,\n" " author = {T. D. Nguyen},\n" - " title = {{GPU}-Accelerated {T}ersoff Potentials for Massively Parallel Molecular Dynamics Simulations},\n" - " journal = {Comput.\ Phys.\ Commun.},\n" " year = 2017,\n" " doi = {10.1016/j.cpc....
codereview_new_cpp_data_6965
static const char cite_user_uef_package[] = "volume = {145},\n" "number = {24},\n" "pages = {244903},\n" - "doi = {10.1063/1.4972894},\n", "year = {2016}\n" "}\n\n"; ```suggestion "doi = {10.1063/1.4972894},\n" ``` static const char cite_user_uef_package[] = "volume = {145},\n" "number =...
codereview_new_cpp_data_6966
void FixMDIQM::post_force(int vflag) if (ierr) error->all(FLERR, "MDI: <STRESS command"); ierr = MDI_Recv(qm_virial, 9, MDI_DOUBLE, mdicomm); if (ierr) error->all(FLERR, "MDI: <STRESS data"); - //for (int i = 0; i < 9; i++) { - // qm_virial[i] = 0.0; - //} MPI_Bcast(qm_virial, 9, MPI_DOUB...
codereview_new_cpp_data_6968
double FixPair::memory_usage() else bytes += (double)atom->nmax*ncols * sizeof(double); return bytes; } - -int FixPair::modify_param(int narg, char **arg) { - int processed_args=0; - int iarg = 0; - while (iarg < narg) { - if (strcmp(arg[iarg], "every") == 0) { - nevery = utils::inume...
codereview_new_cpp_data_7067
flb_sds_t flb_get_s3_key(const char *format, time_t time, const char *tag, sprintf(seq_index_str, "%"PRIu64, seq_index); seq_index_str[seq_index_len] = '\0'; tmp_key = replace_uri_tokens(s3_key, INDEX_STRING, seq_index_str); - if (!tmp_key) { goto error; } ...
codereview_new_cpp_data_7068
struct flb_config *flb_config_init() memset(&config->tasks_map, '\0', sizeof(config->tasks_map)); /* Environment */ config->env = flb_env_create(); - if (!config->env) { flb_error("[config] environment creation failed"); flb_config_exit(config); return NULL; } ...
codereview_new_cpp_data_7069
static void update_retry_metric(struct flb_stackdriver *ctx, uint64_t ts, int http_status, int ret_code) { if (ret_code != FLB_RETRY) { return; } - char tmp[32]; - char *name = (char *) flb_output_name(ctx->ins); - /*...
codereview_new_cpp_data_7070
static void pipeline_config_add_properties(flb_sds_t *buf, struct mk_list *props flb_sds_printf(buf, " %s ", kv->key); if (is_sensitive_property(kv->key)) { - flb_sds_cat(*buf, "--redacted--", strlen("--redacted--")); } else { - flb...
codereview_new_cpp_data_7071
static int flb_proxy_input_cb_exit(void *in_context, struct flb_config *config) if (proxy->def->proxy == FLB_PROXY_GOLANG) { #ifdef FLB_HAVE_PROXY_GO - proxy_go_output_destroy(ctx); #endif } Is proxy_go_input_destroy correct here? `proxy_go_output_destroy` does not proceed to handle `struct ...
codereview_new_cpp_data_7072
static flb_sds_t add_aws_auth(struct flb_http_client *c, signature = flb_signv4_do(c, FLB_TRUE, FLB_TRUE, time(NULL), ctx->aws_region, "es", - 0, ctx->aws_provider); if (!signature) { flb_plg_error(ctx->ins,...
codereview_new_cpp_data_7073
static flb_sds_t add_aws_auth(struct flb_http_client *c, signature = flb_signv4_do(c, FLB_TRUE, FLB_TRUE, time(NULL), ctx->aws_region, "es", - 0, ctx->aws_provider); if (!signature) { flb_plg_error(ctx->ins,...
codereview_new_cpp_data_7074
static flb_sds_t add_aws_auth(struct flb_http_client *c, signature = flb_signv4_do(c, FLB_TRUE, FLB_TRUE, time(NULL), ctx->aws_region, "es", - 0, ctx->aws_provider); if (!signature) { flb_plg_error(ctx->ins,...
codereview_new_cpp_data_7075
TEST_LIST = { {"filter_parser_ignore_malformed_time", flb_test_filter_parser_ignore_malformed_time }, {"filter_parser_preserve_original_field", flb_test_filter_parser_preserve_original_field }, {"filter_parser_first_matched_when_multiple_parser", flb_test_filter_parser_first_matched_when_mutilple_parser...
codereview_new_cpp_data_7076
static struct flb_config_map config_map[] = { { FLB_CONFIG_MAP_BOOL, "use_ansi", "false", 0, FLB_TRUE, offsetof(struct winevtlog_config, ignore_missing_channels), - "Use ANSI encoding on eventlog messages" }, /* EOF */ Could you use the actual description and parameter here like as...
codereview_new_cpp_data_7077
struct mk_list *winevtlog_open_all(const char *channels, int read_existing_event if (ch) { mk_list_add(&ch->_head, list); } } else { if (!ch) { Suppress errors on subscribing non-existent channel is fine. But, we should display warnings when su...
codereview_new_cpp_data_7078
static int msgpack_object_to_ra_value(msgpack_object o, /* Handle cases where flb_sds_create_len fails */ if (result->val.string == NULL) { - return -1; } return 0; } please align to 4 spaces as indentation static int msgpack_object_to_ra_value(msgpack_object o, ...
codereview_new_cpp_data_7079
char *flb_tail_file_name(struct flb_tail_file *file) break; } } - flb_free(file_entries); #endif return buf; } This should be a `free` call because the system uses `malloc` to reserve that memory whereas fluent-bit could be using its own allocator and that could cause an issue. ...
codereview_new_cpp_data_7080
static int parser_conf_file(const char *cfg, struct flb_cf *cf, } if (types_len) { for (i=0; i<types_len; i++){ - if (types[i].key != NULL) { flb_free(types[i].key); - } } flb_free(types); } Could you check indentation level ? static int parser_con...
codereview_new_cpp_data_7081
int flb_input_collector_fd(flb_pipefd_t fd, struct flb_config *config) else { if (collector->cb_collect(collector->instance, config, collector->instance->context) == -1) { - return -1; - } } return 0; Could you check indentation level ? int flb_input_coll...
codereview_new_cpp_data_7082
static void cb_stdout_flush(struct flb_event_chunk *event_chunk, printf("%"PRIu32".%09lu, ", (uint32_t)tmp.tm.tv_sec, tmp.tm.tv_nsec); msgpack_object_print(stdout, *p); printf("]\n"); - } } msgpack_unpacked_destroy(&result); flb_free(buf...
codereview_new_cpp_data_7083
void test_multiline_parser(msgpack_object *root2, int rand_val) { for (int i = 0; i < 4; i++) { for (int j = 0; j < 5; j++) { if (random_strings[j] != NULL) { - /* stream_ids index by j, random_strings index by i */ flb_ml_append(ml, stream_ids[j], FLB_M...
codereview_new_cpp_data_7091
double proj_strtod(const char *str, char **endptr) { if (strncmp(p, "NaN", 3) == 0) { if (endptr) *endptr = const_cast<char *>(p + 3); - return NAN; } /* non-numeric? */ I'm not sure how strict/flexible this code needs to be. It specifically checks for only NaN (not "nan"...
codereview_new_cpp_data_7092
double proj_strtod(const char *str, char **endptr) { if (strncmp(p, "NaN", 3) == 0) { if (endptr) *endptr = const_cast<char *>(p + 3); - return NAN; } /* non-numeric? */ ```suggestion return std::numeric_limits<double>::quiet_NaN(); ``` double proj_strtod(co...
codereview_new_cpp_data_7093
PJ_COORD proj_trans(PJ *P, PJ_DIRECTION direction, PJ_COORD coord) { coord.xyzt.t = P->coordinateEpoch; if (isnan(coord.v[0]) || isnan(coord.v[1]) || isnan(coord.v[2]) || isnan(coord.v[3])) - coord.v[0] = coord.v[1] = coord.v[2] = coord.v[3] = NAN; else if (direction == PJ_FWD) ...
codereview_new_cpp_data_7129
TEST(defaultdevicetype, scoped_profile_region) { ASSERT_TRUE(test_region_stack.empty()); - // Unnamed guard! Profile region is popped at the end of the statement. - Kokkos::Profiling::ScopedProfileRegion("bug"); - - ASSERT_TRUE(test_region_stack.empty()); - { std::string outer_identifier = "outer"; ...
codereview_new_cpp_data_7130
void initialize_host_hip_lock_arrays() { copy_hip_lock_arrays_to_device(); init_lock_array_kernel_atomic<<< (KOKKOS_IMPL_HIP_SPACE_ATOMIC_MASK + 1 + 255) / 256, 256, 0, nullptr>>>(); - HIP::impl_static_fence( - "Kokkos::Impl::initialize_host_hip_lock_arrays: Post Init Lock Arrays"); } void final...
codereview_new_cpp_data_7131
Kokkos::HIP::size_type *HIPInternal::scratch_functor_host( m_scratchFunctorHost = reinterpret_cast<size_type *>(r->data()); } - return m_scratchFunctor; } int HIPInternal::acquire_team_scratch_space() { ```suggestion return m_scratchFunctorHost; ``` Kokkos::HIP::size_type *HIPInternal::scratch_fu...