#ifndef _ASM_POWERPC_SPARSEMEM_H
#define _ASM_POWERPC_SPARSEMEM_H 1
#ifdef __KERNEL__

#ifdef CONFIG_SPARSEMEM
/*
 * SECTION_SIZE_BITS		2^N: how big each section will be
 * MAX_PHYSADDR_BITS		2^N: how much physical address space we have
 * MAX_PHYSMEM_BITS		2^N: how much memory we can have in that space
 */
#define SECTION_SIZE_BITS       28

#define MAX_PHYSADDR_BITS       44
#define MAX_PHYSMEM_BITS        44

#endif /* CONFIG_SPARSEMEM */

#ifdef CONFIG_MEMORY_HOTPLUG
extern void create_section_mapping(unsigned long start, unsigned long end);
extern int remove_section_mapping(unsigned long start, unsigned long end);
#ifdef CONFIG_NUMA
extern int hot_add_scn_to_nid(unsigned long scn_addr);
#else
static inline int hot_add_scn_to_nid(unsigned long scn_addr)
{
	return 0;
}
#endif /* CONFIG_NUMA */
#endif /* CONFIG_MEMORY_HOTPLUG */

#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_SPARSEMEM_H */

#ifndef _ASM_POWERPC_SPARSEMEM_H
#define _ASM_POWERPC_SPARSEMEM_H 1
#ifdef __KERNEL__

#ifdef CONFIG_SPARSEMEM
/*
 * SECTION_SIZE_BITS		2^N: how big each section will be
 * MAX_PHYSADDR_BITS		2^N: how much physical address space we have
 * MAX_PHYSMEM_BITS		2^N: how much memory we can have in that space
 */
#define SECTION_SIZE_BITS       24

#define MAX_PHYSADDR_BITS       44
#define MAX_PHYSMEM_BITS        44

#endif /* CONFIG_SPARSEMEM */

#ifdef CONFIG_MEMORY_HOTPLUG
extern void create_section_mapping(unsigned long start, unsigned long end);
extern int remove_section_mapping(unsigned long start, unsigned long end);
#ifdef CONFIG_NUMA
extern int hot_add_scn_to_nid(unsigned long scn_addr);
#else
static inline int hot_add_scn_to_nid(unsigned long scn_addr)
{
	return 0;
}
#endif /* CONFIG_NUMA */
#endif /* CONFIG_MEMORY_HOTPLUG */

#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_SPARSEMEM_H */

Revert "powerpc/mm: Bump SECTION_SIZE_BITS from 16MB to 256MB"

This reverts commit 7545ba6f82924d4523f8f8a2baf2e517a750265d.

It breaks eHEA among other issues


#ifndef ERL_NIF_COMPAT_H_
#define ERL_NIF_COMPAT_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include "erl_nif.h"

#if ERL_NIF_MAJOR_VERSION == 1 && ERL_NIF_MINOR_VERSION == 0

#define enif_open_resource_type_compat enif_open_resource_type
#define enif_alloc_resource_compat enif_alloc_resource
#define enif_release_resource_compat enif_release_resource
#define enif_alloc_binary_compat enif_alloc_binary
#define enif_realloc_binary_compat enif_realloc_binary
#define enif_release_binary_compat enif_release_binary
#define enif_alloc_compat enif_alloc
#define enif_free_compat enif_free
#define enif_get_atom_compat(E, T, B, S, C) \
    enif_get_atom(E, T, B, S)

#endif /* R13B04 */

#if ERL_NIF_MAJOR_VERSION == 2 && ERL_NIF_MINOR_VERSION == 0

#define enif_open_resource_type_compat(E, N, D, F, T) \
    enif_open_resource_type(E, NULL, N, D, F, T)

#define enif_alloc_resource_compat(E, T, S) \
    enif_alloc_resource(T, S)

#define enif_release_resource_compat(E, H) \
    enif_release_resource(H)

#define enif_alloc_binary_compat(E, S, B) \
    enif_alloc_binary(S, B)

#define enif_realloc_binary_compat(E, B, S) \
    enif_realloc_binary(B, S)

#define enif_release_binary_compat(E, B) \
    enif_release_binary(B)

#define enif_alloc_compat(E, S) \
    enif_alloc(S)

#define enif_free_compat(E, P) \
    enif_free(P)

#define enif_get_atom_compat enif_get_atom

#endif /* R14 */

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* ERL_NIF_COMPAT_H_ */

Add compatibility header and use compatibility macros to enable builds on both R13 and R14.


#ifndef GAMEMODEWIDGET_H
#define GAMEMODEWIDGET_H

#include <QtWidgets>

#include "PlayerActivatedWidget.h"
#include "PlayerControlModeWidget.h"

#include "Game\Player.h"
#include "Game\State.h"

class GameModeWidget : public QWidget
{
public:
	GameModeWidget(QWidget * parent = 0);
	~GameModeWidget();

	Player currentPlayer()const;
	State currentMode()const;

protected:

private:
	PlayerActivatedWidget * m_player1Indicator,
		*m_player2Indicator;
	PlayerControlModeWidget * m_playerControlAngle,
							* m_playerControlPower,
							* m_playerControlFire;
public slots:
	void setCurrentMode(State gameMode);
	void setCurrentPlayer(Player player);
};

#endif

#ifndef GAMEMODEWIDGET_H
#define GAMEMODEWIDGET_H

#include <QtWidgets>

#include "PlayerActivatedWidget.h"
#include "PlayerControlModeWidget.h"

#include "Game/Player.h"
#include "Game/State.h"

class GameModeWidget : public QWidget
{
public:
	GameModeWidget(QWidget * parent = 0);
	~GameModeWidget();

	Player currentPlayer()const;
	State currentMode()const;

protected:

private:
	PlayerActivatedWidget * m_player1Indicator,
		*m_player2Indicator;
	PlayerControlModeWidget * m_playerControlAngle,
							* m_playerControlPower,
							* m_playerControlFire;
public slots:
	void setCurrentMode(State gameMode);
	void setCurrentPlayer(Player player);
};

#endif

Update relative path of includes

Update relative path of includes


/*
 * Copyright (c) 2016 Domingo Alvarez Duarte
 *
 * The software is licensed under either the MIT License (below) or the Perl
 * license.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */

#ifndef HTTPPARSER_H
#define HTTPPARSER_H

#include "picohttpparser.h"

#endif // HTTPPARSER_H

Add the h2o/httparser.h forgotten on previous commit


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

#ifndef VIEWS_VIEW_CONSTANTS_H_
#define VIEWS_VIEW_CONSTANTS_H_
#pragma once

#include "views/views_export.h"

namespace views {

// Size (width or height) within which the user can hold the mouse and the
// view should scroll.
extern const int kAutoscrollSize;

// Time in milliseconds to autoscroll by a row. This is used during drag and
// drop.
extern const int kAutoscrollRowTimerMS;

// Used to determine whether a drop is on an item or before/after it. If a drop
// occurs kDropBetweenPixels from the top/bottom it is considered before/after
// the item, otherwise it is on the item.
VIEWS_EXPORT extern const int kDropBetweenPixels;

}  // namespace views

#endif  // VIEWS_VIEW_CONSTANTS_H_

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

#ifndef VIEWS_VIEW_CONSTANTS_H_
#define VIEWS_VIEW_CONSTANTS_H_
#pragma once

#include "views/views_export.h"

namespace views {

// Size (width or height) within which the user can hold the mouse and the
// view should scroll.
VIEWS_EXPORT extern const int kAutoscrollSize;

// Time in milliseconds to autoscroll by a row. This is used during drag and
// drop.
VIEWS_EXPORT extern const int kAutoscrollRowTimerMS;

// Used to determine whether a drop is on an item or before/after it. If a drop
// occurs kDropBetweenPixels from the top/bottom it is considered before/after
// the item, otherwise it is on the item.
VIEWS_EXPORT extern const int kDropBetweenPixels;

}  // namespace views

#endif  // VIEWS_VIEW_CONSTANTS_H_

Add VIEWS_EXPORT to autoscroll constants.

Referenced by browser/bookmarks/bookmark_drop_info.cc, fixes link when in
component and incremental linking on Windows.

BUG=
TEST=Links in Component build mode

Review URL: http://codereview.chromium.org/7741017

git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@98281 0039d316-1c4b-4281-b951-d872f2087c98


Make US100 sensor get distance successfully.


#ifndef MAP_PUT_INDIVIDUAL_CONTEXT_ENTITY_ATTRIBUTE_H
#define MAP_PUT_INDIVIDUAL_CONTEXT_ENTITY_ATTRIBUTE_H

/*
*
* Copyright 2013 Telefonica Investigacion y Desarrollo, S.A.U
*
* This file is part of Orion Context Broker.
*
* Orion Context Broker is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Orion Context Broker is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
* General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/.
*
* For those usages not covered by this license please contact with
* fermin at tid dot es
*
* Author: TID Developer
*/
#include "convenience/UpdateContextAttributeRequest.h"
#include "mongoBackend/MongoGlobal.h"

/* ****************************************************************************
*
* mapPutIndividualContextEntityAttributes -
*/
extern HttpStatusCode mapPutIndividualContextEntityAttribute(std::string entityId, std::string attributeName, UpdateContextAttributeRequest* request, StatusCode* response);

#endif

#ifndef MAP_PUT_INDIVIDUAL_CONTEXT_ENTITY_ATTRIBUTE_H
#define MAP_PUT_INDIVIDUAL_CONTEXT_ENTITY_ATTRIBUTE_H

/*
*
* Copyright 2014 Telefonica Investigacion y Desarrollo, S.A.U
*
* This file is part of Orion Context Broker.
*
* Orion Context Broker is free software: you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* Orion Context Broker is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero
* General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with Orion Context Broker. If not, see http://www.gnu.org/licenses/.
*
* For those usages not covered by this license please contact with
* fermin at tid dot es
*
* Author: TID Developer
*/
#include "convenience/UpdateContextAttributeRequest.h"
#include "mongoBackend/MongoGlobal.h"

/* ****************************************************************************
*
* mapPutIndividualContextEntityAttributes -
*/
extern HttpStatusCode mapPutIndividualContextEntityAttribute(std::string entityId, std::string attributeName, UpdateContextAttributeRequest* request, StatusCode* response);

#endif

Change date of copyright notice

Change date of copyright notice


#ifndef INLINE_DEBUG_HELPER_H
#define INLINE_DEBUG_HELPER_H

#include "pipe/p_compiler.h"
#include "util/u_debug.h"

/* Helper function to wrap a screen with
 * one or more debug driver: rbug, trace.
 */

#ifdef GALLIUM_TRACE
#include "trace/tr_public.h"
#endif

#ifdef GALLIUM_RBUG
#include "rbug/rbug_public.h"
#endif

#ifdef GALLIUM_GALAHAD
#include "galahad/glhd_public.h"
#endif

#ifdef GALLIUM_NOOP
#include "noop/noop_public.h"
#endif

static INLINE struct pipe_screen *
debug_screen_wrap(struct pipe_screen *screen)
{

#if defined(GALLIUM_RBUG)
   screen = rbug_screen_create(screen);
#endif

#if defined(GALLIUM_TRACE)
   screen = trace_screen_create(screen);
#endif

#if defined(GALLIUM_GALAHAD)
   screen = galahad_screen_create(screen);
#endif

#if defined(GALLIUM_NOOP)
   screen = noop_screen_create(screen);
#endif

   return screen;
}

#endif

#ifndef INLINE_DEBUG_HELPER_H
#define INLINE_DEBUG_HELPER_H

#include "pipe/p_compiler.h"
#include "util/u_debug.h"

/* Helper function to wrap a screen with
 * one or more debug driver: rbug, trace.
 */

#ifdef DEBUG

#ifdef GALLIUM_TRACE
#include "trace/tr_public.h"
#endif

#ifdef GALLIUM_RBUG
#include "rbug/rbug_public.h"
#endif

#ifdef GALLIUM_GALAHAD
#include "galahad/glhd_public.h"
#endif

#ifdef GALLIUM_NOOP
#include "noop/noop_public.h"
#endif

#endif /* DEBUG */

static INLINE struct pipe_screen *
debug_screen_wrap(struct pipe_screen *screen)
{
#ifdef DEBUG

#if defined(GALLIUM_RBUG)
   screen = rbug_screen_create(screen);
#endif

#if defined(GALLIUM_TRACE)
   screen = trace_screen_create(screen);
#endif

#if defined(GALLIUM_GALAHAD)
   screen = galahad_screen_create(screen);
#endif

#if defined(GALLIUM_NOOP)
   screen = noop_screen_create(screen);
#endif

#endif /* DEBUG */

   return screen;
}

#endif

target-helpers: Enable debug helpers only on debug builds.

Some of these helpers use debug_get_option, which works also on releases.


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

#ifndef GMSampleView_DEFINED
#define GMSampleView_DEFINED

#include "SampleCode.h"
#include "gm.h"

class GMSampleView : public SampleView {
private:
    typedef skiagm::GM GM;

public:
    GMSampleView(GM* gm)
    : fGM(gm) {}

    virtual ~GMSampleView() {
        delete fGM;
    }

protected:
    virtual bool onQuery(SkEvent* evt) {
        if (SampleCode::TitleQ(*evt)) {
            SkString name("GM ");
            name.append(fGM->shortName());
            SampleCode::TitleR(evt, name.c_str());
            return true;
        }
        return this->INHERITED::onQuery(evt);
    }

    virtual void onDrawContent(SkCanvas* canvas) {
        fGM->drawContent(canvas);
    }

    virtual void onDrawBackground(SkCanvas* canvas) {
        fGM->drawBackground(canvas);
    }

private:
    GM* fGM;
    typedef SampleView INHERITED;
};

#endif

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

#ifndef GMSampleView_DEFINED
#define GMSampleView_DEFINED

#include "SampleCode.h"
#include "gm.h"

class GMSampleView : public SampleView {
private:
    typedef skiagm::GM GM;

public:
    GMSampleView(GM* gm)
    : fGM(gm) {}

    virtual ~GMSampleView() {
        delete fGM;
    }

protected:
    virtual bool onQuery(SkEvent* evt) {
        if (SampleCode::TitleQ(*evt)) {
            SkString name("GM:");
            name.append(fGM->shortName());
            SampleCode::TitleR(evt, name.c_str());
            return true;
        }
        return this->INHERITED::onQuery(evt);
    }

    virtual void onDrawContent(SkCanvas* canvas) {
        fGM->drawContent(canvas);
    }

    virtual void onDrawBackground(SkCanvas* canvas) {
        fGM->drawBackground(canvas);
    }

private:
    GM* fGM;
    typedef SampleView INHERITED;
};

#endif

Use : as separator between "GM" and slide name in SampleApp. This makes it easier to jump to a GM slide using command line args on windows.


#pragma once

#include "pathos/actor/scene_component.h"
#include "badger/types/matrix_types.h"

namespace pathos {

	class Mesh;
	class MeshGeometry;
	class Material;

	// #todo-renderer: Further decompose
	struct StaticMeshProxy : public SceneComponentProxy {
		uint32 doubleSided : 1;
		uint32 renderInternal : 1;
		matrix4 modelMatrix;
		MeshGeometry* geometry;
		Material* material;
	};

	struct ShadowMeshProxy : public SceneComponentProxy {
		matrix4 modelMatrix;
		MeshGeometry* geometry;
	};

	class StaticMeshComponent : public SceneComponent {
		friend class GodRay; // due to createRenderProxy_internal()

	public:
		virtual void createRenderProxy(Scene* scene);

		inline Mesh* getStaticMesh() const { return mesh; }

		void setStaticMesh(Mesh* inMesh) { mesh = inMesh; }

	private:
		void createRenderProxy_internal(Scene* scene, std::vector<StaticMeshProxy*>& outProxyList);

	public:
		bool castsShadow = true;

	private:
		Mesh* mesh;

	};

}

#pragma once

#include "pathos/actor/scene_component.h"
#include "badger/types/matrix_types.h"

namespace pathos {

	class Mesh;
	class MeshGeometry;
	class Material;

	// #todo-renderer: Further decompose
	struct StaticMeshProxy : public SceneComponentProxy {
		uint32 doubleSided : 1;
		uint32 renderInternal : 1;
		matrix4 modelMatrix;
		MeshGeometry* geometry;
		Material* material;
	};

	struct ShadowMeshProxy : public SceneComponentProxy {
		matrix4 modelMatrix;
		MeshGeometry* geometry;
	};

	class StaticMeshComponent : public SceneComponent {
		friend class GodRay; // due to createRenderProxy_internal()

	public:
		virtual void createRenderProxy(Scene* scene);

		inline Mesh* getStaticMesh() const { return mesh; }

		void setStaticMesh(Mesh* inMesh) { mesh = inMesh; }

	private:
		void createRenderProxy_internal(Scene* scene, std::vector<StaticMeshProxy*>& outProxyList);

	public:
		bool castsShadow = true;

	private:
		Mesh* mesh = nullptr;

	};

}

Set default value of StaticMeshComponent::mesh to nullptr


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

#include "m-string.h"

size_t fsize(const char str[])
{
  return m_str1ng_utf8_length(str);
}

void convert(string_t s, unsigned n)
{
  m_string_set_ui(s, n);
}

void construct(char s[], unsigned n)
{
  strcpy(s, M_CSTR("Hello %u worlds"));
}

Update code for generated asm analysis

Update code for generated asm analysis


//
//  WebSocketTransport.h
//  WebSocketTransport
//
//  Created by Paul Young on 27/08/2014.
//  Copyright (c) 2014 CocoaFlow. All rights reserved.
//

#import <Foundation/Foundation.h>

//! Project version number for WebSocketTransport.
FOUNDATION_EXPORT double WebSocketTransportVersionNumber;

//! Project version string for WebSocketTransport.
FOUNDATION_EXPORT const unsigned char WebSocketTransportVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <WebSocketTransport/PublicHeader.h>

#import "BLWebSocketsServer.h"

Make BLWebSocketsServer available in Swift.


//
//  ZDetailKit.h
//
//  Created by Lukas Zeller on 15.02.13.
//  Copyright (c) 2013 plan44.ch. All rights reserved.
//

// common
#import "ZDetailEditing.h"
#import "ZDBGMacros.h"

// ZUtils
#import "ZCustomI8n.h"

// controllers
#import "ZDetailTableViewController.h"

// cells
#import "ZButtonCell.h"
#import "ZSwitchCell.h"
#import "ZSegmentChoicesCell.h"
#import "ZSliderCell.h"
#import "ZTextFieldCell.h"
#import "ZTextViewCell.h"
#import "ZDateTimeCell.h"
#import "ZColorChooserCell.h"
#import "ZChoiceListCell.h"

// Note: ZLocationCell requires MapKit and CoreLocation frameworks to be included in the app
#import "ZLocationCell.h"

// EOF

//
//  ZDetailKit.h
//
//  Created by Lukas Zeller on 15.02.13.
//  Copyright (c) 2013 plan44.ch. All rights reserved.
//

// common
#import "ZDetailEditing.h"
#import "ZDBGMacros.h"

// ZUtils
#import "ZCustomI8n.h"

// controllers
#import "ZDetailTableViewController.h"

// cells
#import "ZButtonCell.h"
#import "ZSwitchCell.h"
#import "ZSegmentChoicesCell.h"
#import "ZSliderCell.h"
#import "ZTextFieldCell.h"
#import "ZTextViewCell.h"
#import "ZDateTimeCell.h"
#import "ZColorChooserCell.h"
#import "ZChoiceListCell.h"

// Note: ZLocationCell requires MapKit and CoreLocation frameworks to be included in the app,
//       which in turn requires that the app declares usage of location in NSLocationAlwaysUsageDescription,
//       NSLocationWhenInUseUsageDescription, and NSLocationAlwaysAndWhenInUseUsageDescription in info.plist
#import "ZLocationCell.h"

// EOF

Comment improvement: explain consequences of using ZLocationCell


// project-specific definitions for otaa sensor
//#define CFG_eu868 1
#define CFG_us915 1
//#define CFG_au921 1
//#define CFG_as923 1
//#define CFG_in866 1
#define CFG_sx1276_radio 1
//#define LMIC_USE_INTERRUPTS

// project-specific definitions
//#define CFG_eu868 1
#define CFG_us915 1
//#define CFG_au921 1
//#define CFG_as923 1
// #define LMIC_COUNTRY_CODE LMIC_COUNTRY_CODE_JP	/* for as923-JP */
//#define CFG_in866 1
#define CFG_sx1276_radio 1
//#define LMIC_USE_INTERRUPTS

Add example of how to select Japan country


#include "../libk.h"

void screenTest(void)
{
    int rows, cols; rows = glob.rows; cols = glob.cols;

    printf("%s", CursorToTopLeft ClearScreen );fflush(stdout);
    printf("Top of Screen: rows = %d cols = %d\n\r", rows,cols);fflush(stdout);

    int count;
    for (count = 2; count < rows; count ++)
        {printf("%s", TildeReturnNewline); fflush(stdout);}

    printf("%s","Bottom of Screen         "); fflush(stdout);

//  Force Cursor Position with	<ESC>[{ROW};{COLUMN}f

    printf ("\x1b[%d;%df%s", 5,5,"Hello World"); fflush(stdout);

//
    printf("\x1b[%d;%df",2,1); fflush(stdout);

    return;
 }

#include "../libk.h"
//  function screenTest
void screenTest(void)
{
//  retrieve Screen rows and columns from struct glob
    int rows, cols; rows = glob.rows; cols = glob.cols;
//  Move Screen Cursor to Top Left, Then Clear Screen
    printf("%s", CursorToTopLeft ClearScreen );fflush(stdout);
//  Print the Screen Header
    printf("Top of Screen: rows = %d cols = %d\n\r", rows,cols);fflush(stdout);

    int count;
//  Print Left Column Tildes to Screen, leaving screen last line clear
    for (count = 2; count < rows; count ++)
        {printf("%s", TildeReturnNewline); fflush(stdout);}
//  Prnt Screen Last Line
    printf("%s","Bottom of Screen         "); fflush(stdout);

//  Place Cursor Position with	<ESC>[{ROW};{COLUMN}f

    printf ("\x1b[%d;%df%s", 5,5,"Hello World"); fflush(stdout);

//  Move Screen Cursor to Second Line, First Column
    printf("\x1b[%d;%df",2,1); fflush(stdout);

    return;
 }

Add comments suit for formatting with idiom


#ifndef LMSENSOR_H
#define LMSENSOR_H

#include <K3Process>
#include <K3ProcIO>

#include "sensor.h"

/**
 *
 * Hans Karlsson
 **/
class SensorSensor : public Sensor
{
    Q_OBJECT
public:
    SensorSensor(int interval, char tempUnit);

    ~SensorSensor();

    void update();

private:
    K3ShellProcess ksp;
    QString extraParams;

    QMap<QString, QString> sensorMap;
#ifdef __FreeBSD__
    QMap<QString, QString> sensorMapBSD;
#endif
    QString sensorResult;

private slots:
    void receivedStdout(K3Process *, char *buffer, int);
    void processExited(K3Process *);

};

#endif // LMSENSOR_H

#ifndef LMSENSOR_H
#define LMSENSOR_H

#include <K3Process>
#include <K3ProcIO>

#include "sensor.h"

/**
 *
 * Hans Karlsson
 **/
class SensorSensor : public Sensor
{
    Q_OBJECT
public:
    SensorSensor(int interval, char tempUnit);

    ~SensorSensor();

    void update();

private:
    K3ShellProcess ksp;
    QString extraParams;

    QMap<QString, QString> sensorMap;
#if defined(__FreeBSD__) || defined(Q_OS_NETBSD)
    QMap<QString, QString> sensorMapBSD;
#endif
    QString sensorResult;

private slots:
    void receivedStdout(K3Process *, char *buffer, int);
    void processExited(K3Process *);

};

#endif // LMSENSOR_H

Fix knode superkaramba compilation on NetBSD.
Patch by Mark Davies.
BUG: 154730

svn path=/trunk/KDE/kdeutils/superkaramba/; revision=753733


int x = 0;

int main(int argc, char *argv[]) {
	int y;
	char *p = &x;

	*p = 23;
	y = x;
	x = 35;
	return y;
}

int x = 0;

int main(int argc, char *argv[]) {
	int y;
	char *p = &x;

	*p = 23;
	y = x;
	x = 35;
	return y != 23;
}

Fix return value of main().

Fix return value of main().

[r19359]


#pragma once

#include <TestFramework/TestFramework.h>
#include <cal3d/streamops.h>
#include <cal3d/vector4.h>
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/scoped_array.hpp>

using boost::scoped_ptr;
using boost::shared_ptr;
using boost::lexical_cast;
using boost::scoped_array;

inline bool AreClose(
    const CalPoint4& p1,
    const CalPoint4& p2,
    float tolerance
) {
    return (p1.asCalVector4() - p2.asCalVector4()).length() < tolerance;
}

#pragma once

// The old version of clang currently used on the Mac builder requires some
// operator<<() declarations to precede their use in the UnitTest++
// templates/macros. -- jlee - 2014-11-21
#include <cal3d/streamops.h>

#include <TestFramework/TestFramework.h>
#include <cal3d/vector4.h>
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/scoped_array.hpp>

using boost::scoped_ptr;
using boost::shared_ptr;
using boost::lexical_cast;
using boost::scoped_array;

inline bool AreClose(
    const CalPoint4& p1,
    const CalPoint4& p2,
    float tolerance
) {
    return (p1.asCalVector4() - p2.asCalVector4()).length() < tolerance;
}

cal3d: Rearrange output operator declarations in tests to make old OSX clang happy

Maybe fixing Mac buildbot.

git-svn-id: febc42a3fd39fb08e5ae2b2182bc5ab0a583559c@207440 07c76cb3-cb09-0410-85de-c24d39f1912e


/*
   Copyright 2011 Future Platforms

   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.
*/

#import <KirinKit/KirinKit.h>
#import "Networking.h"

@interface NetworkingBackend : KirinServiceStub <Networking> {

}

@end

/*
   Copyright 2011 Future Platforms

   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.
*/

#import <KirinKit/KirinKit.h>
#import "Networking.h"

@interface NetworkingBackend : KirinServiceStub <Networking, KirinServiceOnMainThread> {

}

@end

Make Networking run on the main thread.

Make Networking run on the main thread.


//
//  EYMaskedTextField.h
//
//
//  Created by Evgeniy Yurtaev on 10/09/15.
//  Copyright (c) 2015 Evgeniy Yurtaev. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol EYMaskedTextFieldDelegate <UITextFieldDelegate>

@optional
- (BOOL)textField:(UITextField *)textField shouldChangeUnformattedText:(NSString *)unformattedText inRange:(NSRange)range replacementString:(NSString *)string;

@end

@interface EYMaskedTextField : UITextField

@property (copy, nonatomic) IBInspectable NSString *mask;

@property (copy, nonatomic) IBInspectable NSString *unformattedText;

@property (assign, nonatomic) id<EYMaskedTextFieldDelegate> delegate;

@end

//
//  EYMaskedTextField.h
//
//
//  Created by Evgeniy Yurtaev on 10/09/15.
//  Copyright (c) 2015 Evgeniy Yurtaev. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN

@protocol EYMaskedTextFieldDelegate <UITextFieldDelegate>

@optional
- (BOOL)textField:(nonnull UITextField *)textField shouldChangeUnformattedText:(nullable NSString *)unformattedText inRange:(NSRange)range replacementString:(nullable NSString *)string;

@end

@interface EYMaskedTextField : UITextField

@property (copy, nonatomic, nullable) IBInspectable NSString *mask;

@property (copy, nonatomic, nullable) IBInspectable NSString *unformattedText;

@property (assign, nonatomic, nullable) id<EYMaskedTextFieldDelegate> delegate;

@end

NS_ASSUME_NONNULL_END

Add `nonnull` and `nullable` attributes

Add `nonnull` and `nullable` attributes


#pragma once

#include <ri.h>
#include <vector>
#include "Types.h"

typedef std::vector<RtInt> RtIntContainer;
typedef std::vector<RtFloat> RtFloatContainer;

/*!
 * \remark Alembic does not support "holes" but to be safe, we are targeting
 *         RiPointsGeneralPolygons to future proof our code
 *
 *         RtVoid RiPointsGeneralPolygons(RtInt npolys, RtInt nloops[],
 *                                        RtInt nvertices[],
 *                                        RtInt vertices[], ...);
 *
 */
struct RendermanMeshData
{
	V3fSamplingArray2D _P_data_array;
	// Assumes topological stability
	RtInt _npolys;
	RtIntContainer _nloops_data;
	RtIntContainer _nvertices_data;
	RtIntContainer _vertices_data;
};

struct RendermanPointsData
{
	V3fSamplingArray2D _P_data_array;
	// Assumes topological stability
	RtFloat _constantwidth;
	RtIntContainer _ids_data;
	RtFloatContainer _width_data;
};
// == Emacs ================
// -------------------------
// Local variables:
// tab-width: 4
// indent-tabs-mode: t
// c-basic-offset: 4
// end:
//
// == vi ===================
// -------------------------
// Format block
// ex:ts=4:sw=4:expandtab
// -------------------------

#pragma once

#include <ri.h>
#include <vector>
#include "Types.h"

typedef std::vector<RtInt> RtIntContainer;
typedef std::vector<RtFloat> RtFloatContainer;

/*!
 * \remark Alembic does not support "holes" but to be safe, we are targeting
 *         RiPointsGeneralPolygons to future proof our code
 *
 *         RtVoid RiPointsGeneralPolygons(RtInt npolys, RtInt nloops[],
 *                                        RtInt nvertices[],
 *                                        RtInt vertices[], ...);
 *
 */
struct RendermanMeshData
{
	V3fSamplingArray2D _P_data_array;
	// Assumes topological stability
	RtInt _npolys;
	RtIntContainer _nloops_data;
	RtIntContainer _nvertices_data;
	RtIntContainer _vertices_data;
};

struct RendermanPointsData
{
	V3fSamplingArray2D _P_data_array;
	// Assumes topological stability
	RtIntContainer _ids_data;
	RtFloatContainer _width_data;
};
// == Emacs ================
// -------------------------
// Local variables:
// tab-width: 4
// indent-tabs-mode: t
// c-basic-offset: 4
// end:
//
// == vi ===================
// -------------------------
// Format block
// ex:ts=4:sw=4:expandtab
// -------------------------

Remove _constantwidth as there are other was to determine that via the length of the _width_data vector


/**
 * @file
 *
 * @brief tests if compilation works (include and build paths set correct, etc...)
 *
 * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
 *
 */

#include <gcrypt.h>

int main (void)
{
	gcry_cipher_hd_t elektraCryptoHandle;
	return 0;
}

/**
 * @file
 *
 * @brief tests if compilation works (include and build paths set correct, etc...)
 *
 * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
 *
 */

#include <gcrypt.h>

gcry_cipher_hd_t nothing ()
{
	gcry_cipher_hd_t elektraCryptoHandle = NULL;
	return elektraCryptoHandle;
}

int main (void)
{
	nothing ();
	return 0;
}

Gcrypt: Fix detection of lib if we use `-Werror`

Before this update detecting Libgcrypt would fail, if we treated
warnings as errors (`-Werror`). The cause of this problem was that
compiling `compile_gcrypt.cpp` produced a warning about an unused
variable.


/*
 * 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 java_lang_Thread_H
#define java_lang_Thread_H

#import <pthread.h>

@class JavaLangThread;

CF_EXTERN_C_BEGIN

pthread_key_t java_thread_key;
pthread_once_t java_thread_key_init_once;

void initJavaThreadKeyOnce();
JavaLangThread *getCurrentJavaThreadOrNull();

CF_EXTERN_C_END

#endif  // java_lang_Thread_H

/*
 * 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 java_lang_Thread_H
#define java_lang_Thread_H

#import <pthread.h>

@class JavaLangThread;

CF_EXTERN_C_BEGIN

extern pthread_key_t java_thread_key;
extern pthread_once_t java_thread_key_init_once;

void initJavaThreadKeyOnce();
JavaLangThread *getCurrentJavaThreadOrNull();

CF_EXTERN_C_END

#endif  // java_lang_Thread_H

Fix unintentional tentative definitions that result in duplicate symbol definitions when building with -fno-common

This primarily consists of adding missing `extern`s in front of declarations of global variables, and `typedef` in front of some `NS_ENUM`s.

-fno-common is being turned on by default with Clang 11. This fix is a preemptive measure to ensure code will compile when Clang 11 is shipped in a future Xcode update.

In C, global variables that are defined without an initializer are known as tentative definitions. These are distinct from declarations of global variables, which are preceeded by the `extern` keyword.

For performance and correctness reasons, Clang is changing their handling of tentative definitions. Almost all tentative definitions are unintentional omissions of `extern`, rather than an intentional decision by the code author, which can result in subtle bugs that are hard to pin down.

Historically, Clang has placed tentative definitions in the __DATA,__common section. The linker then allows non-tentative definitions to override any tentative definitions, and coalesces all tentative definitions of a single symbol into a single tentative definition. This meant that having multiple tentative definitions would not produce a linker error about duplicate symbol definitions, nor would having both a normal and tentative definition.

With the -fno-common flag, Clang will instead place both tentative and normal definitions in the __DATA,__bss section, which will result in duplicate symbol definition errors from the linker if multiple tentative definitions and/or normal definitions are present in different object files.

PiperOrigin-RevId: 305885508


//
//  WebApiClient-Core.h
//  WebApiClient
//
//  Created by Matt on 21/07/15.
//  Copyright (c) 2015 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0.
//

#import <WebApiClient/FileWebApiResource.h>
#import <WebApiClient/NSDictionary+WebApiClient.h>
#import <WebApiClient/WebApiAuthorizationProvider.h>
#import <WebApiClient/WebApiClient.h>
#import <WebApiClient/WebApiClientEnvironment.h>
#import <WebApiClient/WebApiClientSupport.h>
#import <WebApiClient/WebApiDataMapper.h>
#import <WebApiClient/WebApiResource.h>
#import <WebApiClient/WebApiResponse.h>
#import <WebApiClient/WebApiRoute.h>

//
//  WebApiClient-Core.h
//  WebApiClient
//
//  Created by Matt on 21/07/15.
//  Copyright (c) 2015 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0.
//

#import <WebApiClient/FileWebApiResource.h>
#import <WebApiClient/NSDictionary+WebApiClient.h>
#import <WebApiClient/WebApiAuthorizationProvider.h>
#import <WebApiClient/WebApiClient.h>
#import <WebApiClient/WebApiClientDigestUtils.h>
#import <WebApiClient/WebApiClientEnvironment.h>
#import <WebApiClient/WebApiClientSupport.h>
#import <WebApiClient/WebApiDataMapper.h>
#import <WebApiClient/WebApiResource.h>
#import <WebApiClient/WebApiResponse.h>
#import <WebApiClient/WebApiRoute.h>

Add new file to umbrella import.

Add new file to umbrella import.


#ifndef PPRINTFP_H
#define PPRINTFP_H

/*
 * Grisu3 is not part of the portable lib per se, it must be in the
 * include path. Grisu3 provides much faster printing and parsing in the
 * typical case with fallback to sprintf for printing and strod for
 * parsing.
 *
 * Either define PORTABLE_USE_GRISU3, or include the grisu3 header first.
 *
 * Without grisu3, this file still ensures that a float or a double is
 * printed without loss of precision.
 */
#if PORTABLE_USE_GRISU3
#include "grisu3/grisu3_print.h"
#endif

#ifdef grisu3_print_double_is_defined
/* Currently there is not special support for floats. */
#define print_float(n, p) grisu3_print_double((float)(n), (p))
#define print_double(n, p) grisu3_print_double((double)(n), (p))
#else
#include <stdio.h>
#define print_float(n, p) sprintf(p, "%.9g", (float)(n))
#define print_double(n, p) sprintf(p, "%.17g", (double)(n))
#endif

#define print_hex_float(n, p) sprintf(p, "%a", (float)(n))
#define print_hex_double(n, p) sprintf(p, "%a", (double)(n))

#endif /* PPRINTFP_H */

Add portable floating point printing with optional grisu3 support


#ifdef _MSC_VER
    #include <nmmintrin.h>
#else
    #include <popcntintrin.h>
#endif

int main(void)
{
    long long a = 0;
    int b;
#ifdef _MSC_VER
    #ifdef _M_X64
    a = _mm_popcnt_u64(1);
    #endif
    b = _mm_popcnt_u32(1);
#else
    #ifdef __x86_64__
    a = __builtin_popcountll(1);
    #endif
    b = __builtin_popcount(1);
#endif
    return (int)a + b;
}

#ifdef _MSC_VER
    #include <nmmintrin.h>
#else
    #include <popcntintrin.h>
#endif

#include <stdlib.h>

int main(void)
{
    long long a = 0;
    int b;

    a = random();
    b = random();

#ifdef _MSC_VER
    #ifdef _M_X64
    a = _mm_popcnt_u64(a);
    #endif
    b = _mm_popcnt_u32(b);
#else
    #ifdef __x86_64__
    a = __builtin_popcountll(a);
    #endif
    b = __builtin_popcount(b);
#endif
    return (int)a + b;
}

Fix compile-time test of POPCNT

Fix compile-time test of POPCNT

The compile-time test of POPCNT, cpu_popcnt.c produced code that would
execute without error even if the machine didn't support the popcnt
instruction. This patch attempts to use popcnt on random numbers so the
compiler can't substitute the answer at compile time.


#pragma once

#define CLASS_3RVX L"3RVXv3"

static const UINT WM_3RVX_CONTROL
    = RegisterWindowMessage(L"WM_3RVX_CONTROL");
static const UINT WM_3RVX_SETTINGSCTRL
    = RegisterWindowMessage(L"WM_3RVX_SETTINGSCTRL");

#define MSG_LOAD     WM_APP + 100
#define MSG_SETTINGS WM_APP + 101
#define MSG_EXIT     WM_APP + 102
#define MSG_HIDEOSD  WM_APP + 103

#pragma once

#define CLASS_3RVX L"3RVXv3"
#define CLASS_3RVX_SETTINGS L"3RVX-Settings"

static const UINT WM_3RVX_CONTROL
    = RegisterWindowMessage(L"WM_3RVX_CONTROL");
static const UINT WM_3RVX_SETTINGSCTRL
    = RegisterWindowMessage(L"WM_3RVX_SETTINGSCTRL");

#define MSG_LOAD     WM_APP + 100
#define MSG_SETTINGS WM_APP + 101
#define MSG_EXIT     WM_APP + 102
#define MSG_HIDEOSD  WM_APP + 103
#define MSG_ACTIVATE WM_APP + 104

Add a class for the settings dialog

Add a class for the settings dialog


/*
 *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

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

 iLBC Speech Coder ANSI-C Source Code

 WebRtcIlbcfix_NearestNeighbor.c

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

#include "defines.h"

void WebRtcIlbcfix_NearestNeighbor(size_t* index,
                                   const size_t* array,
                                   size_t value,
                                   size_t arlength) {
  size_t min_diff = (size_t)-1;
  for (size_t i = 0; i < arlength; i++) {
    const size_t diff =
        (array[i] < value) ? (value - array[i]) : (array[i] - value);
    if (diff < min_diff) {
      *index = i;
      min_diff = diff;
    }
  }
}

/*
 *  Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

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

 iLBC Speech Coder ANSI-C Source Code

 WebRtcIlbcfix_NearestNeighbor.c

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

#include "defines.h"

void WebRtcIlbcfix_NearestNeighbor(size_t* index,
                                   const size_t* array,
                                   size_t value,
                                   size_t arlength) {
  size_t i;
  size_t min_diff = (size_t)-1;
  for (i = 0; i < arlength; i++) {
    const size_t diff =
        (array[i] < value) ? (value - array[i]) : (array[i] - value);
    if (diff < min_diff) {
      *index = i;
      min_diff = diff;
    }
  }
}

Fix ChromeOS build (C99 break)

Fix ChromeOS build (C99 break)

BUG=5016
TBR=henrik.lundin@webrtc.org

Review URL: https://codereview.webrtc.org/1354163002

Cr-Original-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#9992}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 2803a40fe335a29f9584911d1a52856bdb302df7


// RUN: rm -rf %t && mkdir -p %t && cd %t
// RUN: not --crash %clang_cc1 %s -emit-llvm -o foo.ll
// RUN: ls . | FileCheck %s --allow-empty
// CHECK-NOT: foo.ll

#pragma clang __debug crash
FOO

[Support] Use FILE_SHARE_DELETE to fix RemoveFileOnSignal on Windows

Summary:
Tools like clang that use RemoveFileOnSignal on their output files
weren't actually able to clean up their outputs before this change.  Now
the call to llvm::sys::fs::remove succeeds and the temporary file is
deleted. This is a stop-gap to fix clang before implementing the
solution outlined in PR34070.

Reviewers: davide

Subscribers: llvm-commits, hiraditya

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

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


#ifndef KAI_PLATFORM_GAME_CONTROLLER_H
#define KAI_PLATFORM_GAME_CONTROLLER_H

#include KAI_PLATFORM_INCLUDE(GameController.h)

#endif // SHATTER_PLATFORM_GAME_CONTROLLER_H

//EOF

#ifndef KAI_PLATFORM_GAME_CONTROLLER_H
#define KAI_PLATFORM_GAME_CONTROLLER_H

#include KAI_PLATFORM_INCLUDE(GameController.h)

#endif

//EOF

Add some color for console output

Add some color for console output


/*
 * Copyright (C) 2016 Eistec AB
 *
 * 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     cpu
 * @{
 *
 * @file
 * @brief       MSPGCC supplemental functions
 *
 * @author      Joakim Nohlgård <joakim.nohlgard@eistec.se
 *
 * @}
 */

#ifdef __MSPGCC__

/* internal GCC type for "half integer" (16 bit) */
/* See also:
 * http://stackoverflow.com/questions/4559025/what-does-gcc-attribute-modexx-actually-do
 * http://www.delorie.com/gnu/docs/gcc/gccint_53.html
 */
typedef unsigned int UHItype __attribute__ ((mode (HI)));

/**
 * @brief Count leading zeros
 *
 * Naive implementation
 */
int __clzhi2(UHItype x)
{
    int i = 0;
    for (UHItype mask = (1 << 15); mask != 0; mask >>= 1) {
        if (x & mask) {
            return i;
        }
        ++i;
    }
    return i; /* returns 16 if x == 0 */
}

/**
 * @brief Count trailing zeros
 *
 * Naive implementation
 */
int __ctzhi2(UHItype x)
{
    int i = 0;
    for (UHItype mask = 1; mask != 0; mask <<= 1) {
        if (x & mask) {
            return i;
        }
        ++i;
    }
    return i; /* returns 16 if x == 0 */
}
#endif /* __MSPGCC__ */

msp430_common: Add supplemental __clzhi2, __ctzhi2, for old MSPGCC


// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/document/bucket/bucketid.h>
#include <vespa/persistence/spi/bucket_limits.h>
#include <cassert>

namespace storage {

/**
 * Returns the super bucket key of the given bucket id key based on the minimum used bits allowed.
 */
uint64_t get_super_bucket_key(const document::BucketId& bucket_id) {
    assert(bucket_id.getUsedBits() >= spi::BucketLimits::MinUsedBits);
    // Since bucket keys have count-bits at the LSB positions, we want to look at the MSBs instead.
    return (bucket_id.toKey() >> (64 - spi::BucketLimits::MinUsedBits));
}

}

// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/document/bucket/bucketid.h>
#include <vespa/persistence/spi/bucket_limits.h>
#include <cassert>

namespace storage {

/**
 * Returns the super bucket key of the given bucket id key based on the minimum used bits allowed.
 */
inline uint64_t get_super_bucket_key(const document::BucketId& bucket_id) noexcept {
    assert(bucket_id.getUsedBits() >= spi::BucketLimits::MinUsedBits);
    // Since bucket keys have count-bits at the LSB positions, we want to look at the MSBs instead.
    return (bucket_id.toKey() >> (64 - spi::BucketLimits::MinUsedBits));
}

}

Make function inline and noexcept.

Make function inline and noexcept.


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "constants.h"
#include "funcs.h"

int main(int argc, char **argv) {

    if (argc != 2) {
        return printf("usage: %s [hex key] [key phrase]\n", argv[0]);
    }

    char *wordlist[NUMWORDS];
    FILE *fp = fopen(WORDFILE, "r");

    if (!fp) {
       printf("Could not find wordlist: '%s' is missing!", WORDFILE);
       return 1;
    }

    for(int i=0; i < NUMWORDS; i++) {
        wordlist[i] = malloc(WORDLENGTH + 1);
        fgets(wordlist[i], WORDLENGTH + 1, fp);
        for (int j=strlen(wordlist[i])-1; j>=0 && (wordlist[i][j] == '\n' || wordlist[i][j]=='\r'); j--) {
            wordlist[i][j]='\0';
        }
    }

    if (is_hex(argv[1])) {

        char hex[normalized_hex_string_length(argv[1])];
        normalize_hex_string(hex, argv[1]);

        char phrase[max_phrase_length(hex)];
        get_phrase(phrase, hex, wordlist);

        printf("%s\n", phrase);

        for (int i=0; i < NUMWORDS; i++) {
            free(wordlist[i]);
        }

    } else {
        printf("TBD\n");
    }
}

Implement the actual utility. Only does key to phrase conversion at the moment.


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0`

#ifndef OPENTITAN_SW_DEVICE_LIB_RUNTIME_CHECK_H_
#define OPENTITAN_SW_DEVICE_LIB_RUNTIME_CHECK_H_

#include <stdbool.h>

#include "sw/device/lib/base/log.h"
#include "sw/device/lib/runtime/abort.h"

/**
 * Runtime assertion macros with log.h integration.
 */

/**
 * Checks that the given condition is true. If the condition is false, this
 * function logs and then aborts.
 *
 * @param condition an expression to check.
 * @param ... arguments to a LOG_* macro, which are evaluated if the check
 * fails.
 */
#define CHECK(condition, ...)                \
  do {                                       \
    if (!(condition)) {                      \
      LOG_ERROR("CHECK-fail: " __VA_ARGS__); \
      abort();                               \
    }                                        \
  } while (false)

/**
 * Shorthand for CHECK(value == 0).
 *
 * @param condition a value to check.
 * @param ... arguments to a LOG_* macro, which are evaluated if the check
 * fails.
 */
#define CHECKZ(value, ...) CHECK((value) == 0, ...)

#endif  // OPENTITAN_SW_DEVICE_LIB_RUNTIME_CHECK_H_

[sw] Add a library to provide CHECK and friends.

Signed-off-by: Miguel Young de la Sota <71b8e7f4945fd97b98544cf897992af89646547a@google.com>


// RUN: %llvmgcc -S %s -emit-llvm -o - | grep "signext" | count 4

signed char foo1() { return 1; }

void foo2(signed short a) { }

signed char foo3(void) { return 1; }

void foo4(a) signed short a; { }

Add testcase for last llvm-gcc tweaks

Add testcase for last llvm-gcc tweaks

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


/*  chardata.h
 *
 *
 */

#ifndef XML_CHARDATA_H
#define XML_CHARDATA_H 1

#ifndef XML_VERSION
#include "expat.h"                      /* need XML_Char */
#endif

typedef struct {
    int count;                          /* # of chars, < 0 if not set */
    XML_Char data[1024];
} CharData;

void CharData_Init(CharData *storage);

void CharData_AppendString(CharData *storage, const char *s);

void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len);

int CharData_CheckString(CharData *storage, const char *s);

int CharData_CheckXMLChars(CharData *storage, const XML_Char *s);

#endif  /* XML_CHARDATA_H */

/* chardata.h

   Interface to some helper routines used to accumulate and check text
   and attribute content.
*/

#ifndef XML_CHARDATA_H
#define XML_CHARDATA_H 1

#ifndef XML_VERSION
#include "expat.h"                      /* need XML_Char */
#endif

typedef struct {
    int count;                          /* # of chars, < 0 if not set */
    XML_Char data[1024];
} CharData;

void CharData_Init(CharData *storage);

void CharData_AppendString(CharData *storage, const char *s);

void CharData_AppendXMLChars(CharData *storage, const XML_Char *s, int len);

int CharData_CheckString(CharData *storage, const char *s);

int CharData_CheckXMLChars(CharData *storage, const XML_Char *s);

#endif  /* XML_CHARDATA_H */

Add a small comment to tell what this is.


// Filename: p3dReferenceCount.h
// Created by:  drose (09Jul09)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University.  All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license.  You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////

#ifndef P3DREFERENCECOUNT_H
#define P3DREFERENCECOUNT_H

#include "p3d_plugin_common.h"

////////////////////////////////////////////////////////////////////
//       Class : P3DReferenceCount
// Description : A base class for reference-counted objects in this
//               module.  We follow the Panda convention, rather than
//               the Pythong convention: the reference count of a new
//               object is initially 0.
////////////////////////////////////////////////////////////////////
class P3DReferenceCount {
public:
  inline P3DReferenceCount();
  inline ~P3DReferenceCount();

  inline void ref() const;
  inline bool unref() const;

private:
  int _ref_count;
};

template<class RefCountType>
inline void unref_delete(RefCountType *ptr);

#include "p3dReferenceCount.I"

#endif

// Filename: p3dReferenceCount.h
// Created by:  drose (09Jul09)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University.  All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license.  You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////

#ifndef P3DREFERENCECOUNT_H
#define P3DREFERENCECOUNT_H

#include "p3d_plugin_common.h"

////////////////////////////////////////////////////////////////////
//       Class : P3DReferenceCount
// Description : A base class for reference-counted objects in this
//               module.  We follow the Panda convention, rather than
//               the Python convention: the reference count of a new
//               object is initially 0.
////////////////////////////////////////////////////////////////////
class P3DReferenceCount {
public:
  inline P3DReferenceCount();
  inline ~P3DReferenceCount();

  inline void ref() const;
  inline bool unref() const;

private:
  int _ref_count;
};

template<class RefCountType>
inline void unref_delete(RefCountType *ptr);

#include "p3dReferenceCount.I"

#endif

Fix typo: "Pythong" -> "Python" ;-)

Fix typo: "Pythong" -> "Python" ;-)


#pragma once
#include "bpftrace.h"
#include "log.h"
#include "pass_manager.h"
#include "visitors.h"

namespace bpftrace {
namespace ast {

class NodeCounter : public Visitor
{
public:
  void Visit(Node &node)
  {
    count_++;
    Visitor::Visit(node);
  }

  size_t get_count()
  {
    return count_;
  };

private:
  size_t count_ = 0;
};

Pass CreateCounterPass()
{
  auto fn = [](Node &n, PassContext &ctx) {
    NodeCounter c;
    c.Visit(n);
    auto node_count = c.get_count();
    auto max = ctx.b.ast_max_nodes_;
    if (bt_verbose)
    {
      LOG(INFO) << "node count: " << max;
    }
    if (node_count >= max)
    {
      LOG(ERROR) << "node count (" << node_count << ") exceeds the limit ("
                 << max << ")";
      return PassResult::Error("node count exceeded");
    }
    return PassResult::Success();
  };
  return Pass("NodeCounter", fn);
}

} // namespace ast
} // namespace bpftrace

#pragma once
#include "bpftrace.h"
#include "log.h"
#include "pass_manager.h"
#include "visitors.h"

namespace bpftrace {
namespace ast {

class NodeCounter : public Visitor
{
public:
  void Visit(Node &node)
  {
    count_++;
    Visitor::Visit(node);
  }

  size_t get_count()
  {
    return count_;
  };

private:
  size_t count_ = 0;
};

Pass CreateCounterPass()
{
  auto fn = [](Node &n, PassContext &ctx) {
    NodeCounter c;
    c.Visit(n);
    auto node_count = c.get_count();
    auto max = ctx.b.ast_max_nodes_;
    if (bt_verbose)
    {
      LOG(INFO) << "node count: " << node_count;
    }
    if (node_count >= max)
    {
      LOG(ERROR) << "node count (" << node_count << ") exceeds the limit ("
                 << max << ")";
      return PassResult::Error("node count exceeded");
    }
    return PassResult::Success();
  };
  return Pass("NodeCounter", fn);
}

} // namespace ast
} // namespace bpftrace

Fix printing bug in node-counter pass

Fix printing bug in node-counter pass


#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(boost_meta, L"??@*@");
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_

#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(boost_meta, L"??@*@");
ExcludeFromCodeCoverage(You_NLP, L"You::NLP::*");
ExcludeFromCodeCoverage(You_QueryEngine, L"You::QueryEngine::*");
ExcludeFromCodeCoverage(You_DataStore, L"You::DataStore::*");
ExcludeFromCodeCoverage(You_Utils, L"You::Utils::*");

#pragma managed(pop)

#endif  // MS_CPP_CODECOVERAGE

#endif  // YOU_CONTROLLER_TESTS_EXCLUSIONS_H_

Exclude data store from controller code coverage.


// Wrapper to prevent multiple imports
#ifndef LIBHDHOMERUN_H
#define LIBHDHOMERUN_H

#import "hdhomerun_os.h"
#import "hdhomerun_discover.h"
#import "hdhomerun_pkt.h"

#endif

Add wrapper to stop reinclude of library headers


#pragma once
#include "begin_code.h"
namespace _internal
{

/// This is just an empty class.
/// Most wrapper class regard this class as a friend class.
/// You can get/set raw pointers through this class.
class Plugin
{
public:
    template<typename T>
    decltype(auto) get(const T& obj)
    {
        return obj._get();
    }
    template<typename T,typename U>
    void set(T& obj,U&& value)
    {
        obj._set(value);
    }
    template<typename T>
    void clear(T& obj)
    {
        obj._clear();
    }

    template<typename T,typename U>
    void set_no_delete(T& obj,U&& value)
    {
        obj._set_no_delete(value);
    }
};

}
#include "end_code.h"

#pragma once
#include "begin_code.h"
namespace _internal
{

/// This is just an empty class.
/// Most wrapper class regard this class as a friend class.
/// You can get/set raw pointers through this class.
class Plugin
{
public:
    template<typename T>
    static decltype(auto) get(const T& obj)
    {
        return obj._get();
    }
    template<typename T,typename U>
    static void set(T& obj,U&& value)
    {
        obj._set(value);
    }
    template<typename T>
    static void clear(T& obj)
    {
        obj._clear();
    }

    template<typename T,typename U>
    static void set_no_delete(T& obj,U&& value)
    {
        obj._set_no_delete(value);
    }
};

}
#include "end_code.h"

Change Plugin methods to static

Change Plugin methods to static


// Copyright (c) 2009-2011 Turbulenz Limited

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#ifdef _MSC_VER
#pragma once
#endif

#ifndef _WIN32_WINNT		// Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501	// Change this to the appropriate value to target other versions of Windows.
#endif

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif

#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif

#ifndef BOOST_DISABLE_THREADS
#define BOOST_DISABLE_THREADS
#endif

#include <boost/xpressive/xpressive.hpp>
#include <stdio.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <list>
#include <map>
#include <set>

#include <Cg/cg.h>
#include <Cg/cgGL.h>

// Copyright (c) 2009-2011 Turbulenz Limited

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#ifdef _MSC_VER
#pragma once
#endif

#ifndef _WIN32_WINNT		// Allow use of features specific to Windows XP or later.
#define _WIN32_WINNT 0x0501	// Change this to the appropriate value to target other versions of Windows.
#endif

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif

#ifndef _USE_MATH_DEFINES
#define _USE_MATH_DEFINES
#endif

#ifndef BOOST_DISABLE_THREADS
#define BOOST_DISABLE_THREADS
#endif

#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable:4458)
# pragma warning(disable:4459)
# pragma warning(disable:4456)
#endif

#include <boost/xpressive/xpressive.hpp>

#ifdef _MSC_VER
# pragma warning(pop)
#endif

#include <stdio.h>
#include <math.h>
#include <float.h>
#include <limits.h>
#include <string.h>
#include <stdlib.h>
#include <string>
#include <list>
#include <map>
#include <set>

#include <Cg/cg.h>
#include <Cg/cgGL.h>

Disable some compiler warnings on the boost library.


#include <wb.h>

int main(int argc, char** argv) {
    wbArg_t args;
    int inputLength;
    float* h_A;
    float* h_B;
    float* h_O;

    args = wbArg_read(argc, argv);

    wbTime_start(Generic, "Importing data and creating memory on host");
    h_A = (float*)wbImport(wbArg_getInputFile(args, 0), &inputLength);
    h_B = (float*)wbImport(wbArg_getInputFile(args, 1), &inputLength);
    h_O = (float*)malloc(inputLength * sizeof(float));
    wbTime_stop(Generic, "Importing data and creating memory on host");

    wbLog(TRACE, "The input length is ", inputLength);

    wbTime_start(GPU, "Computing data on the GPU");

    int workers = 256;

    #pragma acc parallel copyin(h_A[0 : inputLength], h_B[0 : inputLength]), copyout(h_O[0 : inputLength]), num_workers(workers)
    {
        #pragma acc loop worker
        int i;
        for (i = 0; i < inputLength; i++) {
            h_O[i] = h_A[i] + h_B[i];
        }
    }

    wbTime_stop(GPU, "Computing data on the GPU");
    wbSolution(args, h_O, inputLength);

    free(h_A);
    free(h_B);
    free(h_O);

    return 0;
}

Solve Vector Addition using OpenACC

Solve Vector Addition using OpenACC


#ifndef ALIHLTPHOSDATAHEADERSTRUCT_H
#define ALIHLTPHOSDATAHEADERSTRUCT_H

#include "AliHLTDataTypes.h"

struct AliHLTPHOSDataHeaderStruct
{
  AliHLTUInt32_t fSize;              /**<Total size of datablock in bytes, incuding the header*/
  AliHLTComponentDataType fDataType; /**<Data type stored in this file */
  AliHLTUInt32_t fEventID;           /**<The HLT internal event ID for this event */
  AliHLTUInt32_t fAlgorithm;         /**<Wich algorithm was uses estimate cellenergies*/
  AliHLTUInt32_t fFormatVersion;     /**<Header format version, currently 1*/
  AliHLTUInt32_t fFutureUse0;
  AliHLTUInt32_t fFutureUse1;
  AliHLTUInt32_t fFutureUse2;
};

#endif

Structure to hold header information for dat that should be written to file.


/* vl53l0x_types.h - Zephyr customization of ST vl53l0x library,
 * basic type definition.
 */

/*
 * Copyright (c) 2017 STMicroelectronics
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef ZEPHYR_DRIVERS_SENSOR_VL53L0X_VL53L0X_TYPES_H_
#define ZEPHYR_DRIVERS_SENSOR_VL53L0X_VL53L0X_TYPES_H_

/* Zephyr provides stdint.h and stddef.h, so this is enough to include it.
 * If it was not the case, we would defined here all signed and unsigned
 * basic types...
 */
#include <stdint.h>
#include <stddef.h>

#ifndef NULL
#error "Error NULL definition should be done. Please add required include "
#endif

#if !defined(STDINT_H) && !defined(_GCC_STDINT_H) && !defined(__STDINT_DECLS) \
	&& !defined(_GCC_WRAP_STDINT_H) && !defined(_STDINT_H)                \
	&& !defined(__INC_stdint_h__)
 #pragma message("Review type definition of STDINT define for your platform")
#endif /* _STDINT_H */

/** use where fractional values are expected
 *
 * Given a floating point value f it's .16 bit point is (int)(f*(1<<16))
 */
typedef uint32_t FixPoint1616_t;

#endif /* ZEPHYR_DRIVERS_SENSOR_VL53L0X_VL53L0X_TYPES_H_ */

/* vl53l0x_types.h - Zephyr customization of ST vl53l0x library,
 * basic type definition.
 */

/*
 * Copyright (c) 2017 STMicroelectronics
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#ifndef ZEPHYR_DRIVERS_SENSOR_VL53L0X_VL53L0X_TYPES_H_
#define ZEPHYR_DRIVERS_SENSOR_VL53L0X_VL53L0X_TYPES_H_

/* Zephyr provides stdint.h and stddef.h, so this is enough to include it.
 * If it was not the case, we would defined here all signed and unsigned
 * basic types...
 */
#include <stdint.h>
#include <stddef.h>

#ifndef NULL
#error "Error NULL definition should be done. Please add required include "
#endif

/** use where fractional values are expected
 *
 * Given a floating point value f it's .16 bit point is (int)(f*(1<<16))
 */
typedef uint32_t FixPoint1616_t;

#endif /* ZEPHYR_DRIVERS_SENSOR_VL53L0X_VL53L0X_TYPES_H_ */

Remove unnecessary lib include check

drivers/sensor/vl53l0x: Remove unnecessary lib include check

vl53l0x driver is using an external library to build, located under:
ext/hal/st/lib/sensor/vl53l0x.
This library is expecting stdint.h lib to be available and to
secure this for driver library inclusion work, a stdint.h file
header check was done. This check was based on assumptions on possible
header names for stdint.h.
Due to recent renaming of the zephyr header files, this check was
returning a false positive, generating warning at compilation.

Rather than updated with new header names, remove this check, since
driver porting is completed and stdint.h inclusion is actually
done.

Fixes #10134

Signed-off-by: Erwan Gouriou <de4d967452b83bb0e37525652734e7d9163b6a4c@linaro.org>


/// \file api.h
/// Defines the API for Query Engine.
/// \author A0112054Y

#pragma once
#ifndef YOU_QUERYENGINE_API_H_
#define YOU_QUERYENGINE_API_H_

#include <memory>
#include <boost/variant.hpp>
#include "task_model.h"

namespace You {
namespace QueryEngine {

/// A synthesized type for holding query responses
typedef boost::variant <
	 std::vector<Task>,
	 Task,
	 Task::ID,
	 Task::Time,
	 Task::Dependencies,
	 Task::Description
	> Response;

/// Base class for all queries.
class Query {
	friend Response executeQuery(std::unique_ptr<Query> query);
private:
	/// Execute the query.
	virtual Response execute() = 0;
};

/// \name Query Constructors
/// @{
/// Construct a query for adding a task
/// \note Please use Task::DEFAULT_xxx to replace incomplete fields.
std::unique_ptr<Query>
AddTask(Task::Description description, Task::Time deadline,
Task::Priority priority, Task::Dependencies dependencies);
/// @}

/// Execute a query and return a response
/// \return The result of the query as a response object.
Response executeQuery(std::unique_ptr<Query> query);

}  // namespace QueryEngine
}  // namespace You

#endif  // YOU_QUERYENGINE_API_H_

/// \file api.h
/// Defines the API for Query Engine.
/// \author A0112054Y

#pragma once
#ifndef YOU_QUERYENGINE_API_H_
#define YOU_QUERYENGINE_API_H_

#include <memory>
#include <boost/variant.hpp>
#include "task_model.h"

namespace You {
namespace QueryEngine {

/// A synthesized type for holding query responses
typedef boost::variant <
	 std::vector<Task>,
	 Task,
	 Task::ID,
	 Task::Time,
	 Task::Dependencies,
	 Task::Description
	> Response;

/// Base class for all queries.
class Query {
	friend Response executeQuery(std::unique_ptr<Query> query);
private:
	/// Execute the query.
	virtual Response execute() = 0;
};

/// \name Query Constructors
/// @{
/// Construct a query for adding a task
/// \note Please use Task::DEFAULT_xxx to replace incomplete fields.
std::unique_ptr<Query>
AddTask(Task::Description description, Task::Time deadline,
Task::Priority priority, Task::Dependencies dependencies);

std::unique_ptr<Query>
FilterTask(const std::function<bool(Task)>& filter);

/// @}

/// Execute a query and return a response
/// \return The result of the query as a response object.
Response executeQuery(std::unique_ptr<Query> query);

}  // namespace QueryEngine
}  // namespace You

#endif  // YOU_QUERYENGINE_API_H_

Add filter stub in header

Add filter stub in header


#ifndef __EVENT_SERVICE_H__
#define __EVENT_SERVICE_H__

#include "basic_types.h"

int32_t events_winopen(char *title);

int32_t events_get_valuator(int32_t device);
void events_qdevice(int32_t device);
int32_t events_qread_start(int blocking);
int32_t events_qread_continue(int16_t *value);
void events_tie(int32_t button, int32_t val1, int32_t val2);

#endif /* __EVENT_SERVICE_H__ */:w

Remove vi schmutz at EOF

Remove vi schmutz at EOF


#include <pony/pony.h>
#include "encore.h"

encore_actor_t *encore_create(encore_create_t *type)
{
  return pony_create(type);
}

/// Allocate s bytes of memory, zeroed out
void *encore_alloc(size_t *s)
{
  void *mem = pony_alloc(s);
  memset(mem, 0, s);

  return mem;
}

/// The starting point of all Encore programs
int encore_start(int argc, char** argv, encore_actor_t *type)
{
  argc = pony_init(argc, argv);
  pony_actor_t* actor = encore_create(type);
  pony_sendargs(actor, _ENC__MSG_MAIN, argc, argv);

  return pony_start(PONY_DONT_WAIT);
}

#include <pony/pony.h>
#include "encore.h"

encore_actor_t *encore_create(encore_actor_t *type)
{
  return pony_create(type);
}

/// Allocate s bytes of memory, zeroed out
void *encore_alloc(size_t *s)
{
  void *mem = pony_alloc(s);
  memset(mem, 0, s);

  return mem;
}

/// The starting point of all Encore programs
int encore_start(int argc, char** argv, encore_actor_t *type)
{
  argc = pony_init(argc, argv);
  pony_actor_t* actor = encore_create(type);
  pony_sendargs(actor, _ENC__MSG_MAIN, argc, argv);

  return pony_start(PONY_DONT_WAIT);
}

Fix also applied to corresponding C file


// modified from 27/09
#include <assert.h>
#include <pthread.h>

int a = 1;
int b = 1;

pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;

void* t_fun(void *arg) {
  return NULL;
}

int main() {
  int *x;
  int rnd;

  if (rnd)
    x = &a;
  else
    x = &b;

  pthread_t id;
  pthread_create(&id, NULL, t_fun, NULL); // go multithreaded

  pthread_mutex_lock(&A); // continue with protected (privatized) values

  assert(*x == 1);
  b = 2;

  assert(a == 1);
  if (*x != 0) { // TODO: invariant makes less precise!
    assert(a == 1); // TODO
  }
  return 0;
}

Add invariant precision worsening test for globals


#ifndef RECEIVER_H
#define RECEIVER_H

#include <stdint.h>
#include "settings.h"

#define RECEIVER_A 0
#ifdef USE_DIVERSITY
  #define RECEIVER_B 1
  #define RECEIVER_AUTO 2

  #define DIVERSITY_AUTO 0
  #define DIVERSITY_FORCE_A 1
  #define DIVERSITY_FORCE_B 2
#endif

#define RECEIVER_LAST_DELAY 100
#define RECEIVER_LAST_DATA_SIZE 16

namespace Receiver {
    extern uint8_t activeReceiver;
    extern uint8_t activeChannel;

    extern uint8_t rssiA;
    extern uint16_t rssiARaw;
    extern uint8_t rssiALast[RECEIVER_LAST_DATA_SIZE];
    #ifdef USE_DIVERSITY
        extern uint8_t rssiB;
        extern uint16_t rssiBRaw;
        extern uint8_t rssiBLast[RECEIVER_LAST_DATA_SIZE];
    #endif

    void setChannel(uint8_t channel);
    void waitForStableRssi();
    uint16_t updateRssi();
    void setActiveReceiver(uint8_t receiver = RECEIVER_A);
    #ifdef USE_DIVERSITY
        void setDiversityMode(uint8_t mode);
        void switchDiversity();
    #endif

    void setup();
    void update();
}

#endif

#ifndef RECEIVER_H
#define RECEIVER_H

#include <stdint.h>
#include "settings.h"

#define RECEIVER_A 0
#ifdef USE_DIVERSITY
  #define RECEIVER_B 1
  #define RECEIVER_AUTO 2

  #define DIVERSITY_AUTO 0
  #define DIVERSITY_FORCE_A 1
  #define DIVERSITY_FORCE_B 2
#endif

#define RECEIVER_LAST_DELAY 50
#define RECEIVER_LAST_DATA_SIZE 24

namespace Receiver {
    extern uint8_t activeReceiver;
    extern uint8_t activeChannel;

    extern uint8_t rssiA;
    extern uint16_t rssiARaw;
    extern uint8_t rssiALast[RECEIVER_LAST_DATA_SIZE];
    #ifdef USE_DIVERSITY
        extern uint8_t rssiB;
        extern uint16_t rssiBRaw;
        extern uint8_t rssiBLast[RECEIVER_LAST_DATA_SIZE];
    #endif

    void setChannel(uint8_t channel);
    void waitForStableRssi();
    uint16_t updateRssi();
    void setActiveReceiver(uint8_t receiver = RECEIVER_A);
    #ifdef USE_DIVERSITY
        void setDiversityMode(uint8_t mode);
        void switchDiversity();
    #endif

    void setup();
    void update();
}

#endif

Tweak RSSI tracking speed/count for better graphs


#include <boost/serialization/version.hpp>
#include <memory>

namespace boost {
namespace serialization {

template<class Archive, class T>
inline void save(Archive& ar, const std::unique_ptr<T>& t, const unsigned int){
    // only the raw pointer has to be saved
    const T* const tx = t.get();
    ar << tx;
}

template<class Archive, class T>
inline void load(Archive& ar, std::unique_ptr<T>& t, const unsigned int){
    T* pTarget;
    ar >> pTarget;

    #if BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, == 1)
        t.release();
        t = std::unique_ptr< T >(pTarget);
    #else
        t.reset(pTarget);
    #endif
}

template<class Archive, class T>
inline void serialize(Archive& ar, std::unique_ptr<T>& t,
        const unsigned int file_version){
    boost::serialization::split_free(ar, t, file_version);
}
} // namespace serialization
} // namespace boost

Add function for serialize std::unique_ptr


#include <stdio.h>

#if defined _WIN32 && !defined __TINYC__
# define U "_"
#else
# define U
#endif

const char str[] = "x1\n";
#ifdef __x86_64__
asm(U"x1: push %rbp; mov $"U"str, %rdi; call "U"printf; pop %rbp; ret");
#elif defined (__i386__)
asm(U"x1: push $"U"str; call "U"printf; pop %eax; ret");
#endif

int main(int argc, char *argv[])
{
    asm("call "U"x1");
    asm("call "U"x2");
    asm("call "U"x3");
    return 0;
}

static
int x2(void)
{
    printf("x2\n");
    return 2;
}

extern int x3(void);

#include <stdio.h>

#if defined _WIN32 && !defined __TINYC__
# define _ "_"
#else
# define _
#endif

static int x1_c(void)
{
    printf("x1\n");
    return 1;
}

asm(".text;"_"x1: call "_"x1_c; ret");

int main(int argc, char *argv[])
{
    asm("call "_"x1");
    asm("call "_"x2");
    asm("call "_"x3");
    return 0;
}

static
int x2(void)
{
    printf("x2\n");
    return 2;
}

extern int x3(void);

Adjust asm-c-connect testcase for Windows

Calling conventions are different, let's use functions without
any arguments.


#pragma once

#include "AuxKernel.h"
#include "RadialAverage.h"
/**
 * Auxkernel to output the averaged material value from RadialAverage
 */
class RadialAverageAux : public AuxKernel
{
public:
  static InputParameters validParams();

  RadialAverageAux(const InputParameters & parameters);

protected:
  virtual Real computeValue() override;
  const RadialAverage::Result & _average;
  RadialAverage::Result::const_iterator _elem_avg;
};

Update to add newline EOF

Update to add newline EOF


//PARAM: --enable ana.int.congruence --disable ana.int.def_exc --disable ana.int.enums

int main() {
	int a = 1;
	int b = 2;
	int c = 3;
	int d = 4;
	int e = 0;

	while (d < 9) {
		b = 2 * a;
		d = d + 4;
		e = e - 4 * a;

		a = b - a;
		c = e + d;
	}

	a = d / 2;
	b = d % 2;

	assert (c == 4); // UNKNOWN!
	assert (d == 12); // UNKNOWN
	assert (a == 6); // UNKNOWN
	assert (b == 0);

	return 0;
}

Add simple regression test for congruence domain


#ifndef JOYMECANUMDRIVE_H
#define JOYMECANUMDRIVE_H
#pragma systemFile

#include "Joystick.h"
#include "Motor.h"

//This function interprets a TJoystick struct and sets desired motor powers.
//This uses mecanum drive in arcade style.
//  Left joystick controls strafing and forwards/backwards
//  Right joystick (x-axis only) controls rotation
void joymecdriveSetDesiredPowers(TJoystick *joyState) {
	motorSetDesiredSafePower(Motor_Mec_FL, joyState->joy1_y1 + joyState->joy1_x2 + joyState->joy1_x1);
	motorSetDesiredSafePower(Motor_Mec_BL, joyState->joy1_y1 + joyState->joy1_x2 - joyState->joy1_x1);
	motorSetDesiredSafePower(Motor_Mec_BR, joyState->joy1_y1 - joyState->joy1_x2 + joyState->joy1_x1);
	motorSetDesiredSafePower(Motor_Mec_FR, joyState->joy1_y1 - joyState->joy1_x2 - joyState->joy1_x2);
}

#endif

Implement arcade drive in a new header file


// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "ModuleManager.h"

DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All);

class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface
{
public:

	bool PythonGILAcquire();
	void PythonGILRelease();

	virtual void StartupModule() override;
	virtual void ShutdownModule() override;

	void RunString(char *);
	void RunFile(char *);
	void RunFileSandboxed(char *);

private:
	void *ue_python_gil;
	// used by console
	void *main_dict;
	void *local_dict;
	void *main_module;
};

struct FScopePythonGIL {
	FScopePythonGIL()
	{
#if defined(UEPY_THREADING)
		UnrealEnginePythonModule = FModuleManager::LoadModuleChecked<FUnrealEnginePythonModule>("UnrealEnginePython");
		safeForRelease = UnrealEnginePythonModule.PythonGILAcquire();
#endif
	}

	~FScopePythonGIL()
	{
#if defined(UEPY_THREADING)
		if (safeForRelease) {
			UnrealEnginePythonModule.PythonGILRelease();
		}
#endif
	}

	FUnrealEnginePythonModule UnrealEnginePythonModule;
	bool safeForRelease;
};

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "ModuleManager.h"

DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All);

class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface
{
public:

	bool PythonGILAcquire();
	void PythonGILRelease();

	virtual void StartupModule() override;
	virtual void ShutdownModule() override;

	void RunString(char *);
	void RunFile(char *);
	void RunFileSandboxed(char *);

private:
	void *ue_python_gil;
	// used by console
	void *main_dict;
	void *local_dict;
};

struct FScopePythonGIL {
	FScopePythonGIL()
	{
#if defined(UEPY_THREADING)
		UnrealEnginePythonModule = FModuleManager::LoadModuleChecked<FUnrealEnginePythonModule>("UnrealEnginePython");
		safeForRelease = UnrealEnginePythonModule.PythonGILAcquire();
#endif
	}

	~FScopePythonGIL()
	{
#if defined(UEPY_THREADING)
		if (safeForRelease) {
			UnrealEnginePythonModule.PythonGILRelease();
		}
#endif
	}

	FUnrealEnginePythonModule UnrealEnginePythonModule;
	bool safeForRelease;
};

Revert "Add support for the Python Stdout Log"

This reverts commit 6dd58324c052cc893f6ce8f009903805185a71d1.


// (C) Copyright 2017, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed 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.
// Portability include to match the Google test environment.

#ifndef TESSERACT_UNITTEST_INCLUDE_GUNIT_H_
#define TESSERACT_UNITTEST_INCLUDE_GUNIT_H_

#include "gtest/gtest.h"
#include "errcode.h"            // for ASSERT_HOST
#include "fileio.h"             // for tesseract::File

const char* FLAGS_test_tmpdir = ".";

class file: public tesseract::File {
};

#define CHECK(test) ASSERT_HOST(test)

#endif  // TESSERACT_UNITTEST_INCLUDE_GUNIT_H_

// (C) Copyright 2017, Google Inc.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed 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.
// Portability include to match the Google test environment.

#ifndef TESSERACT_UNITTEST_INCLUDE_GUNIT_H_
#define TESSERACT_UNITTEST_INCLUDE_GUNIT_H_

#include "gtest/gtest.h"
#include "errcode.h"            // for ASSERT_HOST
#include "fileio.h"             // for tesseract::File

const char* FLAGS_test_tmpdir = ".";

class file: public tesseract::File {
};

#define ARRAYSIZE(arr) (sizeof(arr) / sizeof(arr[0]))
#define CHECK(test) ASSERT_HOST(test)

#endif  // TESSERACT_UNITTEST_INCLUDE_GUNIT_H_

Add ARRAYSIZE macro for Google test environment

Signed-off-by: Stefan Weil <8d4c780fcfdc41841e5070f4c43da8958ba6aec0@weilnetz.de>


//===-- PPCTargetStreamer.h - PPC Target Streamer --s-----------*- C++ -*--===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H
#define LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H

#include "llvm/MC/MCStreamer.h"

namespace llvm {
class PPCTargetStreamer : public MCTargetStreamer {
public:
  PPCTargetStreamer(MCStreamer &S);
  ~PPCTargetStreamer() override;
  virtual void emitTCEntry(const MCSymbol &S) = 0;
  virtual void emitMachine(StringRef CPU) = 0;
  virtual void emitAbiVersion(int AbiVersion) = 0;
  virtual void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) = 0;
};
}

#endif

//===- PPCTargetStreamer.h - PPC Target Streamer ----------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H
#define LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H

#include "llvm/ADT/StringRef.h"
#include "llvm/MC/MCStreamer.h"

namespace llvm {

class MCExpr;
class MCSymbol;
class MCSymbolELF;

class PPCTargetStreamer : public MCTargetStreamer {
public:
  PPCTargetStreamer(MCStreamer &S);
  ~PPCTargetStreamer() override;

  virtual void emitTCEntry(const MCSymbol &S) = 0;
  virtual void emitMachine(StringRef CPU) = 0;
  virtual void emitAbiVersion(int AbiVersion) = 0;
  virtual void emitLocalEntry(MCSymbolELF *S, const MCExpr *LocalOffset) = 0;
};

} // end namespace llvm

#endif // LLVM_LIB_TARGET_POWERPC_PPCTARGETSTREAMER_H

[PowerPC] Fix some Include What You Use warnings; other minor fixes (NFC).

This is preparation to reduce MC headers dependencies.

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


#import <UIKit/UIKit.h>

//! Project version number for YOChartImageKit.
FOUNDATION_EXPORT double YOChartImageKitVersionNumber;

//! Project version string for YOChartImageKit.
FOUNDATION_EXPORT const unsigned char YOChartImageKitVersionString[];

#import <YOChartImageKit/YODonutChartImage.h>
#import <YOChartImageKit/YOBarChartImage.h>
#import <YOChartImageKit/YOLineChartImage.h>

#import <UIKit/UIKit.h>

//! Project version number for YOChartImageKit.
FOUNDATION_EXPORT double YOChartImageKitVersionNumber;

//! Project version string for YOChartImageKit.
FOUNDATION_EXPORT const unsigned char YOChartImageKitVersionString[];

#import "YODonutChartImage.h"
#import "YOBarChartImage.h"
#import "YOLineChartImage.h"

Fix including framework headers' path

Fix including framework headers' path


// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization dummy
extern int __VERIFIER_nondet_int();

void change(int *p) {
    int a;
    (*p)++;
    a++;
    assert(a == 7); //UNKNOWN!
}

int g;
int main() {
    int c = __VERIFIER_nondet_int();
    int a = 5;
    int *p = &a;
    change(p);
    assert(a == 5); //FAIL
    assert(a - 6 == 0); // Apron currently finds \bot here (!)
    return 0;
}

Add exmpale of confusion between locals of different procedures :/


//
// Created by matti on 16.9.2015.
//

#include <stdio.h>

#define MAXLINE 1000

int max;
char line[MAXLINE];
char longest[MAXLINE];

int getline(void);
void copy(void);

int main() {
    int len;
    extern int max;
    extern char longest[];

    max = 0;
    while((len = getline()) > 0) {
        if (len > max) {
            max = len;
            copy();
        }
        if (max > 0) {
            printf("%s", longest);
        }
        return 0;
    }
}

int getline(void) {
    int c, i;
    extern char line[];

    for(i = 0; i < MAXLINE - 1 && (c=getchar()) != EOF && c != '\n'; ++i) {
        line[i] = c;
        if (c == '\n') {
            line[i] = c;
            ++i;
        }
        line[i] = '\0';
        return i;

    }
}

//
// Created by matti on 16.9.2015.
//

#include <stdio.h>

#define MAXLINE 1000

int max;
char line[MAXLINE];
char longest[MAXLINE];

int getnewline(void);
void copy(void);

int main() {
    int len;
    extern int max;
    extern char longest[];

    max = 0;
    while((len = getnewline()) > 0) {
        if (len > max) {
            max = len;
            copy();
        }
        if (max > 0) {
            printf("%s", longest);
        }
        return 0;
    }
}

int getnewline(void) {
    int c, i;
    extern char line[];

    for(i = 0; i < MAXLINE - 1 && (c=getchar()) != EOF && c != '\n'; ++i) {
        line[i] = c;
        }
        if (c == '\n') {
            line[i] = c;
            ++i;
        }
        line[i] = '\0';
        return i;
}

void copy(void) {
    int i;
    extern char line[], longest[];

    i = 0;

    while((longest[i] = line[i]) != '\0') {
        ++i;
    }
}

Add 1-10 external variable example

Add 1-10 external variable example


#ifndef MYPAINTBRUSHGLIB_H
#define MYPAINTBRUSHGLIB_H

#include <glib-object.h>

#include <mypaint-config.h>

#if MYPAINT_CONFIG_USE_GLIB

#define MYPAINT_TYPE_BRUSH               (mypaint_brush_get_type ())
#define MYPAINT_VALUE_HOLDS_BRUSH(value) (G_TYPE_CHECK_VALUE_TYPE ((value), MYPAINT_TYPE_BRUSH))
GType mypaint_brush_get_type(void);

#endif

#endif // MYPAINTBRUSHGLIB_H

#ifndef MYPAINTBRUSHGLIB_H
#define MYPAINTBRUSHGLIB_H

#include <mypaint-config.h>

#if MYPAINT_CONFIG_USE_GLIB

#include <glib-object.h>
#define MYPAINT_TYPE_BRUSH               (mypaint_brush_get_type ())
#define MYPAINT_VALUE_HOLDS_BRUSH(value) (G_TYPE_CHECK_VALUE_TYPE ((value), MYPAINT_TYPE_BRUSH))
GType mypaint_brush_get_type(void);

#endif

#endif // MYPAINTBRUSHGLIB_H

brushlib: Move glib-object.h include inside USE_GLIB conditional


//===-- InstLoops.h - interface to insert instrumentation --------*- C++ -*--=//
//
// Instrument every back edges with counters
//===----------------------------------------------------------------------===//

#ifndef LLVM_REOPTIMIZERINSTLOOPS_H
#define LLVM_REOPTIMIZERINSTLOOPS_H

class Pass;

// createInstLoopsPass - Create a new pass to add counters on back edges
//
Pass *createInstLoopsPass();

#endif

Check in header file that was missing, thus broke the build

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


#include "cisf.h"
#include "expf.h"

float _Complex cexpf(float _Complex z)
{
    float x = z;
    float y = cimagf(z);

    if (y == 0)
        return CMPLXF(expf_(x), y);

    if (y - y) {
        if (x == INFINITY)
            return CMPLXF(x, y - y);

        if (x == -INFINITY)
            return 0;
    }

    return expf_(x) * cisf_(y);
}

#include "cisf.h"
#include "expf.h"

float _Complex cexpf(float _Complex z)
{
    float x = z;
    float y = cimagf(z);
    double r = expf_(x);

    if (y == 0)
        return CMPLXF(r, y);

    if (y - y) {
        if (x == INFINITY)
            return CMPLXF(x, y - y);

        if (x == -INFINITY)
            return 0;
    }

    return r * cisf_(y);
}

Reduce compiled code size by storing a result of a likely-used common expression


/* The Halfling Project - A Graphics Engine and Projects
 *
 * The Halfling Project is the legal property of Adrian Astley
 * Copyright Adrian Astley 2013
 */

#ifndef CONSOLE_PROGRESS_BAR_H
#define CONSOLE_PROGRESS_BAR_H

#include "common/typedefs.h"

#include "rlutil.h"
#include <cassert>

namespace Common {

class ConsoleProgressBar {
public:
	ConsoleProgressBar();

private:
	uint m_numCols;
	uint m_verticalOffset;

public:
	void DrawProgress(uint progress);
	void SetVerticalOffset(uint offset);
};

ConsoleProgressBar::ConsoleProgressBar()
	: m_numCols(rlutil::tcols()),
	  m_verticalOffset(1) {
}

void ConsoleProgressBar::DrawProgress(uint progress) {
	rlutil::locate(1, 3);
	std::cout << progress << " %" << std::endl << std::endl;

	rlutil::locate(7, m_verticalOffset);
	uint numberOfTicks = progress * (m_numCols - 6) / 100;
	for (uint i = 0; i < numberOfTicks; ++i) {
		std::cout << (char)(219);
	}
	for (uint i = numberOfTicks; i < m_numCols - 6; ++i) {
		std::cout << ' ';
	}
}

void ConsoleProgressBar::SetVerticalOffset(uint offset) {
	assert(offset <= rlutil::trows());
	m_verticalOffset = offset;
}

}

#endif

COMMON: Create a class for drawing progress bars on a console window


#ifndef LB_VECTOR_INCLUDED
	#include "lb_scalar.h"
	// Assume Vector to be n rows by 1 column
	typedef struct {
		Scalar* data;
		unsigned int length;
	} Vector;

	Vector lb_create_vector(Scalar* data, unsigned int length);
	Vector lb_allocate_vector(unsigned int length);
	void lbdp(Vector a, Vector b, Scalar* result);
	void lbstv(Scalar s, Vector v, Vector result);
	#define LB_VECTOR_INCLUDED
#endif

#ifndef LB_VECTOR_INCLUDED
	#include "lb_scalar.h"
	// Assume Vector to be n rows by 1 column
	typedef struct {
		Scalar* data;
		unsigned int length;
	} Vector;

	Vector lb_create_vector(Scalar* data, unsigned int length);
	Vector lb_allocate_vector(unsigned int length);
	void lbdp(Vector a, Vector b, Scalar* result);
	void lbstv(Scalar s, Vector v, Vector result);
	#define lbv_iterate(vec, iter, expr) do{\
		unsigned int iter;\
		for(iter=0; iter < vec.length; iter++) {\
			expr;\
		}\
	} while(0);
	#define LB_VECTOR_INCLUDED
#endif

Make it easy to iterate a vector

Make it easy to iterate a vector


#include <MacHeaders.h>
#include <ansi_prefix.mac.h>
#pragma once off
#define HAVE_CONFIG_H
#define PORT 1
#define MACOS 1
#define CONFIGLESS 1

#include "prefix.h"

#include <MacHeaders.h>
//#include <ansi_prefix.mac.h>
#pragma once off
#define HAVE_CONFIG_H
#define PORT 1
#define MACOS 1
#define CONFIGLESS 1

#include "prefix.h"

Update prefix for CW Pro1

Update prefix for CW Pro1


// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <cstdint>

namespace search::queryeval {

struct IDiversifier {
    virtual ~IDiversifier() {}
    /**
     * Will tell if this document should be kept, and update state for further filtering.
     */
    virtual bool accepted(uint32_t docId) = 0;
};
}

Restructure for code reuse and hiding implementation.


/*
 * cxx_constructors_global.c
 *
 *  Created on: 30 janv. 2013
 *      Author: fsulima
 */

#include <embox/unit.h>

EMBOX_UNIT_INIT(cxx_init);

EMBOX_UNIT_FINI(cxx_fini);

#include "cxx_invoke_constructors.h"
#include "cxx_invoke_destructors.h"
#include "cxx_app_startup_terminatioin.h"

static int cxx_init(void) {
	cxx_invoke_constructors();
	return 0;
}

static int cxx_fini(void) {
	cxx_invoke_destructors();
	return 0;
}

void cxx_app_startup(void) {
}

void cxx_app_termination(void) {
}

/*
 * cxx_constructors_global.c
 *
 *  Created on: 30 janv. 2013
 *      Author: fsulima
 */

#include <embox/unit.h>

#include "cxx_invoke_constructors.h"
#include "cxx_invoke_destructors.h"
#include "cxx_app_startup_termination.h"

EMBOX_UNIT(cxx_init, cxx_fini);

static int cxx_init(void) {
	cxx_invoke_constructors();
	return 0;
}

static int cxx_fini(void) {
	cxx_invoke_destructors();
	return 0;
}

void cxx_app_startup(void) {
}

void cxx_app_termination(void) {
}

qt-pro: Fix compilation of constructor_global module


//
//  Mapping.h
//  Menu
//
//  Created by Matt on 21/07/15.
//  Copyright (c) 2015 Blue Rocket. All rights reserved.
//

#import <BRMenu/UI/BRMenuPlusMinusButton.h>
#import <BRMenu/UI/BRMenuStepper.h>
#import <BRMenu/UI/BRMenuUIStyle.h>

//
//  Mapping.h
//  Menu
//
//  Created by Matt on 21/07/15.
//  Copyright (c) 2015 Blue Rocket. All rights reserved.
//

#import <BRMenu/UI/BRMenuBackBarButtonItemView.h>
#import <BRMenu/UI/BRMenuBarButtonItemView.h>
#import <BRMenu/UI/BRMenuPlusMinusButton.h>
#import <BRMenu/UI/BRMenuStepper.h>
#import <BRMenu/UI/BRMenuUIStyle.h>

Include latest class additions in umbrella include.


#ifndef _LEAP_H
#define _LEAP_H

#include <stdbool.h>
bool leap_year(int year);

#endif

#ifndef _LEAP_H
#define _LEAP_H

#include <stdbool.h>

bool is_leap_year(int year);

#endif

Fix compiler warning in Leap

Fix compiler warning in Leap


// RUN: %clang_cc1 %s -Wunused-macros -Dfoo -Dfoo -verify

#include "warn-macro-unused.h"

#define unused // expected-warning {{macro is not used}}
#define unused
unused

// rdar://9745065
#undef unused_from_header // no warning

// RUN: %clang_cc1 %s -Wunused-macros -Dfoo -Dfoo -verify
// XFAIL: *

#include "warn-macro-unused.h"

#define unused // expected-warning {{macro is not used}}
#define unused
unused

// rdar://9745065
#undef unused_from_header // no warning

Test is broken; XFAIL it until Argyrios gets a chance to look at it.

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


//
//  HATransparentView.h
//  HATransparentView
//
//  Created by Heberti Almeida on 13/09/13.
//  Copyright (c) 2013 Heberti Almeida. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface HATransparentView : UIView

@property (strong, nonatomic) UIColor *color;
@property (nonatomic) CGFloat *alpha;

- (void)open;
- (void)close;

@end

//
//  HATransparentView.h
//  HATransparentView
//
//  Created by Heberti Almeida on 13/09/13.
//  Copyright (c) 2013 Heberti Almeida. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface HATransparentView : UIView

- (void)open;
- (void)close;

@end

Fix disabled interaction on device

Fix disabled interaction on device


//
//  InstabugReactBridge.h
//  instabugDemo
//
//  Created by Yousef Hamza on 9/29/16.
//  Copyright © 2016 Facebook. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "RCTBridgeModule.h"
#import "RCTEventEmitter.h"

@interface InstabugReactBridge : RCTEventEmitter <RCTBridgeModule>

@end

//
//  InstabugReactBridge.h
//  instabugDemo
//
//  Created by Yousef Hamza on 9/29/16.
//  Copyright © 2016 Facebook. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
#import "RCTEventEmitter.h"

@interface InstabugReactBridge : RCTEventEmitter <RCTBridgeModule>

@end

:pencil: Fix the import in the bridge header file to account for changes in RN 0.48


/** @file   Prerequisites.h
    @author Philip Abbet

    Declaration of the types of the Athena-Physics module
*/

#ifndef _ATHENA_PHYSICS_PREREQUISITES_H_
#define _ATHENA_PHYSICS_PREREQUISITES_H_

#include <Athena-Core/Prerequisites.h>
#include <Athena-Physics/Config.h>
#include <Bullet/btConfig.h>
#include <btBulletDynamicsCommon.h>

//----------------------------------------------------------------------------------------
/// @brief	Main namespace. All the components of the Athena engine belongs to this
///			namespace
//----------------------------------------------------------------------------------------
namespace Athena
{
	//------------------------------------------------------------------------------------
	/// @brief	Contains all the physics-related classes
	//------------------------------------------------------------------------------------
    namespace Physics
    {
        class Body;
        class CollisionShape;
        class PhysicalComponent;
        class World;

        class BoxShape;
        class CapsuleShape;
        class ConeShape;
        class CylinderShape;
        class SphereShape;
        class StaticTriMeshShape;
    }

	//------------------------------------------------------------------------------------
	/// @brief	Initialize the Physics module
	//------------------------------------------------------------------------------------
    extern void initialize();
}

#endif

/** @file   Prerequisites.h
    @author Philip Abbet

    Declaration of the types of the Athena-Physics module
*/

#ifndef _ATHENA_PHYSICS_PREREQUISITES_H_
#define _ATHENA_PHYSICS_PREREQUISITES_H_

#include <Athena-Core/Prerequisites.h>
#include <Athena-Physics/Config.h>
#include <Bullet/btConfig.h>
#include <btBulletDynamicsCommon.h>

//----------------------------------------------------------------------------------------
/// @brief	Main namespace. All the components of the Athena engine belongs to this
///			namespace
//----------------------------------------------------------------------------------------
namespace Athena
{
	//------------------------------------------------------------------------------------
	/// @brief	Contains all the physics-related classes
	//------------------------------------------------------------------------------------
    namespace Physics
    {
        class Body;
        class CollisionShape;
        class PhysicalComponent;
        class World;

        class BoxShape;
        class CapsuleShape;
        class ConeShape;
        class CylinderShape;
        class SphereShape;
        class StaticTriMeshShape;

    	//------------------------------------------------------------------------------------
    	/// @brief	Initialize the Physics module
    	//------------------------------------------------------------------------------------
        extern void initialize();
    }
}

#endif

Fix the previous commit: the 'initialize()' function wasn't declared in the 'Athena::Physics' namespace