doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
09bb4eb0-5f7f-42e7-9313-4314567b6cf9
{ "language": "C++" }
```c++ /** * @file * * @brief compilation test for checking if the Botan library is available. * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) * */ #include <botan/init.h> int main (int argc, char ** argv) { Botan::LibraryInitializer::initialize (""); return 0; } ``` Fix detection ...
```c++ /** * @file * * @brief compilation test for checking if the Botan library is available. * * @copyright BSD License (see LICENSE.md or https://www.libelektra.org) * */ #include <botan/init.h> int main (void) { Botan::LibraryInitializer::initialize (""); return 0; } ```
7cda6de9-dbd0-4053-900b-5b3e244a3d49
{ "language": "C++" }
```c++ #include "json_rpc_debug_logger.h" #include <QDebug> namespace jcon { void JsonRpcDebugLogger::logInfo(const QString& message) { qDebug().noquote() << message; } void JsonRpcDebugLogger::logWarning(const QString& message) { qDebug().noquote() << message; } void JsonRpcDebugLogger::logError(const QSt...
```c++ #include "pch.h" #include "json_rpc_debug_logger.h" #include <QDebug> namespace jcon { void JsonRpcDebugLogger::logInfo(const QString& message) { qDebug().noquote() << message; } void JsonRpcDebugLogger::logWarning(const QString& message) { qDebug().noquote() << message; } void JsonRpcDebugLogger::l...
11cb55e2-5ebd-43ae-aba6-d67d6229961f
{ "language": "C++" }
```c++ // REQUIRES: x86-registered-target // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O1 -fmerge-functions -emit-llvm -o - -x c++ < %s | FileCheck %s // Basic functionality test. Function merging doesn't kick in on functions that // are too simple. struct A { virtual int f(int x, int *p) { return x ? *p : 1; } ...
```c++ // REQUIRES: x86-registered-target // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -O1 -fmerge-functions -emit-llvm -o - -x c++ < %s | FileCheck %s -implicit-check-not=_ZN1A1gEiPi // Basic functionality test. Function merging doesn't kick in on functions that // are too simple. struct A { virtual int f(int x,...
d2cf85ad-d497-44c7-8d75-9738ed82a2c0
{ "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. // //===---------------------------------...
f524121a-eaa1-4b67-b639-80811b065e67
{ "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 "SkSRGB.h" #include "SkTypes.h" #include "Test.h" #include <math.h> static uint8_t linear_to_srgb(float l) { return (uint8_t)sk_linear_to_srgb(Sk4f{l})[0]...
```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 "SkSRGB.h" #include "SkTypes.h" #include "Test.h" #include <math.h> static uint8_t linear_to_srgb(float l) { return (uint8_t)sk_linear_to_srgb(Sk4f{l})[0]...
b1d17b2e-3d41-4456-8afa-fc053175cbd1
{ "language": "C++" }
```c++ #include <iostream> #include <QApplication> #include <QPushButton> #include "src/common/Game.h" int main(int argc, char *argv[]) { std::cout << "Welcome to the client interface of Bomberman :)" << std::endl; // This part should be moved to another class, that's just for test QApplication app(argc, ...
```c++ #include <iostream> #include <QApplication> #include <QPushButton> #include "src/common/Game.h" #include "easylogging++.h" _INITIALIZE_EASYLOGGINGPP int main(int argc, char *argv[]) { std::cout << "Welcome to the client interface of Bomberman :)" << std::endl; _START_EASYLOGGINGPP(argc, argv); LO...
91c7507f-46a9-4b79-8ce7-bd2ff8a54ca4
{ "language": "C++" }
```c++ // Native C++ Libraries #include <iostream> #include <string> // C++ Interpreter Libraries #include <Console.h> using namespace std; int main() { RESTART: string input = ""; getline(cin, input); goto RESTART; } ``` Add stringstream and vector library to main source.
```c++ // Native C++ Libraries #include <iostream> #include <string> #include <sstream> #include <vector> // C++ Interpreter Libraries #include <Console.h> using namespace std; int main() { RESTART: string input = ""; getline(cin, input); goto RESTART; } ```
1610f01f-9212-4231-88f3-c03cbe5f271e
{ "language": "C++" }
```c++ /* * Copyright (C) 2018 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...
```c++ /* * Copyright (C) 2018 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...
dcb75419-a8a0-40c0-90c0-00f059957da2
{ "language": "C++" }
```c++ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ #include "catch.hpp" #include "hooks.hh" static int i; void inc_i(vick::contents&) { ++i; } TEST_CASE("hook proc", "[hook]") { vick::hook h; vick::contents c; h.add(inc_i); int li = i; ...
```c++ /* Any copyright is dedicated to the Public Domain. * http://creativecommons.org/publicdomain/zero/1.0/ */ #include "catch.hpp" #include "hooks.hh" static int i; static void inc_i(vick::contents&) { ++i; } TEST_CASE("hook proc", "[hook]") { vick::hook h; vick::contents c; h.add(inc_i); int l...
239f0eee-e7e4-42a5-808b-83b86b430f76
{ "language": "C++" }
```c++ /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "Test.h" // This is a GPU-backend specific test #if SK_SUPPORT_GPU #include "GrContextFactory.h" DEF_GPUTEST(GLInterfaceValidation, reporter, factory) { ...
```c++ /* * Copyright 2011 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #include "Test.h" // This is a GPU-backend specific test #if SK_SUPPORT_GPU #include "GrContextFactory.h" DEF_GPUTEST(GLInterfaceValidation, reporter, factory) { ...
a43336b7-3c89-4d8b-814e-45008568330a
{ "language": "C++" }
```c++ #include "bct.h" #include <cassert> #include <gsl/gsl_matrix.h> #include <gsl/gsl_vector.h> /* * Computes the clustering coefficient for a binary undirected graph. Results * are returned in a vector where each element is the clustering coefficient of * the corresponding node. */ gsl_vector* bct::clustering...
```c++ #include "bct.h" #include <cassert> #include <gsl/gsl_matrix.h> #include <gsl/gsl_vector.h> /* * Computes the clustering coefficient for a binary undirected graph. Results * are returned in a vector where each element is the clustering coefficient of * the corresponding node. */ gsl_vector* bct::clustering...
ab15f0ce-c812-4725-af5d-c58a6bd967ea
{ "language": "C++" }
```c++ #include "util/testing.h" #include <event2/thread.h> #include <gflags/gflags.h> #include <glog/logging.h> #include <gtest/gtest.h> namespace cert_trans { namespace test { void InitTesting(const char* name, int* argc, char*** argv, bool remove_flags) { // Change the defaults. Can be overridd...
```c++ #include "util/testing.h" #include <event2/thread.h> #include <gflags/gflags.h> #include <glog/logging.h> #include <gtest/gtest.h> namespace cert_trans { namespace test { void InitTesting(const char* name, int* argc, char*** argv, bool remove_flags) { ::testing::InitGoogleTest(argc, *argv);...
af6c5847-fdcf-4eaa-9e3e-f1294accdb89
{ "language": "C++" }
```c++ #include <iostream> using namespace std; long long solve(int n) { long long *res = new long long[n + 1]; switch (n) { case 1: return 1; case 2: return 2; case 3: return 3; case 4: return 6; } res[1] = 1; res[2] = 2; res[3] = 3; res[4] = 6; for (int i = 5; i <= n; ...
```c++ #include <iostream> using namespace std; long long solve_1(int n) { long long *res = new long long[n + 1]; switch (n) { case 1: return 1; case 2: return 2; case 3: return 3; case 4: return 6; } res[1] = 1; res[2] = 2; res[3] = 3; res[4] = 6; for (int i = 5; i <= n...
5bf3dfd6-c60b-4e84-81f7-85cc544bc05f
{ "language": "C++" }
```c++ #include "hash.h" #include <QClipboard> #include <QGuiApplication> #include <QQmlContext> #include <QStringList> const int password_length = 30; Hash::Hash(QQmlContext *c, QObject *parent) : QObject(parent), hash(QCryptographicHash::Sha3_224), settings("pasgen"), context(c) { context->setCo...
```c++ #include "hash.h" #include <QClipboard> #include <QGuiApplication> #include <QQmlContext> #include <QStringList> const int password_length = 30; Hash::Hash(QQmlContext *c, QObject *parent) : QObject(parent), hash(QCryptographicHash::Sha3_224), settings("pasgen"), context(c) { context->setCo...
fc66e8c4-7164-4f32-a2b7-ca4f6e1329ec
{ "language": "C++" }
```c++ #include "rapidjson/document.h" #include "rapidjson/writer.h" #include "rapidjson/stringbuffer.h" #include <iostream> #include <fstream> #include <sstream> #include <string> using namespace std; void read_file(string filename, stringstream &buffer){ ifstream f(filename.c_str()); if (f) { buffer << f....
```c++ #include "rapidjson/document.h" #include "rapidjson/filereadstream.h" #include <cstdio> #include <iostream> using namespace std; using namespace rapidjson; int main() { FILE* fp = std::fopen("./1.json", "r"); char buffer[65536]; FileReadStream frs(fp, buffer, sizeof(buffer)); Document jobj; ...
d0aa04d3-3718-42d5-b689-e6cc53a065f5
{ "language": "C++" }
```c++ #include "MainWindow.h" #include <QBoxLayout> #include <QLabel> #include <QSpinBox> #include <fiblib/Fibonacci.h> MainWindow::MainWindow() { // Create content widget QWidget * content = new QWidget(this); setCentralWidget(content); // Create layout QBoxLayout * layout = new QVBoxLayout(...
```c++ #include "MainWindow.h" #include <QBoxLayout> #include <QLabel> #include <QSpinBox> #include <fiblib/Fibonacci.h> MainWindow::MainWindow() { // Create content widget QWidget * content = new QWidget(this); setCentralWidget(content); // Create layout QBoxLayout * boxLayout = new QVBoxLayo...
016e65ca-7f07-4044-8200-d399f802702b
{ "language": "C++" }
```c++ #include <botan/botan.h> #include <botan/ecdsa.h> #include <memory> #include <iostream> using namespace Botan; int main() { try { std::auto_ptr<RandomNumberGenerator> rng( RandomNumberGenerator::make_rng()); EC_Domain_Params params = get_EC_Dom_Pars_by_oid("1.3.132.0.8"); ...
```c++ #include <botan/botan.h> #include <botan/ecdsa.h> #include <memory> #include <iostream> using namespace Botan; int main() { try { std::auto_ptr<RandomNumberGenerator> rng( RandomNumberGenerator::make_rng()); EC_Domain_Params params = get_EC_Dom_Pars_by_oid("1.3.132.0.8"); ...
3b6d83ec-bed5-474d-8168-acc86e896ea8
{ "language": "C++" }
```c++ #include "other.hpp" #include "item.hpp" using namespace LD22; Other::~Other() { } void Other::advance() { scanItems(); if (m_item) { int wx = centerx(), wy = centery(); int ix = m_item->centerx(), iy = m_item->centery(); int dx = ix - wx, dy = iy - wy; if (dx < -20) ...
```c++ #include "other.hpp" #include "item.hpp" using namespace LD22; Other::~Other() { } void Other::advance() { scanItems(); if (m_item) { int wx = centerx(), wy = centery(); int ix = m_item->centerx(), iy = m_item->centery(); int dx = ix - wx, dy = iy - wy; if (dx < -20) ...
107e2c03-b2f4-439d-9af4-e2218e29aaa2
{ "language": "C++" }
```c++ // Author: Jingyue // Hook functions are declared with extern "C", because we want to disable // the C++ name mangling and make the instrumentation easier. #include <cstdio> #include <cstdlib> extern "C" void ReportMissingAlias(unsigned VIDOfP, unsigned VIDOfQ, void *V) { fprintf(stderr, "value(%u) = value(...
```c++ // Author: Jingyue // Hook functions are declared with extern "C", because we want to disable // the C++ name mangling and make the instrumentation easier. #include <cstdio> #include <cstdlib> #define DISABLE_REPORT extern "C" void ReportMissingAlias(unsigned VIDOfP, unsigned VIDOfQ, void *V) { #ifndef DISAB...
24c42994-59db-4be1-b460-f3ec0e78d742
{ "language": "C++" }
```c++ // This example shows how to use the TCP server. It listens at given port, // receives one message and sends one message. #include <memory> #include <iostream> #include <gflags/gflags.h> #include "c24/communication/stream.h" #include "c24/communication/stream_tcp_server.h" #include "c24/communication/stream_ba...
```c++ // This example shows how to use the TCP server. It listens at given port, // receives one message and sends one message. #include <memory> #include <iostream> #include <gflags/gflags.h> #include <glog/logging.h> #include "c24/communication/stream.h" #include "c24/communication/stream_tcp_server.h" #include "c...
53a56683-8a4b-4db3-a7b5-f6713648b558
{ "language": "C++" }
```c++ #include "../../testing/testing.hpp" #include "../country.hpp" #include "../../coding/file_writer.hpp" #include "../../coding/file_reader.hpp" #include "../../base/start_mem_debug.hpp" UNIT_TEST(CountrySerialization) { string const TEST_URL = "http://someurl.com/somemap.dat"; uint64_t const TEST_SIZE = 1...
```c++ #include "../../testing/testing.hpp" #include "../country.hpp" #include "../../coding/file_writer.hpp" #include "../../coding/file_reader.hpp" #include "../../base/start_mem_debug.hpp" UNIT_TEST(CountrySerialization) { string const TEST_URL = "http://someurl.com/somemap.dat"; uint64_t const TEST_SIZE = 1...
526b5bae-4de1-4163-bf9e-f2927b39a676
{ "language": "C++" }
```c++ /* * This file is part of Maliit framework * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * * All rights reserved. * * Contact: maliit-discuss@lists.maliit.org * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public ...
```c++ /* * This file is part of Maliit framework * * * Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). * * All rights reserved. * * Contact: maliit-discuss@lists.maliit.org * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public ...
e10aaae0-e3bf-40e0-846c-e0213ce68181
{ "language": "C++" }
```c++ /** * This is free and unencumbered software released into the public domain. **/ #include "Miner.h" #include <memory> class CpuMiner : public Miner { public: ~CpuMiner() {} public: static MinerPtr createInstance() { return MinerPtr( new CpuMiner ); } }; MinerRegistration<CpuMiner> registr...
```c++ /** * This is free and unencumbered software released into the public domain. **/ #include "Miner.h" #include <memory> #include <limits> #include <cassert> class CpuMiner : public Miner { public: ~CpuMiner() {} public: static MinerPtr createInstance() { return MinerPtr( new CpuMiner ); } p...
954d152f-113d-425f-85a6-4ce942454ead
{ "language": "C++" }
```c++ /* Copyright 2007 Albert Strasheim <fullung@gmail.com> 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 applicab...
```c++ /* Copyright 2007 Albert Strasheim <fullung@gmail.com> 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 applicab...
3e88f88c-c434-4f52-9415-7d8ce5a6d19a
{ "language": "C++" }
```c++ /* RMS power gauge, based on the one in csound. -JGG */ #include "RMS.h" RMS :: RMS(double srate) : Filter(srate) { gain = 1.0; subLowFilter = new OnePole(srate); subLowFilter->setFreq(10.0); windowSize = DEFAULT_CONTROL_RATE; counter = 0; lastOutput = 0.0; outputs = inputs = NULL; ...
```c++ /* RMS power gauge, based on the one in csound. -JGG */ #include "RMS.h" RMS :: RMS(double srate) : Filter(srate) { gain = 1.0; subLowFilter = new OnePole(srate); subLowFilter->setFreq(10.0); windowSize = DEFAULT_CONTROL_RATE; counter = 0; lastOutput = 0.0; outputs = inputs = NULL; ...
b67bed4e-4f1e-407e-a967-2bbf7d3532e1
{ "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) //==============================================...
dd018603-8cb7-4e80-9ee3-d83a607a6581
{ "language": "C++" }
```c++ #include "Cursor.h" Cursor* Cursor::instance = NULL; Cursor::Cursor() : Sprite() { // Status m_show = true; // Arrangement m_anchor = Vec2<double>(0.0, 0.0); m_texture_dst = new SDL_Rect; m_texture_dst->x = -m_size.x; m_texture_dst->y = -m_size.y; m_text...
```c++ #include "Cursor.h" Cursor* Cursor::instance = NULL; Cursor::Cursor() : Sprite() { // Status m_show = true; // Arrangement m_anchor = Vec2<double>(0.0, 0.0); m_texture_dst = new SDL_Rect; m_texture_dst->x = -m_size.x; m_texture_dst->y = -m_size.y; m_text...
078bcad7-8031-4dfa-80ae-0d0635f0014f
{ "language": "C++" }
```c++ #include "vertexbuffer.hpp" #include "collisiondetection/axisalignedboundingbox.hpp" using namespace modelloader; VertexBuffer::VertexBuffer(VertexBuffer&& other) : vBO{other.vBO}, iBO{other.iBO}, nBO{other.nBO}, numIndices{other.numIndices}, extremes{other.extremes}, bounds(std::move(other.bounds)){ } Verte...
```c++ #include "vertexbuffer.hpp" #include "collisiondetection/axisalignedboundingbox.hpp" using namespace modelloader; VertexBuffer::VertexBuffer(VertexBuffer&& other) : vBO{other.vBO}, iBO{other.iBO}, nBO{other.nBO}, vao(other.vao), numIndices{other.numIndices}, extremes{other.extremes}, bounds(std::move(other.bo...
92f608c8-f61a-49e8-a8f2-54e2840a49fb
{ "language": "C++" }
```c++ //! \file CacheJsonToArticleConverter.cpp #include "CacheJsonToArticleConverter.h" #include <json/json.h> #include "WalkerException.h" #include "Article.h" ArticleCollection& CacheJsonToArticleConverter::convertToArticle(std::string json, ArticleCollection& articleCache) { Json::Reader reader; ...
```c++ //! \file CacheJsonToArticleConverter.cpp #include "CacheJsonToArticleConverter.h" #include <json/json.h> #include "WalkerException.h" #include "Article.h" ArticleCollection& CacheJsonToArticleConverter::convertToArticle(std::string json, ArticleCollection& articleCache) { Json::Reader reader; ...
f0ebffcb-3d10-4f7a-ad46-d50f115e1b23
{ "language": "C++" }
```c++ #include <ncurses.h> #include <string> int main() { /* * init term */ initscr(); cbreak(); noecho(); clear(); /* * init title */ move(5, 5); std::string title = "TERMINAL QUEST"; for (int i; i < title.size(); i++) { addch(title[i]); ad...
```c++ #include <ncurses.h> #include <string> using namespace std; void menuShow(); void menuAdd(int pos, string str); void menuDone(); int main() { /* * init term */ initscr(); cbreak(); noecho(); clear(); /* * init title */ menuShow(); refresh(); while(...
847cbf0c-d10a-41ac-b8f6-41860db40d04
{ "language": "C++" }
```c++ #include "qcalparser.h" #include "qcalevent.h" #include <QtCore/QCoreApplication> #include <QFile> #include <QString> #include <QDebug> int main(int argc, char *argv[]) { QCoreApplication a(argc, argv); QFile *file = new QFile(a.arguments().at(1)); QCalParser *parser = new QCalParser(file); for...
```c++ /* * This file is part of libqcalparser * * Copyright (C) Rohan Garg <rohan16garg@gmail.com> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the L...
0b5f9f83-0c0d-44c5-b5bd-86c40bc8faa5
{ "language": "C++" }
```c++ // Copyright (c) 2009 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/icon_loader.h" #include "base/message_loop.h" #include "base/mime_util.h" #include "base/thread.h" #include "chrome/b...
```c++ // Copyright (c) 2009 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/icon_loader.h" #include "base/message_loop.h" #include "base/mime_util.h" #include "base/thread.h" #include "chrome/b...
0b14d764-2502-438e-b199-f7799fee5c7d
{ "language": "C++" }
```c++ /* Copyright(c) 2015 - 2019 Denis Blank <denis.blank at outlook dot com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights ...
```c++ /* Copyright(c) 2015 - 2019 Denis Blank <denis.blank at outlook dot com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files(the "Software"), to deal in the Software without restriction, including without limitation the rights ...
38c015c8-cc09-4cb0-ac90-84e170c827f8
{ "language": "C++" }
```c++ #include "audiobase.h" namespace openalpp { AudioBase::AudioBase(int frequency,int refresh,int synchronous) throw (InitError) { if(!instances_) { // Open a write (output) device. This should (in theory) make it possible // to open a read (input) device later.. device_=alcOpenDevice((const ALu...
```c++ #include "audiobase.h" namespace openalpp { AudioBase::AudioBase(int frequency,int refresh,int synchronous) throw (InitError) { if(!instances_) { // Open a write (output) device. This should (in theory) make it possible // to open a read (input) device later.. device_=alcOpenDevice((/*const *...
96cb577b-3c94-484b-b720-ff1129ff7a6a
{ "language": "C++" }
```c++ #include "chainerx/python/error.h" #include "chainerx/error.h" #include "chainerx/python/common.h" namespace chainerx { namespace python { namespace python_internal { namespace py = pybind11; // standard convention void InitChainerxError(pybind11::module& m) { py::register_exception<ChainerxError>(m, "...
```c++ #include "chainerx/python/error.h" #include "chainerx/error.h" #include "chainerx/python/common.h" namespace chainerx { namespace python { namespace python_internal { namespace py = pybind11; // standard convention void InitChainerxError(pybind11::module& m) { py::register_exception<ChainerxError>(m, "...
1341ff7f-1aea-4f63-b569-ffe6835626c5
{ "language": "C++" }
```c++ #include "SkTypeface.h" // ===== Begin Chrome-specific definitions ===== uint32_t SkTypeface::UniqueID(const SkTypeface* face) { return NULL; } void SkTypeface::serialize(SkWStream* stream) const { } SkTypeface* SkTypeface::Deserialize(SkStream* stream) { return NULL; } // ===== End Chrome-specific de...
```c++ #include "SkTypeface.h" // ===== Begin Chrome-specific definitions ===== uint32_t SkTypeface::UniqueID(const SkTypeface* face) { return 0; } void SkTypeface::serialize(SkWStream* stream) const { } SkTypeface* SkTypeface::Deserialize(SkStream* stream) { return NULL; } // ===== End Chrome-specific defin...
33ef1063-f18f-4752-b38d-85c01faec297
{ "language": "C++" }
```c++ // Copyright (c) 2015 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include "atom/common/api/event_emitter_caller.h" #include "atom/common/api/locker.h" #include "atom/common/node_includes.h" namespace mate { namespace internal { v8::Local<...
```c++ // Copyright (c) 2015 GitHub, Inc. // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include "atom/common/api/event_emitter_caller.h" #include "atom/common/api/locker.h" #include "atom/common/node_includes.h" namespace mate { namespace internal { v8::Local<...
fb49aa7f-1b2a-4456-b0a4-df77947fca09
{ "language": "C++" }
```c++ /* * Copyright (C) 2012 by Glenn Hickey (hickey@soe.ucsc.edu) * * Released under the MIT license, see LICENSE.txt */ #include <cstdlib> #include <iostream> #include "halStats.h" using namespace std; using namespace hal; int main(int argc, char** argv) { CLParserPtr optionsParser = hdf5CLParserInstance()...
```c++ /* * Copyright (C) 2012 by Glenn Hickey (hickey@soe.ucsc.edu) * * Released under the MIT license, see LICENSE.txt */ #include <cstdlib> #include <iostream> #include "halStats.h" using namespace std; using namespace hal; int main(int argc, char** argv) { CLParserPtr optionsParser = hdf5CLParserInstance()...
91112367-68e5-4c95-944e-02102cf57983
{ "language": "C++" }
```c++ #include "pch.h" #include "DspBalance.h" #include "AudioRenderer.h" namespace SaneAudioRenderer { void DspBalance::Process(DspChunk& chunk) { float balance = m_renderer.GetBalance(); if (!chunk.IsEmpty() && balance != 0.0f) { assert(balance >= -1.0f && ...
```c++ #include "pch.h" #include "DspBalance.h" #include "AudioRenderer.h" namespace SaneAudioRenderer { void DspBalance::Process(DspChunk& chunk) { float balance = m_renderer.GetBalance(); if (!chunk.IsEmpty() && balance != 0.0f && chunk.GetChannelCount() == 2) { ...
217bab14-786d-447a-baad-195474b201d3
{ "language": "C++" }
```c++ #include "LevelState.h" LevelState::LevelState() { } LevelState::~LevelState() { } int LevelState::ShutDown() { int result = 1; return result; } int LevelState::Initialize(GameStateHandler * gsh, ComponentHandler* cHandler) { int result = 0; result = GameState::InitializeBase(gsh, cHandler); //Read ...
```c++ #include "LevelState.h" LevelState::LevelState() { } LevelState::~LevelState() { } int LevelState::ShutDown() { int result = 1; return result; } int LevelState::Initialize(GameStateHandler * gsh, ComponentHandler* cHandler) { int result = 0; result = GameState::InitializeBase(gsh, cHandler); //Read ...
4cff341b-da38-4809-8030-873817036495
{ "language": "C++" }
```c++ // Copyright (c) 2020-2022 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) #include <config/bitcoin-config.h> #endif #include <tinyformat.h> #include <util/syserror....
```c++ // Copyright (c) 2020-2022 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #if defined(HAVE_CONFIG_H) #include <config/bitcoin-config.h> #endif #include <tinyformat.h> #include <util/syserror....
3fe1a57e-d9d8-4111-9ec8-ff44a5ca6b79
{ "language": "C++" }
```c++ #include "listener.h" #include "log.h" #include "buffers.h" void conditionalEnqueue(QUEUE_TYPE(uint8_t)* queue, uint8_t* message, int messageSize) { if(queue_available(queue) < messageSize + 1) { debug("Dropped incoming CAN message -- send queue full for USB\r\n"); return; ...
```c++ #include "listener.h" #include "log.h" #include "buffers.h" void conditionalEnqueue(QUEUE_TYPE(uint8_t)* queue, uint8_t* message, int messageSize) { if(queue_available(queue) < messageSize + 1) { debug("Dropped incoming CAN message -- send queue full\r\n"); return; } ...
a2e9a82e-1438-4269-9ecd-aa6a4d9f9665
{ "language": "C++" }
```c++ #include <sstream> #include "backend.h" tstring CommandConsole::receiveStandardInput() { char input [1024]; std::cin >> input; return input; } void CommandConsole::processStandardOutput(const tstring& output) { std::cout << output; } ``` Fix console output to use tstring.
```c++ #include <sstream> #include "backend.h" tstring CommandConsole::receiveStandardInput() { tstring input; std::cin >> input; return input; } void CommandConsole::processStandardOutput(const tstring& output) { std::cout << output; } ```
da764e79-e3a7-478e-ad55-79e58ce78caa
{ "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 "net/base/network_change_notifier_win.h" #include <iphlpapi.h> #include <winsock2.h> #pragma comment(lib, "iphlpapi.lib") namespace...
```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 "net/base/network_change_notifier_win.h" #include <iphlpapi.h> #include <winsock2.h> #pragma comment(lib, "iphlpapi.lib") namespace...
55e7da27-fe68-4546-9bec-747df50acc85
{ "language": "C++" }
```c++ #include "accessobject.h" #include "accessclass.h" #include "util.h" #include <QSet> #include <QQmlEngine> namespace RubyQml { AccessObject::AccessObject(const SP<ForeignClass> &klass, VALUE value) : ForeignObject(klass), mValue(value) { globalMarkValues() << value; QQmlEngine::setObjectOwnersh...
```c++ #include "accessobject.h" #include "accessclass.h" #include "util.h" #include <QSet> namespace RubyQml { AccessObject::AccessObject(const SP<ForeignClass> &klass, VALUE value) : ForeignObject(klass), mValue(value) { globalMarkValues() << value; } AccessObject::~AccessObject() { globalMarkValue...
65434dc9-a6ec-4405-ac22-0219cbeafda2
{ "language": "C++" }
```c++ // RUN: %clang_cc1 -fsyntax-only -verify %s struct S { S (S); // expected-error {{copy constructor must pass its first argument by reference}} }; S f(); void g() { S a( f() ); } ``` Add test case from PR6064, which now works
```c++ // RUN: %clang_cc1 -fsyntax-only -verify %s struct S { S (S); // expected-error {{copy constructor must pass its first argument by reference}} }; S f(); void g() { S a( f() ); } namespace PR6064 { struct A { A() { } inline A(A&, int); }; A::A(A&, int = 0) { } void f() { A const ...
09801cca-73d1-4338-ad56-0ac21c3696b4
{ "language": "C++" }
```c++ // REQUIRES: asan-64-bits // Regression test: __tls_get_addr interceptor must recognize static TLS. // // RUN: %clangxx_asan -DSHARED %s -shared -o %t-so.so -fPIC // RUN: %clangxx_asan %s -ldl -pthread -o %t %t-so.so // RUN: ASAN_OPTIONS=verbosity=2 %run %t 2>&1 | FileCheck %s // CHECK: before // CHECK: __tls_g...
```c++ // REQUIRES: asan-64-bits // Regression test: __tls_get_addr interceptor must recognize static TLS. // // RUN: %clangxx_asan -DSHARED %s -shared -o %t-so.so -fPIC // RUN: %clangxx_asan %s -ldl -pthread -o %t %t-so.so // RUN: ASAN_OPTIONS=verbosity=2 %run %t 2>&1 | FileCheck %s // CHECK: before // CHECK: __tls_g...
342235be-0ed0-455f-92c4-ee129f4f64ea
{ "language": "C++" }
```c++ #include "event.h" #include "deconz.h" #include "resource.h" /*! Constructor. */ Event::Event() : m_resource(0), m_what(0), m_num(0), m_numPrev(0) { } Event::Event(const char *resource, const char *what, const QString &id, ResourceItem *item) : m_resource(resource), m_what(what), m...
```c++ #include "event.h" #include "deconz.h" #include "resource.h" /*! Constructor. */ Event::Event() : m_resource(0), m_what(0), m_num(0), m_numPrev(0) { } Event::Event(const char *resource, const char *what, const QString &id, ResourceItem *item) : m_resource(resource), m_what(what), m...
58ac0140-a36f-4422-942a-efb7160eeca5
{ "language": "C++" }
```c++ // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. // // Copyright 2015 Heiko Fink, All Rights Reserved. // // This file is subject to the terms and conditions defined in // file 'LICENSE.txt', which is part of this source code package. // // Perception Neuron (TM) is a trademark of Beijing Noitom Te...
```c++ // Copyright 1998-2015 Epic Games, Inc. All Rights Reserved. // // Copyright 2015 Heiko Fink, All Rights Reserved. // // This file is subject to the terms and conditions defined in // file 'LICENSE.txt', which is part of this source code package. // // Perception Neuron (TM) is a trademark of Beijing Noitom Te...
d475803c-6074-4c3b-8231-46f5fc842393
{ "language": "C++" }
```c++ #include <gtest/gtest.h> #include <stdlib.h> #include <time.h> #if defined (ANDROID_NDK) #include <stdio.h> #endif #if (defined(ANDROID_NDK)||defined(APPLE_IOS)) int CodecUtMain (int argc , char** argv) { #else int main (int argc, char** argv) { #endif #if (defined(ANDROID_NDK)||defined(APPLE_IOS)) char xml...
```c++ #include <gtest/gtest.h> #include <stdlib.h> #include <time.h> #include <stdio.h> #include <string.h> #if (defined(ANDROID_NDK)||defined(APPLE_IOS)) int CodecUtMain (int argc , char** argv) { #else int main (int argc, char** argv) { #endif #if (defined(ANDROID_NDK)||defined(APPLE_IOS)) char xmlPath[1024] = ...
f1b62b24-4e5b-4e7f-8ff0-5de4714d94cd
{ "language": "C++" }
```c++ #include <gtest/gtest.h> #include "../../include/Cpu.h" // The fixture for testing class Foo. class CpuTest : public Cpu, public ::testing::Test { protected: CpuTest() { } ~CpuTest() override { } void SetUp() override { } void TearDown() override { } }; TEST_F(CpuTest, pcNop) { run...
```c++ #include <gtest/gtest.h> #include "../../include/Cpu.h" // The fixture for testing class Foo. class CpuTest : public Cpu, public ::testing::Test { protected: CpuTest() { } ~CpuTest() override { } void SetUp() override { } void TearDown() override { } }; TEST_F(CpuTest, pcNop) { run...
b32db901-7592-4ea4-a2d9-68a81a761fc2
{ "language": "C++" }
```c++ #include "Halide.h" #include <stdint.h> #include <stdio.h> #include <cmath> using namespace Halide; // FIXME: Why aren't we using a unit test framework for this? // See Issue #898 void h_assert(bool condition, const char* msg) { if (!condition) { printf("FAIL: %s\n", msg); abort(); } } ...
```c++ #include "Halide.h" #include <stdint.h> #include <stdio.h> #include <cmath> using namespace Halide; // FIXME: Why aren't we using a unit test framework for this? // See Issue #898 void h_assert(bool condition, const char* msg) { if (!condition) { printf("FAIL: %s\n", msg); abort(); } } ...
2d105195-20c0-4298-a268-8dfefab1145b
{ "language": "C++" }
```c++ /* Copyright c1997-2006 Trygve Isaacson. All rights reserved. This file is part of the Code Vault version 2.5 http://www.bombaydigital.com/ */ /** @file */ #include "vwritebufferedstream.h" #include "vexception.h" VWriteBufferedStream::VWriteBufferedStream(VStream& rawStream, Vs64 initialBufferSize, Vs64 res...
```c++ /* Copyright c1997-2006 Trygve Isaacson. All rights reserved. This file is part of the Code Vault version 2.5 http://www.bombaydigital.com/ */ /** @file */ #include "vwritebufferedstream.h" #include "vexception.h" VWriteBufferedStream::VWriteBufferedStream(VStream& rawStream, Vs64 initialBufferSize, Vs64 res...
cc980c14-43c7-4174-a74a-1a6db2f5f84c
{ "language": "C++" }
```c++ #include "BezierCurve.h" BezierCurve::BezierCurve(int range, double accur, int bits) { m_range = range; m_accur = accur; m_bits = bits; } double BezierCurve::normalize(int x) { double result; int scale = ((1 << m_bits) - 1) / 255; if (m_range == 0) // PC range { result = x / (255. * scale); } els...
```c++ #include "BezierCurve.h" BezierCurve::BezierCurve(int range, double accur, int bits) { m_range = range; m_accur = accur; m_bits = bits; } double BezierCurve::normalize(int x) { double result; int scale = ((1 << m_bits) - 1) / 255; if (m_range == 0) // PC range { result = x / (255. * scale); } els...
c95731c0-1d9e-4b93-8cf1-8d1250b6f839
{ "language": "C++" }
```c++ /* Copyright 2011 Thomas McGuire <mcguire@kde.org> Copyright 2011 Alexander Potashev <aspotashev@gmail.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2...
```c++ /* Copyright 2011 Thomas McGuire <mcguire@kde.org> Copyright 2011 Alexander Potashev <aspotashev@gmail.com> This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2...
ff1a5a37-6487-4fa2-b5ce-f203729d2c89
{ "language": "C++" }
```c++ #include "stdafx.h" #include "foobar2000/SDK/foobar2000.h" #include "ServerProxy.h" DECLARE_COMPONENT_VERSION( "foo_rest", "0.1", "REST interface for foobar." ) class InitQuit : public initquit { public: virtual void on_init(); virtual void on_quit(); }; std::unique_ptr<ServerProxy> serverProxy; void Init...
```c++ #include "stdafx.h" #include "foobar2000/SDK/foobar2000.h" #include "ServerProxy.h" DECLARE_COMPONENT_VERSION( "foo_rest", "0.1", "REST interface for foobar.\nhttps://github.com/ivarboms/foo_rest" ) class InitQuit : public initquit { public: virtual void on_init(); virtual void on_quit(); }; std::unique_pt...
5c0b0b76-296c-4b46-83f2-daf9b5a1e581
{ "language": "C++" }
```c++ //===-- main.cpp ------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- main.cpp ------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
4e6e195b-283b-4d0a-af8e-7b1ac229ee1f
{ "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 "ppapi/proxy/ppapi_messages.h" #include "base/file_path.h" #include "ipc/ipc_channel_handle.h" #include "ppapi/c/dev/pp_file_info_dev...
```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 "ppapi/proxy/ppapi_messages.h" #include "base/file_path.h" #include "ipc/ipc_channel_handle.h" #include "ppapi/c/dev/pp_file_info_dev...
1cb43ec3-e7a8-4a56-9119-eb2318364fc9
{ "language": "C++" }
```c++ #include "tmfs.hh" int main(int argc, char ** argv) { if (argc < 3) { fprintf(stderr, "%s: <path> fuse-options...\n", argv[0]); return 2; } /* global structure setup */ tmfs::instance().hfs_root_ = argv[1]; --argc; for (int i = 1; i < argc; ++i) argv[i] = argv[i + 1]; /* check that...
```c++ #include "tmfs.hh" int main(int argc, char ** argv) { if (argc < 3) { fprintf(stderr, "usage: %s: <HFS+ mount> <Time Machine Mount>" " [fuse options]\n", argv[0]); return 2; } /* global structure setup */ tmfs::instance().hfs_root_ = argv[1]; --argc; for (int i = 1; i < argc; ...
985d5e36-a5ac-40ec-97b0-1e2da49d8953
{ "language": "C++" }
```c++ #include "fdsb/fabric.hpp" #include "fdsb/nid.hpp" #include "fdsb/harc.hpp" #include <unordered_map> using namespace fdsb; std::unordered_multimap<unsigned long long,Harc*> fabric; Harc &fdsb::get(const Nid &a, const Nid &b) { for (auto i : fabric.find(Nid::dual_hash(a,b))) { if ((i->tail(0) == a && i->t...
```c++ #include "fdsb/fabric.hpp" #include "fdsb/nid.hpp" #include "fdsb/harc.hpp" #include <unordered_map> using namespace fdsb; std::unordered_multimap<unsigned long long,Harc*> fabric; Harc &fdsb::get(const Nid &a, const Nid &b) { auto range = fabric.equal_range(Nid::dual_hash(a,b)); for (auto i : range) { ...
27c2a3fd-7a58-4f54-a7d2-df492f8c16b9
{ "language": "C++" }
```c++ /* BEGIN_COMMON_COPYRIGHT_HEADER * (c)LGPL2+ * * LXDE-Qt - a lightweight, Qt based, desktop toolset * http://razor-qt.org * * Copyright: 2012 Razor team * Authors: * Christian Surlykke <christian@surlykke.dk> * * This program or library is free software; you can redistribute it * and/or modify it un...
```c++ /* BEGIN_COMMON_COPYRIGHT_HEADER * (c)LGPL2+ * * LXDE-Qt - a lightweight, Qt based, desktop toolset * http://razor-qt.org * * Copyright: 2012 Razor team * Authors: * Christian Surlykke <christian@surlykke.dk> * * This program or library is free software; you can redistribute it * and/or modify it un...
4cfed1b6-9ca5-4291-b11b-b2c60822939d
{ "language": "C++" }
```c++ #include <iostream> int main(void) { std::cout << "woooot" << std::endl; }``` Make cpp test a unit test
```c++ #define BOOST_TEST_MODULE simple_test #include <boost/test/unit_test.hpp> BOOST_AUTO_TEST_CASE(simple_cpp_test) { BOOST_CHECK(true); } ```
44f2f597-c153-47b2-ab22-b67bb9d337a1
{ "language": "C++" }
```c++ // Copyright 2020 The Google Research 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 applica...
```c++ // Copyright 2020 The Google Research 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 applica...
afd5d3b4-7757-43ae-8cf1-7fabb12a616f
{ "language": "C++" }
```c++ // Copyright (c) 2018 Chris Ohk, Youngjoong Kim, SeungHyun Jeon // We are making my contributions/submissions to this project solely in our // personal capacity and are not conveying any rights to any intellectual // property of any third parties. #include <hspp/Commons/Utils.hpp> #include <hspp/Policies/IoPol...
```c++ // Copyright (c) 2018 Chris Ohk, Youngjoong Kim, SeungHyun Jeon // We are making my contributions/submissions to this project solely in our // personal capacity and are not conveying any rights to any intellectual // property of any third parties. #include <hspp/Commons/Utils.hpp> #include <hspp/Policies/IoPol...
00d12d31-f697-4f07-990a-15257e69b3ae
{ "language": "C++" }
```c++ /* * Copyright (c) 2017 Akil Darjean (adarjean@uh.edu) * Distributed under the MIT License. * See accompanying file LICENSE.md or copy at http://opensource.org/licenses/MIT */ #include "window.h" #include <string> int main(int argc, char const* argv[]) { Window window; if (argc > 1) { std:...
```c++ /* * Copyright (c) 2017 Akil Darjean (adarjean@uh.edu) * Distributed under the MIT License. * See accompanying file LICENSE.md or copy at http://opensource.org/licenses/MIT */ #include "window.h" #include <iostream> #include <string> int main(int argc, char const* argv[]) { Window window; if (argc...
c3298c8f-bfb3-47b0-80fc-a080d4f22593
{ "language": "C++" }
```c++ #include <cstdio> int main(int argc, char* argv[]) { printf("testapp reporting in!\n"); for (;;) ; return 0; }``` Change infinite loop to sleep
```c++ #include <cstdio> #include <unistd.h> int main(int argc, char* argv[]) { printf("testapp reporting in!\n"); sleep(100000000); return 0; } ```
43d816b7-b3ae-4316-b2f1-2a0bf90c5cb1
{ "language": "C++" }
```c++ #include "clang.h" #include <memory> #include <utility> #pragma warning(push, 0) #include <clang/Basic/Diagnostic.h> #include <clang/Basic/DiagnosticIDs.h> #include <clang/Basic/VirtualFileSystem.h> // Fixes "Member access into incomplete type 'clang::vfs::FileSystem'". #include <clang/Driver/Compilation.h> #inc...
```c++ #include "clang.h" #include <memory> #include <utility> #pragma warning(push, 0) #include <clang/Basic/Diagnostic.h> #include <clang/Basic/DiagnosticIDs.h> #include <clang/Basic/VirtualFileSystem.h> // Fixes "Member access into incomplete type 'clang::vfs::FileSystem'". #include <clang/Driver/Compilation.h> #inc...
6ff9ad6a-5b6e-4d0b-8555-f6663f08a931
{ "language": "C++" }
```c++ #include "cell.hpp" namespace roadagain { Cell::Cell() : color(EMPTY) { } Cell::Cell(const Point& point, CellColor color) : point(point), color(color) { } void Cell::reverse() { color_ = reversed(color_); } } // namespace roadagain``` Fix wrong member names in Cell
```c++ #include "cell.hpp" namespace roadagain { Cell::Cell() : color(EMPTY) { } Cell::Cell(const Point& point, CellColor color) : point_(point), color_(color) { } void Cell::reverse() { color_ = reversed(color_); } } // namespace roadagain```
79cc08c8-cc19-49bf-a7b7-21bd1731499f
{ "language": "C++" }
```c++ #define BOOST_TEST_MODULE VexIO #include <boost/test/unit_test.hpp> #include <boost/test/tools/output_test_stream.hpp> #include <vexcl/vector.hpp> #include <vexcl/element_index.hpp> #include "context_setup.hpp" BOOST_AUTO_TEST_CASE(stream_vector) { boost::test_tools::output_test_stream output; vex::vec...
```c++ #define BOOST_TEST_MODULE VexIO #include <boost/test/unit_test.hpp> #if BOOST_VERSION >= 107100 # include <boost/test/tools/output_test_stream.hpp> #else # include <boost/test/output_test_stream.hpp> #endif #include <vexcl/vector.hpp> #include <vexcl/element_index.hpp> #include "context_setup.hpp" BOOST_AUTO_...
39c5a9b8-af1b-4178-9e48-2cd8fa80e064
{ "language": "C++" }
```c++ #include "fdsb/fabric.hpp" #include "fdsb/nid.hpp" #include "fdsb/harc.hpp" #include <unordered_map> using namespace fdsb; std::unordered_multimap<unsigned long long,Harc*> fabric; Harc &fdsb::get(const Nid &a, const Nid &b) { auto range = fabric.equal_range(Nid::dual_hash(a,b)); for (auto i : range) { ...
```c++ #include "fdsb/fabric.hpp" #include "fdsb/nid.hpp" #include "fdsb/harc.hpp" #include <unordered_map> using namespace fdsb; std::unordered_multimap<unsigned long long,Harc*> fabric; Harc &fdsb::get(const Nid &a, const Nid &b) { auto range = fabric.equal_range(Nid::dual_hash(a,b)); for (auto i = range.first;...
260cef0d-20d1-480d-a659-8e22c3aaa9fc
{ "language": "C++" }
```c++ /** ** \file libport/string.cc ** \brief string: implements file libport/string.hh */ #include <boost/lexical_cast.hpp> #include "libport/cstring" #include "libport/detect_win32.h" namespace libport { #ifdef WIN32 # define LIBPORT_BUFFER_SIZE 1024 const char* getWinErrorMessage() { static cha...
```c++ /** ** \file libport/string.cc ** \brief string: implements file libport/string.hh */ #include <boost/lexical_cast.hpp> #include "libport/cstring" #include "libport/detect_win32.h" namespace libport { #ifdef WIN32 # define LIBPORT_BUFFER_SIZE 1024 const char* getWinErrorMessage() { static cha...
95b23b2b-ffca-4cd3-b055-b7ef2a617316
{ "language": "C++" }
```c++ /********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2008 Sean Gillies * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as publish...
```c++ /********************************************************************** * * GEOS - Geometry Engine Open Source * http://geos.osgeo.org * * Copyright (C) 2008 Sean Gillies * * This is free software; you can redistribute and/or modify it under * the terms of the GNU Lesser General Public Licence as publish...
3750d873-6b87-4211-8767-21ed72205dd0
{ "language": "C++" }
```c++ // Copyright 2017 Google Inc. // // 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 or agreed...
```c++ // Copyright 2017 Google Inc. // // 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 or agreed...
8ce5b84e-fc7a-4e13-89aa-1faf9be45c6b
{ "language": "C++" }
```c++ #include "output.h" Output output; float a = 123.0; int b = 79; unsigned int c = 24; int main() { float d = b; float e = c; output << (int) a; // CHECK: 0x0000007b output << (unsigned int) a; // CHECK: 0x0000007b output << (int) d; // CHECK: 0x0000004f } ``` Add a (commented out) incorrect convers...
```c++ #include "output.h" Output output; float a = 123.0; int b = 79; unsigned int c = 24; int main() { float d = b; float e = c; output << (int) a; // CHECK: 0x0000007b output << (unsigned int) a; // CHECK: 0x0000007b output << (int) d; // CHECK: 0x0000004f // output << (int) e; // XXX should be 0x18,...
c05afb9d-a47a-4b94-9359-280572a32ad8
{ "language": "C++" }
```c++ // Copyright © 2017 Dmitriy Khaustov // // 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 or...
```c++ // Copyright © 2017 Dmitriy Khaustov // // 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 or...
b4c46c99-24c0-43e4-be46-b0f9aeceb431
{ "language": "C++" }
```c++ #include "validate_timing_graph_constraints.hpp" #include "TimingGraph.hpp" #include "TimingConstraints.hpp" #include "tatum_error.hpp" #include "loop_detect.hpp" namespace tatum { bool validate_timing_graph_constraints(const TimingGraph& /*timing_graph*/, const TimingConstraints& /*timing_constraints*/) { ...
```c++ #include "validate_timing_graph_constraints.hpp" #include "TimingGraph.hpp" #include "TimingConstraints.hpp" #include "tatum_error.hpp" #include "loop_detect.hpp" namespace tatum { bool validate_timing_graph_constraints(const TimingGraph& timing_graph, const TimingConstraints& timing_constraints) { //Che...
ab6c0f3d-df6e-4dd0-abae-9fcffd9c5fe2
{ "language": "C++" }
```c++ // Copyright (c) 2009 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. // This is a simple allocator based on the windows heap. extern "C" { HANDLE win_heap; bool win_heap_init(bool use_lfh) { win_heap = HeapC...
```c++ // Copyright (c) 2009 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. // This is a simple allocator based on the windows heap. extern "C" { HANDLE win_heap; bool win_heap_init(bool use_lfh) { win_heap = HeapC...
8fe3efab-28b0-4270-97a7-e1e10529510c
{ "language": "C++" }
```c++ //===--- Phases.cpp - Transformations on Driver Types -------------------*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===--- Phases.cpp - Transformations on Driver Types -------------------*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
031bf456-fe27-4fcf-8c8c-488e1474b92e
{ "language": "C++" }
```c++ // Copyright (C) 2015 Elviss Strazdins // This file is part of the Ouzel engine. #include "Application.h" void ouzelMain(const std::vector<std::string>& args) { OUZEL_UNUSED(args); ouzel::Settings settings; settings.driver = ouzel::video::Renderer::Driver::METAL; settings.size = ouzel::Size2(8...
```c++ // Copyright (C) 2015 Elviss Strazdins // This file is part of the Ouzel engine. #include "Application.h" void ouzelMain(const std::vector<std::string>& args) { OUZEL_UNUSED(args); ouzel::Settings settings; //settings.driver = ouzel::video::Renderer::Driver::METAL; settings.size = ouzel::Size2...
4d37b2a7-0e9c-4923-9164-6b489c3e2182
{ "language": "C++" }
```c++ // gtest macros raise -Wsign-compare #pragma GCC diagnostic ignored "-Wsign-compare" #include <string> #include "gtest/gtest.h" #include "libparse/driver.h" #include "libparse/parser.tab.h" extern casmi_driver *global_driver; class ParserTest: public ::testing::Test { protected: virtual void SetUp() {...
```c++ // gtest macros raise -Wsign-compare #pragma GCC diagnostic ignored "-Wsign-compare" #include <string> #include "gtest/gtest.h" #include "libparse/driver.h" #include "libparse/parser.tab.h" extern casmi_driver *global_driver; class ParserTest: public ::testing::Test { protected: virtual void SetUp() {...
ac5dd4a9-e82a-4edc-952a-0d53501b13d8
{ "language": "C++" }
```c++ #include "Genes/Priority_Threshold_Gene.h" #include <memory> #include <string> #include <algorithm> #include "Utility.h" class Board; Priority_Threshold_Gene::Priority_Threshold_Gene() : threshold(0.0) { } void Priority_Threshold_Gene::reset_properties() const { properties["Threshold"] = threshold; } v...
```c++ #include "Genes/Priority_Threshold_Gene.h" #include <memory> #include <string> #include <algorithm> #include "Utility.h" class Board; Priority_Threshold_Gene::Priority_Threshold_Gene() : threshold(0.0) { } void Priority_Threshold_Gene::reset_properties() const { properties["Threshold"] = threshold; } v...
69c1db7e-2612-41e7-bac0-b67da4643ee2
{ "language": "C++" }
```c++ //===-- RegularExpression.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++ //===-- RegularExpression.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 // //===--------------------...
8bad8741-96c7-40f4-a92a-af19b46e1961
{ "language": "C++" }
```c++ #include <gtest/gtest.h> #include <fixedcube.hh> #include <side.hh> using namespace Rubik; class FixedCubeTests : public testing::Test { private: static int n; public: int generateInteger() { return n++; } Side::Data generateSideData() { Side::Data result; for(unsigned int i=0; ...
```c++ #include <gtest/gtest.h> #include <fixedcube.hh> #include <side.hh> using namespace Rubik; class FixedCubeTests : public testing::Test { private: static int n; public: CubeData data; public: FixedCubeTests() : data(top(generateSideData()). left(generateSideData()). front(g...
00fe5c8d-bf8b-4642-b7de-19f4d9766723
{ "language": "C++" }
```c++ // RUN: %clangxx -O0 %s -o %t // RUN: %env_tool_opts=strip_path_prefix=/TestCases/ %run %t 2>&1 | FileCheck %s // UNSUPPORTED: i386-apple // // Tests __sanitizer_symbolize_pc. #include <stdio.h> #include <sanitizer/common_interface_defs.h> void SymbolizeCaller() { char data[1000]; __sanitizer_symbolize_pc(__...
```c++ // RUN: %clangxx -O0 %s -o %t // RUN: %env_tool_opts=strip_path_prefix=/TestCases/ %run %t 2>&1 | FileCheck %s // REQUIRES: x86_64-target-arch // // Tests __sanitizer_symbolize_pc. #include <stdio.h> #include <sanitizer/common_interface_defs.h> void SymbolizeCaller() { char data[1000]; __sanitizer_symbolize_...
2744220c-20c8-452d-94e5-9f59d20b0130
{ "language": "C++" }
```c++ // RUN: %llvmgxx %s -S -emit-llvm -O2 -o - | grep _Unwind_Resume | wc -l | grep {\[03\]} struct One { }; struct Two { }; void handle_unexpected () { try { throw; } catch (One &) { throw Two (); } } ``` Make this test pass if llvm-g++ was built without exception handling support.
```c++ // RUN: %llvmgxx %s -S -emit-llvm -O2 -o - | grep -c {handle\\|_Unwind_Resume} | grep {\[14\]} struct One { }; struct Two { }; void handle_unexpected () { try { throw; } catch (One &) { throw Two (); } } ```
bd9f584e-e5e0-4796-8afd-af3ba246656b
{ "language": "C++" }
```c++ //===- MCAsmMacro.h - Assembly Macros ---------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===- MCAsmMacro.h - Assembly Macros ---------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
69a3b6c8-d532-4451-987b-fc0f2f173b49
{ "language": "C++" }
```c++ // RUN: %clang_cc1 %s -emit-llvm-only -verify // PR7281 class A { public: ~A(); }; class B : public A { void ice_throw(); }; void B::ice_throw() { throw *this; } ``` Make sure this test doesn't break when we disallow throwing an exception in -fno-exceptions mode.
```c++ // RUN: %clang_cc1 %s -emit-llvm -o - -fexceptions | FileCheck %s // PR7281 class A { public: ~A(); }; class B : public A { void ice_throw(); }; void B::ice_throw() { throw *this; } ```
a7648caa-deaf-4b3d-a701-ff50e3c1eb0c
{ "language": "C++" }
```c++ // complex double * int // originally found in package 'snd_7.8-1' // b.ii:7:19: error: invalid complex arithmetic operand types `double _Complex &' and `int &' // ERR-MATCH: invalid complex arithmetic operand types int main() { _Complex double a; int b; _Complex double c = a * b; } ``` Add int * comp...
```c++ // complex double * int // originally found in package 'snd_7.8-1' // b.ii:7:19: error: invalid complex arithmetic operand types `double _Complex &' and `int &' // ERR-MATCH: invalid complex arithmetic operand types int main() { _Complex double a; int b; _Complex double c = a * b; _Complex double d =...
f9f0f8a7-ea90-4f30-88fb-746cf631ed7f
{ "language": "C++" }
```c++ #include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } ``` Indent and fix include statement
```c++ #include <QApplication> #include "gui/mainwindow.h" int main(int argc, char *argv[]) { QApplication app(argc, argv); MainWindow window; window.show(); return app.exec(); } ```
104ad2d6-0fd7-421c-96d3-c3ede25a373c
{ "language": "C++" }
```c++ #include <rewrite/desugarer.hh> #include <rewrite/pattern-binder.hh> #include <rewrite/rewrite.hh> #include <rewrite/rescoper.hh> namespace rewrite { // FIXME: template-factor those two ast::rNary rewrite(ast::rConstNary nary) { Desugarer desugar; Rescoper rescope; ast::rAst res; desuga...
```c++ #include <rewrite/desugarer.hh> #include <rewrite/pattern-binder.hh> #include <rewrite/rewrite.hh> #include <rewrite/rescoper.hh> namespace rewrite { ast::rNary rewrite(ast::rConstNary nary) { return rewrite(ast::rConstExp(nary)).unsafe_cast<ast::Nary>(); } ast::rExp rewrite(ast::rConstExp nary...
826a1668-0de0-4739-869a-02ccfdf91c04
{ "language": "C++" }
```c++ #include "MessageBase.hpp" #include "MessageBaseImpl.hpp" namespace Grappa { /// Internal messaging functions namespace impl { /// @addtogroup Communication /// @{ void Grappa::impl::MessageBase::legacy_send_message_am( char * buf, size_t size, void * payload, size_t payload_size ) { G...
```c++ #include "MessageBase.hpp" #include "MessageBaseImpl.hpp" namespace Grappa { /// Internal messaging functions namespace impl { /// @addtogroup Communication /// @{ void Grappa::impl::MessageBase::legacy_send_message_am( char * buf, size_t size, void * payload, size_t payload_size ) { G...
2aeff6a3-da71-48a1-b7e5-d61cbacdacac
{ "language": "C++" }
```c++ #include "SymbolicEngine.h" SymbolicElement::SymbolicElement(std::stringstream &dst, std::stringstream &src, uint64_t id) { //this->isTainted = !TAINTED; this->source = new std::stringstream(src.str()); this->destination = new std::stringstream(dst.str()); this->expression = new std::stringstr...
```c++ #include "SymbolicEngine.h" SymbolicElement::SymbolicElement(std::stringstream &dst, std::stringstream &src, uint64_t id) { this->isTainted = false; this->source = new std::stringstream(src.str()); this->destination = new std::stringstream(dst.str()); this->expression = new std::stringstream()...
1a565537-903e-4479-a31b-6ff1165d0ba5
{ "language": "C++" }
```c++ /**************************************************************************** * Copyright (c) 2012-2019 by the DataTransferKit authors * * All rights reserved. * * * ...
```c++ /**************************************************************************** * Copyright (c) 2012-2019 by the DataTransferKit authors * * All rights reserved. * * * ...
b23b7958-0762-4539-9d3b-5691a3ce8330
{ "language": "C++" }
```c++ #include "WorkerThread.h" #include "Logger.h" #include <sstream> namespace comm { WorkerThread::WorkerThread() : tasks(folly::MPMCQueue<std::unique_ptr<taskType>>(20)) { auto job = [this]() { while (true) { std::unique_ptr<taskType> lastTask; this->tasks.blockingRead(lastTask); if (...
```c++ #include "WorkerThread.h" #include "Logger.h" #include <sstream> namespace comm { WorkerThread::WorkerThread() : tasks(folly::MPMCQueue<std::unique_ptr<taskType>>(20)) { auto job = [this]() { while (true) { std::unique_ptr<taskType> lastTask; this->tasks.blockingRead(lastTask); if (...
444f639c-a0b3-46ad-8740-a20d842dd19f
{ "language": "C++" }
```c++ #include <string> #include "runDiff.h" int main(int argc, const char * argv[]) { if (argc != 2 ) { std::cerr<<"Usage: "<<argv[0]<<" input file name"<<std::endl; return 1; } runFiles(string(argv[1])); return 0; } ``` Use std::string instead of string (error fix, compiles now)
```c++ #include <string> #include "runDiff.h" int main(int argc, const char * argv[]) { if (argc != 2 ) { std::cerr<<"Usage: "<<argv[0]<<" input file name"<<std::endl; return 1; } runFiles(std::string(argv[1])); return 0; } ```
5e104256-a6a4-4e71-b46e-9be23d14d0d4
{ "language": "C++" }
```c++ // This file is part of Parsito <http://github.com/ufal/parsito/>. // // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of // Mathematics and Physics, Charles University in Prague, Czech Republic. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. I...
```c++ // This file is part of Parsito <http://github.com/ufal/parsito/>. // // Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of // Mathematics and Physics, Charles University in Prague, Czech Republic. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. I...
1202eae7-9f00-46f1-a44e-39d5c2b60dc9
{ "language": "C++" }
```c++ #include <iostream> #include "List.h" using namespace std; using namespace List_h; void foo() { Skip_list ll; for (auto i = -50; i < 50000; ++i) { ll.push_back(i); } ll.display(); } int main() { Skip_list sl; sl.push_back(3); sl.push_back(6); sl.push_back(7); ...
```c++ #include <vector> #include <initializer_list> #include <algorithm> #include <random> #include <iostream> #include <ctime> #include "List.h" using namespace std; using namespace List_h; void foo() { Skip_list ll; for (auto i = -50; i < 50000; ++i) { ll.push_back(i); } ll.display(); } ...
23b05ac9-8148-4a89-b30b-bd224177e080
{ "language": "C++" }
```c++ #include "Animator.h" namespace hm { Animator::Animator() { } Animator::~Animator() { } void Animator::add(Animation a) { animations.push_back(a); return; } void Animator::add(AnimationQueue q) { queues.push_back(q); return; } void Animator::clearAnimations() { animations.clear()...
```c++ #include "Animator.h" namespace hm { Animator::Animator() { } Animator::~Animator() { } void Animator::add(Animation a) { animations.push_back(a); return; } void Animator::add(AnimationQueue q) { queues.push_back(q); return; } void Animator::clearAnimations() { animations.clear()...
b060ca70-b8b3-4366-bcb4-76fc41314b0b
{ "language": "C++" }
```c++ // Copyright (c) 2015-2016 William W. Fisher (at gmail dot com) // This file is distributed under the MIT License. #include "ofp/protocoliterator.h" #include "ofp/unittest.h" using namespace ofp; TEST(protocoliterator, ProtocolRangeItemCount) { UInt64 buffer; ByteRange data{&buffer, 0UL}; const size_t u...
```c++ // Copyright (c) 2015-2016 William W. Fisher (at gmail dot com) // This file is distributed under the MIT License. #include "ofp/protocoliterator.h" #include "ofp/unittest.h" using namespace ofp; TEST(protocoliterator, ProtocolRangeItemCount) { UInt64 buffer; ByteRange data{&buffer, static_cast<size_t>(0)...
2fa960b0-10be-4b77-a210-29e07e831877
{ "language": "C++" }
```c++ #include "dselrig_part.h" #include "eavesdroppermodel.h" #include <kdemacros.h> #include <kparts/genericfactory.h> #include <QLabel> #include <QTreeView> #include <QVBoxLayout> K_PLUGIN_FACTORY(DselRigPartFactory, registerPlugin<DselRigPart>();) // produce a factory K_EXPORT_PLUGIN(DselRigPartFactory("DselRi...
```c++ #include "dselrig_part.h" #include "eavesdroppermodel.h" #include <kdemacros.h> #include <kparts/genericfactory.h> #include <QLabel> #include <QTreeView> #include <QVBoxLayout> K_PLUGIN_FACTORY(DselRigPartFactory, registerPlugin<DselRigPart>();) // produce a factory K_EXPORT_PLUGIN(DselRigPartFactory("DselRi...