/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
#include <fs/fs.h>
#include <fs/fs_if.h>

#include "fs_priv.h"

int
fs_rename(const char *from, const char *to)
{
    struct fs_ops *fops = safe_fs_ops_for("fatfs");
    return fops->f_rename(from, to);
}

int
fs_mkdir(const char *path)
{
    struct fs_ops *fops = safe_fs_ops_for("fatfs");
    return fops->f_mkdir(path);
}

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
#include <fs/fs.h>
#include <fs/fs_if.h>

#include "fs_priv.h"

struct fs_ops *fops_from_filename(const char *);

int
fs_rename(const char *from, const char *to)
{
    struct fs_ops *fops = fops_from_filename(from);
    return fops->f_rename(from, to);
}

int
fs_mkdir(const char *path)
{
    struct fs_ops *fops = fops_from_filename(path);
    return fops->f_mkdir(path);
}

Update for compatibility with multiple FS


/* CMSIS-DAP Interface Firmware
 * Copyright (c) 2009-2013 ARM Limited
 *
 * 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 CORTEX_M_H
#define CORTEX_M_H

#include <stdint.h>

typedef int cortex_int_state_t;

__attribute__((always_inline))
static cortex_int_state_t cortex_int_get_and_disable(void)
{
    cortex_int_state_t state;
    state = __disable_irq();
    return state;
}

__attribute__((always_inline))
static void cortex_int_restore(cortex_int_state_t state)
{
    if (!state) {
        __enable_irq();
    }
}

#endif

Add functions to disable and restore interrupts

Add the two functions cortex_int_get_and_disable and
cortex_int_restore.  This allows interrupts to be disabled globally.


#ifndef __JSON_GLIB_H__
#define __JSON_GLIB_H__

#include <json-glib/json-types.h>
#include <json-glib/json-scanner.h>
#include <json-glib/json-generator.h>
#include <json-glib/json-parser.h>
#include <json-glib/json-version.h>

#endif /* __JSON_GLIB_H__ */

#ifndef __JSON_GLIB_H__
#define __JSON_GLIB_H__

#include <json-glib/json-types.h>
#include <json-glib/json-scanner.h>
#include <json-glib/json-generator.h>
#include <json-glib/json-parser.h>
#include <json-glib/json-version.h>
#include <json-glib/json-enum-types.h>

#endif /* __JSON_GLIB_H__ */

Include the newly added json-enum-types.h header

When including json-glib/json-glib.h we get everything json-glib
expose as a public symbol.


#pragma once

#include "MeterWnd/Animations/AnimationTypes.h"
#include "Settings.h"

class SettingsDefaults {
public:
    /* Default settings */
    static const bool OnTop = true;
    static const AnimationTypes::HideAnimation DefaultHideAnim
        = AnimationTypes::Fade;
    static const bool HideFullscreen = false;
    static const bool HideDirectX = false;
    static const int HideSpeed = 765;
    static const int HideTime = 800;
    static constexpr const float VolumeLimit = 1.0f;
    static const bool NotifyIcon = true;
    static const bool ShowOnStartup = true;
    static const bool SoundsEnabled = true;
    static const int OSDOffset = 140;
    static const Settings::OSDPos OSDPosition = Settings::OSDPos::Bottom;
    static const bool AutoUpdate = false;
    static const bool MuteLock = false;
    static const bool SubscribeVolumeEvents = true;
    static const bool SubscribeEjectEvents = true;

    static const bool VolumeOSDEnabled = true;
    static const bool EjectOSDEnabled = true;
    static const bool BrightnessOSDEnabled = true;
    static const bool KeyboardOSDEnabled = false;
};

#pragma once

#include "MeterWnd/Animations/AnimationTypes.h"
#include "Settings.h"

class SettingsDefaults {
public:
    /* String Constants*/
    static constexpr const wchar_t *Language = L"English";
    static constexpr const wchar_t *Skin = L"Classic";
    static constexpr const wchar_t *MainAppName = L"3RVX.exe";
    static constexpr const wchar_t *SettingsAppName = L"Settings.exe";
    static constexpr const wchar_t *SettingsFileName = L"Settings.xml";
    static constexpr const wchar_t *LanguageDirName = L"Languages";
    static constexpr const wchar_t *SkinDirName = L"Skins";
    static constexpr const wchar_t *SkinFileName = L"Skin.xml";

    /* OSDs */
    static const bool VolumeOSDEnabled = true;
    static const bool EjectOSDEnabled = true;
    static const bool BrightnessOSDEnabled = true;
    static const bool KeyboardOSDEnabled = false;

    static const bool OnTop = true;
    static const bool HideFullscreen = false;
    static const bool HideDirectX = false;
    static const AnimationTypes::HideAnimation DefaultHideAnim
        = AnimationTypes::Fade;
    static const int HideSpeed = 765;
    static const int HideTime = 800;
    static constexpr const float VolumeLimit = 1.0f;
    static const bool NotifyIcon = true;
    static const bool ShowOnStartup = true;
    static const bool SoundsEnabled = true;
    static const int OSDOffset = 140;
    static const Settings::OSDPos OSDPosition = Settings::OSDPos::Bottom;
    static const bool AutoUpdate = false;
    static const bool MuteLock = false;
    static const bool SubscribeVolumeEvents = true;
    static const bool SubscribeEjectEvents = true;

};

Add string constants and reorganize defaults


/*
 * Copyright (c) 2014 Jeremy Yallop.
 *
 * This file is distributed under the terms of the MIT License.
 * See the file LICENSE for details.
 */

#ifndef CSTUBS_INTERNALS_H
#define CSTUBS_INTERNALS_H

/* Types and functions used by generated C code. */

#include "ctypes/primitives.h"
#include "ctypes/complex_stubs.h"
#include "ctypes/raw_pointer.h"
#include "ctypes/managed_buffer_stubs.h"

#endif /* CSTUBS_INTERNALS_H */

Add a single header file with everything needed by generated stubs.


#ifndef MEM_H__
#define MEM_H__

#include <stdlib.h>

#include "ocomm/o_log.h"

void *xmalloc (size_t size);
void *xcalloc (size_t count, size_t size);
void *xrealloc (void *ptr, size_t size);
size_t xmalloc_usable_size(void *ptr);
char *xstralloc (size_t len);
void *xmemdupz (const void *data, size_t len);
char *xstrndup (const char *str, size_t len);
void xfree (void *ptr);

size_t xmembytes();
size_t xmemnew();
size_t xmemfreed();
char *xmemsummary ();
void xmemreport (int loglevel);

#endif /* MEM_H__ */

/*
 Local Variables:
 mode: C
 tab-width: 2
 indent-tabs-mode: nil
 End:
 vim: sw=2:sts=2:expandtab
*/

#ifndef MEM_H__
#define MEM_H__

#include <stdlib.h>

#include "ocomm/o_log.h"

void *xmalloc (size_t size);
void *xcalloc (size_t count, size_t size);
void *xrealloc (void *ptr, size_t size);
size_t xmalloc_usable_size(void *ptr);
char *xstralloc (size_t len);
void *xmemdupz (const void *data, size_t len);
char *xstrndup (const char *str, size_t len);
void xfree (void *ptr);

size_t xmembytes();
size_t xmemnew();
size_t xmemfreed();
char *xmemsummary ();
void xmemreport (int loglevel);

/* Duplicate nil-terminated string
 *
 * \param str string to copy in the new xchunk
 * \return the newly allocated xchunk, or NULL
 * \see xstrndup
 * \see strndup(3), strlen(3)
 */
#define xstrdup(str)  xstrndup((str), strlen((str)))

#endif /* MEM_H__ */

/*
 Local Variables:
 mode: C
 tab-width: 2
 indent-tabs-mode: nil
 End:
 vim: sw=2:sts=2:expandtab
*/

Add xstrdup as a convenience macro around xstrndup

Signed-off-by: Olivier Mehani <b6547e8761a9172c977da5c389270d45960e4aa0@ssji.net>


/*
 * Copyright (c) 2013 Jeremy Yallop.
 *
 * This file is distributed under the terms of the MIT License.
 * See the file LICENSE for details.
 */

#ifndef TYPE_INFO_STUBS_H
#define TYPE_INFO_STUBS_H

#include <caml/mlvalues.h>
#include <caml/fail.h>
#include <caml/callback.h>

/* allocate_unpassable_struct_type_info : (size, alignment) -> _ ctype */
value ctypes_allocate_unpassable_struct_type_info(int size, int alignment);

/* Read a C value from a block of memory */
/* read : 'a prim -> offset:int -> raw_pointer -> 'a */
extern value ctypes_read(value ctype, value offset, value buffer);

/* Write a C value to a block of memory */
/* write : 'a prim -> offset:int -> 'a -> raw_pointer -> unit */
extern value ctypes_write(value ctype, value offset, value v, value buffer);

#endif /* TYPE_INFO_STUBS_H */

/*
 * Copyright (c) 2013 Jeremy Yallop.
 *
 * This file is distributed under the terms of the MIT License.
 * See the file LICENSE for details.
 */

#ifndef TYPE_INFO_STUBS_H
#define TYPE_INFO_STUBS_H

#include <caml/mlvalues.h>

/* Read a C value from a block of memory */
/* read : 'a prim -> offset:int -> raw_pointer -> 'a */
extern value ctypes_read(value ctype, value offset, value buffer);

/* Write a C value to a block of memory */
/* write : 'a prim -> offset:int -> 'a -> raw_pointer -> unit */
extern value ctypes_write(value ctype, value offset, value v, value buffer);

#endif /* TYPE_INFO_STUBS_H */

Remove another obsolete function declaration.


#pragma  once

#include "../IFactory.h"
#include "../ISystem.h"

#include <string>
#include <vector>
#include <map>
#include "../AABBTree.h"

class Property;
class IMoverComponent;

class SimplePhysics
    : public Sigma::IFactory, public ISystem<IMoverComponent> {
public:
	SimplePhysics() { }
	~SimplePhysics() { };
	/**
	 * \brief Starts the Simple Physics system.
	 *
	 * \return bool Returns false on startup failure.
	 */
	bool Start() { }

	/**
	 * \brief Causes an update in the system based on the change in time.
	 *
	 * Updates the state of the system based off how much time has elapsed since the last update.
	 * \param[in] const float delta The change in time since the last update
	 * \return bool Returns true if we had an update interval passed.
	 */
	bool Update(const double delta);

    std::map<std::string,FactoryFunction> getFactoryFunctions();
	void createPhysicsMover(const unsigned int entityID, std::vector<Property> &properties) ;
	void createViewMover(const unsigned int entityID, std::vector<Property> &properties) ;
	void createAABBTree(const unsigned int entityID, std::vector<Property> &properties) ;
private:
	std::map<unsigned int, Sigma::AABBTree*> colliders;
};

#pragma  once

#include "../IFactory.h"
#include "../ISystem.h"

#include <string>
#include <vector>
#include <map>
#include "../AABBTree.h"

class Property;
class IMoverComponent;

class SimplePhysics
    : public Sigma::IFactory, public ISystem<IMoverComponent> {
public:
	SimplePhysics() { }
	~SimplePhysics() { };
	/**
	 * \brief Starts the Simple Physics system.
	 *
	 * \return bool Returns false on startup failure.
	 */
	bool Start() { }

	/**
	 * \brief Causes an update in the system based on the change in time.
	 *
	 * Updates the state of the system based off how much time has elapsed since the last update.
	 * \param[in] const float delta The change in time since the last update
	 * \return bool Returns true if we had an update interval passed.
	 */
	bool Update(const double delta);

    std::map<std::string,FactoryFunction> getFactoryFunctions();
	void createPhysicsMover(const unsigned int entityID, std::vector<Property> &properties) ;
	void createViewMover(const unsigned int entityID, std::vector<Property> &properties) ;
	void createAABBTree(const unsigned int entityID, std::vector<Property> &properties) ;

	Sigma::AABBTree* GetCollider(const unsigned int entityID) {
		if (this->colliders.find(entityID) != this->colliders.end()) {
			return this->colliders[entityID];
		}
		return nullptr;
	}
private:
	std::map<unsigned int, Sigma::AABBTree*> colliders;
};

Add the ability to get Colliders from SImplePhysics


#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class AliChaoticity+;
#pragma link C++ class AliThreePionRadii+;
#pragma link C++ class AliChaoticityEventCollection+;
#pragma link C++ class AliChaoticityEventStruct+;
#pragma link C++ class AliChaoticityTrackStruct+;
#pragma link C++ class AliChaoticityMCStruct+;
#pragma link C++ class AliChaoticityPairStruct+;
#pragma link C++ class AliChaoticityNormPairStruct+;

#pragma link C++ class AliFourPion+;
#pragma link C++ class AliFourPionEventCollection+;
#pragma link C++ class AliFourPionEventStruct+;
#pragma link C++ class AliFourPionTrackStruct+;
#pragma link C++ class AliFourPionMCStruct+;

Update compile code for 4-pion analysis

Update compile code for 4-pion analysis


#include "modlib.h"
#include "parser.h"
#include "exception.h"

//Types
typedef struct
{
	uint8_t Length; //Length of frame, if it's equal to 0, frame is not ready
	uint8_t *Frame; //Response frame content
} MODBUSResponseStatus; //Type containing information about frame that is set up at slave side

typedef struct
{
	uint8_t Address;
	uint16_t *Registers;
	uint16_t RegisterCount;
	MODBUSResponseStatus Response;
} MODBUSSlaveStatus; //Type containing slave device configuration data

//Variables definitions
extern MODBUSSlaveStatus MODBUSSlave; //Slave configuration

//Function prototypes
extern void MODBUSParseRequest( uint8_t *, uint8_t ); //Parse and interpret given modbus frame on slave-side
extern void MODBUSSlaveInit( uint8_t, uint16_t *, uint16_t ); //Very basic init of slave side

#include "modlib.h"
#include "parser.h"
#include "exception.h"

//Types
typedef struct
{
	uint8_t Length; //Length of frame, if it's equal to 0, frame is not ready
	uint8_t *Frame; //Response frame content
} MODBUSResponseStatus; //Type containing information about frame that is set up at slave side

typedef struct
{
	uint8_t Address;
	uint16_t *Registers;
	uint16_t RegisterCount;
	MODBUSResponseStatus Response;
} MODBUSSlaveStatus; //Type containing slave device configuration data

//Variables definitions
extern MODBUSSlaveStatus MODBUSSlave; //Slave configuration

//Function prototypes
extern void MODBUSException( uint8_t, uint8_t ); //Generate exception response to response frame buffer
extern void MODBUSParseRequest( uint8_t *, uint8_t ); //Parse and interpret given modbus frame on slave-side
extern void MODBUSSlaveInit( uint8_t, uint16_t *, uint16_t ); //Very basic init of slave side

Add prototype of MODBUSException function


/*
 * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
 *
 * 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.
 */

/**
 * @addtogroup  posix_sockets
 */
/**
 * @{
 *
 * @file
 * @brief   System-internal byte operations.
 *
 * @author  Martine Lenders <mlenders@inf.fu-berlin.de>
 */
#ifndef SYS_BYTES_H
#define SYS_BYTES_H

#include <stddef.h>

#include "byteorder.h"

#ifdef __cplusplus
extern "C" {
#endif

#ifndef __MACH__
typedef size_t socklen_t;           /**< socket address length */
#else
/* Defined for OSX with a different type */
typedef __darwin_socklen_t socklen_t;   /**< socket address length */
#endif

#ifdef __cplusplus
}
#endif

#endif /* SYS_BYTES_H */
/** @} */

/*
 * Copyright (C) 2015 Martine Lenders <mlenders@inf.fu-berlin.de>
 *
 * 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.
 */

/**
 * @addtogroup  posix_sockets
 */
/**
 * @{
 *
 * @file
 * @brief   System-internal byte operations.
 *
 * @author  Martine Lenders <mlenders@inf.fu-berlin.de>
 */
#ifndef SYS_BYTES_H
#define SYS_BYTES_H

#include <stddef.h>

#include "byteorder.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef size_t socklen_t;           /**< socket address length */

#ifdef __cplusplus
}
#endif

#endif /* SYS_BYTES_H */
/** @} */

Revert "posix/osx: fix type conflict on OSX native"

This reverts commit dcebfb11bc5a861c711e58838eec5b0131d020e2.


#include <stdio.h>
#include <ruby.h>
#include <ruby/encoding.h>

static VALUE
profiler_start(VALUE module, VALUE usec)
{
    struct itimerval timer;
    timer.it_interval.tv_sec = 0;
    timer.it_interval.tv_usec = NUM2LONG(usec);
    timer.it_value = timer.it_interval;
    setitimer(ITIMER_PROF, &timer, 0);

    return Qnil;
}

static VALUE
profiler_stop(VALUE module)
{
    struct itimerval timer;
    memset(&timer, 0, sizeof(timer));
    setitimer(ITIMER_PROF, &timer, 0);

    return Qnil;
}

static VALUE
rb_profile_block(VALUE module, VALUE usec)
{
    rb_need_block();

    profiler_start(module, usec);
    rb_yield(Qundef);
    profiler_stop(module);

    return Qnil;
}

void Init_fast_stack( void )
{
  VALUE rb_mFastStack = rb_define_module("FastStack");
  rb_define_module_function(rb_mFastStack, "profile_block", rb_profile_block, 1);
}

#include <stdio.h>
#include <sys/time.h>
#include <ruby.h>
#include <ruby/encoding.h>

static VALUE
profiler_start(VALUE module, VALUE usec)
{
    struct itimerval timer;
    timer.it_interval.tv_sec = 0;
    timer.it_interval.tv_usec = NUM2LONG(usec);
    timer.it_value = timer.it_interval;
    setitimer(ITIMER_PROF, &timer, 0);

    return Qnil;
}

static VALUE
profiler_stop(VALUE module)
{
    struct itimerval timer;
    memset(&timer, 0, sizeof(timer));
    setitimer(ITIMER_PROF, &timer, 0);

    return Qnil;
}

static VALUE
rb_profile_block(VALUE module, VALUE usec)
{
    rb_need_block();

    profiler_start(module, usec);
    rb_yield(Qundef);
    profiler_stop(module);

    return Qnil;
}

void Init_fast_stack( void )
{
  VALUE rb_mFastStack = rb_define_module("FastStack");
  rb_define_module_function(rb_mFastStack, "profile_block", rb_profile_block, 1);
}

Fix "storage size of 'timer' isn't known" on Debian Squeeze

struct itimerval defined in sys/time.h


/*
 Copyright (C) 2008-2010 Christian Dywan <christian@twotoasts.de>

 This library is free software; you can redistribute it and/or
 modify it under the terms of the GNU Lesser General Public
 License as published by the Free Software Foundation; either
 version 2.1 of the License, or (at your option) any later version.

 See the file COPYING for the full license text.
*/

#include <midori/midori.h>
#include <midori/sokoke.h>

static void
tabs_minimized_app_add_browser_cb (MidoriApp*       app,
                                   MidoriBrowser*   browser,
                                   MidoriExtension* extension);

static void
tabs_minimized_deactivate_cb (MidoriExtension* extension,
                              MidoriBrowser*   browser)
{
    MidoriApp* app = midori_extension_get_app (extension);

    g_signal_handlers_disconnect_by_func (
        extension, tabs_minimized_deactivate_cb, browser);
    g_signal_handlers_disconnect_by_func (
        app, tabs_minimized_app_add_browser_cb, extension);
}

static void
tabs_minimized_add_tab_cb (MidoriApp*       app,
                           MidoriView*      tab,
                           MidoriExtension* extension)
{
    g_object_set (tab, "minimized", TRUE, NULL);
}

static void
tabs_minimized_app_add_browser_cb (MidoriApp*       app,
                                   MidoriBrowser*   browser,
                                   MidoriExtension* extension)
{
    g_signal_connect (browser, "add-tab",
        G_CALLBACK (tabs_minimized_add_tab_cb), extension);
    g_signal_connect (extension, "deactivate",
        G_CALLBACK (tabs_minimized_deactivate_cb), browser);
}

static void
tabs_minimized_activate_cb (MidoriExtension* extension,
                            MidoriApp*       app)
{
    KatzeArray* browsers;
    MidoriBrowser* browser;
    guint i;

    browsers = katze_object_get_object (app, "browsers");
    i = 0;
    while ((browser = katze_array_get_nth_item (browsers, i++)))
        tabs_minimized_app_add_browser_cb (app, browser, extension);
    g_object_unref (browsers);
    g_signal_connect (app, "add-browser",
        G_CALLBACK (tabs_minimized_app_add_browser_cb), extension);
}

MidoriExtension*
extension_init (void)
{
    MidoriExtension* extension = g_object_new (MIDORI_TYPE_EXTENSION,
        "name", _("Minimize new Tabs"),
        "description", _("New tabs open minimized"),
        "version", "0.1",
        "authors", "MonkeyOfDoom <pixelmonkey@ensellitis.com>",
        NULL);

    g_signal_connect (extension, "activate",
        G_CALLBACK (tabs_minimized_activate_cb), NULL);

    return extension;
}

Add extension 'Minimize new Tabs'

Add extension 'Minimize new Tabs'

Once it is activated the extension will minimize all newly opened
tabs by default.


/*
 *
 *  BlueZ - Bluetooth protocol stack for Linux
 *
 *  Copyright (C) 2005-2006  Marcel Holtmann <marcel@holtmann.org>
 *
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdio.h>
#include <errno.h>

#include "logging.h"
#include "sdp-xml.h"

sdp_record_t *sdp_xml_parse_record(const char *data, int size)
{
	error("No XML parser available");

	return -1;
}

/*
 *
 *  BlueZ - Bluetooth protocol stack for Linux
 *
 *  Copyright (C) 2005-2006  Marcel Holtmann <marcel@holtmann.org>
 *
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program 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 General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

#include <stdio.h>
#include <errno.h>

#include "logging.h"
#include "sdp-xml.h"

sdp_record_t *sdp_xml_parse_record(const char *data, int size)
{
	error("No XML parser available");

	return NULL;
}

Return NULL in case of the dummy XML parser


/*===-- object.c - tool for testing libLLVM and llvm-c API ----------------===*\
|*                                                                            *|
|*                     The LLVM Compiler Infrastructure                       *|
|*                                                                            *|
|* This file is distributed under the University of Illinois Open Source      *|
|* License. See LICENSE.TXT for details.                                      *|
|*                                                                            *|
|*===----------------------------------------------------------------------===*|
|*                                                                            *|
|* This file implements the --add-named-metadata-operand and --set-metadata   *|
|* commands in llvm-c-test.                                                   *|
|*                                                                            *|
\*===----------------------------------------------------------------------===*/

#include "llvm-c-test.h"
#include "llvm-c/Core.h"

int add_named_metadata_operand(void) {
  LLVMModuleRef m = LLVMModuleCreateWithName("Mod");
  LLVMValueRef values[] = { LLVMConstInt(LLVMInt32Type(), 0, 0) };

  // This used to trigger an assertion
  LLVMAddNamedMetadataOperand(m, "name", LLVMMDNode(values, 1));

  return 0;
}

int set_metadata(void) {
  LLVMBuilderRef b = LLVMCreateBuilder();
  LLVMValueRef values[] = { LLVMConstInt(LLVMInt32Type(), 0, 0) };

  // This used to trigger an assertion
  LLVMSetMetadata(
      LLVMBuildRetVoid(b),
      LLVMGetMDKindID("kind", 4),
      LLVMMDNode(values, 1));

  return 0;
}

/*===-- object.c - tool for testing libLLVM and llvm-c API ----------------===*\
|*                                                                            *|
|*                     The LLVM Compiler Infrastructure                       *|
|*                                                                            *|
|* This file is distributed under the University of Illinois Open Source      *|
|* License. See LICENSE.TXT for details.                                      *|
|*                                                                            *|
|*===----------------------------------------------------------------------===*|
|*                                                                            *|
|* This file implements the --add-named-metadata-operand and --set-metadata   *|
|* commands in llvm-c-test.                                                   *|
|*                                                                            *|
\*===----------------------------------------------------------------------===*/

#include "llvm-c-test.h"
#include "llvm-c/Core.h"

int add_named_metadata_operand(void) {
  LLVMModuleRef m = LLVMModuleCreateWithName("Mod");
  LLVMValueRef values[] = { LLVMConstInt(LLVMInt32Type(), 0, 0) };

  // This used to trigger an assertion
  LLVMAddNamedMetadataOperand(m, "name", LLVMMDNode(values, 1));

  LLVMDisposeModule(m);

  return 0;
}

int set_metadata(void) {
  LLVMBuilderRef b = LLVMCreateBuilder();
  LLVMValueRef values[] = { LLVMConstInt(LLVMInt32Type(), 0, 0) };

  // This used to trigger an assertion
  LLVMSetMetadata(
      LLVMBuildRetVoid(b),
      LLVMGetMDKindID("kind", 4),
      LLVMMDNode(values, 1));

  LLVMDisposeBuilder(b);

  return 0;
}

Fix build breakage caused by memory leaks in llvm-c-test

I accidently introduced those in r227319.

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


#ifndef FILE_UNIT_H_
#define FILE_UNIT_H_

#include <string>

template <typename T>
class FileUnit
{
public:
    std::string filename;
    T *file;

    FileUnit(std::string& filename);

    virtual ~FileUnit();
};

#endif

#ifndef FILE_UNIT_H_
#define FILE_UNIT_H_

#include <string>

template <typename T>
class FileUnit
{
public:
    FileUnit(std::string& filename);

    virtual ~FileUnit();

private:
    std::string filename;
    T *file;
};

#endif

Change privacy to private for the filename and generic representation


// SKIP PARAM: --sets ana.activated[+] octApron
#include <assert.h>

extern void magic();

int g;
int h;

void main() {
  int r, x;

  x = r;
  g = r;
  h = r + 1;

  assert(g < h);
  magic(); // invalidates (forgets) globals
  assert(g < h); // UNKNOWN!
  assert(x == r); // shouldn't forget locals
}

Add octApron test for special globals invalidation


/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */

#include "common.h"
#include "commands.h"
#include "imap-expunge.h"

bool cmd_close(struct client_command_context *cmd)
{
	struct client *client = cmd->client;
	struct mailbox *mailbox = client->mailbox;
	struct mail_storage *storage;

	if (!client_verify_open_mailbox(cmd))
		return TRUE;

	storage = mailbox_get_storage(mailbox);
	client->mailbox = NULL;

	if (!imap_expunge(mailbox, NULL))
		client_send_untagged_storage_error(client, storage);

	if (mailbox_close(&mailbox) < 0)
                client_send_untagged_storage_error(client, storage);
	client_update_mailbox_flags(client, NULL);

	client_send_tagline(cmd, "OK Close completed.");
	return TRUE;
}

/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */

#include "common.h"
#include "commands.h"
#include "imap-expunge.h"

bool cmd_close(struct client_command_context *cmd)
{
	struct client *client = cmd->client;
	struct mailbox *mailbox = client->mailbox;
	struct mail_storage *storage;

	if (!client_verify_open_mailbox(cmd))
		return TRUE;

	storage = mailbox_get_storage(mailbox);
	client->mailbox = NULL;

	if (!imap_expunge(mailbox, NULL))
		client_send_untagged_storage_error(client, storage);
	else if (mailbox_sync(mailbox, 0, 0, NULL) < 0)
		client_send_untagged_storage_error(client, storage);

	if (mailbox_close(&mailbox) < 0)
                client_send_untagged_storage_error(client, storage);
	client_update_mailbox_flags(client, NULL);

	client_send_tagline(cmd, "OK Close completed.");
	return TRUE;
}

CLOSE: Synchronize the mailbox after expunging messages to actually get them
expunged.


//===--- StmtCXX.h - Classes for representing C++ statements ----*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the C++ statement AST node classes.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_AST_STMTCXX_H
#define LLVM_CLANG_AST_STMTCXX_H

#include "clang/AST/Stmt.h"

namespace clang {

/// CXXCatchStmt - This represents a C++ catch block.
///
class CXXCatchStmt : public Stmt {
  SourceLocation CatchLoc;
  /// The exception-declaration of the type.
  Decl *ExceptionDecl;
  /// The handler block.
  Stmt *HandlerBlock;

public:
  CXXCatchStmt(SourceLocation catchLoc, Decl *exDecl, Stmt *handlerBlock)
  : Stmt(CXXCatchStmtClass), CatchLoc(catchLoc), ExceptionDecl(exDecl),
    HandlerBlock(handlerBlock) {}

  virtual void Destroy(ASTContext& Ctx);

  virtual SourceRange getSourceRange() const {
    return SourceRange(CatchLoc, HandlerBlock->getLocEnd());
  }

  Decl *getExceptionDecl() { return ExceptionDecl; }
  QualType getCaughtType();
  Stmt *getHandlerBlock() { return HandlerBlock; }

  static bool classof(const Stmt *T) {
    return T->getStmtClass() == CXXCatchStmtClass;
  }
  static bool classof(const CXXCatchStmt *) { return true; }

  virtual child_iterator child_begin();
  virtual child_iterator child_end();
};

/// CXXTryStmt - A C++ try block, including all handlers.
///
class CXXTryStmt : public Stmt {
  SourceLocation TryLoc;
  // First place is the guarded CompoundStatement. Subsequent are the handlers.
  // More than three handlers should be rare.
  llvm::SmallVector<Stmt*, 4> Stmts;

public:
  CXXTryStmt(SourceLocation tryLoc, Stmt *tryBlock,
             Stmt **handlers, unsigned numHandlers);

  virtual SourceRange getSourceRange() const {
    return SourceRange(TryLoc, Stmts.back()->getLocEnd());
  }

  CompoundStmt *getTryBlock() { return llvm::cast<CompoundStmt>(Stmts[0]); }
  const CompoundStmt *getTryBlock() const {
    return llvm::cast<CompoundStmt>(Stmts[0]);
  }

  unsigned getNumHandlers() const { return Stmts.size() - 1; }
  CXXCatchStmt *getHandler(unsigned i) {
    return llvm::cast<CXXCatchStmt>(Stmts[i + 1]);
  }
  const CXXCatchStmt *getHandler(unsigned i) const {
    return llvm::cast<CXXCatchStmt>(Stmts[i + 1]);
  }

  static bool classof(const Stmt *T) {
    return T->getStmtClass() == CXXTryStmtClass;
  }
  static bool classof(const CXXTryStmt *) { return true; }

  virtual child_iterator child_begin();
  virtual child_iterator child_end();
};

}  // end namespace clang

#endif

Split C++ statements out to their own file.

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


//
//  ContentfulDeliveryAPI.h
//  ContentfulSDK
//
//  Created by Boris Bügling on 04/03/14.
//
//

#import <Foundation/Foundation.h>

#import <ContentfulDeliveryAPI/CDAArray.h>
#import <ContentfulDeliveryAPI/CDAAsset.h>
#import <ContentfulDeliveryAPI/CDAClient.h>
#import <ContentfulDeliveryAPI/CDAConfiguration.h>
#import <ContentfulDeliveryAPI/CDAContentType.h>
#import <ContentfulDeliveryAPI/CDAEntry.h>
#import <ContentfulDeliveryAPI/CDAField.h>
#import <ContentfulDeliveryAPI/CDAPersistenceManager.h>
#import <ContentfulDeliveryAPI/CDARequest.h>
#import <ContentfulDeliveryAPI/CDAResponse.h>
#import <ContentfulDeliveryAPI/CDASpace.h>
#import <ContentfulDeliveryAPI/CDASyncedSpace.h>

#if TARGET_OS_IPHONE
#import <ContentfulDeliveryAPI/CDAEntriesViewController.h>
#import <ContentfulDeliveryAPI/CDAFieldsViewController.h>
#import <ContentfulDeliveryAPI/CDAMapViewController.h>
#import <ContentfulDeliveryAPI/CDAResourceCell.h>
#import <ContentfulDeliveryAPI/CDAResourcesCollectionViewController.h>
#import <ContentfulDeliveryAPI/CDAResourcesViewController.h>
#endif

extern NSString* const CDAErrorDomain;

//
//  ContentfulDeliveryAPI.h
//  ContentfulSDK
//
//  Created by Boris Bügling on 04/03/14.
//
//

#import <Foundation/Foundation.h>

#import <ContentfulDeliveryAPI/CDAArray.h>
#import <ContentfulDeliveryAPI/CDAAsset.h>
#import <ContentfulDeliveryAPI/CDAClient.h>
#import <ContentfulDeliveryAPI/CDAConfiguration.h>
#import <ContentfulDeliveryAPI/CDAContentType.h>
#import <ContentfulDeliveryAPI/CDAEntry.h>
#import <ContentfulDeliveryAPI/CDAField.h>
#import <ContentfulDeliveryAPI/CDAPersistenceManager.h>
#import <ContentfulDeliveryAPI/CDARequest.h>
#import <ContentfulDeliveryAPI/CDAResponse.h>
#import <ContentfulDeliveryAPI/CDASpace.h>
#import <ContentfulDeliveryAPI/CDASyncedSpace.h>

#if TARGET_OS_IPHONE
#import <ContentfulDeliveryAPI/CDAEntriesViewController.h>
#import <ContentfulDeliveryAPI/CDAFieldsViewController.h>
#import <ContentfulDeliveryAPI/CDAMapViewController.h>
#import <ContentfulDeliveryAPI/CDAResourceCell.h>
#import <ContentfulDeliveryAPI/CDAResourcesCollectionViewController.h>
#import <ContentfulDeliveryAPI/CDAResourcesViewController.h>
#import <ContentfulDeliveryAPI/UIImageView+CDAAsset.h>
#endif

extern NSString* const CDAErrorDomain;

Include image view category in framework header.


/*
 * QLogic iSCSI HBA Driver
 * Copyright (c)  2003-2006 QLogic Corporation
 *
 * See LICENSE.qla4xxx for copyright and licensing details.
 */

#define QLA4XXX_DRIVER_VERSION	"5.01.00-k9"

/*
 * QLogic iSCSI HBA Driver
 * Copyright (c)  2003-2006 QLogic Corporation
 *
 * See LICENSE.qla4xxx for copyright and licensing details.
 */

#define QLA4XXX_DRIVER_VERSION	"5.02.00-k1"

Update driver version to 5.02.00-k1

[SCSI] qla4xxx: Update driver version to 5.02.00-k1

Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com>
Signed-off-by: Ravi Anand <399b6871085291e2c1578e38a71f59e8d20fafc0@qlogic.com>
Reviewed-by: Mike Christie <6fe105eefab41990d7ec714c6c25ade3095cdb48@cs.wisc.edu>
Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@suse.de>


#include <bf_alloc.h>

#include <sys/mman.h>

uint8_t *allocate_executable_space(size_t size) {
    uint8_t *memory = (uint8_t*) mmap(
            NULL,                       /* No existing address. */
            size,                       /* At LEAST this size. */
            PROT_EXEC|PROT_WRITE,       /* Writable and executable memory. */
            MAP_PRIVATE|MAP_ANONYMOUS,  /* An anonymous mapping; using private
                                           mapping is most portable. */
            -1,                         /* Using fd = -1 is most portable in
                                           conjunction with MAP_ANONYMOUS. */
            0                           /* Irrelevant for MAP_ANONYMOUS. */
    );

    if (memory == MAP_FAILED) {
        return NULL;
    }

    return memory;
}

/* TODO: fairly certain this will lead to a memory leak if the mapping is
 * larger than the page size... */

bool free_executable_space(uint8_t *space) {
    if (munmap(space, 1) == 0) {
        return true;
    }
    return false;
}

#include <bf_alloc.h>

/* So that MAP_ANONYMOUS is available on glibc. */
#define _BSD_SOURCE
#include <sys/mman.h>

uint8_t *allocate_executable_space(size_t size) {
    uint8_t *memory = (uint8_t*) mmap(
            NULL,                       /* No existing address. */
            size,                       /* At LEAST this size. */
            PROT_EXEC|PROT_WRITE,       /* Writable and executable memory. */
            MAP_PRIVATE|MAP_ANONYMOUS,  /* An anonymous mapping; using private
                                           mapping is most portable. */
            -1,                         /* Using fd = -1 is most portable in
                                           conjunction with MAP_ANONYMOUS. */
            0                           /* Irrelevant for MAP_ANONYMOUS. */
    );

    if (memory == MAP_FAILED) {
        return NULL;
    }

    return memory;
}

/* TODO: fairly certain this will lead to a memory leak if the mapping is
 * larger than the page size... */

bool free_executable_space(uint8_t *space) {
    if (munmap(space, 1) == 0) {
        return true;
    }
    return false;
}

Add feature-test macro for MAP_ANONYMOUS.


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

#ifndef CHROME_GPU_GPU_CONFIG_H_
#define CHROME_GPU_GPU_CONFIG_H_

// This file declares common preprocessor configuration for the GPU process.

#include "build/build_config.h"

#if defined(OS_LINUX) && !defined(ARCH_CPU_X86)

// Only define GLX support for Intel CPUs for now until we can get the
// proper dependencies and build setup for ARM.
#define GPU_USE_GLX

#endif

#endif  // CHROME_GPU_GPU_CONFIG_H_

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

#ifndef CHROME_GPU_GPU_CONFIG_H_
#define CHROME_GPU_GPU_CONFIG_H_

// This file declares common preprocessor configuration for the GPU process.

#include "build/build_config.h"

#if defined(OS_LINUX) && defined(ARCH_CPU_X86)

// Only define GLX support for Intel CPUs for now until we can get the
// proper dependencies and build setup for ARM.
#define GPU_USE_GLX

#endif

#endif  // CHROME_GPU_GPU_CONFIG_H_

Fix stupid error for Linux build.

Fix stupid error for Linux build.

TEST=none
BUG=none
Review URL: http://codereview.chromium.org/555096

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


/****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jolla.com>
**
****************************************************************************/

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef DECLARATIVEWEBUTILS_H
#define DECLARATIVEWEBUTILS_H

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

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

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

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

    static DeclarativeWebUtils *instance();

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

signals:
    void homePageChanged();

private:
    QString m_homePage;
    bool m_firstUseDone;
};

QML_DECLARE_TYPE(DeclarativeWebUtils)

#endif

/****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jolla.com>
**
****************************************************************************/

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef DECLARATIVEWEBUTILS_H
#define DECLARATIVEWEBUTILS_H

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

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

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

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

    static DeclarativeWebUtils *instance();

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

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

private:
    QString m_homePage;
    bool m_firstUseDone;
};

QML_DECLARE_TYPE(DeclarativeWebUtils)

#endif

Add missing property for WebUtils mock

[sailfish-browser] Add missing property for WebUtils mock

A warning was printed when running unit tests.


//
//  UIButton+PPiAwesome.h
//  PPiAwesomeButton-Demo
//
//  Created by Pedro Piñera Buendía on 19/08/13.
//  Copyright (c) 2013 PPinera. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "NSString+FontAwesome.h"
#import <QuartzCore/QuartzCore.h>
#import <objc/runtime.h>
typedef enum {
    IconPositionRight,
    IconPositionLeft,
} IconPosition;

@interface UIButton (PPiAwesome)
+(UIButton*)buttonWithType:(UIButtonType)type text:(NSString*)text icon:(NSString*)icon textAttributes:(NSDictionary*)attributes andIconPosition:(IconPosition)position;
-(id)initWithFrame:(CGRect)frame text:(NSString*)text icon:(NSString*)icon textAttributes:(NSDictionary*)attributes andIconPosition:(IconPosition)position;

-(void)setTextAttributes:(NSDictionary*)attributes forUIControlState:(UIControlState)state;
-(void)setBackgroundColor:(UIColor*)color forUIControlState:(UIControlState)state;
-(void)setIconPosition:(IconPosition)position;
-(void)setButtonText:(NSString*)text;
-(void)setButtonIcon:(NSString*)icon;
-(void)setRadius:(CGFloat)radius;
-(void)setSeparation:(NSUInteger)separation;

@end

//
//  UIButton+PPiAwesome.h
//  PPiAwesomeButton-Demo
//
//  Created by Pedro Piñera Buendía on 19/08/13.
//  Copyright (c) 2013 PPinera. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "NSString+FontAwesome.h"
#import <QuartzCore/QuartzCore.h>
#import <objc/runtime.h>
typedef enum {
    IconPositionRight,
    IconPositionLeft,
} IconPosition;

@interface UIButton (PPiAwesome)
+(UIButton*)buttonWithType:(UIButtonType)type text:(NSString*)text icon:(NSString*)icon textAttributes:(NSDictionary*)attributes andIconPosition:(IconPosition)position;
-(id)initWithFrame:(CGRect)frame text:(NSString*)text icon:(NSString*)icon textAttributes:(NSDictionary*)attributes andIconPosition:(IconPosition)position;

-(void)setTextAttributes:(NSDictionary*)attributes forUIControlState:(UIControlState)state;
-(void)setBackgroundColor:(UIColor*)color forUIControlState:(UIControlState)state;
-(void)setIconPosition:(IconPosition)position;
-(void)setButtonText:(NSString*)text;
-(void)setButtonIcon:(NSString*)icon;
-(void)setRadius:(CGFloat)radius;
-(void)setSeparation:(NSUInteger)separation;
-(void)setIsAwesome:(BOOL)isAwesome;

@end

Make isAwesome public to convert nib-based buttons.


#ifndef __MEMORY_SYSTEM__H
#define __MEMORY_SYSTEM__H

#include <functional>
#include <string>

namespace dramsim3 {

// This should be the interface class that deals with CPU
class MemorySystem {
   public:
    MemorySystem(const std::string &config_file, const std::string &output_dir,
                 std::function<void(uint64_t)> read_callback,
                 std::function<void(uint64_t)> write_callback);
    ~MemorySystem();
    void ClockTick();
    void RegisterCallbacks(std::function<void(uint64_t)> read_callback,
                           std::function<void(uint64_t)> write_callback);
    double GetTCK() const;
    int GetBusBits() const;
    int GetBurstLength() const;
    int GetQueueSize() const;
    void PrintStats() const;

    bool WillAcceptTransaction(uint64_t hex_addr, bool is_write) const;
    bool AddTransaction(uint64_t hex_addr, bool is_write);
};

}  // namespace dramsim3

#endif

Add header file for external use (e.g. SST)


#ifndef MBR_H
#define MBR_H

#include <stdint.h>

struct MBREntry {
	uint8_t  boot_indicator;
	uint8_t  starting_head;
	uint16_t starting_sector   :  6;
	uint16_t starting_cylinder : 10;
	uint8_t  system_id;
	uint8_t  ending_head;
	uint16_t ending_sector     :  6;
	uint16_t ending_cylinder   : 10;
	uint32_t starting_lba;
	uint32_t sector_count;
} __attribute__((packed));

struct MBR {
	uint8_t padding[0x1BE];
	MBREntry entries[4];
} __attribute__((packed));

MBR mbr_read(void);

#endif

#ifndef MBR_H
#define MBR_H

#include <stdint.h>

struct MBREntry {
	uint8_t  boot_indicator;
	uint8_t  starting_head;
	uint16_t starting_sector   :  6;
	uint16_t starting_cylinder : 10;
	uint8_t  system_id;
	uint8_t  ending_head;
	uint16_t ending_sector     :  6;
	uint16_t ending_cylinder   : 10;
	uint32_t starting_lba;
	uint32_t sector_count;
} __attribute__((packed));

struct MBR {
	uint8_t padding[0x1BE];
	MBREntry entries[4];
	uint16_t boot_signature;
} __attribute__((packed));

MBR mbr_read(void);

#endif

Add boot sig to MBR structure

Add boot sig to MBR structure


//
//  UINotificationTableViewCell.h
//  YouLocal
//
//  Created by Mihail Velikov on 5/3/15.
//  Copyright (c) 2015 YouLoc.al. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface NotificationTableViewCell : UITableViewCell

@property (nonatomic, weak) UIImageView *avatarImage;
@property (nonatomic, weak) UIImageView *typeImage;
@property (nonatomic, weak) UILabel *authorNameLabel;
@property (nonatomic, weak) UILabel *createdBeforeLabel;
@property (nonatomic, weak) UILabel *messageLabel;

@end

//
//  UINotificationTableViewCell.h
//  YouLocal
//
//  Created by Mihail Velikov on 5/3/15.
//  Copyright (c) 2015 YouLoc.al. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface NotificationTableViewCell : UITableViewCell

@property (weak, nonatomic) IBOutlet UIImageView *avatarImage;
@property (weak, nonatomic) IBOutlet UIImageView *typeImage;
@property (weak, nonatomic) IBOutlet UILabel *nameLabel;
@property (weak, nonatomic) IBOutlet UILabel *typeLabel;
@property (weak, nonatomic) IBOutlet UILabel *messageLabel;
@property (weak, nonatomic) IBOutlet UILabel *createdBeforeLabel;
@property (weak, nonatomic) IBOutlet UILabel *createdBeforeSign;
@end

Add Storyboard outlets in Notifications cell class


class EncoderFormat {
public:
  std::string get() { return std::string(_format.begin(), _format.end()); } const
  void set(const std::wstring fileName, const std::wstring extension)
  {
    if (fileName.find(L"clusterfuzz-testcase-") == -1)
    {
      if (extension.length() > 1)
        _format = extension.substr(1, extension.size() - 1);
      return;
    }

    std::wstring format=fileName;

    size_t index = format.find(L"_", 0);
    if (index == std::wstring::npos)
      return;

    format=format.substr(index + 1);
    index = format.find(L"_", 0);
    if (index != std::wstring::npos)
      _format=format.substr(0, index);
  }
private:
  std::wstring _format = L".notset";
};

class EncoderFormat {
public:
  std::string get() { return std::string(_format.begin(), _format.end()); } const
  void set(const std::wstring fileName, const std::wstring extension)
  {
    if (fileName.find(L"clusterfuzz-testcase-") == -1)
    {
      if (extension.length() > 1)
        _format = extension.substr(1, extension.size() - 1);
      return;
    }

    std::wstring format=fileName;

    size_t index = format.find(L"_", 0);
    if (index == std::wstring::npos)
      return;

    format=format.substr(index + 1);
    index = format.find(L"_", 0);
    if (index != std::wstring::npos)
      _format=format.substr(0, index);
    else if (extension.length() > 1)
      _format=extension.substr(1, extension.size() - 1);
  }
private:
  std::wstring _format = L".notset";
};

Use file extension as fallback.

Use file extension as fallback.


#include <libunwind.h>

#ifndef HAVE_CMP8XCHG16

#include <pthread.h>

/* Make it easy to write thread-safe code which may or may not be
   linked against libpthread.  The macros below can be used
   unconditionally and if -lpthread is around, they'll call the
   corresponding routines otherwise, they do nothing.  */

#pragma weak pthread_rwlock_rdlock
#pragma weak pthread_rwlock_wrlock
#pragma weak pthread_rwlock_unlock

#define rw_rdlock(l)    (pthread_rwlock_rdlock ? pthread_rwlock_rdlock (l) : 0)
#define rw_wrlock(l)    (pthread_rwlock_wrlock ? pthread_rwlock_wrlock (l) : 0)
#define rw_unlock(l)    (pthread_rwlock_unlock ? pthread_rwlock_unlock (l) : 0)

static pthread_rwlock_t registration_lock = PTHREAD_RWLOCK_INITIALIZER;

#endif

extern unw_dyn_info_list_t _U_dyn_info_list;

int
_U_dyn_register (unw_dyn_info_t *di)
{
#ifdef HAVE_CMP8XCHG16
  unw_dyn_info_t *old_list_head, *new_list_head;
  unsigned long old_gen, new_gen;

  do
    {
      old_gen = _U_dyn_info_list.generation;
      old_list_head = _U_dyn_info_list.first;

      new_gen = old_gen + 1;
      new_list_head = di;
      di->next = old_list_head;
    }
  while (cmp8xchg16 (&_U_dyn_info_list, new_gen, new_list_head) != old_gen);
#else
  rw_wrlock (&registration_lock);
  {
    ++_U_dyn_info_list.generation;
    di->next = _U_dyn_info_list.first;
    _U_dyn_info_list.first = di;
  }
  rw_unlock (&registration_lock);
#endif
}

#include "internal.h"

pthread_mutex_t _U_dyn_info_list_lock = PTHREAD_MUTEX_INITIALIZER;

void
_U_dyn_register (unw_dyn_info_t *di)
{
  mutex_lock (&_U_dyn_info_list_lock);
  {
    ++_U_dyn_info_list.generation;

    di->next = _U_dyn_info_list.first;
    di->prev = NULL;
    if (di->next)
	    di->next->prev = di;
    _U_dyn_info_list.first = di;
  }
  mutex_unlock (&_U_dyn_info_list_lock);
}

Move pthread-locking stuff to "internal.h".
(_U_dyn_info_list_lock): Rename from "registration_lock" and change from r/w-lock
	to a simple mutex (spin) lock.
(_U_dyn_register): Insert into doubly-linked list.

(Logical change 1.30)


#ifndef SRC_EIGEN_QDEBUG_H_

#define SRC_EIGEN_QDEBUG_H_

#include <iostream>
#include <QDebug>
#include <Eigen/Core>

QDebug operator<<(QDebug dbg, const Eigen::Vector2f &vector)
{
  dbg << "[" << vector.x() << "|" << vector.y() << "]";

  return dbg.maybeSpace();
}

QDebug operator<<(QDebug dbg, const Eigen::Vector3f &vector)
{
  dbg << "[" << vector.x() << "|" << vector.y() << "|" << vector.z() << "]";

  return dbg.maybeSpace();
}

QDebug operator<<(QDebug dbg, const Eigen::Matrix4f &vector)
{
  const Eigen::IOFormat cleanFormat(4, 0, ", ", "\n", "[", "]");
  std::stringstream stream;
  stream << vector.format(cleanFormat);
  dbg << stream.str().c_str();

  return dbg.maybeSpace();
}

#endif  // SRC_EIGEN_QDEBUG_H_

Add overloads for qDebug << and some eigen types.


#define MODULE_API_REVISION 1

struct api_version {
    int rev;
    size_t mi_size;
};

struct moduleinfo {
    const char *name;
    struct api_version ver;
};

#define MI_VER_INIT(sname) {.rev = MODULE_API_REVISION, .mi_size = sizeof(sname)}

#define MODULE_API_REVISION 2

struct rtpp_cfg_stable;
struct rtpp_module_priv;
struct rtpp_accounting;

DEFINE_METHOD(rtpp_cfg_stable, rtpp_module_ctor, struct rtpp_module_priv *);
DEFINE_METHOD(rtpp_module_priv, rtpp_module_dtor, void);
DEFINE_METHOD(rtpp_module_priv, rtpp_module_on_session_end, void,
  struct rtpp_accounting *);

struct api_version {
    int rev;
    size_t mi_size;
};

struct moduleinfo {
    const char *name;
    struct api_version ver;
    rtpp_module_ctor_t ctor;
    rtpp_module_dtor_t dtor;
    rtpp_module_on_session_end_t on_session_end;
};

#define MI_VER_INIT(sname) {.rev = MODULE_API_REVISION, .mi_size = sizeof(sname)}
#define MI_VER_CHCK(sname, sptr) ((sptr)->ver.rev == MODULE_API_REVISION && \
  (sptr)->ver.mi_size == sizeof(sname))

Define constructor, destructor and on_session_end methods.


//
//  Use this file to import your target's public headers that you would like to expose to Swift.
//

#import "DetailViewController.h"
#import "LoremIpsum.h"

//
//  Use this file to import your target's public headers that you would like to expose to Swift.
//
//  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 "DetailViewController.h"
#import "LoremIpsum.h"

Add license to bridging header

Add license to bridging header


#include <clib/dos_protos.h>
#include <inline/dos_protos.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <exec/execbase.h>
#include <graphics/gfxbase.h>

#include "system/check.h"

bool SystemCheck() {
  bool kickv40 = (SysBase->LibNode.lib_Version >= 40) ? TRUE : FALSE;
  bool chipaga = (GfxBase->ChipRevBits0 & (GFXF_AA_ALICE|GFXF_AA_LISA)) ? TRUE : FALSE;
  bool cpu68040 = (SysBase->AttnFlags & AFF_68040) ? TRUE : FALSE;
  bool fpu68882 = (SysBase->AttnFlags & AFF_68882) ? TRUE : FALSE;

  Printf("System check:\n");
  Printf(" - Kickstart v40 : %s\n", kickv40 ? "yes" : "no");
  Printf(" - ChipSet AGA : %s\n", chipaga ? "yes" : "no");
  Printf(" - CPU 68040 : %s\n", cpu68040 ? "yes" : "no");
  Printf(" - FPU 68882 : %s\n", fpu68882 ? "yes" : "no");

  return (kickv40 && cpu68040 && fpu68882 && chipaga);
}

#include <clib/dos_protos.h>
#include <inline/dos_protos.h>
#include <proto/dos.h>
#include <proto/exec.h>
#include <proto/graphics.h>
#include <exec/execbase.h>
#include <graphics/gfxbase.h>

#include "system/check.h"

bool SystemCheck() {
  bool kickv40 = SysBase->LibNode.lib_Version >= 40;
  bool chipaga = GfxBase->ChipRevBits0 & (GFXF_AA_ALICE|GFXF_AA_LISA);
  bool cpu68040 = SysBase->AttnFlags & AFF_68040;
  bool fpu68882 = SysBase->AttnFlags & AFF_68882;

  Printf("System check:\n");
  Printf(" - Kickstart v40 : %s\n", kickv40 ? "yes" : "no");
  Printf(" - ChipSet AGA : %s\n", chipaga ? "yes" : "no");
  Printf(" - CPU 68040 : %s\n", cpu68040 ? "yes" : "no");
  Printf(" - FPU 68882 : %s\n", fpu68882 ? "yes" : "no");

  return (kickv40 && cpu68040 && fpu68882 && chipaga);
}

Remove explicit conversion to boolean value.


/**
* @mainpage
*
* This is an automatically generated API documentation for the @c cpp-bencoding project.
*/

// Document the bencoding namespace (there is no better place).
/// @namespace bencoding Main namespace of the bencoding library.

Add a documentation for the bencoding namespace.


/*!
  \file state.h
  \brief The definition and its controls for a state monad.
 */
#ifndef FUNCTIONAL_STATE_H_
#define FUNCTIONAL_STATE_H_

#include <functional>
#include <type_traits>
#include <utility>

namespace functional {

template <typename S, typename T>
using State = std::function<std::pair<T, S>(S)>;

template <typename T, typename S, typename F>
constexpr functional::State<S, T> make_state(F f)
  { return functional::State<S, T>(f); }

template <typename T, typename S, typename F>
constexpr typename std::result_of<F(T)>::type bind(
  functional::State<S, T> state, F f
) {
  return typename std::result_of<F(T)>::type(
    [state, f](S s) {
      auto new_state = state(std::move(s));
      return f(std::move(new_state.first))(std::move(new_state.second));
    }
  );
}

template <typename T, typename S, typename F, typename... Args>
constexpr typename std::result_of<F(T, Args...)>::type bind(
  functional::State<S, T> state, F f, Args&&... args
) {
  return typename std::result_of<F(T, Args...)>::type(
    [&, state, f](S s) {
      auto g = std::bind(f, std::placeholders::_1, std::forward<Args>(args)...);
      auto new_state = state(std::move(s));
      return g(std::move(new_state.first))(std::move(new_state.second));
    }
  );
}

template <typename T, typename S, typename F>
constexpr auto bind_void(functional::State<S, T> state, F f) -> decltype(f()) {
  return decltype(f())(
    [state, f](S s) {
      auto new_state = state(std::move(s));
      return f()(std::move(new_state.second));
    }
  );
}

template <typename T, typename S, typename F, typename... Args>
constexpr auto bind_void(
  functional::State<S, T> state, F f, Args&&... args
) -> decltype(f(args...)) {
  return decltype(f(args...))(
    [&, state, f](S s) {
      auto g = std::bind(f, std::forward<Args>(args)...);
      auto new_state = state(std::move(s));
      return g()(std::move(new_state.second));
    }
  );
}

template <typename T, typename S, typename F>
constexpr functional::State<S, T> fmap(functional::State<S, T> state, F f) {
  return functional::make_state<T, S>(
    [state, f](S s) {
      auto new_state = state(std::move(s));
      return std::make_pair(
        std::move(f(new_state.first)), std::move(new_state.second)
      );
    }
  );
}

} // namespace functional

#endif

Add functional::State and its controls.

Add functional::State and its controls.


#pragma once

#include <memory>

#include "xchainer/array.h"
#include "xchainer/device.h"
#include "xchainer/scalar.h"

namespace xchainer {

class Backend {
public:
    virtual ~Backend() = default;

    virtual std::shared_ptr<void> Allocate(const Device& device, size_t bytesize) = 0;
    virtual void MemoryCopy(void* dst_ptr, const void* src_ptr, size_t bytesize) = 0;
    virtual std::shared_ptr<void> FromBuffer(const Device& device, const std::shared_ptr<void>& src_ptr, size_t bytesize) = 0;

    virtual void Fill(Array& out, Scalar value) = 0;

    virtual void Add(const Array& lhs, const Array& rhs, Array& out) = 0;
    virtual void Mul(const Array& lhs, const Array& rhs, Array& out) = 0;

    virtual void Synchronize() = 0;
};

}  // namespace xchainer

#pragma once

#include <memory>

#include "xchainer/array.h"
#include "xchainer/device.h"
#include "xchainer/scalar.h"

namespace xchainer {

class Backend {
public:
    virtual ~Backend() = default;

    // Allocates a memory chunk on the specified device.
    virtual std::shared_ptr<void> Allocate(const Device& device, size_t bytesize) = 0;

    // Copies the data between two memory chunks.
    virtual void MemoryCopy(void* dst_ptr, const void* src_ptr, size_t bytesize) = 0;

    // Creates a data buffer filled with the specified data on the specified device.
    //
    // It may allocate a new memory or return an alias.
    // src_ptr is guaranteed to reside in the main RAM.
    virtual std::shared_ptr<void> FromBuffer(const Device& device, const std::shared_ptr<void>& src_ptr, size_t bytesize) = 0;

    virtual void Fill(Array& out, Scalar value) = 0;

    virtual void Add(const Array& lhs, const Array& rhs, Array& out) = 0;
    virtual void Mul(const Array& lhs, const Array& rhs, Array& out) = 0;

    virtual void Synchronize() = 0;
};

}  // namespace xchainer

Comment on Backend member functions

Comment on Backend member functions


////////////////////////////////////////////////////////////////////////////////
//
//  EXPANZ
//  Copyright 2008-2011 EXPANZ
//  All Rights Reserved.
//
//  NOTICE: Expanz permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

#import <Foundation/Foundation.h>
#import "xcode_AbstractDefinition.h"
#import "XcodeSourceFileType.h"

@interface xcode_SourceFileDefinition : xcode_AbstractDefinition;

@property(nonatomic, strong, readonly) NSString* sourceFileName;
@property(nonatomic, strong, readonly) NSData* data;
@property(nonatomic, readonly) XcodeSourceFileType type;

+ (xcode_SourceFileDefinition*) sourceDefinitionWithName:(NSString*)name text:(NSString*)text
        type:(XcodeSourceFileType)type;

+ (xcode_SourceFileDefinition*) sourceDefinitionWithName:(NSString*)name data:(NSData*)data
        type:(XcodeSourceFileType)type;

- (id) initWithName:(NSString*)name text:(NSString*)text type:(XcodeSourceFileType)type;

- (id) initWithName:(NSString*)name data:(NSData*)data type:(XcodeSourceFileType)type;

@end
/* ================================================================================================================== */
@compatibility_alias SourceFileDefinition xcode_SourceFileDefinition;

////////////////////////////////////////////////////////////////////////////////
//
//  EXPANZ
//  Copyright 2008-2011 EXPANZ
//  All Rights Reserved.
//
//  NOTICE: Expanz permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

#import <Foundation/Foundation.h>
#import "xcode_AbstractDefinition.h"
#import "XcodeSourceFileType.h"

@interface xcode_SourceFileDefinition : xcode_AbstractDefinition {

    NSString* _sourceFileName;
    XcodeSourceFileType _type;
    NSData* _data;

}

@property(nonatomic, strong, readonly) NSString* sourceFileName;
@property(nonatomic, strong, readonly) NSData* data;
@property(nonatomic, readonly) XcodeSourceFileType type;

+ (xcode_SourceFileDefinition*) sourceDefinitionWithName:(NSString*)name text:(NSString*)text
        type:(XcodeSourceFileType)type;

+ (xcode_SourceFileDefinition*) sourceDefinitionWithName:(NSString*)name data:(NSData*)data
        type:(XcodeSourceFileType)type;

- (id) initWithName:(NSString*)name text:(NSString*)text type:(XcodeSourceFileType)type;

- (id) initWithName:(NSString*)name data:(NSData*)data type:(XcodeSourceFileType)type;

@end
/* ================================================================================================================== */
@compatibility_alias SourceFileDefinition xcode_SourceFileDefinition;

Fix to allow compile under 32 bit.

Fix to allow compile under 32 bit.


// PARAM: --enable ana.int.interval
#include <pthread.h>
#include <assert.h>

// global priv succeeds
// global-history fails due to [1,+inf] widen ([1,+inf] join [0,+inf]) -> [-inf,+inf]
// sensitive to eval and widen order!

int g = 0;
int limit; // unknown

pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;

void *worker(void *arg )
{
  // just for going to multithreaded mode
  return NULL;
}

int put() {
  pthread_mutex_lock(&A);
  while (g >= limit) { // problematic widen

  }
  assert(g >= 0);
  g++;
  pthread_mutex_unlock(&A);
}

int main(int argc , char **argv )
{
  pthread_t tid;
  pthread_create(& tid, NULL, & worker, NULL);

  int r;
  limit = r; // only problematic if limit unknown

  while (1) {
    // only problematic if not inlined
    put();
  }
  return 0;
}

Add regression tests where global is more precise than global-history due to non-side widen order


#ifndef LAND_H
#define LAND_H

#include <string>
#include "Plant.h"

class Land
{
	public:
		~Land();
		bool put(Plant & plant);
		bool getStood()const{return isStood_;}
		Plant & getPlant() { return *plant_; }
		const Plant & getPlant() const { return *plant_; }

	private:
		Plant * plant_ = nullptr;
		bool isStood_ = false;
};

#endif // LAND_H

#ifndef MAP_H
#define MAP_H

#include <vector>

class Map
{
	public:
		// with this constructor, you could get a map with [land_num] empty land
		Map(int land_num);

		Land operator[] (int i) { return lands_[i]; }
		const Land operator[] (int i) const { return lands_[i]; }

		int size() { return lands_.size(); }
		bool put(Plant & plant, int position) { return lands_[position].put(plant); }

	private:
		constexpr static int max_land_num = 10;
		std::vector<Land> lands_;
};

#endif // MAP_H

#ifndef LAND_H
#define LAND_H

#include <string>
#include "Plant.h"

class Land
{
	public:
		~Land();
		bool put(Plant & plant);
		bool getStood()const{return isStood_;}
		Plant * getPlant() { return plant_; }
		const Plant * getPlant() const { return plant_; }

	private:
		Plant * plant_ = nullptr;
		bool isStood_ = false;
};

#endif // LAND_H

#ifndef MAP_H
#define MAP_H

#include <vector>

class Map
{
	public:
		// with this constructor, you could get a map with [land_num] empty land
		Map(int land_num);

		Land operator[] (int i) { return lands_[i]; }
		const Land operator[] (int i) const { return lands_[i]; }

		int size() { return lands_.size(); }
		bool put(Plant & plant, int position) { return lands_[position].put(plant); }

	private:
		constexpr static int max_land_num = 10;
		std::vector<Land> lands_;
};

#endif // MAP_H

Make Land getPlant return pointer

Make Land getPlant return pointer


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

#ifndef VISTK_PYTHON_HELPERS_PYTHON_WRAP_VIL_SMART_PTR_H
#define VISTK_PYTHON_HELPERS_PYTHON_WRAP_VIL_SMART_PTR_H

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

#include <vil/vil_smart_ptr.h>

namespace boost
{

namespace python
{

template <typename T>
inline
T*
get_pointer(vil_smart_ptr<T> const& p)
{
  return p.ptr();
}

template <typename T>
struct pointee<vil_smart_ptr<T> >
{
  typedef T type;
};

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

}

}

#endif // VISTK_PYTHON_HELPERS_PYTHON_WRAP_VIL_SMART_PTR_H

Add a pointer wrapper for vil_smart_ptr

Add a pointer wrapper for vil_smart_ptr


Use azy_server_run as a replacement for ecore_main_loop_begin


//
// react-objc - a library for functional-reactive-like programming
// https://github.com/tconkling/react-objc/blob/master/LICENSE

#import "RAConnection.h"
#import "RAConnectionGroup.h"
#import "RABoolSignal.h"
#import "RABoolValue.h"
#import "RADoubleSignal.h"
#import "RADoubleValue.h"
#import "RAFloatSignal.h"
#import "RAFloatValue.h"
#import "RAIntSignal.h"
#import "RAIntValue.h"
#import "RAObjectSignal.h"
#import "RAObjectValue.h"
#import "RAUnitSignal.h"
#import "RAFuture.h"
#import "RAPromise.h"
#import "RAMultiFailureError.h"
#import "RATry.h"
#import "RAMappedSignal.h"

//
// react-objc - a library for functional-reactive-like programming
// https://github.com/tconkling/react-objc/blob/master/LICENSE

#import "RAConnection.h"
#import "RAConnectionGroup.h"
#import "RABoolSignal.h"
#import "RABoolValue.h"
#import "RADoubleSignal.h"
#import "RADoubleValue.h"
#import "RAFloatSignal.h"
#import "RAFloatValue.h"
#import "RAIntSignal.h"
#import "RAIntValue.h"
#import "RAObjectSignal.h"
#import "RAObjectValue.h"
#import "RAStringSignal.h"
#import "RAStringValue.h"
#import "RAUnitSignal.h"
#import "RAFuture.h"
#import "RAPromise.h"
#import "RAMultiFailureError.h"
#import "RATry.h"
#import "RAMappedSignal.h"

Add RAStringSignal and RAStringValue to header


/*
 *    Copyright (c) 2010-2014, Delft University of Technology
 *    Copyright (c) 2010-2014, K. Kumar (me@kartikkumar.com)
 *    All rights reserved.
 *    See http://bit.ly/1jern3m for license details.
 */

#ifndef ASSIST_INPUT_OUTPUT_H
#define ASSIST_INPUT_OUTPUT_H

#include <string>

namespace assist
{
namespace input_output
{

//! Get root-path for Assist directory.
/*!
 * Returns root-path corresponding with root-directory of Assist as a string with
 * trailing slash included.
 * \return Assist root-path.
 */
static inline std::string getAssistRootPath( )
{
#ifdef ASSIST_CUSTOM_ROOT_PATH
    return std::string( ASSIST_CUSTOM_ROOT_PATH );
#else
    // Declare file path string assigned to filePath.
    // __FILE__ only gives the absolute path in the header file!
    std::string filePath_( __FILE__ );

    // Strip filename from temporary string and return root-path string.
    return filePath_.substr( 0, filePath_.length( ) -
                                std::string( "InputOutput/rootPath.h" ).length( ) );
#endif
}

} // namespace input_output
} // namespace assist

#endif // ASSIST_INPUT_OUTPUT_H

/*
 *    Copyright (c) 2010-2014, Delft University of Technology
 *    Copyright (c) 2010-2014, K. Kumar (me@kartikkumar.com)
 *    All rights reserved.
 *    See http://bit.ly/1jern3m for license details.
 */

#ifndef ASSIST_ROOT_PATH_H
#define ASSIST_ROOT_PATH_H

#include <string>

namespace assist
{
namespace input_output
{

//! Get root-path for Assist directory.
/*!
 * Returns root-path corresponding with root-directory of Assist as a string with
 * trailing slash included.
 * \return Assist root-path.
 */
static inline std::string getAssistRootPath( )
{
#ifdef ASSIST_CUSTOM_ROOT_PATH
    return std::string( ASSIST_CUSTOM_ROOT_PATH );
#else
    // Declare file path string assigned to filePath.
    // __FILE__ only gives the absolute path in the header file!
    std::string filePath_( __FILE__ );

    // Strip filename from temporary string and return root-path string.
    return filePath_.substr( 0, filePath_.length( ) -
                                std::string( "InputOutput/rootPath.h" ).length( ) );
#endif
}

} // namespace input_output
} // namespace assist

#endif // ASSIST_ROOT_PATH_H

Update header include guard for root-path file.


#ifndef TA_ADDDATASOURCEPARAM_PRIV_H
#define TA_ADDDATASOURCEPARAM_PRIV_H

/* The following is a private copy of the user provided
 * parameters for a TA_AddDataSource call.
 *
 * Code is in 'ta_data_interface.c'
 */
typedef struct
{
  TA_SourceId   id;
  TA_SourceFlag flags;
  TA_Period     period;

  TA_String *location;
  TA_String *info;
  TA_String *username;
  TA_String *password;
  TA_String *category;
  TA_String *country;
  TA_String *exchange;
  TA_String *type;
  TA_String *symbol;
  TA_String *name;
} TA_AddDataSourceParamPriv;

/* Function to alloc/free a TA_AddDataSourceParamPriv. */
TA_AddDataSourceParamPriv *TA_AddDataSourceParamPrivAlloc( const TA_AddDataSourceParam *param );

TA_RetCode TA_AddDataSourceParamPrivFree( TA_AddDataSourceParamPriv *toBeFreed );

#endif

#ifndef TA_ADDDATASOURCEPARAM_PRIV_H
#define TA_ADDDATASOURCEPARAM_PRIV_H

/* The following is a private copy of the user provided
 * parameters for a TA_AddDataSource call.
 *
 * Code is in 'ta_data_interface.c'
 */
typedef struct
{
  TA_SourceId   id;
  TA_SourceFlag flags;
  TA_Period     period;

  TA_String *location;
  TA_String *info;
  TA_String *username;
  TA_String *password;
  TA_String *category;
  TA_String *country;
  TA_String *exchange;
  TA_String *type;
  TA_String *symbol;
  TA_String *name;
} TA_AddDataSourceParamPriv;

#endif

Remove function prototype that are now static in ta_data_interface.c

git-svn-id: 33305d871a58cfd02b407b81d5206d2a785211eb@618 159cb52c-178a-4f3c-8eb8-d0aff033d058


// RUN: %clang_cc1 -fsyntax-only -Wall -pedantic -verify %s
// RUN: cp %s %t
// RUN: cp %S/fixit-include.h %T
// RUN: not %clang_cc1 -fsyntax-only -fixit %t
// RUN: %clang_cc1 -Wall -pedantic %t

#include <fixit-include.h> // expected-error {{'fixit-include.h' file not found with <angled> include; use "quotes" instead}}

#pragma does_not_exist // expected-warning {{unknown pragma ignored}}

int main( void ) {
  return 0;
}

Remove dos line endings. Please remember to configure your windows SVN
clients to default text files to 'eol-native'.

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


#include <stdio.h>
#include <stdlib.h>
#include "../brk.h"
#include <unistd.h>
#include "clock.h"

int main(int argc, char *argv[]) {
  int nbytes = 5;
  void **ptrs;
  long num;
  long i;

  num = atol(argv[1]);

  ptrs = malloc(sizeof(void*) * num);

  for(i = 0; i < num; i++) {
    ptrs[i] = malloc(nbytes);
    malloc(1);
  }

  for(i = 0; i < num; i++) {
    free(ptrs[i]);
  }

  _reset_clock();
  for(i = 0; i < num; i++) {
    _resume();
    ptrs[i] = malloc(nbytes + 1);
    _pause();
  }

  _print_elapsed_time();

  return 0;
}

#include <stdio.h>
#include <stdlib.h>
#include "../brk.h"
#include <unistd.h>
#include "clock.h"

#define MIN_ALLOC (1024)
#define HEADER_SIZE (16)

int main(int argc, char *argv[]) {
  void **ptrs;
  long num;
  long i;

  int small_malloc = HEADER_SIZE;
  int medium_malloc = (MIN_ALLOC - 3) * HEADER_SIZE;
  int large_malloc = (MIN_ALLOC - 1) * HEADER_SIZE;

  num = atol(argv[1]);

  ptrs = malloc(sizeof(void*) * num);

  for(i = 0; i < num; i++) {
    ptrs[i] = malloc(medium_malloc);
    malloc(small_malloc);
  }

  for(i = 0; i < num; i++) {
    free(ptrs[i]);
  }

  _reset_clock();
  for(i = 0; i < num; i++) {
    _resume();
    ptrs[i] = malloc(large_malloc);
    _pause();
  }

  _print_elapsed_time();

  return 0;
}

Make worst case actual worst case.

Make worst case actual worst case.


/* Define the real-function versions of all inline functions
   defined in signal.h (or bits/sigset.h).  */

#include <features.h>

#define _EXTERN_INLINE
#ifndef __USE_EXTERN_INLINES
# define __USE_EXTERN_INLINES	1
#endif

#include "signal.h"

/* Define the real-function versions of all inline functions
   defined in signal.h (or bits/sigset.h).  */

#include <features.h>

#define _EXTERN_INLINE
#ifndef __USE_EXTERN_INLINES
# define __USE_EXTERN_INLINES	1
#endif

#include <signal.h>

Use <> instead of \"\"

Use <> instead of \"\"


#ifndef PUT_INDIVIDUAL_CONTEXT_ENTITY_ATTRIBUTE_H
#define 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 <string>
#include <vector>

#include "rest/ConnectionInfo.h"
#include "ngsi/ParseData.h"

/* ****************************************************************************
*
* putIndividualContextEntityAttribute -
*/
extern std::string putIndividualContextEntityAttribute(ConnectionInfo* ciP, int components, std::vector<std::string> compV, ParseData* parseDataP);

#endif

#ifndef PUT_INDIVIDUAL_CONTEXT_ENTITY_ATTRIBUTE_H
#define 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 <string>
#include <vector>

#include "rest/ConnectionInfo.h"
#include "ngsi/ParseData.h"

/* ****************************************************************************
*
* putIndividualContextEntityAttribute -
*/
extern std::string putIndividualContextEntityAttribute(ConnectionInfo* ciP, int components, std::vector<std::string> compV, ParseData* parseDataP);

#endif

Change date of copyright notice

Change date of copyright notice


#ifndef PROBLEM_H
#define PROBLEM_H

#include "sense.h"

class Problem {
  public:
    int objcnt; // Number of objectives
    double* rhs;
    int** objind; // Objective indices
    double** objcoef; // Objective coefficients
    Sense objsen; // Objective sense. Note that all objectives must have the same
                // sense (i.e., either all objectives are to be minimised, or
                // all objectives are to be maximised).
    int* conind;
    char* consense;

    ~Problem();

};

inline Problem::~Problem() {
  for(int j = 0; j < objcnt; ++j) {
    delete[] objind[j];
    delete[] objcoef[j];
  }
  delete[] objind;
  delete[] objcoef;
  delete[] rhs;
  delete[] conind;
  delete[] consense;
}
#endif /* PROBLEM_H */

#ifndef PROBLEM_H
#define PROBLEM_H

#include "sense.h"

class Problem {
  public:
    int objcnt; // Number of objectives
    double* rhs;
    int** objind; // Objective indices
    double** objcoef; // Objective coefficients
    Sense objsen; // Objective sense. Note that all objectives must have the same
                // sense (i.e., either all objectives are to be minimised, or
                // all objectives are to be maximised).
    int* conind;
    char* consense;

    Problem();
    ~Problem();

};

inline Problem::Problem() : objcnt(0) { }

inline Problem::~Problem() {
  // If objcnt == 0, then no problem has been assigned and no memory allocated
  if (objcnt == 0)
    return;
  for(int j = 0; j < objcnt; ++j) {
    delete[] objind[j];
    delete[] objcoef[j];
  }
  delete[] objind;
  delete[] objcoef;
  delete[] rhs;
  delete[] conind;
  delete[] consense;
}
#endif /* PROBLEM_H */

Fix invalid delete[] calls in ~Problem

Fix invalid delete[] calls in ~Problem

If objcnt is 0, then no memory has been allocated.


#ifndef _version_h_
# define _version_h_

# define PROGRAM_NAME "xyzzy"
# define PROGRAM_COPYRIGHT "Copyright (C) 1996-2005 T.Kamei"

# define PROGRAM_MAJOR_VERSION 0
# define PROGRAM_MINOR_VERSION 2
# define PROGRAM_MAJOR_REVISION 3
# define PROGRAM_MINOR_REVISION 5
# define PROGRAM_PATCH_LEVEL 0

# define TITLE_BAR_STRING_SIZE 256
extern char TitleBarString[];
extern const char VersionString[];
extern const char DisplayVersionString[];
extern const char ProgramName[];
extern const char ProgramNameWithVersion[];

#endif

#ifndef _version_h_
# define _version_h_

# define PROGRAM_NAME "xyzzy"
# define PROGRAM_COPYRIGHT "Copyright (C) 1996-2005 T.Kamei"

# define PROGRAM_MAJOR_VERSION 0
# define PROGRAM_MINOR_VERSION 2
# define PROGRAM_MAJOR_REVISION 3
# define PROGRAM_MINOR_REVISION 5
# define PROGRAM_PATCH_LEVEL 1

# define TITLE_BAR_STRING_SIZE 256
extern char TitleBarString[];
extern const char VersionString[];
extern const char DisplayVersionString[];
extern const char ProgramName[];
extern const char ProgramNameWithVersion[];

#endif

Update patch level for update test.

Update patch level for update test.


/*
 * This file is part of Kotaka, a mud library for DGD
 * http://github.com/shentino/kotaka
 *
 * Copyright (C) 2013  Raymond Jennings
 *
 * This program 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.
 *
 * This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include <kotaka/paths.h>

#include <account/paths.h>
#include <text/paths.h>
#include <game/paths.h>

inherit LIB_RAWVERB;

void main(object actor, string args)
{
	string owner;
	mapping seen;
	object first;
	object obj;

	if (query_user()->query_class() < 2) {
		send_out("Only a wizard can list objregd.\n");
		return;
	}

	seen = ([ ]);
	first = KERNELD->first_link(args);

	if (!first) {
		send_out(args + " owns no objects.\n");
		return;
	}

	obj = first;

	send_out("Objects owned by " + args + ":\n");

	do {
		send_out(object_name(obj) + "\n");

		seen[obj] = 1;
		obj = KERNELD->next_link(obj);

		if (!obj) {
			send_out("nil\n");
			break;
		}
	} while (!seen[obj]);
}

Add command to list all objects owned by a given user


#ifndef _PKG_ERROR_H
#define _PKG_ERROR_H

#ifdef DEBUG
#	define pkg_error_set(code, fmt, ...) \
		_pkg_error_set(code, fmt " [at %s:%d]", ##__VA_ARGS__, __FILE__, __LINE__)
#else
#	define pkg_error_set _pkg_error_set
#endif

#define ERROR_BAD_ARG(name) \
	pkg_error_set(EPKG_FATAL, "Bad argument `%s` in %s", name, __FUNCTION__)

#define ERROR_SQLITE(db) \
	pkg_error_set(EPKG_FATAL, "%s (sqlite at %s:%d)", sqlite3_errmsg(db), __FILE__, __LINE__)

pkg_error_t _pkg_error_set(pkg_error_t, const char *, ...);

#endif

#ifndef _PKG_ERROR_H
#define _PKG_ERROR_H

#ifdef DEBUG
#	define pkg_error_set(code, fmt, ...) \
		_pkg_error_set(code, fmt " [at %s:%d]", ##__VA_ARGS__, __FILE__, __LINE__)
#else
#	define pkg_error_set _pkg_error_set
#endif

#define ERROR_BAD_ARG(name) \
	pkg_error_set(EPKG_FATAL, "Bad argument `%s` in %s", name, __FUNCTION__)

#define ERROR_SQLITE(db) \
	pkg_error_set(EPKG_FATAL, "%s (sqlite)", sqlite3_errmsg(db))

pkg_error_t _pkg_error_set(pkg_error_t, const char *, ...);

#endif

Revert "Indicate the location of sqlite failures."

This reverts commit 2686383409d98488ae7b2c39d531af9ef380e21a.


// RUN: %clang_cc1 -triple arm64-apple-darwin -target-feature +neon -fsyntax-only -ffreestanding -verify %s

#include <arm_neon.h>

// rdar://13527900
void vcopy_reject(float32x4_t vOut0, float32x4_t vAlpha, int t) {
  vcopyq_laneq_f32(vOut0, 1, vAlpha, t); // expected-error {{argument to '__builtin_neon_vgetq_lane_f32' must be a constant integer}} expected-error {{initializing 'float32_t' (aka 'float') with an expression of incompatible type 'void'}}
}

// rdar://problem/15256199
float32x4_t test_vmlsq_lane(float32x4_t accum, float32x4_t lhs, float32x2_t rhs) {
  return vmlsq_lane_f32(accum, lhs, rhs, 1);
}

// RUN: %clang_cc1 -triple arm64-apple-darwin -target-feature +neon -fsyntax-only -ffreestanding -verify %s
// RUN: %clang_cc1 -triple arm64_be-none-linux-gnu -target-feature +neon -fsyntax-only -ffreestanding -verify %s

#include <arm_neon.h>

// rdar://13527900
void vcopy_reject(float32x4_t vOut0, float32x4_t vAlpha, int t) {
  vcopyq_laneq_f32(vOut0, 1, vAlpha, t); // expected-error {{argument to '__builtin_neon_vgetq_lane_f32' must be a constant integer}} expected-error {{initializing 'float32_t' (aka 'float') with an expression of incompatible type 'void'}}
}

// rdar://problem/15256199
float32x4_t test_vmlsq_lane(float32x4_t accum, float32x4_t lhs, float32x2_t rhs) {
  return vmlsq_lane_f32(accum, lhs, rhs, 1);
}

Add a test for big-endian NEON on ARM64.

The enabled test #includes <arm_neon.h>, which is sufficient to test all
the code in r207624.

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


/* USB commands use the first byte as the 'type' variable.
 * Subsequent bytes are generally the 'arguments'.
 * So host->device usb packets usually look like:
 * [command, arg1, arg2, 0, 0, ... , 0, 0]
 * to which the device will respond with
 * [CMD_ACK, command, 0, 0, 0 ..., 0, 0]
 *
 * The exception to this, are the commands which 'GET'
 * For them host->device generally looks like:
 * [command, 0, ..., 0, 0]
 * to which the device responds
 * [CMD_RESP, command, arg1, arg2, 0, ..., 0, 0]
 * */

#ifndef USB_COMMANDS_H
#define USB_COMMANDS_H

#define CMD_ACK          0xAF
#define CMD_RESP         0xBF

#define CMD_BL_ON        0x10
#define CMD_BL_OFF       0x11
#define CMD_BL_LEVEL     0x12
#define CMD_BL_UP        0x13
#define CMD_BL_DOWN      0x14
#define CMD_BL_GET_STATE 0x1F

#define CMD_RGB_SET      0x20
#define CMD_RGB_GET      0x2F

#endif

Document the usb protocol (ish)

Document the usb protocol (ish)


#ifndef DICT2_CLASSN_H
#define DICT2_CLASSN_H

#include "ClassI.h"
#include "ClassL.h"

class ClassN: /* public ClassI, */ public ClassL {
 public:
  ClassN() : fN('n') {}
  virtual ~ClassN() {}
  int n() { return fN; }
  void setN(int v) { fN = v; }
 private:
  int fN;
};

#endif // DICT2_CLASSN_H

Test class to check for ambiguities in the dictionary source code in case of
non virtual diamonds

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@16987 27541ba8-7e3a-0410-8455-c3a389f83636


#define CODE_EXPANDER
#include <system.h>
#include "back.h"
#include "mach.h"

#ifdef DEBUG
arg_error( s, arg)
char *s;
int arg;
{
	fprint( STDERR, "arg_error %s %d\n", s, arg);
}
#endif

int push_waiting = FALSE;

int fit_byte( val)
int val;
{
	return( val >= -128 && val <= 127);
}

#include <con_float>

#define CODE_EXPANDER
#include <system.h>
#include "back.h"
#include "mach.h"

#ifdef DEBUG
arg_error( s, arg)
char *s;
int arg;
{
	fprint( STDERR, "arg_error %s %d\n", s, arg);
}
#endif

int push_waiting = FALSE;

int fit_byte( val)
int val;
{
	return( val >= -128 && val <= 127);
}

#define IEEEFLOAT
#define FL_MSL_AT_LOW_ADDRESS	0
#define FL_MSW_AT_LOW_ADDRESS	0
#define FL_MSB_AT_LOW_ADDRESS	0
#include <con_float>

Use Intel byte order for floating point

Use Intel byte order for floating point


#ifndef SECURITY_BUFFER_DESCRIPTOR_H
#define SECURITY_BUFFER_DESCRIPTOR_H

#include <node.h>
#include <node_object_wrap.h>
#include <v8.h>

#include <windows.h>
#include <sspi.h>
#include "nan.h"

using namespace v8;
using namespace node;

class SecurityBufferDescriptor : public ObjectWrap {
  public:
    Local<Array> arrayObject;
    SecBufferDesc secBufferDesc;

    SecurityBufferDescriptor();
    SecurityBufferDescriptor(const Persistent<Array>& arrayObjectPersistent);
    ~SecurityBufferDescriptor();

    // Has instance check
    static inline bool HasInstance(Handle<Value> val) {
      if (!val->IsObject()) return false;
      Local<Object> obj = val->ToObject();
      return NanNew(constructor_template)->HasInstance(obj);
    };

    char *toBuffer();
    size_t bufferSize();

    // Functions available from V8
    static void Initialize(Handle<Object> target);
    static NAN_METHOD(ToBuffer);

    // Constructor used for creating new Long objects from C++
    static Persistent<FunctionTemplate> constructor_template;

  private:
    static NAN_METHOD(New);
};

#endif

#ifndef SECURITY_BUFFER_DESCRIPTOR_H
#define SECURITY_BUFFER_DESCRIPTOR_H

#include <node.h>
#include <node_object_wrap.h>
#include <v8.h>

#include <WinSock2.h>
#include <windows.h>
#include <sspi.h>
#include "nan.h"

using namespace v8;
using namespace node;

class SecurityBufferDescriptor : public ObjectWrap {
  public:
    Local<Array> arrayObject;
    SecBufferDesc secBufferDesc;

    SecurityBufferDescriptor();
    SecurityBufferDescriptor(const Persistent<Array>& arrayObjectPersistent);
    ~SecurityBufferDescriptor();

    // Has instance check
    static inline bool HasInstance(Handle<Value> val) {
      if (!val->IsObject()) return false;
      Local<Object> obj = val->ToObject();
      return NanNew(constructor_template)->HasInstance(obj);
    };

    char *toBuffer();
    size_t bufferSize();

    // Functions available from V8
    static void Initialize(Handle<Object> target);
    static NAN_METHOD(ToBuffer);

    // Constructor used for creating new Long objects from C++
    static Persistent<FunctionTemplate> constructor_template;

  private:
    static NAN_METHOD(New);
};

#endif

Fix windows build issue for node v0.12

Fix windows build issue for node v0.12


/*
 * BRLTTY - A background process providing access to the console screen (when in
 *          text mode) for a blind person using a refreshable braille display.
 *
 * Copyright (C) 1995-2005 by The BRLTTY Team. All rights reserved.
 *
 * BRLTTY comes with ABSOLUTELY NO WARRANTY.
 *
 * This is free software, placed under the terms of the
 * GNU General Public License, as published by the Free Software
 * Foundation.  Please see the file COPYING for details.
 *
 * Web Page: http://mielke.cc/brltty/
 *
 * This software is maintained by Dave Mielke <dave@mielke.cc>.
 */

#ifndef BRLTTY_INCLUDED_SCR_HURD
#define BRLTTY_INCLUDED_SCR_HURD

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

#define HURD_CONSDIR		"/dev/cons"
#define HURD_VCSDIR		"/dev/vcs"
#define HURD_INPUTPATH		HURD_VCSDIR "/input"
#define HURD_DISPLAYPATH	HURD_VCSDIR "/display"
#define HURD_CURVCSPATH		HURD_CONSDIR "/vcs"

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* BRLTTY_INCLUDED_SCR_HURD */

/*
 * BRLTTY - A background process providing access to the console screen (when in
 *          text mode) for a blind person using a refreshable braille display.
 *
 * Copyright (C) 1995-2005 by The BRLTTY Team. All rights reserved.
 *
 * BRLTTY comes with ABSOLUTELY NO WARRANTY.
 *
 * This is free software, placed under the terms of the
 * GNU General Public License, as published by the Free Software
 * Foundation.  Please see the file COPYING for details.
 *
 * Web Page: http://mielke.cc/brltty/
 *
 * This software is maintained by Dave Mielke <dave@mielke.cc>.
 */

#ifndef BRLTTY_INCLUDED_SCR_HURD
#define BRLTTY_INCLUDED_SCR_HURD

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

#define HURD_CONSDIR		"/dev/cons"
#define HURD_VCSDIR		"/dev/vcs"
#define HURD_INPUTPATH		HURD_VCSDIR "/%u/input"
#define HURD_DISPLAYPATH	HURD_VCSDIR "/%u/display"
#define HURD_CURVCSPATH		HURD_CONSDIR "/vcs"

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* BRLTTY_INCLUDED_SCR_HURD */

Support access to individual Hurd consoles. (st)

git-svn-id: 30a5f035a20f1bc647618dbad7eea2a951b61b7c@1435 91a5dbb7-01b9-0310-9b5f-b28072856b6e


#ifndef __MORDOR_TIMEOUT_STREAM__
#define __MORDOR_TIMEOUT_STREAM__
// Copyright (c) 2010 - Mozy, Inc.

#include "filter.h"
#include "scheduler.h"

namespace Mordor {

class TimerManager;
class Timer;

class TimeoutStream : public FilterStream
{
public:
    typedef boost::shared_ptr<TimeoutStream> ptr;

public:
    TimeoutStream(Stream::ptr parent, TimerManager &timerManager, bool own = true)
        : FilterStream(parent),
          m_timerManager(timerManager),
          m_readTimeout(~0ull),
          m_writeTimeout(~0ull)
    {}

    unsigned long long readTimeout() const { return m_readTimeout; }
    void readTimeout(unsigned long long readTimeout);
    unsigned long long writeTimeout() const { return m_writeTimeout; }
    void writeTimeout(unsigned long long writeTimeout);

    size_t read(Buffer &buffer, size_t length);
    size_t write(const Buffer &buffer, size_t length);

private:
    TimerManager &m_timerManager;
    unsigned long long m_readTimeout, m_writeTimeout;
    bool m_readTimedOut, m_writeTimedOut;
    boost::shared_ptr<Timer> m_readTimer, m_writeTimer;
    FiberMutex m_mutex;
};

}

#endif

#ifndef __MORDOR_TIMEOUT_STREAM__
#define __MORDOR_TIMEOUT_STREAM__
// Copyright (c) 2010 - Mozy, Inc.

#include "filter.h"
#include "scheduler.h"

namespace Mordor {

class TimerManager;
class Timer;

class TimeoutStream : public FilterStream
{
public:
    typedef boost::shared_ptr<TimeoutStream> ptr;

public:
    TimeoutStream(Stream::ptr parent, TimerManager &timerManager, bool own = true)
        : FilterStream(parent),
          m_timerManager(timerManager),
          m_readTimeout(~0ull),
          m_writeTimeout(~0ull),
          m_readTimedOut(true),
          m_writeTimedOut(true)
    {}

    unsigned long long readTimeout() const { return m_readTimeout; }
    void readTimeout(unsigned long long readTimeout);
    unsigned long long writeTimeout() const { return m_writeTimeout; }
    void writeTimeout(unsigned long long writeTimeout);

    size_t read(Buffer &buffer, size_t length);
    size_t write(const Buffer &buffer, size_t length);

private:
    TimerManager &m_timerManager;
    unsigned long long m_readTimeout, m_writeTimeout;
    bool m_readTimedOut, m_writeTimedOut;
    boost::shared_ptr<Timer> m_readTimer, m_writeTimer;
    FiberMutex m_mutex;
};

}

#endif

Initialize some vars so we don't register for a timer when there's not a call oustanding

Change-Id: I690bc333f35cb5aaa196d4f4bbcc11dfee4083df
Reviewed-on: https://gerrit.dechocorp.com/4912
Reviewed-by: Jeremy Stanley <8cc48e55af0ea00a29d3ccf3190022dccfb4961b@decho.com>


#include <connection_pool.h>

static void deallocate(ConnectionPool_T *pool)
{
  ConnectionPool_stop(*pool);
  ConnectionPool_free(pool);
}

/*
 * Wrap libzdb's connection pool in a ruby object
 */
static VALUE allocate(VALUE klass)
{
  ConnectionPool_T *pool;
  return Data_Wrap_Struct(klass, NULL, deallocate, pool);
}

static VALUE initialize(VALUE self, VALUE rb_string)
{
  Check_Type(rb_string, T_STRING);

  ConnectionPool_T *poolPtr;
  ConnectionPool_T pool;
  URL_T url;
  char *url_string;

  Data_Get_Struct(self, ConnectionPool_T, poolPtr);

  url_string = StringValueCStr(rb_string);
  url        = URL_new(url_string);
  pool       = ConnectionPool_new(url);

  ConnectionPool_start(pool);

  poolPtr = &pool;

  URL_free(&url);

  return self;
}

VALUE cLibzdbConnectionPool;
void init_connection_pool()
{
  VALUE libzdb = rb_define_module("Libzdb");
  VALUE klass  = rb_define_class_under(libzdb, "ConnectionPool", rb_cObject);

  cLibzdbConnectionPool = klass;

  rb_define_alloc_func(cLibzdbConnectionPool, allocate);
  rb_define_method(cLibzdbConnectionPool, "initialize", initialize, 1);
}

#include <connection_pool.h>

static void deallocate(ConnectionPool_T *pool)
{
  ConnectionPool_stop(*pool);
  ConnectionPool_free(pool);
}

static VALUE allocate(VALUE klass)
{
  ConnectionPool_T *pool = malloc(sizeof(ConnectionPool_T));
  return Data_Wrap_Struct(klass, NULL, deallocate, pool);
}

static VALUE initialize(VALUE self, VALUE rb_string)
{
  Check_Type(rb_string, T_STRING);

  ConnectionPool_T *pool;

  char *url_string = StringValueCStr(rb_string);
  URL_T url        = URL_new(url_string);

  Data_Get_Struct(self, ConnectionPool_T, pool);

  *pool = ConnectionPool_new(url);
  ConnectionPool_start(*pool);

  URL_free(&url);

  return self;
}

VALUE cLibzdbConnectionPool;
void init_connection_pool()
{
  VALUE libzdb = rb_define_module("Libzdb");
  VALUE klass  = rb_define_class_under(libzdb, "ConnectionPool", rb_cObject);

  cLibzdbConnectionPool = klass;

  rb_define_alloc_func(cLibzdbConnectionPool, allocate);
  rb_define_method(cLibzdbConnectionPool, "initialize", initialize, 1);
}

Make sure that we allocate something at our pointer and assign our init’d pool to the pointers value.


#ifndef _ANDROIDOPENGLINITEVENT_H_
#define _ANDROIDOPENGLINITEVENT_H_

#include <OpenGLInitEvent.h>
#include <android/native_window.h>

class AndroidOpenGLInitEvent : public OpenGLInitEvent {
public:
 AndroidOpenGLInitEvent(double _timestamp, int _opengl_es_version, ANativeWindow * _window)
   : OpenGLInitEvent(_timestamp, _opengl_es_version), window(_window) { }

  ANativeWindow * getWindow() { return window; }
  std::shared_ptr<EventBase> dup() const { return  std::make_shared<AndroidOpenGLInitEvent>(*this); }
  void dispatch(Element & element);

 private:
  ANativeWindow * window = 0;
};

#endif

#ifndef _ANDROIDOPENGLINITEVENT_H_
#define _ANDROIDOPENGLINITEVENT_H_

#include <OpenGLInitEvent.h>
#include <android/native_window.h>

class AndroidOpenGLInitEvent : public OpenGLInitEvent {
public:
 AndroidOpenGLInitEvent(double _timestamp, int _opengl_es_version, ANativeWindow * _window)
   : OpenGLInitEvent(_timestamp, _opengl_es_version), window(_window) { }

  ANativeWindow * getWindow() { return window; }
  std::shared_ptr<EventBase> dup() const { return  std::make_shared<AndroidOpenGLInitEvent>(*this); }
  void dispatch(Element & element) { }

 private:
  ANativeWindow * window = 0;
};

#endif

Add Todo implementation to dispatch

Add Todo implementation to dispatch


//! \file Walker.h

#ifndef _WALKER_H
#define _WALKER_H

#include "ArticleCollection.h"

//! Base class for article analyzers
class Walker
{
protected:
    //! article collection, used as cache, for walked articles
    ArticleCollection articleSet;
};

#endif // _WALKER_H

//! \file Walker.h

#ifndef _WALKER_H
#define _WALKER_H

#include "ArticleCollection.h"

//! Base class for article analyzers
class Walker
{
public:
    const ArticleCollection& getCollection() const
    {
        return articleSet;
    }

protected:
    //! article collection, used as cache, for walked articles
    ArticleCollection articleSet;
};

#endif // _WALKER_H

Add method to get const article collection in walker

  so I don't have to do everything within that class...