// This program is free software licenced under MIT Licence. You can
// find a copy of this licence in LICENCE.txt in the top directory of
// source code.
//

#ifndef BASIC_ROUND_STRATEGY_H_INCLUDED
#define BASIC_ROUND_STRATEGY_H_INCLUDED

// Project
#include "globals.h"
#include "RoundStrategy.h"

namespace warlightAi {

// Fwrd decls
class World;

class BasicRoundStrategy : public RoundStrategy
{
public:
    BasicRoundStrategy(const World &world, int availableArmies);

    VecOfPairs getDeployments() const;
    VecOfTuples getAttacks() const;

private:
    VecOfPairs m_deployments;
    VecOfTuples m_attacks;

}; // class BasicRoundStrategy

} // namespace warlightAi

#endif // BASIC_ROUND_STRATEGY_H_INCLUDED

// This program is free software licenced under MIT Licence. You can
// find a copy of this licence in LICENCE.txt in the top directory of
// source code.
//

#ifndef BASIC_ROUND_STRATEGY_H_INCLUDED
#define BASIC_ROUND_STRATEGY_H_INCLUDED

// Project
#include "globals.h"
#include "RoundStrategy.h"

namespace warlightAi {

// Fwrd decls
class World;

class BasicRoundStrategy : public RoundStrategy
{
public:
    BasicRoundStrategy(const World &world, int availableArmies);

    VecOfPairs getDeployments() const override;
    VecOfTuples getAttacks() const override;

private:
    VecOfPairs m_deployments;
    VecOfTuples m_attacks;

}; // class BasicRoundStrategy

} // namespace warlightAi

#endif // BASIC_ROUND_STRATEGY_H_INCLUDED

Add override after overriden methods

Add override after overriden methods


/*
Copyright (c) 2013 Janne Blomqvist

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

*/

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

#ifdef _OPENMP
#include <omp.h>
#endif

#ifdef MPI
#include <mpi.h>
#endif

static hwloc_topology_t topo;

static void print_cpu_bind(FILE* f, int rank, int threadid)
{
	char* s;
	hwloc_bitmap_t cpuset = hwloc_bitmap_alloc();

	/* get the current thread CPU location */
	hwloc_get_cpubind(topo, cpuset, HWLOC_CPUBIND_THREAD);
	hwloc_bitmap_asprintf(&s, cpuset);
	fprintf(f, "MPI rank %d thread %d running on %s\n", rank, threadid,
		s);
}

int main(int argc, char **argv)
{
	int rank = 0;
	hwloc_topology_init(&topo);
	hwloc_topology_load(topo);

#ifdef MPI
	MPI_Init(&argc, &argv);
	MPI_Comm_rank(MPI_COMM_WORLD, &rank);
#endif

	#pragma omp parallel
	{
#ifdef _OPENMP
		int threadid = omp_get_thread_num();
#else
		int threadid = 0;
#endif
		print_cpu_bind(stdout, rank, threadid);
	}

#ifdef MPI
	MPI_Finalize();
#endif
	return 0;
}

Test program to get CPU affinity of an MPI application


#ifndef DOWNLOAD_QUERY_LOADER_H
#define DOWNLOAD_QUERY_LOADER_H

#include <QString>

class Site;
class DownloadQueryImage;
class DownloadQueryGroup;

class DownloadQueryLoader
{
	public:
		static bool load(QString path, QList<DownloadQueryImage> &uniques, QList<DownloadQueryGroup> &batchs, QMap<QString, Site*> &sites);
		static bool save(QString path, QList<DownloadQueryImage> &uniques, QList<DownloadQueryGroup> &batchs);
};

#endif // DOWNLOAD_QUERY_LOADER_H

#ifndef DOWNLOAD_QUERY_LOADER_H
#define DOWNLOAD_QUERY_LOADER_H

#include <QString>
#include <QList>
#include <QMap>

class Site;
class DownloadQueryImage;
class DownloadQueryGroup;

class DownloadQueryLoader
{
	public:
		static bool load(QString path, QList<DownloadQueryImage> &uniques, QList<DownloadQueryGroup> &batchs, QMap<QString, Site*> &sites);
		static bool save(QString path, QList<DownloadQueryImage> &uniques, QList<DownloadQueryGroup> &batchs);
};

#endif // DOWNLOAD_QUERY_LOADER_H

Include QList and QMap to header file to fix build


#ifndef _TOKU_DIRENT_H
#define _TOKU_DIRENT_H

#if defined(__cplusplus)
extern "C" {
#endif

//The DIR functions do not exist in windows, but the Linux API ends up
//just using a wrapper.  We might convert these into an toku_os_* type api.

enum {
    DT_UNKNOWN = 0,
    DT_DIR     = 4,
    DT_REG     = 8
};

struct dirent {
    char          d_name[_MAX_PATH];
    unsigned char d_type;
};

struct __toku_windir;
typedef struct __toku_windir DIR;

DIR *opendir(const char *name);

struct dirent *readdir(DIR *dir);

int closedir(DIR *dir);

#ifndef NAME_MAX
#define NAME_MAX 255
#endif

#if defined(__cplusplus)
};
#endif

#endif

#ifndef _TOKU_DIRENT_H
#define _TOKU_DIRENT_H

#include "toku_os_types.h"
#if defined(__cplusplus)
extern "C" {
#endif

//The DIR functions do not exist in windows, but the Linux API ends up
//just using a wrapper.  We might convert these into an toku_os_* type api.

enum {
    DT_UNKNOWN = 0,
    DT_DIR     = 4,
    DT_REG     = 8
};

struct dirent {
    char          d_name[_MAX_PATH];
    unsigned char d_type;
};

struct __toku_windir;
typedef struct __toku_windir DIR;

DIR *opendir(const char *name);

struct dirent *readdir(DIR *dir);

int closedir(DIR *dir);

#ifndef NAME_MAX
#define NAME_MAX 255
#endif

#if defined(__cplusplus)
};
#endif

#endif

[t:2499] Fix broken windows build due to r19902 (merge of 2499d branch)

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@19935 c7de825b-a66e-492c-adef-691d508d4ae1


#pragma once

#include "Tab.h"

class Display : public Tab {
public:
    virtual void SaveSettings();

protected:
    virtual void Initialize();
    virtual void LoadSettings();

private:
    bool OnAnimationChanged();
    bool OnAnimationSpin(NMUPDOWN *ud);
    bool OnCustomCheckChanged();
    bool OnPositionChanged();

private:
    /* Controls: */
    Checkbox _onTop;
    Checkbox _hideFullscreen;

    ComboBox _position;
    Label _customX;
    EditBox _positionX;
    Label _customY;
    EditBox _positionY;
    Checkbox _customDistance;
    Spinner _edgeSpinner;
    Label _displayDevLabel;
    ComboBox _displayDevice;

    ComboBox _animation;
    Label _hideDelayLabel;
    Spinner _hideDelay;
    Label _hideSpeedLabel;
    Spinner _hideSpeed;

private:
    /* Strings: */
    std::wstring primaryMonitorStr = L"Primary Monitor";
    std::wstring allMonitorStr = L"All Monitors";
    std::wstring customPositionStr = L"Custom";
    std::wstring noAnimStr = L"None";

private:
    /* Constants: */
    const int MIN_EDGE = -65535;
    const int MAX_EDGE = 65535;
    const int MIN_MS = USER_TIMER_MINIMUM;
    const int MAX_MS = 60000;
};

#pragma once

#include "Tab.h"

#include <CommCtrl.h>

class Display : public Tab {
public:
    virtual void SaveSettings();

protected:
    virtual void Initialize();
    virtual void LoadSettings();

private:
    bool OnAnimationChanged();
    bool OnAnimationSpin(NMUPDOWN *ud);
    bool OnCustomCheckChanged();
    bool OnPositionChanged();

private:
    /* Controls: */
    Checkbox _onTop;
    Checkbox _hideFullscreen;

    ComboBox _position;
    Label _customX;
    EditBox _positionX;
    Label _customY;
    EditBox _positionY;
    Checkbox _customDistance;
    Spinner _edgeSpinner;
    Label _displayDevLabel;
    ComboBox _displayDevice;

    ComboBox _animation;
    Label _hideDelayLabel;
    Spinner _hideDelay;
    Label _hideSpeedLabel;
    Spinner _hideSpeed;

private:
    /* Strings: */
    std::wstring primaryMonitorStr = L"Primary Monitor";
    std::wstring allMonitorStr = L"All Monitors";
    std::wstring customPositionStr = L"Custom";
    std::wstring noAnimStr = L"None";

private:
    /* Constants: */
    const int MIN_EDGE = -65535;
    const int MAX_EDGE = 65535;
    const int MIN_MS = USER_TIMER_MINIMUM;
    const int MAX_MS = 60000;
    const int ANIM_SPIN_INCREMENT = 100;
};

Add constant for spin increment

Add constant for spin increment


extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern int __VERIFIER_nondet_int();
void __VERIFIER_assert(int cond) {
    if (!(cond)) {
        ERROR: __VERIFIER_error();
    }
    return;
}

int main()
{
    int x, y;
    if (__VERIFIER_nondet_int())
    {
        x = 0;
        y = 1;
    }
    else
    {
        x = 1;
        y = 0;
    }

    __VERIFIER_assert(x + y == 1);
    return 0;
}

Add basic (base analysis) path sensitivity test


#include <QtCore/QProcess>

#include <QtDBus/QtDBus>

#include <QtTest/QtTest>

#include <TelepathyQt4/Client/PendingOperation>
#include <TelepathyQt4/Constants>

#include "tests/lib/test.h"

class PinocchioTest : public Test
{
    Q_OBJECT

public:

    PinocchioTest(QObject *parent = 0);

    virtual ~PinocchioTest();

    static inline QLatin1String pinocchioBusName()
    {
        return QLatin1String(
            TELEPATHY_CONNECTION_MANAGER_BUS_NAME_BASE "pinocchio");
    }

    static inline QLatin1String pinocchioObjectPath()
    {
        return QLatin1String(
            TELEPATHY_CONNECTION_MANAGER_OBJECT_PATH_BASE "pinocchio");
    }

    bool waitForPinocchio(uint timeoutMs = 5000);

protected:
    QString mPinocchioPath;
    QString mPinocchioCtlPath;
    QProcess mPinocchio;
    QEventLoop *mLoop;

    virtual void initTestCaseImpl();

    virtual void cleanupTestCaseImpl();

protected Q_SLOTS:
    void gotNameOwner(QDBusPendingCallWatcher* watcher);
    void onNameOwnerChanged(const QString&, const QString&, const QString&);
};

#include <QtCore/QProcess>

#include <QtDBus/QtDBus>

#include <QtTest/QtTest>

#include <TelepathyQt4/Client/PendingOperation>
#include <TelepathyQt4/Constants>

#include "tests/lib/test.h"

class PinocchioTest : public Test
{
    Q_OBJECT

public:

    PinocchioTest(QObject *parent = 0);

    virtual ~PinocchioTest();

    static inline QLatin1String pinocchioBusName()
    {
        return QLatin1String(
            TELEPATHY_CONNECTION_MANAGER_BUS_NAME_BASE "pinocchio");
    }

    static inline QLatin1String pinocchioObjectPath()
    {
        return QLatin1String(
            TELEPATHY_CONNECTION_MANAGER_OBJECT_PATH_BASE "pinocchio");
    }

    bool waitForPinocchio(uint timeoutMs = 5000);

protected:
    QString mPinocchioPath;
    QString mPinocchioCtlPath;
    QProcess mPinocchio;

    virtual void initTestCaseImpl();

    virtual void cleanupTestCaseImpl();

protected Q_SLOTS:
    void gotNameOwner(QDBusPendingCallWatcher* watcher);
    void onNameOwnerChanged(const QString&, const QString&, const QString&);
};

Remove spurious mLoop member from PinocchioTest

Having moved mLoop into the parent class, the fact that there's another
one here (uninitialized, and used for about half the functions) breaks
the tests.


#include <stdio.h>

int main()
{
    long nc = 0;

    while (getchar() != EOF) {
        ++nc;
    }

    printf("count: %d\n", nc);
}

#include <stdio.h>

int main()
{
    double nc = 0;

    for (nc = 0; getchar() != EOF; ++nc)
        ;

    printf("count: %f\n", nc);
}

Use dirty C tricks to make it smaller

Use dirty C tricks to make it smaller


// RUN: clang-cc %s -o %t -emit-llvm -verify
// PR4289

struct funcptr {
  int (*func)();
};

static int func(f)
  void *f;
{
  return 0;
}

int
main(int argc, char *argv[])
{
  struct funcptr fp;

  fp.func = &func;
  fp.func = func;
  return 0;
}

// RUN: clang-cc %s -o %t -emit-llvm -verify
// PR4289

struct funcptr {
  int (*func)();
};

static int func(f)
  void *f;
{
  return 0;
}

int
main(int argc, char *argv[])
{
  struct funcptr fp;

  fp.func = &func;
  fp.func = func;
}

Revert this, was a bug in my new warning code, not the test case.

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


#pragma once
#include <string>

#if 0
int Stricmp(const char* str1, const char* str2) {
	int d;
	while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) {
		str1++;
		str2++;
	}
	return d;
}

int Strnicmp(const char* str1, const char* str2, int count) {
	int d = 0;
	while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) {
		str1++; str2++; count--;
	}
	return d;
}
#endif

#ifdef _MSC_VER
#define SL_CALL __vectorcall
#else
#define SL_CALL
#endif

#define COUNT_OF(X) (sizeof(X) / sizeof((X)[0]))
#define ZERO_MEM(X, Y) (memset(X, 0, Y));

#pragma once
#include <string>

#if 0
int Stricmp(const char* str1, const char* str2) {
	int d;
	while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) {
		str1++;
		str2++;
	}
	return d;
}

int Strnicmp(const char* str1, const char* str2, int count) {
	int d = 0;
	while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) {
		str1++; str2++; count--;
	}
	return d;
}
#endif

#if defined(_MSC_VER) && (_MSC_VER >= 1800)
#define SL_CALL __vectorcall
#else
#define SL_CALL
#endif

#define COUNT_OF(X) (sizeof(X) / sizeof((X)[0]))
#define ZERO_MEM(X, Y) (memset(X, 0, Y));

Remove __vectorcall calling convention on older versions of MSVC++


// LAF Base Library
// Copyright (c) 2017 David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.

#ifndef BASE_WIN_COMPTR_H_INCLUDED
#define BASE_WIN_COMPTR_H_INCLUDED
#pragma once

#if !defined(_WIN32)
  #error This header file can be used only on Windows platform
#endif

#include "base/disable_copying.h"

namespace base {

  template<class T>
  class ComPtr {
  public:
    ComPtr() : m_ptr(nullptr) { }
    ~ComPtr() { reset(); }
    T** operator&() { return &m_ptr; }
    T* operator->() { return m_ptr; }

    T* get() {
      return m_ptr;
    }

    void reset() {
      if (m_ptr) {
        m_ptr->Release();
        m_ptr = nullptr;
      }
    }

  private:
    T* m_ptr;

    DISABLE_COPYING(ComPtr);
  };

} // namespace base

#endif

Add ComPtr utility to laf-base library

Add ComPtr utility to laf-base library


//PARAM: --set ana.activated '["base", "mallocWrapper"]'
// Copied & modified from 33/04.
#include <assert.h>

int main() {
    // state: {bot}, because no locals/globals
    assert(1); // state: {bot}, because Hoare set add (in PathSensitive2 map) keeps bot, while reduce would remove
    assert(1); // state: {bot}, because Hoare set add (in PathSensitive2 map) keeps bot, while reduce would remove
    return 0;
}

Add test where base has live bottom state


/* Copyright (C) 2002 Timo Sirainen */

#include "common.h"
#include "mail-namespace.h"
#include "commands.h"

bool cmd_create(struct client_command_context *cmd)
{
	struct mail_namespace *ns;
	const char *mailbox, *full_mailbox;
	bool directory;
	size_t len;

	/* <mailbox> */
	if (!client_read_string_args(cmd, 1, &mailbox))
		return FALSE;
	full_mailbox = mailbox;

	ns = client_find_namespace(cmd, &mailbox);
	if (ns == NULL)
		return TRUE;

	len = strlen(full_mailbox);
	if (len == 0 || full_mailbox[len-1] != ns->sep)
		directory = FALSE;
	else {
		/* name ends with hierarchy separator - client is just
		   informing us that it wants to create children under this
		   mailbox. */
                directory = TRUE;
		mailbox = t_strndup(mailbox, len-1);
		full_mailbox = t_strndup(full_mailbox, strlen(full_mailbox)-1);
	}

	if (!client_verify_mailbox_name(cmd, full_mailbox, FALSE, TRUE))
		return TRUE;

	if (mail_storage_mailbox_create(ns->storage, mailbox, directory) < 0)
		client_send_storage_error(cmd, ns->storage);
	else
		client_send_tagline(cmd, "OK Create completed.");
	return TRUE;
}

/* Copyright (C) 2002 Timo Sirainen */

#include "common.h"
#include "mail-namespace.h"
#include "commands.h"

bool cmd_create(struct client_command_context *cmd)
{
	struct mail_namespace *ns;
	const char *mailbox, *full_mailbox;
	bool directory;
	size_t len;

	/* <mailbox> */
	if (!client_read_string_args(cmd, 1, &mailbox))
		return FALSE;
	full_mailbox = mailbox;

	ns = client_find_namespace(cmd, &mailbox);
	if (ns == NULL)
		return TRUE;

	len = strlen(full_mailbox);
	if (len == 0 || full_mailbox[len-1] != ns->sep)
		directory = FALSE;
	else {
		/* name ends with hierarchy separator - client is just
		   informing us that it wants to create children under this
		   mailbox. */
                directory = TRUE;
		mailbox = t_strndup(mailbox, strlen(mailbox)-1);
		full_mailbox = t_strndup(full_mailbox, len-1);
	}

	if (!client_verify_mailbox_name(cmd, full_mailbox, FALSE, TRUE))
		return TRUE;

	if (mail_storage_mailbox_create(ns->storage, mailbox, directory) < 0)
		client_send_storage_error(cmd, ns->storage);
	else
		client_send_tagline(cmd, "OK Create completed.");
	return TRUE;
}

CREATE ns_prefix/box/ didn't work right when namespace prefix existed.

--HG--
branch : HEAD


/*
 * $Id$
 *
 * Define the tags in the shared memory in a reusable format.
 * Whoever includes this get to define what the SLTM macro does.
 *
 */

SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(URL)
SLTM(Protocol)
SLTM(HD_Unknown)
SLTM(HD_Lost)
#define HTTPH(a, b, c, d, e, f, g)	SLTM(b)
#include "http_headers.h"
#undef HTTPH

/*
 * $Id$
 *
 * Define the tags in the shared memory in a reusable format.
 * Whoever includes this get to define what the SLTM macro does.
 *
 */

SLTM(Debug)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(URL)
SLTM(Protocol)
SLTM(HD_Unknown)
SLTM(HD_Lost)
#define HTTPH(a, b, c, d, e, f, g)	SLTM(b)
#include "http_headers.h"
#undef HTTPH

Add a Debug shmemlog tag.

Add a Debug shmemlog tag.

git-svn-id: 7d4b18ab7d176792635d6a7a77dd8cbbea8e8daa@104 d4fa192b-c00b-0410-8231-f00ffab90ce4


#ifndef _CONDOR_SYSCALLS_H
#define _CONDOR_SYSCALLS_H

#if defined( AIX32)
#	include "syscall.aix32.h"
#else
#	include <syscall.h>
#endif

typedef int BOOL;

static const int 	SYS_LOCAL = 1;
static const int 	SYS_REMOTE = 0;
static const int	SYS_RECORDED = 2;
static const int	SYS_MAPPED = 2;

static const int	SYS_UNRECORDED = 0;
static const int	SYS_UNMAPPED = 0;

#if defined(__cplusplus)
extern "C" {
#endif

int SetSyscalls( int mode );
int GetSyscallMode();
BOOL LocalSysCalls();
BOOL RemoteSysCalls();
BOOL MappingFileDescriptors();
int REMOTE_syscall( int syscall_num, ... );

#if defined(OSF1) || defined(HPUX9)
	int syscall( int, ... );
#endif

#if defined(__cplusplus)
}
#endif

#endif

#ifndef _CONDOR_SYSCALLS_H
#define _CONDOR_SYSCALLS_H

#if defined( AIX32)
#	include "syscall.aix.h"
#else
#	include <syscall.h>
#endif

typedef int BOOL;

static const int 	SYS_LOCAL = 1;
static const int 	SYS_REMOTE = 0;
static const int	SYS_RECORDED = 2;
static const int	SYS_MAPPED = 2;

static const int	SYS_UNRECORDED = 0;
static const int	SYS_UNMAPPED = 0;

#if defined(__cplusplus)
extern "C" {
#endif

int SetSyscalls( int mode );
int GetSyscallMode();
BOOL LocalSysCalls();
BOOL RemoteSysCalls();
BOOL MappingFileDescriptors();
int REMOTE_syscall( int syscall_num, ... );

#if defined(OSF1) || defined(HPUX9)
	int syscall( int, ... );
#endif

#if defined(__cplusplus)
}
#endif

#endif

Make work for AIX machines.

Make work for AIX machines.


#pragma once

#include <stdint.h>
#if _MSC_VER
#include <intrin.h>
#endif

template<typename morton>
inline bool findFirstSetBit(const morton x, unsigned long* firstbit_location) {
#if _MSC_VER && !_WIN64
	// 32 BIT on 32 BIT
	if (sizeof(morton) <= 4) {
		return _BitScanReverse(firstbit_location, x);
	}
	// 64 BIT on 32 BIT
	else {
		*firstbit_location = 0;
		if (_BitScanReverse(firstbit_location, (x >> 32))) { // check first part
			firstbit_location += 32;
			return true;
		}
		return _BitScanReverse(firstbit_location, (x & 0xFFFFFFFF));
	}
#elif  _MSC_VER && _WIN64
	// 32 or 64 BIT on 64 BIT
	return _BitScanReverse64(firstbit_location, x);
#elif __GNUC__
	if (x == 0) {
		return false;
	}
	else {
		*firstbit_location = static_cast<unsigned long>((sizeof(morton)*8) - __builtin_clzll(x));
		return true;
	}
#endif
}

#pragma once

// Libmorton - Common helper methods needed in Morton encoding/decoding

#include <stdint.h>
#if _MSC_VER
#include <intrin.h>
#endif

template<typename morton>
inline bool findFirstSetBit(const morton x, unsigned long* firstbit_location) {
#if _MSC_VER && !_WIN64
	// 32 BIT on 32 BIT
	if (sizeof(morton) <= 4) {
		return _BitScanReverse(firstbit_location, x);
	}
	// 64 BIT on 32 BIT
	else {
		*firstbit_location = 0;
		if (_BitScanReverse(firstbit_location, (x >> 32))) { // check first part
			firstbit_location += 32;
			return true;
		}
		return _BitScanReverse(firstbit_location, (x & 0xFFFFFFFF));
	}
#elif  _MSC_VER && _WIN64
	// 32 or 64 BIT on 64 BIT
	return _BitScanReverse64(firstbit_location, x) != 0;
#elif __GNUC__
	if (x == 0) {
		return false;
	}
	else {
		*firstbit_location = static_cast<unsigned long>((sizeof(morton)*8) - __builtin_clzll(x));
		return true;
	}
#endif
}

Fix MSVC compiler warnings about return value not being a boolean


/******************************************************************************
 *
 *  file:  Visitor.h
 *
 *  Copyright (c) 2003, Michael E. Smoot .
 *  All rights reverved.
 *
 *  See the file COPYING in the top directory of this distribution for
 *  more information.
 *
 *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
 *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 *  DEALINGS IN THE SOFTWARE.
 *
 *****************************************************************************/

#ifndef TCLAP_VISITOR_H
#define TCLAP_VISITOR_H

namespace TCLAP {

/**
 * A base class that defines the interface for visitors.
 */
class Visitor
{
	public:

		/**
		 * Constructor. Does nothing.
		 */
		Visitor() { }

		/**
		 * Destructor. Does nothing.
		 */
		virtual ~Visitor() { }

		/**
		 * Does nothing. Should be overridden by child.
		 */
		virtual void visit() { }
};

}

#endif

/******************************************************************************
 *
 *  file:  Visitor.h
 *
 *  Copyright (c) 2003, Michael E. Smoot .
 *  All rights reverved.
 *
 *  See the file COPYING in the top directory of this distribution for
 *  more information.
 *
 *  THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS
 *  OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 *  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 *  THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 *  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 *  DEALINGS IN THE SOFTWARE.
 *
 *****************************************************************************/

#ifndef TCLAP_VISITOR_H
#define TCLAP_VISITOR_H

namespace TCLAP {

/**
 * A base class that defines the interface for visitors.
 */
class Visitor
{
	public:

		/**
		 * Constructor. Does nothing.
		 */
		Visitor() { }

		/**
		 * Destructor. Does nothing.
		 */
		virtual ~Visitor() { }

		/**
		 * This method (to implemented by children) will be
		 * called when the visitor is visited.
		 */
		virtual void visit() = 0;
};

}

#endif

Make "visit" method pure virtual (needs to be implemented by subclass to make sense).


/*===- RectConfinementForce.h - libSimulation -=================================
*
*                                  DEMON
*
* This file is distributed under the BSD Open Source License. See LICENSE.TXT
* for details.
*
*===-----------------------------------------------------------------------===*/

#ifndef RECTCONFINEMENTFORCE_H
#define RECTCONFINEMENTFORCE_H

#include "Force.h"

class RectConfinementForce : public Force {
public:
	RectConfinementForce(Cloud * const C, double confineConstX, double confineConstY)
	: Force(C), confineX(-confineConstX), confineY(-confineConstY) {}
	// IMPORTANT: In the above constructor, confineConst_'s must be positive!
	~RectConfinementForce() {}

// public functions:
	void force1(const double currentTime); // rk substep 1
	void force2(const double currentTime); // rk substep 2
	void force3(const double currentTime); // rk substep 3
	void force4(const double currentTime); // rk substep 4

	void writeForce(fitsfile * const file, int * const error) const;
	void readForce(fitsfile * const file, int * const error);

private:
// private variables:
	double confineX;
	double confineY;

// private functions:
	void force(const cloud_index currentParticle, const __m128d currentPositionX, const __m128d currentPositionY);
};

#endif // RECTCONFINEMENTFORCE_H

/*===- RectConfinementForce.h - libSimulation -=================================
*
*                                  DEMON
*
* This file is distributed under the BSD Open Source License. See LICENSE.TXT
* for details.
*
*===-----------------------------------------------------------------------===*/

#ifndef RECTCONFINEMENTFORCE_H
#define RECTCONFINEMENTFORCE_H

#include "Force.h"

class RectConfinementForce : public Force {
public:
	RectConfinementForce(Cloud * const C, double confineConstX, double confineConstY)
	: Force(C), confineX(confineConstX), confineY(-confineConstY) {}
	// IMPORTANT: In the above constructor, confineConst_'s must be positive!
	~RectConfinementForce() {}

// public functions:
	void force1(const double currentTime); // rk substep 1
	void force2(const double currentTime); // rk substep 2
	void force3(const double currentTime); // rk substep 3
	void force4(const double currentTime); // rk substep 4

	void writeForce(fitsfile * const file, int * const error) const;
	void readForce(fitsfile * const file, int * const error);

private:
// private variables:
	double confineX;
	double confineY;

// private functions:
	void force(const cloud_index currentParticle, const __m128d currentPositionX, const __m128d currentPositionY);
};

#endif // RECTCONFINEMENTFORCE_H

Fix direction of rectangular confinement force.


// PARAM: --enable ana.int.interval --enable ana.int.def_exc

int main(){

  unsigned long long a ;
  unsigned long long addr;

  if(a + addr > 0x0ffffffffULL){
    return 1;
  }
}

Add minimal failing test case

Add minimal failing test case


/**
 * @file
 * @details This file contains @link interrupt_handler() @endlink function.
 *        It's proxy between asm code and kernel interrupt handler
 *        @link irq_dispatch() @endlink function.
 *
 * @date 27.11.09
 * @author Anton Bondarev
 */

#include <drivers/irqctrl.h>
#include <asm/msr.h>

/* we havn't interrupts acknowledgment in microblaze architecture
 * and must receive interrupt number our self and then clear pending bit in
 * pending register
 */
void interrupt_handler(void) {
	unsigned int pending;

	while (0 != (pending = mb_intc_get_pending())) {
		unsigned int irq_num;

		for (irq_num = 0; irq_num < IRQCTRL_IRQS_TOTAL; irq_num++) {
			if (pending & (1 << irq_num)) {
				//TODO we must clear whole pending register
				irqctrl_clear(irq_num);

				/*now we allow nested irq*/
				msr_set_ie();

				irq_dispatch(irq_num);
			}
		}
	}
}

/**
 * @file
 * @details This file contains @link interrupt_handler() @endlink function.
 *        It's proxy between asm code and kernel interrupt handler
 *        @link irq_dispatch() @endlink function.
 *
 * @date 27.11.09
 * @author Anton Bondarev
 */

#include <drivers/irqctrl.h>
#include <asm/msr.h>
#include <kernel/irq.h>

/* we havn't interrupts acknowledgment in microblaze architecture
 * and must receive interrupt number our self and then clear pending bit in
 * pending register
 */
void interrupt_handler(void) {
	unsigned int pending;

	while (0 != (pending = mb_intc_get_pending())) {
		unsigned int irq_num;

		for (irq_num = 0; irq_num < IRQCTRL_IRQS_TOTAL; irq_num++) {
			if (pending & (1 << irq_num)) {
				//TODO we must clear whole pending register
				irqctrl_clear(irq_num);

				/*now we allow nested irq*/
				msr_set_ie();

				irq_dispatch(irq_num);
			}
		}
	}
}

Fix microblaze build after merge 480c64b


/**
 * mips.h - all the aliases to MIPS ISA
 * @author Aleksandr Misevich
 * Copyright 2018 MIPT-MIPS
 */

#ifndef MIPS_H_
#define MIPS_H_

#include "mips_instr.h"

#include <infra/instrcache/instr_cache_memory.h>

template<MIPSVersion VERSION>
struct MIPS
{
    using Register = MIPSRegister;
    using RegisterUInt = MIPSRegisterUInt<VERSION>;
    using FuncInstr = MIPSInstr<VERSION>;
    using Memory = InstrMemory<FuncInstr>;
    static const auto& get_instr( uint32 bytes, Addr PC) {
        return FuncInstr( VERSION, bytes, PC);
    }
};

// 32 bit MIPS
using MIPSI   = MIPS<MIPSVersion::I>;
using MIPSII  = MIPS<MIPSVersion::II>;
using MIPS32  = MIPS<MIPSVersion::v32>;

// 64 bit MIPS
using MIPSIII = MIPS<MIPSVersion::III>;
using MIPSIV  = MIPS<MIPSVersion::IV>;
using MIPS64  = MIPS<MIPSVersion::v64>;

static_assert( std::is_same_v<MIPS32Instr, MIPS32::FuncInstr>);
static_assert( std::is_same_v<MIPS64Instr, MIPS64::FuncInstr>);

#endif // MIPS_H_

/**
 * mips.h - all the aliases to MIPS ISA
 * @author Aleksandr Misevich
 * Copyright 2018 MIPT-MIPS
 */

#ifndef MIPS_H_
#define MIPS_H_

#include "mips_instr.h"

#include <infra/instrcache/instr_cache_memory.h>

template<MIPSVersion version>
struct MIPS
{
    using Register = MIPSRegister;
    using RegisterUInt = MIPSRegisterUInt<version>;
    using FuncInstr = MIPSInstr<version>;
    using Memory = InstrMemory<FuncInstr>;
    static const auto& get_instr( uint32 bytes, Addr PC) {
        return FuncInstr( version, bytes, PC);
    }
};

// 32 bit MIPS
using MIPSI   = MIPS<MIPSVersion::I>;
using MIPSII  = MIPS<MIPSVersion::II>;
using MIPS32  = MIPS<MIPSVersion::v32>;

// 64 bit MIPS
using MIPSIII = MIPS<MIPSVersion::III>;
using MIPSIV  = MIPS<MIPSVersion::IV>;
using MIPS64  = MIPS<MIPSVersion::v64>;

static_assert( std::is_same_v<MIPS32Instr, MIPS32::FuncInstr>);
static_assert( std::is_same_v<MIPS64Instr, MIPS64::FuncInstr>);

#endif // MIPS_H_

Rename VERSION to avoid overlapping with external macros


#ifndef CLASS_SELECTOR_H_
#define CLASS_SELECTOR_H_

#include "llvm/IR/Module.h"
#include "llvm/IR/Instruction.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/IntrinsicInst.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/Operator.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Argument.h"
#include "llvm/IR/Constant.h"
#include "llvm/Analysis/RegionInfo.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/IR/GlobalVariable.h"
#include "llvm/IR/GlobalValue.h"
#include "llvm/IR/GlobalAlias.h"
#include "llvm/IR/InlineAsm.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/Analysis/RegionInfo.h"
#include "llvm/Analysis/LoopInfo.h"
#include "llvm/Analysis/RegionPass.h"
#include "llvm/Analysis/LoopPass.h"
#include "llvm/ADT/Optional.h"
namespace knowledge {

template<typename T>
struct ElectronClassNameSelector {
	static void selectName(llvm::raw_string_ostream& str) {
		str << "";
	}
};

#define X(__, type, className, ___) \
	template<> \
	struct ElectronClassNameSelector<type> { \
		static void selectName(llvm::raw_string_ostream& str) { \
			str << className ; \
		} \
	};
#include "knowledge/EngineNodes.def"
#undef X
}
#endif // CLASS_SELECTOR_H_

Move class selection code out to a separate header

- makes it possible to be referenced by teh gen-clips-classes program


#include <stdio.h>

int main(int argc, char *argv[])
{
    printf("gxtas - The GTA Text Assembler\n");

    return 0;
}

/*
 * Copyright (c) 2017 Wes Hampson <thehambone93@gmail.com>
 *
 * Licensed under the MIT License. See LICENSE at top level directory.
 */

#include <stdio.h>
#include <string.h>

#include "gxtas.h"

void show_help_info(void)
{
    printf("%s\n", GXTAS_HELP_MESSAGE);
}

void show_version_info(void)
{
    printf("%s - %s\n", GXTAS_APP_NAME, GXTAS_APP_MOTTO);
    printf("Version %d.%d.%d%s\n", GXTAS_VERSION_MAJOR, GXTAS_VERSION_MINOR,
                                   GXTAS_VERSION_PATCH, GXTAS_VERSION_BUILD);

    printf("\n%s\n", GXTAS_COPYRIGHT_NOTICE);
    printf("\n%s\n", GXTAS_LICENSE_NOTICE);
    printf("\n%s\n", GXTAS_WARRANTY_NOTICE);
}

int main(int argc, char *argv[])
{
    if (argc < 2)
    {
        show_help_info();
    }
    else if (strcmp(argv[1], "--version") == 0)
    {
        show_version_info();
    }
    else
    {
        show_help_info();
    }
    return 0;
}

Add license header, add version and help info


//Copyright (c) 2018 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.

#ifndef RATIO_H
#define RATIO_H

namespace cura
{

/*
 * \brief Represents a ratio between two numbers.
 *
 * This is a facade. It behaves like a double.
 */
struct Ratio
{
    /*
     * \brief Default constructor setting the ratio to 1.
     */
    constexpr Ratio() : value(1.0) {};

    /*
     * \brief Casts a double to a Ratio instance.
     */
    constexpr Ratio(double value) : value(value / 100) {};

    /*
     * \brief Casts the Ratio instance to a double.
     */
    operator double() const
    {
        return value;
    }

    /*
     * \brief The actual ratio, as a double.
     */
    double value = 0;
};

constexpr Ratio operator "" _r(const long double ratio)
{
    return Ratio(ratio);
}

}

#endif //RATIO_H

//Copyright (c) 2018 Ultimaker B.V.
//CuraEngine is released under the terms of the AGPLv3 or higher.

#ifndef RATIO_H
#define RATIO_H

namespace cura
{

/*
 * \brief Represents a ratio between two numbers.
 *
 * This is a facade. It behaves like a double.
 */
struct Ratio
{
    /*
     * \brief Default constructor setting the ratio to 1.
     */
    constexpr Ratio() : value(1.0) {};

    /*
     * \brief Casts a double to a Ratio instance.
     */
    constexpr Ratio(double value) : value(value / 100) {};

    /*
     * \brief Casts the Ratio instance to a double.
     */
    operator double() const
    {
        return value;
    }

    /*
     * Some operators for arithmetic on ratios.
     */
    Ratio operator *(const Ratio& other) const
    {
        return Ratio(value * other.value);
    }
    template<typename E> Ratio operator *(const E& other) const
    {
        return Ratio(value * other);
    }
    Ratio operator /(const Ratio& other) const
    {
        return Ratio(value / other.value);
    }
    template<typename E> Ratio operator /(const E& other) const
    {
        return Ratio(value / other);
    }
    Ratio& operator *=(const Ratio& other)
    {
        value *= other.value;
        return *this;
    }
    template<typename E> Ratio& operator *=(const E& other)
    {
        value *= other;
        return *this;
    }
    Ratio& operator /=(const Ratio& other)
    {
        value /= other.value;
        return *this;
    }
    template<typename E> Ratio& operator /=(const E& other)
    {
        value /= other;
        return *this;
    }

    /*
     * \brief The actual ratio, as a double.
     */
    double value = 0;
};

constexpr Ratio operator "" _r(const long double ratio)
{
    return Ratio(ratio);
}

}

#endif //RATIO_H

Add operators for arithmetic with ratios

Contributes to issue CURA-4410.


// Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.

#ifndef INCLUDE_ROCKSDB_PERF_LEVEL_H_
#define INCLUDE_ROCKSDB_PERF_LEVEL_H_

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

namespace rocksdb {

// How much perf stats to collect. Affects perf_context and iostats_context.

enum PerfLevel {
  kDisable = 0,                   // disable perf stats
  kEnableCount = 1,               // enable only count stats
  kEnableTimeExceptForMutex = 2,  // Other than count stats, also enable time
                                  // stats except for mutexes
  kEnableTime = 3                 // enable count and time stats
};

// set the perf stats level for current thread
void SetPerfLevel(PerfLevel level);

// get current perf stats level for current thread
PerfLevel GetPerfLevel();

}  // namespace rocksdb

#endif  // INCLUDE_ROCKSDB_PERF_LEVEL_H_

// Copyright (c) 2011-present, Facebook, Inc.  All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.

#ifndef INCLUDE_ROCKSDB_PERF_LEVEL_H_
#define INCLUDE_ROCKSDB_PERF_LEVEL_H_

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

namespace rocksdb {

// How much perf stats to collect. Affects perf_context and iostats_context.

enum PerfLevel : char {
  kUninitialized = -1,            // unknown setting
  kDisable = 0,                   // disable perf stats
  kEnableCount = 1,               // enable only count stats
  kEnableTimeExceptForMutex = 2,  // Other than count stats, also enable time
                                  // stats except for mutexes
  kEnableTime = 3,                // enable count and time stats
  kOutOfBounds = 4                // N.B. Must always be the last value!
};

// set the perf stats level for current thread
void SetPerfLevel(PerfLevel level);

// get current perf stats level for current thread
PerfLevel GetPerfLevel();

}  // namespace rocksdb

#endif  // INCLUDE_ROCKSDB_PERF_LEVEL_H_

Add low and upper bound values for rocksdb::PerfLevel enum

Summary:
Add under and over limits for rocksdb::PerfLevel enum
to allow us to do boundary checks before casting ints or unints
to this enum.

Test Plan: make all check -j32

Reviewers: sdong

Reviewed By: sdong

Subscribers: andrewkr, dhruba, leveldb

Differential Revision: https://reviews.facebook.net/D58521


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

#ifndef SkWebpEncoder_DEFINED
#define SkWebpEncoder_DEFINED

#include "SkEncoder.h"

class SkWStream;

namespace SK_API SkWebpEncoder {

    struct Options {
        /**
         *  |fQuality| must be in [0.0f, 100.0f] where 0.0f corresponds to the lowest quality.
         */
        float fQuality = 100.0f;

        /**
         *  If the input is premultiplied, this controls the unpremultiplication behavior.
         *  The encoder can convert to linear before unpremultiplying or ignore the transfer
         *  function and unpremultiply the input as is.
         */
        SkTransferFunctionBehavior fUnpremulBehavior = SkTransferFunctionBehavior::kRespect;
    };

    /**
     *  Encode the |src| pixels to the |dst| stream.
     *  |options| may be used to control the encoding behavior.
     *
     *  Returns true on success.  Returns false on an invalid or unsupported |src|.
     */
    bool Encode(SkWStream* dst, const SkPixmap& src, const Options& options);
};

#endif

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

#ifndef SkWebpEncoder_DEFINED
#define SkWebpEncoder_DEFINED

#include "SkEncoder.h"

class SkWStream;

namespace SkWebpEncoder {

    struct SK_API Options {
        /**
         *  |fQuality| must be in [0.0f, 100.0f] where 0.0f corresponds to the lowest quality.
         */
        float fQuality = 100.0f;

        /**
         *  If the input is premultiplied, this controls the unpremultiplication behavior.
         *  The encoder can convert to linear before unpremultiplying or ignore the transfer
         *  function and unpremultiply the input as is.
         */
        SkTransferFunctionBehavior fUnpremulBehavior = SkTransferFunctionBehavior::kRespect;
    };

    /**
     *  Encode the |src| pixels to the |dst| stream.
     *  |options| may be used to control the encoding behavior.
     *
     *  Returns true on success.  Returns false on an invalid or unsupported |src|.
     */
    SK_API bool Encode(SkWStream* dst, const SkPixmap& src, const Options& options);
};

#endif

Move SK_API from namespace to function

Move SK_API from namespace to function

Bug: skia:
Change-Id: Ib538b77c28e323bbcc40634b0f3cd87d88d898e8
Reviewed-on: https://skia-review.googlesource.com/16496
Reviewed-by: Mike Reed <f5cabf8735907151a446812c9875d6c0c712d847@google.com>
Reviewed-by: Matt Sarett <bb43c9b8214fcf1292f134c9714ba8a0e7075913@google.com>
Commit-Queue: Matt Sarett <bb43c9b8214fcf1292f134c9714ba8a0e7075913@google.com>


#include <glib.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>

#include "../marquise.h"

extern uint8_t valid_namespace(char *namespace);
extern char* build_spool_path(const char *spool_prefix, char *namespace);

void test_valid_namespace() {
	int ret = valid_namespace("abcdefghijklmn12345");
	g_assert_cmpint(ret, ==, 1);
}

void test_invalid_namespace() {
	int ret = valid_namespace("a_b");
	g_assert_cmpint(ret, ==, 0);
}

int main(int argc, char **argv) {
	g_test_init(&argc, &argv, NULL);
	g_test_add_func("/valid_namespace/valid", test_valid_namespace);
	g_test_add_func("/valid_namespace/invalid", test_invalid_namespace);
	return g_test_run();
}

#include <glib.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>

#include "../marquise.h"

extern uint8_t valid_namespace(char *namespace);
extern char* build_spool_path(const char *spool_prefix, char *namespace);

void test_valid_namespace() {
	int ret = valid_namespace("abcdefghijklmn12345");
	g_assert_cmpint(ret, ==, 1);
}

void test_invalid_namespace() {
	int ret = valid_namespace("a_b");
	g_assert_cmpint(ret, ==, 0);
}

void test_build_spool_path() {
	char *spool_path = build_spool_path("/tmp", "marquisetest");
	char *expected_path = "/tmp/marquisetest/";
	size_t expected_len = strlen(expected_path);
	int i;
	for (i=0; i < expected_len; i++) {
		if (expected_path[i] != spool_path[i]) {
			printf("Got path %s, expected path with prefix %s\n", spool_path, expected_path);
			g_test_fail();
		}
	}
}

int main(int argc, char **argv) {
	g_test_init(&argc, &argv, NULL);
	g_test_add_func("/valid_namespace/valid", test_valid_namespace);
	g_test_add_func("/valid_namespace/invalid", test_invalid_namespace);
	g_test_add_func("/build_spool_path/path", test_build_spool_path);
	return g_test_run();
}

Add test for spool path construction

Add test for spool path construction

Signed-off-by: Sharif Olorin <f4e2cff0138e8cd5600e8ca295bf078683584659@tesser.org>


// Regular C libs
#include <stdio.h>

// Elixir libs -- clang doesn't know where the hell this is
#include "erl_nif.h"

static ERL_NIF_TERM hello(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {

}

// Regular C libs
#include <stdio.h>

// Elixir libs -- clang doesn't know where the hell this is
#include "erl_nif.h"

// Needs to figure out what ERL_NIF_TERM means
static ERL_NIF_TERM hello(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {

}

static ErlNifFuncs funcs[] = {
	{"hello", 2, hello}
};

ERL_NIF_INIT(Elixir.Hello, funcs, &hello)

Add basic setup for Elixir binding

Add basic setup for Elixir binding


/** \defgroup mpg123_examples example programs using libmpg123
	@{ */

/** \file mpg123_to_wav.c A simple MPEG audio to WAV converter using libmpg123 (read) and libsndfile (write).
    ...an excersize on two simple APIs. */

/** \file mpglib.c Example program mimicking the old mpglib test program.
	It takes an MPEG bitstream from standard input and writes raw audio to standard output.
	This is an use case of the mpg123_decode() in and out function in the feeder mode, quite close to classic mpglib usage and thus a template to convert from that to libmpg123.
*/

/** \file scan.c Example program that examines the exact length of an MPEG file.
    It opens a list of files and does mpg123_scan() on each and reporting the mpg123_length() before and after that. */

/** \file id3dump.c Parse ID3 info and print to standard output. */

/* @} */

/** \defgroup mpg123_examples example programs using libmpg123
	@{ */

/** \file mpg123_to_wav.c A simple MPEG audio to WAV converter using libmpg123 (read) and libsndfile (write).
    ...an excersize on two simple APIs. */

/** \file mpglib.c Example program mimicking the old mpglib test program.
	It takes an MPEG bitstream from standard input and writes raw audio to standard output.
	This is an use case of the mpg123_decode() in and out function in the feeder mode, quite close to classic mpglib usage and thus a template to convert from that to libmpg123.
*/

/** \file scan.c Example program that examines the exact length of an MPEG file.
    It opens a list of files and does mpg123_scan() on each and reporting the mpg123_length() before and after that. */

/** \file id3dump.c Parse ID3 info and print to standard output. */

/** \file feedseek.c Fuzzy feeder seeking. */

/* @} */

Add feedseek example to API docs.

Add feedseek example to API docs.

git-svn-id: 793bb72743a407948e3701719c462b6a765bc435@2963 35dc7657-300d-0410-a2e5-dc2837fedb53


//
//  BOXAPIAccessTokenDelegate.h
//  BoxContentSDK
//
//  Created by Andrew Chun on 6/6/15.
//  Copyright (c) 2015 Box. All rights reserved.
//

/**
 * App Users are full-featured enterprise Box accounts that belong to your application not a Box user. Unlike typical Box accounts,
 * these accounts do not have an associated login and can only be accessed through the Content API by the controlling application
 * and associated Box User ID. This new user model allows your application to take advantage of groups, permissions, collaborations,
 * comments, tasks, and the many other features offered by the Box platform.
 *
 * For more information the documentation is linked below.
 * https://developers.box.com/developer-edition/#app_users
 *
 * BOXAPIAccessTokenDelegate allows developers to make network calls to their own servers to retrieve an access token
 * outside of the normal means of authentication (OAuth2).
 *
 * BOXAPIAccessTokenDelegate is a protocol that should only be conformed to if App Users is being used.
 */
@protocol BOXAPIAccessTokenDelegate <NSObject>

/**
 * The method is meant to be used to make network requests to acquire access tokens and access token expiration dates.
 */
- (void)fetchAccessTokenWithCompletion:(void (^)(NSString *accessToken, NSDate *accessTokenExpiration, NSError *error))completion;

@end

//
//  BOXAPIAccessTokenDelegate.h
//  BoxContentSDK
//
//  Created by Andrew Chun on 6/6/15.
//  Copyright (c) 2015 Box. All rights reserved.
//

/**
 * App Users are full-featured enterprise Box accounts that belong to your application not a Box user. Unlike typical Box accounts,
 * these accounts do not have an associated login and can only be accessed through the Content API by the controlling application
 * and associated Box User ID. This new user model allows your application to take advantage of groups, permissions, collaborations,
 * comments, tasks, and the many other features offered by the Box platform.
 *
 * For more information the documentation is linked below.
 * https://developer.box.com/docs/app-users and https://developer.box.com/docs/service-account
 *
 * BOXAPIAccessTokenDelegate allows developers to make network calls to their own servers to retrieve an access token
 * outside of the normal means of authentication (OAuth2).
 *
 * BOXAPIAccessTokenDelegate is a protocol that should only be conformed to if App Users is being used.
 */
@protocol BOXAPIAccessTokenDelegate <NSObject>

/**
 * The method is meant to be used to make network requests to acquire access tokens and access token expiration dates.
 */
- (void)fetchAccessTokenWithCompletion:(void (^)(NSString *accessToken, NSDate *accessTokenExpiration, NSError *error))completion;

@end

Update the App Users documentation links


inherit "/lib/string/sprint";
inherit "../support";

static string thing_form(object obj)
{
	string buffer;

	buffer = "
Object form
\n";

	buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n";
	buffer += "
Mass: <input type=\"text\" name=\"mass\" value=\"" + mixed_sprint(obj->query_mass()) + "\"/>

\n";
	buffer += "<input type=\"submit\" value=\"change mass\" />\n";
	buffer += "</form>\n";

	return buffer;
}

inherit "/lib/string/sprint";
inherit "../support";

static string thing_form(object obj)
{
	string buffer;

	buffer = "
Object form
\n";

	buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n";
	buffer += "Mass: <input type=\"text\" name=\"mass\" value=\"" + mixed_sprint(obj->query_mass()) + "\"/>\n";
	buffer += "<input type=\"submit\" value=\"change mass\" />\n";
	buffer += "</form>\n";

	buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n";
	buffer += "Local mass: <input type=\"text\" name=\"localmass\" value=\"" + mixed_sprint(obj->query_local_mass()) + "\"/>\n";
	buffer += "<input type=\"submit\" value=\"change local mass\" />\n";
	buffer += "</form>\n";

	return buffer;
}

Allow local mass and mass to be set separately by form


#if defined(__i386__)
#define NEED_I386_TAS_ASM
#endif
#if defined(__sparc__)
#define NEED_SPARC_TAS_ASM
#endif

#define HAS_TEST_AND_SET

typedef unsigned char slock_t;

/* This is marked as obsoleted in BSD/OS 4.3. */
#ifndef EAI_ADDRFAMILY
#define  EAI_ADDRFAMILY		1
#endif

Add define for missing EAI_ADDRFAMILY in BSD/OS 4.3.


/* Copyright (c) 2003 Timo Sirainen */

#include "lib.h"
#include "mkdir-parents.h"

#include <sys/stat.h>

int mkdir_parents(const char *path, mode_t mode)
{
	const char *p;

	if (mkdir(path, mode) < 0 && errno != EEXIST) {
		if (errno != ENOENT)
			return -1;

		p = strrchr(path, '/');
		if (p == NULL || p == path)
			return -1; /* shouldn't happen */

		t_push();
		if (mkdir_parents(t_strdup_until(path, p), mode) < 0) {
			t_pop();
			return -1;
		}
		t_pop();

		/* should work now */
		if (mkdir(path, mode) < 0 && errno != EEXIST)
			return -1;
	}

	return 0;
}

/* Copyright (c) 2003 Timo Sirainen */

#include "lib.h"
#include "mkdir-parents.h"

#include <sys/stat.h>

int mkdir_parents(const char *path, mode_t mode)
{
	const char *p;

	/* EISDIR check is for BSD/OS which returns it if path contains '/'
	   at the end and it exists. */
	if (mkdir(path, mode) < 0 && errno != EEXIST && errno != EISDIR) {
		if (errno != ENOENT)
			return -1;

		p = strrchr(path, '/');
		if (p == NULL || p == path)
			return -1; /* shouldn't happen */

		t_push();
		if (mkdir_parents(t_strdup_until(path, p), mode) < 0) {
			t_pop();
			return -1;
		}
		t_pop();

		/* should work now */
		if (mkdir(path, mode) < 0 && errno != EEXIST)
			return -1;
	}

	return 0;
}

Check for EISDIR error as well. Fixed problems with BSD/OS.

--HG--
branch : HEAD


/**
 *  @copyright Copyright 2016 The J-PET Framework Authors. All rights reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may find a copy of the License in the LICENCE file.
 *
 *  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.
 *
 *  @file JPetReaderInterface.h
 */

#ifndef JPETREADERINTERFACE_H
#define JPETREADERINTERFACE_H

#include <TNamed.h> // for Event typedef

class JPetReaderInterface {
 public:
  typedef TObject MyEvent;
  virtual ~JPetReaderInterface() {;}
  virtual MyEvent& getCurrentEvent()=0;
  virtual bool nextEvent()=0;
  virtual bool firstEvent()=0;
  virtual bool lastEvent()=0;
  virtual bool nthEvent(int n)=0;
  virtual long long getCurrentEventNumber() const =0;
  virtual long long getNbOfAllEvents() const =0;
  virtual TObject* getObjectFromFile(const char* name)=0;

  virtual bool openFileAndLoadData(const char* filename, const char* treename)=0;
  virtual void closeFile()=0;
};
#endif /*  !JPETREADERINTERFACE_H */

/**
 *  @copyright Copyright 2016 The J-PET Framework Authors. All rights reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may find a copy of the License in the LICENCE file.
 *
 *  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.
 *
 *  @file JPetReaderInterface.h
 */

#ifndef JPETREADERINTERFACE_H
#define JPETREADERINTERFACE_H

#include <TNamed.h> // for Event typedef

class JPetReaderInterface {
 public:
  typedef TObject MyEvent;
  virtual ~JPetReaderInterface() {;}
  virtual MyEvent& getCurrentEvent()=0;
  virtual bool nextEvent()=0;
  virtual bool firstEvent()=0;
  virtual bool lastEvent()=0;
  virtual bool nthEvent(long long int n)=0;
  virtual long long getCurrentEventNumber() const =0;
  virtual long long getNbOfAllEvents() const =0;
  virtual TObject* getObjectFromFile(const char* name)=0;

  virtual bool openFileAndLoadData(const char* filename, const char* treename)=0;
  virtual void closeFile()=0;
};
#endif /*  !JPETREADERINTERFACE_H */

Change int to long long

Change int to long long


/*
 * Sample MPI "hello world" application in C
 *
 * J. Hursey
 *
 */

#include <stdio.h>
#include "mpi.h"

int main(int argc, char* argv[])
{
    int rank, size, len;
    char processor[MPI_MAX_PROCESSOR_NAME];

    /*
     * Initialize the MPI library
     */
    MPI_Init(&argc, &argv);

    /*
     * Get my 'rank' (unique ID)
     */
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);

    /*
     * Get the size of the world (How many other 'processes' are there)
     */
    MPI_Comm_size(MPI_COMM_WORLD, &size);

    /*
     * Get the processor name (usually the hostname)
     */
    MPI_Get_processor_name(processor, &len);

    /*
     * Print a message from this process
     */
    printf("Hello, world! I am %2d of %d on %s!\n", rank, size, processor);

    /*
     * Shutdown the MPI library before exiting
     */
    MPI_Finalize();

    return 0;
}

/*
 * Sample MPI "hello world" application in C
 *
 * J. Hursey
 *
 */

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "mpi.h"

int main(int argc, char* argv[])
{
    int rank, size, len;
    char processor[MPI_MAX_PROCESSOR_NAME];
    char *name = NULL;

    /*
     * Initialize the MPI library
     */
    MPI_Init(&argc, &argv);

    /*
     * Check to see if we have a command line argument for the name
     */
    if( argc > 1 ) {
        name = strdup(argv[1]);
    }
    else {
        name = strdup("World");
    }

    /*
     * Get my 'rank' (unique ID)
     */
    MPI_Comm_rank(MPI_COMM_WORLD, &rank);

    /*
     * Get the size of the world (How many other 'processes' are there)
     */
    MPI_Comm_size(MPI_COMM_WORLD, &size);

    /*
     * Get the processor name (usually the hostname)
     */
    MPI_Get_processor_name(processor, &len);

    /*
     * Print a message from this process
     */
    printf("Hello, %s! I am %2d of %d on %s!\n", name, rank, size, processor);

    /*
     * Shutdown the MPI library before exiting
     */
    MPI_Finalize();

    /*
     * Cleanup
     */
    if( NULL != name ) {
        free(name);
        name = NULL;
    }

    return 0;
}

Add an optional command line parameter to demostrate a custom form field


#ifndef PSTDALIGN_H
#define PSTDALIGN_H

#ifndef __alignas_is_defined

#ifndef __cplusplus

#if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L)
/* C11 or newer */
#include <stdalign.h>
#else

#if defined(__GNUC__) || defined (__IBMC__) || defined(__clang__)
#define _Alignas(t) __attribute__((__aligned__(t)))
#define _Alignof(t) __alignof__(t)
#elif defined(_MSC_VER)
#define _Alignas(t) __declspec (align(t))
#define _Alignof(t) __alignof(t)
#else
#error please update pstdalign.h with support for current compiler
#endif

#define alignas _Alignas
#define alignof _Alignof

#define __alignas_is_defined 1
#define __alignof_is_defined 1

#endif /* __STDC_VERSION__ */

#endif /* __cplusplus */
#endif /* __alignas__is_defined */
#endif /* PSTDALIGN_H */

#ifndef PSTDALIGN_H
#define PSTDALIGN_H

#ifndef __alignas_is_defined
#ifndef __cplusplus

#if ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)) || defined(__IBMC__)
#undef PORTABLE_C11_STDALIGN_MISSING
#define PORTABLE_C11_STDALIGN_MISSING
#endif

#if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && \
    !defined(PORTABLE_C11_STDALIGN_MISSING)
/* C11 or newer */
#include <stdalign.h>

#else

#if defined(__GNUC__) || defined (__IBMC__) || defined(__clang__)
#define _Alignas(t) __attribute__((__aligned__(t)))
#define _Alignof(t) __alignof__(t)
#elif defined(_MSC_VER)
#define _Alignas(t) __declspec (align(t))
#define _Alignof(t) __alignof(t)
#define alignas _Alignas
#define alignof _Alignof

#define __alignas_is_defined 1
#define __alignof_is_defined 1

#else
#error please update pstdalign.h with support for current compiler
#endif

#endif /* __STDC__ */

#endif /* __cplusplus */
#endif /* __alignas__is_defined */
#endif /* PSTDALIGN_H */

Handle C11 compilers witout stdalign

Handle C11 compilers witout stdalign


#ifndef LINE_EQUATION_H
#define LINE_EQUATION_H

#include "Vector2.h"

class LineEquation
{
public:
	LineEquation();
	LineEquation(Vector2 a, Vector2 b);
	LineEquation(Vector2 p, double m);

	~LineEquation();

	LineEquation(const LineEquation& e);
	LineEquation(LineEquation&& e);

	LineEquation& operator=(const LineEquation& e);
	LineEquation& operator=(LineEquation&& e);

	double operator()(const double x);

	void Move(const Vector2 v);
	Vector2 Intersection(LineEquation& e) const;
	bool IsHorizontal();
	bool IsVertical();

	double m;
	double b;
	bool vertical;
};

#endif

#ifndef LINE_EQUATION_H
#define LINE_EQUATION_H

#include "Vector2.h"

class LineEquation
{
public:
	LineEquation();
	LineEquation(Vector2 p1, Vector2 p2);
	LineEquation(Vector2 p, double m);

	~LineEquation();

	LineEquation(const LineEquation& e);
	LineEquation(LineEquation&& e);

	LineEquation& operator=(const LineEquation& e);
	LineEquation& operator=(LineEquation&& e);

	double operator()(const double x);

	void Move(const Vector2 v);
	Vector2 Intersection(LineEquation& e) const;
	bool IsHorizontal();
	bool IsVertical();

	double m;
	double b;
	bool vertical;
};

#endif

Modify parameter's name (name conflict)

Modify parameter's name (name conflict)


//
//  Created by Asger Nyman Christiansen on 08/01/2017.
//  Copyright © 2017 Asger Nyman Christiansen. All rights reserved.
//

#pragma once

namespace gle
{
    class GLState
    {
    public:
        static void cull_back_faces(bool enable)
        {
            static bool currently_enabled = true;
            if(currently_enabled != enable)
            {
                if(enable)
                {
                    glEnable(GL_CULL_FACE);
                    glCullFace(GL_BACK);
                }
                else {
                    glDisable(GL_CULL_FACE);
                }
                currently_enabled = enable;
            }
        }

        static void depth_test(bool enable)
        {
            static bool currently_enabled = false;
            if(currently_enabled != enable)
            {
                if(enable)
                {
                    glEnable(GL_DEPTH_TEST);
                }
                else {
                    glDisable(GL_DEPTH_TEST);
                }
                currently_enabled = enable;
            }
        }

        static void depth_write(bool enable)
        {
            static bool currently_enabled = true;
            if(currently_enabled != enable)
            {
                if(enable)
                {
                    glDepthMask(GL_TRUE);
                }
                else {
                    glDepthMask(GL_FALSE);
                }
                currently_enabled = enable;
            }
        }
    };
}

//
//  Created by Asger Nyman Christiansen on 08/01/2017.
//  Copyright © 2017 Asger Nyman Christiansen. All rights reserved.
//

#pragma once

namespace gle
{
    class GLState
    {
    public:
        static void cull_back_faces(bool enable)
        {
            static bool currently_enabled = false;
            if(currently_enabled != enable)
            {
                if(enable)
                {
                    glEnable(GL_CULL_FACE);
                    glCullFace(GL_BACK);
                }
                else {
                    glDisable(GL_CULL_FACE);
                }
                currently_enabled = enable;
            }
        }

        static void depth_test(bool enable)
        {
            static bool currently_enabled = false;
            if(currently_enabled != enable)
            {
                if(enable)
                {
                    glEnable(GL_DEPTH_TEST);
                }
                else {
                    glDisable(GL_DEPTH_TEST);
                }
                currently_enabled = enable;
            }
        }

        static void depth_write(bool enable)
        {
            static bool currently_enabled = true;
            if(currently_enabled != enable)
            {
                if(enable)
                {
                    glDepthMask(GL_TRUE);
                }
                else {
                    glDepthMask(GL_FALSE);
                }
                currently_enabled = enable;
            }
        }
    };
}

Bugfix: Correct initialisation of cull back faces.


#include "temp_profile.h"
#include "sntp.h"

float
temp_profile_get_current_setpoint(const temp_profile_t* profile)
{
  int i;

  uint32_t duration_into_profile = sntp_get_time() - profile->start_time;
  uint32_t step_begin = 0;
  float last_temp = profile->start_value.value;

  for (i = 0; i < profile->num_steps; ++i) {
    const temp_profile_step_t* step = &profile->steps[i];
    uint32_t step_end = step_begin + step[i].duration;

    if (duration_into_profile >= step_begin &&
        duration_into_profile < step_end) {
      if (step->type == STEP_HOLD)
        return step->value.value;
      else {
        return last_temp + ((last_temp - step->value.value) * (now - profile->start_time - step_begin) / step->duration);
      }
    }
    step_begin += step->duration;
  }

  return profile->steps[profile->num_steps-1].value.value;
}

#include "temp_profile.h"
#include "sntp.h"

float
temp_profile_get_current_setpoint(const temp_profile_t* profile)
{
  int i;

  uint32_t duration_into_profile = sntp_get_time() - profile->start_time;
  uint32_t step_begin = 0;
  float last_temp = profile->start_value.value;

  for (i = 0; i < profile->num_steps; ++i) {
    const temp_profile_step_t* step = &profile->steps[i];
    uint32_t step_end = step_begin + step[i].duration;

    if (duration_into_profile >= step_begin &&
        duration_into_profile < step_end) {
      if (step->type == STEP_HOLD)
        return step->value.value;
      else {
        uint32_t duration_into_step = duration_into_profile - step_begin;
        return last_temp + ((last_temp - step->value.value) * duration_into_step / step->duration);
      }
    }
    step_begin += step->duration;
  }

  return profile->steps[profile->num_steps-1].value.value;
}

Fix temp profile setpoint interpolation.


/*
  Copyright (c) 2012 Carsten Burstedde, Donna Calhoun
  All rights reserved.

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

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

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

#ifndef FCLAW2D_INCLUDE_ALL_H
#define FCLAW2D_INCLUDE_ALL_H

#include <fclaw_package.h>

#include <fclaw2d_forestclaw.h>
#include <fclaw2d_options.h>
#include <fclaw2d_domain.h>
#include <fclaw2d_diagnostics.h>
#include <fclaw2d_convenience.h>
#include <fclaw2d_global.h>
#include <fclaw2d_vtable.h>

#include <fclaw2d_map.h>
#include <p4est_connectivity.h>
#include <fclaw2d_map_query.h>

#include <fclaw_math.h>

#ifdef __cplusplus
extern "C"
{
#if 0
}                               /* need this because indent is dumb */
#endif
#endif

/* This file is for convenience only and should only be used in
	applications ... */

#ifdef __cplusplus
#if 0
{
#endif
}
#endif

#endif

Add big include file which can be used for applications


@interface ChromeBluetooth : CDVPlugin {

}

#pragma mark chrome.bluetoothLowEnergy interface
// chrome.bluetooth and chrome.bluetoothLowEnergy uses same file because connect, and disconnect
// a deivce requires the same instance of CBCentralManager that found the device.

- (void)connect:(CDVInvokedUrlCommand*)command;
- (void)disconnect:(CDVInvokedUrlCommand*)command;
- (void)getService:(CDVInvokedUrlCommand*)command;
- (void)getServices:(CDVInvokedUrlCommand*)command;
- (void)getCharacteristic:(CDVInvokedUrlCommand*)command;
- (void)getCharacteristics:(CDVInvokedUrlCommand*)command;
- (void)getIncludedServices:(CDVInvokedUrlCommand*)command;
- (void)getDescriptor:(CDVInvokedUrlCommand*)command;
- (void)getDescriptors:(CDVInvokedUrlCommand*)command;
- (void)readCharacteristicValue:(CDVInvokedUrlCommand*)command;
- (void)writeCharacteristicValue:(CDVInvokedUrlCommand*)command;
- (void)startCharacteristicNotifications:(CDVInvokedUrlCommand*)command;
- (void)stopCharacteristicNotifications:(CDVInvokedUrlCommand*)command;
- (void)readDescriptorValue:(CDVInvokedUrlCommand*)command;
- (void)writeDescriptorValue:(CDVInvokedUrlCommand*)command;
- (void)registerBluetoothLowEnergyEvents:(CDVInvokedUrlCommand*)command;

@end

Fix up missing newlines at eof

Fix up missing newlines at eof


// vim:ts=8:expandtab
#include "i3status.h"

const char *get_load() {
        static char part[512];

/* Get load */
#ifdef LINUX
        slurp("/proc/loadavg", part, sizeof(part));
        *skip_character(part, ' ', 3) = '\0';
#else
        /* TODO: correctly check for NetBSD, check if it works the same on *BSD */
        struct loadavg load;
        size_t length = sizeof(struct loadavg);
        int mib[2] = { CTL_VM, VM_LOADAVG };
        if (sysctl(mib, 2, &load, &length, NULL, 0) < 0)
                die("Could not sysctl({ CTL_VM, VM_LOADAVG })\n");
        double scale = load.fscale;
        (void)snprintf(part, sizeof(part), "%.02f %.02f %.02f",
                        (double)load.ldavg[0] / scale,
                        (double)load.ldavg[1] / scale,
                        (double)load.ldavg[2] / scale);
#endif

        return part;
}

// vim:ts=8:expandtab
#include "i3status.h"
#include <err.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

const char *get_load() {
        static char part[512];

/* Get load */
#if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(sun)
        double loadavg[3];
        if (getloadavg(loadavg, 3) == -1)
                errx(-1, "getloadavg() failed\n");
        (void)snprintf(part, sizeof(part), "%1.2f %1.2f %1.2f", loadavg[0], loadavg[1], loadavg[2]);
#else
        part[0] = '\0';
#endif

        return part;
}

Use getloadavg() instead of using /proc, patch by Baptiste Daroussin


/*
   This file was generated automatically by ./make_zip_err_str.sh
   from ./zip.h; make changes there.
 */

#include "zipint.h"

const char * const _zip_err_str[] = {
    "No error",
    "Multi-disk zip archives not supported",
    "Renaming temporary file failed",
    "Closing zip archive failed",
    "Seek error",
    "Read error",
    "Write error",
    "CRC error",
    "Containing zip archive was closed",
    "No such file",
    "File already exists",
    "Can't open file",
    "Failure to create temporary file",
    "Zlib error",
    "Malloc failure",
    "Entry has been changed",
    "Compression method not supported",
    "Premature EOF",
    "Invalid argument",
    "Not a zip archive",
    "Internal error",
    "Zip archive inconsistent",
    "Can't remove file",
    "Entry has been deleted",
    "Encryption method not supported",
    "Read-only archive",
    "No password provided",
    "Wrong password provided",
};

const int _zip_nerr_str = sizeof(_zip_err_str)/sizeof(_zip_err_str[0]);

#define N ZIP_ET_NONE
#define S ZIP_ET_SYS
#define Z ZIP_ET_ZLIB

const int _zip_err_type[] = {
    N,
    N,
    S,
    S,
    S,
    S,
    S,
    N,
    N,
    N,
    N,
    S,
    S,
    Z,
    N,
    N,
    N,
    N,
    N,
    N,
    N,
    N,
    S,
    N,
    N,
    N,
    N,
    N,
};

Add generated file so that hg HEAD can be used with cmake.


/* Copyright (C) 2004       Manuel Novoa III    <mjn3@codepoet.org>
 *
 * GNU Library General Public License (LGPL) version 2 or later.
 *
 * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
 */

#include "_stdio.h"

link_warning(gets, "the 'gets' function is dangerous and should not be used.")

/* UNSAFE FUNCTION -- do not bother optimizing */

libc_hidden_proto(getchar_unlocked)
libc_hidden_proto(__fgetc_unlocked)
libc_hidden_proto(__stdin)

char *gets(char *s)
{
	register char *p = s;
	int c;
	__STDIO_AUTO_THREADLOCK_VAR;

	__STDIO_AUTO_THREADLOCK(stdin);

	/* Note: don't worry about performance here... this shouldn't be used!
	 * Therefore, force actual function call. */
	while (((c = getchar_unlocked()) != EOF) && ((*p = c) != '\n')) {
		++p;
	}
	if ((c == EOF) || (s == p)) {
		s = NULL;
	} else {
		*p = 0;
	}

	__STDIO_AUTO_THREADUNLOCK(stdin);

	return s;
}

/* Copyright (C) 2004       Manuel Novoa III    <mjn3@codepoet.org>
 *
 * GNU Library General Public License (LGPL) version 2 or later.
 *
 * Dedicated to Toni.  See uClibc/DEDICATION.mjn3 for details.
 */

#include "_stdio.h"

link_warning(gets, "the 'gets' function is dangerous and should not be used.")

/* UNSAFE FUNCTION -- do not bother optimizing */

libc_hidden_proto(getchar_unlocked)
libc_hidden_proto(__fgetc_unlocked)
#ifdef __STDIO_GETC_MACRO
libc_hidden_proto(__stdin)
#else
#define __stdin stdin
#endif

char *gets(char *s)
{
	register char *p = s;
	int c;
	__STDIO_AUTO_THREADLOCK_VAR;

	__STDIO_AUTO_THREADLOCK(stdin);

	/* Note: don't worry about performance here... this shouldn't be used!
	 * Therefore, force actual function call. */
	while (((c = getchar_unlocked()) != EOF) && ((*p = c) != '\n')) {
		++p;
	}
	if ((c == EOF) || (s == p)) {
		s = NULL;
	} else {
		*p = 0;
	}

	__STDIO_AUTO_THREADUNLOCK(stdin);

	return s;
}

Build if GETC_MACRO use is disabled

Build if GETC_MACRO use is disabled


//
//  SVNetworking.h
//  SVNetworking
//
//  Created by Nate Stedman on 3/14/14.
//  Copyright (c) 2014 Svpply. All rights reserved.
//

#import <SVNetworking/NSObject+SVBindings.h>
#import <SVNetworking/NSObject+SVMultibindings.h>
#import <SVNetworking/SVDataRequest.h>
#import <SVNetworking/SVDiskCache.h>
#import <SVNetworking/SVFunctional.h>
#import <SVNetworking/SVJSONRequest.h>
#import <SVNetworking/SVRemoteImage.h>
#import <SVNetworking/SVRemoteDataResource.h>
#import <SVNetworking/SVRemoteJSONResource.h>
#import <SVNetworking/SVRemoteResource.h>
#import <SVNetworking/SVRequest.h>

//
//  SVNetworking.h
//  SVNetworking
//
//  Created by Nate Stedman on 3/14/14.
//  Copyright (c) 2014 Svpply. All rights reserved.
//

#import <SVNetworking/NSObject+SVBindings.h>
#import <SVNetworking/NSObject+SVMultibindings.h>
#import <SVNetworking/SVDataRequest.h>
#import <SVNetworking/SVDiskCache.h>
#import <SVNetworking/SVFunctional.h>
#import <SVNetworking/SVJSONRequest.h>
#import <SVNetworking/SVRemoteImage.h>
#import <SVNetworking/SVRemoteDataRequestResource.h>
#import <SVNetworking/SVRemoteDataResource.h>
#import <SVNetworking/SVRemoteJSONRequestResource.h>
#import <SVNetworking/SVRemoteJSONResource.h>
#import <SVNetworking/SVRemoteResource.h>
#import <SVNetworking/SVRequest.h>

Add new resource classes to the header.

Add new resource classes to the header.


// Test this without pch.
// RUN: clang-cc -include %S/asm.h -fsyntax-only -verify %s &&

// Test with pch.
// RUN: clang-cc -emit-pch -o %t %S/asm.h &&
// RUN: clang-cc -include-pch %t -fsyntax-only -verify %s

void call_f(void) { f(); }

void call_clobbers(void) { clobbers(); }

// Test this without pch.
// RUN: clang-cc -triple i386-unknown-unknown -include %S/asm.h -fsyntax-only -verify %s &&

// Test with pch.
// RUN: clang-cc -triple i386-unknown-unknown -emit-pch -o %t %S/asm.h &&
// RUN: clang-cc -triple i386-unknown-unknown -include-pch %t -fsyntax-only -verify %s

void call_f(void) { f(); }

void call_clobbers(void) { clobbers(); }

Make this test portable to non-x86 hosts, patch by Mark Cianciosa!

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


#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>

#include "Server.h"

char char_of_uint8(uint8_t x) {
  return (char) x;
}

uint32_t bufstrcpy(char *dst, const char *src) {
  /* The F* precondition guarantees that src is zero-terminated */
  return sprintf(dst, "%s", src);
}

uint32_t print_u32(char *dst, uint32_t i) {
  return sprintf(dst, "%"PRIu32, i);
}

#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>

#include "Server.h"

uint32_t bufstrcpy(char *dst, const char *src) {
  /* The F* precondition guarantees that src is zero-terminated */
  return sprintf(dst, "%s", src);
}

uint32_t print_u32(char *dst, uint32_t i) {
  return sprintf(dst, "%"PRIu32, i);
}

Remove function now implemented in kremlib


#include<stdlib.h>

volatile int i1 __attribute__ ((visibility ("protected")));
volatile int i2 __attribute__ ((visibility ("default")));
volatile int i3 __attribute__ ((visibility ("hidden")));
volatile int i4 __attribute__ ((visibility ("protected")));
volatile int i5 __attribute__ ((visibility ("internal")));

int main() {
	i1 = 542;
	i2 = 2341;
	i3 = 1;
	i4 = 4534;
	i5 = 12312;
	if (i1 != 542) {
		abort();
	}
	if (i2 != 2341) {
		abort();
	}
	if (i3 != 1) {
		abort();
	}
	if (i4 != 4534) {
		abort();
	}
	if (i5 != 12312) {
		abort();
	}
}

Add test case for visibility attributes

Add test case for visibility attributes


/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#ifdef E_TYPEDEFS
#else
#ifndef E_INT_CONFIG_THEME_H
#define E_INT_CONFIG_THEME_H

EAPI E_Config_Dialog *e_int_config_theme(E_Container *con, const char *params __UNUSED__);

EAPI void             e_int_config_theme_import_done(E_Config_Dialog *dia);
EAPI void             e_int_config_theme_update(E_Config_Dialog *dia, char *file);

#endif
#endif

/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#ifdef E_TYPEDEFS
#else
#ifndef E_INT_CONFIG_THEME_H
#define E_INT_CONFIG_THEME_H

EAPI E_Config_Dialog *e_int_config_theme(E_Container *con, const char *params __UNUSED__);

EAPI void             e_int_config_theme_import_done(E_Config_Dialog *dia);
EAPI void             e_int_config_theme_update(E_Config_Dialog *dia, char *file);
EAPI void             e_int_config_theme_web_done(E_Config_Dialog *dia);

#endif
#endif

Declare public function in header.

Declare public function in header.

git-svn-id: 0f3f1c46c6da7ffd142db61e503a7ff63af3a195@35475 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33


#include <linux/string.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/of.h>

#include "of_helpers.h"

/**
 * pseries_of_derive_parent - basically like dirname(1)
 * @path:  the full_name of a node to be added to the tree
 *
 * Returns the node which should be the parent of the node
 * described by path.  E.g., for path = "/foo/bar", returns
 * the node with full_name = "/foo".
 */
struct device_node *pseries_of_derive_parent(const char *path)
{
	struct device_node *parent;
	char *parent_path = "/";
	const char *tail = kbasename(path);

	/* reject if path is "/" */
	if (!strcmp(path, "/"))
		return ERR_PTR(-EINVAL);

	if (tail > path + 1) {
		parent_path = kstrndup(path, tail - path, GFP_KERNEL);
		if (!parent_path)
			return ERR_PTR(-ENOMEM);
	}
	parent = of_find_node_by_path(parent_path);
	if (strcmp(parent_path, "/"))
		kfree(parent_path);
	return parent ? parent : ERR_PTR(-EINVAL);
}

#include <linux/string.h>
#include <linux/err.h>
#include <linux/slab.h>
#include <linux/of.h>

#include "of_helpers.h"

/**
 * pseries_of_derive_parent - basically like dirname(1)
 * @path:  the full_name of a node to be added to the tree
 *
 * Returns the node which should be the parent of the node
 * described by path.  E.g., for path = "/foo/bar", returns
 * the node with full_name = "/foo".
 */
struct device_node *pseries_of_derive_parent(const char *path)
{
	struct device_node *parent;
	char *parent_path = "/";
	const char *tail;

	/* We do not want the trailing '/' character */
	tail = kbasename(path) - 1;

	/* reject if path is "/" */
	if (!strcmp(path, "/"))
		return ERR_PTR(-EINVAL);

	if (tail > path) {
		parent_path = kstrndup(path, tail - path, GFP_KERNEL);
		if (!parent_path)
			return ERR_PTR(-ENOMEM);
	}
	parent = of_find_node_by_path(parent_path);
	if (strcmp(parent_path, "/"))
		kfree(parent_path);
	return parent ? parent : ERR_PTR(-EINVAL);
}

powerpc/pseries: Correct string length in pseries_of_derive_parent()

Commit a030e1e4bbd085bbcfd0a23f8d355fcd41f39bed make a change to use
kstrndup() instead of kmalloc() + strlcpy() in the pseries_of_derive_parent()
routine that introduces a subtle change in the parent path name generated.
The kstrndup() routine will copy n characters followed by a terminating null,
whereas strlcpy() will copy n-1 characters and add a terminating null.

This slight difference results in having a parent path that includes the
tailing '/' character, "/cpus/" vs. "/cpus". This then causes the subsequent
call to of_find_node_by_path() to fail, and in the case of DLPAR add
operations the DLPAR request fails.

This patch decrements the pointer returned from kbasename() to point to the
'/' character before the base name instead of the base name. This then
adjusts the string length calculations to not include the trailing '/'
in the parent path name.

Signed-off-by: Nathan Fontenot <4b7bfe500077bf77c5456931a34b0b70e36e0bc6@linux.vnet.ibm.com>
Reviewed-by: Andy Shevchenko <74f0c009df510614346aa771cd21959b78cdb413@linux.intel.com>
Signed-off-by: Michael Ellerman <864f124608374e06e4da1fa5d2e47ed839b95411@ellerman.id.au>


#include "gc.h"
#include "runtime_vars.h"
#include "scheduler.h"

GC_Env* __get_GC_Env()
{
#ifdef MULTITHREAD
    return get_currentthread()->gcEnv;
#else
    return currentthread->gcEnv;
#endif
}

ThreadData* __mellow_get_cur_green_thread()
{
#ifdef MULTITHREAD
    return get_currentthread();
#else
    return currentthread;
#endif
}

Add function to get current green thread at-will


/*
 *   include/uapi/linux/cifs/cifs_mount.h
 *
 *   Author(s): Scott Lovenberg (scott.lovenberg@gmail.com)
 *
 *   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.
 *
 *   This library 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 Lesser General Public License for more details.
 */
#ifndef _CIFS_MOUNT_H
#define _CIFS_MOUNT_H

/* Max string lengths for cifs mounting options. */
#define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */
#define CIFS_MAX_USERNAME_LEN   256 /* reasonable max for current servers */
#define CIFS_MAX_PASSWORD_LEN   512 /* Windows max seems to be 256 wide chars */
#define CIFS_MAX_SHARE_LEN       80

#endif /* _CIFS_MOUNT_H */

/*
 *   include/uapi/linux/cifs/cifs_mount.h
 *
 *   Author(s): Scott Lovenberg (scott.lovenberg@gmail.com)
 *
 *   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.
 *
 *   This library 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 Lesser General Public License for more details.
 */
#ifndef _CIFS_MOUNT_H
#define _CIFS_MOUNT_H

/* Max string lengths for cifs mounting options. */
#define CIFS_MAX_DOMAINNAME_LEN 256 /* max fully qualified domain name */
#define CIFS_MAX_USERNAME_LEN   256 /* reasonable max for current servers */
#define CIFS_MAX_PASSWORD_LEN   512 /* Windows max seems to be 256 wide chars */
#define CIFS_MAX_SHARE_LEN      256 /* reasonable max share name length */

#endif /* _CIFS_MOUNT_H */

Expand max share name length to 256

cifs: Expand max share name length to 256

The old max share name length limit was 80 due to Windows NET SHARE
command not allowing more than that.  However, share names can be much
longer.  This is a more reasonable maximum share name length.

Signed-off-by: Scott Lovenberg <15023d7c1da44acb5cafa0fa8ca989be856d31b9@gmail.com>
Reviewed-by: Jeff Layton <4376fbf8623cd7b7c0232225289bb91cedc0a27f@redhat.com>
Signed-off-by: Steve French <51565b4e5841e493fd669866e11ea3c7c0d781cc@gmail.com>


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

#include "vp8_opencl.h"

#define CLAMP(x,min,max) if (x < min) x = min; else if ( x > max ) x = max;

const char *idctCompileOptions = "-Ivp8/common/opencl";
const char *idctllm_cl_file_name = "vp8/common/opencl/idctllm_cl.cl";

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

#include "vp8_opencl.h"

#define CLAMP(x,min,max) if (x < min) x = min; else if ( x > max ) x = max;

//External functions that are fallbacks if CL is unavailable
void vp8_short_idct4x4llm_c(short *input, short *output, int pitch);
void vp8_short_idct4x4llm_1_c(short *input, short *output, int pitch);
void vp8_dc_only_idct_add_c(short input_dc, unsigned char *pred_ptr, unsigned char *dst_ptr, int pitch, int stride);
void vp8_short_inv_walsh4x4_c(short *input, short *output);
void vp8_short_inv_walsh4x4_1_c(short *input, short *output);

const char *idctCompileOptions = "-Ivp8/common/opencl";
const char *idctllm_cl_file_name = "vp8/common/opencl/idctllm_cl.cl";

Declare C fallbacks in IDCT header.

Declare C fallbacks in IDCT header.


#ifndef __PACKET_TYPE_H__
#define __PACKET_TYPE_H__

enum PacketType
{
   INVALID,
   USER,
   SHARED_MEM_REQ,
   SHARED_MEM_EVICT,
   SHARED_MEM_RESPONSE,
   SHARED_MEM_UPDATE_UNEXPECTED,
   SHARED_MEM_ACK,
   SHARED_MEM_TERMINATE_THREADS,
   MCP_REQUEST_TYPE,
   MCP_RESPONSE_TYPE,
   MCP_UTILIZATION_UPDATE_TYPE,
   NUM_PACKET_TYPES
};

// This defines the different static network types
enum EStaticNetwork
   {
      STATIC_NETWORK_USER,
      STATIC_NETWORK_MEMORY,
      STATIC_NETWORK_SYSTEM,
      NUM_STATIC_NETWORKS
   };

// Packets are routed to a static network based on their type. This
// gives the static network to use for a given packet type.
static EStaticNetwork g_type_to_static_network_map[] __attribute__((unused)) =
   {
      STATIC_NETWORK_SYSTEM, // INVALID
      STATIC_NETWORK_USER,   // USER
      STATIC_NETWORK_MEMORY, // SM_REQ
      STATIC_NETWORK_MEMORY, // SM_EVICT
      STATIC_NETWORK_MEMORY, // SM_RESPONSE
      STATIC_NETWORK_MEMORY, // SM_UPDATE_UNEXPECTED
      STATIC_NETWORK_MEMORY, // SM_ACK
      STATIC_NETWORK_MEMORY, // SM_TERMINATE_THREADS
      STATIC_NETWORK_SYSTEM, // MCP_REQ
      STATIC_NETWORK_SYSTEM, // MCP_RESP
      STATIC_NETWORK_SYSTEM, // MCP_UTIL
   };

#endif

#ifndef __PACKET_TYPE_H__
#define __PACKET_TYPE_H__

enum PacketType
{
   INVALID,
   USER,
   SHARED_MEM_REQ,
   SHARED_MEM_EVICT,
   SHARED_MEM_RESPONSE,
   SHARED_MEM_UPDATE_UNEXPECTED,
   SHARED_MEM_ACK,
   SHARED_MEM_TERMINATE_THREADS,
   MCP_REQUEST_TYPE,
   MCP_RESPONSE_TYPE,
   MCP_UTILIZATION_UPDATE_TYPE,
   MCP_SYSTEM_TYPE,
   NUM_PACKET_TYPES
};

// This defines the different static network types
enum EStaticNetwork
   {
      STATIC_NETWORK_USER,
      STATIC_NETWORK_MEMORY,
      STATIC_NETWORK_SYSTEM,
      NUM_STATIC_NETWORKS
   };

// Packets are routed to a static network based on their type. This
// gives the static network to use for a given packet type.
static EStaticNetwork g_type_to_static_network_map[] __attribute__((unused)) =
   {
      STATIC_NETWORK_SYSTEM, // INVALID
      STATIC_NETWORK_USER,   // USER
      STATIC_NETWORK_MEMORY, // SM_REQ
      STATIC_NETWORK_MEMORY, // SM_EVICT
      STATIC_NETWORK_MEMORY, // SM_RESPONSE
      STATIC_NETWORK_MEMORY, // SM_UPDATE_UNEXPECTED
      STATIC_NETWORK_MEMORY, // SM_ACK
      STATIC_NETWORK_MEMORY, // SM_TERMINATE_THREADS
      STATIC_NETWORK_USER,   // MCP_REQ
      STATIC_NETWORK_USER,   // MCP_RESP
      STATIC_NETWORK_SYSTEM, // MCP_UTIL
      STATIC_NETWORK_SYSTEM, // MCP_SYSTEM
   };

#endif

[network] Expand MCP messages to have user (modeled) and system (magic) types.


// @(#)root/cont
// Author: Philippe Canal Aug 2013

/*************************************************************************
 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TListOfTypes
#define ROOT_TListOfTypes

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TListOfTypes                                                         //
//                                                                      //
// A collection of TDataType designed to hold the typedef information   //
// and numerical type information.  The collection is populated on      //
// demand.                                                              //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_THastTable
#include "THashTable.h"
#endif

class TDataType;

class TListOfTypes : public THashTable
{
public:
   TListOfTypes();

   using THashTable::FindObject;
   virtual TObject   *FindObject(const char *name) const;

   virtual TDataType *FindType(const char *name) const;

   ClassDef(TListOfTypes,3); // Specical container for the list of types.
};

#endif

// @(#)root/cont
// Author: Philippe Canal Aug 2013

/*************************************************************************
 * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_TListOfTypes
#define ROOT_TListOfTypes

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// TListOfTypes                                                         //
//                                                                      //
// A collection of TDataType designed to hold the typedef information   //
// and numerical type information.  The collection is populated on      //
// demand.                                                              //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#ifndef ROOT_THastTable
#include "THashTable.h"
#endif

class TDataType;

class TListOfTypes : public THashTable
{
public:
   TListOfTypes();

   using THashTable::FindObject;
   virtual TObject   *FindObject(const char *name) const;

   TDataType *FindType(const char *name) const;

   ClassDef(TListOfTypes,2); // Specical container for the list of types.
};

#endif

Remove unnecessary virtual keyword. Lower version number to minimun.


//
//  BotKit.h
//  BotKit
//
//  Created by Mark Adams on 9/28/12.
//  Copyright (c) 2012 thoughtbot. All rights reserved.
//

#import "BKCoreDataManager.h"
#import "BKManagedViewController.h"
#import "BKManagedTableViewController.h"
#import "NSObject+Coding.h"
#import "NSArray+ObjectAccess.h"
#import "NSDate+RelativeDates.h"
#import "UIColor+AdjustColor.h"
#import "UIColor+Serialization.h"
#import "NSArray+Filtering.h"

/*

TODOS:

BKImageLoader
 -imageWithContentsOfURL:completionHandler:
 -imageWithContentsOFURLPath:completionHandler:

UIImage:
 +imageWithContentsOfURLPath:

NSArray:
 -filteredArrayWhereKeys:matchValue:withMethod:
 -filteredArrayWhereKeys:containValue:caseInsensitive:diacritical:

NSURLRequest:
 +requestWithString:
 +requestWithURL:

NSDate:
 -dateStringWithFormat:
 -dateStringWithStyle:

*/

//
//  BotKit.h
//  BotKit
//
//  Created by Mark Adams on 9/28/12.
//  Copyright (c) 2012 thoughtbot. All rights reserved.
//

#import "BKCoreDataManager.h"
#import "BKManagedViewController.h"
#import "BKManagedTableViewController.h"
#import "NSObject+BKCoding.h"
#import "NSArray+ObjectAccess.h"
#import "NSDate+RelativeDates.h"
#import "UIColor+AdjustColor.h"
#import "UIColor+Serialization.h"
#import "NSArray+Filtering.h"

/*

TODOS:

BKImageLoader
 -imageWithContentsOfURL:completionHandler:
 -imageWithContentsOFURLPath:completionHandler:

UIImage:
 +imageWithContentsOfURLPath:

NSArray:
 -filteredArrayWhereKeys:matchValue:withMethod:
 -filteredArrayWhereKeys:containValue:caseInsensitive:diacritical:

NSURLRequest:
 +requestWithString:
 +requestWithURL:

NSDate:
 -dateStringWithFormat:
 -dateStringWithStyle:

*/

Fix reference to BKCoding category

Fix reference to BKCoding category


// RUN: clang -checker-simple -verify %s
// RUN: clang -checker-simple -analyzer-store-region -verify %s

struct s {
  int data;
  int data_array[10];
};

typedef struct {
  int data;
} STYPE;

void f(void) {
  int a[10];
  int (*p)[10];
  p = &a;
  (*p)[3] = 1;

  struct s d;
  struct s *q;
  q = &d;
  q->data = 3;
  d.data_array[9] = 17;
}

void f2() {
  char *p = "/usr/local";
  char (*q)[4];
  q = &"abc";
}

void f3() {
  STYPE s;
}

void f4() {
  int a[] = { 1, 2, 3};
  int b[3] = { 1, 2 };
}

Add test code for array initialization.

Add test code for array initialization.

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


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

#define QLA4XXX_DRIVER_VERSION	"5.04.00-k4"

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

#define QLA4XXX_DRIVER_VERSION	"5.04.00-k5"

Update driver version to 5.04.00-k5

qla4xxx: Update driver version to 5.04.00-k5

Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com>
Reviewed-by: Mike Christie <6fe105eefab41990d7ec714c6c25ade3095cdb48@cs.wisc.edu>
Signed-off-by: Christoph Hellwig <923f7720577207a44b32e59bbfbea59d27f1ae8e@lst.de>


#ifndef BANDIT_REGISTRATION_REGISTRAR_H
#define BANDIT_REGISTRATION_REGISTRAR_H

#include <bandit/registration/spec_registry.h>

namespace bandit {
  namespace detail {
    struct spec_registrar {
      spec_registrar(std::function<void()> func) {
        bandit::detail::specs().push_back(func);
      }
    };
  }
}

#define BANDIT_CONCAT2(a, b) a##b
#define BANDIT_CONCAT(a, b) BANDIT_CONCAT2(a, b)
#define BANDIT_ADD_COUNTER(a) SNOWHOUSE_CONCAT(a, __COUNTER__)

#define go_bandit \
  static bandit::detail::spec_registrar BANDIT_ADD_COUNTER(bandit_registrar_)

#define SPEC_BEGIN(name) \
  go_bandit([]{
#define SPEC_END \
  });
#endif

#ifndef BANDIT_REGISTRATION_REGISTRAR_H
#define BANDIT_REGISTRATION_REGISTRAR_H

#include <bandit/registration/spec_registry.h>

namespace bandit {
  namespace detail {
    struct spec_registrar {
      spec_registrar(std::function<void()> func) {
        bandit::detail::specs().push_back(func);
      }
    };
  }
}

#define BANDIT_CONCAT2(a, b) a##b
#define BANDIT_CONCAT(a, b) BANDIT_CONCAT2(a, b)
#define BANDIT_ADD_COUNTER(a) BANDIT_CONCAT(a, __COUNTER__)

#define go_bandit \
  static bandit::detail::spec_registrar BANDIT_ADD_COUNTER(bandit_registrar_)

#define SPEC_BEGIN(name) \
  go_bandit([]{
#define SPEC_END \
  });
#endif

Use BANDIT_CONCAT instead of SNOWHOUSE_CONCAT macro

Resolves #134


/*
 * This file is part of SpeakEasy.
 * Copyright (C) 2012  Lambert Clara <lambert.clara@yahoo.fr>
 *
 * 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/>.
 */

/**
 * @file    SE_CInputManager.h
 * @brief   Input devices manager
 *
 * @author  Lambert Clara <lambert.clara@yahoo.fr>
 * @date    Created : 2012-04-23
 */

#pragma once

#include "SE_IBaseManager.h"

class SE_CInputManager : public SE_IBaseManager
{
    public:
        explicit SE_CInputManager();
        ~SE_CInputManager();

        void startUp()  override;
        void shutDown() override;
};

/*
 * This file is part of SpeakEasy.
 * Copyright (C) 2012  Lambert Clara <lambert.clara@yahoo.fr>
 *
 * 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/>.
 */

/**
 * @file    SE_CInputManager.h
 * @brief   Input devices manager
 *
 * @author  Lambert Clara <lambert.clara@yahoo.fr>
 * @date    Created : 2012-04-23
 */

#pragma once

#include "SE_IBaseManager.h"

class SE_CInputManager : public SE_IBaseManager
{
    public:
        SE_CInputManager();
        ~SE_CInputManager();

        void startUp()  override;
        void shutDown() override;
};

Remove useless explicit keyword on constructors without arguments.


/*
 * QLogic Fibre Channel HBA Driver
 * Copyright (c)  2003-2013 QLogic Corporation
 *
 * See LICENSE.qla2xxx for copyright and licensing details.
 */
/*
 * Driver version
 */
#define QLA2XXX_VERSION      "8.06.00.08-k"

#define QLA_DRIVER_MAJOR_VER	8
#define QLA_DRIVER_MINOR_VER	6
#define QLA_DRIVER_PATCH_VER	0
#define QLA_DRIVER_BETA_VER	0

/*
 * QLogic Fibre Channel HBA Driver
 * Copyright (c)  2003-2013 QLogic Corporation
 *
 * See LICENSE.qla2xxx for copyright and licensing details.
 */
/*
 * Driver version
 */
#define QLA2XXX_VERSION      "8.06.00.12-k"

#define QLA_DRIVER_MAJOR_VER	8
#define QLA_DRIVER_MINOR_VER	6
#define QLA_DRIVER_PATCH_VER	0
#define QLA_DRIVER_BETA_VER	0

[SCSI] qla2xxx: Update the driver version to 8.06.00.12-k.

Signed-off-by: Giridhar Malavali <799b6491fce2c7a80b5fedcf9a728560cc9eb954@qlogic.com>
Signed-off-by: Saurav Kashyap <88d6fd94e71a9ac276fc44f696256f466171a3c0@qlogic.com>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>


// RUN: %llvmgcc -std=gnu99 %s -S -o - | grep ".*alloca.*align 32"

extern void bar(int[]);

void foo(int a)
{
  int var[a] __attribute__((__aligned__(32)));
  bar(var);
  return;
}

// RUN: %llvmgcc -std=gnu99 %s -S -o - | grep ".*alloca.*align 16"

extern void bar(int[]);

void foo(int a)
{
  int var[a] __attribute__((__aligned__(16)));
  bar(var);
  return;
}

Update this to use a "valid" alignment.

Update this to use a "valid" alignment.

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