Bring other get_pointer instances into the scope

--- src/python/helpers/python_wrap_const_shared_ptr.h
+++ src/python/helpers/python_wrap_const_shared_ptr.h
@@ -8,6 +8,7 @@
 #define VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H

 #include <boost/python/pointee.hpp>
+#include <boost/get_pointer.hpp>
 #include <boost/shared_ptr.hpp>

 // Retrieved from http://mail.python.org/pipermail/cplusplus-sig/2006-November/011329.html
@@ -31,6 +32,10 @@
   typedef T type;
 };

+// Don't hide other get_pointer instances.
+using boost::python::get_pointer;
+using boost::get_pointer;
+
 }

 }

<|original_code|>
/*ckwg +5
 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
 * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
 * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
 */

#ifndef VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H
#define VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H

#include <boost/python/pointee.hpp>
#include <boost/shared_ptr.hpp>

// Retrieved from http://mail.python.org/pipermail/cplusplus-sig/2006-November/011329.html
namespace boost
{

namespace python
{

template <typename T>
inline
T*
get_pointer(boost::shared_ptr<T const> const& p)
{
  return const_cast<T*>(p.get());
}

template <typename T>
struct pointee<boost::shared_ptr<T const> >
{
  typedef T type;
};

}

}

#endif // VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H

<|edits_diff|>
--- src/python/helpers/python_wrap_const_shared_ptr.h
+++ src/python/helpers/python_wrap_const_shared_ptr.h
@@ -8,6 +8,7 @@
 #define VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H

 #include <boost/python/pointee.hpp>
+#include <boost/get_pointer.hpp>
 #include <boost/shared_ptr.hpp>

 // Retrieved from http://mail.python.org/pipermail/cplusplus-sig/2006-November/011329.html
<|current_version|>
/*ckwg +5
 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
 * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
 * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
 */

#ifndef VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H
#define VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H

#include <boost/python/pointee.hpp>
#include <boost/get_pointer.hpp>
#include <boost/shared_ptr.hpp>

// Retrieved from http://mail.python.org/pipermail/cplusplus-sig/2006-November/011329.html
namespace boost
{

namespace python
{

template <typename T>
inline
T*
get_pointer(boost::shared_ptr<T const> const& p)
{
  return const_cast<T*>(p.get());
}

template <typename T>
struct pointee<boost::shared_ptr<T const> >
{
  typedef T type;
};

}

}

#endif // VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H

<|next_version|>
/*ckwg +5
 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
 * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
 * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
 */

#ifndef VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H
#define VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H

#include <boost/python/pointee.hpp>
#include <boost/get_pointer.hpp>
#include <boost/shared_ptr.hpp>

// Retrieved from http://mail.python.org/pipermail/cplusplus-sig/2006-November/011329.html
namespace boost
{

namespace python
{

template <typename T>
inline
T*
get_pointer(boost::shared_ptr<T const> const& p)
{
  return const_cast<T*>(p.get());
}

template <typename T>
struct pointee<boost::shared_ptr<T const> >
{
  typedef T type;
};

// Don't hide other get_pointer instances.
using boost::python::get_pointer;
using boost::get_pointer;

}

}

#endif // VISTK_PYTHON_HELPERS_PYTHON_WRAP_CONST_SHARED_PTR_H


r300g: Fix build, invalid extern "C" around header inclusion.

A previous patch to fix header inclusion within extern "C" neglected
to fix the occurences of this pattern in r300 files.

When the helper to detect this issue was pushed to master, it broke
the build for the r300 driver.  This patch fixes the r300 build.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89477
Reviewed-by: Ilia Mirkin <bcbbb7aa705ec3a5fc5824c01a845186c3d62fca@alum.mit.edu>
Reviewed-by: Jose Fonseca <61b5a29db2c0650f7c8510f93eece059c1b09320@vmware.com>

--- src/gallium/drivers/r300/r300_public.h
+++ src/gallium/drivers/r300/r300_public.h
@@ -1,9 +1,17 @@

 #ifndef R300_PUBLIC_H
 #define R300_PUBLIC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif

 struct radeon_winsys;

 struct pipe_screen* r300_screen_create(struct radeon_winsys *rws);

+#ifdef __cplusplus
+} // extern "C"
 #endif
+
+#endif

<|original_code|>

#ifndef R300_PUBLIC_H
#define R300_PUBLIC_H

struct radeon_winsys;

struct pipe_screen* r300_screen_create(struct radeon_winsys *rws);

#endif

<|edits_diff|>
--- src/gallium/drivers/r300/r300_public.h
+++ src/gallium/drivers/r300/r300_public.h
@@ -1,9 +1,15 @@

 #ifndef R300_PUBLIC_H
 #define R300_PUBLIC_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif

 struct radeon_winsys;

 struct pipe_screen* r300_screen_create(struct radeon_winsys *rws);

+#ifdef __cplusplus
+} // extern "C"
 #endif
<|current_version|>

#ifndef R300_PUBLIC_H
#define R300_PUBLIC_H

#ifdef __cplusplus
extern "C" {
#endif

struct radeon_winsys;

struct pipe_screen* r300_screen_create(struct radeon_winsys *rws);

#ifdef __cplusplus
} // extern "C"
#endif

<|next_version|>

#ifndef R300_PUBLIC_H
#define R300_PUBLIC_H

#ifdef __cplusplus
extern "C" {
#endif

struct radeon_winsys;

struct pipe_screen* r300_screen_create(struct radeon_winsys *rws);

#ifdef __cplusplus
} // extern "C"
#endif

#endif


Add a little bit of c++ awareness to the main header

--- ugeneric.h
+++ ugeneric.h
@@ -1,3 +1,7 @@
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 #include "generic.h"
 #include "dict.h"
 #include "vector.h"
@@ -13,3 +17,7 @@
 #include "bitmap.h"
 #include "string_utils.h"
 #include "file_utils.h"
+
+#if defined(__cplusplus)
+}
+#endif

<|original_code|>
#include "generic.h"
#include "dict.h"
#include "vector.h"
#include "list.h"
#include "htbl.h"
#include "dsu.h"
#include "heap.h"
#include "bst.h"
#include "sort.h"
#include "heap.h"
#include "queue.h"
#include "mem.h"
#include "bitmap.h"
#include "string_utils.h"
#include "file_utils.h"

<|edits_diff|>
--- ugeneric.h
+++ ugeneric.h
@@ -1,3 +1,7 @@
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 #include "generic.h"
 #include "dict.h"
 #include "vector.h"
<|current_version|>
#if defined(__cplusplus)
extern "C" {
#endif

#include "generic.h"
#include "dict.h"
#include "vector.h"
#include "list.h"
#include "htbl.h"
#include "dsu.h"
#include "heap.h"
#include "bst.h"
#include "sort.h"
#include "heap.h"
#include "queue.h"
#include "mem.h"
#include "bitmap.h"
#include "string_utils.h"
#include "file_utils.h"

<|next_version|>
#if defined(__cplusplus)
extern "C" {
#endif

#include "generic.h"
#include "dict.h"
#include "vector.h"
#include "list.h"
#include "htbl.h"
#include "dsu.h"
#include "heap.h"
#include "bst.h"
#include "sort.h"
#include "heap.h"
#include "queue.h"
#include "mem.h"
#include "bitmap.h"
#include "string_utils.h"
#include "file_utils.h"

#if defined(__cplusplus)
}
#endif


Fix build under node.js 0.10.0

Fix build under node.js 0.10.0

--- src/common.h
+++ src/common.h
@@ -1,8 +1,10 @@
 #ifndef __COMMON_H__
 #define __COMMON_H__

+#ifdef NODE_VERSION_AT_LEAST
 #if NODE_VERSION_AT_LEAST(0,11,0)
 #define __NODE_V0_11__
+#endif
 #endif

 #endif

<|original_code|>
#ifndef __COMMON_H__
#define __COMMON_H__

#if NODE_VERSION_AT_LEAST(0,11,0)
#define __NODE_V0_11__
#endif

#endif

<|edits_diff|>
--- src/common.h
+++ src/common.h
@@ -1,6 +1,7 @@
 #ifndef __COMMON_H__
 #define __COMMON_H__

+#ifdef NODE_VERSION_AT_LEAST
 #if NODE_VERSION_AT_LEAST(0,11,0)
 #define __NODE_V0_11__
 #endif
<|current_version|>
#ifndef __COMMON_H__
#define __COMMON_H__

#ifdef NODE_VERSION_AT_LEAST
#if NODE_VERSION_AT_LEAST(0,11,0)
#define __NODE_V0_11__
#endif

#endif

<|next_version|>
#ifndef __COMMON_H__
#define __COMMON_H__

#ifdef NODE_VERSION_AT_LEAST
#if NODE_VERSION_AT_LEAST(0,11,0)
#define __NODE_V0_11__
#endif
#endif

#endif


Allow parsing firmware with fwupdtool

solokey: Allow parsing firmware with fwupdtool

--- plugins/solokey/fu-plugin-solokey.c
+++ plugins/solokey/fu-plugin-solokey.c
@@ -9,6 +9,7 @@
 #include "fu-plugin-vfuncs.h"

 #include "fu-solokey-device.h"
+#include "fu-solokey-firmware.h"

 void
 fu_plugin_init (FuPlugin *plugin)
@@ -16,4 +17,5 @@
 	fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
 	fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_SUPPORTS_PROTOCOL, "com.solokeys");
 	fu_plugin_set_device_gtype (plugin, FU_TYPE_SOLOKEY_DEVICE);
+	fu_plugin_add_firmware_gtype (plugin, "solokey", FU_TYPE_SOLOKEY_FIRMWARE);
 }

<|original_code|>
/*
 * Copyright (C) 2019 Richard Hughes <richard@hughsie.com>
 *
 * SPDX-License-Identifier: LGPL-2.1+
 */

#include "config.h"

#include "fu-plugin-vfuncs.h"

#include "fu-solokey-device.h"

void
fu_plugin_init (FuPlugin *plugin)
{
	fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
	fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_SUPPORTS_PROTOCOL, "com.solokeys");
	fu_plugin_set_device_gtype (plugin, FU_TYPE_SOLOKEY_DEVICE);
}

<|edits_diff|>
--- plugins/solokey/fu-plugin-solokey.c
+++ plugins/solokey/fu-plugin-solokey.c
@@ -9,6 +9,7 @@
 #include "fu-plugin-vfuncs.h"

 #include "fu-solokey-device.h"
+#include "fu-solokey-firmware.h"

 void
 fu_plugin_init (FuPlugin *plugin)
<|current_version|>
/*
 * Copyright (C) 2019 Richard Hughes <richard@hughsie.com>
 *
 * SPDX-License-Identifier: LGPL-2.1+
 */

#include "config.h"

#include "fu-plugin-vfuncs.h"

#include "fu-solokey-device.h"
#include "fu-solokey-firmware.h"

void
fu_plugin_init (FuPlugin *plugin)
{
	fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
	fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_SUPPORTS_PROTOCOL, "com.solokeys");
	fu_plugin_set_device_gtype (plugin, FU_TYPE_SOLOKEY_DEVICE);
}

<|next_version|>
/*
 * Copyright (C) 2019 Richard Hughes <richard@hughsie.com>
 *
 * SPDX-License-Identifier: LGPL-2.1+
 */

#include "config.h"

#include "fu-plugin-vfuncs.h"

#include "fu-solokey-device.h"
#include "fu-solokey-firmware.h"

void
fu_plugin_init (FuPlugin *plugin)
{
	fu_plugin_set_build_hash (plugin, FU_BUILD_HASH);
	fu_plugin_add_rule (plugin, FU_PLUGIN_RULE_SUPPORTS_PROTOCOL, "com.solokeys");
	fu_plugin_set_device_gtype (plugin, FU_TYPE_SOLOKEY_DEVICE);
	fu_plugin_add_firmware_gtype (plugin, "solokey", FU_TYPE_SOLOKEY_FIRMWARE);
}


Add comment on why ana.int.wrap_on_signed_overflow needs to enabled for test case

--- tests/regression/01-cpa/10-posneg.c
+++ tests/regression/01-cpa/10-posneg.c
@@ -1,4 +1,5 @@
 //PARAM: --enable ana.int.wrap_on_signed_overflow
+// Enabling ana.int.wrap_on_signed_overflow here, to retain precision for cases when a signed overflow might occcur
 #include<stdio.h>
 #include<assert.h>

@@ -10,6 +11,10 @@
     return 0;
   }
   assert(k != 5);
+
+  // Signed overflows might occur in some of the following operations (e.g. the first assignment k could be MAX_INT).
+  // Signed overflows are undefined behavior, so by default we go to top when they might occur.
+  // Here we activated wrap_on_signed_overflow, so we retain precision, assuming that signed overflows are defined (via the usual two's complement representation).

   // simple arithmetic
   i = k + 1;

<|original_code|>
//PARAM: --enable ana.int.wrap_on_signed_overflow
#include<stdio.h>
#include<assert.h>

int main() {
  int i,k,j;

  if (k == 5) {
    assert(k == 5);
    return 0;
  }
  assert(k != 5);

  // simple arithmetic
  i = k + 1;
  assert(i != 6);
  i = k - 1;
  assert(i != 4);
  i = k * 3;       // multiplication with odd numbers is injective
  assert(i != 15);
  i = k * 2;       // multiplication with even numbers is not injective
  assert(i != 10); // UNKNOWN! k could be -2147483643;
  i = k / 2;
  assert(i != 2); // UNKNOWN! k could be 4

  return 0;
}

<|edits_diff|>
--- tests/regression/01-cpa/10-posneg.c
+++ tests/regression/01-cpa/10-posneg.c
@@ -1,4 +1,5 @@
 //PARAM: --enable ana.int.wrap_on_signed_overflow
+// Enabling ana.int.wrap_on_signed_overflow here, to retain precision for cases when a signed overflow might occcur
 #include<stdio.h>
 #include<assert.h>

<|current_version|>
//PARAM: --enable ana.int.wrap_on_signed_overflow
// Enabling ana.int.wrap_on_signed_overflow here, to retain precision for cases when a signed overflow might occcur
#include<stdio.h>
#include<assert.h>

int main() {
  int i,k,j;

  if (k == 5) {
    assert(k == 5);
    return 0;
  }
  assert(k != 5);

  // simple arithmetic
  i = k + 1;
  assert(i != 6);
  i = k - 1;
  assert(i != 4);
  i = k * 3;       // multiplication with odd numbers is injective
  assert(i != 15);
  i = k * 2;       // multiplication with even numbers is not injective
  assert(i != 10); // UNKNOWN! k could be -2147483643;
  i = k / 2;
  assert(i != 2); // UNKNOWN! k could be 4

  return 0;
}

<|next_version|>
//PARAM: --enable ana.int.wrap_on_signed_overflow
// Enabling ana.int.wrap_on_signed_overflow here, to retain precision for cases when a signed overflow might occcur
#include<stdio.h>
#include<assert.h>

int main() {
  int i,k,j;

  if (k == 5) {
    assert(k == 5);
    return 0;
  }
  assert(k != 5);

  // Signed overflows might occur in some of the following operations (e.g. the first assignment k could be MAX_INT).
  // Signed overflows are undefined behavior, so by default we go to top when they might occur.
  // Here we activated wrap_on_signed_overflow, so we retain precision, assuming that signed overflows are defined (via the usual two's complement representation).

  // simple arithmetic
  i = k + 1;
  assert(i != 6);
  i = k - 1;
  assert(i != 4);
  i = k * 3;       // multiplication with odd numbers is injective
  assert(i != 15);
  i = k * 2;       // multiplication with even numbers is not injective
  assert(i != 10); // UNKNOWN! k could be -2147483643;
  i = k / 2;
  assert(i != 2); // UNKNOWN! k could be 4

  return 0;
}


Fix compilation with namespaced Qt.

QmlDesigner: Fix compilation with namespaced Qt.

Change-Id: I4de7ae4391f57f4c7eac4e5e8b057b8365ca42c9
Reviewed-by: Thomas Hartmann <588ee739c05aab7547907becfd1420d2b7316069@digia.com>

--- src/plugins/qmldesigner/designercore/filemanager/qmlwarningdialog.h
+++ src/plugins/qmldesigner/designercore/filemanager/qmlwarningdialog.h
@@ -3,9 +3,11 @@

 #include <QDialog>

+QT_BEGIN_NAMESPACE
 namespace Ui {
     class QmlWarningDialog;
 }
+QT_END_NAMESPACE

 namespace QmlDesigner {

<|original_code|>
#ifndef QMLWARNINGDIALOG_H
#define QMLWARNINGDIALOG_H

#include <QDialog>

namespace Ui {
    class QmlWarningDialog;
}

namespace QmlDesigner {

namespace Internal {

class QmlWarningDialog : public QDialog
{
    Q_OBJECT

public:
    explicit QmlWarningDialog(QWidget *parent, const QStringList &warnings);
    ~QmlWarningDialog();

    bool warningsEnabled() const;

public slots:
    void ignoreButtonPressed();
    void okButtonPressed();
    void checkBoxToggled(bool);
    void linkClicked(const QString &link);

private:
    Ui::QmlWarningDialog *ui;
    const QStringList m_warnings;
};

} //Internal

} //QmlDesigner

#endif // QMLWARNINGDIALOG_H

<|edits_diff|>
--- src/plugins/qmldesigner/designercore/filemanager/qmlwarningdialog.h
+++ src/plugins/qmldesigner/designercore/filemanager/qmlwarningdialog.h
@@ -3,6 +3,7 @@

 #include <QDialog>

+QT_BEGIN_NAMESPACE
 namespace Ui {
     class QmlWarningDialog;
 }
<|current_version|>
#ifndef QMLWARNINGDIALOG_H
#define QMLWARNINGDIALOG_H

#include <QDialog>

QT_BEGIN_NAMESPACE
namespace Ui {
    class QmlWarningDialog;
}

namespace QmlDesigner {

namespace Internal {

class QmlWarningDialog : public QDialog
{
    Q_OBJECT

public:
    explicit QmlWarningDialog(QWidget *parent, const QStringList &warnings);
    ~QmlWarningDialog();

    bool warningsEnabled() const;

public slots:
    void ignoreButtonPressed();
    void okButtonPressed();
    void checkBoxToggled(bool);
    void linkClicked(const QString &link);

private:
    Ui::QmlWarningDialog *ui;
    const QStringList m_warnings;
};

} //Internal

} //QmlDesigner

#endif // QMLWARNINGDIALOG_H

<|next_version|>
#ifndef QMLWARNINGDIALOG_H
#define QMLWARNINGDIALOG_H

#include <QDialog>

QT_BEGIN_NAMESPACE
namespace Ui {
    class QmlWarningDialog;
}
QT_END_NAMESPACE

namespace QmlDesigner {

namespace Internal {

class QmlWarningDialog : public QDialog
{
    Q_OBJECT

public:
    explicit QmlWarningDialog(QWidget *parent, const QStringList &warnings);
    ~QmlWarningDialog();

    bool warningsEnabled() const;

public slots:
    void ignoreButtonPressed();
    void okButtonPressed();
    void checkBoxToggled(bool);
    void linkClicked(const QString &link);

private:
    Ui::QmlWarningDialog *ui;
    const QStringList m_warnings;
};

} //Internal

} //QmlDesigner

#endif // QMLWARNINGDIALOG_H


Add tests for weak functions

[Sema] Add tests for weak functions

I found these checks to be missing, just add some simple cases.

Differential Revision: https://reviews.llvm.org/D47200

git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@333283 91177308-0d34-0410-b5e6-96231b3b80d8

--- test/Sema/attr-weak.c
+++ test/Sema/attr-weak.c
@@ -1,7 +1,9 @@
 // RUN: %clang_cc1 -verify -fsyntax-only %s

+extern int f0() __attribute__((weak));
 extern int g0 __attribute__((weak));
 extern int g1 __attribute__((weak_import));
+int f2() __attribute__((weak));
 int g2 __attribute__((weak));
 int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
 int __attribute__((weak_import)) g4(void);
@@ -11,6 +13,7 @@
 struct __attribute__((weak)) s0 {}; // expected-warning {{'weak' attribute only applies to variables, functions, and classes}}
 struct __attribute__((weak_import)) s1 {}; // expected-warning {{'weak_import' attribute only applies to variables and functions}}

+static int f() __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}
 static int x __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

 // rdar://9538608

<|original_code|>
// RUN: %clang_cc1 -verify -fsyntax-only %s

extern int g0 __attribute__((weak));
extern int g1 __attribute__((weak_import));
int g2 __attribute__((weak));
int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
int __attribute__((weak_import)) g4(void);
void __attribute__((weak_import)) g5(void) {
}

struct __attribute__((weak)) s0 {}; // expected-warning {{'weak' attribute only applies to variables, functions, and classes}}
struct __attribute__((weak_import)) s1 {}; // expected-warning {{'weak_import' attribute only applies to variables and functions}}

static int x __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

// rdar://9538608
int C; // expected-note {{previous definition is here}}
extern int C __attribute__((weak_import)); // expected-warning {{an already-declared variable is made a weak_import declaration}}

static int pr14946_x;
extern int pr14946_x  __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

static void pr14946_f();
void pr14946_f() __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

<|edits_diff|>
--- test/Sema/attr-weak.c
+++ test/Sema/attr-weak.c
@@ -1,7 +1,9 @@
 // RUN: %clang_cc1 -verify -fsyntax-only %s

+extern int f0() __attribute__((weak));
 extern int g0 __attribute__((weak));
 extern int g1 __attribute__((weak_import));
+int f2() __attribute__((weak));
 int g2 __attribute__((weak));
 int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
 int __attribute__((weak_import)) g4(void);
<|current_version|>
// RUN: %clang_cc1 -verify -fsyntax-only %s

extern int f0() __attribute__((weak));
extern int g0 __attribute__((weak));
extern int g1 __attribute__((weak_import));
int f2() __attribute__((weak));
int g2 __attribute__((weak));
int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
int __attribute__((weak_import)) g4(void);
void __attribute__((weak_import)) g5(void) {
}

struct __attribute__((weak)) s0 {}; // expected-warning {{'weak' attribute only applies to variables, functions, and classes}}
struct __attribute__((weak_import)) s1 {}; // expected-warning {{'weak_import' attribute only applies to variables and functions}}

static int x __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

// rdar://9538608
int C; // expected-note {{previous definition is here}}
extern int C __attribute__((weak_import)); // expected-warning {{an already-declared variable is made a weak_import declaration}}

static int pr14946_x;
extern int pr14946_x  __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

static void pr14946_f();
void pr14946_f() __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

<|next_version|>
// RUN: %clang_cc1 -verify -fsyntax-only %s

extern int f0() __attribute__((weak));
extern int g0 __attribute__((weak));
extern int g1 __attribute__((weak_import));
int f2() __attribute__((weak));
int g2 __attribute__((weak));
int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
int __attribute__((weak_import)) g4(void);
void __attribute__((weak_import)) g5(void) {
}

struct __attribute__((weak)) s0 {}; // expected-warning {{'weak' attribute only applies to variables, functions, and classes}}
struct __attribute__((weak_import)) s1 {}; // expected-warning {{'weak_import' attribute only applies to variables and functions}}

static int f() __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}
static int x __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

// rdar://9538608
int C; // expected-note {{previous definition is here}}
extern int C __attribute__((weak_import)); // expected-warning {{an already-declared variable is made a weak_import declaration}}

static int pr14946_x;
extern int pr14946_x  __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

static void pr14946_f();
void pr14946_f() __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}


Work around byteswap bug in gcc < 4.2

avr32: Work around byteswap bug in gcc < 4.2

gcc versions earlier than 4.2 sign-extends the result of le16_to_cpu()
and friends when we implement __arch__swabX() using
__builtin_bswap_X(). Disable our arch-specific optimizations when those
gcc versions are being used.

Signed-off-by: Haavard Skinnemoen <de7418319212d7eab32260a76732c1f83e514852@atmel.com>

--- include/asm-avr32/byteorder.h
+++ include/asm-avr32/byteorder.h
@@ -12,8 +12,14 @@
 extern unsigned short __builtin_bswap_16(unsigned short x);
 #endif

+/*
+ * avr32-linux-gcc versions earlier than 4.2 improperly sign-extends
+ * the result.
+ */
+#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 2)
 #define __arch__swab32(x) __builtin_bswap_32(x)
 #define __arch__swab16(x) __builtin_bswap_16(x)
+#endif

 #if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
 # define __BYTEORDER_HAS_U64__

<|original_code|>
/*
 * AVR32 endian-conversion functions.
 */
#ifndef __ASM_AVR32_BYTEORDER_H
#define __ASM_AVR32_BYTEORDER_H

#include <asm/types.h>
#include <linux/compiler.h>

#ifdef __CHECKER__
extern unsigned long __builtin_bswap_32(unsigned long x);
extern unsigned short __builtin_bswap_16(unsigned short x);
#endif

#define __arch__swab32(x) __builtin_bswap_32(x)
#define __arch__swab16(x) __builtin_bswap_16(x)

#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
# define __BYTEORDER_HAS_U64__
# define __SWAB_64_THRU_32__
#endif

#include <linux/byteorder/big_endian.h>

#endif /* __ASM_AVR32_BYTEORDER_H */

<|edits_diff|>
--- include/asm-avr32/byteorder.h
+++ include/asm-avr32/byteorder.h
@@ -12,6 +12,11 @@
 extern unsigned short __builtin_bswap_16(unsigned short x);
 #endif

+/*
+ * avr32-linux-gcc versions earlier than 4.2 improperly sign-extends
+ * the result.
+ */
+#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 2)
 #define __arch__swab32(x) __builtin_bswap_32(x)
 #define __arch__swab16(x) __builtin_bswap_16(x)

<|current_version|>
/*
 * AVR32 endian-conversion functions.
 */
#ifndef __ASM_AVR32_BYTEORDER_H
#define __ASM_AVR32_BYTEORDER_H

#include <asm/types.h>
#include <linux/compiler.h>

#ifdef __CHECKER__
extern unsigned long __builtin_bswap_32(unsigned long x);
extern unsigned short __builtin_bswap_16(unsigned short x);
#endif

/*
 * avr32-linux-gcc versions earlier than 4.2 improperly sign-extends
 * the result.
 */
#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 2)
#define __arch__swab32(x) __builtin_bswap_32(x)
#define __arch__swab16(x) __builtin_bswap_16(x)

#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
# define __BYTEORDER_HAS_U64__
# define __SWAB_64_THRU_32__
#endif

#include <linux/byteorder/big_endian.h>

#endif /* __ASM_AVR32_BYTEORDER_H */

<|next_version|>
/*
 * AVR32 endian-conversion functions.
 */
#ifndef __ASM_AVR32_BYTEORDER_H
#define __ASM_AVR32_BYTEORDER_H

#include <asm/types.h>
#include <linux/compiler.h>

#ifdef __CHECKER__
extern unsigned long __builtin_bswap_32(unsigned long x);
extern unsigned short __builtin_bswap_16(unsigned short x);
#endif

/*
 * avr32-linux-gcc versions earlier than 4.2 improperly sign-extends
 * the result.
 */
#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 2)
#define __arch__swab32(x) __builtin_bswap_32(x)
#define __arch__swab16(x) __builtin_bswap_16(x)
#endif

#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
# define __BYTEORDER_HAS_U64__
# define __SWAB_64_THRU_32__
#endif

#include <linux/byteorder/big_endian.h>

#endif /* __ASM_AVR32_BYTEORDER_H */


Document all the public properties and methods

--- PBWebViewController/PBWebViewController.h
+++ PBWebViewController/PBWebViewController.h
@@ -10,10 +10,20 @@

 @interface PBWebViewController : UIViewController <UIWebViewDelegate>

+/**
+ * The URL that will be loaded by the web view controller.
+ * If there is one present when the web view appears, it will be automatically loaded, by calling `load`,
+ * Otherwise, you can set a `URL` after the web view has already been loaded and then manually call `load`.
+ */
 @property (strong, nonatomic) NSURL *URL;

+/** The array of data objects on which to perform the activity. */
 @property (strong, nonatomic) NSArray *activityItems;
+
+/** An array of UIActivity objects representing the custom services that your application supports. */
 @property (strong, nonatomic) NSArray *applicationActivities;
+
+/** The list of services that should not be displayed. */
 @property (strong, nonatomic) NSArray *excludedActivityTypes;

 /**
@@ -23,7 +33,15 @@
  */
 @property (assign, nonatomic) BOOL showsNavigationToolbar;

+/**
+ * Loads the given `URL`. This is called automatically when the when the web view appears if a `URL` exists,
+ * otehrwise it can be called manually.
+ */
 - (void)load;
+
+/**
+ * Clears the contents of the web view.
+ */
 - (void)clear;

 @end

<|original_code|>
//
//  PBWebViewController.h
//  Pinbrowser
//
//  Created by Mikael Konutgan on 11/02/2013.
//  Copyright (c) 2013 Mikael Konutgan. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface PBWebViewController : UIViewController <UIWebViewDelegate>

@property (strong, nonatomic) NSURL *URL;

@property (strong, nonatomic) NSArray *activityItems;
@property (strong, nonatomic) NSArray *applicationActivities;
@property (strong, nonatomic) NSArray *excludedActivityTypes;

/**
 * A Boolean indicating whether the web view controller’s toolbar,
 * which displays a stop/refresh, back, forward and share button, is shown.
 * The default value of this property is `YES`.
 */
@property (assign, nonatomic) BOOL showsNavigationToolbar;

- (void)load;
- (void)clear;

@end

<|edits_diff|>
--- PBWebViewController/PBWebViewController.h
+++ PBWebViewController/PBWebViewController.h
@@ -10,10 +10,20 @@

 @interface PBWebViewController : UIViewController <UIWebViewDelegate>

+/**
+ * The URL that will be loaded by the web view controller.
+ * If there is one present when the web view appears, it will be automatically loaded, by calling `load`,
+ * Otherwise, you can set a `URL` after the web view has already been loaded and then manually call `load`.
+ */
 @property (strong, nonatomic) NSURL *URL;

+/** The array of data objects on which to perform the activity. */
 @property (strong, nonatomic) NSArray *activityItems;
+
+/** An array of UIActivity objects representing the custom services that your application supports. */
 @property (strong, nonatomic) NSArray *applicationActivities;
+
+/** The list of services that should not be displayed. */
 @property (strong, nonatomic) NSArray *excludedActivityTypes;

 /**
@@ -23,6 +33,10 @@
  */
 @property (assign, nonatomic) BOOL showsNavigationToolbar;

+/**
+ * Loads the given `URL`. This is called automatically when the when the web view appears if a `URL` exists,
+ * otehrwise it can be called manually.
+ */
 - (void)load;
 - (void)clear;

<|current_version|>
//
//  PBWebViewController.h
//  Pinbrowser
//
//  Created by Mikael Konutgan on 11/02/2013.
//  Copyright (c) 2013 Mikael Konutgan. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface PBWebViewController : UIViewController <UIWebViewDelegate>

/**
 * The URL that will be loaded by the web view controller.
 * If there is one present when the web view appears, it will be automatically loaded, by calling `load`,
 * Otherwise, you can set a `URL` after the web view has already been loaded and then manually call `load`.
 */
@property (strong, nonatomic) NSURL *URL;

/** The array of data objects on which to perform the activity. */
@property (strong, nonatomic) NSArray *activityItems;

/** An array of UIActivity objects representing the custom services that your application supports. */
@property (strong, nonatomic) NSArray *applicationActivities;

/** The list of services that should not be displayed. */
@property (strong, nonatomic) NSArray *excludedActivityTypes;

/**
 * A Boolean indicating whether the web view controller’s toolbar,
 * which displays a stop/refresh, back, forward and share button, is shown.
 * The default value of this property is `YES`.
 */
@property (assign, nonatomic) BOOL showsNavigationToolbar;

/**
 * Loads the given `URL`. This is called automatically when the when the web view appears if a `URL` exists,
 * otehrwise it can be called manually.
 */
- (void)load;
- (void)clear;

@end

<|next_version|>
//
//  PBWebViewController.h
//  Pinbrowser
//
//  Created by Mikael Konutgan on 11/02/2013.
//  Copyright (c) 2013 Mikael Konutgan. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface PBWebViewController : UIViewController <UIWebViewDelegate>

/**
 * The URL that will be loaded by the web view controller.
 * If there is one present when the web view appears, it will be automatically loaded, by calling `load`,
 * Otherwise, you can set a `URL` after the web view has already been loaded and then manually call `load`.
 */
@property (strong, nonatomic) NSURL *URL;

/** The array of data objects on which to perform the activity. */
@property (strong, nonatomic) NSArray *activityItems;

/** An array of UIActivity objects representing the custom services that your application supports. */
@property (strong, nonatomic) NSArray *applicationActivities;

/** The list of services that should not be displayed. */
@property (strong, nonatomic) NSArray *excludedActivityTypes;

/**
 * A Boolean indicating whether the web view controller’s toolbar,
 * which displays a stop/refresh, back, forward and share button, is shown.
 * The default value of this property is `YES`.
 */
@property (assign, nonatomic) BOOL showsNavigationToolbar;

/**
 * Loads the given `URL`. This is called automatically when the when the web view appears if a `URL` exists,
 * otehrwise it can be called manually.
 */
- (void)load;

/**
 * Clears the contents of the web view.
 */
- (void)clear;

@end


Add APIntVal as a possible GenericeValue.

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@34879 91177308-0d34-0410-b5e6-96231b3b80d8

--- include/llvm/ExecutionEngine/GenericValue.h
+++ include/llvm/ExecutionEngine/GenericValue.h
@@ -20,6 +20,8 @@
 namespace llvm {

 typedef uintptr_t PointerTy;
+class APInt;
+class Type;

 union GenericValue {
   bool            Int1Val;
@@ -27,6 +29,7 @@
   unsigned short  Int16Val;
   unsigned int    Int32Val;
   uint64_t        Int64Val;
+  APInt          *APIntVal;
   double          DoubleVal;
   float           FloatVal;
   struct { unsigned int first; unsigned int second; } UIntPairVal;

<|original_code|>
//===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// The GenericValue class is used to represent an LLVM value of arbitrary type.
//
//===----------------------------------------------------------------------===//

#ifndef GENERIC_VALUE_H
#define GENERIC_VALUE_H

#include "llvm/Support/DataTypes.h"

namespace llvm {

typedef uintptr_t PointerTy;

union GenericValue {
  bool            Int1Val;
  unsigned char   Int8Val;
  unsigned short  Int16Val;
  unsigned int    Int32Val;
  uint64_t        Int64Val;
  double          DoubleVal;
  float           FloatVal;
  struct { unsigned int first; unsigned int second; } UIntPairVal;
  PointerTy       PointerVal;
  unsigned char   Untyped[8];

  GenericValue() {}
  GenericValue(void *V) {
    PointerVal = (PointerTy)(intptr_t)V;
  }
};

inline GenericValue PTOGV(void *P) { return GenericValue(P); }
inline void* GVTOP(const GenericValue &GV) {
  return (void*)(intptr_t)GV.PointerVal;
}

} // End llvm namespace
#endif

<|edits_diff|>
--- include/llvm/ExecutionEngine/GenericValue.h
+++ include/llvm/ExecutionEngine/GenericValue.h
@@ -20,6 +20,8 @@
 namespace llvm {

 typedef uintptr_t PointerTy;
+class APInt;
+class Type;

 union GenericValue {
   bool            Int1Val;
<|current_version|>
//===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// The GenericValue class is used to represent an LLVM value of arbitrary type.
//
//===----------------------------------------------------------------------===//

#ifndef GENERIC_VALUE_H
#define GENERIC_VALUE_H

#include "llvm/Support/DataTypes.h"

namespace llvm {

typedef uintptr_t PointerTy;
class APInt;
class Type;

union GenericValue {
  bool            Int1Val;
  unsigned char   Int8Val;
  unsigned short  Int16Val;
  unsigned int    Int32Val;
  uint64_t        Int64Val;
  double          DoubleVal;
  float           FloatVal;
  struct { unsigned int first; unsigned int second; } UIntPairVal;
  PointerTy       PointerVal;
  unsigned char   Untyped[8];

  GenericValue() {}
  GenericValue(void *V) {
    PointerVal = (PointerTy)(intptr_t)V;
  }
};

inline GenericValue PTOGV(void *P) { return GenericValue(P); }
inline void* GVTOP(const GenericValue &GV) {
  return (void*)(intptr_t)GV.PointerVal;
}

} // End llvm namespace
#endif

<|next_version|>
//===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// The GenericValue class is used to represent an LLVM value of arbitrary type.
//
//===----------------------------------------------------------------------===//

#ifndef GENERIC_VALUE_H
#define GENERIC_VALUE_H

#include "llvm/Support/DataTypes.h"

namespace llvm {

typedef uintptr_t PointerTy;
class APInt;
class Type;

union GenericValue {
  bool            Int1Val;
  unsigned char   Int8Val;
  unsigned short  Int16Val;
  unsigned int    Int32Val;
  uint64_t        Int64Val;
  APInt          *APIntVal;
  double          DoubleVal;
  float           FloatVal;
  struct { unsigned int first; unsigned int second; } UIntPairVal;
  PointerTy       PointerVal;
  unsigned char   Untyped[8];

  GenericValue() {}
  GenericValue(void *V) {
    PointerVal = (PointerTy)(intptr_t)V;
  }
};

inline GenericValue PTOGV(void *P) { return GenericValue(P); }
inline void* GVTOP(const GenericValue &GV) {
  return (void*)(intptr_t)GV.PointerVal;
}

} // End llvm namespace
#endif


Fix ps depedency when ps not included

Fix ps depedency when ps not included

--- sys/shell/commands/sc_ps.c
+++ sys/shell/commands/sc_ps.c
@@ -18,6 +18,7 @@
  * @}
  */

+#ifdef MODULE_PS
 #include "ps.h"

 int _ps_handler(int argc, char **argv)
@@ -29,3 +30,4 @@

     return 0;
 }
+#endif

<|original_code|>
/*
 * Copyright (C) 2013  INRIA.
 *
 * This file is subject to the terms and conditions of the GNU Lesser
 * General Public License v2.1. See the file LICENSE in the top level
 * directory for more details.
 */

/**
 * @ingroup     sys_shell_commands
 * @{
 *
 * @file
 * @brief       Shell commands for the PS module
 *
 * @author      Oliver Hahm <oliver.hahm@inria.fr>
 *
 * @}
 */

#include "ps.h"

int _ps_handler(int argc, char **argv)
{
    (void) argc;
    (void) argv;

    ps();

    return 0;
}

<|edits_diff|>
--- sys/shell/commands/sc_ps.c
+++ sys/shell/commands/sc_ps.c
@@ -18,6 +18,7 @@
  * @}
  */

+#ifdef MODULE_PS
 #include "ps.h"

 int _ps_handler(int argc, char **argv)
<|current_version|>
/*
 * Copyright (C) 2013  INRIA.
 *
 * This file is subject to the terms and conditions of the GNU Lesser
 * General Public License v2.1. See the file LICENSE in the top level
 * directory for more details.
 */

/**
 * @ingroup     sys_shell_commands
 * @{
 *
 * @file
 * @brief       Shell commands for the PS module
 *
 * @author      Oliver Hahm <oliver.hahm@inria.fr>
 *
 * @}
 */

#ifdef MODULE_PS
#include "ps.h"

int _ps_handler(int argc, char **argv)
{
    (void) argc;
    (void) argv;

    ps();

    return 0;
}

<|next_version|>
/*
 * Copyright (C) 2013  INRIA.
 *
 * This file is subject to the terms and conditions of the GNU Lesser
 * General Public License v2.1. See the file LICENSE in the top level
 * directory for more details.
 */

/**
 * @ingroup     sys_shell_commands
 * @{
 *
 * @file
 * @brief       Shell commands for the PS module
 *
 * @author      Oliver Hahm <oliver.hahm@inria.fr>
 *
 * @}
 */

#ifdef MODULE_PS
#include "ps.h"

int _ps_handler(int argc, char **argv)
{
    (void) argc;
    (void) argv;

    ps();

    return 0;
}
#endif


Add comments to confusing test

Add comments to confusing test

--- tests/regression/37-congruence/07-refinements-o.c
+++ tests/regression/37-congruence/07-refinements-o.c
@@ -21,6 +21,7 @@
     assert(i == 0);

     if(top % 3 == 17) {
+        // This is unreachable in the concrete!
         assert(top%17 == 3); //UNKNOWN!
     }
 }
@@ -47,6 +48,7 @@
     assert(i == 0);

     if(top % 3 == 17) {
+        // This is unreachable in the concrete!
         assert(top%17 == 3); //UNKNOWN!
     }

<|original_code|>
// PARAM: --enable ana.int.congruence
void unsignedCase() {
    unsigned int top;
    unsigned int i = 0;
    if(top % 17 == 3) {
        assert(top%17 ==3);
        if(top %17 != 3) {
            i = 12;
        } else {

        }
    }
    assert(i ==0);

    if(top % 17 == 0) {
        assert(top%17 == 0);
        if(top %17 != 0) {
            i = 12;
        }
    }
    assert(i == 0);

    if(top % 3 == 17) {
        assert(top%17 == 3); //UNKNOWN!
    }
}

int main() {
    int top;
    int i = 0;
    if(top % 17 == 3) {
        assert(top%17 ==3);
        if(top %17 != 3) {
            i = 12;
        } else {

        }
    }
    assert(i ==0);

    if(top % 17 == 0) {
        assert(top%17 == 0);
        if(top %17 != 0) {
            i = 12;
        }
    }
    assert(i == 0);

    if(top % 3 == 17) {
        assert(top%17 == 3); //UNKNOWN!
    }

    unsignedCase();
}

<|edits_diff|>
--- tests/regression/37-congruence/07-refinements-o.c
+++ tests/regression/37-congruence/07-refinements-o.c
@@ -21,6 +21,7 @@
     assert(i == 0);

     if(top % 3 == 17) {
+        // This is unreachable in the concrete!
         assert(top%17 == 3); //UNKNOWN!
     }
 }
<|current_version|>
// PARAM: --enable ana.int.congruence
void unsignedCase() {
    unsigned int top;
    unsigned int i = 0;
    if(top % 17 == 3) {
        assert(top%17 ==3);
        if(top %17 != 3) {
            i = 12;
        } else {

        }
    }
    assert(i ==0);

    if(top % 17 == 0) {
        assert(top%17 == 0);
        if(top %17 != 0) {
            i = 12;
        }
    }
    assert(i == 0);

    if(top % 3 == 17) {
        // This is unreachable in the concrete!
        assert(top%17 == 3); //UNKNOWN!
    }
}

int main() {
    int top;
    int i = 0;
    if(top % 17 == 3) {
        assert(top%17 ==3);
        if(top %17 != 3) {
            i = 12;
        } else {

        }
    }
    assert(i ==0);

    if(top % 17 == 0) {
        assert(top%17 == 0);
        if(top %17 != 0) {
            i = 12;
        }
    }
    assert(i == 0);

    if(top % 3 == 17) {
        assert(top%17 == 3); //UNKNOWN!
    }

    unsignedCase();
}

<|next_version|>
// PARAM: --enable ana.int.congruence
void unsignedCase() {
    unsigned int top;
    unsigned int i = 0;
    if(top % 17 == 3) {
        assert(top%17 ==3);
        if(top %17 != 3) {
            i = 12;
        } else {

        }
    }
    assert(i ==0);

    if(top % 17 == 0) {
        assert(top%17 == 0);
        if(top %17 != 0) {
            i = 12;
        }
    }
    assert(i == 0);

    if(top % 3 == 17) {
        // This is unreachable in the concrete!
        assert(top%17 == 3); //UNKNOWN!
    }
}

int main() {
    int top;
    int i = 0;
    if(top % 17 == 3) {
        assert(top%17 ==3);
        if(top %17 != 3) {
            i = 12;
        } else {

        }
    }
    assert(i ==0);

    if(top % 17 == 0) {
        assert(top%17 == 0);
        if(top %17 != 0) {
            i = 12;
        }
    }
    assert(i == 0);

    if(top % 3 == 17) {
        // This is unreachable in the concrete!
        assert(top%17 == 3); //UNKNOWN!
    }

    unsignedCase();
}


hwloc: Include Linux or FreeBSD symbols depending on OS we are compiling on.

--- third_party/hwloc/static-components.h
+++ third_party/hwloc/static-components.h
@@ -22,8 +22,13 @@
     &hwloc_xml_component,
     &hwloc_synthetic_component,
     &hwloc_xml_nolibxml_component,
+#ifdef __Linux__
     &hwloc_linux_component,
     &hwloc_linuxio_component,
+#endif
+#ifdef __FreeBSD__
+    &hwloc_freebsd_component,
+#endif
 #if defined(__x86_64__) || defined(__amd64__) || defined(_M_IX86) || \
     defined(_M_X64)
     &hwloc_x86_component,

<|original_code|>
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may 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.
==============================================================================*/

#ifndef THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_
#define THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_

#include <private/internal-components.h>
static const struct hwloc_component* hwloc_static_components[] = {
    &hwloc_noos_component,
    &hwloc_xml_component,
    &hwloc_synthetic_component,
    &hwloc_xml_nolibxml_component,
    &hwloc_linux_component,
    &hwloc_linuxio_component,
#if defined(__x86_64__) || defined(__amd64__) || defined(_M_IX86) || \
    defined(_M_X64)
    &hwloc_x86_component,
#endif
    NULL};

#endif  // THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_

<|edits_diff|>
--- third_party/hwloc/static-components.h
+++ third_party/hwloc/static-components.h
@@ -22,6 +22,7 @@
     &hwloc_xml_component,
     &hwloc_synthetic_component,
     &hwloc_xml_nolibxml_component,
+#ifdef __Linux__
     &hwloc_linux_component,
     &hwloc_linuxio_component,
 #if defined(__x86_64__) || defined(__amd64__) || defined(_M_IX86) || \
<|current_version|>
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may 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.
==============================================================================*/

#ifndef THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_
#define THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_

#include <private/internal-components.h>
static const struct hwloc_component* hwloc_static_components[] = {
    &hwloc_noos_component,
    &hwloc_xml_component,
    &hwloc_synthetic_component,
    &hwloc_xml_nolibxml_component,
#ifdef __Linux__
    &hwloc_linux_component,
    &hwloc_linuxio_component,
#if defined(__x86_64__) || defined(__amd64__) || defined(_M_IX86) || \
    defined(_M_X64)
    &hwloc_x86_component,
#endif
    NULL};

#endif  // THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_

<|next_version|>
/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may 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.
==============================================================================*/

#ifndef THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_
#define THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_

#include <private/internal-components.h>
static const struct hwloc_component* hwloc_static_components[] = {
    &hwloc_noos_component,
    &hwloc_xml_component,
    &hwloc_synthetic_component,
    &hwloc_xml_nolibxml_component,
#ifdef __Linux__
    &hwloc_linux_component,
    &hwloc_linuxio_component,
#endif
#ifdef __FreeBSD__
    &hwloc_freebsd_component,
#endif
#if defined(__x86_64__) || defined(__amd64__) || defined(_M_IX86) || \
    defined(_M_X64)
    &hwloc_x86_component,
#endif
    NULL};

#endif  // THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_


Add include guard to SkFontConfigInterface.h

BUG=skia:7137

Change-Id: I29536a21211eae8b075d43984f3677f64ff9f481
Reviewed-on: https://skia-review.googlesource.com/57820
Reviewed-by: Ben Wagner <53965154ffeecc4a10886eab9259e95965f2979a@google.com>
Commit-Queue: Ben Wagner <53965154ffeecc4a10886eab9259e95965f2979a@google.com>

--- src/ports/SkFontConfigInterface_direct.h
+++ src/ports/SkFontConfigInterface_direct.h
@@ -6,6 +6,8 @@
  */

 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
+#ifndef SKFONTCONFIGINTERFACE_DIRECT_H_
+#define SKFONTCONFIGINTERFACE_DIRECT_H_

 #include "SkFontConfigInterface.h"

@@ -33,3 +35,5 @@
                          const SkString& family);
     typedef SkFontConfigInterface INHERITED;
 };
+
+#endif

<|original_code|>
/*
 * Copyright 2009-2015 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */

#include "SkFontConfigInterface.h"

#include <fontconfig/fontconfig.h>

class SkFontConfigInterfaceDirect : public SkFontConfigInterface {
public:
    SkFontConfigInterfaceDirect();
    ~SkFontConfigInterfaceDirect() override;

    bool matchFamilyName(const char familyName[],
                         SkFontStyle requested,
                         FontIdentity* outFontIdentifier,
                         SkString* outFamilyName,
                         SkFontStyle* outStyle) override;

    SkStreamAsset* openStream(const FontIdentity&) override;

protected:
    virtual bool isAccessible(const char* filename);

private:
    bool isValidPattern(FcPattern* pattern);
    FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family,
                         const SkString& family);
    typedef SkFontConfigInterface INHERITED;
};

<|edits_diff|>
--- src/ports/SkFontConfigInterface_direct.h
+++ src/ports/SkFontConfigInterface_direct.h
@@ -6,6 +6,8 @@
  */

 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
+#ifndef SKFONTCONFIGINTERFACE_DIRECT_H_
+#define SKFONTCONFIGINTERFACE_DIRECT_H_

 #include "SkFontConfigInterface.h"

<|current_version|>
/*
 * Copyright 2009-2015 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
#ifndef SKFONTCONFIGINTERFACE_DIRECT_H_
#define SKFONTCONFIGINTERFACE_DIRECT_H_

#include "SkFontConfigInterface.h"

#include <fontconfig/fontconfig.h>

class SkFontConfigInterfaceDirect : public SkFontConfigInterface {
public:
    SkFontConfigInterfaceDirect();
    ~SkFontConfigInterfaceDirect() override;

    bool matchFamilyName(const char familyName[],
                         SkFontStyle requested,
                         FontIdentity* outFontIdentifier,
                         SkString* outFamilyName,
                         SkFontStyle* outStyle) override;

    SkStreamAsset* openStream(const FontIdentity&) override;

protected:
    virtual bool isAccessible(const char* filename);

private:
    bool isValidPattern(FcPattern* pattern);
    FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family,
                         const SkString& family);
    typedef SkFontConfigInterface INHERITED;
};

<|next_version|>
/*
 * Copyright 2009-2015 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

/* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
#ifndef SKFONTCONFIGINTERFACE_DIRECT_H_
#define SKFONTCONFIGINTERFACE_DIRECT_H_

#include "SkFontConfigInterface.h"

#include <fontconfig/fontconfig.h>

class SkFontConfigInterfaceDirect : public SkFontConfigInterface {
public:
    SkFontConfigInterfaceDirect();
    ~SkFontConfigInterfaceDirect() override;

    bool matchFamilyName(const char familyName[],
                         SkFontStyle requested,
                         FontIdentity* outFontIdentifier,
                         SkString* outFamilyName,
                         SkFontStyle* outStyle) override;

    SkStreamAsset* openStream(const FontIdentity&) override;

protected:
    virtual bool isAccessible(const char* filename);

private:
    bool isValidPattern(FcPattern* pattern);
    FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family,
                         const SkString& family);
    typedef SkFontConfigInterface INHERITED;
};

#endif


Use forward declarations to speed up compilation

Former-commit-id: 58cb24dbf6102d6be5cf36336ae6547d9b6b544e

--- source/tools/finite/opt.h
+++ source/tools/finite/opt.h
@@ -12,6 +12,7 @@
 class class_tensors_finite;
 class class_algorithm_status;
 class class_tic_toc;
+namespace eig {class solver;}
 enum class OptSpace;
 enum class OptType;
 enum class OptMode;
@@ -20,6 +21,9 @@
     class opt_mps;

     using Scalar = std::complex<double>;
+    using real = double;
+    using cplx = std::complex<double>;
+    extern void                     extract_solutions(const opt_mps &initial_mps,const class_tensors_finite &tensors, eig::solver &solver, std::vector<tools::finite::opt::opt_mps> &eigvecs_mps, const std::string & tag = "");
     extern opt_mps find_excited_state(const class_tensors_finite &tensors, const opt_mps &initial_mps, const class_algorithm_status &status,
                                         OptMode optMode, OptSpace optSpace, OptType optType);
     extern opt_mps find_excited_state(const class_tensors_finite &tensors, const class_algorithm_status &status, OptMode optMode, OptSpace optSpace,

<|original_code|>
//
// Created by david on 2019-03-18.
//

#pragma once

#include <general/eigen_tensor_fwd_decl.h>

class class_state_finite;
class class_model_finite;
class class_edges_finite;
class class_tensors_finite;
class class_algorithm_status;
class class_tic_toc;
enum class OptSpace;
enum class OptType;
enum class OptMode;
enum class StateRitz;
namespace tools::finite::opt {
    class opt_mps;

    using Scalar = std::complex<double>;
    extern opt_mps find_excited_state(const class_tensors_finite &tensors, const opt_mps &initial_mps, const class_algorithm_status &status,
                                        OptMode optMode, OptSpace optSpace, OptType optType);
    extern opt_mps find_excited_state(const class_tensors_finite &tensors, const class_algorithm_status &status, OptMode optMode, OptSpace optSpace,
                                        OptType optType);
    extern Eigen::Tensor<Scalar, 3> find_ground_state(const class_tensors_finite &tensors, StateRitz ritz);
}

<|edits_diff|>
--- source/tools/finite/opt.h
+++ source/tools/finite/opt.h
@@ -12,6 +12,7 @@
 class class_tensors_finite;
 class class_algorithm_status;
 class class_tic_toc;
+namespace eig {class solver;}
 enum class OptSpace;
 enum class OptType;
 enum class OptMode;
<|current_version|>
//
// Created by david on 2019-03-18.
//

#pragma once

#include <general/eigen_tensor_fwd_decl.h>

class class_state_finite;
class class_model_finite;
class class_edges_finite;
class class_tensors_finite;
class class_algorithm_status;
class class_tic_toc;
namespace eig {class solver;}
enum class OptSpace;
enum class OptType;
enum class OptMode;
enum class StateRitz;
namespace tools::finite::opt {
    class opt_mps;

    using Scalar = std::complex<double>;
    extern opt_mps find_excited_state(const class_tensors_finite &tensors, const opt_mps &initial_mps, const class_algorithm_status &status,
                                        OptMode optMode, OptSpace optSpace, OptType optType);
    extern opt_mps find_excited_state(const class_tensors_finite &tensors, const class_algorithm_status &status, OptMode optMode, OptSpace optSpace,
                                        OptType optType);
    extern Eigen::Tensor<Scalar, 3> find_ground_state(const class_tensors_finite &tensors, StateRitz ritz);
}

<|next_version|>
//
// Created by david on 2019-03-18.
//

#pragma once

#include <general/eigen_tensor_fwd_decl.h>

class class_state_finite;
class class_model_finite;
class class_edges_finite;
class class_tensors_finite;
class class_algorithm_status;
class class_tic_toc;
namespace eig {class solver;}
enum class OptSpace;
enum class OptType;
enum class OptMode;
enum class StateRitz;
namespace tools::finite::opt {
    class opt_mps;

    using Scalar = std::complex<double>;
    using real = double;
    using cplx = std::complex<double>;
    extern void                     extract_solutions(const opt_mps &initial_mps,const class_tensors_finite &tensors, eig::solver &solver, std::vector<tools::finite::opt::opt_mps> &eigvecs_mps, const std::string & tag = "");
    extern opt_mps find_excited_state(const class_tensors_finite &tensors, const opt_mps &initial_mps, const class_algorithm_status &status,
                                        OptMode optMode, OptSpace optSpace, OptType optType);
    extern opt_mps find_excited_state(const class_tensors_finite &tensors, const class_algorithm_status &status, OptMode optMode, OptSpace optSpace,
                                        OptType optType);
    extern Eigen::Tensor<Scalar, 3> find_ground_state(const class_tensors_finite &tensors, StateRitz ritz);
}


Undo change for LittleFS include name: Arduino uses the capitalized one.

--- src/iotsaFS.h
+++ src/iotsaFS.h
@@ -13,8 +13,13 @@
 #define IOTSA_FS SPIFFS
 #define IOTSA_FS_NAME "SPIFFS"
 #else
+#ifdef ESP32
+#include <LITTLEFS.h>
+#define IOTSA_FS LITTLEFS
+#else
 #include <LittleFS.h>
 #define IOTSA_FS LittleFS
+#endif
 #define IOTSA_FS_NAME "LittleFS"
 #endif

<|original_code|>
#ifndef _IOTSAFS_H_
#define _IOTSAFS_H_
//
// SPIFFS/LittleFS choice is complex, also for include file differences on ESP32/ESP8266.
// So put if all in a separate include file.
//
#include <FS.h>

#ifdef IOTSA_WITH_LEGACY_SPIFFS
#ifdef ESP32
#include <SPIFFS.h>
#endif
#define IOTSA_FS SPIFFS
#define IOTSA_FS_NAME "SPIFFS"
#else
#include <LittleFS.h>
#define IOTSA_FS LittleFS
#define IOTSA_FS_NAME "LittleFS"
#endif

#endif

<|edits_diff|>
--- src/iotsaFS.h
+++ src/iotsaFS.h
@@ -13,6 +13,10 @@
 #define IOTSA_FS SPIFFS
 #define IOTSA_FS_NAME "SPIFFS"
 #else
+#ifdef ESP32
+#include <LITTLEFS.h>
+#define IOTSA_FS LITTLEFS
+#else
 #include <LittleFS.h>
 #define IOTSA_FS LittleFS
 #define IOTSA_FS_NAME "LittleFS"
<|current_version|>
#ifndef _IOTSAFS_H_
#define _IOTSAFS_H_
//
// SPIFFS/LittleFS choice is complex, also for include file differences on ESP32/ESP8266.
// So put if all in a separate include file.
//
#include <FS.h>

#ifdef IOTSA_WITH_LEGACY_SPIFFS
#ifdef ESP32
#include <SPIFFS.h>
#endif
#define IOTSA_FS SPIFFS
#define IOTSA_FS_NAME "SPIFFS"
#else
#ifdef ESP32
#include <LITTLEFS.h>
#define IOTSA_FS LITTLEFS
#else
#include <LittleFS.h>
#define IOTSA_FS LittleFS
#define IOTSA_FS_NAME "LittleFS"
#endif

#endif

<|next_version|>
#ifndef _IOTSAFS_H_
#define _IOTSAFS_H_
//
// SPIFFS/LittleFS choice is complex, also for include file differences on ESP32/ESP8266.
// So put if all in a separate include file.
//
#include <FS.h>

#ifdef IOTSA_WITH_LEGACY_SPIFFS
#ifdef ESP32
#include <SPIFFS.h>
#endif
#define IOTSA_FS SPIFFS
#define IOTSA_FS_NAME "SPIFFS"
#else
#ifdef ESP32
#include <LITTLEFS.h>
#define IOTSA_FS LITTLEFS
#else
#include <LittleFS.h>
#define IOTSA_FS LittleFS
#endif
#define IOTSA_FS_NAME "LittleFS"
#endif

#endif


Use extern C if C++

Use extern C if C++

--- Pathfinder-Core/include/pathfinder.h
+++ Pathfinder-Core/include/pathfinder.h
@@ -1,5 +1,9 @@
 #ifndef PATHFINDER_H_DEF
 #define PATHFINDER_H_DEF
+
+#ifdef __cplusplus
+extern "C" {
+#endif

 #include "pathfinder/mathutil.h"
 #include "pathfinder/structs.h"
@@ -16,4 +20,8 @@

 #include "pathfinder/io.h"

+#ifdef __cplusplus
+}
 #endif
+
+#endif

<|original_code|>
#ifndef PATHFINDER_H_DEF
#define PATHFINDER_H_DEF

#include "pathfinder/mathutil.h"
#include "pathfinder/structs.h"

#include "pathfinder/fit.h"
#include "pathfinder/spline.h"
#include "pathfinder/trajectory.h"

#include "pathfinder/modifiers/tank.h"
#include "pathfinder/modifiers/swerve.h"

#include "pathfinder/followers/encoder.h"
#include "pathfinder/followers/distance.h"

#include "pathfinder/io.h"

#endif
<|edits_diff|>
--- Pathfinder-Core/include/pathfinder.h
+++ Pathfinder-Core/include/pathfinder.h
@@ -1,5 +1,9 @@
 #ifndef PATHFINDER_H_DEF
 #define PATHFINDER_H_DEF
+
+#ifdef __cplusplus
+extern "C" {
+#endif

 #include "pathfinder/mathutil.h"
 #include "pathfinder/structs.h"
<|current_version|>
#ifndef PATHFINDER_H_DEF
#define PATHFINDER_H_DEF

#ifdef __cplusplus
extern "C" {
#endif

#include "pathfinder/mathutil.h"
#include "pathfinder/structs.h"

#include "pathfinder/fit.h"
#include "pathfinder/spline.h"
#include "pathfinder/trajectory.h"

#include "pathfinder/modifiers/tank.h"
#include "pathfinder/modifiers/swerve.h"

#include "pathfinder/followers/encoder.h"
#include "pathfinder/followers/distance.h"

#include "pathfinder/io.h"

#endif
<|next_version|>
#ifndef PATHFINDER_H_DEF
#define PATHFINDER_H_DEF

#ifdef __cplusplus
extern "C" {
#endif

#include "pathfinder/mathutil.h"
#include "pathfinder/structs.h"

#include "pathfinder/fit.h"
#include "pathfinder/spline.h"
#include "pathfinder/trajectory.h"

#include "pathfinder/modifiers/tank.h"
#include "pathfinder/modifiers/swerve.h"

#include "pathfinder/followers/encoder.h"
#include "pathfinder/followers/distance.h"

#include "pathfinder/io.h"

#ifdef __cplusplus
}
#endif

#endif


Make PathChar compatible with other platform

--- src/kbase/basic_types.h
+++ src/kbase/basic_types.h
@@ -12,13 +12,20 @@
 #include <cstdint>
 #include <string>

+#include "kbase/basic_macros.h"
+
 // Defines types that would be shared by among several files.
 namespace kbase {

 // |PathKey| is used by |PathService| and |BasePathProvider|.
 using PathKey = int;

+#if defined(OS_WIN)
 using PathChar = wchar_t;
+#else
+using PathChar = char;
+#endif
+
 using PathString = std::basic_string<PathChar>;

 using byte = uint8_t;

<|original_code|>
/*
 @ 0xCCCCCCCC
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef KBASE_BASIC_TYPES_H_
#define KBASE_BASIC_TYPES_H_

#include <cstdint>
#include <string>

// Defines types that would be shared by among several files.
namespace kbase {

// |PathKey| is used by |PathService| and |BasePathProvider|.
using PathKey = int;

using PathChar = wchar_t;
using PathString = std::basic_string<PathChar>;

using byte = uint8_t;

// Casts an enum value into an equivalent integer.
template<typename E>
constexpr auto enum_cast(E e)
{
    return static_cast<std::underlying_type_t<E>>(e);
}

}   // namespace kbase

#endif  // KBASE_BASIC_TYPES_H_
<|edits_diff|>
--- src/kbase/basic_types.h
+++ src/kbase/basic_types.h
@@ -12,12 +12,15 @@
 #include <cstdint>
 #include <string>

+#include "kbase/basic_macros.h"
+
 // Defines types that would be shared by among several files.
 namespace kbase {

 // |PathKey| is used by |PathService| and |BasePathProvider|.
 using PathKey = int;

+#if defined(OS_WIN)
 using PathChar = wchar_t;
 using PathString = std::basic_string<PathChar>;

<|current_version|>
/*
 @ 0xCCCCCCCC
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef KBASE_BASIC_TYPES_H_
#define KBASE_BASIC_TYPES_H_

#include <cstdint>
#include <string>

#include "kbase/basic_macros.h"

// Defines types that would be shared by among several files.
namespace kbase {

// |PathKey| is used by |PathService| and |BasePathProvider|.
using PathKey = int;

#if defined(OS_WIN)
using PathChar = wchar_t;
using PathString = std::basic_string<PathChar>;

using byte = uint8_t;

// Casts an enum value into an equivalent integer.
template<typename E>
constexpr auto enum_cast(E e)
{
    return static_cast<std::underlying_type_t<E>>(e);
}

}   // namespace kbase

#endif  // KBASE_BASIC_TYPES_H_
<|next_version|>
/*
 @ 0xCCCCCCCC
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef KBASE_BASIC_TYPES_H_
#define KBASE_BASIC_TYPES_H_

#include <cstdint>
#include <string>

#include "kbase/basic_macros.h"

// Defines types that would be shared by among several files.
namespace kbase {

// |PathKey| is used by |PathService| and |BasePathProvider|.
using PathKey = int;

#if defined(OS_WIN)
using PathChar = wchar_t;
#else
using PathChar = char;
#endif

using PathString = std::basic_string<PathChar>;

using byte = uint8_t;

// Casts an enum value into an equivalent integer.
template<typename E>
constexpr auto enum_cast(E e)
{
    return static_cast<std::underlying_type_t<E>>(e);
}

}   // namespace kbase

#endif  // KBASE_BASIC_TYPES_H_


Add SenTestingKit to test targets

Add SenTestingKit to test targets

--- WebHereTests/WebHereTests.h
+++ WebHereTests/WebHereTests.h
@@ -6,6 +6,7 @@
 //  Copyright (c) 2013 Rui D Lopes. All rights reserved.
 //

+#import <SenTestingKit/SenTestingKit.h>
 #import <Kiwi/Kiwi.h>
 #import <Nocilla/Nocilla.h>
 #import <OCLogTemplate/OCLogTemplate.h>
@@ -19,3 +20,8 @@
 #import "WHNSObject.h"
 #import "WHLoginForm.h"

+#	define LOGGING_ENABLED        1
+#	define LOGGING_LEVEL_TRACE        0
+#	define LOGGING_LEVEL_INFO        1
+#	define LOGGING_LEVEL_ERROR        1
+#	define LOGGING_LEVEL_DEBUG        1

<|original_code|>
//
//  WebHereTests.h
//  WebHereTests
//
//  Created by Rui D Lopes on 25/03/13.
//  Copyright (c) 2013 Rui D Lopes. All rights reserved.
//

#import <Kiwi/Kiwi.h>
#import <Nocilla/Nocilla.h>
#import <OCLogTemplate/OCLogTemplate.h>
#import <WebHere/WebHere.h>

// Fixtures
#import "WHPerson.h"
#import "WHAdmin.h"
#import "WHUnmatchedPerson.h"
#import "WHPersonQueryForm.h"
#import "WHNSObject.h"
#import "WHLoginForm.h"

<|edits_diff|>
--- WebHereTests/WebHereTests.h
+++ WebHereTests/WebHereTests.h
@@ -6,6 +6,7 @@
 //  Copyright (c) 2013 Rui D Lopes. All rights reserved.
 //

+#import <SenTestingKit/SenTestingKit.h>
 #import <Kiwi/Kiwi.h>
 #import <Nocilla/Nocilla.h>
 #import <OCLogTemplate/OCLogTemplate.h>
<|current_version|>
//
//  WebHereTests.h
//  WebHereTests
//
//  Created by Rui D Lopes on 25/03/13.
//  Copyright (c) 2013 Rui D Lopes. All rights reserved.
//

#import <SenTestingKit/SenTestingKit.h>
#import <Kiwi/Kiwi.h>
#import <Nocilla/Nocilla.h>
#import <OCLogTemplate/OCLogTemplate.h>
#import <WebHere/WebHere.h>

// Fixtures
#import "WHPerson.h"
#import "WHAdmin.h"
#import "WHUnmatchedPerson.h"
#import "WHPersonQueryForm.h"
#import "WHNSObject.h"
#import "WHLoginForm.h"

<|next_version|>
//
//  WebHereTests.h
//  WebHereTests
//
//  Created by Rui D Lopes on 25/03/13.
//  Copyright (c) 2013 Rui D Lopes. All rights reserved.
//

#import <SenTestingKit/SenTestingKit.h>
#import <Kiwi/Kiwi.h>
#import <Nocilla/Nocilla.h>
#import <OCLogTemplate/OCLogTemplate.h>
#import <WebHere/WebHere.h>

// Fixtures
#import "WHPerson.h"
#import "WHAdmin.h"
#import "WHUnmatchedPerson.h"
#import "WHPersonQueryForm.h"
#import "WHNSObject.h"
#import "WHLoginForm.h"

#	define LOGGING_ENABLED        1
#	define LOGGING_LEVEL_TRACE        0
#	define LOGGING_LEVEL_INFO        1
#	define LOGGING_LEVEL_ERROR        1
#	define LOGGING_LEVEL_DEBUG        1


Exclude skiplist string key tests from device

--- src/tests/behaviour/dictionary/skip_list/test_behaviour_skip_list.c
+++ src/tests/behaviour/dictionary/skip_list/test_behaviour_skip_list.c
@@ -30,5 +30,9 @@
 runalltests_behaviour_skip_list(
 	void
 ) {
+#if defined(ARDUINO)
+	bhdct_run_tests(sldict_init, 7, BHDCT_ALL_TESTS & ~BHDCT_STRING_INT);
+#else
 	bhdct_run_tests(sldict_init, 7, BHDCT_ALL_TESTS);
+#endif
 }

<|original_code|>
/******************************************************************************/
/**
@file
@author		Kris Wallperington
@brief		Behaviour tests for the skip list implementation.
@copyright	Copyright 2016
				The University of British Columbia,
				IonDB Project Contributors (see AUTHORS.md)
@par
			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
@par
			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 "../../../planckunit/src/planck_unit.h"
#include "../behaviour_dictionary.h"
#include "../../../../dictionary/skip_list/skip_list_handler.h"
#include "test_behaviour_skip_list.h"

void
runalltests_behaviour_skip_list(
	void
) {
	bhdct_run_tests(sldict_init, 7, BHDCT_ALL_TESTS);
}

<|edits_diff|>
--- src/tests/behaviour/dictionary/skip_list/test_behaviour_skip_list.c
+++ src/tests/behaviour/dictionary/skip_list/test_behaviour_skip_list.c
@@ -30,5 +30,8 @@
 runalltests_behaviour_skip_list(
 	void
 ) {
+#if defined(ARDUINO)
+	bhdct_run_tests(sldict_init, 7, BHDCT_ALL_TESTS & ~BHDCT_STRING_INT);
+#else
 	bhdct_run_tests(sldict_init, 7, BHDCT_ALL_TESTS);
 }
<|current_version|>
/******************************************************************************/
/**
@file
@author		Kris Wallperington
@brief		Behaviour tests for the skip list implementation.
@copyright	Copyright 2016
				The University of British Columbia,
				IonDB Project Contributors (see AUTHORS.md)
@par
			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
@par
			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 "../../../planckunit/src/planck_unit.h"
#include "../behaviour_dictionary.h"
#include "../../../../dictionary/skip_list/skip_list_handler.h"
#include "test_behaviour_skip_list.h"

void
runalltests_behaviour_skip_list(
	void
) {
#if defined(ARDUINO)
	bhdct_run_tests(sldict_init, 7, BHDCT_ALL_TESTS & ~BHDCT_STRING_INT);
#else
	bhdct_run_tests(sldict_init, 7, BHDCT_ALL_TESTS);
}

<|next_version|>
/******************************************************************************/
/**
@file
@author		Kris Wallperington
@brief		Behaviour tests for the skip list implementation.
@copyright	Copyright 2016
				The University of British Columbia,
				IonDB Project Contributors (see AUTHORS.md)
@par
			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
@par
			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 "../../../planckunit/src/planck_unit.h"
#include "../behaviour_dictionary.h"
#include "../../../../dictionary/skip_list/skip_list_handler.h"
#include "test_behaviour_skip_list.h"

void
runalltests_behaviour_skip_list(
	void
) {
#if defined(ARDUINO)
	bhdct_run_tests(sldict_init, 7, BHDCT_ALL_TESTS & ~BHDCT_STRING_INT);
#else
	bhdct_run_tests(sldict_init, 7, BHDCT_ALL_TESTS);
#endif
}


Introduce the macro `PATH_LITERAL` for helping construct `PathString`.

--- KLog/klog/basic_types.h
+++ KLog/klog/basic_types.h
@@ -18,9 +18,11 @@
 #if defined(OS_WIN)
 using PathChar = wchar_t;
 using PathString = std::wstring;
+#define PATH_LITERAL(str) L##str
 #else
 using PathChar = char;
 using PathString = std::string;
+#define PATH_LITERAL(str) str
 #endif

 }   // namespace klog

<|original_code|>
/*
 @ 0xCCCCCCCC
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef KLOG_BASIC_TYPES_H_
#define KLOG_BASIC_TYPES_H_

#include <string>

#include "klog/basic_macros.h"

namespace klog {

#if defined(OS_WIN)
using PathChar = wchar_t;
using PathString = std::wstring;
#else
using PathChar = char;
using PathString = std::string;
#endif

}   // namespace klog

#endif  // KLOG_BASIC_TYPES_H_
<|edits_diff|>
--- KLog/klog/basic_types.h
+++ KLog/klog/basic_types.h
@@ -18,6 +18,7 @@
 #if defined(OS_WIN)
 using PathChar = wchar_t;
 using PathString = std::wstring;
+#define PATH_LITERAL(str) L##str
 #else
 using PathChar = char;
 using PathString = std::string;
<|current_version|>
/*
 @ 0xCCCCCCCC
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef KLOG_BASIC_TYPES_H_
#define KLOG_BASIC_TYPES_H_

#include <string>

#include "klog/basic_macros.h"

namespace klog {

#if defined(OS_WIN)
using PathChar = wchar_t;
using PathString = std::wstring;
#define PATH_LITERAL(str) L##str
#else
using PathChar = char;
using PathString = std::string;
#endif

}   // namespace klog

#endif  // KLOG_BASIC_TYPES_H_
<|next_version|>
/*
 @ 0xCCCCCCCC
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef KLOG_BASIC_TYPES_H_
#define KLOG_BASIC_TYPES_H_

#include <string>

#include "klog/basic_macros.h"

namespace klog {

#if defined(OS_WIN)
using PathChar = wchar_t;
using PathString = std::wstring;
#define PATH_LITERAL(str) L##str
#else
using PathChar = char;
using PathString = std::string;
#define PATH_LITERAL(str) str
#endif

}   // namespace klog

#endif  // KLOG_BASIC_TYPES_H_


Exclude 3rd party code from the controller tests code coverage.

--- You-Controller-Tests/exclusions.h
+++ You-Controller-Tests/exclusions.h
@@ -14,7 +14,9 @@
 #pragma managed(push, off)

 ExcludeFromCodeCoverage(boost, L"boost::*");
+ExcludeFromCodeCoverage(You_NLP, L"You::NLP::*");
 ExcludeFromCodeCoverage(You_QueryEngine, L"You::QueryEngine::*");
+ExcludeFromCodeCoverage(You_Utils, L"You::Utils::*");

 #pragma managed(pop)

<|original_code|>
#pragma once
#ifndef YOU_CONTROLLER_TESTS_EXCLUSIONS_H_
#define YOU_CONTROLLER_TESTS_EXCLUSIONS_H_

// A local define since there is no way to test whether a header file exists.
// If you have VS Premium, then add it to the project definition (user
// properties) file
#ifdef MS_CPP_CODECOVERAGE

/// \file Exclusions from code coverage analysis.
/// See http://msdn.microsoft.com/en-sg/library/dd537628.aspx

#include <CodeCoverage/CodeCoverage.h>
#pragma managed(push, off)

ExcludeFromCodeCoverage(boost, L"boost::*");
ExcludeFromCodeCoverage(You_QueryEngine, L"You::QueryEngine::*");

#pragma managed(pop)

#endif  // MS_CPP_CODECOVERAGE

#endif  // YOU_CONTROLLER_TESTS_EXCLUSIONS_H_

<|edits_diff|>
--- You-Controller-Tests/exclusions.h
+++ You-Controller-Tests/exclusions.h
@@ -14,6 +14,7 @@
 #pragma managed(push, off)

 ExcludeFromCodeCoverage(boost, L"boost::*");
+ExcludeFromCodeCoverage(You_NLP, L"You::NLP::*");
 ExcludeFromCodeCoverage(You_QueryEngine, L"You::QueryEngine::*");

 #pragma managed(pop)
<|current_version|>
#pragma once
#ifndef YOU_CONTROLLER_TESTS_EXCLUSIONS_H_
#define YOU_CONTROLLER_TESTS_EXCLUSIONS_H_

// A local define since there is no way to test whether a header file exists.
// If you have VS Premium, then add it to the project definition (user
// properties) file
#ifdef MS_CPP_CODECOVERAGE

/// \file Exclusions from code coverage analysis.
/// See http://msdn.microsoft.com/en-sg/library/dd537628.aspx

#include <CodeCoverage/CodeCoverage.h>
#pragma managed(push, off)

ExcludeFromCodeCoverage(boost, L"boost::*");
ExcludeFromCodeCoverage(You_NLP, L"You::NLP::*");
ExcludeFromCodeCoverage(You_QueryEngine, L"You::QueryEngine::*");

#pragma managed(pop)

#endif  // MS_CPP_CODECOVERAGE

#endif  // YOU_CONTROLLER_TESTS_EXCLUSIONS_H_

<|next_version|>
#pragma once
#ifndef YOU_CONTROLLER_TESTS_EXCLUSIONS_H_
#define YOU_CONTROLLER_TESTS_EXCLUSIONS_H_

// A local define since there is no way to test whether a header file exists.
// If you have VS Premium, then add it to the project definition (user
// properties) file
#ifdef MS_CPP_CODECOVERAGE

/// \file Exclusions from code coverage analysis.
/// See http://msdn.microsoft.com/en-sg/library/dd537628.aspx

#include <CodeCoverage/CodeCoverage.h>
#pragma managed(push, off)

ExcludeFromCodeCoverage(boost, L"boost::*");
ExcludeFromCodeCoverage(You_NLP, L"You::NLP::*");
ExcludeFromCodeCoverage(You_QueryEngine, L"You::QueryEngine::*");
ExcludeFromCodeCoverage(You_Utils, L"You::Utils::*");

#pragma managed(pop)

#endif  // MS_CPP_CODECOVERAGE

#endif  // YOU_CONTROLLER_TESTS_EXCLUSIONS_H_


Make the audio player a public property.

--- Classes/EPSPlayerViewModel.h
+++ Classes/EPSPlayerViewModel.h
@@ -8,10 +8,13 @@

 #import <Foundation/Foundation.h>
 #import <ReactiveCocoa/ReactiveCocoa.h>
+#import <AVFoundation/AVFoundation.h>

 @interface EPSPlayerViewModel : NSObject

 @property (nonatomic) NSURL *audioURL;
+
+@property (readonly) AVPlayer *player;

 @property (readonly) NSTimeInterval duration;

<|original_code|>
//
//  EPSPlayerViewModel.h
//  ReactiveAudioPlayer
//
//  Created by Peter Stuart on 4/24/14.
//  Copyright (c) 2014 Electric Peel, LLC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <ReactiveCocoa/ReactiveCocoa.h>

@interface EPSPlayerViewModel : NSObject

@property (nonatomic) NSURL *audioURL;

@property (readonly) NSTimeInterval duration;

@property (readonly) NSTimeInterval currentTime;

@property (readonly) NSString *elapsedTimeString;

@property (readonly) NSString *remainingTimeString;

@property (readonly, getter = isPlaying) BOOL playing;

// Commands

@property (readonly) RACCommand *playCommand;

@property (readonly) RACCommand *pauseCommand;

@property (readonly) RACCommand *togglePlayPauseCommand;

@property (nonatomic, getter = isSeeking) BOOL seeking;

- (void)seekToTime:(NSTimeInterval)time;

@end

<|edits_diff|>
--- Classes/EPSPlayerViewModel.h
+++ Classes/EPSPlayerViewModel.h
@@ -8,6 +8,7 @@

 #import <Foundation/Foundation.h>
 #import <ReactiveCocoa/ReactiveCocoa.h>
+#import <AVFoundation/AVFoundation.h>

 @interface EPSPlayerViewModel : NSObject

<|current_version|>
//
//  EPSPlayerViewModel.h
//  ReactiveAudioPlayer
//
//  Created by Peter Stuart on 4/24/14.
//  Copyright (c) 2014 Electric Peel, LLC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <ReactiveCocoa/ReactiveCocoa.h>
#import <AVFoundation/AVFoundation.h>

@interface EPSPlayerViewModel : NSObject

@property (nonatomic) NSURL *audioURL;

@property (readonly) NSTimeInterval duration;

@property (readonly) NSTimeInterval currentTime;

@property (readonly) NSString *elapsedTimeString;

@property (readonly) NSString *remainingTimeString;

@property (readonly, getter = isPlaying) BOOL playing;

// Commands

@property (readonly) RACCommand *playCommand;

@property (readonly) RACCommand *pauseCommand;

@property (readonly) RACCommand *togglePlayPauseCommand;

@property (nonatomic, getter = isSeeking) BOOL seeking;

- (void)seekToTime:(NSTimeInterval)time;

@end

<|next_version|>
//
//  EPSPlayerViewModel.h
//  ReactiveAudioPlayer
//
//  Created by Peter Stuart on 4/24/14.
//  Copyright (c) 2014 Electric Peel, LLC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <ReactiveCocoa/ReactiveCocoa.h>
#import <AVFoundation/AVFoundation.h>

@interface EPSPlayerViewModel : NSObject

@property (nonatomic) NSURL *audioURL;

@property (readonly) AVPlayer *player;

@property (readonly) NSTimeInterval duration;

@property (readonly) NSTimeInterval currentTime;

@property (readonly) NSString *elapsedTimeString;

@property (readonly) NSString *remainingTimeString;

@property (readonly, getter = isPlaying) BOOL playing;

// Commands

@property (readonly) RACCommand *playCommand;

@property (readonly) RACCommand *pauseCommand;

@property (readonly) RACCommand *togglePlayPauseCommand;

@property (nonatomic, getter = isSeeking) BOOL seeking;

- (void)seekToTime:(NSTimeInterval)time;

@end


Define WSAPOLLFD only on mingw 4.x

Define WSAPOLLFD only on mingw 4.x

Fixes #10327

--- src/etc/mingw-fix-include/winsock2.h
+++ src/etc/mingw-fix-include/winsock2.h
@@ -2,6 +2,9 @@
 #define _FIX_WINSOCK2_H 1

 #include_next <winsock2.h>
+
+// mingw 4.0.x has broken headers (#9246) but mingw-w64 does not.
+#if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4

 typedef struct pollfd {
   SOCKET fd;
@@ -10,3 +13,5 @@
 } WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;

 #endif
+
+#endif // _FIX_WINSOCK2_H

<|original_code|>
#ifndef _FIX_WINSOCK2_H
#define _FIX_WINSOCK2_H 1

#include_next <winsock2.h>

typedef struct pollfd {
  SOCKET fd;
  short  events;
  short  revents;
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;

#endif

<|edits_diff|>
--- src/etc/mingw-fix-include/winsock2.h
+++ src/etc/mingw-fix-include/winsock2.h
@@ -2,6 +2,9 @@
 #define _FIX_WINSOCK2_H 1

 #include_next <winsock2.h>
+
+// mingw 4.0.x has broken headers (#9246) but mingw-w64 does not.
+#if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4

 typedef struct pollfd {
   SOCKET fd;
<|current_version|>
#ifndef _FIX_WINSOCK2_H
#define _FIX_WINSOCK2_H 1

#include_next <winsock2.h>

// mingw 4.0.x has broken headers (#9246) but mingw-w64 does not.
#if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4

typedef struct pollfd {
  SOCKET fd;
  short  events;
  short  revents;
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;

#endif

<|next_version|>
#ifndef _FIX_WINSOCK2_H
#define _FIX_WINSOCK2_H 1

#include_next <winsock2.h>

// mingw 4.0.x has broken headers (#9246) but mingw-w64 does not.
#if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4

typedef struct pollfd {
  SOCKET fd;
  short  events;
  short  revents;
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;

#endif

#endif // _FIX_WINSOCK2_H


Mark string functions unused, in case the header is included in files that only use one of them.

git-svn-id: f6517e426f81db5247881cd92f7386583ace04fa@30387 72102866-910b-0410-8b05-ffd578937521

--- string_hash.h
+++ string_hash.h
@@ -4,6 +4,7 @@
 /**
  * Efficient string hash function.
  */
+__attribute__((unused))
 static uint32_t string_hash(const char *str)
 {
 	uint32_t hash = 0;
@@ -18,6 +19,7 @@
 /**
  * Test two strings for equality.
  */
+__attribute__((unused))
 static int string_compare(const char *str1, const char *str2)
 {
 	if (str1 == str2)

<|original_code|>
#include <string.h>
#include <stdint.h>

/**
 * Efficient string hash function.
 */
static uint32_t string_hash(const char *str)
{
	uint32_t hash = 0;
	int32_t c;
	while ((c = *str++))
	{
		hash = c + (hash << 6) + (hash << 16) - hash;
	}
	return hash;
}

/**
 * Test two strings for equality.
 */
static int string_compare(const char *str1, const char *str2)
{
	if (str1 == str2)
	{
		return 1;
	}
	if (str2 == NULL)
	{
		return 0;
	}
	return strcmp(str1, str2) == 0;
}

<|edits_diff|>
--- string_hash.h
+++ string_hash.h
@@ -4,6 +4,7 @@
 /**
  * Efficient string hash function.
  */
+__attribute__((unused))
 static uint32_t string_hash(const char *str)
 {
 	uint32_t hash = 0;
<|current_version|>
#include <string.h>
#include <stdint.h>

/**
 * Efficient string hash function.
 */
__attribute__((unused))
static uint32_t string_hash(const char *str)
{
	uint32_t hash = 0;
	int32_t c;
	while ((c = *str++))
	{
		hash = c + (hash << 6) + (hash << 16) - hash;
	}
	return hash;
}

/**
 * Test two strings for equality.
 */
static int string_compare(const char *str1, const char *str2)
{
	if (str1 == str2)
	{
		return 1;
	}
	if (str2 == NULL)
	{
		return 0;
	}
	return strcmp(str1, str2) == 0;
}

<|next_version|>
#include <string.h>
#include <stdint.h>

/**
 * Efficient string hash function.
 */
__attribute__((unused))
static uint32_t string_hash(const char *str)
{
	uint32_t hash = 0;
	int32_t c;
	while ((c = *str++))
	{
		hash = c + (hash << 6) + (hash << 16) - hash;
	}
	return hash;
}

/**
 * Test two strings for equality.
 */
__attribute__((unused))
static int string_compare(const char *str1, const char *str2)
{
	if (str1 == str2)
	{
		return 1;
	}
	if (str2 == NULL)
	{
		return 0;
	}
	return strcmp(str1, str2) == 0;
}


Fix compile warning when selftests disabled

--- src/duk_selftest.h
+++ src/duk_selftest.h
@@ -5,6 +5,8 @@
 #ifndef DUK_SELFTEST_H_INCLUDED
 #define DUK_SELFTEST_H_INCLUDED

+#if defined(DUK_USE_SELF_TESTS)
 DUK_INTERNAL_DECL void duk_selftest_run_tests(void);
+#endif

 #endif  /* DUK_SELFTEST_H_INCLUDED */

<|original_code|>
/*
 *  Selftest code
 */

#ifndef DUK_SELFTEST_H_INCLUDED
#define DUK_SELFTEST_H_INCLUDED

DUK_INTERNAL_DECL void duk_selftest_run_tests(void);

#endif  /* DUK_SELFTEST_H_INCLUDED */

<|edits_diff|>
--- src/duk_selftest.h
+++ src/duk_selftest.h
@@ -5,6 +5,7 @@
 #ifndef DUK_SELFTEST_H_INCLUDED
 #define DUK_SELFTEST_H_INCLUDED

+#if defined(DUK_USE_SELF_TESTS)
 DUK_INTERNAL_DECL void duk_selftest_run_tests(void);

 #endif  /* DUK_SELFTEST_H_INCLUDED */
<|current_version|>
/*
 *  Selftest code
 */

#ifndef DUK_SELFTEST_H_INCLUDED
#define DUK_SELFTEST_H_INCLUDED

#if defined(DUK_USE_SELF_TESTS)
DUK_INTERNAL_DECL void duk_selftest_run_tests(void);

#endif  /* DUK_SELFTEST_H_INCLUDED */

<|next_version|>
/*
 *  Selftest code
 */

#ifndef DUK_SELFTEST_H_INCLUDED
#define DUK_SELFTEST_H_INCLUDED

#if defined(DUK_USE_SELF_TESTS)
DUK_INTERNAL_DECL void duk_selftest_run_tests(void);
#endif

#endif  /* DUK_SELFTEST_H_INCLUDED */


Add more common includes to PCH.

Add more common includes to PCH.

--- src/StdAfx.h
+++ src/StdAfx.h
@@ -32,7 +32,9 @@
 #include <list>
 #include <map>
 #include <memory>
+#include <sstream>
 #include <string>
+#include <vector>
 #include <utility>

 #include <SDL2/SDL.h>

<|original_code|>

/* StdAfx.h
 *
 * Copyright (C) 2013 Michael Imamura
 *
 * 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.
 */

#pragma once

#ifdef _WIN32
#	define VC_EXTRALEAN
#	define WIN32_LEAN_AND_MEAN
#	include <windows.h>
#endif

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#include <list>
#include <map>
#include <memory>
#include <string>
#include <utility>

#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_ttf.h>

<|edits_diff|>
--- src/StdAfx.h
+++ src/StdAfx.h
@@ -32,6 +32,7 @@
 #include <list>
 #include <map>
 #include <memory>
+#include <sstream>
 #include <string>
 #include <utility>

<|current_version|>

/* StdAfx.h
 *
 * Copyright (C) 2013 Michael Imamura
 *
 * 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.
 */

#pragma once

#ifdef _WIN32
#	define VC_EXTRALEAN
#	define WIN32_LEAN_AND_MEAN
#	include <windows.h>
#endif

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#include <list>
#include <map>
#include <memory>
#include <sstream>
#include <string>
#include <utility>

#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_ttf.h>

<|next_version|>

/* StdAfx.h
 *
 * Copyright (C) 2013 Michael Imamura
 *
 * 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.
 */

#pragma once

#ifdef _WIN32
#	define VC_EXTRALEAN
#	define WIN32_LEAN_AND_MEAN
#	include <windows.h>
#endif

#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#include <list>
#include <map>
#include <memory>
#include <sstream>
#include <string>
#include <vector>
#include <utility>

#include <SDL2/SDL.h>
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_ttf.h>


Check cplusplus in header files.

Check cplusplus in header files.

--- src/opencc_convert.h
+++ src/opencc_convert.h
@@ -23,7 +23,15 @@

 #define SEGMENT_BUFF_SIZE 1048576

+#ifdef __cplusplus
+extern "C" {
+#endif
+
 wchar_t * words_segmention(wchar_t * dest, const wchar_t * text);
 wchar_t * simp_to_trad(wchar_t * dest, const wchar_t * text);

+#ifdef __cplusplus
+};
+#endif
+
 #endif /* __OPENCC_CONVERT_H_ */

<|original_code|>
/*
* Open Chinese Convert
*
* Copyright 2010 BYVoid <byvoid1@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by 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.
*/

#ifndef __OPENCC_CONVERT_H_
#define __OPENCC_CONVERT_H_

#include "opencc_utils.h"

#define SEGMENT_BUFF_SIZE 1048576

wchar_t * words_segmention(wchar_t * dest, const wchar_t * text);
wchar_t * simp_to_trad(wchar_t * dest, const wchar_t * text);

#endif /* __OPENCC_CONVERT_H_ */

<|edits_diff|>
--- src/opencc_convert.h
+++ src/opencc_convert.h
@@ -23,6 +23,10 @@

 #define SEGMENT_BUFF_SIZE 1048576

+#ifdef __cplusplus
+extern "C" {
+#endif
+
 wchar_t * words_segmention(wchar_t * dest, const wchar_t * text);
 wchar_t * simp_to_trad(wchar_t * dest, const wchar_t * text);

<|current_version|>
/*
* Open Chinese Convert
*
* Copyright 2010 BYVoid <byvoid1@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by 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.
*/

#ifndef __OPENCC_CONVERT_H_
#define __OPENCC_CONVERT_H_

#include "opencc_utils.h"

#define SEGMENT_BUFF_SIZE 1048576

#ifdef __cplusplus
extern "C" {
#endif

wchar_t * words_segmention(wchar_t * dest, const wchar_t * text);
wchar_t * simp_to_trad(wchar_t * dest, const wchar_t * text);

#endif /* __OPENCC_CONVERT_H_ */

<|next_version|>
/*
* Open Chinese Convert
*
* Copyright 2010 BYVoid <byvoid1@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*      http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by 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.
*/

#ifndef __OPENCC_CONVERT_H_
#define __OPENCC_CONVERT_H_

#include "opencc_utils.h"

#define SEGMENT_BUFF_SIZE 1048576

#ifdef __cplusplus
extern "C" {
#endif

wchar_t * words_segmention(wchar_t * dest, const wchar_t * text);
wchar_t * simp_to_trad(wchar_t * dest, const wchar_t * text);

#ifdef __cplusplus
};
#endif

#endif /* __OPENCC_CONVERT_H_ */


Add missing property for WebUtils mock

[sailfish-browser] Add missing property for WebUtils mock

A warning was printed when running unit tests.

--- tests/auto/common/declarativewebutils.h
+++ tests/auto/common/declarativewebutils.h
@@ -21,6 +21,7 @@
 {
     Q_OBJECT
     Q_PROPERTY(QString homePage READ homePage NOTIFY homePageChanged FINAL)
+    Q_PROPERTY(bool firstUseDone READ firstUseDone NOTIFY firstUseDoneChanged FINAL)

 public:
     explicit DeclarativeWebUtils(QObject *parent = 0);
@@ -36,6 +37,7 @@

 signals:
     void homePageChanged();
+    void firstUseDoneChanged();

 private:
     QString m_homePage;

<|original_code|>
/****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jolla.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/. */

#ifndef DECLARATIVEWEBUTILS_H
#define DECLARATIVEWEBUTILS_H

#include <QObject>
#include <QString>
#include <QColor>
#include <qqml.h>

class DeclarativeWebUtils : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString homePage READ homePage NOTIFY homePageChanged FINAL)

public:
    explicit DeclarativeWebUtils(QObject *parent = 0);

    Q_INVOKABLE int getLightness(QColor color) const;
    Q_INVOKABLE QString displayableUrl(QString fullUrl) const;

    static DeclarativeWebUtils *instance();

    QString homePage() const;
    bool firstUseDone() const;
    void setFirstUseDone(bool firstUseDone);

signals:
    void homePageChanged();

private:
    QString m_homePage;
    bool m_firstUseDone;
};

QML_DECLARE_TYPE(DeclarativeWebUtils)

#endif

<|edits_diff|>
--- tests/auto/common/declarativewebutils.h
+++ tests/auto/common/declarativewebutils.h
@@ -21,6 +21,7 @@
 {
     Q_OBJECT
     Q_PROPERTY(QString homePage READ homePage NOTIFY homePageChanged FINAL)
+    Q_PROPERTY(bool firstUseDone READ firstUseDone NOTIFY firstUseDoneChanged FINAL)

 public:
     explicit DeclarativeWebUtils(QObject *parent = 0);
<|current_version|>
/****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jolla.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/. */

#ifndef DECLARATIVEWEBUTILS_H
#define DECLARATIVEWEBUTILS_H

#include <QObject>
#include <QString>
#include <QColor>
#include <qqml.h>

class DeclarativeWebUtils : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString homePage READ homePage NOTIFY homePageChanged FINAL)
    Q_PROPERTY(bool firstUseDone READ firstUseDone NOTIFY firstUseDoneChanged FINAL)

public:
    explicit DeclarativeWebUtils(QObject *parent = 0);

    Q_INVOKABLE int getLightness(QColor color) const;
    Q_INVOKABLE QString displayableUrl(QString fullUrl) const;

    static DeclarativeWebUtils *instance();

    QString homePage() const;
    bool firstUseDone() const;
    void setFirstUseDone(bool firstUseDone);

signals:
    void homePageChanged();

private:
    QString m_homePage;
    bool m_firstUseDone;
};

QML_DECLARE_TYPE(DeclarativeWebUtils)

#endif

<|next_version|>
/****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jolla.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/. */

#ifndef DECLARATIVEWEBUTILS_H
#define DECLARATIVEWEBUTILS_H

#include <QObject>
#include <QString>
#include <QColor>
#include <qqml.h>

class DeclarativeWebUtils : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString homePage READ homePage NOTIFY homePageChanged FINAL)
    Q_PROPERTY(bool firstUseDone READ firstUseDone NOTIFY firstUseDoneChanged FINAL)

public:
    explicit DeclarativeWebUtils(QObject *parent = 0);

    Q_INVOKABLE int getLightness(QColor color) const;
    Q_INVOKABLE QString displayableUrl(QString fullUrl) const;

    static DeclarativeWebUtils *instance();

    QString homePage() const;
    bool firstUseDone() const;
    void setFirstUseDone(bool firstUseDone);

signals:
    void homePageChanged();
    void firstUseDoneChanged();

private:
    QString m_homePage;
    bool m_firstUseDone;
};

QML_DECLARE_TYPE(DeclarativeWebUtils)

#endif