doc_id stringlengths 36 36 | metadata dict | input stringlengths 28 4.3k | output stringlengths 11 5.45k |
|---|---|---|---|
48858514-cf7c-4d9c-b116-fd830614534c | {
"language": "C++"
} | ```c++
//===--------------------- LLDBAssert.cpp ------------------------*- C++-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------... | ```c++
//===--------------------- LLDBAssert.cpp ------------------------*- C++-*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===--------------------... |
c4c06b26-d822-48b2-88ec-92c3e71b1a22 | {
"language": "C++"
} | ```c++
/**
* @file nmf_test.cpp
* @author Mohan Rajendran
*
* Test file for NMF class.
*/
#include <mlpack/core.hpp>
#include <mlpack/methods/nmf/nmf.hpp>
#include <boost/test/unit_test.hpp>
#include "old_boost_test_definitions.hpp"
BOOST_AUTO_TEST_SUITE(NMFTest);
using namespace std;
using namespace arma;
usin... | ```c++
/**
* @file nmf_test.cpp
* @author Mohan Rajendran
*
* Test file for NMF class.
*/
#include <mlpack/core.hpp>
#include <mlpack/methods/nmf/nmf.hpp>
#include <boost/test/unit_test.hpp>
#include "old_boost_test_definitions.hpp"
BOOST_AUTO_TEST_SUITE(NMFTest);
using namespace std;
using namespace arma;
usin... |
0ceb99dc-0fbf-471d-ab31-44b4883c3b36 | {
"language": "C++"
} | ```c++
/*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
***************************************... | ```c++
/*******************************************************
* Copyright (c) 2014, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
***************************************... |
a10f9111-4197-4c7c-bcfe-1aab5f79c47b | {
"language": "C++"
} | ```c++
#include <iostream>
#include <cstdlib>
#include <Eigen/Dense>
#include "problem.hpp"
using namespace integrator_chains;
int main()
{
Eigen::Vector2i numdim_output_bounds( 2, 2 );
Eigen::Vector2i num_integrators_bounds( 2, 2 );
Eigen::Vector4d Y_box;
Y_box << -1, 10, -2, 10;
Eigen::Vect... | ```c++
#include <iostream>
#include <cstdlib>
#include <ctime>
#include <Eigen/Dense>
#include "problem.hpp"
using namespace integrator_chains;
int main()
{
Eigen::Vector2i numdim_output_bounds( 2, 2 );
Eigen::Vector2i num_integrators_bounds( 2, 2 );
Eigen::Vector4d Y_box;
Y_box << -1, 10, -2, 10;... |
84a8b7e9-e2de-4c37-be1c-7be8a6418e25 | {
"language": "C++"
} | ```c++
#include "ToJsonWriter.h"
#include <json/json.h>
std::string ToJsonWriter::convertToJson(const Article* a)
{
Json::Value val;
Json::Value array(Json::ValueType::arrayValue);
for(auto ali = a->linkBegin(); ali != a->linkEnd(); ali++) {
std::string tit = (*ali)->getTitle();
array.ap... | ```c++
#include "ToJsonWriter.h"
#include <json/json.h>
Json::Value getArticleLinks(const Article* a)
{
Json::Value array(Json::ValueType::arrayValue);
for(auto ali = a->linkBegin(); ali != a->linkEnd(); ali++) {
std::string tit = (*ali)->getTitle();
array.append(Json::Value(tit));
}
... |
743557ba-fd13-4686-81e6-0f9c6332345d | {
"language": "C++"
} | ```c++
// Copyright (C) 2012, All Rights Reserved.
// Author: Cory Maccarrone <darkstar6262@gmail.com>
#include "client/ui/cli/cli_client.h"
#include "gflags/gflags.h"
#include "glog/logging.h"
using backup::CliMain;
int main(int argc, char* argv[]) {
google::ParseCommandLineFlags(&argc, &argv, true);
google::In... | ```c++
// Copyright (C) 2012, All Rights Reserved.
// Author: Cory Maccarrone <darkstar6262@gmail.com>
#include "client/ui/cli/cli_client.h"
#include "gflags/gflags.h"
#include "glog/logging.h"
using backup::CliMain;
int main(int argc, char* argv[]) {
google::SetUsageMessage(
"Usage: cli_client <options> <co... |
1b16b467-816a-464a-aee0-0833c8808ee6 | {
"language": "C++"
} | ```c++
#include <fstream>
#include <iostream>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <bitset>
using namespace std;
int main() {
ifstream fin("highcard.in");
ofstream fout("highcard.out");
int num_sing_cards;
fin >> num_sing_cards;
bitset<100000> cards;
for (int i = 0; i < n... | ```c++
#include <fstream>
#include <bitset>
using namespace std;
int main() {
ifstream fin("highcard.in");
ofstream fout("highcard.out");
int num_sing_cards;
fin >> num_sing_cards;
bitset<100000> cards;
for (int i = 0; i < num_sing_cards; i++) {
int card;
fin >> card;
cards[card - 1] = true;
}
int el... |
178f5e29-c302-48ee-94ed-b462378f8456 | {
"language": "C++"
} | ```c++
#include <gtest/gtest.h>
#include "distance.h"
using namespace testing;
using namespace std::literals::distance_literals;
namespace TestDistanceUnits
{
class DistanceTest : public Test
{
protected:
std::units::si::distance<long int> distance{0};
};
TEST_F(DistanceTest, Constructor_... | ```c++
#include <gtest/gtest.h>
#include "distance.h"
using namespace testing;
using namespace std::literals::distance_literals;
namespace TestDistanceUnits
{
class DistanceTest : public Test
{
protected:
std::units::si::distance<long int> distance{0};
};
TEST_F(DistanceTest, Constructor_... |
02b03e86-932c-47ce-bad1-f7a23e63d811 | {
"language": "C++"
} | ```c++
#include <iostream>
#include <string>
#include <proxc/config.hpp>
#include <proxc/context.hpp>
#include <proxc/scheduler.hpp>
#include "setup.hpp"
using Context = proxc::Context;
void printer(int x, int y)
{
SafeCout::print(x, ", ", y);
}
void test_context()
{
auto main_ctx = Context::running();... | ```c++
#include <iostream>
#include <string>
#include <proxc/config.hpp>
#include <proxc/context.hpp>
#include <proxc/scheduler.hpp>
#include "setup.hpp"
using Context = proxc::Context;
void printer(int x, int y)
{
SafeCout::print(x, ", ", y);
}
void test_context()
{
// TODO
}
int main()
{
test_con... |
6952e623-79f8-4d9c-ba00-d4e7a754c01f | {
"language": "C++"
} | ```c++
// Copyright (c) 2020 Sony Corporation. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless requi... | ```c++
// Copyright (c) 2020 Sony Corporation. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless requi... |
243f0fb6-2b89-445f-829d-c83784564457 | {
"language": "C++"
} | ```c++
#include "logging.h"
XPLogAggregator xplog_aggregator;
XPLogAggregator xplog_debug_aggregator;
thread_local XPLogger xplog(xplog_aggregator);
thread_local XPLogger xplog_debug(xplog_debug_aggregator);
XPLogAggregator::XPLogAggregator() {
XPLMCreateFlightLoop_t callback_info{
.structSize = sizeof(... | ```c++
#include "logging.h"
XPLogAggregator xplog_aggregator;
XPLogAggregator xplog_debug_aggregator;
thread_local XPLogger xplog(xplog_aggregator);
thread_local XPLogger xplog_debug(xplog_debug_aggregator);
XPLogAggregator::XPLogAggregator() {
XPLMCreateFlightLoop_t callback_info{
.structSize = sizeof(... |
59e54c55-4486-4a4e-8770-722e073e7d1c | {
"language": "C++"
} | ```c++
/*
*
* Copyright 2017 Asylo authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law o... | ```c++
/*
*
* Copyright 2017 Asylo authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law o... |
1f973b51-a1f2-4e42-b93e-68aa9bc0d049 | {
"language": "C++"
} | ```c++
#include "main.h"
#include <boost/program_options.hpp>
#include <iostream>
#include "application.h"
namespace po = boost::program_options;
using namespace simplicity;
using namespace std;
void print_version(void);
int main(int argc, char **argv)
{
po::options_description program_desc("Simplicity window ma... | ```c++
#include "main.h"
#include <boost/program_options.hpp>
#include <iostream>
#include "application.h"
namespace po = boost::program_options;
using namespace simplicity;
using namespace std;
void print_version(void);
int main(int argc, char **argv)
{
po::options_description program_desc("Simplicity window ma... |
1c34699a-7316-4d45-a65b-50c40ad9f90f | {
"language": "C++"
} | ```c++
/*
* *****************************************************************************
* Copyright 2014 Spectra Logic Corporation. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License
... | ```c++
/*
* *****************************************************************************
* Copyright 2014 Spectra Logic Corporation. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License"). You may not
* use this file except in compliance with the License. A copy of the License
... |
5cde761e-76bd-4868-bdbf-5ab16370d9f1 | {
"language": "C++"
} | ```c++
#include "RegExp.h"
namespace tinygrep {
namespace resyntax {
RegExp::RegExp() : RegExp::RegExp(RegExpEnum::kEmpty) {}
RegExp::RegExp(RegExpEnum type) : type_(type), r1_(nullptr), r2_(nullptr), literal_('\0') {}
RegExp::RegExp(RegExpEnum type, literalType literal) : RegExp::RegExp(type) {
literal_ = liter... | ```c++
#include "RegExp.h"
namespace tinygrep {
namespace resyntax {
RegExp::RegExp() : RegExp::RegExp(RegExpEnum::kEmpty) {}
RegExp::RegExp(RegExpEnum type) : type_(type), r1_(nullptr), r2_(nullptr), literal_('\0') {}
RegExp::RegExp(RegExpEnum type, literalType literal) : RegExp::RegExp(type) {
literal_ = liter... |
350bd462-007f-4980-b8e6-ec2674bb0aff | {
"language": "C++"
} | ```c++
/*
* Qumulus UML editor
* Author: Randy Thiemann
*
*/
#include "ToolBar.h"
#include <Gui/Widgets/MainWindow.h>
QUML_BEGIN_NAMESPACE_GW
#ifdef Q_OS_MAC_disabled
ToolBar::ToolBar(QObject* parent) : QObject(parent),
mToolBar(new QMacNativeToolBar()) {
}
#else
ToolBar::ToolBar(QObject* parent) : QObje... | ```c++
/*
* Qumulus UML editor
* Author: Randy Thiemann
*
*/
#include "ToolBar.h"
#include <Gui/Widgets/MainWindow.h>
QUML_BEGIN_NAMESPACE_GW
#ifdef Q_OS_MAC_disabled
ToolBar::ToolBar(QObject* parent) : QObject(parent),
mToolBar(new QMacNativeToolBar()) {
}
#else
ToolBar::ToolBar(QObject* parent) : QObje... |
352bce3f-0f7a-4ec4-814f-2dd2254ae810 | {
"language": "C++"
} | ```c++
#include "counter_application.hpp"
#include <lib-tmsp/server.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/log/trivial.hpp>
int main(int argc, char const* argv[])
{
if(argc < 3)
{
BOOST_LOG_TRIVIAL(info) << "Provide TMSP listening endpoint on command line. Example: 0.0.0.0 4665... | ```c++
#include "counter_application.hpp"
#include <lib-tmsp/server.hpp>
#include <boost/exception/diagnostic_information.hpp>
#include <boost/log/trivial.hpp>
int main(int argc, char const* argv[])
{
if(argc < 3)
{
BOOST_LOG_TRIVIAL(info) << "Provide TMSP listening endpoint on command line. Example: 0.0.0.0 4665... |
d8896dd5-ef93-40ef-b147-1a311a159edd | {
"language": "C++"
} | ```c++
/**
* \file
* \brief chip::lowLevelInitialization() implementation for STM32L4
*
* \author Copyright (C) 2017 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
*
* \par License
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL ... | ```c++
/**
* \file
* \brief chip::lowLevelInitialization() implementation for STM32L4
*
* \author Copyright (C) 2017 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
*
* \par License
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL ... |
bd071a07-b15a-4a24-b37e-7a20842b3e2d | {
"language": "C++"
} | ```c++
#include <windows.h>
#include "system/thread.hh"
using System::Thread;
DWORD WINAPI startThread(LPVOID args);
class Implementation : public Thread::ThreadImplementation
{
public:
Implementation(Thread::Callable function) : _function(function) { }
void start()
{
_threadHandle... | ```c++
#include <windows.h>
#include "system/thread.hh"
using System::Thread;
DWORD WINAPI startThread(LPVOID args);
class Implementation : public Thread::ThreadImplementation
{
public:
Implementation(Thread::Callable function) : _function(function) { }
void start()
{
_threadHandle... |
b223258a-4946-482b-a21b-05c0a0e9b7e8 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -std=c++11 -ast-dump %s | FileCheck %s
char c8[] = u8"test\0\\\"\t\a\b\234";
// CHECK: char c8[12] = (StringLiteral {{.*}} lvalue u8"test\000\\\"\t\a\b\234")
char16_t c16[] = u"test\0\\\"\t\a\b\234\u1234";
// CHECK: char16_t c16[13] = (StringLiteral {{.*}} lvalue u"test\000\\\"\t\a\b\234\u1... | ```c++
// RUN: %clang_cc1 -std=c++11 -ast-dump %s -triple x86_64-linux-gnu | FileCheck %s
char c8[] = u8"test\0\\\"\t\a\b\234";
// CHECK: char c8[12] = (StringLiteral {{.*}} lvalue u8"test\000\\\"\t\a\b\234")
char16_t c16[] = u"test\0\\\"\t\a\b\234\u1234";
// CHECK: char16_t c16[13] = (StringLiteral {{.*}} lvalue u"... |
c5b704c1-8772-47ca-a1b1-c83c47f15eeb | {
"language": "C++"
} | ```c++
// RUN: %clang -march=x86_64-apple-darwin10 -emit-llvm -g -S %s -o - | FileCheck %s
struct X {
X(int v);
int value;
};
X::X(int v) {
// CHECK: call void @_ZN1XC2Ei(%struct.X* %this1, i32 %tmp), !dbg
value = v;
}
```
Revert r110936; this fails on clang-i686-darwin10 too. | ```c++
// RUN: %clang -emit-llvm -g -S %s -o - | FileCheck %s
struct X {
X(int v);
int value;
};
X::X(int v) {
// CHECK_TEMPORARILY_DISABLED: call void @_ZN1XC2Ei(%struct.X* %this1, i32 %tmp), !dbg
// TEMPORARY CHECK: X
value = v;
}
``` |
6ea5082e-af68-43ad-a212-78daae2d5095 | {
"language": "C++"
} | ```c++
#if defined(__unix__) || defined(__APPLE__)
#include <iostream>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include "Types.h"
#include "Tools.h"
void StartBotProcess(const BotConfig &Agent, const std::string& CommandLine, void **ProcessId)
{
FILE* pipe = popen(CommandLine.c_str(), "r");
... | ```c++
#if defined(__unix__) || defined(__APPLE__)
#include <iostream>
#include <signal.h>
#include <stdio.h>
#include <unistd.h>
#include "Types.h"
#include "Tools.h"
void StartBotProcess(const BotConfig &Agent, const std::string& CommandLine, void **ProcessId)
{
FILE* pipe = popen(CommandLine.c_str(), "r");
... |
1515e692-3efe-4473-a214-4ce12be46cac | {
"language": "C++"
} | ```c++
#include "mips_memory.h"
#include "mips_instr.h"
#include <infra/instrcache/instr_cache.h>
FuncInstr MIPSMemory::fetch_instr( Addr PC)
{
const auto [found, value] = instr_cache.find( PC);
FuncInstr instr = found ? value : FuncInstr( fetch( PC), PC);
instr_cache.update( PC, instr);
return in... | ```c++
#include "mips_memory.h"
#include "mips_instr.h"
#include <infra/instrcache/instr_cache.h>
FuncInstr MIPSMemory::fetch_instr( Addr PC)
{
const auto [found, value] = instr_cache.find( PC); // NOLINT https://bugs.llvm.org/show_bug.cgi?id=36283
FuncInstr instr = found ? value : FuncInstr( fetch( PC), PC... |
98371e7e-e5c6-4e3e-a081-f83997583a43 | {
"language": "C++"
} | ```c++
#include "include/matchercreationdialog.h"
#include "ui_matchercreationdialog.h"
MatcherCreationDialog::MatcherCreationDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MatcherCreationDialog)
{
ui->setupUi(this);
}
MatcherCreationDialog::~MatcherCreationDialog()
{
delete ui;
}
int MatcherCreationDial... | ```c++
#include "include/matchercreationdialog.h"
#include "ui_matchercreationdialog.h"
#include <QSettings>
MatcherCreationDialog::MatcherCreationDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::MatcherCreationDialog)
{
ui->setupUi(this);
QSettings settings;
ui->xblocks->setValue(settings.value("xblocks")... |
a098d798-2ac8-49a6-9d91-90f6531060f8 | {
"language": "C++"
} | ```c++
#include <Halide.h>
#include "vzero.h"
#include <stdio.h>
using namespace Halide;
// RUN: rm -f vzero.stdout; ./vzero.out; llvm-dis -o vzero.stdout vzero.bc; FileCheck %s < vzero.stdout
int main(int argc, char **argv) {
Target target;
setupHexagonTarget(target);
target.set_feature(Target::HVX_64);
//CH... | ```c++
#include <Halide.h>
#include "vzero.h"
#include <stdio.h>
using namespace Halide;
// RUN: rm -f vzero.stdout; ./vzero.out; llvm-dis -o vzero.stdout vzero.bc; FileCheck %s < vzero.stdout
int main(int argc, char **argv) {
Target target;
setupHexagonTarget(target, Target::HVX_64);
//CHECK: call{{.*}}@llvm.h... |
fb9455a1-ea2a-4fba-8ee7-f51b01bb0266 | {
"language": "C++"
} | ```c++
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkFontConfigInterface.h"
#include "SkFontMgr.h"
#include "SkMutex.h"
#include "SkRefCnt.h"
SK_DECLARE_STATIC_MUTEX(gFontConfigInterfaceMutex);
static sk_sp<S... | ```c++
/*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkFontConfigInterface.h"
#include "SkFontMgr.h"
#include "SkMutex.h"
#include "SkRefCnt.h"
SK_DECLARE_STATIC_MUTEX(gFontConfigInterfaceMutex);
static SkFontC... |
3daf4740-6d3c-40b3-a1ac-4ca13fb68194 | {
"language": "C++"
} | ```c++
#include <kontsevich_graph_sum.hpp>
template <class T>
void KontsevichGraphSum<T>::reduce()
{
auto current_term = this->begin();
current_term->first *= current_term->second.sign();
current_term->second.sign(1);
while (current_term < this->end())
{
auto subsequent_term = current_term ... | ```c++
#include "kontsevich_graph_sum.hpp"
template <class T>
void KontsevichGraphSum<T>::reduce()
{
auto current_term = this->begin();
while (current_term < this->end())
{
current_term->first *= current_term->second.sign();
current_term->second.sign(1);
auto subsequent_term = curre... |
b7337c7c-4c98-418c-bfd8-3f0760d3dad7 | {
"language": "C++"
} | ```c++
// RUN: %clangxx -target x86_64-unknown-unknown -g %s -emit-llvm -S -o - | FileCheck %s
// RUN: %clangxx -target x86_64-unknown-unknown -g -fno-elide-constructors %s -emit-llvm -S -o - | FileCheck %s -check-prefix=NOELIDE
struct Foo {
Foo() = default;
Foo(Foo &&other) { x = other.x; }
int x;
};
void some_f... | ```c++
// RUN: %clangxx -target x86_64-unknown-unknown -g \
// RUN: %s -emit-llvm -S -o - | FileCheck %s
// RUN: %clangxx -target x86_64-unknown-unknown -g \
// RUN: -fno-elide-constructors %s -emit-llvm -S -o - | \
// RUN: FileCheck %s -check-prefix=NOELIDE
struct Foo {
Foo() = default;
Foo(Foo &&other) { ... |
d34db32f-9956-41ee-b257-d273d7d4c851 | {
"language": "C++"
} | ```c++
#include "singlerole.h"
#include <QVariant>
namespace qqsfpm {
/*!
\qmltype SingleRole
\inherits ProxyRole
\inqmlmodule SortFilterProxyModel
\brief Base type for the \l SortFilterProxyModel proxy roles defining a single role
SingleRole is a convenience base class for proxy roles who define... | ```c++
#include "singlerole.h"
#include <QVariant>
namespace qqsfpm {
/*!
\qmltype SingleRole
\inherits ProxyRole
\inqmlmodule SortFilterProxyModel
\brief Base type for the \l SortFilterProxyModel proxy roles defining a single role
SingleRole is a convenience base class for proxy roles who define... |
f364a34c-18fc-49b4-b7cd-ea052467be03 | {
"language": "C++"
} | ```c++
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===---------------------------------... | ```c++
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===---------------------------------... |
3943c7a8-fd5d-4795-bde1-d9ba26a45298 | {
"language": "C++"
} | ```c++
#include <evenk/synch.h>
#include <evenk/thread.h>
#include <iostream>
evenk::default_synch::lock_type lock;
evenk::default_synch::cond_var_type cond;
void
thread_routine()
{
evenk::default_synch::lock_owner_type guard(lock);
cond.notify_one(); // notify that the thread started
cond.wait(guard); // wait f... | ```c++
#include <evenk/synch.h>
#include <evenk/thread.h>
#include <iostream>
evenk::default_synch::lock_type lock;
evenk::default_synch::cond_var_type cond;
void
thread_routine()
{
evenk::default_synch::lock_owner_type guard(lock);
cond.notify_one(); // notify that the thread started
cond.wait(guard); // wait f... |
5779d5ca-5528-47bd-9465-74497cee4521 | {
"language": "C++"
} | ```c++
//
// Created by monty on 08/12/16.
//
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include "IFileLoaderDelegate.h"
#include "CPlainFileLoader.h"
namespace Knights {
CPlainFileLoader::CPlainFileLoader() {
}
CPlainFileLoader::CPlainFileLoader(std::string prefix) : mP... | ```c++
//
// Created by monty on 08/12/16.
//
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <Common.h>
#include "IFileLoaderDelegate.h"
#include "CPlainFileLoader.h"
namespace Knights {
CPlainFileLoader::CPlainFileLoader() {
}
CPlainFileLoader::CPlainFileLoader(std:... |
ae8be656-50b6-4b41-bbce-6856d28ec82c | {
"language": "C++"
} | ```c++
/*
* Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by... | ```c++
/*
* Copyright 2021 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by... |
e8648d8a-67c9-43ed-8bb3-0e267a5b736f | {
"language": "C++"
} | ```c++
#include "emptyScene.h"
void emptyScene::setup(){
// parameters.add(param);
loadCode("emptyScene/exampleCode.cpp");
}
void emptyScene::update(){
}
void emptyScene::draw(){
}
void emptyScene::drawCode(){
string codeReplaced = getCodeWithParamsReplaced();
ofDrawBitmapString(code... | ```c++
#include "emptyScene.h"
void emptyScene::setup(){
// parameters.add(param);
loadCode("emptyScene/exampleCode.cpp");
}
void emptyScene::update(){
}
void emptyScene::draw(){
drawCode();
}
void emptyScene::drawCode(){
string codeReplaced = getCodeWithParamsReplaced();
ofDrawBitmap... |
a8c03250-eb2e-436b-b1a3-c3d075feb045 | {
"language": "C++"
} | ```c++
#include <climits>
#include <cstdlib>
#include <cstring>
#include <unistd.h>
#include <iostream>
#include <algorithm>
#include <list>
#include <deque>
#include <vector>
#include <X11/keysym.h>
#include <xcb/xcb.h>
#include <xcb/xcb_atom.h>
#include <xcb/xcb_keysyms.h>
#include <xcb/damage.h>
#include <xcb/xinera... | ```c++
#include <xcb/xcb.h>
#include <X11/keysym.h>
#include "data_types.hpp"
#include "x_event_handler.hpp"
#include "x_connection.hpp"
#include "x_client.hpp"
#include "x_event_source.hpp"
#include "x_client_container.hpp"
#include "x_clients_preview.hpp"
#include "layout_t.hpp"
#include "grid.hpp"
int main(int arg... |
48934d6d-0423-4e0c-b880-4f2773bf765a | {
"language": "C++"
} | ```c++
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===---------------------------------... | ```c++
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===---------------------------------... |
241c2377-253b-45f6-99b1-fa57d1984458 | {
"language": "C++"
} | ```c++
//== AnalysisManager.cpp - Path sensitive analysis data manager ----*- C++ -*-//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... | ```c++
//== AnalysisManager.cpp - Path sensitive analysis data manager ----*- C++ -*-//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... |
161fd975-5686-490d-8cdb-bce699f7ca77 | {
"language": "C++"
} | ```c++
#include <gtest/gtest.h>
#include <graph/list_graph.hpp>
namespace {
class ListGraphTest : public ::testing::Test {
protected:
ListGraphTest() {}
virtual ~ListGraphTest() {}
virtual void SetUp() {}
virtual void TearDown() {}
};
}
TEST_F(ListGraphTest, add_vertex)
{
ListGraph<false, int> g... | ```c++
#include <gtest/gtest.h>
#include <graph/list_graph.hpp>
namespace {
class ListGraphUndirectedTest : public ::testing::Test {
protected:
ListGraph<false, int> g;
};
TEST_F(ListGraphUndirectedTest, test_add_vertex)
{
EXPECT_EQ(0, g.vertex_num());
g.add_vertex(Vertex<int>(2));
EXPECT_EQ(3, g.ver... |
59f3372e-4ce0-4d80-9bce-01b91d758ee8 | {
"language": "C++"
} | ```c++
#include <algorithm>
#include <chrono>
#include <cmath>
#include <iostream>
#include <string>
#include <sys/time.h>
#include <thread>
#include <rclcpp/rclcpp.hpp>
#include <simple_msgs/AllBuiltinTypes.h>
#include <simple_msgs/AllDynamicArrayTypes.h>
#include <simple_msgs/AllPrimitiveTypes.h>
#include <simple_m... | ```c++
#include <algorithm>
#include <chrono>
#include <cmath>
#include <iostream>
#include <string>
#include <sys/time.h>
#include <thread>
#include <rclcpp/rclcpp.hpp>
#include <simple_msgs/AllBuiltinTypes.h>
#include <simple_msgs/AllDynamicArrayTypes.h>
#include <simple_msgs/AllPrimitiveTypes.h>
#include <simple_m... |
5a30700f-94aa-4bf0-97cb-4cd6955658ac | {
"language": "C++"
} | ```c++
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===---------------------------------... | ```c++
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is dual licensed under the MIT and the University of Illinois Open
// Source Licenses. See LICENSE.TXT for details.
//
//===---------------------------------... |
29fd04e1-cdeb-4d02-8bd7-bf117710026d | {
"language": "C++"
} | ```c++
//
// ODCManager.cpp
// opendatacon_suite
//
// Created by Alan Murray on 6/06/2017.
//
//
#include <opendatacon/ODCManager.h>
namespace odc {
ODCManager::ODCManager(
uint32_t concurrencyHint,
openpal::ICryptoProvider* crypto,
std::function<void()> onThreadStart,
std::function<void(... | ```c++
//
// ODCManager.cpp
// opendatacon_suite
//
// Created by Alan Murray on 6/06/2017.
//
//
#include <opendatacon/ODCManager.h>
#include <iostream>
namespace odc {
ODCManager::ODCManager(
uint32_t concurrencyHint,
openpal::ICryptoProvider* crypto,
std::function<void()> onThreadStart,
... |
78a3957a-c84f-4ed9-86f4-32ec65069ccf | {
"language": "C++"
} | ```c++
#include <iostream>
#include "SparseReorderingFeature.h"
using namespace std;
namespace Moses
{
SparseReorderingFeature::SparseReorderingFeature(const std::string &line)
:StatefulFeatureFunction("StatefulFeatureFunction", line)
{
cerr << "Constructing a Sparse Reordering feature" << endl;
}
FFState* Spa... | ```c++
#include <iostream>
#include "moses/ChartHypothesis.h"
#include "SparseReorderingFeature.h"
using namespace std;
namespace Moses
{
SparseReorderingFeature::SparseReorderingFeature(const std::string &line)
:StatefulFeatureFunction("StatefulFeatureFunction",0, line)
{
cerr << "Constructing a Sparse Reorde... |
0c26ac6c-691e-40a3-828a-badb0c9cad20 | {
"language": "C++"
} | ```c++
//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright (C) 2012 Illya Kovalevskyy <illya.kovalevskyy@gmail.com>
//
#include "GeoSceneLi... | ```c++
//
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright (C) 2012 Illya Kovalevskyy <illya.kovalevskyy@gmail.com>
//
#include "GeoSceneLi... |
c36043d9-a6f1-4e62-ad81-3d36828d7e39 | {
"language": "C++"
} | ```c++
#include <iostream>
#include "boost/program_options.hpp"
using namespace std;
namespace po = boost::program_options;
int main(int argc, char **argv) {
// Declare the supported options.
po::options_description desc("Accepted options");
desc.add_options()
("help", "produce help message")
... | ```c++
#include <iostream>
#include "boost/program_options.hpp"
using namespace std;
namespace po = boost::program_options;
po::variables_map parse_args(int argc, char **argv) {
po::options_description desc("Accepted options");
desc.add_options()
("help", "produce help message")
("temp", "sor... |
f97f0119-f99e-4291-956a-3881ebebe942 | {
"language": "C++"
} | ```c++
#include "deviceinfo.h"
#include "log/logger.h"
#include <QCryptographicHash>
#include <QDir>
#include <fstab.h>
LOGGER(DeviceInfo);
DeviceInfo::DeviceInfo()
: d(NULL)
{
}
DeviceInfo::~DeviceInfo()
{
}
QString DeviceInfo::deviceId() const
{
if (int ret = setfsent() != 1)
{
LOG_ERROR(QString(... | ```c++
#include "deviceinfo.h"
#include "log/logger.h"
#include <QCryptographicHash>
#include <QDir>
#include <fstab.h>
LOGGER(DeviceInfo);
namespace
{
static const char* FSEntries[] = {
"/",
"/boot",
NULL
};
}
DeviceInfo::DeviceInfo()
: d(NULL)
{
}
DeviceInfo::~DeviceInfo()
{
}
QS... |
78ac5508-1d69-4cba-9949-ea2a9a167dfc | {
"language": "C++"
} | ```c++
#include <iostream>
#include "../../Parser/Tagger/converter.h"
void testConverter(string sentence);
using namespace std;
int main()
{
testConverter("This is a Bear");
testConverter("That is not a building"); /// Bug , comma in dictionary
testConverter("Who told you that?");
// testConvert... | ```c++
#include <iostream>
#include "../../Parser/Tagger/converter.h"
void testConverter(string sentence);
using namespace std;
int main()
{
testConverter("This is a Bear");
testConverter("That is not a building"); /// Bug , comma in dictionary
testConverter("Who told you that?");
testConverter... |
6a780006-fbd6-47cd-9a25-4d4f2455f35e | {
"language": "C++"
} | ```c++
#include "demo/system/precompiled.h"
#if (DEA_PLATFORM == DEA_PLATFORM_WINDOWS)
#include <windows.h>
#endif
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR pScmdline, int iCmdshow)
{
/* Just the get this to compile for now */
(void*)hInstance;
(void*)hPrevInstance;
(void*)pScmdline;
... | ```c++
#include "demo/system/precompiled.h"
#include "engine/system/system.h"
DEA_START()
#if (DEA_PLATFORM == DEA_PLATFORM_WINDOWS)
#include <windows.h>
int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE prev_instance, PSTR cmd_line, int cmd_show)
{
/* Just the get this to compile for now */
(void*)hinstance;
(vo... |
b63ed6cd-41c7-478e-ab16-dd21b55995e5 | {
"language": "C++"
} | ```c++
#include <iostream>
#include <memory>
#include <boost/interprocess/ipc/message_queue.hpp>
#include "messageQueue.h"
using namespace boost::interprocess;
int main()
{
std::unique_ptr<message_queue> mq = nullptr;
try {
mq = std::make_unique<message_queue>(open_only, mqName);
} catch (std::e... | ```c++
#include <iostream>
#include <memory>
#include <fstream>
#include <boost/interprocess/ipc/message_queue.hpp>
#include "messageQueue.h"
using namespace boost::interprocess;
int main()
{
std::unique_ptr<message_queue> mq = nullptr;
try {
mq = std::make_unique<message_queue>(open_only, mqName);
... |
1a2f4139-9b6e-4ee0-a0cf-dd8d11837ad9 | {
"language": "C++"
} | ```c++
#include <inttypes.h>
#include <stdlib.h>
#include <config/config_type_int.h>
ConfigTypeInt config_type_int;
bool
ConfigTypeInt::set(ConfigValue *cv, const std::string& vstr)
{
if (ints_.find(cv) != ints_.end())
return (false);
const char *str = vstr.c_str();
char *endp;
intmax_t imax;
imax = strtoim... | ```c++
#if !defined(__OPENNT)
#include <inttypes.h>
#endif
#include <stdlib.h>
#include <config/config_type_int.h>
ConfigTypeInt config_type_int;
bool
ConfigTypeInt::set(ConfigValue *cv, const std::string& vstr)
{
if (ints_.find(cv) != ints_.end())
return (false);
const char *str = vstr.c_str();
char *endp;
i... |
dec1352e-cc90-417d-a78e-09c0ba0178c0 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -fsyntax-only -verify %s
// Clang used to crash trying to recover while adding 'this->' before Work(x);
template <typename> struct A {
static void Work(int); // expected-note{{must qualify identifier}}
};
template <typename T> struct B : public A<T> {
template <typename T2> B(T2 x) {
... | ```c++
// RUN: %clang_cc1 -fsyntax-only -verify %s
// Clang used to crash trying to recover while adding 'this->' before Work(x);
template <typename> struct A {
static void Work(int); // expected-note{{must qualify identifier}}
};
template <typename T> struct B : public A<T> {
template <typename T2> B(T2 x) {
... |
6bd7bac2-5bf4-4397-8a98-796714386dfb | {
"language": "C++"
} | ```c++
#include "stdafx.h"
#include "myLevel.hpp"
MyLevel::MyLevel() : AnnAbstractLevel()
{
}
void MyLevel::load()
{
//For having a lighter syntax :
auto engine(AnnEngine::Instance());
//Load Sinbad:
auto Sinbad (engine->createGameObject("Sinbad.mesh"));
Sinbad->setUpPhysics(100, phyShapeType::boxShape);
//Ad... | ```c++
#include "stdafx.h"
#include "myLevel.hpp"
MyLevel::MyLevel() : AnnAbstractLevel()
{
}
void MyLevel::load()
{
//For having a lighter syntax :
auto engine(AnnEngine::Instance());
//Load Sinbad:
auto Sinbad (engine->createGameObject("Sinbad.mesh"));
Sinbad->setUpPhysics(100, phyShapeType::boxShape);
//Ad... |
82645711-ce09-4886-88d5-faf258f5825a | {
"language": "C++"
} | ```c++
#include <cuda_runtime_api.h>
#include <stdio.h>
int main(void)
{
int num_devices = 0;
cudaGetDeviceCount(&num_devices);
if(num_devices > 0)
{
cudaDeviceProp properties;
cudaGetDeviceProperties(&properties, 0);
printf("--gpu-architecture=sm_%d%d", properties.major, properties.minor);
ret... | ```c++
#include <cuda_runtime_api.h>
#include <stdio.h>
#include <stdlib.h>
void usage(const char *name)
{
printf("usage: %s [device_id]\n", name);
}
int main(int argc, char **argv)
{
int num_devices = 0;
int device_id = 0;
if(argc == 2)
{
device_id = atoi(argv[1]);
}
else if(argc > 2)
{
usage... |
25d124f0-b6a5-401a-9f56-8fcc4faf0845 | {
"language": "C++"
} | ```c++
#include <iostream>
#include "demo/demo.h"
int main()
{
using namespace demo;
// create demo
Demo demo;
// run demo
demo.startup();
demo.run();
demo.shutdown();
return 0;
}```
Remove using since it is unnecessary. | ```c++
#include <iostream>
#include "demo/demo.h"
int main()
{
// create demo
demo::Demo demo;
// run demo
demo.startup();
demo.run();
demo.shutdown();
return 0;
}``` |
4bca08eb-a477-4375-9ae9-90bcc9bc05a8 | {
"language": "C++"
} | ```c++
#include <sensormanagerinterface.h>
int main()
{
SensorManagerInterface* m_remoteSensorManager;
m_remoteSensorManager = &SensorManagerInterface::instance();
return 0;
}
```
Add a header check to the sensord configure test. | ```c++
#include <sensormanagerinterface.h>
#include <datatypes/magneticfield.h>
int main()
{
SensorManagerInterface* m_remoteSensorManager;
m_remoteSensorManager = &SensorManagerInterface::instance();
return 0;
}
``` |
1e885178-adf3-498a-918e-452d11be8e03 | {
"language": "C++"
} | ```c++
/* -*- mode:linux -*- */
/**
* \file completion_counter.cc
*
*
*
* \author Ethan Burns
* \date 2008-10-24
*/
#include <pthread.h>
#include "completion_counter.h"
#include <iostream>;
CompletionCounter::CompletionCounter(unsigned int max)
: counter(0), max(max)
{
pthread_mutex_init(&mutex, NULL);
pth... | ```c++
/* -*- mode:linux -*- */
/**
* \file completion_counter.cc
*
*
*
* \author Ethan Burns
* \date 2008-10-24
*/
#include <pthread.h>
#include "completion_counter.h"
#include <iostream>
CompletionCounter::CompletionCounter(unsigned int max)
: counter(0), max(max)
{
pthread_mutex_init(&mutex, NULL);
pthr... |
d6c9f724-fdc1-4afb-9182-ead3a7287515 | {
"language": "C++"
} | ```c++
//=======================================================================
// Copyright Baptiste Wicht 2011.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//==============================================... | ```c++
//=======================================================================
// Copyright Baptiste Wicht 2011.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//==============================================... |
6bbdfec0-6996-4249-88d0-8d7808445e07 | {
"language": "C++"
} | ```c++
#include <iostream>
#include <gtest/gtest.h>
#include <mongo/bson/bson.h>
#include <mongo/client/dbclient.h>
namespace {
// Check that we can reproduce the example from bsonspec.org
TEST(OID, gen) {
const mongo::OID anOid = mongo::OID::gen();
}
} // namespace
```
Clean up test a bit | ```c++
#include <gtest/gtest.h>
#include <mongo/bson/bson.h>
namespace {
TEST(OID, gen) {
const mongo::OID oid1 = mongo::OID::gen();
const mongo::OID oid2 = mongo::OID::gen();
EXPECT_NE(oid1, oid2);
}
} // namespace
``` |
6de2d1bd-dca9-4b4d-a154-325f1c68ab0d | {
"language": "C++"
} | ```c++
#include <QtDebug>
#include "hsqml.h"
#include "HsQMLManager.h"
#include "HsQMLEngine.h"
#include "HsQMLObject.h"
#include "HsQMLWindow.h"
HsQMLEngine::HsQMLEngine(HsQMLEngineConfig& config)
{
mEngine.rootContext()->setContextObject(config.globalObject->object());
HsQMLWindow* win = new HsQMLWindow(this);... | ```c++
#include <QtDebug>
#include "hsqml.h"
#include "HsQMLManager.h"
#include "HsQMLEngine.h"
#include "HsQMLObject.h"
#include "HsQMLWindow.h"
HsQMLEngine::HsQMLEngine(HsQMLEngineConfig& config)
{
// Obtain, re-parent, and set QML global object
QObject* globalObject = config.globalObject->object();
globalObj... |
ac8427e9-39d2-4967-82de-cfbfc0c74228 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -emit-llvm -triple=le32-unknown-nacl -o - %s | FileCheck %s
int f();
// Test that PNaCl uses the Itanium/x86 ABI in which the static
// variable's guard variable is tested via "load i8 and compare with
// zero" rather than the ARM ABI which uses "load i32 and test the
// bottom bit".
void g(... | ```c++
// RUN: %clang_cc1 -emit-llvm -triple=le32-unknown-nacl -o - %s | FileCheck %s
int f();
// Test that PNaCl uses the Itanium/x86 ABI in which the static
// variable's guard variable is tested via "load i8 and compare with
// zero" rather than the ARM ABI which uses "load i32 and test the
// bottom bit".
void g(... |
cd648eb2-e7a9-4780-8b8e-70ed238fb069 | {
"language": "C++"
} | ```c++
#include <stdlib.h>
#include <stdio.h>
#include "TexComp.h"
int main(int argc, char **argv) {
if(argc != 2) {
fprintf(stderr, "Usage: %s <imagefile>\n", argv[0]);
exit(1);
}
ImageFile file (argv[1]);
SCompressionSettings settings;
CompressedImage *ci = CompressImage(file, settings);
/... | ```c++
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "TexComp.h"
void PrintUsage() {
fprintf(stderr, "Usage: tc [-s|-t <num>] <imagefile>\n");
}
int main(int argc, char **argv) {
int fileArg = 1;
int quality = 50;
int numThreads = 1;
bool bUseSIMD = false;
bool knowArg = false... |
d3e4d244-bd69-46f9-a602-b5e6dd4740b0 | {
"language": "C++"
} | ```c++
/**
* @copyright Copyright 2018 The J-PET Framework Authors. All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may find a copy of the License in the LICENCE file.
*
* Unless required by applica... | ```c++
/**
* @copyright Copyright 2018 The J-PET Framework Authors. All rights reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may find a copy of the License in the LICENCE file.
*
* Unless required by applica... |
e6e7c093-d559-434d-ba03-3434f8b1b853 | {
"language": "C++"
} | ```c++
/* RTcmix - Copyright (C) 2000 The RTcmix Development Team
See ``AUTHORS'' for a list of contributors. See ``LICENSE'' for
the license to this software and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include <globals.h>
#include <ugens.h>
#include <iostream.h>
#include "Instrument.h"
#include "rtdefs.h"
#inc... | ```c++
/* RTcmix - Copyright (C) 2000 The RTcmix Development Team
See ``AUTHORS'' for a list of contributors. See ``LICENSE'' for
the license to this software and for a DISCLAIMER OF ALL WARRANTIES.
*/
#include <globals.h>
#include <ugens.h>
#include <iostream.h>
#include "Instrument.h"
#include "rtdefs.h"
#inc... |
ea48f4fc-a97e-416b-9180-b6c02f589705 | {
"language": "C++"
} | ```c++
// See LICENSE file for copyright and license details.
#include "ui/event/end_turn.hpp"
#include <cassert>
#include <SDL/SDL_opengl.h>
#include "core/misc.hpp"
#include "core/v2i.hpp"
#include "core/dir.hpp"
#include "core/core.hpp"
#include "core/path.hpp"
#include "ui/v2f.hpp"
#include "ui/vertex_array.hpp"
#... | ```c++
// See LICENSE file for copyright and license details.
#include "ui/event/end_turn.hpp"
#include <cassert>
#include <SDL/SDL_opengl.h>
#include "core/misc.hpp"
#include "core/v2i.hpp"
#include "core/dir.hpp"
#include "core/core.hpp"
#include "core/path.hpp"
#include "ui/v2f.hpp"
#include "ui/vertex_array.hpp"
#... |
58c314f0-4725-4228-be9d-ec115c55f0d1 | {
"language": "C++"
} | ```c++
//===- llvm/VMCore/TargetTransformInfo.cpp ----------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... | ```c++
//===- llvm/VMCore/TargetTransformInfo.cpp ----------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... |
6d040442-facc-46cd-88c4-7d3f5f3cb290 | {
"language": "C++"
} | ```c++
//===- llvm/unittest/IR/TypesTest.cpp - Type unit tests -------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... | ```c++
//===- llvm/unittest/IR/TypesTest.cpp - Type unit tests -------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===------------------------------------------------... |
518db1fc-c38f-4433-9aaa-463a54347a84 | {
"language": "C++"
} | ```c++
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/basictypes.h"
#include "base/file_path.h"
#include "build/build_config.h"
#include "chrome/test/ui/ui_test.h"
#include "net/base... | ```c++
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/basictypes.h"
#include "base/file_path.h"
#include "build/build_config.h"
#include "chrome/test/ui/ui_test.h"
#include "net/base... |
2692a4b4-dbd1-4bb1-8419-3315481b43e5 | {
"language": "C++"
} | ```c++
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/disk_cache/cache_util.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/string_util.h"
namespace dis... | ```c++
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "net/disk_cache/cache_util.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/string_util.h"
namespace dis... |
30805811-2852-4a17-8d3d-3f98ac18551c | {
"language": "C++"
} | ```c++
#include "./frustum_optimizer.h"
#include "./nodes.h"
FrustumOptimizer::FrustumOptimizer(std::shared_ptr<Nodes> nodes) : nodes(nodes)
{
}
void FrustumOptimizer::update(Eigen::Matrix4f viewMatrix)
{
float min = std::numeric_limits<float>::max();
float max = -min;
for (auto node : nodes->getNodes())
{
... | ```c++
#include "./frustum_optimizer.h"
#include <limits>
#include <algorithm>
#include "./nodes.h"
FrustumOptimizer::FrustumOptimizer(std::shared_ptr<Nodes> nodes) : nodes(nodes)
{
}
void FrustumOptimizer::update(Eigen::Matrix4f viewMatrix)
{
float min = std::numeric_limits<float>::max();
float max = -min;
for... |
8059f87d-4068-4a05-9d12-3cb8623a520f | {
"language": "C++"
} | ```c++
#include <dirent.h>
#include "../../../../runtime/types/InternalTypes.h"
void DirectoryType::__constructor__() {
auto self = Program::create<DirectoryInstance>();
auto file_path = Program::argument<TextInstance>();
self->file_path = file_path->text();
Program::push(self);
}
void DirectoryType::conten... | ```c++
#include <dirent.h>
#include "../../../../runtime/types/InternalTypes.h"
void DirectoryType::__constructor__() {
auto self = Program::create<DirectoryInstance>();
auto file_path = Program::argument<TextInstance>();
self->file_path = file_path->text();
Program::push(self);
}
void DirectoryType::conten... |
9e2c4353-8eac-4833-be99-d945f46d825c | {
"language": "C++"
} | ```c++
#if defined(WIN32) && !defined(_DEBUG)
#pragma comment(linker, "/SUBSYSTEM:WINDOWS /entry:mainCRTStartup")
#endif
#include <memory>
#include <QFileInfo>
#include <gloperate-qt/viewer/Application.h>
#include <gloperate-qt/viewer/Viewer.h>
#include <widgetzeug/dark_fusion_style.hpp>
class Application : pub... | ```c++
#if defined(WIN32) && !defined(_DEBUG)
#pragma comment(linker, "/SUBSYSTEM:WINDOWS /entry:mainCRTStartup")
#endif
#include <memory>
#include <QFileInfo>
#include <gloperate-qt/viewer/Application.h>
#include <gloperate-qt/viewer/Viewer.h>
#include <widgetzeug/dark_fusion_style.hpp>
#include "glexamples-ver... |
11d9ac95-ae65-4c7a-8953-66e28065e4cb | {
"language": "C++"
} | ```c++
#include <stdint.h>
#include <stdio.h>
#include "impl.h"
int main(int /*argc*/, const char ** /*argv*/)
{
SSE2NEON::SSE2NEONTest *test = SSE2NEON::SSE2NEONTest::create();
uint32_t passCount = 0;
uint32_t failedCount = 0;
for (uint32_t i = 0; i < SSE2NEON::IT_LAST; i++) {
SSE2NEON::Instru... | ```c++
#include <stdint.h>
#include <stdio.h>
#include "impl.h"
int main(int /*argc*/, const char ** /*argv*/)
{
SSE2NEON::SSE2NEONTest *test = SSE2NEON::SSE2NEONTest::create();
uint32_t passCount = 0;
uint32_t failedCount = 0;
for (uint32_t i = 0; i < SSE2NEON::IT_LAST; i++) {
SSE2NEON::Instru... |
b5f447d2-3c5e-4c0a-b417-91e864da5865 | {
"language": "C++"
} | ```c++
/**
** \file libport/perror.cc
** \brief perror: implements file libport/perror.hh
*/
#include <cstdio>
#include <iostream>
#include "libport/cstring"
namespace libport
{
void
perror (const char* s)
{
#ifndef WIN32
::perror(s);
#else
int errnum;
const char* errstring;
const char* col... | ```c++
/**
** \file libport/perror.cc
** \brief perror: implements file libport/perror.hh
*/
#include <cstdio>
#include <iostream>
#include "libport/windows.hh"
#include "libport/cstring"
namespace libport
{
void
perror (const char* s)
{
#ifndef WIN32
::perror(s);
#else
int errnum;
const char* ... |
5069967a-d3d8-4305-b5bc-c954d797a676 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
// Test that the line table info for Foo<T>::bar() is pointing to the
// right header file.
// CHECK: define{{.*}}bar
// CHECK-NOT: define
// CHECK: ret {{.*}}, !dbg ![[DBG:.*]]
// CHECK: ![[HPP:.*]] = metadata !{metadata !"./template.hpp",
// CHECK:![[BLOC... | ```c++
// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
// Test that the line table info for Foo<T>::bar() is pointing to the
// right header file.
// CHECK: define{{.*}}bar
// CHECK-NOT: define
// CHECK: ret {{.*}}, !dbg ![[DBG:.*]]
// CHECK-DAG: ![[HPP:.*]] = metadata !{metadata !"./template.hpp",
// CHECK-DAG... |
5ce4355d-e827-438c-889f-271d5e3475e8 | {
"language": "C++"
} | ```c++
#include "Director.hpp"
#include "detail/env.hpp"
namespace Rice {
Director::Director(Object self) {
self_ = self;
}
bool Director::callIsFromRuby(const char* methodName) const {
return (getSelf().value() == ruby_frame->self) && ( rb_id2name(ruby_frame->orig_func) != methodName );
}
void D... | ```c++
#include "Director.hpp"
#include "detail/ruby.hpp"
#ifdef RUBY_VM
/* YARV */
#include "detail/cfp.hpp"
#else
/* pre-YARV */
#include "detail/env.hpp"
#endif
namespace Rice {
Director::Director(Object self) {
self_ = self;
}
bool Director::callIsFromRuby(const char* methodName) const {
# ifdef RU... |
b33be542-fe9a-451a-9f7a-61df66d21969 | {
"language": "C++"
} | ```c++
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "config.h"
#include "webkit/glue/resource_loader_bridge.h"
#include "net/http/http_response_headers.h"
namespace webkit_glu... | ```c++
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
#include "config.h"
#include "webkit/glue/resource_loader_bridge.h"
#include "webkit/glue/webappcachecontext.h"
#include "net/http/ht... |
add98e00-1cfc-475b-be43-0b889979defe | {
"language": "C++"
} | ```c++
// Microsoft compiler does not allow main to be in a library.
// So we define one here.
#include <urbi/umain.hh>
int
main(int argc, const char* argv[])
{
return urbi::main(argc, argv);
}
```
Mark main with a default visibility. | ```c++
// Microsoft compiler does not allow main to be in a library.
// So we define one here.
#include <urbi/umain.hh>
#include <libport/detect-win32.h>
#ifndef WIN32
__attribute__((visibility("default")))
#endif
int
main(int argc, const char* argv[])
{
return urbi::main(argc, argv);
}
``` |
901a2797-fd7e-4863-b8f0-24962bfe8adc | {
"language": "C++"
} | ```c++
#include "cli.h"
#include "../definitions.h"
bool flag_set(char** begin, char** end, const std::string& long_option) {
return std::find(begin, end, long_option) != end;
}
Options get_options(int argc, char* argv[]) {
char** begin = argv;
char** end = argv + argc;
if (argc < 2) {
fatal_... | ```c++
#include "cli.h"
#include "../definitions.h"
bool flag_set(char** begin, char** end, const std::string& long_option) {
return std::find(begin, end, long_option) != end;
}
Options get_options(int argc, char* argv[]) {
char** begin = argv;
char** end = argv + argc;
if (argc < 2) {
fatal_... |
e59d97ef-1bee-48db-9f5e-0d4c6d5add27 | {
"language": "C++"
} | ```c++
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied war... | ```c++
/*===================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied war... |
72c0dabd-3a3b-46d1-8245-5998b1bfad1d | {
"language": "C++"
} | ```c++
#include <memory>
#include "film/color.h"
#include "material/bsdf.h"
#include "material/blinn_distribution.h"
#include "material/anisotropic_distribution.h"
#include "material/torrance_sparrow.h"
#include "material/lambertian.h"
#include "material/fresnel.h"
#include "material/plastic_material.h"
PlasticMateria... | ```c++
#include <memory>
#include "film/color.h"
#include "material/bsdf.h"
#include "material/blinn_distribution.h"
#include "material/torrance_sparrow.h"
#include "material/lambertian.h"
#include "material/fresnel.h"
#include "material/plastic_material.h"
PlasticMaterial::PlasticMaterial(const Texture *diffuse, cons... |
d7410744-39c5-4fbf-a10c-d97182c1b7b7 | {
"language": "C++"
} | ```c++
// RUN: not %clang_cc1 %s -fno-rtti -triple=i686-pc-win32 -emit-llvm -o /dev/null 2>&1 | FileCheck --check-prefix=CHECK32
// RUN: %clang_cc1 %s -fno-rtti -triple=x86_64-pc-win32 -emit-llvm -o - | FileCheck --check-prefix=CHECK64
namespace byval_thunk {
struct Agg {
Agg();
Agg(const Agg &);
~Agg();
int x... | ```c++
// RUN: not %clang_cc1 %s -fno-rtti -triple=i686-pc-win32 -emit-llvm -o /dev/null 2>&1 | FileCheck --check-prefix=CHECK32 %s
// RUN: %clang_cc1 %s -fno-rtti -triple=x86_64-pc-win32 -emit-llvm -o - | FileCheck --check-prefix=CHECK64 %s
namespace byval_thunk {
struct Agg {
Agg();
Agg(const Agg &);
~Agg();
... |
2a56f12b-8e5c-4112-9a4e-3be9e2b2f204 | {
"language": "C++"
} | ```c++
VectorXf v;
v.setLinSpaced(5,0.5f,1.5f).transpose();
cout << v << endl;
```
Remove confusing transpose() in setLinSpaced() docs. | ```c++
VectorXf v;
v.setLinSpaced(5,0.5f,1.5f);
cout << v << endl;
``` |
c50fbd72-09ec-400b-8723-979aa62339ac | {
"language": "C++"
} | ```c++
#include <iostream>
using namespace std;
#include <QCoreApplication>
#include <QDebug>
#include <QTest>
#include "test_canpie_timestamp.hpp"
#include "test_qcan_frame.hpp"
#include "test_qcan_socket.hpp"
int main(int argc, char *argv[])
{
int32_t slResultT;
cout << "#============================... | ```c++
#include <iostream>
using namespace std;
#include <QCoreApplication>
#include <QDebug>
#include <QTest>
#include "canpie_frame.hpp"
#include "canpie_frame_error.hpp"
#include "test_canpie_timestamp.hpp"
#include "test_qcan_frame.hpp"
#include "test_qcan_socket.hpp"
int main(int argc, char *argv[])
{
int... |
f0ac0c86-7860-4014-8267-8d7eecb74d33 | {
"language": "C++"
} | ```c++
/*
* Copyright 2018 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkRegion.h"
#include "SkSurface.h"
bool FuzzRegionDeserialize(sk_sp<SkData> bytes) {
SkRegion region;
if ... | ```c++
/*
* Copyright 2018 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkCanvas.h"
#include "SkPaint.h"
#include "SkRegion.h"
#include "SkSurface.h"
bool FuzzRegionDeserialize(sk_sp<SkData> bytes) {
SkRegion region;
if ... |
e5e493c3-5225-4dfa-89ac-f015ba4de1a7 | {
"language": "C++"
} | ```c++
#include <GL/glew.h>
#include <SDL2/SDL.h>
int main(void)
{
int flags = SDL_WINDOW_OPENGL | SDL_RENDERER_PRESENTVSYNC;
SDL_Init(SDL_INIT_EVERYTHING);
auto window = SDL_CreateWindow("title", 0, 0, 320, 240, flags);
auto context = SDL_GL_CreateContext(window);
glewInit();
glClearColor(0, 1, 0, 1);
... | ```c++
#include <GL/glew.h>
#include <SDL2/SDL.h>
int main(void)
{
int flags = SDL_WINDOW_OPENGL | SDL_RENDERER_PRESENTVSYNC;
SDL_Init(SDL_INIT_EVERYTHING);
auto window = SDL_CreateWindow("Warg", 0, 0, 320, 240, flags);
auto context = SDL_GL_CreateContext(window);
glewInit();
glClearColor(0, 1, 0, 1);
... |
0c9f7a12-8f47-4ca8-a8d6-6002cbc26d52 | {
"language": "C++"
} | ```c++
/**
* \file
* \brief lowLevelInitialization() implementation for ARMv6-M and ARMv7-M
*
* \author Copyright (C) 2015 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
*
* \par License
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of th... | ```c++
/**
* \file
* \brief lowLevelInitialization() implementation for ARMv6-M and ARMv7-M
*
* \author Copyright (C) 2015 Kamil Szczygiel http://www.distortec.com http://www.freddiechopin.info
*
* \par License
* This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of th... |
5793e86d-36e1-4e49-b72a-b3e4f8b5a652 | {
"language": "C++"
} | ```c++
#include <iostream>
#include <string>
#include <utility>
#include "pool.h"
void Pool::add_machine(const Machine& new_machine)
{
const std::string& machine_name = new_machine.get_name();
std::cout << "Adding machine to pool: " << machine_name << std::endl;
machines.insert(std::make_pair(machine_nam... | ```c++
#include <iostream>
#include <string>
#include <utility>
#include "pool.h"
void Pool::add_machine(const Machine& new_machine)
{
const std::string& machine_name = new_machine.get_name();
std::cout << "Adding machine to pool: " << machine_name << std::endl;
machines.insert(std::make_pair(machine_nam... |
9299438f-4659-4edf-868b-5eca21656c0b | {
"language": "C++"
} | ```c++
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "views/controls/menu/menu_config.h"
#include "grit/app_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/... | ```c++
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "views/controls/menu/menu_config.h"
#include "grit/app_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/... |
f86ba97e-dd8d-4cb2-b117-3151a0cb1654 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
// expected-no-diagnostics
bool PR14634(int x) {
double y = (double)x;
return !y;
}
bool PR14634_implicit(int x) {
double y = (double)x;
return y;
}
void intAsBoolAsSwitchCondition(int c) {
switch ((bool)c) {
case... | ```c++
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-store=region -verify %s
bool PR14634(int x) {
double y = (double)x;
return !y;
}
bool PR14634_implicit(int x) {
double y = (double)x;
return y;
}
void intAsBoolAsSwitchCondition(int c) {
switch ((bool)c) { // expected-warning {{switch cond... |
d04e1dfa-9223-46ac-b161-f774a257f66d | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -emit-llvm -triple=armv7-apple-darwin -std=c++11 %s -o - -O1 \
// RUN: | FileCheck %s
// RUN: %clang_cc1 -emit-llvm -triple=armv7-apple-darwin -std=c++11 %s -o - -O1 \
// RUN: -discard-value-names | FileCheck %s --check-prefix=DISCARDVALUE
extern "C" void branch();
bool test(bool pred... | ```c++
// RUN: %clang_cc1 -emit-llvm -triple=armv7-apple-darwin -std=c++11 %s -o - -O1 \
// RUN: | FileCheck %s
// RUN: %clang_cc1 -emit-llvm -triple=armv7-apple-darwin -std=c++11 %s -o - -O1 \
// RUN: -discard-value-names | FileCheck %s --check-prefix=DISCARDVALUE
extern "C" void branch();
bool test(bool pred... |
fe829fff-66ea-4df2-9eae-c49a7d862372 | {
"language": "C++"
} | ```c++
// RUN: %clang_cc1 -x c++-module-map %s -fmodule-name=a -verify
module a {
module b {
requires cplusplus11
}
}
#pragma clang module contents
// expected-error@3 {{module 'a.b' requires feature 'cplusplus11'}}
#pragma clang module begin a.b // expected-note {{entering module 'a' due to this pragma}}
int f... | ```c++
// RUN: %clang_cc1 -x c++-module-map %s -fmodule-name=a -verify -std=c++98
module a {
module b {
requires cplusplus11
}
}
#pragma clang module contents
// expected-error@3 {{module 'a.b' requires feature 'cplusplus11'}}
#pragma clang module begin a.b // expected-note {{entering module 'a' due to this pra... |
eeffb375-3986-4700-bbc7-0721307eb4da | {
"language": "C++"
} | ```c++
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "osfhandle.h"
#include <io.h>
#include "v8-profiler.h"
#include "v8-inspector.h"
namespace node {
int open_osfhandle(intptr_t osfhandle, int flags) {
return _open... | ```c++
// Copyright (c) 2016 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#include "osfhandle.h"
#include <io.h>
#include "v8-profiler.h"
#include "v8-inspector.h"
namespace node {
int open_osfhandle(intptr_t osfhandle, int flags) {
return _open... |
f1600714-1174-4cc4-ac66-e3a2044db3e6 | {
"language": "C++"
} | ```c++
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/idle_query_linux.h"
#include <X11/Xlib.h>
#include <X11/extensions/scrnsaver.h>
namespace browser {
class IdleData ... | ```c++
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/idle_query_linux.h"
#include <X11/extensions/scrnsaver.h>
#include "ui/base/x/x11_util.h"
namespace browser {
class... |
5d6e509c-16ed-4150-9731-45c05b3581e4 | {
"language": "C++"
} | ```c++
#include <QString>
#include <QtTest>
#include <execinfo.h>
#include <signal.h>
#include <unistd.h>
#include <TestRunner>
#include <QtQuickTest>
#include "example.h"
#include "asyncfuturetests.h"
#include "bugtests.h"
void handleBacktrace(int sig) {
void *array[100];
size_t size;
// get void*'s for ... | ```c++
#include <QString>
#include <QtTest>
#include <TestRunner>
#include <QtQuickTest>
#include "example.h"
#include "asyncfuturetests.h"
#include "bugtests.h"
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
#include <execinfo.h>
#include <signal.h>
#include <unistd.h>
void handleBacktrace(int sig) {
void *array[100]... |
98567efb-79b6-4ae6-86ff-cfdda829d520 | {
"language": "C++"
} | ```c++
#include <cstdio>
int f() {
int x, y[1024][1024];
scanf("%d", &x); // hidden store
scanf("%d", &y[0][0]); // hidden store
x += y[0][0]; // store 0, load 0, load 1 (WAR load 1 - store 0)
return x; // load 2 (RAW: store 0)
}
int g() {
i... | ```c++
#include <cstdio>
int f() {
int x, y[1024][1024];
scanf("%d", &x); // hidden store
scanf("%d", &y[0][0]); // hidden store
x += y[0][0]; // store 0, load 0, load 1 (WAR load 1 - store 0)
return x; // load 2 (RAW: store 0)
}
int g() {
int x, y[1024][1024];... |
2ecf7f63-80c4-475d-b857-9a0c9be6272b | {
"language": "C++"
} | ```c++
#include <rmc++.h>
void mp_send(rmc<int> *flag, rmc<int> *data) {
VEDGE(wdata, wflag);
L(wdata, *data = 42);
L(wflag, *flag = 1);
}
int mp_recv(rmc<int> *flag, int *data) {
XEDGE(rflag, rdata);
while (L(rflag, *flag) == 0)
continue;
return L(rdata, *data);
}
int cas(rmc<int> *... | ```c++
#include <rmc++.h>
void mp_send(rmc<int> *flag, rmc<int> *data) {
VEDGE(wdata, wflag);
L(wdata, *data = 42);
L(wflag, *flag = 1);
}
int mp_recv(rmc<int> *flag, int *data) {
XEDGE(rflag, rdata);
while (L(rflag, *flag) == 0)
continue;
return L(rdata, *data);
}
int cas(rmc<int> *... |
3067b3d2-7d17-4b74-9592-2a5fc54ec3b8 | {
"language": "C++"
} | ```c++
#include "AutonomousCommandGroup.h"
#include "MoveElevator.h"
#include "Move2Container.h"
#include "AdjustAngle.h"
#include "BringBurden.h"
#include "PivotCommand.h"
#include "../RobotMap.h"
AutonomousCommandGroup::AutonomousCommandGroup()
{
//AddSequential(new PivotCommand(-90));
AddSequential(new MoveElev... | ```c++
#include "AutonomousCommandGroup.h"
#include "MoveElevator.h"
#include "Move2Container.h"
#include "AdjustAngle.h"
#include "BringBurden.h"
#include "PivotCommand.h"
#include "../RobotMap.h"
AutonomousCommandGroup::AutonomousCommandGroup()
{
AddSequential(new MoveElevator(3.0,true));
AddSequential(new Move2... |
41cbabeb-81b5-45c2-8542-8968b253d352 | {
"language": "C++"
} | ```c++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE-CHROMIUM file.
#include "common/content_client.h"
#include "common/application_info.h"
#include "base/stringprintf.h"
#include "base/string_util.h"... | ```c++
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE-CHROMIUM file.
#include "common/content_client.h"
#include "common/application_info.h"
#include "base/stringprintf.h"
#include "base/string_util.h"... |
75d8afe1-1f15-439e-9d5e-3032094695c8 | {
"language": "C++"
} | ```c++
#import <node.h>
#import "nan.h"
#import "scrollbar-style-observer.h"
using namespace v8;
void ScrollbarStyleObserver::Init(Handle<Object> target) {
NanScope();
Local<FunctionTemplate> newTemplate = FunctionTemplate::New(ScrollbarStyleObserver::New);
newTemplate->SetClassName(NanSymbol("ScrollbarStyleObs... | ```c++
#include <node.h>
#include "nan.h"
#include "scrollbar-style-observer.h"
using namespace v8;
void ScrollbarStyleObserver::Init(Handle<Object> target) {
NanScope();
Local<FunctionTemplate> newTemplate = FunctionTemplate::New(ScrollbarStyleObserver::New);
newTemplate->SetClassName(NanSymbol("ScrollbarStyle... |
59339a9b-7332-4187-b71b-5b65539fb7e4 | {
"language": "C++"
} | ```c++
#include <hal/clock.hpp>
#include <hal/gpio.hpp>
//------------------------------------------------------------------------------
int main(void)
{
::gpio::GPIO pinLed = ::gpio::GPIO(1, 0);
int time;
time = 500;
while(1)
{
if (time < 10) time = 500;
pinLed.high();
clock::msleep(time);
... | ```c++
#include <hal/clock.hpp>
#include <hal/gpio.hpp>
#define LED_PORT 6
#define LED_PIN 1
//------------------------------------------------------------------------------
int main(void)
{
::gpio::GPIO pinLed = ::gpio::GPIO(LED_PORT, LED_PIN);
int time;
time = 500;
while(1)
{
if (time... |
ef15ae0c-f79b-4798-92a1-767284efebf6 | {
"language": "C++"
} | ```c++
/**
* Coverity Scan model
*
* Manage false positives by giving coverity some hints.
*
* Updates to this file must be manually submitted by an admin to:
*
* https://scan.coverity.com/projects/1222
*
*/
// When tag is 1 or 2, let coverity know that execution is halting. Those
// tags correspond to INT_... | ```c++
/**
* Coverity Scan model
*
* Manage false positives by giving coverity some hints.
*
* Updates to this file must be manually submitted by an admin to:
*
* https://scan.coverity.com/projects/1222
*
*/
// When tag is 1 or 2, let coverity know that execution is halting. Those
// tags correspond to INT_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.