#include <omp.h>

#include "proctor/detector.h"
#include "proctor/proctor.h"
#include "proctor/scanning_model_source.h"

using pcl::proctor::Detector;
//using pcl::proctor::ProctorMPI;
using pcl::proctor::Proctor;
using pcl::proctor::ScanningModelSource;

Detector detector;
Proctor proctor;

int main(int argc, char **argv) {
  unsigned int model_seed = 2;
  unsigned int test_seed = 0; //time(NULL);
  if (argc >= 2) model_seed = atoi(argv[1]);
  if (argc >= 3) test_seed = atoi(argv[2]);

  ScanningModelSource model_source("Princeton", "/home/justin/Documents/benchmark/db");
  model_source.loadModels();

  //detector.enableVisualization();
  proctor.setModelSource(&model_source);
  proctor.train(detector);
  proctor.test(detector, test_seed);
  proctor.printResults(detector);

  while (true) {}

  return 0;
}

#include <omp.h>

#include "proctor/detector.h"
#include "proctor/proctor.h"
#include "proctor/scanning_model_source.h"

using pcl::proctor::Detector;
//using pcl::proctor::ProctorMPI;
using pcl::proctor::Proctor;
using pcl::proctor::ScanningModelSource;

Detector detector;
Proctor proctor;

int main(int argc, char **argv) {
  unsigned int model_seed = 2;
  unsigned int test_seed = 0; //time(NULL);
  if (argc >= 2) model_seed = atoi(argv[1]);
  if (argc >= 3) test_seed = atoi(argv[2]);

  ScanningModelSource model_source("Princeton", "/home/justin/Documents/benchmark/db");
  model_source.loadModels();

  //detector.enableVisualization();
  proctor.setModelSource(&model_source);
  proctor.train(detector);
  proctor.test(detector, test_seed);
  proctor.printResults(detector);

  sleep(100000);

  return 0;
}

Use sleep instead of a busy-wait while loop to retain the output.


/******************************************************************************

  nomlib - C++11 cross-platform game engine

Copyright (c) 2013, Jeffrey Carpenter <jeffrey.carp@gmail.com>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

******************************************************************************/

// This file is auto-generated by CMake at build time
#include "nomlib/version.hpp"

const std::string NOMLIB_INSTALL_PREFIX = "/Users/jeff/Library/Frameworks";
const std::string NOMLIB_BUNDLE_IDENTIFIER = "org.i8degrees.nomlib";

/******************************************************************************

  nomlib - C++11 cross-platform game engine

Copyright (c) 2013, Jeffrey Carpenter <jeffrey.carp@gmail.com>
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
   list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

******************************************************************************/

// This file is auto-generated by CMake at build time
#include "nomlib/version.hpp"

#if defined (NOM_PLATFORM_WINDOWS)
  const std::string NOMLIB_INSTALL_PREFIX = "C:/";
#endif

const std::string NOMLIB_BUNDLE_IDENTIFIER = "org.i8degrees.nomlib";

Add conditional preprocessor for nomlib's install prefix under Windows


#include <emscripten/bind.h>

#include "libcellml/logger.h"

using namespace emscripten;

EMSCRIPTEN_BINDINGS(libcellml_logger) {

    class_<libcellml::Logger>("Logger")
        .function("addIssue", &libcellml::Logger::addIssue)
        .function("removeAllIssues", &libcellml::Logger::removeAllIssues)
        .function("error", &libcellml::Logger::error)
        .function("warning", &libcellml::Logger::warning)
        .function("hint", &libcellml::Logger::hint)
    ;
}

#include <emscripten/bind.h>

#include "libcellml/logger.h"

using namespace emscripten;

EMSCRIPTEN_BINDINGS(libcellml_logger) {

    class_<libcellml::Logger>("Logger")
        .function("addIssue", &libcellml::Logger::addIssue)
        .function("removeAllIssues", &libcellml::Logger::removeAllIssues)
        .function("error", &libcellml::Logger::error)
        .function("warning", &libcellml::Logger::warning)
        .function("hint", &libcellml::Logger::hint)
        .function("issueCount", &libcellml::Logger::issueCount)
        .function("errorCount", &libcellml::Logger::errorCount)
        .function("warningCount", &libcellml::Logger::warningCount)
        .function("hintCount", &libcellml::Logger::hintCount)
    ;
}

Add missing API from Javascript bindings Logger class.


// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"

#if defined(TOOLKIT_VIEWS) || defined(OS_MACOSX)
#define MAYBE_Infobars Infobars
#else
// Need to finish port to Linux. See http://crbug.com/39916 for details.
#define MAYBE_Infobars DISABLED_Infobars
#endif

IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Infobars) {
  // TODO(finnur): Remove once infobars are no longer experimental (bug 39511).
  CommandLine::ForCurrentProcess()->AppendSwitch(
      switches::kEnableExperimentalExtensionApis);

  ASSERT_TRUE(RunExtensionTest("infobars")) << message_;
}

// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/command_line.h"
#include "chrome/browser/extensions/extension_apitest.h"
#include "chrome/common/chrome_switches.h"

#if defined(TOOLKIT_VIEWS)
#define MAYBE_Infobars Infobars
#else
// Need to finish port to Linux. See http://crbug.com/39916 for details.
// Also disabled on mac.  See http://crbug.com/60990.
#define MAYBE_Infobars DISABLED_Infobars
#endif

IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Infobars) {
  // TODO(finnur): Remove once infobars are no longer experimental (bug 39511).
  CommandLine::ForCurrentProcess()->AppendSwitch(
      switches::kEnableExperimentalExtensionApis);

  ASSERT_TRUE(RunExtensionTest("infobars")) << message_;
}

Disable ExtensionApiTest.Infobars on Mac, as it is flaky.


#include <gtest/gtest.h>

#ifndef NDEBUG
#define NDEBUG
#endif
#define SM_ALWAYS_ASSERT
#include <sm/assert_macros.hpp>

TEST(SmCommonTestSuite,testAssertMacrosAlwaysAssert)
{
  SM_DEFINE_EXCEPTION(Exception, std::runtime_error);
  EXPECT_THROW( SM_ASSERT_TRUE_DBG(Exception, false, ""), Exception);
}

#include <gtest/gtest.h>

#ifndef NDEBUG
#define NDEBUG
#endif
#ifndef SM_ALWAYS_ASSERT
#define SM_ALWAYS_ASSERT
#endif
#include <sm/assert_macros.hpp>

TEST(SmCommonTestSuite,testAssertMacrosAlwaysAssert)
{
  SM_DEFINE_EXCEPTION(Exception, std::runtime_error);
  EXPECT_THROW( SM_ASSERT_TRUE_DBG(Exception, false, ""), Exception);
}

Add another guard against multiple definition


/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 */

#include "NativeLabelObject.h"
#include <bb/cascades/Color>
#include <QColor>

NativeLabelObject::NativeLabelObject(TiObject* tiObject)
    : NativeAbstractTextControlObject(tiObject, N_TYPE_LABEL)
{
    label_ = NULL;
}

NativeLabelObject::~NativeLabelObject()
{
}

NativeLabelObject* NativeLabelObject::createLabel(TiObject* tiObject)
{
    return new NativeLabelObject(tiObject);
}

NATIVE_TYPE NativeLabelObject::getObjectType() const
{
    return N_TYPE_LABEL;
}

int NativeLabelObject::initialize()
{
    label_ = bb::cascades::Label::create();
    setTextControl(label_);
    // TODO: Set label layout here
    return NATIVE_ERROR_OK;
}

int NativeLabelObject::setWordWrap(TiObject* obj)
{
	bool multilined;
    getBoolean(obj, &multilined);

	label_->setMultiline(multilined);
    return NATIVE_ERROR_OK;
}

/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2012 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 */

#include "NativeLabelObject.h"
#include <bb/cascades/Color>
#include <QColor>

NativeLabelObject::NativeLabelObject(TiObject* tiObject)
    : NativeAbstractTextControlObject(tiObject, N_TYPE_LABEL)
{
    label_ = NULL;
}

NativeLabelObject::~NativeLabelObject()
{
}

NativeLabelObject* NativeLabelObject::createLabel(TiObject* tiObject)
{
    return new NativeLabelObject(tiObject);
}

NATIVE_TYPE NativeLabelObject::getObjectType() const
{
    return N_TYPE_LABEL;
}

int NativeLabelObject::initialize()
{
    label_ = bb::cascades::Label::create();
	label_->setMultiline(true);
    setTextControl(label_);
    // TODO: Set label layout here
    return NATIVE_ERROR_OK;
}

int NativeLabelObject::setWordWrap(TiObject* obj)
{
	bool multilined;
    getBoolean(obj, &multilined);

	label_->setMultiline(multilined);
    return NATIVE_ERROR_OK;
}

Set multiline on labels default


// 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/browser_process.h"

#include "chrome/browser/printing/print_job_manager.h"
#include "ui/base/l10n/l10n_util.h"

BrowserProcess* g_browser_process = NULL;

BrowserProcess::BrowserProcess() {
  g_browser_process = this;

  print_job_manager_.reset(new printing::PrintJobManager);
}

BrowserProcess::~BrowserProcess() {
  g_browser_process = NULL;
}

std::string BrowserProcess::GetApplicationLocale() {
  return l10n_util::GetApplicationLocale("");
}

printing::PrintJobManager* BrowserProcess::print_job_manager() {
  return print_job_manager_.get();
}

// 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/browser_process.h"

#include "chrome/browser/printing/print_job_manager.h"
#include "ui/base/l10n/l10n_util.h"

BrowserProcess* g_browser_process = NULL;

BrowserProcess::BrowserProcess()
    : print_job_manager_(new printing::PrintJobManager) {
  g_browser_process = this;
}

BrowserProcess::~BrowserProcess() {
  g_browser_process = NULL;
}

std::string BrowserProcess::GetApplicationLocale() {
  return l10n_util::GetApplicationLocale("");
}

printing::PrintJobManager* BrowserProcess::print_job_manager() {
  return print_job_manager_.get();
}

Reorder BrowserProcess constructor to avoid invalid memory


#include <algorithm>

#include "env.hh"
#include "parse_args.hh"
#include "consumer.hh"

using namespace std;
using namespace boost::filesystem;

int main(int argc, char** argv) {
    argc--;
    argv++;

    vector<path> files;
    string playlist;
    parse_args(argc, argv, files, playlist);

    Consumer consumer(std::move(playlist));
    for (auto& file : files) {
        consumer.consume(std::move(file));
    }
}

#include <algorithm>

#include "env.hh"
#include "parse_args.hh"
#include "consumer.hh"

using namespace std;
using namespace boost::filesystem;

int main(int argc, char** argv) {
    argc--;
    argv++;

    vector<path> files;
    string playlist;
    parse_args(argc, argv, files, playlist);

    Consumer consumer(std::move(playlist));
    for (const auto& file : files) {
        consumer.consume(file);
    }
}

Revert "Move each `file` into the `Consumer::consume` method."


#include "perf_precomp.hpp"

using namespace std;
using namespace cv;
using namespace perf;

typedef TestBaseWithParam< pair<string, string> > ImagePair;

pair<string, string> impair(const char* im1, const char* im2)
{
    return make_pair(string(im1), string(im2));
}

PERF_TEST_P(ImagePair, OpticalFlowDual_TVL1, testing::Values(impair("cv/optflow/RubberWhale1.png", "cv/optflow/RubberWhale2.png")))
{
    declare.time(40);

    Mat frame1 = imread(getDataPath(GetParam().first), IMREAD_GRAYSCALE);
    Mat frame2 = imread(getDataPath(GetParam().second), IMREAD_GRAYSCALE);
    ASSERT_FALSE(frame1.empty());
    ASSERT_FALSE(frame2.empty());

    Mat flow;

    OpticalFlowDual_TVL1 tvl1;

    TEST_CYCLE()
    {
        tvl1(frame1, frame2, flow);
    }

    SANITY_CHECK(flow, 0.02);
}

#include "perf_precomp.hpp"

using namespace std;
using namespace cv;
using namespace perf;

typedef TestBaseWithParam< pair<string, string> > ImagePair;

pair<string, string> impair(const char* im1, const char* im2)
{
    return make_pair(string(im1), string(im2));
}

PERF_TEST_P(ImagePair, OpticalFlowDual_TVL1, testing::Values(impair("cv/optflow/RubberWhale1.png", "cv/optflow/RubberWhale2.png")))
{
    declare.time(40);

    Mat frame1 = imread(getDataPath(GetParam().first), IMREAD_GRAYSCALE);
    Mat frame2 = imread(getDataPath(GetParam().second), IMREAD_GRAYSCALE);
    ASSERT_FALSE(frame1.empty());
    ASSERT_FALSE(frame2.empty());

    Mat flow;

    OpticalFlowDual_TVL1 tvl1;

    TEST_CYCLE()
    {
        tvl1(frame1, frame2, flow);
    }

    SANITY_CHECK(flow, 0.5);
}

Set sanity threshold for TVL1 optical flow to 0.5


#include "bitfield.h"
#include "canutil_lpc17xx.h"
#include "canutil.h"
#include "canwrite.h"
#include "log.h"
#include <stdbool.h>

void copyToMessageBuffer(uint64_t source, uint8_t* a, uint8_t* b) {
    for(int i = 0, j = 4; i < 3 && j < 8; i++, j++) {
        a[i] = nthByte(source, i);
        b[i] = nthByte(source, j);
    }
}

bool sendCanMessage(CanBus* bus, CanMessage request) {
    CAN_MSG_Type message;
    message.id =  request.id;
    message.len = 8;
    message.type = DATA_FRAME;
    message.format = STD_ID_FORMAT;
    copyToMessageBuffer(request.data, message.dataA, message.dataB);

    return CAN_SendMsg(CAN_CONTROLLER(bus), &message) == SUCCESS;
}

#include "bitfield.h"
#include "canutil_lpc17xx.h"
#include "canutil.h"
#include "canwrite.h"
#include "log.h"
#include <stdbool.h>

void copyToMessageBuffer(uint64_t source, uint8_t* a, uint8_t* b) {
    for(int i = 0, j = 4; i < 4 && j < 8; i++, j++) {
        a[3 - i] = nthByte(source, j);
        b[3 - i] = nthByte(source, i);
    }
}

bool sendCanMessage(CanBus* bus, CanMessage request) {
    CAN_MSG_Type message;
    message.id =  request.id;
    message.len = 8;
    message.type = DATA_FRAME;
    message.format = STD_ID_FORMAT;
    copyToMessageBuffer(request.data, message.dataA, message.dataB);

    return CAN_SendMsg(CAN_CONTROLLER(bus), &message) == SUCCESS;
}

Fix byte order when writing CAN messages on LPC17xx.


// RUN: %clang_cc1 -fsyntax-only -Wconditional-uninitialized -fsyntax-only %s -verify

class Foo {
public:
  Foo();
  ~Foo();
  operator bool();
};

int bar();
int baz();
int init(double *);

// This case flags a false positive under -Wconditional-uninitialized because
// the destructor in Foo fouls about the minor bit of path-sensitivity in
// -Wuninitialized.
double test() {
  double x; // expected-note {{variable 'x' is declared here}} expected-note{{add initialization to silence this warning}}
  if (bar() || baz() || Foo() || init(&x)) {
    return x; // expected-warning {{variable 'x' is possibly uninitialized when used here}}
  }
  return 1.0;
}

// RUN: %clang_cc1 -fsyntax-only -Wconditional-uninitialized -fsyntax-only %s -verify

class Foo {
public:
  Foo();
  ~Foo();
  operator bool();
};

int bar();
int baz();
int init(double *);

// This case flags a false positive under -Wconditional-uninitialized because
// the destructor in Foo fouls about the minor bit of path-sensitivity in
// -Wuninitialized.
double test() {
  double x; // expected-note {{variable 'x' is declared here}} expected-note{{add initialization to silence this warning}}
  if (bar() || baz() || Foo() || init(&x))
    return 1.0;

  return x; // expected-warning {{variable 'x' is possibly uninitialized when used here}}
}

Fix test to test the right thing.


#include <QApplication>

#include "mainwindow.h"

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    MainWindow w;
    w.show();

    return a.exec();
}

#include <QApplication>

#include "mainwindow.h"

int main(int argc, char *argv[])
{
    QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);

    QApplication a(argc, argv);

    MainWindow w;
    w.show();

    return a.exec();
}

Enable HiDPI for the demo app.


// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s
//
// Ensure that when we use builtins in C++ code with templates that compute the
// valid immediate, the dead code with the invalid immediate doesn't error.

typedef short __v8hi __attribute__((__vector_size__(16)));

template <int Imm>
__v8hi test(__v8hi a) {
    if (Imm < 4)
      return __builtin_ia32_pshuflw(a, 0x55 * Imm);
    else
      return __builtin_ia32_pshuflw(a, 0x55 * (Imm - 4));
}

template __v8hi test<0>(__v8hi);
template __v8hi test<1>(__v8hi);
template __v8hi test<2>(__v8hi);
template __v8hi test<3>(__v8hi);
template __v8hi test<4>(__v8hi);
template __v8hi test<5>(__v8hi);
template __v8hi test<6>(__v8hi);
template __v8hi test<7>(__v8hi);

// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s
//
// Ensure that when we use builtins in C++ code with templates that compute the
// valid immediate, the dead code with the invalid immediate doesn't error.
// expected-no-diagnostics

typedef short __v8hi __attribute__((__vector_size__(16)));

template <int Imm>
__v8hi test(__v8hi a) {
    if (Imm < 4)
      return __builtin_ia32_pshuflw(a, 0x55 * Imm);
    else
      return __builtin_ia32_pshuflw(a, 0x55 * (Imm - 4));
}

template __v8hi test<0>(__v8hi);
template __v8hi test<1>(__v8hi);
template __v8hi test<2>(__v8hi);
template __v8hi test<3>(__v8hi);
template __v8hi test<4>(__v8hi);
template __v8hi test<5>(__v8hi);
template __v8hi test<6>(__v8hi);
template __v8hi test<7>(__v8hi);

Fix a tiny bug in my test case in r335309 by marking that we don't expect any diagnostics.


// RUN: %clang_cc1 -fsyntax-only -verify %s

class Base { };
class Derived1 : public Base { };
class Derived2 : public Base { };

void f0(volatile Base *b, Derived1 *d1, const Derived2 *d2) {
  if (b > d1)
    return;
  if (d1 <= b)
    return;
  if (b > d2)
    return;
  if (d1 >= d2) // expected-error{{comparison of distinct}}
    return;
}

void f1(volatile Base *b, Derived1 *d1, const Derived2 *d2) {
  if (b == d1)
    return;
  if (d1 == b)
    return;
  if (b != d2)
    return;
  if (d1 == d2) // expected-error{{comparison of distinct}}
    return;
}

// PR4691
int ptrcmp1(void *a, int *b) {
  return a < b;
}
int ptrcmp2(long *a, int *b) {
  return a < b; // expected-error{{distinct}}
}

// PR5509 - Multi-level pointers
int f2() {
  typedef int *IntPtr;
  typedef IntPtr *IntPtrPtr;
  typedef IntPtr const *IntPtrConstPtr;
  IntPtrConstPtr i = 0;
  IntPtrPtr j = 0;
  return i != j;
}

// PR5763
typedef double Matrix4[4][4];

bool f(Matrix4 m1, const Matrix4 m2) {
  return m1 != m2;
}

Add test case from PR5763


#include <Halide.h>
#include <stdio.h>

using namespace Halide;

int main(int argc, char **argv) {
    Func f;
    Var x;

    ImageParam input(Float(32), 1);

    f(x) = input(cast<int>(round(0.3f * ceil(0.4f * floor(x * 22.5f)))));

    f.infer_input_bounds(10);

    Image<float> in = input.get();

    int correct = roundf(0.3f * ceilf(0.4f * floorf(9 * 22.5f))) + 1;
    if (in.width() != correct) {
        printf("Width is %d instead of %d\n", in.width(), correct);
        return -1;
    }

    printf("Success!\n");
    return 0;
}

#include <Halide.h>
#include <stdio.h>

using namespace Halide;

int main(int argc, char **argv) {
    Func f;
    Var x;

    ImageParam input(Float(32), 1);

    f(x) = input(cast<int>(ceil(0.3f * ceil(0.4f * floor(x * 22.5f)))));

    f.infer_input_bounds(10);

    Image<float> in = input.get();

    int correct = 26;
    if (in.width() != correct) {
        printf("Width is %d instead of %d\n", in.width(), correct);
        return -1;
    }

    printf("Success!\n");
    return 0;
}

Remove roundf from test because windows


#define CATCH_CONFIG_RUNNER
#include <catch.hpp>
#include <iostream>
#include <mipp.h>

int main(int argc, char* argv[])
{
	std::cout << "MIPP tests" << std::endl;
	std::cout << "----------" << std::endl << std::endl;

	std::cout << "Instr. type:       " << mipp::InstructionType                  << std::endl;
	std::cout << "Instr. full type:  " << mipp::InstructionFullType              << std::endl;
	std::cout << "Instr. version:    " << mipp::InstructionVersion               << std::endl;
	std::cout << "Instr. size:       " << mipp::RegisterSizeBit       << " bits" << std::endl;
	std::cout << "Instr. lanes:      " << mipp::Lanes                            << std::endl;
	std::cout << "64-bit support:    " << (mipp::Support64Bit    ? "yes" : "no") << std::endl;
	std::cout << "Byte/word support: " << (mipp::SupportByteWord ? "yes" : "no") << std::endl;
	std::cout << std::endl;

	int result = Catch::Session().run(argc, argv);

	return result;
}

#define CATCH_CONFIG_RUNNER
#include <catch.hpp>
#include <iostream>
#include <mipp.h>

int main(int argc, char* argv[])
{
	std::cout << "MIPP tests" << std::endl;
	std::cout << "----------" << std::endl << std::endl;

	std::cout << "Instr. type:       " << mipp::InstructionType                  << std::endl;
	std::cout << "Instr. full type:  " << mipp::InstructionFullType              << std::endl;
	std::cout << "Instr. version:    " << mipp::InstructionVersion               << std::endl;
	std::cout << "Instr. size:       " << mipp::RegisterSizeBit       << " bits" << std::endl;
	std::cout << "Instr. lanes:      " << mipp::Lanes                            << std::endl;
	std::cout << "64-bit support:    " << (mipp::Support64Bit    ? "yes" : "no") << std::endl;
	std::cout << "Byte/word support: " << (mipp::SupportByteWord ? "yes" : "no") << std::endl;
	auto ext = mipp::InstructionExtensions();
	if (ext.size() > 0)
	{
		std::cout << "Instr. extensions: {";
		for (auto i = 0; i < (int)ext.size(); i++)
			std::cout << ext[i] << (i < ((int)ext.size() -1) ? ", " : "");
		std::cout << "}" << std::endl;
	}
	std::cout << std::endl;

	int result = Catch::Session().run(argc, argv);

	return result;
}

Put back the extensions display.


// Copyright (c) 2013, Zeex
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
//    this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#include <ctime>
#include <iostream>
#include <vector>
#include "statistics_writer.h"

namespace amx_profiler {

StatisticsWriter::StatisticsWriter()
	: print_date_(false)
{
}

} // namespace amx_profiler

// Copyright (c) 2013, Zeex
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
//    this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
//    this list of conditions and the following disclaimer in the documentation
//    and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#include <ctime>
#include <iostream>
#include <vector>
#include "statistics_writer.h"

namespace amx_profiler {

StatisticsWriter::StatisticsWriter()
	: stream_(0)
	, print_date_(false)
	, print_run_time_(false)
{
}

} // namespace amx_profiler

Fix members of StatisticsWriter not being initialized


// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>

using namespace vespalib;

void testDebug() {
    TEST_DEBUG("lhs.out", "rhs.out");
    EXPECT_EQUAL("a\n"
               "b\n"
               "c\n",

               "a\n"
               "b\n"
               "c\n"
               "d\n");
    EXPECT_EQUAL("a\n"
               "d\n"
               "b\n"
               "c\n",

               "a\n"
               "b\n"
               "c\n"
               "d\n");
    EXPECT_EQUAL(1, 2);
    EXPECT_EQUAL("foo", "bar");
}

TEST_MAIN() {
    testDebug();
}

// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#include <vespa/vespalib/testkit/test_kit.h>

using namespace vespalib;

void testDebug() {
    TEST_DEBUG("lhs.out", "rhs.out");
    EXPECT_EQUAL(string("a\n"
                        "b\n"
                        "c\n"),

                string("a\n"
                       "b\n"
                       "c\n"
                       "d\n"));
    EXPECT_EQUAL(string("a\n"
                        "d\n"
                        "b\n"
                        "c\n"),

                 string("a\n"
                        "b\n"
                        "c\n"
                        "d\n"));
    EXPECT_EQUAL(1, 2);
    EXPECT_EQUAL(string("foo"), string("bar"));
}

TEST_MAIN() {
    testDebug();
}

Stop trying to compare arrays (deprecated in C++20)


// Copyright (c) 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 "chrome/browser/metrics/variations/variations_request_scheduler.h"

namespace chrome_variations {

namespace {

// Time between seed fetches, in hours.
const int kSeedFetchPeriodHours = 5;

}  // namespace

VariationsRequestScheduler::VariationsRequestScheduler(
    const base::Closure& task) : task_(task) {
}

VariationsRequestScheduler::~VariationsRequestScheduler() {
}

void VariationsRequestScheduler::Start() {
  // Call the task and repeat it periodically.
  task_.Run();
  timer_.Start(FROM_HERE, base::TimeDelta::FromHours(kSeedFetchPeriodHours),
               task_);
}

void VariationsRequestScheduler::Reset() {
  if (timer_.IsRunning())
    timer_.Reset();
}

base::Closure VariationsRequestScheduler::task() const {
  return task_;
}

#if !defined(OS_ANDROID)
// static
VariationsRequestScheduler* VariationsRequestScheduler::Create(
    const base::Closure& task,
    PrefService* local_state) {
  return new VariationsRequestScheduler(task);
}
#endif  // !defined(OS_ANDROID)

}  // namespace chrome_variations

// Copyright (c) 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 "chrome/browser/metrics/variations/variations_request_scheduler.h"

namespace chrome_variations {

namespace {

// Time between seed fetches, in hours.
const int kSeedFetchPeriodHours = 5;

}  // namespace

VariationsRequestScheduler::VariationsRequestScheduler(
    const base::Closure& task) : task_(task) {
}

VariationsRequestScheduler::~VariationsRequestScheduler() {
}

void VariationsRequestScheduler::Start() {
  // Call the task and repeat it periodically.
  task_.Run();
  timer_.Start(FROM_HERE, base::TimeDelta::FromHours(kSeedFetchPeriodHours),
               task_);
}

void VariationsRequestScheduler::Reset() {
  if (timer_.IsRunning())
    timer_.Reset();
}

base::Closure VariationsRequestScheduler::task() const {
  return task_;
}

#if !defined(OS_ANDROID) && !defined(OS_IOS)
// static
VariationsRequestScheduler* VariationsRequestScheduler::Create(
    const base::Closure& task,
    PrefService* local_state) {
  return new VariationsRequestScheduler(task);
}
#endif  // !defined(OS_ANDROID) && !defined(OS_IOS)

}  // namespace chrome_variations

Use the correct VariationsRequestScheduler on iOS.


// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/WebKit/chromium/public/WebView.h"
#include "webkit/tools/test_shell/test_shell_test.h"

using WebKit::WebView;

class WebViewTest : public TestShellTest {
};

TEST_F(WebViewTest, GetContentAsPlainText) {
  WebView* view = test_shell_->webView();
  ASSERT_TRUE(view != 0);

  view->setIsActive(true);
  EXPECT_TRUE(view->isActive());

  view->setIsActive(false);
  EXPECT_FALSE(view->isActive());

  view->setIsActive(true);
  EXPECT_TRUE(view->isActive());
}

// TODO(viettrungluu): add more tests

// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/WebKit/WebKit/chromium/public/WebView.h"
#include "webkit/tools/test_shell/test_shell_test.h"

using WebKit::WebView;

class WebViewTest : public TestShellTest {
};

TEST_F(WebViewTest, ActiveState) {
  WebView* view = test_shell_->webView();
  ASSERT_TRUE(view != 0);

  view->setIsActive(true);
  EXPECT_TRUE(view->isActive());

  view->setIsActive(false);
  EXPECT_FALSE(view->isActive());

  view->setIsActive(true);
  EXPECT_TRUE(view->isActive());
}

// TODO(viettrungluu): add more tests

Rename unit test: WebViewTest.GetContentAsPlainText -> WebViewTest.ActiveState.


// RUN: c-index-test -test-load-source all -c %s -fsyntax-only -target x86_64-apple-darwin9 -fcoroutines-ts -std=c++1z -I%S/../SemaCXX/Inputs | FileCheck %s
#include "std-coroutine.h"

using std::experimental::suspend_always;
using std::experimental::suspend_never;

struct promise_void {
  void get_return_object();
  suspend_always initial_suspend();
  suspend_always final_suspend();
  void return_void();
  void unhandled_exception();
};

template <>
struct std::experimental::coroutine_traits<void> { using promise_type = promise_void; };

void CoroutineTestRet() {
  co_return;
}
// CHECK: [[@LINE-3]]:25: UnexposedStmt=
// CHECK-SAME: [[@LINE-4]]:25 - [[@LINE-2]]:2]
// CHECK: [[@LINE-4]]:5: UnexposedStmt=
// CHECK-SAME: [[@LINE-5]]:5 - [[@LINE-5]]:14]

// RUN: c-index-test -test-load-source all -c %s -fsyntax-only -target x86_64-apple-darwin9 -fcoroutines-ts -std=c++1z -I%S/../SemaCXX/Inputs | FileCheck %s
#include "std-coroutine.h"

using std::experimental::suspend_always;
using std::experimental::suspend_never;

struct promise_void {
  void get_return_object();
  suspend_always initial_suspend();
  suspend_always final_suspend();
  void return_void();
  void unhandled_exception();
};

template <>
struct std::experimental::coroutine_traits<void> { using promise_type = promise_void; };

void CoroutineTestRet() {
  co_return;
}
// CHECK: [[@LINE-3]]:25: UnexposedStmt=
// CHECK-SAME: [[@LINE-4]]:25 - [[@LINE-2]]:2]
// CHECK: [[@LINE-4]]:3: UnexposedStmt=
// CHECK-SAME: [[@LINE-5]]:3 - [[@LINE-5]]:12]

Fix incorrect column numbers in test from r350282.


#include "main_state.hpp"
#include "system_movement.hpp"
#include "system_draw.hpp"
#include "entityx/entityx.h"
#include <SDL2/SDL.h>

MainState::MainState(Game *game) : m_game(game) {}

MainState::~MainState(){}

int MainState::init() {
	m_systems.add<MovementSystem>();
	m_systems.add<DrawSystem>(m_game);
    return 0;
}

void MainState::update(double dt) {
    SDL_Event e;
    while (SDL_PollEvent(&e)) {
        if (e.type == SDL_QUIT) {
            m_game->shutdown();
        }
        if (e.type == SDL_KEYDOWN) {
            if(e.key.keysym.sym == SDLK_ESCAPE) {
                m_game->shutdown();
            }
        }
    }

    SDL_SetRenderDrawColor(m_game->get_renderer(), 0, 100, 200, 255);
    SDL_RenderClear(m_game->get_renderer());
    SDL_RenderPresent(m_game->get_renderer());

    m_systems.update<MovementSystem>(dt);
    m_systems.update<DrawSystem>(dt);
}

#include "main_state.hpp"
#include "system_movement.hpp"
#include "system_draw.hpp"
#include "entityx/entityx.h"
#include <SDL2/SDL.h>

MainState::MainState(Game *game) : m_game(game) {}

MainState::~MainState(){}

int MainState::init() {
	m_systems.add<MovementSystem>();
	m_systems.add<DrawSystem>(m_game);
    m_systems.configure();
    return 0;
}

void MainState::update(double dt) {
    SDL_Event e;
    while (SDL_PollEvent(&e)) {
        if (e.type == SDL_QUIT) {
            m_game->shutdown();
        }
        if (e.type == SDL_KEYDOWN) {
            if(e.key.keysym.sym == SDLK_ESCAPE) {
                m_game->shutdown();
            }
        }
    }

    SDL_SetRenderDrawColor(m_game->get_renderer(), 0, 100, 200, 255);
    SDL_RenderClear(m_game->get_renderer());
    SDL_RenderPresent(m_game->get_renderer());

    m_systems.update<MovementSystem>(dt);
    m_systems.update<DrawSystem>(dt);
}

Configure entityx systems after init


///////////////////////////////////////////////////////////////////////
// File:        dotproduct.h
// Description: Native dot product function.
//
// (C) Copyright 2018, 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 to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////

#include "dotproduct.h"

namespace tesseract {

// Computes and returns the dot product of the two n-vectors u and v.
double DotProductNative(const double *u, const double *v, int n) {
  double total = 0.0;
#if defined(OPENMP_SIMD)
#pragma omp simd reduction(+:total)
#endif
  for (int k = 0; k < n; ++k) {
    total += u[k] * v[k];
  }
  return total;
}

} // namespace tesseract

///////////////////////////////////////////////////////////////////////
// File:        dotproduct.h
// Description: Native dot product function.
//
// (C) Copyright 2018, 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 to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
///////////////////////////////////////////////////////////////////////

#include "dotproduct.h"

namespace tesseract {

// Computes and returns the dot product of the two n-vectors u and v.
double DotProductNative(const double *u, const double *v, int n) {
  double total = 0.0;
#if defined(OPENMP_SIMD) || defined(_OPENMP)
#pragma omp simd reduction(+:total)
#endif
  for (int k = 0; k < n; ++k) {
    total += u[k] * v[k];
  }
  return total;
}

} // namespace tesseract

Enable pragma for SIMD also when _OPENMP is defined


// This is the starting point
//
#include <iostream>

int main() {
    std::string greeting("Welcome to RGrep-CPP");
    std::cout << greeting << std::endl;
    std::string firstInputString;
    std::string secondInputString;

    std::cout << "Enter the first string" << std::endl;
    std::cin >> firstInputString;
    std::cout << "Enter the second string" << std::endl;
    std::cin >> secondInputString;

    if (firstInputString == secondInputString) {
        std::cout << "Match!" << std::endl;

    }

    return 0;
}

// This is the starting point
//
#include <iostream>
#include <fstream>
#include <sstream>

int main() {
    std::string greeting("Welcome to RGrep-CPP");
    std::cout << greeting << std::endl;
    std::string firstInputString;
    std::string secondInputString;

    std::cout << "Enter the first string" << std::endl;
    std::cin >> firstInputString;
    std::cout << "Enter the second string" << std::endl;
    std::cin >> secondInputString;

    if (firstInputString == secondInputString) {
        std::cout << "Match!" << std::endl;
    }

    std::string fileName;
    std::cout << "Enter a filename in which to look for the string" << std::endl;
    std::cin >> fileName;

    std::ifstream fileInputStream(fileName);
    std::string line;
    if (fileInputStream.is_open()) {
        std::cout << "Successfully opened " << fileName << std::endl;
        while(true) {
            if (fileInputStream.fail()) {
                std::cout << "The file input stream went into an error state" << std::endl;
                break;
            }
            getline(fileInputStream, line);
            std::cout << line << std::endl;
            if (firstInputString == line) {
                std::cout << "Match!" << std::endl;
            }
        }
    } else {
        std::cout << "Could not open file for reading" << std::endl;
    }

    return 0;
}

Add funtionality to match in files


//===- llvm/System/Darwin/Path.cpp - Linux Path Implementation --*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by Reid Spencer and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file provides the Darwin specific implementation of the Path class.
//
//===----------------------------------------------------------------------===//

//===----------------------------------------------------------------------===//
//=== WARNING: Implementation here must contain only Darwin specific code
//===          and must not be generic UNIX code (see ../Unix/Path.cpp)
//===----------------------------------------------------------------------===//

// Include the generic unix implementation
#include "../Unix/Path.cpp"

namespace llvm {
using namespace sys;

bool
Path::is_valid() const {
  if (path.empty())
    return false;
  if (path.length() >= MAXPATHLEN)
    return false;
  return true;
}

Path
Path::GetTemporaryDirectory() {
  char pathname[MAXPATHLEN];
  strcpy(pathname,"/tmp/llvm_XXXXXX");
  if (0 == mkdtemp(pathname))
    ThrowErrno(std::string(pathname) + ": Can't create temporary directory");
  Path result;
  result.set_directory(pathname);
  assert(result.is_valid() && "mkdtemp didn't create a valid pathname!");
  return result;
}

std::string
Path::GetDLLSuffix() {
  return "dyld";
}

}

// vim: sw=2 smartindent smarttab tw=80 autoindent expandtab

//===- llvm/System/Darwin/Path.cpp - Linux Path Implementation --*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by Reid Spencer and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file provides the Darwin specific implementation of the Path class.
//
//===----------------------------------------------------------------------===//

//===----------------------------------------------------------------------===//
//=== WARNING: Implementation here must contain only Darwin specific code
//===          and must not be generic UNIX code (see ../Unix/Path.cpp)
//===----------------------------------------------------------------------===//

// Include the generic unix implementation
#include "../Unix/Path.cpp"

namespace llvm {
using namespace sys;

bool
Path::is_valid() const {
  if (path.empty())
    return false;
  if (path.length() >= MAXPATHLEN)
    return false;
  return true;
}

Path
Path::GetTemporaryDirectory() {
  char pathname[MAXPATHLEN];
  strcpy(pathname,"/tmp/llvm_XXXXXX");
  if (0 == mkdtemp(pathname))
    ThrowErrno(std::string(pathname) + ": Can't create temporary directory");
  Path result;
  result.set_directory(pathname);
  assert(result.is_valid() && "mkdtemp didn't create a valid pathname!");
  return result;
}

std::string
Path::GetDLLSuffix() {
  return "dylib";
}

}

// vim: sw=2 smartindent smarttab tw=80 autoindent expandtab

Correct the dynamic lib suffix on Darwin.


/*
 * DialogPassword.cpp
 *
 *  Created on: 01.01.2017
 *      Author: felix
 */

#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QVBoxLayout>
#include <frontend/DialogPassword.h>

namespace Flix {

DialogPassword::DialogPassword(QWidget *parent, Qt::WindowFlags flags):
    QDialog(parent, flags)
{
    setWindowTitle(tr("Password dialog"));
    initLayout();
}

DialogPassword::~DialogPassword()
{
}

QString DialogPassword::getPassword(void) const
{
    return editPassword->text();
}

void DialogPassword::initLayout(void)
{
    QVBoxLayout* layout = new QVBoxLayout(this);

    layout->addWidget(new QLabel(tr("Please enter the password") + ":"));

    editPassword = new QLineEdit();
    editPassword->setEchoMode(QLineEdit::EchoMode::Password);
    layout->addWidget(editPassword);

    QHBoxLayout* layoutDialogButtons = new QHBoxLayout();
    buttonOk = new QPushButton(tr("OK"));
    connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
    layoutDialogButtons->addWidget(buttonOk);
    buttonCancel = new QPushButton(tr("Cancel"));
    connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
    layoutDialogButtons->addWidget(buttonCancel);

    layout->addLayout(layoutDialogButtons);
}

} /* namespace Flix */

/*
 * DialogPassword.cpp
 *
 *  Created on: 01.01.2017
 *      Author: felix
 */

#include <QtWidgets/QHBoxLayout>
#include <QtWidgets/QLabel>
#include <QtWidgets/QVBoxLayout>
#include <frontend/DialogPassword.h>

namespace Flix {

DialogPassword::DialogPassword(QWidget *parent, Qt::WindowFlags flags):
    QDialog(parent, flags)
{
    setWindowTitle(tr("Password dialog"));
    initLayout();
}

DialogPassword::~DialogPassword()
{
}

QString DialogPassword::getPassword(void) const
{
    return editPassword->text();
}

void DialogPassword::initLayout(void)
{
    QVBoxLayout* layout = new QVBoxLayout(this);

    layout->addWidget(new QLabel(tr("Please enter the password") + ":"));

    editPassword = new QLineEdit();
    editPassword->setEchoMode(QLineEdit::EchoMode::Password);
    layout->addWidget(editPassword);

    QHBoxLayout* layoutDialogButtons = new QHBoxLayout();
    buttonOk = new QPushButton(tr("OK"));
    connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
    layoutDialogButtons->addWidget(buttonOk);
    buttonCancel = new QPushButton(tr("Cancel"));
    connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
    layoutDialogButtons->addWidget(buttonCancel);

    layout->addLayout(layoutDialogButtons);

    editPassword->setFocus();
}

} /* namespace Flix */

Enforce focus for the line edit.


// RUN: %clang_cc1 -std=c++11 -verify %s

using size_t = decltype(sizeof(int));
void operator "" wibble(const char *); // expected-warning {{user-defined literal suffixes not starting with '_' are reserved; no literal will invoke this operator}}
void operator "" wibble(const char *, size_t); // expected-warning {{user-defined literal suffixes not starting with '_' are reserved; no literal will invoke this operator}}

template<typename T>
void f() {
  // A program containing a reserved ud-suffix is ill-formed.
  // FIXME: Reject these for the right reason.
  123wibble; // expected-error {{suffix 'wibble'}}
  123.0wibble; // expected-error {{suffix 'wibble'}}
  const char *p = ""wibble; // expected-error {{invalid suffix on literal; C++11 requires a space between literal and identifier}} expected-error {{expected ';'}}
  const char *q = R"x("hello")x"wibble; // expected-error {{invalid suffix on literal; C++11 requires a space between literal and identifier}} expected-error {{expected ';'}}
}

// RUN: %clang_cc1 -std=c++11 -verify %s

using size_t = decltype(sizeof(int));
void operator "" wibble(const char *); // expected-warning {{user-defined literal suffixes not starting with '_' are reserved; no literal will invoke this operator}}
void operator "" wibble(const char *, size_t); // expected-warning {{user-defined literal suffixes not starting with '_' are reserved; no literal will invoke this operator}}

template<typename T>
void f() {
  // A program containing a reserved ud-suffix is ill-formed.
  123wibble; // expected-error {{invalid suffix 'wibble'}}
  123.0wibble; // expected-error {{invalid suffix 'wibble'}}
  const char *p = ""wibble; // expected-error {{invalid suffix on literal; C++11 requires a space between literal and identifier}} expected-error {{expected ';'}}
  const char *q = R"x("hello")x"wibble; // expected-error {{invalid suffix on literal; C++11 requires a space between literal and identifier}} expected-error {{expected ';'}}
}

Remove a test FIXME for a case which is already fixed.


/*
 * Copyright 2011 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

struct GrGLInterface;

const GrGLInterface* GrGLDefaultInterface() {
    return NULL;
}

/*
 * 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 "GrGLInterface.h"

const GrGLInterface* GrGLDefaultInterface() {
    return NULL;
}

Include GrGLInterface.h instead of forward declaring, since we have to get NULL defined anyway.