#ifndef __MORDOR_VERSION_H__
#define __MORDOR_VERSION_H__

// OS
#ifdef _WIN32
#   define WINDOWS
#else
#   define POSIX
#endif
#ifdef __CYGWIN__
#   define WINDOWS
#   define CYGWIN
#endif

#if defined(linux) || defined(__linux__)
#   define LINUX
#endif

#ifdef __APPLE__
#   define OSX
#   ifndef BSD
#       define BSD
#   endif
#endif

#ifdef __FreeBSD__
#   define FREEBSD
#   define BSD
#endif

#ifdef WINDOWS
#define MORDOR_NATIVE(win32, posix) win32
#else
#define MORDOR_NATIVE(win32, posix) posix
#endif

// Architecture
#ifdef _MSC_VER
#   define MSVC
#   ifdef _M_X64
#       define X86_64
#   elif defined(_M_IX86)
#       define X86
#   endif
#endif

#ifdef __GNUC__
#   define GCC
#   ifdef __x86_64
#       define X86_64
#   elif defined(i386)
#       define X86
#   elif defined(__ppc__)
#       define PPC
#   elif defined(__arm__)
#       define ARM
#   endif
#endif

#ifdef MSVC
#ifndef _DEBUG
#define NDEBUG
#endif
#endif

#endif

#ifndef __MORDOR_VERSION_H__
#define __MORDOR_VERSION_H__

// OS
#ifdef _WIN32
#   define WINDOWS
#else
#   define POSIX
#endif
#ifdef __CYGWIN__
#   define WINDOWS
#   define CYGWIN
#endif

#if defined(linux) || defined(__linux__)
#   define LINUX
#endif

#ifdef __APPLE__
#   define OSX
#   ifndef BSD
#       define BSD
#   endif
#endif

#ifdef __FreeBSD__
#   define FREEBSD
#   define BSD
#endif

#ifdef WINDOWS
#define MORDOR_NATIVE(win32, posix) win32
#else
#define MORDOR_NATIVE(win32, posix) posix
#endif

// Architecture
#ifdef _MSC_VER
#   define MSVC
#   ifdef _M_X64
#       define X86_64
#   elif defined(_M_IX86)
#       define X86
#   endif
#endif

#ifdef __GNUC__
#   define GCC
#   ifdef __x86_64
#       define X86_64
#   elif defined(i386)
#       define X86
#   elif defined(__ppc__)
#       define PPC
#   elif defined(__arm__)
#       define ARM
#   endif
#endif

#ifdef MSVC
#   ifndef _DEBUG
#       ifndef NDEBUG
#           define NDEBUG
#       endif
#   endif
#endif

#endif

Fix compiler warning in release

Fix compiler warning in release

Fix long standing warning that appears multiple time in Stash
release build:

warning C4005: 'NDEBUG' : macro redefinition

(example:
http://build.dechocorp.com/job/sync-release/arch=i386,dist=windows/2043/console)

If NDEBUG is already defined there is no need to define it

Change-Id: I1573a99f0908e879642c3c33ee9f0dda22e885d1
Signed-off-by: Andrew Skowronski <96924f7a4dbe24093bb2da18f50a76703cb4a362@mozy.com>
Reviewed-on: https://gerrit.dechocorp.com/37185
Reviewed-by: Jeff Tulley <85f87182ef9726107fb7bae84686c93fca64c9ab@vmware.com>
Reviewed-by: Jenkins <49695b0f9c673fd73dab0ff3f84b5ced9302cc6a@mozy.com>


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

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

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

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

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

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

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

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


/*A C calculator...of sorts*/
/* An attempt at a C calculator from stuff read so far */

#include<stdio.h>

/* function for addition */

int add(int input1, int input2)
{
  int result;

  result = input1 + input2;

  return result;
}

/* function for multiplication */

int multi(int input1, int input2)
{
  int result;

  result = input1 * input2;

  return result;
}

/* function for subtraction */

int sub(int input1, int input2)
{
  int result;

  result = input1 - input2;

  return result;
}

/* division function */

float div(float input1, float input2)
{
  float result;

  result = input1 / input2;

  return result;
}

int main()
{
  int a, b, output;
  float output2;
  char myinput;

  printf("Please enter a number\n");
  scanf("%d", &a);
  printf("Enter another number\n");
  scanf("%d", &b);
  printf("What calculation would you like to perform?\n");
  printf("a) addition\n");
  printf("b) mulitplication\n");
  printf("c) subtraction\n");
  printf("d) division\n");
  scanf(" %c", &myinput);

  /* switch statement to run certain calculations */
  switch(myinput)
  {
    case 'a':
      {
        printf("Adding the numbers entered...\n");
        output = add(a, b);
        printf("The sum of %d and %d is: %d\n", a, b, output);
        break;
      }
    case 'b':
      {
        printf("Multiplication chosen\n");
        output = multi(a, b);
        printf("Multiplying %d and %d equals %d\n", a, b , output);
        break;
      }
    case 'c':
      {
        printf("Subtracting %d from %d\n", a, b);
        output = sub(a, b);
        printf("%d minus %d is: %d\n", a, b, output);
        break;
      }
    case 'd':
      {
        printf("Divison program running...\n");
        output2 = div(a, b);
        printf("Division of %d by %d equals %f\n", a, b, output2);
        break;
      }
    default:
      {
        printf("Invalid entry\n");
        printf("Please run again\n");
      }
  }

  return 0;
}

Add another sample file for C

Add another sample file for C


#include <linux/init.h>
#include <asm/io.h>
#include <asm/time.h>

#define QEMU_PORT_BASE 0xb4000000

static void __init qemu_timer_setup(struct irqaction *irq)
{
	/* set the clock to 100 Hz */
	outb_p(0x34,0x43);		/* binary, mode 2, LSB/MSB, ch 0 */
	outb_p(LATCH & 0xff , 0x40);	/* LSB */
	outb(LATCH >> 8 , 0x40);	/* MSB */
	setup_irq(0, irq);
}

void __init plat_setup(void)
{
	set_io_port_base(QEMU_PORT_BASE);
	board_timer_setup = qemu_timer_setup;
}

#include <linux/init.h>
#include <asm/io.h>
#include <asm/time.h>

#define QEMU_PORT_BASE 0xb4000000

const char *get_system_type(void)
{
	return "Qemu";
}

static void __init qemu_timer_setup(struct irqaction *irq)
{
	/* set the clock to 100 Hz */
	outb_p(0x34,0x43);		/* binary, mode 2, LSB/MSB, ch 0 */
	outb_p(LATCH & 0xff , 0x40);	/* LSB */
	outb(LATCH >> 8 , 0x40);	/* MSB */
	setup_irq(0, irq);
}

void __init plat_setup(void)
{
	set_io_port_base(QEMU_PORT_BASE);
	board_timer_setup = qemu_timer_setup;
}

Implement get_system_type() for Qemu to get procfs-enabled kernels to
link.

Signed-off-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org>


/*
 *  Selftest code
 */

#ifndef DUK_SELFTEST_H_INCLUDED
#define DUK_SELFTEST_H_INCLUDED

DUK_INTERNAL_DECL void duk_selftest_run_tests(void);

#endif  /* DUK_SELFTEST_H_INCLUDED */

/*
 *  Selftest code
 */

#ifndef DUK_SELFTEST_H_INCLUDED
#define DUK_SELFTEST_H_INCLUDED

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

#endif  /* DUK_SELFTEST_H_INCLUDED */

Fix compile warning when selftests disabled


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

// previously failed in line 7 with "exception Invalid_argument("Cilfacade.get_ikind: non-integer type double ")"
//(same error as in sv-comp: float-newlib/float_req_bl_0220a.c)
// similar error also occured in the additional examples when branching on a float argument
int main()
{
  double z;

  z = 1 - 1.0;

  assert(z == 0.); // SUCCESS

  if (0.)
    ;

  if (0 == (0. + 1.))
    ;
  assert(0); // FAIL
}

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

// previously failed in line 7 with "exception Invalid_argument("Cilfacade.get_ikind: non-integer type double ")"
//(same error as in sv-comp: float-newlib/float_req_bl_0220a.c)
// similar error also occurred in the additional examples when branching on a float argument
int main()
{
  double z;
  int x;

  z = 1 - 1.0;

  assert(z == 0.); // SUCCESS

  if (0.) { x = z;}

  if (0 == (0. + 1.)) { x = z;}

  assert(0); // FAIL
}

Modify test 57/12 to actually trigger the issue


/* -----------------------------------------------------------------------------
 *
 * (c) The GHC Team, 2000-2015
 *
 * RTS Symbols
 *
 * ---------------------------------------------------------------------------*/

#ifndef RTS_SYMBOLS_H
#define RTS_SYMBOLS_H

#ifdef LEADING_UNDERSCORE
#define MAYBE_LEADING_UNDERSCORE_STR(s) ("_" s)
#else
#define MAYBE_LEADING_UNDERSCORE_STR(s) (s)
#endif

typedef struct _RtsSymbolVal {
    const char   *lbl;
    void   *addr;
} RtsSymbolVal;

extern  RtsSymbolVal rtsSyms[];

#endif /* RTS_SYMBOLS_H */

/* -----------------------------------------------------------------------------
 *
 * (c) The GHC Team, 2000-2015
 *
 * RTS Symbols
 *
 * ---------------------------------------------------------------------------*/

#ifndef RTS_SYMBOLS_H
#define RTS_SYMBOLS_H

#include "ghcautoconf.h"

#ifdef LEADING_UNDERSCORE
#define MAYBE_LEADING_UNDERSCORE_STR(s) ("_" s)
#else
#define MAYBE_LEADING_UNDERSCORE_STR(s) (s)
#endif

typedef struct _RtsSymbolVal {
    const char   *lbl;
    void   *addr;
} RtsSymbolVal;

extern  RtsSymbolVal rtsSyms[];

#endif /* RTS_SYMBOLS_H */

Fix the DYNAMIC_GHC_PROGRAMS=NO build on Mac/Windows

LEADING_UNDERSCORE is defined in a header file, so we need to #include
that file where we use LEADING_UNDERSCORE.

Reviewed By: austin

Differential Revision: https://phabricator.haskell.org/D1382


//
//  TWTValidation.h
//  TWTValidation
//
//  Created by Prachi Gauriar on 3/28/2014.
//  Copyright (c) 2014 Two Toasters, LLC. All rights reserved.
//

@import Foundation;

#import <TWTValidation/TWTValidator.h>

#import <TWTValidation/TWTBlockValidator.h>

#import <TWTValidation/TWTCompoundValidator.h>

#import <TWTValidation/TWTValueValidator.h>
#import <TWTValidation/TWTNumberValidator.h>
#import <TWTValidation/TWTStringValidator.h>

#import <TWTValidation/TWTValidationErrors.h>

//
//  TWTValidation.h
//  TWTValidation
//
//  Created by Prachi Gauriar on 3/28/2014.
//  Copyright (c) 2014 Two Toasters, LLC. All rights reserved.
//

@import Foundation;

#import <TWTValidation/TWTValidator.h>
#import <TWTValidation/TWTValidationErrors.h>

#import <TWTValidation/TWTBlockValidator.h>

#import <TWTValidation/TWTCompoundValidator.h>

#import <TWTValidation/TWTValueValidator.h>
#import <TWTValidation/TWTNumberValidator.h>
#import <TWTValidation/TWTStringValidator.h>

#import <TWTValidation/TWTCollectionValidator.h>
#import <TWTValidation/TWTKeyedCollectionValidator.h>
#import <TWTValidation/TWTKeyValuePairValidator.h>

#import <TWTValidation/TWTValidatingObject.h>

Add new classes to umbrella header

Add new classes to umbrella header


#ifndef REDCARPET_H__
#define REDCARPET_H__

#define RSTRING_NOT_MODIFIED
#include "ruby.h"
#include <stdio.h>

#ifdef HAVE_RUBY_ENCODING_H
#	include <ruby/encoding.h>
#	define redcarpet_str_new(data, size, enc) rb_enc_str_new(data, size, enc)
#else
#	define redcarpet_str_new(data, size, enc) rb_str_new(data, size)
#endif

#include "markdown.h"
#include "html.h"

#define CSTR2SYM(s) (ID2SYM(rb_intern((s))))

void Init_redcarpet_rndr();

struct redcarpet_renderopt {
	struct html_renderopt html;
	VALUE link_attributes;
	VALUE self;
	VALUE base_class;
#ifdef HAVE_RUBY_ENCODING_H
	rb_encoding *active_enc;
#endif
};

struct rb_redcarpet_rndr {
	struct sd_callbacks callbacks;
	struct redcarpet_renderopt options;
};

#endif

#ifndef REDCARPET_H__
#define REDCARPET_H__

#define RSTRING_NOT_MODIFIED
#include "ruby.h"
#include <stdio.h>

#include <ruby/encoding.h>
#define redcarpet_str_new(data, size, enc) rb_enc_str_new(data, size, enc)

#include "markdown.h"
#include "html.h"

#define CSTR2SYM(s) (ID2SYM(rb_intern((s))))

void Init_redcarpet_rndr();

struct redcarpet_renderopt {
	struct html_renderopt html;
	VALUE link_attributes;
	VALUE self;
	VALUE base_class;
	rb_encoding *active_enc;
};

struct rb_redcarpet_rndr {
	struct sd_callbacks callbacks;
	struct redcarpet_renderopt options;
};

#endif

Remove encoding conditionals that are no longer required

These are no longer needed since we don't support Ruby 1.8.x anymore.


#include "common.h"
#include "tube.h"

int FdTube;
FILE *TextTube;

void InitTubes(int textTube, int fdTube) {
    SetCloexec(textTube);
    SetCloexec(fdTube);
    TextTube = fdopen(textTube, "a+");
    DieIf(TextTube == 0, "fdopen");
    FdTube = fdTube;
}

#include "common.h"
#include "tube.h"

int FdTube;
FILE *TextTube;

void InitTubes(int textTube, int fdTube) {
    SetCloexec(textTube);
    SetCloexec(fdTube);
    TextTube = fdopen(textTube, "a+");
    setlinebuf(TextTube);
    DieIf(TextTube == 0, "fdopen");
    FdTube = fdTube;
}

Put TextTube to line buffer mode

Server: Put TextTube to line buffer mode


/*
 * $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(SessionReuse)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(Response)
SLTM(Status)
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(SessionReuse)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(HandlingPass)
SLTM(HandlingPipe)
SLTM(Request)
SLTM(Response)
SLTM(Status)
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 shmlog tags for pipe and pass handling

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


#ifndef __MOTORS_H_
#define __MOTORS_H_

#include <Servo.h>

#define MIDPOINT 128

class Motors {
  private:
    Servo port, vertical, starbord;
    int port_pin, vertical_pin, starbord_pin;

  public:

    Motors(int p_pin, int v_pin, int s_pin);
    void reset();
    void go(int p, int v, int s);
    void stop();

};

#endif

#ifndef __MOTORS_H_
#define __MOTORS_H_

#include <Servo.h>

#define MIDPOINT 90

class Motors {
  private:
    Servo port, vertical, starbord;
    int port_pin, vertical_pin, starbord_pin;

  public:

    Motors(int p_pin, int v_pin, int s_pin);
    void reset();
    void go(int p, int v, int s);
    void stop();

};

#endif

Set MIDPOINT to 90 instead of 128 (servo lib goes from 0 to 180)


/* This file should provide inline versions of string functions.

   Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.

   This file should define __STRING_INLINES if functions are actually defined
   as inlines.  */

#ifndef _BITS_STRING_H
#define _BITS_STRING_H	1

#define _STRING_ARCH_unaligned   0

#if defined(__GNUC__) && !defined(__cplusplus)

static inline unsigned long __libc_detect_null(unsigned long w)
{
  unsigned long mask = 0x7f7f7f7f;
  if (sizeof(long) == 8)
    mask = ((mask << 16) << 16) | mask;
  return ~(((w & mask) + mask) | w | mask);
}

#endif /* __GNUC__ && !__cplusplus */

#endif /* bits/string.h */

/* This file should provide inline versions of string functions.

   Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.

   This file should define __STRING_INLINES if functions are actually defined
   as inlines.  */

#ifndef _BITS_STRING_H
#define _BITS_STRING_H	1

#define _STRING_ARCH_unaligned   0

#if defined(__GNUC__) && !defined(__cplusplus)

static __inline__ unsigned long __libc_detect_null(unsigned long w)
{
  unsigned long mask = 0x7f7f7f7f;
  if (sizeof(long) == 8)
    mask = ((mask << 16) << 16) | mask;
  return ~(((w & mask) + mask) | w | mask);
}

#endif /* __GNUC__ && !__cplusplus */

#endif /* bits/string.h */

Change a "inline" to "__inline__"

Change a "inline" to "__inline__"

So "inline" isn't complient C, which means strict packages won't build
with it.  This uses "__inline__" instead, which is ANSI C.  This patch
is required to get freetype to build.


#include <runtime.h>
#include <cgocall.h>
void runtime·asmstdcall(void *c);

void ·cSyscall(WinCall *c) {
	runtime·cgocall(runtime·asmstdcall, c);
}

#include <runtime.h>
#include <cgocall.h>
void runtime·asmstdcall(void *c);

void ·cSyscall(LibCall *c) {
	runtime·cgocall(runtime·asmstdcall, c);
}

Update for renamed struct in runtime.h (WinCall to LibCall)


#ifndef __math_compat_h
#define __math_compat_h

/* Define isnan and isinf on Windows/MSVC */

#ifndef HAVE_DECL_ISNAN
# ifdef HAVE_DECL__ISNAN
#include <float.h>
#define isnan(x) _isnan(x)
# endif
#endif

#ifndef HAVE_DECL_ISINF
# ifdef HAVE_DECL__FINITE
#include <float.h>
#define isinf(x) (!_finite(x))
# endif
#endif

#ifndef HAVE_DECL_NAN
#error This platform does not have nan()
#endif

#ifndef HAVE_DECL_INFINITY
#error This platform does not have INFINITY
#endif

#endif

#ifndef __math_compat_h
#define __math_compat_h

/* Define isnan, isinf, infinity and nan on Windows/MSVC */

#ifndef HAVE_DECL_ISNAN
# ifdef HAVE_DECL__ISNAN
#include <float.h>
#define isnan(x) _isnan(x)
# endif
#endif

#ifndef HAVE_DECL_ISINF
# ifdef HAVE_DECL__FINITE
#include <float.h>
#define isinf(x) (!_finite(x))
# endif
#endif

#ifndef HAVE_DECL_INFINITY
#include <float.h>
#define INFINITY (DBL_MAX + DBL_MAX)
#define HAVE_DECL_INFINITY
#endif

#ifndef HAVE_DECL_NAN
#define NAN (INFINITY - INFINITY)
#define HAVE_DECL_NAN
#endif

#endif

Define INFINITY and NAN when missing

Define INFINITY and NAN when missing


/*
 Copyright 2009-2013 Urban Airship Inc. All rights reserved.

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

 1. Redistributions of source code must retain the above copyright notice, this
 list of conditions and the following disclaimer.

 2. Redistributions in binaryform must reproduce the above copyright notice,
 this list of conditions and the following disclaimer in the documentation
 and/or other materials provided withthe distribution.

 THIS SOFTWARE IS PROVIDED BY THE URBAN AIRSHIP INC``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 URBAN AIRSHIP INC 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.
 */

#import <Foundation/Foundation.h>

@interface UAAction : NSObject

@end

/*
 Copyright 2009-2013 Urban Airship Inc. All rights reserved.

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

 1. Redistributions of source code must retain the above copyright notice, this
 list of conditions and the following disclaimer.

 2. Redistributions in binaryform must reproduce the above copyright notice,
 this list of conditions and the following disclaimer in the documentation
 and/or other materials provided withthe distribution.

 THIS SOFTWARE IS PROVIDED BY THE URBAN AIRSHIP INC``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 URBAN AIRSHIP INC 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.
 */

#import <Foundation/Foundation.h>
#import "UAActionArguments.h"

typedef BOOL (^UAActionPredicate)(UAActionArguments *);

@interface UAAction : NSObject

@end

Add action predicate block typedef

Add action predicate block typedef


#ifndef MAYATYPEID_H
#define MAYATYPEID_H

// Inside Maya, the type IDs are used to identify nodes and dependency graph
// data. So when we create custom nodes and data in any Maya plugins, they must
// all be assigned unique IDs. For any plugins that will be used outside of
// Side Effects, we *must* assign globally unique IDs. However, for plugins
// that are only used internally inside Side Effects, we could assign the
// "internal IDs" (0x0 - 0x7ffff).

// Some important notes from the Maya SDK docs:

//     - In Maya, both intrinsic and user-defined Maya Objects are registered
//     and recognized by their type identifier or type id.

//     - It is very important to note that these ids are written into the Maya
//     binary file format. So, once an id is assigned to a node or data type it
//     can never be changed while any existing Maya file contains an instance
//     of that node or data type. If a change is made, such files will become
//     unreadable.

//     - For plug-ins that will forever be internal to your site use the
//     constructor that takes a single unsigned int parameter.  The numeric
//     range 0 - 0x7ffff (524288 ids) has been reserved for such plug-ins.

// For more information on these IDs, please refer to the documentation for
// MTypeId in the Maya SDK.

// Globally unique IDs assigned to Side Effects:
//     - 0x0011E240 - 0x0011E2BF : 128 IDs requested by Andrew Wong on 2013-07-17 13:55

// More IDs can be requested through the Autodesk Developer Network.

// Globally unique IDs being used by Side Effects
enum MayaTypeID
{
};

#endif

Add header file for tracking our Maya type IDs


/*
 *  Prototype loop is tricky to handle internally and must not cause e.g.
 *  GC failures.  Exercise a few common paths.
 */

/*===
*** test_1 (duk_safe_call)
first gc
make unreachable
second gc
==> rc=0, result='undefined'
===*/

static duk_ret_t test_1(duk_context *ctx) {
	duk_push_object(ctx);
	duk_push_object(ctx);
	duk_dup(ctx, 0);
	duk_set_prototype(ctx, 1);
	duk_dup(ctx, 1);
	duk_set_prototype(ctx, 0);

	/* Both objects are now in a prototype loop.  Force garbage
	 * collection to ensure nothing breaks.
	 */

	printf("first gc\n"); fflush(stdout);
	duk_gc(ctx, 0);

	/* Make the objects unreachable and re-run GC.  This triggers
	 * e.g. finalizer checks.
	 */

	printf("make unreachable\n"); fflush(stdout);
	duk_set_top(ctx, 0);

	printf("second gc\n"); fflush(stdout);
	duk_gc(ctx, 0);

	return 0;
}

void test(duk_context *ctx) {
	TEST_SAFE_CALL(test_1);
}

Add an API testcase for prototype loop and GC


// A current_time function for use in the tests.  Returns time in
// milliseconds.

#ifdef _WIN32
extern "C" bool QueryPerformanceCounter(uint64_t *);
extern "C" bool QueryPerformanceFrequency(uint64_t *);
double current_time() {
    uint64_t t, freq;
    QueryPerformanceCounter(&t);
    QueryPerformanceFrequency(&freq);
    return (t * 1000.0) / freq;
}
#else
#include <sys/time.h>
double current_time() {
    static bool first_call = true;
    static timeval reference_time;
    if (first_call) {
        first_call = false;
        gettimeofday(&reference_time, NULL);
        return 0.0;
    } else {
        timeval t;
        gettimeofday(&t, NULL);
        return ((t.tv_sec - reference_time.tv_sec)*1000.0 +
                (t.tv_usec - reference_time.tv_usec)/1000.0);
    }
}
#endif

// A current_time function for use in the tests.  Returns time in
// milliseconds.

#ifdef _WIN32
#include <Windows.h>
double current_time() {
    LARGE_INTEGER freq, t;
    QueryPerformanceCounter(&t);
    QueryPerformanceFrequency(&freq);
    return (t.QuadPart * 1000.0) / freq.QuadPart;
}
// Gross, these come from Windows.h
#undef max
#undef min
#else
#include <sys/time.h>
double current_time() {
    static bool first_call = true;
    static timeval reference_time;
    if (first_call) {
        first_call = false;
        gettimeofday(&reference_time, NULL);
        return 0.0;
    } else {
        timeval t;
        gettimeofday(&t, NULL);
        return ((t.tv_sec - reference_time.tv_sec)*1000.0 +
                (t.tv_usec - reference_time.tv_usec)/1000.0);
    }
}
#endif

Fix build of tutorials that require libpng under Visual Studio.


/*
  This file is part of Grantlee.

  Copyright (c) 2011 Stephen Kelly <steveire@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 Licence, 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.

  You should have received a copy of the GNU Lesser General Public
  License along with this library.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef GRANTLEE_TEXTDOCUMENT_H
#define GRANTLEE_TEXTDOCUMENT_H

#include "grantlee/abstractmarkupbuilder.h"
#include "grantlee/bbcodebuilder.h"
#include "grantlee/markupdirector.h"
#include "grantlee/plaintextmarkupbuilder.h"
#include "grantlee/texthtmlbuilder.h"
#include "grantlee/mediawikimarkupbuilder.h"
#include "grantlee/grantlee_gui_export.h"

#endif

Add a convenience header for the textdocument library.


/**
 * FreeIMU calibration header. Automatically generated by FreeIMU_GUI.
 * Do not edit manually unless you know what you are doing.
*/

#define CALIBRATION_H

const int acc_off_x = 426;
const int acc_off_y = -141;
const int acc_off_z = -540;
const float acc_scale_x = 16255.420145;
const float acc_scale_y = 16389.952315;
const float acc_scale_z = 16598.537030;

const int magn_off_x = 222;
const int magn_off_y = -190;
const int magn_off_z = -67;
const float magn_scale_x = 488.787511;
const float magn_scale_y = 513.264462;
const float magn_scale_z = 434.896123;

Backup of APM 2.5.2 calibration file

Backup of APM 2.5.2 calibration file


#include "redislite.h"
#include "page_string.h"
#include "util.h"
#include <string.h>
#include <stdlib.h>
#include <math.h>

void redislite_free_freelist(void *_db, void *_page)
{
	redislite_page_string* page = (redislite_page_string*)_page;
	if (page == NULL) return;
	redislite_free(page);
}

void redislite_write_freelist(void *_db, unsigned char *data, void *_page)
{
	redislite *db = (redislite*)_db;
	redislite_page_string* page = (redislite_page_string*)_page;
	if (page == NULL) return;

	data[0] = REDISLITE_PAGE_TYPE_FREELIST;
	redislite_put_4bytes(&data[1], 0); // reserverd
	redislite_put_4bytes(&data[5], page->right_page);
	int size = db->page_size-9;
	memset(&data[9], 0, size);
}

void *redislite_read_freelist(void *_db, unsigned char *data)
{
	redislite_page_string* page = redislite_malloc(sizeof(redislite_page_string));

	page->right_page = redislite_get_4bytes(&data[5]);

	return page;
}

#include "redislite.h"
#include "page_string.h"
#include "util.h"
#include <string.h>
#include <stdlib.h>
#include <math.h>

void redislite_free_freelist(void *_db, void *_page)
{
	redislite_page_string* page = (redislite_page_string*)_page;
	if (page == NULL) return;
	redislite_free(page);
}

void redislite_write_freelist(void *_db, unsigned char *data, void *_page)
{
	redislite *db = (redislite*)_db;
	redislite_page_string* page = (redislite_page_string*)_page;
	if (page == NULL) return;

	redislite_put_4bytes(&data[0], 0); // reserverd
	redislite_put_4bytes(&data[4], page->right_page);
	int size = db->page_size-8;
	memset(&data[8], 0, size);
}

void *redislite_read_freelist(void *_db, unsigned char *data)
{
	redislite_page_string* page = redislite_malloc(sizeof(redislite_page_string));
	page->right_page = redislite_get_4bytes(&data[8]);
	return page;
}

Remove unused byte in freelist

Remove unused byte in freelist


#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <orc/orconce.h>
#include <orc/orcdebug.h>

#if defined(HAVE_THREAD_PTHREAD)

#include <pthread.h>

static pthread_mutex_t once_mutex = PTHREAD_MUTEX_INITIALIZER;

void
_orc_once_init (void)
{

}

void
orc_once_mutex_lock (void)
{
  pthread_mutex_lock (&once_mutex);
}

void
orc_once_mutex_unlock (void)
{
  pthread_mutex_unlock (&once_mutex);
}

#elif defined(HAVE_THREAD_WIN32)

#include <windows.h>

static CRITICAL_SECTION once_mutex;

void
_orc_once_init (void)
{
  InitializeCriticalSection (&once_mutex);
}

void
orc_once_mutex_lock (void)
{
  EnterCriticalSection (&once_mutex);
}

void
orc_once_mutex_unlock (void)
{
  LeaveCriticalSection (&once_mutex);
}

#else

void
_orc_once_init (void)
{
}

void
orc_once_mutex_lock (void)
{
}

void
orc_once_mutex_unlock (void)
{
}

#endif

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <orc/orconce.h>
#include <orc/orcdebug.h>

#if defined(HAVE_THREAD_PTHREAD)

#include <pthread.h>

static pthread_mutex_t once_mutex = PTHREAD_MUTEX_INITIALIZER;

void
_orc_once_init (void)
{

}

void
orc_once_mutex_lock (void)
{
  pthread_mutex_lock (&once_mutex);
}

void
orc_once_mutex_unlock (void)
{
  pthread_mutex_unlock (&once_mutex);
}

#elif defined(HAVE_THREAD_WIN32)

#include <windows.h>

static CRITICAL_SECTION once_mutex;

void
_orc_once_init (void)
{
}

void
orc_once_mutex_lock (void)
{
  EnterCriticalSection (&once_mutex);
}

void
orc_once_mutex_unlock (void)
{
  LeaveCriticalSection (&once_mutex);
}

int
DllMain (HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
  if (dwReason == DLL_PROCESS_ATTACH) {
    InitializeCriticalSection (&once_mutex);
  }
  return 1;
}

#else

void
_orc_once_init (void)
{
}

void
orc_once_mutex_lock (void)
{
}

void
orc_once_mutex_unlock (void)
{
}

#endif

Fix initialization of once mutex

win32: Fix initialization of once mutex


/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#ifndef THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_
#define THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_

#include <private/internal-components.h>
static const struct hwloc_component* hwloc_static_components[] = {
    &hwloc_noos_component,      &hwloc_xml_component,
    &hwloc_synthetic_component, &hwloc_xml_nolibxml_component,
    &hwloc_linux_component,     &hwloc_linuxio_component,
#ifdef PLATFORM_IS_X86
    &hwloc_x86_component,
#endif
    NULL};

#endif  // THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_

/* Copyright 2019 The TensorFlow Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/

#ifndef THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_
#define THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_

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

#endif  // THIRD_PARTY_HWLOC_STATIC_COMPONENTS_H_

Include all x86 defines macros for hwloc

Copied from tensorflow/core/platform/platform.h#L59
Look for both gcc/clang and Visual Studio macros indicating we're compiling
for an x86 device.


//
//  MASCompositeConstraint.h
//  Masonry
//
//  Created by Jonas Budelmann on 21/07/13.
//  Copyright (c) 2013 cloudling. All rights reserved.
//

#import "MASConstraint.h"
#import "MASUtilities.h"

/**
 *	A group of MASConstraint objects
 *  conforms to MASConstraint
 */
@interface MASCompositeConstraint : NSObject <MASConstraint>

/**
 *	Creates a composite with a predefined array of children
 *
 *	@param	view	first item view
 *	@param	children	child MASConstraints
 *
 *	@return	a composite constraint
 */
- (id)initWithChildren:(NSArray *)children;

@end

//
//  MASCompositeConstraint.h
//  Masonry
//
//  Created by Jonas Budelmann on 21/07/13.
//  Copyright (c) 2013 cloudling. All rights reserved.
//

#import "MASConstraint.h"
#import "MASUtilities.h"

/**
 *	A group of MASConstraint objects
 *  conforms to MASConstraint
 */
@interface MASCompositeConstraint : NSObject <MASConstraint>

/**
 *	Creates a composite with a predefined array of children
 *
 *	@param	children	child MASConstraints
 *
 *	@return	a composite constraint
 */
- (id)initWithChildren:(NSArray *)children;

@end

Remove non-existent 'view' parameter documentation

This was causing a warning when compiling with `-Wdocumentation` enabled.


#define TEST_NAME "auth"
#include "cmptest.h"

/* "Test Case 2" from RFC 4231 */
unsigned char key[32] = "Jefe";
unsigned char c[] = "what do ya want for nothing?";

unsigned char a[32];

int main(void)
{
  int i;
  crypto_auth(a,c,sizeof c - 1U,key);
  for (i = 0;i < 32;++i) {
    printf(",0x%02x",(unsigned int) a[i]);
    if (i % 8 == 7) printf("\n");
  }

  assert(crypto_auth_bytes() > 0U);
  assert(crypto_auth_keybytes() > 0U);
  assert(strcmp(crypto_auth_primitive(), "hmacsha512256") == 0);

  return 0;
}

#define TEST_NAME "auth"
#include "cmptest.h"

/* "Test Case 2" from RFC 4231 */
unsigned char key[32] = "Jefe";
unsigned char c[] = "what do ya want for nothing?";

unsigned char a[32];

int main(void)
{
  int i;
  crypto_auth(a,c,sizeof c - 1U,key);
  for (i = 0;i < 32;++i) {
    printf(",0x%02x",(unsigned int) a[i]);
    if (i % 8 == 7) printf("\n");
  }

  assert(crypto_auth_bytes() > 0U);
  assert(crypto_auth_keybytes() > 0U);
  assert(strcmp(crypto_auth_primitive(), "hmacsha512256") == 0);
  assert(crypto_auth_hmacsha512256_bytes() > 0U);
  assert(crypto_auth_hmacsha512256_keybytes() > 0U);

  return 0;
}

Test the presence of some extra functions


#ifndef CLUTTER_GST_SHADERS_H
#define CLUTTER_GST_SHADERS_H

#include <clutter/clutter.h>

/* Copied from test-shaders */

/* These variables are used instead of the standard GLSL variables on
   GLES 2 */
#ifdef COGL_HAS_GLES

#define GLES2_VARS              \
  "precision mediump float;\n"  \
  "varying vec2 tex_coord;\n"   \
  "varying vec4 frag_color;\n"
#define TEX_COORD "tex_coord"
#define COLOR_VAR "frag_color"

#else /* COGL_HAS_GLES */

#define GLES2_VARS ""
#define TEX_COORD "gl_TexCoord[0]"
#define COLOR_VAR "gl_Color"

#endif /* COGL_HAS_GLES */

/* a couple of boilerplate defines that are common amongst all the
 * sample shaders
 */

#define FRAGMENT_SHADER_VARS      \
  GLES2_VARS

/* FRAGMENT_SHADER_END: apply the changed color to the output buffer correctly
 * blended with the gl specified color (makes the opacity of actors work
 * correctly).
 */
#define FRAGMENT_SHADER_END                             \
     "  gl_FragColor = gl_FragColor * " COLOR_VAR ";"

#endif

#ifndef CLUTTER_GST_SHADERS_H
#define CLUTTER_GST_SHADERS_H

#include <clutter/clutter.h>

/* Copied from test-shaders */

/* These variables are used instead of the standard GLSL variables on
   GLES 2 */
#ifdef COGL_HAS_GLES

#define GLES2_VARS              \
  "precision mediump float;\n"
#define TEX_COORD "cogl_tex_coord_in[0]"
#define COLOR_VAR "cogl_color_in"

#else /* COGL_HAS_GLES */

#define GLES2_VARS ""
#define TEX_COORD "gl_TexCoord[0]"
#define COLOR_VAR "gl_Color"

#endif /* COGL_HAS_GLES */

/* a couple of boilerplate defines that are common amongst all the
 * sample shaders
 */

#define FRAGMENT_SHADER_VARS      \
  GLES2_VARS

/* FRAGMENT_SHADER_END: apply the changed color to the output buffer correctly
 * blended with the gl specified color (makes the opacity of actors work
 * correctly).
 */
#define FRAGMENT_SHADER_END                             \
     "  gl_FragColor = gl_FragColor * " COLOR_VAR ";"

#endif

sink: Update the shaders to work with Cogl 1.6.0+ and GLES2

The GLES2 shaders were considered private API until 1.6.0, see
discussion:
  https://bugzilla.gnome.org/show_bug.cgi?id=661071

Let's update the variable names and depend on 1.6.0


#ifndef __SODIUM_UTILS_H__
#define __SODIUM_UTILS_H__

#include <stddef.h>

#include "export.h"

#ifdef __cplusplus
extern "C" {
#endif

#ifndef __cplusplus
# define _SODIUM_C99(X) X
#else
# define _SODIUM_C99(X)
#endif

unsigned char *_sodium_alignedcalloc(unsigned char ** const unaligned_p,
                                     const size_t len);

SODIUM_EXPORT
void sodium_memzero(void * const pnt, const size_t len);

SODIUM_EXPORT
int sodium_memcmp(const void * const b1_, const void * const b2_, size_t size);

SODIUM_EXPORT
char *sodium_bin2hex(char * const hex, const size_t hexlen,
                     const unsigned char *bin, const size_t binlen);

#ifdef __cplusplus
}
#endif

#endif

#ifndef __SODIUM_UTILS_H__
#define __SODIUM_UTILS_H__

#include <stddef.h>

#include "export.h"

#ifdef __cplusplus
extern "C" {
#endif

#if defined(__cplusplus) || !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# define _SODIUM_C99(X)
#else
# define _SODIUM_C99(X) X
#endif

unsigned char *_sodium_alignedcalloc(unsigned char ** const unaligned_p,
                                     const size_t len);

SODIUM_EXPORT
void sodium_memzero(void * const pnt, const size_t len);

SODIUM_EXPORT
int sodium_memcmp(const void * const b1_, const void * const b2_, size_t size);

SODIUM_EXPORT
char *sodium_bin2hex(char * const hex, const size_t hexlen,
                     const unsigned char *bin, const size_t binlen);

#ifdef __cplusplus
}
#endif

#endif

Define _SODIUM_C99 as empty on retarded compilers, not only when using C++


#include "torture.h"

#include <stdio.h>

static int verbosity = 0;

int torture_libssh_verbosity(void){
  return verbosity;
}

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

    return torture_run_tests();
}

#include <stdio.h>
#include <libssh/libssh.h>

#include "torture.h"

static int verbosity = 0;

int torture_libssh_verbosity(void){
  return verbosity;
}

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

    (void) argc;
    (void) argv;

    ssh_init();

    rc = torture_run_tests();

    ssh_finalize();

    return rc;
}

tests: Call ssh_init() and ssh_finalize() before we run the tests.


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

#ifndef LayoutObjectDrawingRecorder_h
#define LayoutObjectDrawingRecorder_h

#include "core/layout/PaintPhase.h"
#include "platform/geometry/FloatRect.h"
#include "platform/geometry/LayoutRect.h"
#include "platform/graphics/paint/DisplayItem.h"
#include "platform/graphics/paint/DrawingRecorder.h"

namespace blink {

class GraphicsContext;
class LayoutObject;

class LayoutObjectDrawingRecorder {
public:
    LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type displayItemType, const LayoutRect& clip)
        : m_drawingRecorder(context, layoutObject, displayItemType, pixelSnappedIntRect(clip)) { }

    LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, PaintPhase phase, const FloatRect& clip)
        : m_drawingRecorder(context, layoutObject, DisplayItem::paintPhaseToDrawingType(phase), clip) { }

    LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type type, const FloatRect& clip)
        : m_drawingRecorder(context, layoutObject, type, clip) { }

    bool canUseCachedDrawing() const { return m_drawingRecorder.canUseCachedDrawing(); }

private:
    DrawingRecorder m_drawingRecorder;
};

} // namespace blink

#endif // LayoutObjectDrawingRecorder_h

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

#ifndef LayoutObjectDrawingRecorder_h
#define LayoutObjectDrawingRecorder_h

#include "core/layout/PaintPhase.h"
#include "platform/geometry/LayoutRect.h"
#include "platform/graphics/paint/DrawingRecorder.h"

namespace blink {

class GraphicsContext;
class LayoutObject;

// Convienance constructors for creating DrawingRecorders.
class LayoutObjectDrawingRecorder final : public DrawingRecorder {
public:
    LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type displayItemType, const LayoutRect& clip)
        : DrawingRecorder(context, layoutObject, displayItemType, pixelSnappedIntRect(clip)) { }

    LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, PaintPhase phase, const FloatRect& clip)
        : DrawingRecorder(context, layoutObject, DisplayItem::paintPhaseToDrawingType(phase), clip) { }

    LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type type, const FloatRect& clip)
        : DrawingRecorder(context, layoutObject, type, clip) { }
};

} // namespace blink

#endif // LayoutObjectDrawingRecorder_h

Convert LayoutDrawingRecorder to be a simple helper of DrawingRecorder

This patch makes LayoutDrawingRecorder a non-virual subclass of
DrawingRecorder instead of carrying a DrawingRecorder member. This is
just a cleanup and should have no observable differences.

Review URL: https://codereview.chromium.org/1083223002

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@193749 bbb929c8-8fbe-4397-9dbb-9b2b20218538


/*=========================================================================
 *
 *  Copyright Insight Software Consortium
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0.txt
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *=========================================================================*/
#ifndef __itkImageSourceCommon_h
#define __itkImageSourceCommon_h

#include "ITKCommonExport.h"

namespace itk
{

/** \class ImageSourceCommon
 * \brief Secondary base class of ImageSource common between templates
 *
 * This class provides common non-templated code which can be compiled
 * and used by all templated versions of ImageSource.
 *
 * This class must be inherited privately, and light-weight adapting
 * of methods is required for virtual methods or non-private methods
 * for the ImageSource interface.
 *
 * \ingroup ITKCommon
 */
struct ITKCommon_EXPORT ImageSourceCommon
{
  /**
   * Provide access to a common static object for image region splitting
   */
  static  const ImageRegionSplitterBase*  GetGlobalDefaultSplitter(void);
};

} // end namespace itk

#endif

/*=========================================================================
 *
 *  Copyright Insight Software Consortium
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0.txt
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *=========================================================================*/
#ifndef __itkImageSourceCommon_h
#define __itkImageSourceCommon_h

#include "ITKCommonExport.h"
#include "itkImageRegionSplitterBase.h"

namespace itk
{

/** \class ImageSourceCommon
 * \brief Secondary base class of ImageSource common between templates
 *
 * This class provides common non-templated code which can be compiled
 * and used by all templated versions of ImageSource.
 *
 * This class must be inherited privately, and light-weight adapting
 * of methods is required for virtual methods or non-private methods
 * for the ImageSource interface.
 *
 * \ingroup ITKCommon
 */
struct ITKCommon_EXPORT ImageSourceCommon
{
  /**
   * Provide access to a common static object for image region splitting
   */
  static  const ImageRegionSplitterBase*  GetGlobalDefaultSplitter(void);
};

} // end namespace itk

#endif

COMP: Add missing itkImageRegionSplitterBase to ImageSourceCommon.

Change-Id: I64f5635f1605c4ce4c47d56ad6c6abcda40c130d


/* Copyright (C) 2002 Timo Sirainen */

#include "common.h"
#include "commands.h"

int cmd_create(struct client *client)
{
	struct mail_storage *storage;
	const char *mailbox;
	int directory;
	size_t len;

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

	storage = client_find_storage(client, &mailbox);
	if (storage == NULL)
		return TRUE;

	len = strlen(mailbox);
	if (mailbox[len-1] != mail_storage_get_hierarchy_sep(storage))
		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);
	}

	if (!client_verify_mailbox_name(client, mailbox, FALSE, TRUE))
		return TRUE;

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

/* Copyright (C) 2002 Timo Sirainen */

#include "common.h"
#include "commands.h"

int cmd_create(struct client *client)
{
	struct mail_storage *storage;
	const char *mailbox, *full_mailbox;
	int directory;
	size_t len;

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

	storage = client_find_storage(client, &mailbox);
	if (storage == NULL)
		return TRUE;

	len = strlen(mailbox);
	if (mailbox[len-1] != mail_storage_get_hierarchy_sep(storage))
		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);
	}

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

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

CREATE was broken if namespace prefixes were set. Patch by Andreas Fuchs.

--HG--
branch : HEAD


/*
 * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
 * Universitaet Berlin.  See the accompanying file "COPYRIGHT" for
 * details.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
 */

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

#include "gsm.h"
#include "private.h"

gsm gsm_create ()
{
	gsm = (gsm)calloc(sizeof(struct gsm_state));

        if (r)
          r->nrp = 40;

	return r;
}

/*
 * Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
 * Universitaet Berlin.  See the accompanying file "COPYRIGHT" for
 * details.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
 */

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

#include "gsm.h"
#include "private.h"

gsm gsm_create ()
{
	gsm r = (gsm)calloc(1, sizeof(struct gsm_state));

        if (r)
          r->nrp = 40;

	return r;
}

Fix typos in last commit.

Fix typos in last commit.


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

#import <ObjectiveRocks/RocksDB.h>

#import <ObjectiveRocks/RocksDBColumnFamily.h>
#import <ObjectiveRocks/RocksDBColumnFamilyDescriptor.h>

#import <ObjectiveRocks/RocksDBIterator.h>
#import <ObjectiveRocks/RocksDBPrefixExtractor.h>

#import <ObjectiveRocks/RocksDBWriteBatch.h>

#import <ObjectiveRocks/RocksDBComparator.h>

#import <ObjectiveRocks/RocksDBOptions.h>
#import <ObjectiveRocks/RocksDBDatabaseOptions.h>
#import <ObjectiveRocks/RocksDBColumnFamilyOptions.h>
#import <ObjectiveRocks/RocksDBWriteOptions.h>
#import <ObjectiveRocks/RocksDBReadOptions.h>
#import <ObjectiveRocks/RocksDBTableFactory.h>
#import <ObjectiveRocks/RocksDBBlockBasedTableOptions.h>
#import <ObjectiveRocks/RocksDBCache.h>
#import <ObjectiveRocks/RocksDBFilterPolicy.h>
#import <ObjectiveRocks/RocksDBMemTableRepFactory.h>
#import <ObjectiveRocks/RocksDBEnv.h>

#import <ObjectiveRocks/RocksDBSnapshot.h>

#import <ObjectiveRocks/RocksDBMergeOperator.h>

#import <ObjectiveRocks/RocksDBTypes.h>
#import <ObjectiveRocks/RocksDBRange.h>

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

#import <ObjectiveRocks/RocksDB.h>

#import <ObjectiveRocks/RocksDBColumnFamily.h>
#import <ObjectiveRocks/RocksDBColumnFamilyDescriptor.h>

#import <ObjectiveRocks/RocksDBIterator.h>
#import <ObjectiveRocks/RocksDBPrefixExtractor.h>

#import <ObjectiveRocks/RocksDBWriteBatch.h>

#import <ObjectiveRocks/RocksDBComparator.h>

#import <ObjectiveRocks/RocksDBOptions.h>
#import <ObjectiveRocks/RocksDBDatabaseOptions.h>
#import <ObjectiveRocks/RocksDBColumnFamilyOptions.h>
#import <ObjectiveRocks/RocksDBWriteOptions.h>
#import <ObjectiveRocks/RocksDBReadOptions.h>
#import <ObjectiveRocks/RocksDBTableFactory.h>
#import <ObjectiveRocks/RocksDBBlockBasedTableOptions.h>
#import <ObjectiveRocks/RocksDBCache.h>
#import <ObjectiveRocks/RocksDBFilterPolicy.h>
#import <ObjectiveRocks/RocksDBMemTableRepFactory.h>
#import <ObjectiveRocks/RocksDBEnv.h>

#import <ObjectiveRocks/RocksDBSnapshot.h>

#import <ObjectiveRocks/RocksDBMergeOperator.h>

#import <ObjectiveRocks/RocksDBRange.h>

Fix bridging header for iOS Swift tests

Fix bridging header for iOS Swift tests


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

#ifndef UI_AURA_EVENT_FILTER_H_
#define UI_AURA_EVENT_FILTER_H_
#pragma once

#include "base/logging.h"
#include "ui/gfx/point.h"

namespace aura {

class Window;
class MouseEvent;

// An object that filters events sent to an owner window, potentially performing
// adjustments to the window's position, size and z-index.
class EventFilter {
 public:
  explicit EventFilter(Window* owner);
  virtual ~EventFilter();

  // Try to handle |event| (before the owner's delegate gets a chance to).
  // Returns true if the event was handled by the WindowManager and should not
  // be forwarded to the owner's delegate.
  virtual bool OnMouseEvent(Window* target, MouseEvent* event);

 protected:
  Window* owner() { return owner_; }

 private:
  Window* owner_;

  DISALLOW_COPY_AND_ASSIGN(EventFilter);
};

}  // namespace aura

#endif  // UI_AURA_EVENT_FILTER_H_

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

#ifndef UI_AURA_EVENT_FILTER_H_
#define UI_AURA_EVENT_FILTER_H_
#pragma once

#include "base/basictypes.h"

namespace aura {

class Window;
class MouseEvent;

// An object that filters events sent to an owner window, potentially performing
// adjustments to the window's position, size and z-index.
class EventFilter {
 public:
  explicit EventFilter(Window* owner);
  virtual ~EventFilter();

  // Try to handle |event| (before the owner's delegate gets a chance to).
  // Returns true if the event was handled by the WindowManager and should not
  // be forwarded to the owner's delegate.
  virtual bool OnMouseEvent(Window* target, MouseEvent* event);

 protected:
  Window* owner() { return owner_; }

 private:
  Window* owner_;

  DISALLOW_COPY_AND_ASSIGN(EventFilter);
};

}  // namespace aura

#endif  // UI_AURA_EVENT_FILTER_H_

aura: Include basictypes.h for DISALLOW macro.

R=ben@chromium.org

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

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


// Copyright 2015  Malcolm Inglis <http://minglis.id.au>
//
// This file is part of Libmacro.
//
// Libmacro 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.
//
// Libmacro 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 Libmacro. If not, see <https://gnu.org/licenses/>.

#ifndef LIBMACRO_NELEM_H
#define LIBMACRO_NELEM_H

// Gives the number of elements in the array `XS`. Be very careful that
// you only call this with an *array* variable, and not a pointer-to-array.
// Note that this evaluates to a constant expression.
#define NELEM( XS ) \
    ( ( sizeof ( XS ) ) / ( sizeof ( ( XS )[ 0 ] ) ) )

#endif

// Copyright 2015  Malcolm Inglis <http://minglis.id.au>
//
// This file is part of Libmacro.
//
// Libmacro 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.
//
// Libmacro 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 Libmacro. If not, see <https://gnu.org/licenses/>.

#ifndef LIBMACRO_NELEM_H
#define LIBMACRO_NELEM_H

// Gives the number of elements in the array `XS`. Be very careful that
// you only call this with an *array* variable, and not a pointer-to-array.
// Note that this evaluates to a constant expression.
#define NELEM( ... ) \
    ( ( sizeof ( __VA_ARGS__ ) ) / ( sizeof ( ( __VA_ARGS__ )[ 0 ] ) ) )

#endif

Change NELEM to take VA_ARGS to handle commas


//
//  NSBezierPath_BDSKExtensions.h
//  Bibdesk
//
//  Created by Adam Maxwell on 10/22/05.
/*
 This software is Copyright (c) 2005,2006,2007
 Adam Maxwell. 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.

 - Neither the name of Adam Maxwell nor the names of any
 contributors may be used to endorse or promote products derived
 from this software without specific prior written permission.

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

@interface NSBezierPath (BDSKExtensions)

+ (void)fillRoundRectInRect:(NSRect)rect radius:(float)radius;
+ (void)strokeRoundRectInRect:(NSRect)rect radius:(float)radius;
+ (NSBezierPath*)bezierPathWithRoundRectInRect:(NSRect)rect radius:(float)radius;

+ (void)drawHighlightInRect:(NSRect)rect radius:(float)radius lineWidth:(float)lineWidth color:(NSColor *)color;

+ (void)fillHorizontalOvalAroundRect:(NSRect)rect;
+ (void)strokeHorizontalOvalAroundRect:(NSRect)rect;
+ (NSBezierPath*)bezierPathWithHorizontalOvalAroundRect:(NSRect)rect;

+ (void)fillStarInRect:(NSRect)rect;
+ (void)fillInvertedStarInRect:(NSRect)rect;
+ (NSBezierPath *)bezierPathWithStarInRect:(NSRect)rect;
+ (NSBezierPath *)bezierPathWithInvertedStarInRect:(NSRect)rect;

@end

Copy bezierpath category from bibdesk to skim.


/**
 * Appcelerator Titanium - licensed under the Apache Public License 2
 * see LICENSE in the root folder for details on the license.
 * Copyright (c) 2008 Appcelerator, Inc. All Rights Reserved.
 */

#ifndef TITANIUM_URL_H_
#define TITANIUM_URL_H_
namespace ti
{
	void NormalizeURLCallback(const char* url, char* buffer, int bufferLength);
	void URLToFileURLCallback(const char* url, char* buffer, int bufferLength);
	int CanPreprocessURLCallback(const char* url);
	char* PreprocessURLCallback(const char* url, KeyValuePair* headers, char** mimeType);
}
#endif

/**
 * Appcelerator Titanium - licensed under the Apache Public License 2
 * see LICENSE in the root folder for details on the license.
 * Copyright (c) 2008 Appcelerator, Inc. All Rights Reserved.
 */

#ifndef TITANIUM_URL_H_
#define TITANIUM_URL_H_

#ifndef KEYVALUESTRUCT
typedef struct {
    char* key;
    char* value;
} KeyValuePair;
#define KEYVALUESTRUCT 1
#endif

namespace ti
{
	void NormalizeURLCallback(const char* url, char* buffer, int bufferLength);
	void URLToFileURLCallback(const char* url, char* buffer, int bufferLength);
	int CanPreprocessURLCallback(const char* url);
	char* PreprocessURLCallback(const char* url, KeyValuePair* headers, char** mimeType);
}
#endif

Include KeyValuePair definition, if needed.


/* StdAfx.h
 *
 * Copyright (C) 2013 Michael Imamura
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

#pragma once

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

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

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

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

/* StdAfx.h
 *
 * Copyright (C) 2013 Michael Imamura
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

#pragma once

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

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

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

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

Add more common includes to PCH.

Add more common includes to PCH.


/*	$Id$ */
/*
 * Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */
#ifdef HAVE_CONFIG_H
#include "../config.h"
#endif

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

#include <curl/curl.h>

#include "../kcgi.h"
#include "regress.h"

static int
parent(CURL *curl)
{
	const char	*data = "foo=bar";

	curl_easy_setopt(curl, CURLOPT_URL,
		"http://localhost:17123/");
	curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
	return(CURLE_OK == curl_easy_perform(curl));
}

static int
child(void)
{
	struct kreq	 r;
	const char 	*page = "index";

	if (KCGI_OK != khttp_parse(&r, NULL, 0, &page, 1, 0))
		return(0);
	khttp_head(&r, kresps[KRESP_STATUS],
		"%s", khttps[KHTTP_200]);
	khttp_head(&r, kresps[KRESP_CONTENT_TYPE],
		"%s", kmimetypes[KMIME_TEXT_HTML]);
	khttp_body(&r);
	khttp_free(&r);
	return(1);
}

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

	return(regress_cgi(parent, child) ? EXIT_SUCCESS : EXIT_FAILURE);
}

Add simple post that triggers the earlier breakage of kcgi(3) with a blocking socket.


/*
 * This file is part of hat-trie.
 *
 * Copyright (c) 2011 by Daniel C. Jones <dcjones@cs.washington.edu>
 *
 *
 * Common typedefs, etc.
 *
 */

#ifndef HATTRIE_COMMON_H
#define HATTRIE_COMMON_H

typedef unsigned long value_t;

#endif

/*
 * This file is part of hat-trie.
 *
 * Copyright (c) 2011 by Daniel C. Jones <dcjones@cs.washington.edu>
 *
 *
 * Common typedefs, etc.
 *
 */

#ifndef HATTRIE_COMMON_H
#define HATTRIE_COMMON_H

#include "pstdint.h"

typedef uintptr_t value_t;

#endif

Switch `value_t` to be `uintptr_t`.

Switch `value_t` to be `uintptr_t`.

This allows `value_t` to be 64-bit even on 64-bit architectures where
`unsigned long` is still 32-bit.


/*
    Copyright (C) 2021 William Hart

    This file is part of FLINT.

    FLINT is free software: you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License (LGPL) as published
    by the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.  See <https://www.gnu.org/licenses/>.
*/

#include "fq_default_poly_factor.h"

#include <stdlib.h>
#include <stdio.h>
#include <gmp.h>
#include "flint.h"
#include "nmod_poly.h"
#include "ulong_extras.h"

int
main(void)
{
    int i;
    FLINT_TEST_INIT(state);

    flint_printf("init/clear....");
    fflush(stdout);

    for (i = 0; i < 100 * flint_test_multiplier(); i++)
    {
        fq_default_ctx_t ctx;
        fq_default_poly_factor_t fq_poly_fac;
        fmpz_t p;

        fmpz_init(p);

        fmpz_set_ui(p, 5);

        fq_default_ctx_init(ctx, p, 5, "x");

        fq_default_poly_factor_init(fq_poly_fac, ctx);

        fq_default_poly_factor_clear(fq_poly_fac, ctx);

        fq_default_ctx_clear(ctx);

        fq_default_ctx_init(ctx, p, 16, "x");

        fq_default_poly_factor_init(fq_poly_fac, ctx);

        fq_default_poly_factor_clear(fq_poly_fac, ctx);

        fq_default_ctx_clear(ctx);

        fmpz_set_str(p, "73786976294838206473", 10);

        fq_default_ctx_init(ctx, p, 1, "x");

        fq_default_poly_factor_init(fq_poly_fac, ctx);

        fq_default_poly_factor_clear(fq_poly_fac, ctx);

        fq_default_ctx_clear(ctx);

        fmpz_clear(p);

    }

    FLINT_TEST_CLEANUP(state);

    flint_printf("PASS\n");
        return 0;
}

Add rudimentary init/clear test for fq_default_poly_factor.


#include "m-array.h"
#include "m-string.h"

/* This example show how to use complex structure with array
   embedding another library */

/* This is a trivial library */
typedef struct lib_ext_struct {
  int id;
  // Other data
} lib_ext_struct;

static lib_ext_struct *lib_ext_struct_Duplicate(const lib_ext_struct *obj)
{
  lib_ext_struct *p = malloc(sizeof(lib_ext_struct));
  if (!p) abort();
  p->id = obj->id;
  return p;
}

static void lib_ext_struct_Delete(lib_ext_struct *obj)
{
  free(obj);
}

/* This is the complex structure */
typedef struct  {
  uint32_t id;
  string_t type;
  lib_ext_struct* properties;
} data_node;

static void data_node_init(data_node *obj)
{
  obj->id = 0;
  string_init(obj->type);
  obj->properties = NULL;
}

static void data_node_init_set(data_node *obj, const data_node *src)
{
  obj->id = src->id;
  string_init_set(obj->type, src->type);
  if (src->properties)
    obj->properties = lib_ext_struct_Duplicate(src->properties);
  else
    obj->properties = NULL;
}

static void data_node_set(data_node *obj, const data_node *src)
{
  obj->id = src->id;
  string_set(obj->type, src->type);
  if (obj->properties)
    lib_ext_struct_Delete(obj->properties);
  if (src->properties)
    obj->properties = lib_ext_struct_Duplicate(src->properties);
  else
    obj->properties = NULL;
}

static void data_node_clear(data_node *obj)
{
  string_clear(obj->type);
  if (obj->properties)
    lib_ext_struct_Delete(obj->properties);
}

ARRAY_DEF(array_data_node, data_node, (INIT(API_2(data_node_init)),SET(API_6(data_node_set)),INIT_SET(API_6(data_node_init_set)),CLEAR(API_2(data_node_clear))))

array_data_node_t global_array;

int main(void)
{
  array_data_node_init(global_array);
  array_data_node_clear(global_array);
}

Add another example on complex structure usage


#include <stdio.h>

int main() {
  int notas[10];

  notas[0] = 10;
  notas[2] = 9;
  notas[3] = 8;
  notas[9] = 4;

  printf("%d %d %d\n", notas[0], notas[2], notas[9]);
}

Update files, Alura, Introdução a C - Parte 2, Aula 2.1


#pragma once

#include <time.h>
#include <sys/time.h>

static inline unsigned long long current_time_ns() {
#ifdef __MACH__
    clock_serv_t cclock;
    mach_timespec_t mts;
    host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
    clock_get_time(cclock, &mts);
    mach_port_deallocate(mach_task_self(), cclock);
    unsigned long long s = 1000000000ULL * (unsigned long long)mts.tv_sec;
    return (unsigned long long)mts.tv_nsec + s;
#else
    struct timespec t ={0,0};
    clock_gettime(CLOCK_MONOTONIC, &t);
    unsigned long long s = 1000000000ULL * (unsigned long long)t.tv_sec;
    return (((unsigned long long)t.tv_nsec)) + s;
#endif
}

#pragma once

#include <time.h>
#include <sys/time.h>

#ifdef __MACH__
#include <mach/clock.h>
#include <mach/mach.h>
#endif

static inline unsigned long long current_time_ns() {
#ifdef __MACH__
    clock_serv_t cclock;
    mach_timespec_t mts;
    host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
    clock_get_time(cclock, &mts);
    mach_port_deallocate(mach_task_self(), cclock);
    unsigned long long s = 1000000000ULL * (unsigned long long)mts.tv_sec;
    return (unsigned long long)mts.tv_nsec + s;
#else
    struct timespec t ={0,0};
    clock_gettime(CLOCK_MONOTONIC, &t);
    unsigned long long s = 1000000000ULL * (unsigned long long)t.tv_sec;
    return (((unsigned long long)t.tv_nsec)) + s;
#endif
}

Fix compilation errors on Mac OS

Fix compilation errors on Mac OS


#ifndef TERMINALIO_H
#define TERMINALIO_H

typedef struct io io_t;
typedef struct chip8 chip8_t;

io_t * terminal_io_new(void);
void terminal_io_render(io_t *, chip8_t *);
void terminal_io_listen(io_t *, chip8_t *);

#endif

#ifndef TERMINAL_IO_H
#define TERMINAL_IO_H

typedef struct io io_t;
typedef struct chip8 chip8_t;

io_t * terminal_io_new(void);
void terminal_io_render(io_t *, chip8_t *);
void terminal_io_listen(io_t *, chip8_t *);

#endif

Use TERMINAL_IO_H as inclusion guard

Use TERMINAL_IO_H as inclusion guard


// -----------------------------------------------------------------------------
//
// Copyright (C) The BioDynaMo Project.
// 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.
//
// See the LICENSE file distributed with this work for details.
// See the NOTICE file distributed with this work for additional information
// regarding copyright ownership.
//
// -----------------------------------------------------------------------------

#ifndef CORE_UTIL_CPPTOML_H_
#define CORE_UTIL_CPPTOML_H_

#define BDM_ASSIGN_CONFIG_VALUE(variable, config_key)                        \
  {                                                                          \
    if (config->contains_qualified(config_key)) {                            \
      auto value = config->get_qualified_as<decltype(variable)>(config_key); \
      if (value) {                                                           \
        variable = *value;                                                   \
      }                                                                      \
    }                                                                        \
  }

#endif  // CORE_UTIL_CPPTOML_H_

// -----------------------------------------------------------------------------
//
// Copyright (C) The BioDynaMo Project.
// 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.
//
// See the LICENSE file distributed with this work for details.
// See the NOTICE file distributed with this work for additional information
// regarding copyright ownership.
//
// -----------------------------------------------------------------------------

#ifndef CORE_UTIL_CPPTOML_H_
#define CORE_UTIL_CPPTOML_H_

#define BDM_ASSIGN_CONFIG_VALUE(variable, config_key)                        \
  {                                                                          \
    if (config->contains_qualified(config_key)) {                            \
      auto value = config->get_qualified_as<decltype(variable)>(config_key); \
      if (value) {                                                           \
        variable = *value;                                                   \
      }                                                                      \
    }                                                                        \
  }

#define BDM_ASSIGN_CONFIG_DOUBLE3_VALUE(variable, config_key)          \
  {                                                                    \
    if (config->contains_qualified(config_key)) {                      \
      auto value = config->get_array_of<double>(config_key);           \
      if (value) {                                                     \
        auto vector = *value;                                          \
        if (vector.size() == variable.size()) {                        \
          for (uint64_t i = 0; i < vector.size(); i++) {               \
            variable[i] = vector[i];                                   \
          }                                                            \
        } else {                                                       \
          Log::Fatal("cpptoml parameter parsing",                      \
                     "An error occured during parameter parsing of (", \
                     config_key, ". Array dimensions do not match");   \
        }                                                              \
      }                                                                \
    }                                                                  \
  }

#endif  // CORE_UTIL_CPPTOML_H_

Add macro to assign Double3 values from toml files


#include <stdarg.h>
#include <stdio.h>

#include <whitgl/logging.h>

#define LOG_BUFFER_MAX (256)
char _buffer[LOG_BUFFER_MAX];

void whitgl_logit(const char *file, const int line, const char *str, ...)
{
	va_list args;
	va_start(args, str);
	vsnprintf(_buffer, LOG_BUFFER_MAX, str, args);
	printf("%24s:%03d  %s\n", file, line, _buffer);
}

void whitgl_panic(const char *file, const int line, const char *str, ...)
{
	va_list args;
	va_start(args, str);
	vsnprintf(_buffer, LOG_BUFFER_MAX, str, args);
	printf("PANIC %24s:%03d  %s\n", file, line, _buffer);
	printf("PANIC %f", *(double*)0); // do something impossible to crash
}

#include <stdarg.h>
#include <stdio.h>

#include <whitgl/logging.h>

#define LOG_BUFFER_MAX (256)
char _buffer[LOG_BUFFER_MAX];

void whitgl_logit(const char *file, const int line, const char *str, ...)
{
	va_list args;
	va_start(args, str);
	vsnprintf(_buffer, LOG_BUFFER_MAX, str, args);
	printf("%24s:%03d  %s\n", file, line, _buffer);
}

void whitgl_panic(const char *file, const int line, const char *str, ...)
{
	va_list args;
	va_start(args, str);
	vsnprintf(_buffer, LOG_BUFFER_MAX, str, args);
	printf("PANIC %24s:%03d  %s\n", file, line, _buffer);
	__builtin_trap();
}

Use __builtin_trap to break to debugger

Use __builtin_trap to break to debugger


#include "test_util.h"
#include <util.h>
#include <ftw.h>
#include <stdio.h>

static int remove_callback(const char* file,
                           const struct stat* UNUSED(stat),
                           int UNUSED(typeflag),
                           struct FTW* UNUSED(ftwbuf)) {
    return remove(file);
}

int delete_directory(const char* dir) {
    const int max_fds = 64;
    return nftw(dir, remove_callback, max_fds, FTW_DEPTH | FTW_PHYS);
}

#include "test_util.h"
#include <util.h>
#include <ftw.h>
#include <stdio.h>

static int remove_callback(const char* file,
                           const struct stat* UNUSED(stat),
                           int UNUSED(typeflag),
                           struct FTW* UNUSED(ftwbuf)) {
    return remove(file);
}

int delete_directory(const char* dir) {
    struct stat st;
    const int max_fds = 64;
    int i = stat(dir, &st);
    if (i == 0) {
        return nftw(dir, remove_callback, max_fds, FTW_DEPTH | FTW_PHYS);
    }
    return 0;
}

Delete test directory only if it exists

Delete test directory only if it exists

This should fix tests.


/*
 * This file includes all the .c files needed for a complete multiarray module.
 * This is used in the case where separate compilation is not enabled
 */

#include "common.c"

#include "hashdescr.c"
#include "numpyos.c"
#include "scalarapi.c"
#include "descriptor.c"
#include "flagsobject.c"
#include "ctors.c"
#include "iterators.c"
#include "mapping.c"
#include "number.c"
#include "getset.c"
#include "sequence.c"
#include "methods.c"
#include "convert_datatype.c"
#include "convert.c"
#include "shape.c"
#include "item_selection.c"
#include "calculation.c"
#include "usertypes.c"
#include "refcount.c"
#include "conversion_utils.c"
#include "buffer.c"

#include "arraytypes.c"
#include "scalartypes.c"

#ifndef Py_UNICODE_WIDE
#include "ucsnarrow.c"
#endif

#include "arrayobject.c"

#include "multiarraymodule.c"

/*
 * This file includes all the .c files needed for a complete multiarray module.
 * This is used in the case where separate compilation is not enabled
 *
 * Note that the order of the includs matters
 */

#include "common.c"

#include "arraytypes.c"

#include "hashdescr.c"
#include "numpyos.c"
#include "scalarapi.c"
#include "descriptor.c"
#include "flagsobject.c"
#include "ctors.c"
#include "iterators.c"
#include "mapping.c"
#include "number.c"
#include "getset.c"
#include "sequence.c"
#include "methods.c"
#include "convert_datatype.c"
#include "convert.c"
#include "shape.c"
#include "item_selection.c"
#include "calculation.c"
#include "usertypes.c"
#include "refcount.c"
#include "conversion_utils.c"
#include "buffer.c"

#include "scalartypes.c"

#ifndef Py_UNICODE_WIDE
#include "ucsnarrow.c"
#endif

#include "arrayobject.c"

#include "multiarraymodule.c"

Include arraytypes.c early for the no separate compilation case.


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

#pragma mark macros

#pragma mark const

FOUNDATION_EXTERN NSString *const NestSDKAccessTokenDidChangeNotification;

#pragma mark enum

#pragma mark typedef

#pragma mark Protocol

@interface NestSDKAccessToken : NSObject <NSSecureCoding>
#pragma mark Properties

@property(readonly, nonatomic) NSDate *expirationDate;
@property(readonly, copy, nonatomic) NSString *tokenString;

#pragma mark Methods

- (instancetype)initWithTokenString:(NSString *)tokenString expirationDate:(NSDate *)expirationDate NS_DESIGNATED_INITIALIZER;

- (BOOL)isEqualToAccessToken:(NestSDKAccessToken *)token;

+ (NestSDKAccessToken *)currentAccessToken;

+ (void)setCurrentAccessToken:(NestSDKAccessToken *)token;

@end

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

#pragma mark macros

#pragma mark const

FOUNDATION_EXTERN NSString *const NestSDKAccessTokenDidChangeNotification;

FOUNDATION_EXTERN NSString *const NestSDKAccessTokenChangeNewKey;
FOUNDATION_EXTERN NSString *const NestSDKAccessTokenChangeOldKey;

#pragma mark enum

#pragma mark typedef

#pragma mark Protocol

@interface NestSDKAccessToken : NSObject <NSSecureCoding>
#pragma mark Properties

@property(readonly, nonatomic) NSDate *expirationDate;
@property(readonly, copy, nonatomic) NSString *tokenString;

#pragma mark Methods

- (instancetype)initWithTokenString:(NSString *)tokenString expirationDate:(NSDate *)expirationDate NS_DESIGNATED_INITIALIZER;

- (BOOL)isEqualToAccessToken:(NestSDKAccessToken *)token;

+ (NestSDKAccessToken *)currentAccessToken;

+ (void)setCurrentAccessToken:(NestSDKAccessToken *)token;

@end

Access token change key added for export


/* $Id$ */
/* Copyright (c) 2017 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS Desktop Mixer */
/* This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, version 3 of the License.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>. */

#ifndef DESKTOP_MIXER_H
# define DESKTOP_MIXER_H

# include "Mixer/control.h"

#endif /* !DESKTOP_MIXER_H */

/* $Id$ */
/* Copyright (c) 2017 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS Desktop Mixer */
/* All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * 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 DESKTOP_MIXER_H
# define DESKTOP_MIXER_H

# include "Mixer/control.h"

#endif /* !DESKTOP_MIXER_H */

Complete the license switch to 2-clause BSD

Thanks ocochard for the heads up!


#include <Instrument.h>      // the base class for this instrument

class MYINST : public Instrument {

public:
	MYINST();
	virtual ~MYINST();
	virtual int init(double *, int);
	virtual int configure();
	virtual int run();

private:
	void doupdate();

	int _nargs, _inchan, _branch;
	float _amp, _pan;
	float *_in;
};

#include <Instrument.h>      // the base class for this instrument

class MYINST : public Instrument {

public:
	MYINST();
	virtual ~MYINST();
	virtual int init(double *, int);
	virtual int configure();
	virtual int run();

private:
	void doupdate();

	float *_in;
	int _nargs, _inchan, _branch;
	float _amp, _pan;
};

Change order of declarations to suppress compiler warning.


// @(#)geom/geocad:$Id$
// Author: Cinzia Luzzi   5/5/2012

/*************************************************************************
 * Copyright (C) 1995-2018, 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_TOCCExports
#define ROOT_TOCCExports

// Combine all OCE headers used by geocad.
// After including them, #undef Handle.

#define Printf Printf_opencascade
#include <TDF_Label.hxx>
#include <TDocStd_Document.hxx>
#include <Standard_Version.hxx>
#include <STEPCAFControl_Writer.hxx>
#include <XCAFDoc_ShapeTool.hxx>
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#undef Printf

// ROOT-9837
#if defined(Handle) && !defined(R__Needs_Handle)
#undef Handle
#endif

#endif

// @(#)geom/geocad:$Id$
// Author: Cinzia Luzzi   5/5/2012

/*************************************************************************
 * Copyright (C) 1995-2018, 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_TOCCExports
#define ROOT_TOCCExports

// Combine all OCE headers used by geocad.
// After including them, #undef Handle.

#include <TDF_Label.hxx>
#include <TDocStd_Document.hxx>
#include <Standard_Version.hxx>
#include <STEPCAFControl_Writer.hxx>
#include <XCAFDoc_ShapeTool.hxx>

#define Printf Printf_opencascade
#include <TopoDS_Shape.hxx>
#include <TopoDS_Wire.hxx>
#undef Printf

// ROOT-9837
#if defined(Handle) && !defined(R__Needs_Handle)
#undef Handle
#endif

#endif

Revert "[GeoCAD] Protect all of OpenCascade headers from declaring Printf."

This reverts commit c71e9ade417b5c1c9f3de614672a0060037df931.


//===- llvm/System/Process.h ------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by Reid Spencer and is distributed under the
// University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the llvm::sys::Process class.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_SYSTEM_PROCESS_H
#define LLVM_SYSTEM_PROCESS_H

namespace llvm {
namespace sys {

  /// This class provides an abstraction for getting information about the
  /// currently executing process.
  /// @since 1.4
  /// @brief An abstraction for operating system processes.
  class Process {
    /// @name Accessors
    /// @{
    public:
      /// This static function will return the operating system's virtual memory
      /// page size.
      /// @returns The number of bytes in a virtual memory page.
      /// @throws nothing
      /// @brief Get the virtual memory page size
      static unsigned GetPageSize();

    /// @}
  };
}
}

// vim: sw=2

#endif

Add methods for detecting different kinds of files by their magic number,
getting the suffix for shared objects, and extracting the basename from a
path.

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


//===-- ModelSync.h - Wireless Syncing of GameModel ---------------- c++ --===//
//
//                               UWH Timer
//
//           This file is distributed under the BSD 3-Clause License.
//                      See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef MODELSYNC_H
#define MODELSYNC_H

#include "uwhd/model/GameModel.h"

#include <string>
#include <vector>

struct ModelSync {
  virtual ~ModelSync() = 0;
  virtual void Init() = 0;
  virtual void setMgr(GameModelManager *M) = 0;
  virtual GameModelManager &getMgr() = 0;
};

//struct ModelSyncPeer {
//  virtual std::string name() const = 0;
//  virtual std::string addr() const = 0;
//};

struct ModelSyncServer : public ModelSync {
  virtual ~ModelSyncServer() = 0;
  //virtual std::vector<ModelSyncPeer*> peers() = 0;
  //virtual void claimPeer(const ModelSyncPeer *P) = 0;
  //virtual void getPeerWallClock(const ModelSyncPeer *P) = 0;
  //virtual void setPeerWallClock(const ModelSyncPeer *P) = 0;
  //virtual void adjustPeerWallClock(const ModelSyncPeer *P, int Delta) = 0;
};

ModelSync *CreateSocketServer(const std::string &Port);
ModelSync *CreateSocketClient(const std::string &Host, const std::string &Port);
ModelSyncServer *CreateXBeeSyncServer();
ModelSync *CreateXBeeSyncClient();

#endif

//===-- ModelSync.h - Wireless Syncing of GameModel ---------------- c++ --===//
//
//                               UWH Timer
//
//           This file is distributed under the BSD 3-Clause License.
//                      See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef MODELSYNC_H
#define MODELSYNC_H

#include "uwhd/model/GameModel.h"

#include <string>
#include <vector>

struct ModelSync {
  virtual ~ModelSync() {};
  virtual void Init() = 0;
  virtual void setMgr(GameModelManager *M) = 0;
  virtual GameModelManager &getMgr() = 0;
};

//struct ModelSyncPeer {
//  virtual std::string name() const = 0;
//  virtual std::string addr() const = 0;
//};

struct ModelSyncServer : public ModelSync {
  virtual ~ModelSyncServer() {};
  //virtual std::vector<ModelSyncPeer*> peers() = 0;
  //virtual void claimPeer(const ModelSyncPeer *P) = 0;
  //virtual void getPeerWallClock(const ModelSyncPeer *P) = 0;
  //virtual void setPeerWallClock(const ModelSyncPeer *P) = 0;
  //virtual void adjustPeerWallClock(const ModelSyncPeer *P, int Delta) = 0;
};

ModelSync *CreateSocketServer(const std::string &Port);
ModelSync *CreateSocketClient(const std::string &Host, const std::string &Port);
ModelSyncServer *CreateXBeeSyncServer();
ModelSync *CreateXBeeSyncClient();

#endif

Add missing destructor bodies... oops

[sync] Add missing destructor bodies... oops


#ifndef _U8G2_FONTS_H
#define _U8G2_FONTS_H

#define U8G2_FONT_TABLE_ENTRY(font)

// ***************************************************************************
// Configure U8glib fonts
//
#ifndef U8G2_FONT_TABLE_EXTRA
//
// Add a U8G2_FONT_TABLE_ENTRY for each font you want to compile into the image
#define U8G2_FONT_TABLE \
  U8G2_FONT_TABLE_ENTRY(font_6x10_tf) \
  U8G2_FONT_TABLE_ENTRY(font_unifont_t_symbols) \

#else
//
// The font table can be defined in an external file.
#define U8G2_FONT_TABLE \
  U8G2_FONT_TABLE_EXTRA

#endif
// ***************************************************************************

#endif /* _U8G2_FONTS_H */

#ifndef _U8G2_FONTS_H
#define _U8G2_FONTS_H

#define U8G2_FONT_TABLE_ENTRY(font)

// ***************************************************************************
// Configure U8glib fonts
//
#ifndef U8G2_FONT_TABLE_EXTRA
//
// Add a U8G2_FONT_TABLE_ENTRY for each font you want to compile into the image
// See https://github.com/olikraus/u8g2/wiki/fntlistall for a complete list of
// available fonts. Drop the 'u8g2_' prefix when you add them here.
#define U8G2_FONT_TABLE \
  U8G2_FONT_TABLE_ENTRY(font_6x10_tf) \
  U8G2_FONT_TABLE_ENTRY(font_unifont_t_symbols) \

#else
//
// The font table can be defined in an external file.
#define U8G2_FONT_TABLE \
  U8G2_FONT_TABLE_EXTRA

#endif
// ***************************************************************************

#endif /* _U8G2_FONTS_H */

Add comment for font list

Add comment for font list


#ifndef GVKILL_DEBUG_H
#define GVKILL_DEBUG_H
#include <cstdlib>
#include <iostream>

// FIXME: These need to be made Windows comptabile
#define DEBUG(X) if (getenv("GVKI_DEBUG") != NULL) X
#define DEBUG_MSG(X) DEBUG( std::cerr << "\033[32m***GVKILL:" << X  << "***\033[0m" << std::endl)

// FIXME: This belongs in its own header file
#define ERROR_MSG(X) std::cerr << "\033[31m**GVKILL ERROR:" << X << "***\033\[0m" << std::endl

#endif

#ifndef GVKILL_DEBUG_H
#define GVKILL_DEBUG_H
#include <cstdlib>
#include <iostream>

// FIXME: These need to be made Windows comptabile
#define DEBUG(X) if (getenv("GVKI_DEBUG") != NULL) X
#define DEBUG_MSG(X) DEBUG( std::cerr << "\033[32m***GVKI:" << X  << "***\033[0m" << std::endl)

// FIXME: This belongs in its own header file
#define ERROR_MSG(X) std::cerr << "\033[31m**GVKI ERROR:" << X << "***\033\[0m" << std::endl

#endif

Fix typos in DEBUG_MSG and ERROR_MSG macros


/* libunwind - a platform-independent unwind library
   Copyright (C) 2002 Hewlett-Packard Co
	Contributed by David Mosberger-Tang <davidm@hpl.hp.com>

This file is part of libunwind.

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 "unwind_i.h"

int
unw_get_proc_info (unw_cursor_t *cursor, unw_proc_info_t *pi)
{
  struct cursor *c = (struct cursor *) cursor;
#if 0
  int ret;
#endif

  memset (pi, 0, sizeof (*pi));
  pi->start_ip = c->eip;
  pi->end_ip = c->eip + 1;

#if 0
  if ((ret = ia64_make_proc_info (c)) < 0)
    return ret;
#endif
  return 0;
}

(unw_get_proc_info): Implement a minimalistic version for x86.

(Logical change 1.81)


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

#include "test_mocks.h"

DEFINE_FFF_GLOBALS;

/* Mocks for common/init_rom.c */
DEFINE_FAKE_VALUE_FUNC(const void *, init_rom_map, const void *, int);
DEFINE_FAKE_VOID_FUNC(init_rom_unmap, const void *, int);
DEFINE_FAKE_VALUE_FUNC(int, init_rom_copy, int, int, int);

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

#include <ztest.h>

#include "test_mocks.h"

DEFINE_FFF_GLOBALS;

/* Mocks for common/init_rom.c */
DEFINE_FAKE_VALUE_FUNC(const void *, init_rom_map, const void *, int);
DEFINE_FAKE_VOID_FUNC(init_rom_unmap, const void *, int);
DEFINE_FAKE_VALUE_FUNC(int, init_rom_copy, int, int, int);

/**
 * @brief Reset all the fakes before each test.
 */
static void fff_reset_rule_before(const struct ztest_unit_test *test,
				  void *data)
{
	ARG_UNUSED(test);
	ARG_UNUSED(data);

	RESET_FAKE(init_rom_map);
	RESET_FAKE(init_rom_unmap);
	RESET_FAKE(init_rom_copy);
}

ZTEST_RULE(fff_reset_rule, fff_reset_rule_before, NULL);

Add a test rule to reset the FFF fakes

zephyr: Add a test rule to reset the FFF fakes

Add a test rule to reset all the fakes so that tests no longer
have to be responsible for it.

BRANCH=none
BUG=none
TEST=zmake configure --clobber --test test-drivers

Signed-off-by: Yuval Peress <50dc11c009bd4d7e9d9d15a383c1743ce5ee82ef@google.com>
Change-Id: Ifbb9107aec843b5b127e8842ac4fc5c0e4c8086b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3500299
Reviewed-by: Jeremy Bettis <4df7b5147fee087dca33c181f288ee7dbf56e022@chromium.org>


/** @file
  Internal Header file for PEI Services Table Pointer Library.

  Copyright (c) 2006, Intel Corporation<BR>
  All rights reserved. This program and the accompanying materials
  are licensed and made available under the terms and conditions of the BSD License
  which accompanies this distribution.  The full text of the license may be found at
  http://opensource.org/licenses/bsd-license.php

  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

**/

#ifndef _PEI_SERVICE_TABLE_POINTER_INTERNAL_H_
#define _PEI_SERVICE_TABLE_POINTER_INTERNAL_H_
/**
  The constructor function caches the pointer to PEI services.

  The constructor function caches the pointer to PEI services.
  It will always return EFI_SUCCESS.

  @param  FfsHeader   Pointer to FFS header the loaded driver.
  @param  PeiServices Pointer to the PEI services.

  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.

**/
EFI_STATUS
EFIAPI
PeiServicesTablePointerLibConstructor (
  IN EFI_PEI_FILE_HANDLE  *FfsHeader,
  IN EFI_PEI_SERVICES     **PeiServices
  )
;
#endif

/** @file
  Internal Header file for PEI Services Table Pointer Library.

  Copyright (c) 2006, Intel Corporation<BR>
  All rights reserved. This program and the accompanying materials
  are licensed and made available under the terms and conditions of the BSD License
  which accompanies this distribution.  The full text of the license may be found at
  http://opensource.org/licenses/bsd-license.php

  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.

**/

#ifndef _PEI_SERVICE_TABLE_POINTER_INTERNAL_H_
#define _PEI_SERVICE_TABLE_POINTER_INTERNAL_H_
/**
  The constructor function caches the pointer to PEI services.

  The constructor function caches the pointer to PEI services.
  It will always return EFI_SUCCESS.

  @param  FfsHeader   Pointer to FFS header the loaded driver.
  @param  PeiServices Pointer to the PEI services.

  @retval EFI_SUCCESS   The constructor always returns EFI_SUCCESS.

**/
EFI_STATUS
EFIAPI
PeiServicesTablePointerLibConstructor (
  IN EFI_PEI_FILE_HANDLE  FileHandle,
  IN EFI_PEI_SERVICES     **PeiServices
  )
;
#endif

Fix the constructor typo. The new type should follow PI spec.

git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@4363 6f19259b-4bc3-4df7-8a09-765794883524


//
//  RTRNodeState.h
//  Router
//
//  Created by Nick Tymchenko on 14/09/15.
//  Copyright (c) 2015 Pixty. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, RTRNodeState) {
    RTRNodeStateNotInitialized = 0,
    RTRNodeStateInactive = 1,
    RTRNodeStateDeactivating = 2,
    RTRNodeStateActivating = 3,
    RTRNodeStateActive = 4
};

static inline BOOL RTRNodeStateIsInitialized(RTRNodeState state) {
    return state != RTRNodeStateNotInitialized;
}

static inline BOOL RTRNodeStateIsTransitioning(RTRNodeState state) {
    return state == RTRNodeStateDeactivating || state == RTRNodeStateActivating;
}

Add helper functions for state

Add helper functions for state


enum npb_class                  {  S,  W,  A,  B,  C,  D };
static const int NKEY_LOG2[]    = { 16, 20, 23, 25, 27, 29 };
static const int MAX_KEY_LOG2[] = { 11, 16, 19, 21, 23, 27 };
static const int NBUCKET_LOG2[] = { 10, 10, 10, 10, 10, 10 };

inline npb_class get_npb_class(char c) {
  switch (c) {
    case 'S': return S;
    case 'W': return W;
    case 'A': return A;
    case 'B': return B;
    case 'C': return C;
    case 'D': return D;
  }
}

Add support for NPB classes.

Sort: Add support for NPB classes.