doc_id
stringlengths
36
36
metadata
dict
input
stringlengths
28
4.3k
output
stringlengths
11
5.45k
8871bfe1-7792-42ca-a6fb-2bec60c51e98
{ "language": "C++" }
```c++ #include <stdint.h> #include "receiver.h" Receiver::Receiver( uint8_t spiClockPin, uint8_t spiDataPin, uint8_t spiSelectPin ) { this->driver.init(spiClockPin, spiDataPin, spiSelectPin); } void Receiver::setFrequency(uint16_t frequency) { uint16_t flO = (frequency - 479) / 2; uint16_t ...
```c++ #include <stdint.h> #include "receiver.h" Receiver::Receiver( uint8_t spiClockPin, uint8_t spiDataPin, uint8_t spiSelectPin ) { this->driver.init(spiClockPin, spiDataPin, spiSelectPin); } void Receiver::setFrequency(uint16_t frequency) { uint16_t fLo = (frequency - 479) / 2; uint16_t ...
614029e1-f19b-4ec0-99f2-3b20b5a5e17e
{ "language": "C++" }
```c++ // Copyright 2015 Alessio Sclocco <a.sclocco@vu.nl> // // 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 applic...
```c++ // Copyright 2015 Alessio Sclocco <a.sclocco@vu.nl> // // 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 applic...
765aefeb-b841-46fa-a766-c153559f325a
{ "language": "C++" }
```c++ // REQUIRES: x86-registered-target,x86-64-registered-target // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s // RUN: FileCheck -check-prefix CHECK-LP64 --input-file=%t-64.s %s // RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s // RUN: FileCheck -check-prefix CHECK-...
```c++ // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm %s -o - | \ // RUN: FileCheck %s // RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -emit-llvm %s -o - | \ // RUN: FileCheck %s struct A { A(const A&, int i1 = 1); }; struct B : A { }; A f(const B &b) { return b; } // CHECK: call voi...
f42a50f9-1b3f-4576-af34-a55047e7cc5b
{ "language": "C++" }
```c++ // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- // -- BEGIN LICENSE BLOCK ---------------------------------------------- // -- END LICENSE BLOCK ------------------------------------------------ //---------------------------------------------------------------------- /*!\file * * \...
```c++ // this is for emacs file handling -*- mode: c++; indent-tabs-mode: nil -*- // -- BEGIN LICENSE BLOCK ---------------------------------------------- // -- END LICENSE BLOCK ------------------------------------------------ //---------------------------------------------------------------------- /*!\file * * \...
9a242cb2-8bc5-4f26-8ede-956a42c72395
{ "language": "C++" }
```c++ //===-- asan_test_main.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- asan_test_main.cc -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
edce0ed9-f8c6-400a-a509-8c7ac4108aa5
{ "language": "C++" }
```c++ // Copyright 2018-2020 Intel Corporation // SPDX-License-Identifier: Apache-2.0 #include "GLFWOSPRayWindow.h" #include "example_common.h" using namespace ospray; using rkcommon::make_unique; int main(int argc, const char *argv[]) { bool denoiser = ospLoadModule("denoiser") == OSP_NO_ERROR; initializeOSPR...
```c++ // Copyright 2018-2020 Intel Corporation // SPDX-License-Identifier: Apache-2.0 #include "GLFWOSPRayWindow.h" #include "example_common.h" using namespace ospray; using rkcommon::make_unique; int main(int argc, const char *argv[]) { initializeOSPRay(argc, argv); bool denoiser = ospLoadModule("denoiser") =...
d6f7932e-d106-4a55-b500-0be1ed862dec
{ "language": "C++" }
```c++ // Copyright (c) 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 "PluginData.h" #include "PluginInfoStore.h" #undef LOG #include "webkit/glue/glue_util.h" #include "webkit/glue...
```c++ // Copyright (c) 2008, Google Inc. // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list o...
84808406-fa45-48de-8f25-8df90cd405c4
{ "language": "C++" }
```c++ #include <gtest/gtest.h> #include "photoeffects.hpp" using namespace cv; TEST(photoeffects, SepiaFakeTest) { Mat src(10, 10, CV_8UC1), dst; EXPECT_EQ(0, sepia(src, dst)); } TEST(photoeffects, SepiaFailTest) { Mat src(10, 10, CV_8UC3), dst; EXPECT_EQ(1, sepia(src, dst)); } /* TEST(photoeffe...
```c++ #include <gtest/gtest.h> #include "photoeffects.hpp" using namespace cv; TEST(photoeffects, SepiaFakeTest) { Mat src(10, 10, CV_8UC1), dst; EXPECT_EQ(0, sepia(src, dst)); } TEST(photoeffects, SepiaFailTest) { Mat src(10, 10, CV_8UC3), dst; EXPECT_EQ(1, sepia(src, dst)); } TEST(photoeffects...
380a2035-1a44-448d-a658-f1ace4282b32
{ "language": "C++" }
```c++ /** * Test suite for the iterator_concepts_ordering.hpp header. */ #include <duck/detail/iterator_concepts_ordering.hpp> #include <boost/mpl/assert.hpp> BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::BidirectionalIterator, duck::RandomAccessIterator>)); BOOST_...
```c++ /** * Test suite for the iterator_concepts_ordering.hpp header. */ #include <duck/detail/iterator_concepts_ordering.hpp> #include <boost/mpl/assert.hpp> BOOST_MPL_ASSERT((duck::is_more_specific_than< duck::BidirectionalIterator, duck::RandomAccessIterator>)); BOOST_...
ca1f01b5-16d8-4fd8-b29a-4721a277a6fb
{ "language": "C++" }
```c++ #include <vector> #include <iostream> #include <algorithm> #ifndef REMOVE_VALUES #ifndef CHECK_VALUES #error "define one of REMOVE_VALUES or CHECK_VALUES" #endif #endif #ifdef REMOVE_VALUES #ifdef CHECK_VALUES #error "define either REMOVE_VALUES or CHECK_VALUES" #endif...
```c++ #include <vector> #include <iostream> #include <algorithm> #ifndef REMOVE_VALUES #ifndef CHECK_VALUES #error "define one of REMOVE_VALUES or CHECK_VALUES" #endif #endif #ifdef REMOVE_VALUES #ifdef CHECK_VALUES #error "define either REMOVE_VALUES or CHECK_VALUES" #endif...
dc40d876-2bf8-470c-b70e-73c73a898731
{ "language": "C++" }
```c++ // Copyright 2004-present Facebook. All Rights Reserved. #include <stdio.h> #include <string.h> #include "osquery/database.h" namespace osquery { namespace tables { QueryData genArp() { Row r; QueryData results; FILE *arp_cmd_output; char *line; size_t length; char ip[32]; char arp[64]; char...
```c++ // Copyright 2004-present Facebook. All Rights Reserved. #include <stdio.h> #include <string.h> #include "osquery/database.h" namespace osquery { namespace tables { QueryData genArp() { Row r; QueryData results; FILE *arp_cmd_output; char *line = NULL; size_t length; int ret; char ip[32]; ch...
0a41cc3f-6996-44f0-a3ab-c1aa600dcc4c
{ "language": "C++" }
```c++ #include <proton/default_container.hpp> #include <proton/messaging_handler.hpp> #include <string> class ExampleHandler: public proton::messaging_handler { std::string url_; // The container has started void on_container_start(proton::container&) override { } // A message can be sent ...
```c++ #include <proton/default_container.hpp> #include <proton/messaging_handler.hpp> #include <string> class ExampleHandler: public proton::messaging_handler { std::string url_; // The container has started void on_container_start(proton::container& c) override { } // A message can be sent...
6bab5b90-5f4e-43c8-ab8c-5e07660fbbe1
{ "language": "C++" }
```c++ // Copyright (c) 2006-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 "views/focus/focus_manager.h" #include "base/logging.h" namespace views { void FocusManager::ClearNativeFocus() { NOTIMPLEME...
```c++ // Copyright (c) 2006-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 "views/focus/focus_manager.h" #include "base/logging.h" namespace views { void FocusManager::ClearNativeFocus() { NOTIMPLEME...
6b1d8fb5-58bc-4e09-82c2-6c29751f6a17
{ "language": "C++" }
```c++ #include "TestCommon.h" USING_NAMESPACE_KAI struct TestString : TestCommon { protected: void AddrequiredClasses() override { Reg().AddClass<bool>(); Reg().AddClass<int>(); Reg().AddClass<String>(); } }; TEST_F(TestString, TestBoolean) { Pointer<String> s0 = Reg().New<St...
```c++ #include "TestCommon.h" USING_NAMESPACE_KAI struct TestString : TestCommon { protected: void AddrequiredClasses() override { Reg().AddClass<bool>(); Reg().AddClass<int>(); Reg().AddClass<String>(); } }; TEST_F(TestString, TestCompare) { Pointer<String> s0 = Reg().New<St...
9c864964-5c1e-463c-95d3-bb27bb018342
{ "language": "C++" }
```c++ #include <QApplication> #include "mainwindow.h" int main(int argc, char *argv[]) { QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); } ``` Set org name and app name
```c++ #include <QApplication> #include "mainwindow.h" const QString APP_ORGNAME = "PepperNote"; const QString APP_APPNAME = "PepperNote"; int main(int argc, char *argv[]) { QCoreApplication::setOrganizationName(APP_ORGNAME); QCoreApplication::setApplicationName(APP_APPNAME); QApplication a(argc, argv); ...
1c88bb29-6056-411c-9304-ea85e9ab185c
{ "language": "C++" }
```c++ /* * Copyright 2015 - 2017 gtalent2@gmail.com * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <map> #include <ox/std/std.hpp> using namespace...
```c++ /* * Copyright 2015 - 2017 gtalent2@gmail.com * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include <map> #include <string> #include <ox/std/std.hpp...
733c5359-9d04-4530-9a38-124a45ff6b8a
{ "language": "C++" }
```c++ // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include <errno.h> #include "bin/utils.h" OSError::OSError() { set_code(errno); SetMessage...
```c++ // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. #include <errno.h> #include "bin/utils.h" OSError::OSError() : code_(0), message_(NULL) { se...
5eaae801-c40d-4eeb-9ea1-27fc34d4f124
{ "language": "C++" }
```c++ #include <cstdlib> #include <stdio.h> #include <string.h> #include <set> #include <string> #include <assert.h> using namespace std; set<string> done; void dump_header(string header) { if (done.find(header) != done.end()) return; done.insert(header); FILE *f = fopen(header.c_str(), "r"); if (...
```c++ #include <cstdlib> #include <stdio.h> #include <string.h> #include <set> #include <string> #include <assert.h> std::set<std::string> done; void dump_header(std::string header) { if (done.find(header) != done.end()) return; done.insert(header); FILE *f = fopen(header.c_str(), "r"); if (f == NU...
7fd3faf3-1828-415e-9f4d-b9c7fdaf5cf5
{ "language": "C++" }
```c++ #include "channel.h" #include "timing/timingfactory.h" class Channel::Private { public: Private() : id(0) { } int id; QString target; QString certificate; TimingPtr timing; }; Channel::Channel() : d(new Private) { } Channel::Channel(const int &id, const QString &target, const ...
```c++ #include "channel.h" #include "timing/timingfactory.h" class Channel::Private { public: Private() : id(0) { } int id; QString target; QString certificate; TimingPtr timing; }; Channel::Channel() : d(new Private) { } Channel::Channel(const int &id, const QString &target, const ...
78433626-c2ed-447f-a63f-41a5838a7d33
{ "language": "C++" }
```c++ #include <jni.h> #include "Device.h" namespace crown { //----------------------------------------------------------------------------- extern "C" JNIEXPORT void JNICALL Java_crown_android_CrownLib_init(JNIEnv* env, jobject obj) { device()->init(0, NULL); } //--------------------------------------------------...
```c++ #include <jni.h> #include "Device.h" namespace crown { //----------------------------------------------------------------------------- extern "C" JNIEXPORT void JNICALL Java_crown_android_CrownLib_init(JNIEnv* env, jobject obj) { const char* argv[] = { "crown-android", "--root-path", "", "--dev" }; device()...
a04f4d67-538a-42f4-8d67-78a5872e4956
{ "language": "C++" }
```c++ // Copyright (c) 2017 Pierre Fourgeaud // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include "rendersystems/GL/indexbufferGL.h" #include <glad/glad.h> namespace CodeHero { IndexBufferGL::IndexBufferGL() { glGenBuffers(1, &_GetGPUObjectHandle()->intHan...
```c++ // Copyright (c) 2017 Pierre Fourgeaud // Use of this source code is governed by the MIT license that can be // found in the LICENSE file. #include "rendersystems/GL/indexbufferGL.h" #include <glad/glad.h> namespace CodeHero { IndexBufferGL::IndexBufferGL() { glGenBuffers(1, &_GetGPUObjectHandle()->intHan...
e41e771f-5e40-47c5-a8ec-e0b05fbadf35
{ "language": "C++" }
```c++ int main(int argc, char* argv[]) { }``` Add basic command line flag handling using cppassist/cmdline
```c++ #include <iostream> #include <string> #include <cppassist/cmdline/ArgumentParser.h> int main(int argc, char* argv[]) { cppassist::ArgumentParser argParser; argParser.parse(argc, argv); auto inFileName = argParser.value("--input"); auto outFileName = argParser.value("--output"); auto outFileType = ...
6097c6d2-e6ec-408d-ac64-f988dd945cc6
{ "language": "C++" }
```c++ #include "headers/mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); /*************************************************************************** * Create and set the settings button on the top...
```c++ #include "headers/mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); /*************************************************************************** * Create and set the settings button on the top...
44e1a50f-b191-45ac-8b33-352ed3ac7618
{ "language": "C++" }
```c++ // RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin9 | FileCheck %s struct A { _Atomic(int) i; A(int j); void v(int j); }; // Storing to atomic values should be atomic // CHECK: store atomic i32 void A::v(int j) { i = j; } // Initialising atomic values should not be atomic // CHECK-NOT: store a...
```c++ // RUN: %clang_cc1 %s -emit-llvm -o - -triple=i686-apple-darwin9 | FileCheck %s struct A { _Atomic(int) i; A(int j); void v(int j); }; // Storing to atomic values should be atomic // CHECK: store atomic i32 void A::v(int j) { i = j; } // Initialising atomic values should not be atomic // CHECK-NOT: store a...
c0f0f191-b400-43ec-b310-9a1eda5fb1db
{ "language": "C++" }
```c++ //===-- sanitizer_vector_test.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
```c++ //===-- sanitizer_vector_test.cc ------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===------------------------------------------------...
a1e0d9af-5a86-4cba-9a23-e64248d15f26
{ "language": "C++" }
```c++ #include <Halide.h> #include <sys/time.h> using namespace Halide; double currentTime() { timeval t; gettimeofday(&t, NULL); return t.tv_sec * 1000.0 + t.tv_usec / 1000.0f; } int main(int argc, char **argv) { Func f, g, h; Var x, y; h(x) = x; g(x) = h(x-1) + h(x+1); f(x, y) = ...
```c++ #include <Halide.h> using namespace Halide; int main(int argc, char **argv) { Func f, g, h; Var x, y; h(x) = x; g(x) = h(x-1) + h(x+1); f(x, y) = (g(x-1) + g(x+1)) + y; h.root(); g.root(); if (use_gpu()) { f.cudaTile(x, y, 16, 16); g.cudaTile(x, 128); ...
5a7947f9-fd7d-41b7-9e94-7c7d1ed7f179
{ "language": "C++" }
```c++ // RUN: rm -rf %t // RUN: pp-trace -ignore FileChanged,MacroDefined %s -x objective-c++ -undef -target x86_64 -std=c++11 -fmodules -fcxx-modules -fmodules-cache-path=%t -I%S -I%S/Input | FileCheck --strict-whitespace %s // CHECK: --- @import Level1A; // CHECK-NEXT: - Callback: moduleImport // CHECK-NEXT: Im...
```c++ // RUN: rm -rf %t // RUN: pp-trace -ignore FileChanged,MacroDefined %s -x objective-c++ -undef -target x86_64 -std=c++11 -fmodules -fcxx-modules -fmodules-cache-path=%t -I%S -I%S/Input | FileCheck --strict-whitespace %s // REQUIRES: x86-registered-target // CHECK: --- @import Level1A; // CHECK-NEXT: - Callback...
0008d7be-e52b-4dda-88d5-c210913b2921
{ "language": "C++" }
```c++ #include "spaghetti/logger.h" namespace spaghetti::log { Logger g_loggerConsole{}; Logger g_loggerFile{}; void init() { if (!g_loggerConsole) g_loggerConsole = spdlog::stdout_color_mt("console"); if (!g_loggerFile) g_loggerFile = spdlog::basic_logger_mt("file", "spaghetti.log"); spdlog::set_pattern("[%...
```c++ #include "spaghetti/logger.h" namespace spaghetti::log { Logger g_loggerConsole{}; Logger g_loggerFile{}; void init() { if (!g_loggerConsole) g_loggerConsole = spdlog::stdout_color_mt("console"); if (!g_loggerFile) g_loggerFile = spdlog::basic_logger_mt("file", "spaghetti.log"); spdlog::set_pattern("[%...
738c5cb5-4681-43f1-8fab-01ffeee9081d
{ "language": "C++" }
```c++ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* * This file is part of the libone project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://moz...
```c++ /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* * This file is part of the libone project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://moz...
ba57ef86-4f2d-4b08-9f10-4b4f7e73f65a
{ "language": "C++" }
```c++ #include <QInputDialog> #include "QGCTCPLinkConfiguration.h" #include "ui_QGCTCPLinkConfiguration.h" #include <stdint.h> QGCTCPLinkConfiguration::QGCTCPLinkConfiguration(TCPLink* link, QWidget *parent) : QWidget(parent), link(link), ui(new Ui::QGCTCPLinkConfiguration) { ui->setupUi(this); u...
```c++ #include <QInputDialog> #include "QGCTCPLinkConfiguration.h" #include "ui_QGCTCPLinkConfiguration.h" #include <stdint.h> QGCTCPLinkConfiguration::QGCTCPLinkConfiguration(TCPLink* link, QWidget *parent) : QWidget(parent), link(link), ui(new Ui::QGCTCPLinkConfiguration) { ui->setupUi(this); u...
c3629552-d4b5-467e-8462-24765ab569ed
{ "language": "C++" }
```c++ #include "authdialog.h" #include <qconnman/manager.h> #include <qconnman/agent.h> #include <QDebug> AuthDialog::AuthDialog(Manager *manager, QWidget *parent): QDialog(parent), m_manager(manager) { ui.setupUi(this); connect(ui.showPassword, SIGNAL(toggled(bool)), SLOT(showPassword(bool))); } ...
```c++ #include "authdialog.h" #include <qconnman/manager.h> #include <qconnman/agent.h> #include <QDebug> AuthDialog::AuthDialog(Manager *manager, QWidget *parent): QDialog(parent), m_manager(manager) { ui.setupUi(this); connect(ui.showPassword, SIGNAL(toggled(bool)), SLOT(showPassword(bool))); } ...
b360270a-e329-40e4-8e1e-bde5f9968d51
{ "language": "C++" }
```c++ // Copyright 2017, Dawid Kurek, <dawikur@gmail.com> #include "lel/operation/unary.hpp" #include "gtest/gtest.h" TEST(unary_test, logical_not_can_be_used_in_constexpr) { std::logical_not<> logical_not; static_assert(logical_not(false), ""); } TEST(unary_test, indirection_can_be_used_in_constexpr) { LeL...
```c++ // Copyright 2017, Dawid Kurek, <dawikur@gmail.com> #include "lel/operation/unary.hpp" #include "gtest/gtest.h" TEST(unary_test, logical_not_can_be_used_in_constexpr) { std::logical_not<> logical_not; static_assert(logical_not(false), ""); } ```
75cdb281-cb00-41a6-852f-266ad7483e6e
{ "language": "C++" }
```c++ #include <iostream> #include <texturebased/polarmapped.h> int main(int /*argc*/, char* /*argv*/[]) { // TODO: glfw return 0; } ``` Add glfw window to texture demo
```c++ #include <iostream> #define GLFW_INCLUDE_NONE #include <GLFW/glfw3.h> #include <glbinding/Binding.h> #include <glbinding/gl/gl.h> #include <globjects/globjects.h> using namespace gl; void error(int errnum, const char * errmsg) { std::cerr << errnum << ": " << errmsg << std::endl; } void key_callback(G...
6a1ae6d6-94f7-4be5-8111-d60158608b1d
{ "language": "C++" }
```c++ #include "ImwWindowManagerDX11.h" #include "ImwPlatformWindowDX11.h" #include <imgui_impl_dx11.h> using namespace ImWindow; ImwWindowManagerDX11::ImwWindowManagerDX11() { ImwPlatformWindowDX11::InitDX11(); } ImwWindowManagerDX11::~ImwWindowManagerDX11() { ImwPlatformWindowDX11::ShutdownDX11(); //ImGui_Imp...
```c++ #include "ImwWindowManagerDX11.h" #include "ImwPlatformWindowDX11.h" #include <imgui_impl_dx11.h> using namespace ImWindow; ImwWindowManagerDX11::ImwWindowManagerDX11() { ImwPlatformWindowDX11::InitDX11(); } ImwWindowManagerDX11::~ImwWindowManagerDX11() { ImwPlatformWindowDX11::ShutdownDX11(); //ImGui_Imp...
af3970b7-c7eb-43b1-9ee5-c15ba340d375
{ "language": "C++" }
```c++ /* * RecorderEndPoint.cpp - Kurento Media Server * * Copyright (C) 2013 Kurento * Contact: Miguel París Díaz <mparisdiaz@gmail.com> * Contact: José Antonio Santos Cadenas <santoscadenas@kurento.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU G...
```c++ /* * RecorderEndPoint.cpp - Kurento Media Server * * Copyright (C) 2013 Kurento * Contact: Miguel París Díaz <mparisdiaz@gmail.com> * Contact: José Antonio Santos Cadenas <santoscadenas@kurento.com> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU G...
4c9694e9-e205-4bc5-a29f-48e79a29ef9b
{ "language": "C++" }
```c++ // This file is distributed under the MIT license. // See the LICENSE file for details. #include <visionaray/detail/macros.h> #if defined(VSNRAY_OS_WIN32) #include <windows.h> #else #include <unistd.h> #endif #include "util.h" unsigned visionaray::get_num_processors() { #if defined(VSNRAY_OS_WIN32) SYST...
```c++ // This file is distributed under the MIT license. // See the LICENSE file for details. #include <visionaray/detail/macros.h> #include <visionaray/detail/platform.h> #if defined(VSNRAY_OS_WIN32) #include <windows.h> #else #include <unistd.h> #endif #include "util.h" unsigned visionaray::get_num_processors() ...
25663888-6a16-4a43-b999-18a4e2e403b5
{ "language": "C++" }
```c++ #include <iostream> #include "floaxie/dtoa.h" using namespace std; using namespace floaxie; int main(int, char**) { double pi = 0.1; char buffer[128]; for (int i = 0; i < 128; ++i) buffer[i] = 0; dtoa(pi, buffer); std::cout << "pi: " << pi << ", buffer: " << buffer << std::endl; return 0; } ``` Re...
```c++ #include <iostream> #include "floaxie/dtoa.h" using namespace std; using namespace floaxie; int main(int, char**) { double pi = 0.1; char buffer[128]; dtoa(pi, buffer); std::cout << "pi: " << pi << ", buffer: " << buffer << std::endl; return 0; } ```
8a13480f-a509-47cb-bddd-f10ba5fc9118
{ "language": "C++" }
```c++ /* * Copyright (c) 2012 by Matthias Noack, Zuse Institute Berlin * * Licensed under the BSD License, see LICENSE file for details. * */ #include "libxtreemfs/interrupt.h" #include <boost/date_time.hpp> namespace xtreemfs { Interruptibilizer::query_function Interruptibilizer::f_ = NULL; void Inter...
```c++ /* * Copyright (c) 2012 by Matthias Noack, Zuse Institute Berlin * * Licensed under the BSD License, see LICENSE file for details. * */ #include "libxtreemfs/interrupt.h" #include <boost/date_time/posix_time/posix_time_types.hpp> namespace xtreemfs { Interruptibilizer::query_function Interruptibilizer...
4c86f04b-2cba-4e47-8ac5-54f3a7d9006a
{ "language": "C++" }
```c++ /* * System Call getentropy(2) * (C) 2017 Alexander Bluhm (genua GmbH) * * Botan is released under the Simplified BSD License (see license.txt) */ #include <botan/internal/getentropy.h> #if defined(BOTAN_TARGET_OS_IS_OPENBSD) || defined(BOTAN_TARGET_OS_IS_FREEBSD) || defined(BOTAN_TARGET_OS_IS_SOLARIS) #inc...
```c++ /* * System Call getentropy(2) * (C) 2017 Alexander Bluhm (genua GmbH) * * Botan is released under the Simplified BSD License (see license.txt) */ #include <botan/internal/getentropy.h> #if defined(BOTAN_TARGET_OS_IS_OPENBSD) || defined(BOTAN_TARGET_OS_IS_FREEBSD) || defined(BOTAN_TARGET_OS_IS_SOLARIS) #inc...
4aed3d78-fc9c-42be-8e9d-156ad31eabd2
{ "language": "C++" }
```c++ // // src/utils/directory.cc // tbd // // Created by inoahdev on 10/17/17. // Copyright © 2017 inoahdev. All rights reserved. // #include "directory.h" namespace utils { directory::open_result directory::open(const char *path) { dir = opendir(path); if (!dir) { return open_r...
```c++ // // src/utils/directory.cc // tbd // // Created by inoahdev on 10/17/17. // Copyright © 2017 inoahdev. All rights reserved. // #include "directory.h" namespace utils { directory::open_result directory::open(const char *path) { this->path = path; this->dir = opendir(path); if ...
c9368e72-2166-4304-aef1-a8461591c293
{ "language": "C++" }
```c++ #include "robobo.h" #include "configuration.cpp" #include "servercapab.cpp" #include "socket.cpp" std::string input, command, currentNick; std::vector<std::string> inputParams; bool registered; int main(int argc, char** argv) { ConfigReader config; Socket bot_socket (config.getServer(), config.getPort()); b...
```c++ #include "robobo.h" #include "configuration.cpp" #include "servercapab.cpp" #include "socket.cpp" std::string input, command, currentNick; std::vector<std::string> inputParams; bool registered; int main(int argc, char** argv) { ConfigReader config; Socket bot_socket (config.getServer(), config.getPort()); b...
194c45ef-e27a-46ad-9527-4551bf116a3f
{ "language": "C++" }
```c++ #include "DMRecordTask.h" #include "DMUtil.h" #include "DMWriteTask.h" #include "SkCommandLineFlags.h" #include "SkRecording.h" DEFINE_bool(skr, false, "If true, run SKR tests."); namespace DM { RecordTask::RecordTask(const Task& parent, skiagm::GM* gm, SkBitmap reference) : CpuTask(parent) , fName(Un...
```c++ #include "DMRecordTask.h" #include "DMUtil.h" #include "DMWriteTask.h" #include "SkCommandLineFlags.h" #include "SkRecording.h" DEFINE_bool(skr, false, "If true, run SKR tests."); namespace DM { RecordTask::RecordTask(const Task& parent, skiagm::GM* gm, SkBitmap reference) : CpuTask(parent) , fName(Un...
a7af1bd5-65a8-43cf-96c7-52a3a3cc872b
{ "language": "C++" }
```c++ // http://www.nuonsoft.com/blog/2017/08/10/implementing-a-thread-safe-singleton-with-c11-using-magic-statics/ // http://blog.mbedded.ninja/programming/languages/c-plus-plus/magic-statics #include <iostream> class CSingleton final { public: static CSingleton& GetInstance(); int getValue() const { return mV...
```c++ // http://www.nuonsoft.com/blog/2017/08/10/implementing-a-thread-safe-singleton-with-c11-using-magic-statics/ // http://blog.mbedded.ninja/programming/languages/c-plus-plus/magic-statics #include <iostream> class CSingleton final { public: static CSingleton& GetInstance() { static CSingleton instance; ...
d7d65ae3-704a-4521-92e0-a207847d863c
{ "language": "C++" }
```c++ #include"qca.h" #include<stdio.h> int main(int argc, char **argv) { QCA::Initializer init; QCString cs = (argc >= 2) ? argv[1] : "hello"; if( !QCA::isSupported("sha1") ) printf("SHA1 not supported!\n"); else { QCA::SHA1 sha1Hash; QString result = sha1Hash.hashToString(cs); printf("sha1(\"%s\") = [%...
```c++ #include"qca.h" #include<stdio.h> int main(int argc, char **argv) { QCA::Initializer init; QCString cs = (argc >= 2) ? argv[1] : "hello"; if( !QCA::isSupported("sha1") ) printf("SHA1 not supported!\n"); else { QString result = QCA::SHA1().hashToString(cs); printf("sha1(\"%s\") = [%s]\n", cs.data(), r...
d5c80ded-7857-4017-aacb-f05a3bd401a3
{ "language": "C++" }
```c++ #include "catch.hpp" #include "StringToInteger.hpp" TEST_CASE("String To Integer") { Solution s; SECTION("Normal tests") { REQUIRE(s.myAtoi("1") == 1); } SECTION("Normal tests 2") { REQUIRE(s.myAtoi(" 010") == 10); } } ``` Update Problem 8 test case
```c++ #include "catch.hpp" #include "StringToInteger.hpp" TEST_CASE("String To Integer") { Solution s; SECTION("Normal tests") { REQUIRE(s.myAtoi("1") == 1); REQUIRE(s.myAtoi("378") == 378); REQUIRE(s.myAtoi("-239") == -239); REQUIRE(s.myAtoi("+832") == 832); } SECTION("Boundary tests") { ...
71f6a771-bc06-48ca-a9db-8483e7f7374a
{ "language": "C++" }
```c++ #include "component.h" #include "entity.h" #include "gtest/gtest.h" /* class TestC : public aronnax::Component { public: void update(aronnax::Entity &entity, const uint32_t dt) { return; } std::string getType() { return "TestComponent"; } }; class EntityTest : public tes...
```c++ #include "component.h" #include "entity.h" #include "gtest/gtest.h" /* class TestC : public aronnax::Component { public: void update(aronnax::Entity &entity, const uint32_t dt) { return; } std::string getType() { return "TestComponent"; } }; */ class EntityTest : public ...
22f89eb8-1356-46ad-aebc-c74fcda60a36
{ "language": "C++" }
```c++ #include "orderinginfo.h" #include "defs.h" #include "eval.h" #include <cstring> OrderingInfo::OrderingInfo(const TranspTable* tt) { _tt = tt; _ply = 0; std::memset(_history, 0, sizeof(_history)); } void OrderingInfo::incrementHistory(Color color, int from, int to, int depth) { _history[color][from][to...
```c++ #include "orderinginfo.h" #include "defs.h" #include "eval.h" #include <cstring> OrderingInfo::OrderingInfo(const TranspTable* tt) { _tt = tt; _ply = 0; std::memset(_history, 0, sizeof(_history)); } void OrderingInfo::incrementHistory(Color color, int from, int to, int depth) { _history[color][from][to...
36bf4779-e329-4c6a-9de6-1e4a7dd2ca39
{ "language": "C++" }
```c++ #include <utils/unique_alias.hpp> #include <atomic> #include <chrono> #include <sstream> static std::atomic<int> __counter(0); utils::unique_alias::unique_alias() { std::ostringstream s; s << "benchmarks-" << std::chrono::duration_cast<std::chrono::seconds>( std::chrono::steady_clo...
```c++ #include <utils/unique_alias.hpp> #include <atomic> #include <chrono> #include <sstream> static std::atomic<int> __counter(0); static const char __base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; utils::unique_alias::unique_alias() { std::ostringstream s; s << "benchmar...
bc5afe8c-2c90-405c-b769-17621991d3bc
{ "language": "C++" }
```c++ #include "utf8_string.hpp" #include "../std/iterator.hpp" #include "../3party/utfcpp/source/utf8/unchecked.h" namespace utf8_string { bool Split(string const & str, vector<string> & out, IsDelimiterFuncT f) { out.clear(); string::const_iterator curr = str.begin(); string::const_iterator end = ...
```c++ #include "utf8_string.hpp" #include "../std/iterator.hpp" #include "../3party/utfcpp/source/utf8/unchecked.h" namespace utf8_string { bool Split(string const & str, vector<string> & out, IsDelimiterFuncT f) { out.clear(); string::const_iterator curr = str.begin(); string::const_iterator end = ...
ff645888-819d-4b1e-b09d-0ef9d87132f9
{ "language": "C++" }
```c++ // Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #include "stdafx.h" #include <autowiring/observable.h> class ObservableTest: public testing::Test {}; TEST_F(ObservableTest, SimpleAssignmentCheck) { autowiring::observable<int> ob; bool hit = false; ob.onChanged += [&hit] { hit = true;...
```c++ // Copyright (C) 2012-2015 Leap Motion, Inc. All rights reserved. #include "stdafx.h" #include <autowiring/observable.h> class ObservableTest: public testing::Test {}; TEST_F(ObservableTest, SimpleAssignmentCheck) { autowiring::observable<int> ob; bool hit = false; ob.onChanged += [&hit] { hit = true;...
9f368d83-714b-4ecf-a0e2-d5e6fc53a03d
{ "language": "C++" }
```c++ #include "SVGImage.h" #define NANOSVG_IMPLEMENTATION #include <nanosvg.h> SVGImage::SVGImage() : _nanoSvgImage(nullptr) { } SVGImage::SVGImage(const boost::filesystem::path &path) : SVGImage() { open(path); } SVGImage::~SVGImage() { if (_nanoSvgImage) { ::nsvgDelete(_nanoSvgImage); } _nano...
```c++ #include "SVGImage.h" #define NANOSVG_IMPLEMENTATION #include <nanosvg.h> #include <nanovg.h> // XXX This is bad, but easy. #define NANOVG_GL_IMPLEMENTATION #include <GLES2/gl2.h> #include <GLES2/gl2ext.h> #include <GLES2/gl2platform.h> #include <nanovg_gl.h> #include <nanovg.c> SVGImage::SVGImage() : _nanoS...
f744d27f-7180-46c7-a84a-cb8909d3aaf1
{ "language": "C++" }
```c++ #include <cppfs/FileEventHandler.h> #include <cppfs/FileHandle.h> namespace cppfs { FileEventHandler::FileEventHandler() { } FileEventHandler::~FileEventHandler() { } void FileEventHandler::onFileEvent(FileHandle & fh, FileEvent event) { if (event & FileCreated) { onFileCreated(fh); } els...
```c++ #include <cppfs/FileEventHandler.h> #include <cppfs/FileHandle.h> namespace cppfs { FileEventHandler::FileEventHandler() { } FileEventHandler::~FileEventHandler() { } void FileEventHandler::onFileEvent(FileHandle & fh, FileEvent event) { switch (event) { case FileCreated: onFileCr...
2c736dc5-9155-4bf2-bf4e-5558e5ca30d1
{ "language": "C++" }
```c++ #include "LinearEllipticPDE.hpp" double f1(Point const & point) { return point.x() * point.x(); } double f2(Point const & point) { return point.y() * point.y(); } int main() { // laplace ConstTensor I(3, 0.); I(0, 0) = I(1, 1) = I(2, 2) = 1.; LinearEllipticPDE LaplacesEquation3D(I, 0., zeroFunc); std::...
```c++ #include "LinearEllipticPDE.hpp" #include "BC.hpp" double g(Point const & point) { // u = g on Г return point.x() * point.y(); } int main() { // Laplace's eqn on the plane ConstTensor I(2, 0.); I(0, 0) = I(1, 1) = 1.; LinearEllipticPDE LaplacesEquation2D(I, 0., zeroFunc); BC myBC(g); // simple Dirichlet...
a69b223e-69c7-4bcf-b37b-106115be6a0f
{ "language": "C++" }
```c++ #include "level.hpp" using namespace engine; void Level::load(){ for(auto game_object : objects){ std::cout << "Loading " << game_object->name << std::endl; game_object->load(); for(auto hit : game_object->get_hitboxes()){ hit->initialize(); } } } void Level::free(){ for(auto game_...
```c++ #include "level.hpp" #include <iostream> using namespace engine; void Level::load(){ for(auto game_object : objects){ std::cout << "Loading " << game_object->name << std::endl; game_object->load(); for(auto hit : game_object->get_hitboxes()){ hit->initialize(); } } } void Level::free...
20ed731d-0789-49ee-9750-b6327ca430db
{ "language": "C++" }
```c++ // // Copyright (C) Alexandr Vorontsov. 2017 // Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). // #include "stdafx.h" #include <Kioto.h> #include <windows.h> void OnEngineInited() { Kioto::Scene* scene = new Kioto::Scene(); Kioto::SetScene(scene); Out...
```c++ // // Copyright (C) Alexandr Vorontsov. 2017 // Distributed under the MIT License (license terms are at http://opensource.org/licenses/MIT). // #include "stdafx.h" #include <Kioto.h> #include <windows.h> class TestScene : public Kioto::Scene { public: ~TestScene() { } }; class TestSceneSystem : ...
21e3205c-6d74-45a7-87cb-5fa6c2c2f818
{ "language": "C++" }
```c++ #include "InputHandler.h" #include "SFML/Window.hpp" #include "SFData.h" Player::Direction InputHandler::LastInput; int InputHandler::InputTime; bool InputHandler::WindowClosed = false; void InputHandler::PollEvents() { sf::Event event; while (SFData::Window->pollEvent(event)) { switch (event.typ...
```c++ #include "InputHandler.h" #include "SFML/Window.hpp" #include "SFData.h" Player::Direction InputHandler::LastInput; int InputHandler::InputTime; bool InputHandler::WindowClosed = false; void InputHandler::PollEvents() { sf::Event event; while (SFData::Window->pollEvent(event)) { switch (event.typ...
6f2e41fd-46bb-4434-962c-70f99f19dd59
{ "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 "content/test/unittest_test_suite.h" #include "base/logging.h" #include "base/test/test_suite.h" #include "third_party/WebKit/Source/...
```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 file. #include "content/test/unittest_test_suite.h" #include "base/logging.h" #include "base/test/test_suite.h" #include "third_party/WebKit/Source/...
f6f3e4cc-fe0d-4c32-b9fe-e0430965ecdb
{ "language": "C++" }
```c++ #include "vm/vm.hpp" #include "util/thread.hpp" #include "gc/managed.hpp" #include "shared_state.hpp" namespace rubinius { thread::ThreadData<ManagedThread*> _current_thread; ManagedThread::ManagedThread(uint32_t id, SharedState& ss, ManagedThread::Kind kind) : shared_(ss) , kind_(kind) , name...
```c++ #include "vm/vm.hpp" #include "util/thread.hpp" #include "gc/managed.hpp" #include "shared_state.hpp" namespace rubinius { thread::ThreadData<ManagedThread*> _current_thread; ManagedThread::ManagedThread(uint32_t id, SharedState& ss, ManagedThread::Kind kind) : shared_(ss) , kind_(kind) , name...
0de3e526-bb07-4bfd-a0d0-a60712e70106
{ "language": "C++" }
```c++ // Copyright 2013 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 "ozone/wayland/inputs/input_method_event_filter.h" #include "ui/base/ime/input_method.h" #include "ui/base/ime/input_method_factory.h" n...
```c++ // Copyright 2013 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 "ozone/wayland/inputs/input_method_event_filter.h" #include "ui/base/ime/input_method.h" #include "ui/base/ime/input_method_factory.h" n...
261f7cbe-5021-4900-b76b-b05e782b7d9f
{ "language": "C++" }
```c++ #include "../http/client-channel.hh" #include "http-call.hh" #include "json.hh" namespace mimosa { namespace rpc { bool httpCall(const std::string &url, const google::protobuf::Message &request, google::protobuf::Message *response) { http::ClientChannel cc; ...
```c++ #include "../stream/string-stream.hh" #include "../stream/copy.hh" #include "../http/client-channel.hh" #include "http-call.hh" #include "json.hh" namespace mimosa { namespace rpc { bool httpCall(const std::string &url, const google::protobuf::Message &request, google:...
3f2ae725-bf78-479d-90a1-adf7d6ee337b
{ "language": "C++" }
```c++ // %llvmgcc %s -S -o - namespace std { class exception { }; class type_info { public: virtual ~type_info(); }; } namespace __cxxabiv1 { class __si_class_type_info : public std::type_info { ~__si_class_type_info(); }; } class recursive_init: public std::exception { public: virtual ~recur...
```c++ // RUN: %llvmgcc %s -S -o - namespace std { class exception { }; class type_info { public: virtual ~type_info(); }; } namespace __cxxabiv1 { class __si_class_type_info : public std::type_info { ~__si_class_type_info(); }; } class recursive_init: public std::exception { public: virtual ~...
93d099f6-2d9f-4b8d-95b4-9fd18d8e9528
{ "language": "C++" }
```c++ // RUN: clang-tidy %s -- --serialize-diagnostics %t | FileCheck %s // CHECK: :[[@LINE+1]]:12: error: expected ';' after struct [clang-diagnostic-error] struct A {} ``` Make a test independent of the default check set.
```c++ // RUN: clang-tidy -checks=-*,llvm-namespace-comment %s -- -serialize-diagnostics %t | FileCheck %s // CHECK: :[[@LINE+1]]:12: error: expected ';' after struct [clang-diagnostic-error] struct A {} ```
a5761d42-1aee-4682-b9f3-de5ef9aead16
{ "language": "C++" }
```c++ //===- AlphaSubtarget.cpp - Alpha Subtarget Information ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by Andrew Lenharth and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===-----------...
```c++ //===- AlphaSubtarget.cpp - Alpha Subtarget Information ---------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by Andrew Lenharth and is distributed under the // University of Illinois Open Source License. See LICENSE.TXT for details. // //===-----------...
d3c8c861-61a1-403b-8583-c02653e1b4e8
{ "language": "C++" }
```c++ #include "lcd.h" #include <TFT.h> // Arduino LCD library // pin definition for LCD #define LCD_CS 10 #define LCD_DC 9 #define LCD_RST 8 namespace LCD { TFT TFTscreen = TFT(LCD_CS, LCD_DC, LCD_RST); void setup() { // initialize the display TFTscreen.begin(); // clear the screen with a bla...
```c++ #include "display.h" #include "sensor.h" #include <LiquidCrystal.h> // Arduino LCD library #include <Arduino.h> // enables use of byte pics // pin definition for LCD #define LCD_CS 10 #define LCD_DC 9 #define LCD_RST 8 namespace LCD { TFT TFTscreen = TFT(LCD_CS, LCD_DC, LCD_RST); void setup() { ...
71ded0a8-5255-424e-9a49-39a500c5f43d
{ "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 file. #include "content/public/browser/android/devtools_auth.h" #include "base/logging.h" namespace content { bool CanUserConnectToDevTools(uid_t ...
```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 file. #include "content/public/browser/android/devtools_auth.h" #include <unistd.h> #include <sys/types.h> #include "base/logging.h" namespace con...
36207f1d-6496-4c22-94f5-5c919683d018
{ "language": "C++" }
```c++ #include "../src/utility.h" #include "../src/HDD/HardDrive.h" void unittest(){ const size_t emptyOff = 0x80120; HDD first(1,true); first.init(); int data[1000]; for(int i = 0 ; i < 1000 ; ++i){ data[i] = i; } first.writeaddr(emptyOff,&data,4*1000); int res; first.re...
```c++ #include "../src/utility.h" #include "../src/HDD/HardDrive.h" void unittest(){ const size_t emptyOff = 0x80120; HDD::HDD first(1,true); first.init(); int data[1000]; for(int i = 0 ; i < 1000 ; ++i){ data[i] = i; } first.writeaddr(emptyOff,&data,4*1000); int res; fir...
81dc1bd2-2a3f-42c2-a489-f1f4e3dfa52a
{ "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 file. #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/test/base/ui_test_utils.h" IN_PROC_BROWSER_TEST_F(ExtensionApiTest,...
```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 file. #include "chrome/browser/extensions/extension_apitest.h" #include "chrome/test/base/ui_test_utils.h" IN_PROC_BROWSER_TEST_F(ExtensionApiTest,...
c689e3ed-688a-4a9d-882e-e4f979764b86
{ "language": "C++" }
```c++ #include "stdafx.h" #include "ExpressionFunctions.h" #include "Misc.h" #include "Common.h" ExpressionValue expressionFunctionEndianness(const std::vector<ExpressionValue>& parameters) { Endianness endianness = g_fileManager->getEndianness(); ExpressionValue result; result.type = ExpressionValueType::String;...
```c++ #include "stdafx.h" #include "ExpressionFunctions.h" #include "Misc.h" #include "Common.h" ExpressionValue expFuncEndianness(const std::vector<ExpressionValue>& parameters) { Endianness endianness = g_fileManager->getEndianness(); ExpressionValue result; result.type = ExpressionValueType::String; switch (...
b52db52a-5d5e-49b2-838e-69f569c198f8
{ "language": "C++" }
```c++ // REQUIRES: static-analyzer // RUN: clang-tidy %s -checks='-*,clang-analyzer-*' -- | FileCheck %s extern void *malloc(unsigned long); extern void free(void *); void f() { int *p = new int(42); delete p; delete p; // CHECK: warning: Attempt to delete released memory [clang-analyzer-cplusplus.NewDelete] ...
```c++ // REQUIRES: static-analyzer // RUN: clang-tidy %s -checks='-*,clang-analyzer-*' -- | FileCheck %s extern void *malloc(unsigned long); extern void free(void *); void f() { int *p = new int(42); delete p; delete p; // CHECK: warning: Attempt to free released memory [clang-analyzer-cplusplus.NewDelete] } ...
51658120-c7dd-4c0d-8992-90382f03ad38
{ "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 "GrGLConfig.h" #include "GrGLInterface.h" void GrGLClearErr(const GrGLInterface* gl) { while (GR_GL_NO_ERROR != gl->fGetError()) {} } void GrGLCheckErr...
```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 "GrGLConfig.h" #include "GrGLInterface.h" void GrGLClearErr(const GrGLInterface* gl) { while (GR_GL_NO_ERROR != gl->fGetError()) {} } void GrGLCheckErr...
4d5e505f-93c0-41d9-a3f8-6b6798a0f87b
{ "language": "C++" }
```c++ #include <Pith/Config.hpp> #include <Pith/LockGuard.hpp> #include <Pith/SharedLock.hpp> #include <gtest/gtest.h> using namespace Pith; TEST(SharedLock, multipleShared) { SharedLock lock; SharedLockGuard<SharedLock> shared1(lock); EXPECT_TRUE(trySharedLock(lock)); } TEST(SharedLock, failToTakeExclusive) { ...
```c++ #include <Pith/Config.hpp> #include <Pith/LockGuard.hpp> #include <Pith/SharedLock.hpp> #include <gtest/gtest.h> using namespace Pith; TEST(SharedLock, multipleShared) { SharedLock lock; SharedLockGuard<SharedLock> shared1(lock); EXPECT_TRUE(trySharedLock(lock)); } TEST(SharedLock, DISABLED_failToTakeExclu...
ef1f86ec-4a0a-41ac-9c62-f5df724f565d
{ "language": "C++" }
```c++ #include "ReadFileManager.h" // Own interface #include "ReadFile.h" // engine::ReadFile namespace engine { ReadFileManager::ReadFileManager() { // Default number of open files max_open_files = 10; } ReadFile *ReadFileManager::getReadFile( std:...
```c++ #include "ReadFileManager.h" // Own interface #include "ReadFile.h" // engine::ReadFile namespace engine { ReadFileManager::ReadFileManager() { // Default number of open files max_open_files = 100; } ReadFile *ReadFileManager::getReadFile( std...
6a467c53-70aa-4da6-a8d0-90f2ce4dbb38
{ "language": "C++" }
```c++ // // WindowSettings.cpp // Hume // // Created by Marshall Clyburn on 7/11/14. // Copyright (c) 2014 Marshall Clyburn. All rights reserved. // #include "WindowSettings.h" namespace hm { /* Default to a fullscreen window at the maximum resolution supported by the attached screen. */ WindowSettings::...
```c++ // // WindowSettings.cpp // Hume // // Created by Marshall Clyburn on 7/11/14. // Copyright (c) 2014 Marshall Clyburn. All rights reserved. // #include "WindowSettings.h" namespace hm { /* Default to a fullscreen window at the maximum resolution supported by the attached screen. */ WindowSettings::...
72a40646-a954-4a55-b9fa-43934260b655
{ "language": "C++" }
```c++ #include <iostream> #include <cstdlib> #include "population.h" int **POPULATION::initializePopulation(int individuals, int genes, bool FILL_ZERO) { int **population; if (!FILL_ZERO) { population = (int **) malloc(individuals * sizeof(int *)); for (int i = 0; i < individuals; i++) populatio...
```c++ #include <iostream> #include <cstdlib> #include "population.h" int **POPULATION::initializePopulation(int individuals, int genes, bool FILL_ZERO) { int **population; if (!FILL_ZERO) { population = (int **) malloc(individuals * sizeof(int *)); for (int i = 0; i < individuals; i++) populatio...
179de196-2fce-4125-9cb2-a385a857a84d
{ "language": "C++" }
```c++ #include "connection.h" hwo_connection::hwo_connection(const std::string& host, const std::string& port) : socket(io_service) { tcp::resolver resolver(io_service); tcp::resolver::query query(host, port); boost::asio::connect(socket, resolver.resolve(query)); response_buf.prepare(8192); } hwo_connecti...
```c++ #include "connection.h" hwo_connection::hwo_connection(const std::string& host, const std::string& port) : socket(io_service) { tcp::resolver resolver(io_service); tcp::resolver::query query(host, port); boost::asio::connect(socket, resolver.resolve(query)); response_buf.prepare(8192); } hwo_connecti...
6aa1d5f8-0e2b-471b-ab10-ce82007377e7
{ "language": "C++" }
```c++ #include "browser/inspectable_web_contents.h" #include "browser/inspectable_web_contents_impl.h" namespace brightray { InspectableWebContents* InspectableWebContents::Create(const content::WebContents::CreateParams& create_params) { return Create(content::WebContents::Create(create_params)); } InspectableW...
```c++ #include "browser/inspectable_web_contents.h" #include "browser/inspectable_web_contents_impl.h" #include "content/public/browser/web_contents_view.h" namespace brightray { InspectableWebContents* InspectableWebContents::Create(const content::WebContents::CreateParams& create_params) { auto contents = cont...
9f190adf-0f86-4e3f-b4cd-02dc3c166df4
{ "language": "C++" }
```c++ // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out // Test orig...
```c++ // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t && not %run %t >%t.out 2>&1 // RUN: FileCheck %s < %t.out && FileCheck %s < %t.out // Test orig...
858b03db-afab-4624-8b1e-094f92e045de
{ "language": "C++" }
```c++ //===------------------------- cxa_exception.cpp --------------------------===// // // 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. // // // This file implements the "Exc...
```c++ //===------------------------- cxa_exception.cpp --------------------------===// // // 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. // // // This file implements the "Exc...
ac3349e0-ff50-4170-bb41-0f2ad22f625a
{ "language": "C++" }
```c++ #include <QtPlugin> \ #include "animatedtilesplugin.h" #include "animatedtilesitem.h" AnimatedTilesPlugin::AnimatedTilesPlugin() { this->mName = "AnimatedTiles"; //This should not be an advertized plugin until it is implemented //this->mRole = "animatedTiles"; } Q_EXPORT_PLUGIN2(animatedTiles, An...
```c++ #include <QtPlugin> \ #include "animatedtilesplugin.h" #include "animatedtilesitem.h" AnimatedTilesPlugin::AnimatedTilesPlugin() { setName("AnimatedTiles"); //This should not be an advertized plugin until it is implemented //setRole("animatedTiles"); } Q_EXPORT_PLUGIN2(animatedTiles, AnimatedTile...
be1c8102-e4e9-4abf-ab77-8d9988904692
{ "language": "C++" }
```c++ #include "AbsPositionOverview.h" AbsPositionOverview::AbsPositionOverview(QObject *parent) : QObject(parent) { } void AbsPositionOverview::parseGpsRawInt(LinkInterface *link, const mavlink_message_t &message, const mavlink_gps_raw_int_t &state) { if (state.fix_type > 2) { this->setLat(state...
```c++ #include "AbsPositionOverview.h" AbsPositionOverview::AbsPositionOverview(QObject *parent) : QObject(parent) { } void AbsPositionOverview::parseGpsRawInt(LinkInterface *link, const mavlink_message_t &message, const mavlink_gps_raw_int_t &state) { if (state.fix_type > 2) { this->setLat(state...
3acf00c6-957d-4ae3-81ae-4fe1e23b8203
{ "language": "C++" }
```c++ #include "gtest/gtest.h" #include "Console.hpp" #include <memory> using namespace warbler; class ConsoleTest { public: static void noopCommandHandler(const std::shared_ptr<const std::vector<ConsoleArg>> &args) {}; static const std::shared_ptr<std::vector<ConsoleArgType>> args; }; const std::shared_pt...
```c++ #include "gtest/gtest.h" #include "Console.hpp" #include <memory> using namespace warbler; class ConsoleTest { public: static void noopCommandHandler(const std::shared_ptr<const std::vector<ConsoleArg>> &args) {}; static const std::shared_ptr<std::vector<ConsoleArgType>> args; }; const std::shared_pt...
a33b13c9-09c5-4f7d-afe6-ce66fbd17af0
{ "language": "C++" }
```c++ #include <iostream> #include "version.h" #include "parser.h" using namespace lean; int main() { std::cout << "Lean (version " << LEAN_VERSION_MAJOR << "." << LEAN_VERSION_MINOR << ")\n"; frontend f; return parse_commands(f, std::cin) ? 0 : 1; } ``` Add support for reading input files from the comma...
```c++ #include <iostream> #include <fstream> #include "version.h" #include "parser.h" using namespace lean; int main(int argc, char ** argv) { std::cout << "Lean (version " << LEAN_VERSION_MAJOR << "." << LEAN_VERSION_MINOR << ")\n"; frontend f; if (argc == 1) { return parse_commands(f, std::cin) ...
6d339ee7-57a6-4c7f-91f2-d75e56563347
{ "language": "C++" }
```c++ /* * Deck.cpp * * Created on: 11.01.2017 * Author: Stefan */ #include <memory> #include <random> #include "Deck.h" #include "Card.h" #include "GlobalDeclarations.h" void Deck::AddSets(std::size_t N) { for(std::size_t i = 0; i < N; ++i) { AddCompleteSet(); } } Deck::pCard Deck::Draw() { // Ran...
```c++ /* * Deck.cpp * * Created on: 11.01.2017 * Author: Stefan */ #include <memory> #include <random> #include "Deck.h" #include "Card.h" #include "GlobalDeclarations.h" #include <chrono> void Deck::AddSets(std::size_t N) { for(std::size_t i = 0; i < N; ++i) { AddCompleteSet(); } } Deck::pCard Deck...
e47585fa-b0f4-4554-9548-2956c72450eb
{ "language": "C++" }
```c++ #include <iostream> #include <thread> #include <vector> #include "World.h" using namespace std; int main(int argc, char * argv[]) { if (argc != 4) { std::cerr << "use: " << argv[0] << " dim iterations nworkers\n"; return -1; } int dim = atoi(argv[1]); int iterations =...
```c++ #include <iostream> #include <thread> #include <vector> #include "World.h" using namespace std; int main(int argc, char * argv[]) { if (argc < 4) { std::cerr << "use: " << argv[0] << " dim iterations nworkers ?[print: on]\n"; return -1; } int dim = atoi(argv[1]); int i...
a5fa2658-fd3e-458d-a37b-20a6f977f0c0
{ "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/chromeos/status_area_button.h" #include "app/gfx/canvas.h" #include "app/gfx/skbitmap_operations.h" #include "app/res...
```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/chromeos/status_area_button.h" #include "app/gfx/canvas.h" #include "app/gfx/skbitmap_operations.h" #include "app/res...
8eb60b9e-8691-40fd-b80c-79db505026a7
{ "language": "C++" }
```c++ #ifdef __unix__ #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"); if (!pipe) { ...
```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"); ...
08b48d84-fb2e-4355-b4ed-59f1c989e1d0
{ "language": "C++" }
```c++ // Copyright (c) 2011 Zeex // // 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 to...
```c++ // Copyright (c) 2011 Zeex // // 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 to...
2843abff-9e7d-4191-ac8f-d898ee5f145e
{ "language": "C++" }
```c++ // // SNA.cpp // Clock Signal // // Created by Thomas Harte on 24/04/2021. // Copyright © 2021 Thomas Harte. All rights reserved. // #include "SNA.hpp" using namespace Storage::State; std::unique_ptr<Analyser::Static::Target> SNA::load(const std::string &file_name) { // 0x1a byte header: // // 00 I //...
```c++ // // SNA.cpp // Clock Signal // // Created by Thomas Harte on 24/04/2021. // Copyright © 2021 Thomas Harte. All rights reserved. // #include "SNA.hpp" using namespace Storage::State; std::unique_ptr<Analyser::Static::Target> SNA::load(const std::string &file_name) { // 0x1a byte header: // // 00 I //...
ca21b3c2-8cc9-42d6-9b60-78b70b9ae6d4
{ "language": "C++" }
```c++ /* High_Temp.cpp 2014 Copyright (c) Seeed Technology Inc. All right reserved. Loovee 2013-4-14 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 t...
```c++ /* High_Temp.cpp 2014 Copyright (c) Seeed Technology Inc. All right reserved. Loovee 2013-4-14 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 t...
4dc2d6d1-ff78-4613-9eb7-3542ae5dcb08
{ "language": "C++" }
```c++ // Based on Euler.ino example #include "NAxisMotion.h" NAxisMotion imu; unsigned long prevTime = 0; const int streamPeriod = 20; // ms void setup() { Serial.begin(115200); I2C.begin(); imu.initSensor(); // I2C Address can be changed here if needed imu.setOperationMode(OPERATION_MODE_NDOF); // Defau...
```c++ #include "NAxisMotion.h" NAxisMotion imu; unsigned long prevTime = 0; const int streamPeriod = 20; // ms void setup() { Serial.begin(115200); I2C.begin(); imu.initSensor(); // I2C Address can be changed here if needed imu.setOperationMode(OPERATION_MODE_NDOF); imu.setUpdateMode(MANUAL); } void loop...
9ae041a9-b61e-4bfa-b280-7f326b92bdab
{ "language": "C++" }
```c++ // RUN: %clang_cc1 %s -emit-llvm-only -verify // PR7291 struct Foo { unsigned file_id; Foo(unsigned arg); }; Foo::Foo(unsigned arg) : file_id(arg = 42) { } ``` Check the output of this test.
```c++ // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s // PR7291 struct Foo { unsigned file_id; Foo(unsigned arg); }; Foo::Foo(unsigned arg) : file_id(arg = 42) { } // CHECK: define void @_ZN3FooC2Ej // CHECK: [[ARG:%.*]] = alloca i32 // CHECK: store i32 42, i32* [[ARG]] // CHECK: [[ARGVAL:%.*]] = load i32...
950e9365-b89e-4723-80d0-acea4bc303dc
{ "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. // //===---------------------------------...
141e5e8f-f2dd-4c8f-aa62-d2f5e0482214
{ "language": "C++" }
```c++ /****************************************************************************** ** Filename: mfdefs.cpp ** Purpose: Basic routines for manipulating micro-features ** Author: Dan Johnson ** ** (c) Copyright Hewlett-Packard Company, 1988. ** Licensed under the Apache License, Version 2.0 (the "Li...
```c++ /****************************************************************************** ** Filename: mfdefs.cpp ** Purpose: Basic routines for manipulating micro-features ** Author: Dan Johnson ** ** (c) Copyright Hewlett-Packard Company, 1988. ** Licensed under the Apache License, Version 2.0 (the "Li...
3365579b-06e9-4def-8c82-9e8978a220b3
{ "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/chromeos/legacy_window_manager/initial_browser_window_observer.h" #include "base/file_path.h" #include "base/file_uti...
```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/chromeos/legacy_window_manager/initial_browser_window_observer.h" #include "base/bind.h" #include "base/file_path.h" ...
4ec09b71-0c7f-4485-be7e-6d0684fbdc9c
{ "language": "C++" }
```c++ #include "qtfirebaseanalytics.h" #include "qtfirebaseremoteconfig.h" #include "qtfirebaseadmob.h" #include "qtfirebaseauth.h" #include "qtfirebasedatabase.h" #ifdef QTFIREBASE_BUILD_ANALYTICS QtFirebaseAnalytics* QtFirebaseAnalytics::self = nullptr; #endif #ifdef QTFIREBASE_BUILD_REMOTE_CONFIG QtFirebaseRemote...
```c++ #include "qtfirebaseanalytics.h" #include "qtfirebaseremoteconfig.h" #include "qtfirebaseadmob.h" #include "qtfirebaseauth.h" #include "qtfirebasedatabase.h" #include "qtfirebasemessaging.h" #ifdef QTFIREBASE_BUILD_ANALYTICS QtFirebaseAnalytics* QtFirebaseAnalytics::self = nullptr; #endif #ifdef QTFIREBASE_BUI...
3fcfc26c-8372-4085-ae04-1d6014aee750
{ "language": "C++" }
```c++ /* * File: NetworkThread.cpp * Author: matthieu * * Created on 6 février 2015, 11:40 */ #include "NetworkThread.h" #include "RecalboxSystem.h" #include "guis/GuiMsgBox.h" NetworkThread::NetworkThread(Window* window) : mWindow(window){ // creer le thread mFirstRun = true; mRunning = t...
```c++ /* * File: NetworkThread.cpp * Author: matthieu * * Created on 6 février 2015, 11:40 */ #include "NetworkThread.h" #include "RecalboxSystem.h" #include "guis/GuiMsgBox.h" NetworkThread::NetworkThread(Window* window) : mWindow(window){ // creer le thread mFirstRun = true; mRunning = t...
d9bbd4a9-d167-4e68-ae9d-7e55cb844fbc
{ "language": "C++" }
```c++ /* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ #include "config.h" #include "tapthrottle.hh" const size_t MINIMUM_SPACE(1024 * 1024); const size_t MAXIMUM_QUEUE(100000); bool TapThrottle::persistenceQueueSmallEnough() const { size_t queueSize = stats.queue_size.get() + sta...
```c++ /* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ #include "config.h" #include "tapthrottle.hh" const size_t MINIMUM_SPACE(1024 * 1024); const size_t MAXIMUM_QUEUE(500000); bool TapThrottle::persistenceQueueSmallEnough() const { size_t queueSize = stats.queue_size.get() + sta...
b3c2dc1d-dcdb-4d5c-896a-a27807b12371
{ "language": "C++" }
```c++ #include "WebSocketWrapper.hpp" #include <iostream> using namespace rtcdcpp; WebSocketWrapper::WebSocketWrapper(std::string url) : url(url), send_queue() { ; } WebSocketWrapper::~WebSocketWrapper() { delete this->ws; } bool WebSocketWrapper::Initialize() { this->ws = WebSocket::from_url(this->url); retu...
```c++ #include "WebSocketWrapper.hpp" #include <thread> #include <iostream> using namespace rtcdcpp; WebSocketWrapper::WebSocketWrapper(std::string url) : url(url), send_queue() { ; } WebSocketWrapper::~WebSocketWrapper() { delete this->ws; } bool WebSocketWrapper::Initialize() { this->ws = WebSocket::from_url(t...
7379a952-7821-47a5-8af4-c8029a06ab7d
{ "language": "C++" }
```c++ #define SOFA_COMPONENT_COLLISION_CYLINDERMODEL_CPP #include "CylinderModel.inl" namespace sofa { namespace component { namespace collision { using namespace sofa::defaulttype; using namespace sofa::core::collision; using namespace helper; SOFA_DECL_CLASS(Cylinder) int RigidCylinderModelClass = core::Regist...
```c++ #define SOFA_COMPONENT_COLLISION_CYLINDERMODEL_CPP #include "CylinderModel.inl" namespace sofa { namespace component { namespace collision { using namespace sofa::defaulttype; using namespace sofa::core::collision; using namespace helper; SOFA_DECL_CLASS(Cylinder) int RigidCylinderModelClass = core::Regist...
810490d1-34c9-4287-a83a-f3cc0d3965ae
{ "language": "C++" }
```c++ #include "Halide.h" namespace { class EdgeDetect : public Halide::Generator<EdgeDetect> { public: ImageParam input{ UInt(8), 2, "input" }; Func build() { Var x, y; Func clamped = Halide::BoundaryConditions::repeat_edge(input); // Gradients in x and y. Func gx("gx"); ...
```c++ #include "Halide.h" namespace { class EdgeDetect : public Halide::Generator<EdgeDetect> { public: ImageParam input{ UInt(8), 2, "input" }; Func build() { Var x, y; Func clamped = Halide::BoundaryConditions::repeat_edge(input); // Upcast to 16-bit Func in16; ...