/* This file is part of VoltDB.
 * Copyright (C) 2008-2019 VoltDB Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with VoltDB.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef UNDOQUANTUM_RELEASE_INTEREST_H_
#define UNDOQUANTUM_RELEASE_INTEREST_H_

namespace voltdb {
class UndoQuantumReleaseInterest {
public:
    virtual void notifyQuantumRelease() = 0;
    virtual ~UndoQuantumReleaseInterest() {}

    inline bool isNewReleaseInterest(int64_t currentUndoToken) {
        if (m_lastSeenUndoToken == currentUndoToken) {
            return false;
        }
        else {
            m_lastSeenUndoToken = currentUndoToken;
            return true;
        }
    }
private:
    int64_t m_lastSeenUndoToken;
};
}

#endif /* UNDOQUANTUM_H_ */

/* This file is part of VoltDB.
 * Copyright (C) 2008-2019 VoltDB Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with VoltDB.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef UNDOQUANTUM_RELEASE_INTEREST_H_
#define UNDOQUANTUM_RELEASE_INTEREST_H_

namespace voltdb {
class UndoQuantumReleaseInterest {
public:
    UndoQuantumReleaseInterest() : m_lastSeenUndoToken(-1);
    virtual void notifyQuantumRelease() = 0;
    virtual ~UndoQuantumReleaseInterest() {}

    inline bool isNewReleaseInterest(int64_t currentUndoToken) {
        if (m_lastSeenUndoToken == currentUndoToken) {
            return false;
        }
        else {
            m_lastSeenUndoToken = currentUndoToken;
            return true;
        }
    }
private:
    int64_t m_lastSeenUndoToken;
};
}

#endif /* UNDOQUANTUM_H_ */

ENG-15084:
Fix Valgrind variable initialization issue.


#pragma once

#include "Control.h"
#include "StatusCallback.h"

class ProgressBar : public Control, public StatusCallback {
public:
    ProgressBar(int id, Dialog &parent, bool translate = true) :
    Control(id, parent, translate) {

    }

protected:
    virtual IFACEMETHODIMP OnProgress(
        unsigned long ulProgress,
        unsigned long ulProgressMax,
        unsigned long ulStatusCode,
        LPCWSTR szStatusText
    );
};

#pragma once

#include "Control.h"
#include "StatusCallback.h"
#include <CommCtrl.h>

class ProgressBar : public Control, public StatusCallback {
public:
    ProgressBar(int id, Dialog &parent, bool translate = true) :
    Control(id, parent, translate) {

    }

    void Range(int min, int max) {
        SendMessage(_hWnd, PBM_SETRANGE32, min, max);
    }

    void Position(int pos) {
        SendMessage(_hWnd, PBM_SETPOS, pos, 0);
    }

    void Marquee(bool enabled, int refresh = 30) {
        SendMessage(_hWnd, PBM_SETMARQUEE, enabled, refresh);
    }

protected:
    virtual IFACEMETHODIMP OnProgress(
        unsigned long ulProgress,
        unsigned long ulProgressMax,
        unsigned long ulStatusCode,
        LPCWSTR szStatusText
    );
};

Add basic implementation of progress bar methods


/* Copyright (C) 2002 Timo Sirainen */

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

int cmd_create(Client *client)
{
	const char *mailbox;

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

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

	if (mailbox[strlen(mailbox)-1] == client->storage->hierarchy_sep) {
		/* name ends with hierarchy separator - client is just
		   informing us that it wants to create a mailbox under
		   this name. we don't need that information. */
	} else if (!client->storage->create_mailbox(client->storage, mailbox)) {
		client_send_storage_error(client);
		return TRUE;
	}

	client_send_tagline(client, "OK Create completed.");
	return TRUE;
}

/* Copyright (C) 2002 Timo Sirainen */

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

int cmd_create(Client *client)
{
	const char *mailbox;
	int ignore;

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

	ignore = mailbox[strlen(mailbox)-1] == client->storage->hierarchy_sep;
	if (ignore) {
		/* name ends with hierarchy separator - client is just
		   informing us that it wants to create a mailbox under
		   this name. we don't need that information, but verify
		   that the mailbox name is valid */
		mailbox = t_strndup(mailbox, strlen(mailbox)-1);
	}

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

	if (!ignore &&
	    !client->storage->create_mailbox(client->storage, mailbox)) {
		client_send_storage_error(client);
		return TRUE;
	}

	client_send_tagline(client, "OK Create completed.");
	return TRUE;
}

CREATE mailbox<hierarchy separator> failed always.

--HG--
branch : HEAD


/* Copyright (c) 2004 Timo Sirainen */

#include "lib.h"
#include "str.h"
#include "str-sanitize.h"

void str_sanitize_append(string_t *dest, const char *src, size_t max_len)
{
	const char *p;

	for (p = src; *p != '\0'; p++) {
		if ((unsigned char)*p < 32)
			break;
	}

	str_append_n(dest, src, (size_t)(p - src));
	for (; *p != '\0' && max_len > 0; p++, max_len--) {
		if ((unsigned char)*p < 32)
			str_append_c(dest, '?');
		else
			str_append_c(dest, *p);
	}

	if (*p != '\0') {
		str_truncate(dest, str_len(dest)-3);
		str_append(dest, "...");
	}
}

const char *str_sanitize(const char *src, size_t max_len)
{
	string_t *str;

	str = t_str_new(I_MIN(max_len, 256));
	str_sanitize_append(str, src, max_len);
	return str_c(str);
}

/* Copyright (c) 2004 Timo Sirainen */

#include "lib.h"
#include "str.h"
#include "str-sanitize.h"

void str_sanitize_append(string_t *dest, const char *src, size_t max_len)
{
	const char *p;

	for (p = src; *p != '\0'; p++) {
		if (((unsigned char)*p & 0x7f) < 32)
			break;
	}

	str_append_n(dest, src, (size_t)(p - src));
	for (; *p != '\0' && max_len > 0; p++, max_len--) {
		if (((unsigned char)*p & 0x7f) < 32)
			str_append_c(dest, '?');
		else
			str_append_c(dest, *p);
	}

	if (*p != '\0') {
		str_truncate(dest, str_len(dest)-3);
		str_append(dest, "...");
	}
}

const char *str_sanitize(const char *src, size_t max_len)
{
	string_t *str;

	str = t_str_new(I_MIN(max_len, 256));
	str_sanitize_append(str, src, max_len);
	return str_c(str);
}

Convert also 0x80..0x9f characters to '?'

--HG--
branch : HEAD


//===--- Timer.h - Shared timers for compilation phases ---------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

#ifndef SWIFT_BASIC_TIMER_H
#define SWIFT_BASIC_TIMER_H

#include "swift/Basic/LLVM.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Support/Timer.h"

namespace swift {
  /// A convenience class for declaring a timer that's part of the Swift
  /// compilation timers group.
  class SharedTimer {
    enum class State {
      Initial,
      Skipped,
      Enabled
    };
    static State CompilationTimersEnabled;

    Optional<llvm::NamedRegionTimer> Timer;

  public:
    explicit SharedTimer(StringRef name) {
      if (CompilationTimersEnabled == State::Enabled)
        Timer.emplace(name, StringRef("Swift compilation"), StringRef("swift"),
                      StringRef("swift related timers"));
      else
        CompilationTimersEnabled = State::Skipped;
    }

    /// Must be called before any SharedTimers have been created.
    static void enableCompilationTimers() {
      assert(CompilationTimersEnabled != State::Skipped &&
             "a timer has already been created");
      CompilationTimersEnabled = State::Enabled;
    }
  };
} // end namespace swift

#endif // SWIFT_BASIC_TIMER_H

//===--- Timer.h - Shared timers for compilation phases ---------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//

#ifndef SWIFT_BASIC_TIMER_H
#define SWIFT_BASIC_TIMER_H

#include "swift/Basic/LLVM.h"
#include "llvm/ADT/Optional.h"
#include "llvm/Support/Timer.h"

namespace swift {
  /// A convenience class for declaring a timer that's part of the Swift
  /// compilation timers group.
  class SharedTimer {
    enum class State {
      Initial,
      Skipped,
      Enabled
    };
    static State CompilationTimersEnabled;

    Optional<llvm::NamedRegionTimer> Timer;

  public:
    explicit SharedTimer(StringRef name) {
      if (CompilationTimersEnabled == State::Enabled)
        Timer.emplace(name, name, "swift", "Swift compilation");
      else
        CompilationTimersEnabled = State::Skipped;
    }

    /// Must be called before any SharedTimers have been created.
    static void enableCompilationTimers() {
      assert(CompilationTimersEnabled != State::Skipped &&
             "a timer has already been created");
      CompilationTimersEnabled = State::Enabled;
    }
  };
} // end namespace swift

#endif // SWIFT_BASIC_TIMER_H

-debug-time-compilation: Fix 2f21735 to actually distinguish phases.

https://bugs.swift.org/browse/SR-4100


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

#pragma once

#include "ModuleManager.h"

DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All);

class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface
{
public:

	bool PythonGILAcquire();
	void PythonGILRelease();

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

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

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

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

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

	FUnrealEnginePythonModule UnrealEnginePythonModule;
	bool safeForRelease;
};

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

#pragma once

#include "ModuleManager.h"

DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All);

class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface
{
public:

	bool PythonGILAcquire();
	void PythonGILRelease();

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

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

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

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

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

	FUnrealEnginePythonModule UnrealEnginePythonModule;
	bool safeForRelease;
};

Revert "Add support for the Python Stdout Log"

This reverts commit 6dd58324c052cc893f6ce8f009903805185a71d1.


#include <stdlib.h>
#include "HsFFI.h"

StgInt* hs_counter_new(void) {
  StgInt* counter = malloc(sizeof(StgInt));
  *counter = 0;
  return counter;
}
void hs_counter_add(volatile StgInt* counter, StgInt n) {
  StgInt temp = n;
#if SIZEOF_VOID_P == 8
  __asm__ __volatile__("lock; xaddq %0,%1"
#elif SIZEOF_VOID_P == 4
  __asm__ __volatile__("lock; xaddl %0,%1"
#else
# error GHC untested on this architecture: sizeof(void *) != 4 or 8
#endif
                       : "+r" (temp), "+m" (*counter)
                       : : "cc", "memory");
}

StgInt hs_counter_read(volatile const StgInt* counter) {
  return *counter;
}

#include <stdlib.h>
#include "HsFFI.h"

StgInt* hs_counter_new(void) {
  StgInt* counter = malloc(sizeof(StgInt));
  *counter = 0;
  return counter;
}
void hs_counter_add(volatile StgInt* counter, StgInt n) {
  __sync_fetch_and_add(counter, n);
}

StgInt hs_counter_read(volatile const StgInt* counter) {
  return *counter;
}

Use GCC builtins instead of inline asm

Use GCC builtins instead of inline asm


#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;
}

#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();
}

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

Reason: breaks test_rand, because threading has to be initialized
before ssh_init()

This reverts commit ef1866db76ed10d64bf8cf97111554b2b2eb1278.


#include <mongoc.h>
#include <mongoc-openssl-private.h>

#include "TestSuite.h"

static void
test_extract_subject (void)
{
   char *subject;

   subject = _mongoc_openssl_extract_subject (BINARY_DIR"/../certificates/client.pem");
   ASSERT (0 == strcmp (subject, "CN=client,OU=kerneluser,O=10Gen,L=New York City,ST=New York,C=US"));
   bson_free (subject);
}

void
test_x509_install (TestSuite *suite)
{
   TestSuite_Add (suite, "/SSL/extract_subject", test_extract_subject);
}

#include <mongoc.h>
#include <mongoc-openssl-private.h>

#include "TestSuite.h"

static void
test_extract_subject (void)
{
   char *subject;

   subject = mongoc_ssl_extract_subject (BINARY_DIR"/../certificates/client.pem");
   ASSERT_CMPSTR (subject, "CN=client,OU=kerneluser,O=10Gen,L=New York City,ST=New York,C=US");
   bson_free (subject);
}

void
test_x509_install (TestSuite *suite)
{
   TestSuite_Add (suite, "/SSL/extract_subject", test_extract_subject);
}

Improve test output on failure

Improve test output on failure


#import <Foundation/Foundation.h>

extern NSString * const spt_kCurrentTestSuiteKey;
extern NSString * const spt_kCurrentSpecKey;

#define SPTCurrentTestSuite [[NSThread currentThread] threadDictionary][spt_kCurrentTestSuiteKey]
#define SPTCurrentSpec  [[NSThread currentThread] threadDictionary][spt_kCurrentSpecKey]
#define SPTCurrentGroup     [SPTCurrentTestSuite currentGroup]
#define SPTGroupStack       [SPTCurrentTestSuite groupStack]

#define SPTReturnUnlessBlockOrNil(block) if ((block) && !SPTIsBlock((block))) return;
#define SPTIsBlock(obj) [(obj) isKindOfClass:NSClassFromString(@"NSBlock")]

BOOL spt_isSpecClass(Class aClass);
NSString *spt_underscorize(NSString *string);
NSArray *spt_map(NSArray *array, id (^block)(id obj, NSUInteger idx));
NSArray *spt_shuffle(NSArray *array);
unsigned int spt_seed();

#import <Foundation/Foundation.h>

extern NSString * const spt_kCurrentTestSuiteKey;
extern NSString * const spt_kCurrentSpecKey;

#define SPTCurrentTestSuite [[NSThread mainThread] threadDictionary][spt_kCurrentTestSuiteKey]
#define SPTCurrentSpec  [[NSThread mainThread] threadDictionary][spt_kCurrentSpecKey]
#define SPTCurrentGroup     [SPTCurrentTestSuite currentGroup]
#define SPTGroupStack       [SPTCurrentTestSuite groupStack]

#define SPTReturnUnlessBlockOrNil(block) if ((block) && !SPTIsBlock((block))) return;
#define SPTIsBlock(obj) [(obj) isKindOfClass:NSClassFromString(@"NSBlock")]

BOOL spt_isSpecClass(Class aClass);
NSString *spt_underscorize(NSString *string);
NSArray *spt_map(NSArray *array, id (^block)(id obj, NSUInteger idx));
NSArray *spt_shuffle(NSArray *array);
unsigned int spt_seed();

Fix for reporting specta/expecta failures on the main thread.


// Dispatches asyncronously unless ARPerformWorkSynchronously is set on the shared dispatch manager
extern void ar_dispatch_async(dispatch_block_t block);

// Dispatches to the main queue unless ARPerformWorkSynchronously is set on the shared dispatch manager
extern void ar_dispatch_main_queue(dispatch_block_t block);

// Dispatches to a queue unless ARPerformWorkSynchronously is set on the shared dispatch manager
extern void ar_dispatch_on_queue(dispatch_queue_t queue, dispatch_block_t block);

extern void ar_dispatch_after_on_queue(float seconds, dispatch_queue_t queue, dispatch_block_t block);

extern void ar_dispatch_after(float seconds, dispatch_block_t block);

@interface ARDispatchManager : NSObject

+ (instancetype)sharedManager;

@end

extern void ar_dispatch_async(dispatch_block_t block);

extern void ar_dispatch_main_queue(dispatch_block_t block);

// Dispatches to a queue unless ARPerformWorkAsynchronously is set to false
extern void ar_dispatch_on_queue(dispatch_queue_t queue, dispatch_block_t block);

extern void ar_dispatch_after_on_queue(float seconds, dispatch_queue_t queue, dispatch_block_t block);

extern void ar_dispatch_after(float seconds, dispatch_block_t block);

@interface ARDispatchManager : NSObject

+ (instancetype)sharedManager;

@end

Remove + fix erroneous comments

Remove + fix erroneous comments


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

#ifndef SkNullCanvas_DEFINED
#define SkNullCanvas_DEFINED

#include "SkBitmap.h"

class SkCanvas;

/**
 * Creates a canvas that draws nothing. This is useful for performance testing.
 */
SkCanvas* SkCreateNullCanvas();

#endif

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

#ifndef SkNullCanvas_DEFINED
#define SkNullCanvas_DEFINED

#include "SkBitmap.h"

class SkCanvas;

/**
 * Creates a canvas that draws nothing. This is useful for performance testing.
 */
SK_API SkCanvas* SkCreateNullCanvas();

#endif

Add SK_API to null canvas create method

Add SK_API to null canvas create method

git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@4221 2bbb7eff-a529-9590-31e7-b0007b416f81


#include <complex>
#ifndef __hpux
using namespace std;
#endif

#pragma create TClass std::complex<int>+;
#pragma create TClass std::complex<long>+;
#pragma create TClass std::complex<float>+;
#pragma create TClass std::complex<double>+;

#ifdef G__NATIVELONGLONG
#pragma create TClass std::complex<long long>+;
// #pragma create TClass std::complex<long double>+;
#endif

Add missing new files for revision 32092

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


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

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

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

#ifndef Minisat_Rnd_h
#define Minisat_Rnd_h

#include "minisat/mtl/Vec.h"

namespace Minisat {

// Generate a random double:
static inline double drand(double& seed)
{
    seed *= 1389796;
    int q = (int)(seed / 2147483647);
    seed -= (double)q * 2147483647;
    return seed / 2147483647;
}

// Generate a random integer:
static inline int irand(double& seed, int size) { return (int)(drand(seed) * size); }

// Randomly shuffle the contents of a vector:
template<class T>
static void randomShuffle(double& seed, vec<T>& xs)
{
    for (int i = 0; i < xs.size(); i++){
        int pick = i + irand(seed, xs.size() - i);
        T tmp = xs[i];
        xs[i] = xs[pick];
        xs[pick] = tmp;
    }
}

// Randomly shuffle a vector of a vector (ugly)
template<class T>
static void randomShuffle(double& seed, vec<vec<T> >& xs)
{
    for (int i = 0; i < xs.size(); i++){
        int pick = i + irand(seed, xs.size() - i);
        vec<T> tmp; xs[i].moveTo(tmp);
        xs[pick].moveTo(xs[i]);
        tmp.moveTo(xs[pick]);
    }
}

//=================================================================================================
} // namespace Minisat
#endif

Move the random-generator to a more generic location.


#ifndef __CMPTEST_H__
#define __CMPTEST_H__

#include <stdio.h>

#include "sodium.h"

#ifndef TEST_SRCDIR
#define TEST_SRCDIR "./"
#endif

#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp"

#ifdef HAVE_ARC4RANDOM
# undef rand
# define rand(X) arc4random(X)
#endif

FILE *fp_res;
int   xmain(void);

int main(void)
{
    FILE *fp_out;
    int   c;

    if ((fp_res = fopen(TEST_NAME_RES, "w+")) == NULL) {
        perror("fopen(" TEST_NAME_RES ")");
        return 99;
    }
    if (sodium_init() != 0) {
        return 99;
    }
    if (xmain() != 0) {
        return 99;
    }
    rewind(fp_res);
    if ((fp_out = fopen(TEST_NAME_OUT, "r")) == NULL) {
        perror("fopen(" TEST_NAME_OUT ")");
        return 99;
    }
    do {
        if ((c = fgetc(fp_res)) != fgetc(fp_out)) {
            return 99;
        }
    } while (c != EOF);

    return 0;
}

#undef  printf
#define printf(...) fprintf(fp_res, __VA_ARGS__)
#define main xmain

#endif

#ifndef __CMPTEST_H__
#define __CMPTEST_H__

#include <stdio.h>

#include "sodium.h"

#ifndef TEST_SRCDIR
# define TEST_SRCDIR "."
#endif

#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp"

#ifdef HAVE_ARC4RANDOM
# undef rand
# define rand(X) arc4random(X)
#endif

FILE *fp_res;
int   xmain(void);

int main(void)
{
    FILE *fp_out;
    int   c;

    if ((fp_res = fopen(TEST_NAME_RES, "w+")) == NULL) {
        perror("fopen(" TEST_NAME_RES ")");
        return 99;
    }
    if (sodium_init() != 0) {
        return 99;
    }
    if (xmain() != 0) {
        return 99;
    }
    rewind(fp_res);
    if ((fp_out = fopen(TEST_NAME_OUT, "r")) == NULL) {
        perror("fopen(" TEST_NAME_OUT ")");
        return 99;
    }
    do {
        if ((c = fgetc(fp_res)) != fgetc(fp_out)) {
            return 99;
        }
    } while (c != EOF);

    return 0;
}

#undef  printf
#define printf(...) fprintf(fp_res, __VA_ARGS__)
#define main xmain

#endif

Add a default value for TEST_SRCDIR

Add a default value for TEST_SRCDIR


#ifndef _FIX_WINSOCK2_H
#define _FIX_WINSOCK2_H 1

#include_next <winsock2.h>

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

#endif

#ifndef _FIX_WINSOCK2_H
#define _FIX_WINSOCK2_H 1

#include_next <winsock2.h>

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

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

#endif

#endif // _FIX_WINSOCK2_H

Define WSAPOLLFD only on mingw 4.x

Define WSAPOLLFD only on mingw 4.x

Fixes #10327


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


// Copyright 2016 The Bazel 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.
//
//
// blaze_abrupt_exit.h: Deals with abrupt exits of the Blaze server.
//
#ifndef THIRD_PARTY_BAZEL_SRC_MAIN_CPP_BLAZE_ABRUPT_EXIT_H_
#define THIRD_PARTY_BAZEL_SRC_MAIN_CPP_BLAZE_ABRUPT_EXIT_H_

namespace blaze {

class GlobalVariables;

// Returns the exit code to use for when the Blaze server exits abruptly.
int GetExitCodeForAbruptExit(const GlobalVariables& globals);

}  // namespace blaze
#endif  // THIRD_PARTY_BAZEL_SRC_MAIN_CPP_BLAZE_ABRUPT_EXIT_H_

// Copyright 2016 The Bazel 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.
//
//
// blaze_abrupt_exit.h: Deals with abrupt exits of the Blaze server.
//
#ifndef THIRD_PARTY_BAZEL_SRC_MAIN_CPP_BLAZE_ABRUPT_EXIT_H_
#define THIRD_PARTY_BAZEL_SRC_MAIN_CPP_BLAZE_ABRUPT_EXIT_H_

namespace blaze {

struct GlobalVariables;

// Returns the exit code to use for when the Blaze server exits abruptly.
int GetExitCodeForAbruptExit(const GlobalVariables& globals);

}  // namespace blaze
#endif  // THIRD_PARTY_BAZEL_SRC_MAIN_CPP_BLAZE_ABRUPT_EXIT_H_

Fix compile warning for struct/class mismatch

./compile.sh is giving:

$ ./compile.sh build bazel-bin/src/bazel
🍃  Building Bazel with Bazel.
INFO: Found 1 target...
INFO: From Compiling src/main/cpp/blaze.cc:
In file included from src/main/cpp/blaze.cc:58:
./src/main/cpp/blaze_globals.h:42:1: warning: 'GlobalVariables' defined as a struct here but previously declared as a class [-Wmismatched-tags]
struct GlobalVariables {
^
./src/main/cpp/blaze_abrupt_exit.h:23:1: note: did you mean struct here?
class GlobalVariables;
^~~~~
struct
1 warning generated.

--
MOS_MIGRATED_REVID=111863702


#ifndef _CPR_TYPES_H_
#define _CPR_TYPES_H_

#include <map>
#include <string>

#include <curl/curl.h>

struct case_insensitive_compare
{
    case_insensitive_compare() {}

    bool operator()(const std::string& a, const std::string& b) const {
        return to_lower(a) < to_lower(b);
    }

    static void char_to_lower(char& c) {
        if (c >= 'A' && c <= 'Z')
        c += ('a' - 'A');
    }

    static std::string to_lower(const std::string& a) {
        std::string s(a);
        std::for_each(s.begin(), s.end(), char_to_lower);
        return s;
    }
};

typedef std::map<std::string, std::string> Parameters;
typedef std::map<std::string, std::string, case_insensitive_compare> Header;
typedef std::string Url;
typedef std::map<std::string, std::string> Payload;
typedef long Timeout;

typedef struct {
    CURL* handle;
    struct curl_slist* chunk;
} CurlHolder;

#endif

#ifndef _CPR_TYPES_H_
#define _CPR_TYPES_H_

#include <algorithm>
#include <map>
#include <string>

#include <curl/curl.h>

struct case_insensitive_compare
{
    case_insensitive_compare() {}

    bool operator()(const std::string& a, const std::string& b) const {
        return to_lower(a) < to_lower(b);
    }

    static void char_to_lower(char& c) {
        if (c >= 'A' && c <= 'Z')
        c += ('a' - 'A');
    }

    static std::string to_lower(const std::string& a) {
        std::string s(a);
        std::for_each(s.begin(), s.end(), char_to_lower);
        return s;
    }
};

typedef std::map<std::string, std::string> Parameters;
typedef std::map<std::string, std::string, case_insensitive_compare> Header;
typedef std::string Url;
typedef std::map<std::string, std::string> Payload;
typedef long Timeout;

typedef struct {
    CURL* handle;
    struct curl_slist* chunk;
} CurlHolder;

#endif

Include header where for_each is defined


/* Copyright 2015 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 TENSORFLOW_CORE_PLATFORM_DEFAULT_CORD_H_
#define TENSORFLOW_CORE_PLATFORM_DEFAULT_CORD_H_

#if !defined(__CUDACC__)

// TODO(frankchn): Resolve compilation errors when building absl::Cord with CUDA
#include "absl/strings/cord.h"
#define TF_CORD_SUPPORT 1

#endif  // __CUDACC__

#endif  // TENSORFLOW_CORE_PLATFORM_DEFAULT_CORD_H_

/* Copyright 2015 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 TENSORFLOW_CORE_PLATFORM_DEFAULT_CORD_H_
#define TENSORFLOW_CORE_PLATFORM_DEFAULT_CORD_H_

#include "absl/strings/cord.h"
#define TF_CORD_SUPPORT 1

#endif  // TENSORFLOW_CORE_PLATFORM_DEFAULT_CORD_H_

Enable Cord in NVCC build.

Enable Cord in NVCC build.

PiperOrigin-RevId: 362322881
Change-Id: I49c24e6e961258b96c194812452de27678141300


#ifndef GrGLConfig_chrome_DEFINED
#define GrGLConfig_chrome_DEFINED

#define GR_SUPPORT_GLES2    1

// gl2ext.h will define these extensions macros but Chrome doesn't provide
// prototypes.
#define GL_OES_mapbuffer                      0

#define GR_GL_PLATFORM_HEADER       <GLES2/gl2.h>
#define GR_GL_PLATFORM_HEADER_EXT   <GLES2/gl2ext.h>

#define GR_GL_FUNCTION_TYPE

#define GR_GL_PROC_ADDRESS(X)       &X

// chrome always assumes BGRA
#define GR_GL_32BPP_COLOR_FORMAT    GR_BGRA

// glGetError() forces a sync with gpu process on chrome
#define GR_GL_CHECK_ERROR_START     0

#endif

#ifndef GrGLConfig_chrome_DEFINED
#define GrGLConfig_chrome_DEFINED

#define GR_SUPPORT_GLES2    1

// gl2ext.h will define these extensions macros but Chrome doesn't provide
// prototypes.
#define GL_OES_mapbuffer                      0

#define GR_GL_PLATFORM_HEADER       <GLES2/gl2.h>
#define GR_GL_PLATFORM_HEADER_EXT   <GLES2/gl2ext.h>

#define GR_GL_FUNCTION_TYPE

#define GR_GL_PROC_ADDRESS(X)       &X

// chrome always assumes BGRA
#define GR_GL_32BPP_COLOR_FORMAT    GR_GL_BGRA

// glGetError() forces a sync with gpu process on chrome
#define GR_GL_CHECK_ERROR_START     0

#endif

Fix macro in Chrome's GL config file

Fix macro in Chrome's GL config file

Review URL: http://codereview.appspot.com/4308041/

git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@980 2bbb7eff-a529-9590-31e7-b0007b416f81


#ifdef KLEE
#include "klee/klee.h"
#endif
#include <assert.h>
#include <stdio.h>

int main() {
  int a;
#ifdef KLEE
  klee_make_symbolic(&a, sizeof(a), "a");
#endif

  if (a == 0) {
    printf("a is zero\n");
#ifdef BUG
    assert(0);
#endif
  } else {
    printf("a is non-zero\n");
  }
  return 0;
}

#ifdef KLEE
#include "klee/klee.h"
#endif
#include <assert.h>
#include <stdio.h>

int main() {
  int a = 0;
#ifdef KLEE
  klee_make_symbolic(&a, sizeof(a), "a");
#endif

  if (a == 0) {
    printf("a is zero\n");
#ifdef BUG
    assert(0);
#endif
  } else {
    printf("a is non-zero\n");
  }
  return 0;
}

Fix assignment in concrete case for example benchmark so that bug should be deterministic.


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

#import <AsyncDisplayKit/ASDisplayNode.h>
#import <AsyncDisplayKit/ASDisplayNodeExtras.h>

#import <AsyncDisplayKit/ASControlNode.h>
#import <AsyncDisplayKit/ASImageNode.h>
#import <AsyncDisplayKit/ASTextNode.h>

#import <AsyncDisplayKit/ASBasicImageDownloader.h>
#import <AsyncDisplayKit/ASMultiplexImageNode.h>
#import <AsyncDisplayKit/ASNetworkImageNode.h>

#import <AsyncDisplayKit/ASTableView.h>
#import <AsyncDisplayKit/ASCollectionView.h>
#import <AsyncDisplayKit/ASCellNode.h>

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

#import <AsyncDisplayKit/ASDisplayNode.h>
#import <AsyncDisplayKit/ASDisplayNodeExtras.h>

#import <AsyncDisplayKit/ASControlNode.h>
#import <AsyncDisplayKit/ASImageNode.h>
#import <AsyncDisplayKit/ASTextNode.h>

#import <AsyncDisplayKit/ASEditableTextNode.h>

#import <AsyncDisplayKit/ASBasicImageDownloader.h>
#import <AsyncDisplayKit/ASMultiplexImageNode.h>
#import <AsyncDisplayKit/ASNetworkImageNode.h>

#import <AsyncDisplayKit/ASTableView.h>
#import <AsyncDisplayKit/ASCollectionView.h>
#import <AsyncDisplayKit/ASCellNode.h>

Include ASEditableTextNode in framework header.


//===- SourceLoc.h - Source Locations and Ranges ----------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
//  This file defines types used to reason about source locations and ranges.
//
//===----------------------------------------------------------------------===//

#ifndef SWIFT_SOURCELOC_H
#define SWIFT_SOURCELOC_H

#include "swift/AST/LLVM.h"
#include "llvm/Support/SMLoc.h"

namespace swift {

/// SourceLoc in swift is just an SMLoc.  We define it as a different type
/// (instead of as a typedef) just to remove the "getFromPointer" methods and
/// enforce purity in the Swift codebase.
class SourceLoc {
public:
  llvm::SMLoc Value;

  SourceLoc() {}
  explicit SourceLoc(llvm::SMLoc Value) : Value(Value) {}

  bool isValid() const { return Value.isValid(); }

  bool operator==(const SourceLoc &RHS) const { return RHS.Value == Value; }
  bool operator!=(const SourceLoc &RHS) const { return RHS.Value != Value; }

  /// getAdvanced - Return a source location advanced a specified number of
  /// characters.
  SourceLoc getAdvancedLoc(unsigned NumCharacters) const {
    assert(isValid() && "Can't advance an invalid location");
    return SourceLoc(llvm::SMLoc::getFromPointer(Value.getPointer() +
                                                 NumCharacters));
  }
};

/// SourceRange in swift is a pair of locations.  However, note that the end
/// location is the start of the last token in the range, not the last character
/// in the range.  This is unlike SMRange, so we use a distinct type to make
/// sure that proper conversions happen where important.
class SourceRange {
public:
  SourceLoc Start, End;

  SourceRange() {}
  SourceRange(SourceLoc Start, SourceLoc End) : Start(Start), End(End) {
    assert(Start.isValid() == End.isValid() &&
           "Start and end should either both be valid or both be invalid!");
  }

  bool isValid() const { return Start.isValid(); }
};

} // end namespace swift

#endif

Add datatypes for swift to represent source locations and ranges, which are
distinct from the SMXXX types.  This is important because SMRange and
SourceRange have subtly different semantics, and is also nice to isolate
SMLoc from swift.

Swift SVN r749


#pragma once

#include "ntddk.h"
#include "wdf.h"
#include "usb.h"
#include "UsbSpec.h"
#include "wdfusb.h"
#include "Alloc.h"

class CWdfUsbInterface;

class CWdfUsbTarget
{
public:
    CWdfUsbTarget();
    ~CWdfUsbTarget();

    NTSTATUS Create(WDFDEVICE Device);
    void DeviceDescriptor(USB_DEVICE_DESCRIPTOR &Descriptor);
    NTSTATUS ConfigurationDescriptor(UCHAR Index, PUSB_CONFIGURATION_DESCRIPTOR Descriptor, PULONG TotalLength);
    NTSTATUS SetInterfaceAltSetting(UCHAR InterfaceIdx, UCHAR AltSettingIdx);

private:
    WDFDEVICE m_Device = WDF_NO_HANDLE;
    WDFUSBDEVICE m_UsbDevice = WDF_NO_HANDLE;

    CObjHolder<CWdfUsbInterface> m_Interfaces;
    UCHAR m_NumInterfaces = 0;

    CWdfUsbTarget(const CWdfUsbTarget&) = delete;
    CWdfUsbTarget& operator= (const CWdfUsbTarget&) = delete;
};

#pragma once

#include "ntddk.h"
#include "wdf.h"
#include "usb.h"
#include "UsbSpec.h"
#include "wdfusb.h"
#include "Alloc.h"

class CWdfUsbInterface;

class CWdfUsbTarget
{
public:
    CWdfUsbTarget();
    ~CWdfUsbTarget();

    NTSTATUS Create(WDFDEVICE Device);
    void DeviceDescriptor(USB_DEVICE_DESCRIPTOR &Descriptor);
    NTSTATUS ConfigurationDescriptor(UCHAR Index, PUSB_CONFIGURATION_DESCRIPTOR Descriptor, PULONG TotalLength);
    NTSTATUS SetInterfaceAltSetting(UCHAR InterfaceIdx, UCHAR AltSettingIdx);

    operator WDFUSBDEVICE () const
    { return m_UsbDevice; }

private:
    WDFDEVICE m_Device = WDF_NO_HANDLE;
    WDFUSBDEVICE m_UsbDevice = WDF_NO_HANDLE;

    CObjHolder<CWdfUsbInterface> m_Interfaces;
    UCHAR m_NumInterfaces = 0;

    CWdfUsbTarget(const CWdfUsbTarget&) = delete;
    CWdfUsbTarget& operator= (const CWdfUsbTarget&) = delete;
};

UsbDk: Introduce USB target raw device accessor

Signed-off-by: Dmitry Fleytman <f50f56ffad4b379c2a89812e98b14900ef87e9ea@redhat.com>


//
//  CDVBackgroundGeoLocation.h
//
//  Created by Chris Scott <chris@transistorsoft.com>
//

#import <Cordova/CDVPlugin.h>
#import "CDVLocation.h"
#import <AudioToolbox/AudioToolbox.h>

@interface CDVBackgroundGeoLocation : CDVPlugin <CLLocationManagerDelegate>

@property (nonatomic, strong) NSString* syncCallbackId;
@property (nonatomic, strong) NSMutableArray* stationaryRegionListeners;

- (void) configure:(CDVInvokedUrlCommand*)command;
- (void) start:(CDVInvokedUrlCommand*)command;
- (void) stop:(CDVInvokedUrlCommand*)command;
- (void) finish:(CDVInvokedUrlCommand*)command;
- (void) onPaceChange:(CDVInvokedUrlCommand*)command;
- (void) setConfig:(CDVInvokedUrlCommand*)command;

- (void) onSuspend:(NSNotification *)notification;
- (void) onResume:(NSNotification *)notification;

@end

//
//  CDVBackgroundGeoLocation.h
//
//  Created by Chris Scott <chris@transistorsoft.com>
//

#import <Cordova/CDVPlugin.h>
#import "CDVLocation.h"
#import <AudioToolbox/AudioToolbox.h>

@interface CDVBackgroundGeoLocation : CDVPlugin <CLLocationManagerDelegate>

@property (nonatomic, strong) NSString* syncCallbackId;
@property (nonatomic, strong) NSMutableArray* stationaryRegionListeners;

- (void) configure:(CDVInvokedUrlCommand*)command;
- (void) start:(CDVInvokedUrlCommand*)command;
- (void) stop:(CDVInvokedUrlCommand*)command;
- (void) finish:(CDVInvokedUrlCommand*)command;
- (void) onPaceChange:(CDVInvokedUrlCommand*)command;
- (void) setConfig:(CDVInvokedUrlCommand*)command;
- (void) onStationary:(CDVInvokedUrlCommand*)command;
- (void) getStationaryLocation:(CDVInvokedUrlCommand *)command;
- (void) onSuspend:(NSNotification *)notification;
- (void) onResume:(NSNotification *)notification;

@end

Add 2 missing public methods to .h, including new onStationary method


#include <stdlib.h>
#include <nan.h>
#include <condition_variable>
#include "libsass/sass_context.h"

#ifdef __cplusplus
extern "C" {
#endif

  using namespace v8;

  void compile_data(struct Sass_Data_Context* dctx);
  void compile_file(struct Sass_File_Context* fctx);
  void compile_it(uv_work_t* req);

  struct sass_context_wrapper {
    // binding related
    bool is_sync;
    void* cookie;
    const char* prev;
    const char* file;
    std::mutex* importer_mutex;
    std::condition_variable* importer_condition_variable;

    // libsass related
    Sass_Import** imports;
    Sass_Data_Context* dctx;
    Sass_File_Context* fctx;

    // libuv related
    uv_async_t async;
    uv_work_t request;

    // v8 and nan related
    Persistent<Object> result;
    NanCallback* error_callback;
    NanCallback* success_callback;
    NanCallback* importer_callback;
  };

  struct sass_context_wrapper*      sass_make_context_wrapper(void);
  void sass_wrapper_dispose(struct sass_context_wrapper*, char*);
  void sass_free_context_wrapper(struct sass_context_wrapper*);

#ifdef __cplusplus
}
#endif

Include <stdlib.h> for malloc related functions.


/*
 * $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(Error)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(BackendOpen)
SLTM(BackendXID)
SLTM(BackendReuse)
SLTM(BackendClose)
SLTM(HttpError)
SLTM(ClientAddr)
SLTM(Backend)
SLTM(Request)
SLTM(Response)
SLTM(Length)
SLTM(Status)
SLTM(URL)
SLTM(Protocol)
SLTM(Header)
SLTM(BldHdr)
SLTM(LostHeader)
SLTM(VCL_call)
SLTM(VCL_trace)
SLTM(VCL_return)
SLTM(XID)
SLTM(Hit)
SLTM(ExpBan)
SLTM(ExpPick)
SLTM(ExpKill)
SLTM(WorkThread)

/*
 * $Id$
 *
 * Define the tags in the shared memory in a reusable format.
 * Whoever includes this get to define what the SLTM macro does.
 *
 * REMEMBER to update the documentation (especially the varnishlog(1) man
 * page) whenever this list changes.
 */

SLTM(Debug)
SLTM(Error)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(BackendOpen)
SLTM(BackendXID)
SLTM(BackendReuse)
SLTM(BackendClose)
SLTM(HttpError)
SLTM(ClientAddr)
SLTM(Backend)
SLTM(Request)
SLTM(Response)
SLTM(Length)
SLTM(Status)
SLTM(URL)
SLTM(Protocol)
SLTM(Header)
SLTM(BldHdr)
SLTM(LostHeader)
SLTM(VCL_call)
SLTM(VCL_trace)
SLTM(VCL_return)
SLTM(XID)
SLTM(Hit)
SLTM(ExpBan)
SLTM(ExpPick)
SLTM(ExpKill)
SLTM(WorkThread)

Add a note to update varnishlog(1) whenever this list changes.

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


//
//  CocoaLumberjack.h
//  CocoaLumberjack
//
//  Created by Andrew Mackenzie-Ross on 3/02/2015.
//
//

#import <Foundation/Foundation.h>

//! Project version number for CocoaLumberjack.
FOUNDATION_EXPORT double CocoaLumberjackVersionNumber;

//! Project version string for CocoaLumberjack.
FOUNDATION_EXPORT const unsigned char CocoaLumberjackVersionString[];

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

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
    #define DD_LEGACY_MACROS 0
#endif

// Core
#import <CocoaLumberjack/DDLog.h>

// Main macros
#import <CocoaLumberjack/DDLogMacros.h>
#import <CocoaLumberjack/DDAssertMacros.h>

// Capture ASL
#import <CocoaLumberjack/DDASLLogCapture.h>

// Loggers
#import <CocoaLumberjack/DDTTYLogger.h>
#import <CocoaLumberjack/DDASLLogger.h>
#import <CocoaLumberjack/DDFileLogger.h>

// CLI
#if defined(DD_CLI) || !__has_include(<AppKit/NSColor.h>)
#import <CocoaLumberjack/CLIColor.h>
#endif

//
//  CocoaLumberjack.h
//  CocoaLumberjack
//
//  Created by Andrew Mackenzie-Ross on 3/02/2015.
//
//

#import <Foundation/Foundation.h>

//! Project version number for CocoaLumberjack.
FOUNDATION_EXPORT double CocoaLumberjackVersionNumber;

//! Project version string for CocoaLumberjack.
FOUNDATION_EXPORT const unsigned char CocoaLumberjackVersionString[];

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

// Disable legacy macros
#ifndef DD_LEGACY_MACROS
    #define DD_LEGACY_MACROS 0
#endif

// Core
#import <CocoaLumberjack/DDLog.h>

// Main macros
#import <CocoaLumberjack/DDLogMacros.h>
#import <CocoaLumberjack/DDAssertMacros.h>

// Capture ASL
#import <CocoaLumberjack/DDASLLogCapture.h>

// Loggers
#import <CocoaLumberjack/DDTTYLogger.h>
#import <CocoaLumberjack/DDASLLogger.h>
#import <CocoaLumberjack/DDFileLogger.h>

// CLI
#import <CocoaLumberjack/CLIColor.h>

Revert "Conditionally include CLIColor in umbrella header"


/*****************************************************************************
 * vlc_memory.h: Memory functions
 *****************************************************************************
 * Copyright (C) 2009 the VideoLAN team
 *
 * Authors: JP Dinger <jpd at videolan dot org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
 *****************************************************************************/

#ifndef VLC_MEMORY_H
#define VLC_MEMORY_H 1

/**
 * \file
 * This file deals with memory fixups
 */

/**
 * \defgroup memory Memory
 * @{
 */

/**
 * This wrapper around realloc() will free the input pointer when
 * realloc() returns NULL. The use case ptr = realloc(ptr, newsize) will
 * cause a memory leak when ptr pointed to a heap allocation before,
 * leaving the buffer allocated but unreferenced. vlc_realloc() is a
 * drop-in replacement for that use case (and only that use case).
 */
static inline void *realloc_or_free( void *p, size_t sz )
{
    void *n = realloc(p,sz);
    if( !n )
        free(p);
    return n;
}

/**
 * @}
 */

#endif

Introduce realloc_or_free(), which does what realloc() does but will free the argument if the reallocation fails. This is useful in some, but not all, use cases of realloc().


/* Copyright 2022 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 TENSORFLOW_LITE_IOS_TENSORFLOWLITEC_H_
#define TENSORFLOW_LITE_IOS_TENSORFLOWLITEC_H_

#include "tensorflow/lite/builtin_ops.h"
#include "tensorflow/lite/c/c_api.h"
#include "tensorflow/lite/c/c_api_experimental.h"
#include "tensorflow/lite/c/c_api_types.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/core/c/c_api.h"
#include "tensorflow/lite/delegates/xnnpack/xnnpack_delegate.h"

#endif  // TENSORFLOW_LITE_IOS_TENSORFLOWLITEC_H_

/* Copyright 2022 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 TENSORFLOW_LITE_IOS_TENSORFLOWLITEC_H_
#define TENSORFLOW_LITE_IOS_TENSORFLOWLITEC_H_

#include "tensorflow/lite/builtin_ops.h"
#include "tensorflow/lite/c/c_api.h"
#include "tensorflow/lite/c/c_api_experimental.h"
#include "tensorflow/lite/c/c_api_types.h"
#include "tensorflow/lite/c/common.h"
#include "tensorflow/lite/delegates/xnnpack/xnnpack_delegate.h"

#endif  // TENSORFLOW_LITE_IOS_TENSORFLOWLITEC_H_

Fix iOS nightly release. Exports the actual c api header instead of the shim header in the TensorflowLiteC framework

PiperOrigin-RevId: 477905780


/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * WindowsInterfacePicker.h
 * Choose an interface to listen on
 * Copyright (C) 2005-2010 Simon Newton
 */

#ifndef COMMON_NETWORK_WINDOWSINTERFACEPICKER_H_
#define COMMON_NETWORK_WINDOWSINTERFACEPICKER_H_

#include <vector>
#include "ola/network/InterfacePicker.h"

/*
 * The InterfacePicker for windows
 */
class WindowsInterfacePicker: public InterfacePicker {
  public:
    std::vector<Interface> GetInterfaces() const;
};
}  // network
}  // ola
#endif  // COMMON_NETWORK_WINDOWSINTERFACEPICKER_H_

/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * WindowsInterfacePicker.h
 * Choose an interface to listen on
 * Copyright (C) 2005-2010 Simon Newton
 */

#ifndef COMMON_NETWORK_WINDOWSINTERFACEPICKER_H_
#define COMMON_NETWORK_WINDOWSINTERFACEPICKER_H_

#include <vector>
#include "ola/network/InterfacePicker.h"

namespace ola {
namespace network {

/*
 * The InterfacePicker for windows
 */
class WindowsInterfacePicker: public InterfacePicker {
  public:
    std::vector<Interface> GetInterfaces() const;
};
}  // network
}  // ola
#endif  // COMMON_NETWORK_WINDOWSINTERFACEPICKER_H_

Add the missing namespace bits

Add the missing namespace bits


/* Copyright 2022 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 TENSORFLOW_COMPILER_XLA_PJRT_PLUGIN_DEVICE_CLIENT_H_
#define TENSORFLOW_COMPILER_XLA_PJRT_PLUGIN_DEVICE_CLIENT_H_

namespace xla {

// Not implemented by default. It is the responsibility of the plugin device
// author to provide an implementation of this function.
StatusOr<std::unique_ptr<PjRtClient>> GetTfrtPluginDeviceClient();

}

#endif // TENSORFLOW_COMPILER_XLA_PJRT_PLUGIN_DEVICE_CLIENT_H_

/* Copyright 2022 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 TENSORFLOW_COMPILER_XLA_PJRT_PLUGIN_DEVICE_CLIENT_H_
#define TENSORFLOW_COMPILER_XLA_PJRT_PLUGIN_DEVICE_CLIENT_H_

namespace xla {

// Not implemented by default. It is the responsibility of the plugin device
// author to provide an implementation of this function. It is recommended to
// implement this in //tensorflow/compiler/plugin:plugin
StatusOr<std::unique_ptr<PjRtClient>> GetTfrtPluginDeviceClient();

}  // namespace xla

#endif  // TENSORFLOW_COMPILER_XLA_PJRT_PLUGIN_DEVICE_CLIENT_H_

Add comment on `GetTfrtPluginDeviceClient` to explain where to put the implementation.


/*
 * Copyright (C) 2009 Apple 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 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 APPLE 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 APPLE 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.
 */

#ifndef FontSmoothingMode_h
#define FontSmoothingMode_h

namespace WebCore {

    enum FontSmoothingMode { AutoSmoothing, NoSmoothing, Antialiased, SubpixelAntialiased };

} // namespace WebCore

#endif // FontSmoothingMode_h

Add file that was missing from the last change

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


/* __USE_POSIX, __USE_BSD, and __USE_BSD_SIGNAL used to be defined either
   here or with -D compile options, but __ macros should be set and used by C
   library macros, not Postgres code.  __USE_POSIX is set by features.h,
   __USE_BSD is set by bsd/signal.h, and __USE_BSD_SIGNAL appears not to
   be used.
*/
#define JMP_BUF
#define USE_POSIX_TIME

#if defined(__i386__)
typedef unsigned char slock_t;

#define HAS_TEST_AND_SET

#elif defined(__sparc__)
typedef unsigned char slock_t;

#define HAS_TEST_AND_SET

#elif defined(__powerpc__)
typedef unsigned int slock_t;

#define HAS_TEST_AND_SET

#elif defined(__alpha__)
typedef long int slock_t;

#define HAS_TEST_AND_SET

#elif defined(__mips__)
typedef unsigned int slock_t;

#define HAS_TEST_AND_SET

#endif

#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#ifdef HAVE_INT_TIMEZONE
#undef HAVE_INT_TIMEZONE
#endif
#endif

#if defined(__powerpc__)
#undef HAVE_INT_TIMEZONE
#endif

/* __USE_POSIX, __USE_BSD, and __USE_BSD_SIGNAL used to be defined either
   here or with -D compile options, but __ macros should be set and used by C
   library macros, not Postgres code.  __USE_POSIX is set by features.h,
   __USE_BSD is set by bsd/signal.h, and __USE_BSD_SIGNAL appears not to
   be used.
*/
#define JMP_BUF
#define USE_POSIX_TIME

#if defined(__i386__)
typedef unsigned char slock_t;

#define HAS_TEST_AND_SET

#elif defined(__sparc__)
typedef unsigned char slock_t;

#define HAS_TEST_AND_SET

#elif defined(__powerpc__)
typedef unsigned int slock_t;

#define HAS_TEST_AND_SET

#elif defined(__alpha__)
typedef long int slock_t;

#define HAS_TEST_AND_SET

#elif defined(__mips__)
typedef unsigned int slock_t;

#define HAS_TEST_AND_SET

#elif defined(__arm__)
typedef unsigned char slock_t

#define HAS_TEST_AND_SET

#endif

#if defined(__GLIBC__) && (__GLIBC__ >= 2)
#ifdef HAVE_INT_TIMEZONE
#undef HAVE_INT_TIMEZONE
#endif
#endif

#if defined(__powerpc__)
#undef HAVE_INT_TIMEZONE
#endif

Include information for armv4l from Mark Knox <segfault@hardline.org>.


/*
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * JsonParser.h
 * A class for Parsing Json data.
 * See http://www.json.org/
 * Copyright (C) 2013 Simon Newton
 */

/**
 * @addtogroup json
 * @{
 * @file JsonParser.h
 * @brief Header file for the JSON parser.
 * The implementation does it's best to conform to
 * http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf
 * @}
 */

#ifndef INCLUDE_OLA_WEB_JSONPARSER_H_
#define INCLUDE_OLA_WEB_JSONPARSER_H_

#include <string>

namespace ola {
namespace web {

class JsonValue;

/**
 * @addtogroup json
 * @{
 */

/**
 * @brief Parse a string containing Json data.
 */
class JsonParser {
 public:
  /**
   * @brief Parse a string with json data
   * @param input the input string
   * @param error set to an error message if parsing fails.
   * @return a JsonValue or NULL if parsing failed.
   */
  static JsonValue* Parse(const std::string &input, std::string *error);

 private:
  static JsonValue* ParseRaw(const char *input, std::string *error);
};

/**@}*/
}  // namespace web
}  // namespace ola
#endif  // INCLUDE_OLA_WEB_JSONPARSER_H_

Add the missing Parser header file.

Add the missing Parser header file.


#ifndef TYPES_H_90878954
#define TYPES_H_90878954

typedef enum {
	false,
	true
} bool_t;

#endif

#ifndef TYPES_H_90878954
#define TYPES_H_90878954

#if __STDC_VERSION__ == 199901L

#include <stdbool.h>
typedef bool bool_t;

#else // __STDC_VERSION__

typedef enum {
	false,
	true
} bool_t;

#endif // __STDC_VERSION

#endif

Use c99 standard bool when available

Use c99 standard bool when available


#ifndef _WLC_COMPOSITOR_H_
#define _WLC_COMPOSTIOR_H_

#include "visibility.h"
#include <stdbool.h>
#include <wayland-util.h>

struct wl_display;
struct wl_event_loop;
struct wl_event_source;
struct wlc_shell;
struct wlc_xdg_shell;
struct wlc_backend;
struct wlc_context;
struct wlc_render;

struct wlc_compositor {
   struct wl_global *global;
   struct wl_display *display;
   struct wl_event_loop *event_loop;
   struct wl_event_source *event_source;
   struct wlc_seat *seat;
   struct wlc_shell *shell;
   struct wlc_xdg_shell *xdg_shell;
   struct wlc_backend *backend;
   struct wlc_context *context;
   struct wlc_render *render;

   struct wl_list surfaces;
   struct wl_event_source *repaint_timer;
   bool repaint_scheduled;

   struct {
      void (*schedule_repaint)(struct wlc_compositor *compositor);
      uint32_t (*get_time)(void);
   } api;
};

WLC_API void wlc_compositor_run(struct wlc_compositor *compositor);
WLC_API void wlc_compositor_free(struct wlc_compositor *compositor);
WLC_API struct wlc_compositor* wlc_compositor_new(void);

#endif /* _WLC_COMPOSITOR_H_ */

#ifndef _WLC_COMPOSITOR_H_
#define _WLC_COMPOSITOR_H_

#include "visibility.h"
#include <stdbool.h>
#include <wayland-util.h>

struct wl_display;
struct wl_event_loop;
struct wl_event_source;
struct wlc_shell;
struct wlc_xdg_shell;
struct wlc_backend;
struct wlc_context;
struct wlc_render;

struct wlc_compositor {
   struct wl_global *global;
   struct wl_display *display;
   struct wl_event_loop *event_loop;
   struct wl_event_source *event_source;
   struct wlc_seat *seat;
   struct wlc_shell *shell;
   struct wlc_xdg_shell *xdg_shell;
   struct wlc_backend *backend;
   struct wlc_context *context;
   struct wlc_render *render;

   struct wl_list surfaces;
   struct wl_event_source *repaint_timer;
   bool repaint_scheduled;

   struct {
      void (*schedule_repaint)(struct wlc_compositor *compositor);
      uint32_t (*get_time)(void);
   } api;
};

WLC_API void wlc_compositor_run(struct wlc_compositor *compositor);
WLC_API void wlc_compositor_free(struct wlc_compositor *compositor);
WLC_API struct wlc_compositor* wlc_compositor_new(void);

#endif /* _WLC_COMPOSITOR_H_ */

Fix typo in header guard.

Fix typo in header guard.


//
//  OCChunkInputStream.h
//  Owncloud iOs Client
//
// Copyright (C) 2014 ownCloud Inc. (http://www.owncloud.org/)
//
// 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.
//

#define k_redirected_code_1 301
#define k_redirected_code_2 302
#define k_redirected_code_3 307

//
//  OCChunkInputStream.h
//  Owncloud iOs Client
//
// Copyright (C) 2015 ownCloud Inc. (http://www.owncloud.org/)
//
// 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.
//

#define k_redirected_code_1 301
#define k_redirected_code_2 302
#define k_redirected_code_3 307

Update the year of the Copyright

Update the year of the Copyright


#ifndef TEST_CUDA_ARRAY_MAPPER_H_

#define TEST_CUDA_ARRAY_MAPPER_H_

#include <vector>
#include <cuda_runtime.h>
#include "../src/utils/cuda_array_provider.h"

/**
 * \brief
 *
 *
 */

template <class ElementType> class CudaArrayMapper : public CudaArrayProvider
{
 public:
  CudaArrayMapper(int width, int height, std::vector<ElementType> data,
                  cudaChannelFormatDesc channelFormat)
    : width(width), height(height), data(data), channelFormat(channelFormat)
  {
  }

  virtual void map()
  {
    HANDLE_ERROR(cudaMallocArray(&array, &channelFormat, width, height,
                                 cudaArraySurfaceLoadStore));
    HANDLE_ERROR(cudaMemcpyToArray(array, 0, 0, data.data(),
                                   sizeof(ElementType) * data.size(),
                                   cudaMemcpyHostToDevice));
  }
  virtual void unmap()
  {
    cudaFree(array);
  }

  virtual cudaChannelFormatDesc getChannelDesc()
  {
    return channelFormat;
  }

  virtual cudaArray_t getArray()
  {
    return array;
  }

  std::vector<ElementType> copyDataFromGpu()
  {
    std::vector<ElementType> result(width * height);
    HANDLE_ERROR(cudaMemcpyFromArray(result.data(), array, 0, 0,
                                     sizeof(ElementType) * width * height,
                                     cudaMemcpyDeviceToHost));

    return result;
  }

 private:
  int width;
  int height;
  std::vector<ElementType> data;
  cudaArray_t array;
  cudaChannelFormatDesc channelFormat;
};

#endif  // TEST_CUDA_ARRAY_MAPPER_H_

Add implementation of CudaArrayProvider for tests named CudaArrayMapper.


//
//  NSManagedObject+JSONHelpers.h
//
//  Created by Saul Mora on 6/28/11.
//  Copyright 2011 Magical Panda Software LLC. All rights reserved.
//

#import <CoreData/CoreData.h>

extern NSString * const kMagicalRecordImportCustomDateFormatKey;
extern NSString * const kMagicalRecordImportDefaultDateFormatString;
extern NSString * const kMagicalRecordImportUnixTimeString;
extern NSString * const kMagicalRecordImportAttributeKeyMapKey;
extern NSString * const kMagicalRecordImportAttributeValueClassNameKey;

extern NSString * const kMagicalRecordImportRelationshipMapKey;
extern NSString * const kMagicalRecordImportRelationshipLinkedByKey;
extern NSString * const kMagicalRecordImportRelationshipTypeKey;

@interface NSManagedObject (MagicalRecord_DataImport)

+ (instancetype) MR_importFromObject:(id)data;
+ (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context;

+ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData;
+ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context;

@end

@interface NSManagedObject (MagicalRecord_DataImportControls)

- (BOOL) shouldImport:(id)data;
- (void) willImport:(id)data;
- (void) didImport:(id)data;

@end

//
//  NSManagedObject+JSONHelpers.h
//
//  Created by Saul Mora on 6/28/11.
//  Copyright 2011 Magical Panda Software LLC. All rights reserved.
//

#import <CoreData/CoreData.h>

extern NSString * const kMagicalRecordImportCustomDateFormatKey;
extern NSString * const kMagicalRecordImportDefaultDateFormatString;
extern NSString * const kMagicalRecordImportUnixTimeString;
extern NSString * const kMagicalRecordImportAttributeKeyMapKey;
extern NSString * const kMagicalRecordImportAttributeValueClassNameKey;

extern NSString * const kMagicalRecordImportRelationshipMapKey;
extern NSString * const kMagicalRecordImportRelationshipLinkedByKey;
extern NSString * const kMagicalRecordImportRelationshipTypeKey;

@protocol MagicalRecordDataImportProtocol <NSObject>

@optional
- (BOOL) shouldImport:(id)data;
- (void) willImport:(id)data;
- (void) didImport:(id)data;

@end

@interface NSManagedObject (MagicalRecord_DataImport) <MagicalRecordDataImportProtocol>

+ (instancetype) MR_importFromObject:(id)data;
+ (instancetype) MR_importFromObject:(id)data inContext:(NSManagedObjectContext *)context;

+ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData;
+ (NSArray *) MR_importFromArray:(NSArray *)listOfObjectData inContext:(NSManagedObjectContext *)context;

@end

Move the import controls into a formal protocol


/*
 * $Id$
 */

#include <errno.h>
#include <time.h>

/* from libvarnish/argv.c */
void FreeArgv(char **argv);
char **ParseArgv(const char *s, int comment);

/* from libvarnish/time.c */
void TIM_format(time_t t, char *p);
time_t TIM_parse(const char *p);

/* from libvarnish/version.c */
void varnish_version(const char *);

/* from libvarnish/assert.c */
#ifdef WITHOUT_ASSERTS
#define assert(e)	((void)0)
#else /* WITH_ASSERTS */
#define assert(e)							\
do { 									\
	if (!(e))							\
		lbv_assert(__func__, __FILE__, __LINE__, #e, errno);	\
} while (0)
#endif

void lbv_assert(const char *, const char *, int, const char *, int);

/* Assert zero return value */
#define AZ(foo)	do { assert((foo) == 0); } while (0)

/*
 * $Id$
 */

#include <errno.h>
#include <time.h>

#ifndef NULL
#define NULL ((void*)0)
#endif

/* from libvarnish/argv.c */
void FreeArgv(char **argv);
char **ParseArgv(const char *s, int comment);

/* from libvarnish/time.c */
void TIM_format(time_t t, char *p);
time_t TIM_parse(const char *p);

/* from libvarnish/version.c */
void varnish_version(const char *);

/* from libvarnish/assert.c */

/*
 * assert(), AN() and AZ() are static checks that should not happen.
 * xxxassert(), XXXAN() and XXXAZ() are markers for missing code.
 */

#ifdef WITHOUT_ASSERTS
#define assert(e)	((void)0)
#else /* WITH_ASSERTS */
#define assert(e)							\
do { 									\
	if (!(e))							\
		lbv_assert(__func__, __FILE__, __LINE__, #e, errno);	\
} while (0)
#endif

#define xxxassert(e)							\
do { 									\
	if (!(e))							\
		lbv_assert("XXX:" __func__, __FILE__, __LINE__, #e, errno); \
} while (0)

void lbv_assert(const char *, const char *, int, const char *, int);

/* Assert zero return value */
#define AZ(foo)	do { assert((foo) == 0); } while (0)
#define AN(foo)	do { assert((foo) != NULL); } while (0)
#define XXXAZ(foo)	do { xxxassert((foo) == 0); } while (0)
#define XXXAN(foo)	do { xxxassert((foo) != NULL); } while (0)

Split assert into "static check" and "missing code" variants.

The "missing code" variants have xxx prefix

Introduce AN() (assert non-null) variant as well.

git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@911 d4fa192b-c00b-0410-8231-f00ffab90ce4


/* Copyright 2017 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 TENSORFLOW_COMPILER_TF2XLA_TYPE_UTIL_H_
#define TENSORFLOW_COMPILER_TF2XLA_TYPE_UTIL_H_

#include "tensorflow/compiler/xla/xla_data.pb.h"
#include "tensorflow/core/framework/types.pb.h"
#include "tensorflow/core/lib/core/status.h"

namespace tensorflow {

// Converts a Tensorflow DataType to an XLA PrimitiveType.
Status DataTypeToPrimitiveType(DataType data_type, xla::PrimitiveType* type);

}  // namespace tensorflow

#endif  // TENSORFLOW_COMPILER_TF2XLA_TYPE_UTIL_H_

/* Copyright 2017 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 TENSORFLOW_COMPILER_TF2XLA_TYPE_UTIL_H_
#define TENSORFLOW_COMPILER_TF2XLA_TYPE_UTIL_H_

#include "tensorflow/compiler/xla/xla_data.pb.h"
#include "tensorflow/core/framework/types.pb.h"
#include "tensorflow/core/lib/core/status.h"

namespace tensorflow {

// Converts a Tensorflow DataType to an XLA PrimitiveType.
Status DataTypeToPrimitiveType(DataType data_type, xla::PrimitiveType* type);

// N.B.: there is intentionally no function to convert an XLA PrimitiveType to
// a TensorFlow DataType. The mapping from TF types to XLA types is not
// one-to-one: for example, both DT_INT8 and DT_QINT8 map to xla::S8. So the
// inverse would not be a well-defined function. If you find that you want the
// inverse mapping, then most likely you should be preserving the original
// TensorFlow type, rather than trying to convert an XLA type into a TensorFlow
// type.

}  // namespace tensorflow

#endif  // TENSORFLOW_COMPILER_TF2XLA_TYPE_UTIL_H_

[TF:XLA] Add comment explaining why there is no PrimitiveTypeToDataType function.

PiperOrigin-RevId: 214945748


Split assert into "static check" and "missing code" variants.

The "missing code" variants have xxx prefix

Introduce AN() (assert non-null) variant as well.

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


// Copyright 2012 Rui Ueyama <rui314@gmail.com>
// This program is free software licensed under the MIT license.

#include "test.h"

void testmain(void) {
    print("numeric constants");

    expect(1, 0x1);
    expect(17, 0x11);
    expect(511, 0777);
    expect(11, 0b1011);  // GNU extension

    expect(3, 3L);
    expect(3, 3LL);
    expect(3, 3UL);
    expect(3, 3LU);
    expect(3, 3ULL);
    expect(3, 3LU);
    expect(3, 3LLU);

    expectd(55.3, 55.3);
    expectd(200, 2e2);
    expectd(0x0.DE488631p8, 0xDE.488631);

    expect(4, sizeof(5));
    expect(8, sizeof(5L));
    expect(4, sizeof(3.0f));
    expect(8, sizeof(3.0));
}

// Copyright 2012 Rui Ueyama <rui314@gmail.com>
// This program is free software licensed under the MIT license.

#include "test.h"

void testmain(void) {
    print("numeric constants");

    expect(1, 0x1);
    expect(17, 0x11);
    expect(511, 0777);
    expect(11, 0b1011);  // GNU extension
    expect(11, 0B1011);  // GNU extension

    expect(3, 3L);
    expect(3, 3LL);
    expect(3, 3UL);
    expect(3, 3LU);
    expect(3, 3ULL);
    expect(3, 3LU);
    expect(3, 3LLU);

    expectd(55.3, 55.3);
    expectd(200, 2e2);
    expectd(0x0.DE488631p8, 0xDE.488631);

    expect(4, sizeof(5));
    expect(8, sizeof(5L));
    expect(4, sizeof(3.0f));
    expect(8, sizeof(3.0));
}

Add a test for '0B' prefix.

Add a test for '0B' prefix.


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

#include <security/pam_appl.h>
#include <security/pam_misc.h>

int main(int argc, char **argv)
{
	pam_handle_t *pamh = NULL;

	pam_sm_authenticate(pamh, 0, 1, "/home/aj/opensc/lib/opensc-pkcs11.so");

	exit(0);
}

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

#include <security/pam_appl.h>
#include <security/pam_misc.h>
#include <security/pam_modules.h>

int main(int argc, char **argv)
{
	pam_handle_t *pamh = NULL;

	pam_sm_authenticate(pamh, 0, 1, "/home/aj/opensc/lib/opensc-pkcs11.so");

	exit(0);
}

Add security/pam_modules.h to fix compiler warning


/* Copyright (C) 2003 Timo Sirainen */

#include "lib.h"
#include "ioloop-internal.h"

#ifdef IOLOOP_NOTIFY_NONE

struct io *io_loop_notify_add(struct ioloop *ioloop __attr_unused__,
			      const char *path __attr_unused__,
			      io_callback_t *callback __attr_unused__,
			      void *context __attr_unused__)
{
	return NULL;
}

void io_loop_notify_remove(struct ioloop *ioloop __attr_unused__,
			   struct io *io __attr_unused__)
{
}

void io_loop_notify_handler_init(struct ioloop *ioloop __attr_unused__)
{
}

void io_loop_notify_handler_deinit(struct ioloop *ioloop __attr_unused__)
{
}

#endif

/* Copyright (C) 2003 Timo Sirainen */

#include "lib.h"
#include "ioloop-internal.h"

#ifdef IOLOOP_NOTIFY_NONE

#undef io_add_notify
struct io *io_add_notify(const char *path __attr_unused__,
			 io_callback_t *callback __attr_unused__,
			 void *context __attr_unused__)
{
	return NULL;
}

void io_loop_notify_remove(struct ioloop *ioloop __attr_unused__,
			   struct io *io __attr_unused__)
{
}

void io_loop_notify_handler_deinit(struct ioloop *ioloop __attr_unused__)
{
}

#endif

Fix for building without notify

Fix for building without notify

--HG--
branch : HEAD


// Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

#ifndef ATOM_COMMON_NATIVE_MATE_CONVERTERS_COMMAND_LINE_CONVERTER_H_
#define ATOM_COMMON_NATIVE_MATE_CONVERTERS_COMMAND_LINE_CONVERTER_H_

#include <string>

#include "atom/common/native_mate_converters/string16_converter.h"
#include "base/command_line.h"

namespace mate {

template<>
struct Converter<base::CommandLine> {
  static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
                                    const base::CommandLine& val) {
    return Converter<base::CommandLine::StringType>::ToV8(isolate, val.GetCommandLineString());
  }
  static bool FromV8(v8::Isolate* isolate,
                     v8::Local<v8::Value> val,
                     base::CommandLine* out) {
    base::FilePath::StringType path;

    if (Converter<base::FilePath::StringType>::FromV8(isolate, val, &path)) {
      *out = base::CommandLine(base::FilePath(path));
      return true;
    } else {
      return false;
    }
  }
};

}  // namespace mate

#endif  // ATOM_COMMON_NATIVE_MATE_CONVERTERS_FILE_PATH_CONVERTER_H_

Add a native mate converter for command lines


/*
 *
 * Copyright 2015, Google 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:
 *
 *     * 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 Google Inc. nor the names of its
 * 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.
 *
 */

#include "src/core/transport/connectivity_state.h"

#include <string.h>

#include <grpc/support/log.h>

#include "test/core/util/test_config.h"

#define LOG_TEST(x) gpr_log(GPR_INFO, "%s", x)

static void test_connectivity_state_name(void) {
  GPR_ASSERT(0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_IDLE), "IDLE"));
  GPR_ASSERT(0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_CONNECTING), "CONNECTING"));
  GPR_ASSERT(0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_READY), "READY"));
  GPR_ASSERT(0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_TRANSIENT_FAILURE), "TRANSIENT_FAILURE"));
  GPR_ASSERT(0 == strcmp(grpc_connectivity_state_name(GRPC_CHANNEL_FATAL_FAILURE), "FATAL_FAILURE"));
}

int main(int argc, char **argv) {
  grpc_test_init(argc, argv);
  grpc_connectivity_state_trace = 1;
  test_connectivity_state_name();
  return 0;
}

Add the test code itself

Add the test code itself


//
//  Blueprint.h
//  SoomlaiOSProfile
//
//  Created by Gur Dotan on 6/9/14.
//  Copyright (c) 2014 Soomla. All rights reserved.
//

#define BP_DB_KEY_PREFIX @"soomla.blueprint"

//
//  Blueprint.h
//  SoomlaiOSProfile
//
//  Created by Gur Dotan on 6/9/14.
//  Copyright (c) 2014 Soomla. All rights reserved.
//

#define BP_DB_KEY_PREFIX @"soomla.levelup"

Change DB prefix string to comply with Android's


#define DIGEST_CMD            /* Image crypto digest commands */
#define DOWNLOAD_PROTO_HTTPS  /* Secure Hypertext Transfer Protocol */
#define IMAGE_COMBOOT         /* COMBOOT */
#define IMAGE_TRUST_CMD	      /* Image trust management commands */
#define NET_PROTO_IPV6        /* IPv6 protocol */
#define REBOOT_CMD            /* Reboot command */
#define VLAN_CMD              /* VLAN commands */
#define NSLOOKUP_CMD	      /* DNS resolving command */
#define NTP_CMD               /* NTP commands */

Add NSLOOKUP and NTP commands to netboot.xyz


#include <winsock.h>

/*
 * strcasecmp() is not in Windows, stricmp is, though
 */
#define strcasecmp(a,b) stricmp(a,b)
#define strncasecmp(a,b,c) _strnicmp(a,b,c)

#define ACCEPT_TYPE_ARG3 int

/*
 * Some compat functions
 */
#define open(a,b,c) _open(a,b,c)
#define close(a) _close(a)
#define read(a,b,c) _read(a,b,c)
#define write(a,b,c) _write(a,b,c)
#define popen(a,b) _popen(a,b)
#define pclose(a) _pclose(a)
#define vsnprintf(a,b,c,d) _vsnprintf(a,b,c,d)

/*
 * crypt not available (yet)
 */
#define crypt(a,b) a

/*
 * Parts of config.h that you get with autoconf on other systems
 */

#define DEF_PGPORT "5432"
#define MAXIMUM_ALIGNOF 4

#include <winsock.h>

/*
 * strcasecmp() is not in Windows, stricmp is, though
 */
#define strcasecmp(a,b) stricmp(a,b)
#define strncasecmp(a,b,c) _strnicmp(a,b,c)

/*
 * Some compat functions
 */
#define open(a,b,c) _open(a,b,c)
#define close(a) _close(a)
#define read(a,b,c) _read(a,b,c)
#define write(a,b,c) _write(a,b,c)
#define popen(a,b) _popen(a,b)
#define pclose(a) _pclose(a)
#define vsnprintf(a,b,c,d) _vsnprintf(a,b,c,d)

/*
 * crypt not available (yet)
 */
#define crypt(a,b) a

/*
 * Parts of config.h that you get with autoconf on other systems
 */
#define MAXIMUM_ALIGNOF 4
#define ACCEPT_TYPE_ARG3 int

Remove broken (and unnecessary) definition of DEF_PGPORT.


/**
 * @file
 * @brief Handle cache lookup just by iterating vfs tree
 * @author Denis Deryugin <deryugin.denis@gmail.com>
 * @version 0.1
 * @date 2015-06-09
 */

#include <fs/dvfs.h>

struct dentry *dvfs_cache_lookup(const char *path, struct dentry *base) {
	return NULL;
}

struct dentry *dvfs_cache_get(char *path) {
	return NULL;
}

int dvfs_cache_del(struct dentry *dentry) {
	return 0;
}

int dvfs_cache_add(struct dentry *dentry) {
	return 0;
}

Implement stubs for trirvial cache

vfs: Implement stubs for trirvial cache


/*============================================================================*/
/*
  Copyright (C) 2008 by Vinnie Falco, this file is part of VFLib.
  See the file GNU_GPL_v2.txt for full licensing terms.

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

  This program is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  details.

  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc., 51
  Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
/*============================================================================*/

#ifndef VF_SAMPLESOURCE_VFHEADER
#define VF_SAMPLESOURCE_VFHEADER

//==============================================================================
/**
  Abstract source of audio samples.

  This interface is used to retrieve sequentual raw audio samples from an
  abstract source. It is intended as a facade for @ref AudioSource, with these
  features:

  - No thread safety; the caller is responsible for all synchronization.

  - The preparation state feature is removed (along with its methods).

  @ingroup vf_audio
*/
class SampleSource
{
public:
  /**
    Read the next block of samples.
  */
  virtual void getNextAudioBlock (AudioSourceChannelInfo const& bufferToFill) = 0;
};

#endif

/*============================================================================*/
/*
  Copyright (C) 2008 by Vinnie Falco, this file is part of VFLib.
  See the file GNU_GPL_v2.txt for full licensing terms.

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

  This program is distributed in the hope that it will be useful, but WITHOUT
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  details.

  You should have received a copy of the GNU General Public License along with
  this program; if not, write to the Free Software Foundation, Inc., 51
  Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
/*============================================================================*/

#ifndef VF_SAMPLESOURCE_VFHEADER
#define VF_SAMPLESOURCE_VFHEADER

//==============================================================================
/**
  Abstract source of audio samples.

  This interface is used to retrieve sequentual raw audio samples from an
  abstract source. It is intended as a facade for @ref AudioSource, with these
  features:

  - No thread safety; the caller is responsible for all synchronization.

  - The preparation state feature is removed (along with its methods).

  @ingroup vf_audio
*/
class SampleSource
{
public:
  virtual ~SampleSource () { }

  /**
    Read the next block of samples.
  */
  virtual void getNextAudioBlock (AudioSourceChannelInfo const& bufferToFill) = 0;
};

#endif

Make dtor virtual in SampleSource

Make dtor virtual in SampleSource


// 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 WebBlobInfo_h
#define WebBlobInfo_h

#include "WebCommon.h"
#include "WebString.h"

namespace blink {

class WebBlobInfo {
public:
    WebBlobInfo()
        : m_isFile(false)
        , m_size(-1)
        , m_lastModified(0)
    {
    }
    WebBlobInfo(const WebString& uuid, const WebString& type, long long size)
        : m_isFile(false)
        , m_uuid(uuid)
        , m_type(type)
        , m_size(size)
        , m_lastModified(0)
    {
    }
    WebBlobInfo(const WebString& uuid, const WebString& filePath, const WebString& fileName, const WebString& type)
        : m_isFile(true)
        , m_uuid(uuid)
        , m_type(type)
        , m_size(-1)
        , m_filePath(filePath)
        , m_fileName(fileName)
        , m_lastModified(0)
    {
    }
    WebBlobInfo(const WebString& uuid, const WebString& filePath, const WebString& fileName, const WebString& type, double lastModified, long long size)
        : m_isFile(true)
        , m_uuid(uuid)
        , m_type(type)
        , m_size(size)
        , m_filePath(filePath)
        , m_fileName(fileName)
        , m_lastModified(lastModified)
    {
    }
    bool isFile() const
    {
        return m_isFile;
    }
    const WebString& uuid() const
    {
        return m_uuid;
    }
    const WebString& type() const
    {
        return m_type;
    }
    long long size() const
    {
        return m_size;
    }
    const WebString& filePath() const
    {
        return m_filePath;
    }
    const WebString& fileName() const
    {
        return m_fileName;
    }
    double lastModified() const
    {
        return m_lastModified;
    }

private:
    bool m_isFile;
    WebString m_uuid;
    WebString m_type; // MIME type
    long long m_size;
    WebString m_filePath; // Only for File
    WebString m_fileName; // Only for File
    double m_lastModified; // Only for File
};

} // namespace blink

#endif

Add two classes [as yet unused] needed for upcoming IDB Blob support.

BUG=108012
R=cmumford,jsbell,abarth

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

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


/*
 * $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(Error)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(BackendOpen)
SLTM(BackendXID)
SLTM(BackendReuse)
SLTM(BackendClose)
SLTM(HttpError)
SLTM(ClientAddr)
SLTM(Backend)
SLTM(Request)
SLTM(Response)
SLTM(Length)
SLTM(Status)
SLTM(URL)
SLTM(Protocol)
SLTM(Header)
SLTM(BldHdr)
SLTM(LostHeader)
SLTM(VCL_call)
SLTM(VCL_trace)
SLTM(VCL_return)
SLTM(XID)
SLTM(ExpBan)
SLTM(ExpPick)
SLTM(ExpKill)

/*
 * $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(Error)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(BackendOpen)
SLTM(BackendXID)
SLTM(BackendReuse)
SLTM(BackendClose)
SLTM(HttpError)
SLTM(ClientAddr)
SLTM(Backend)
SLTM(Request)
SLTM(Response)
SLTM(Length)
SLTM(Status)
SLTM(URL)
SLTM(Protocol)
SLTM(Header)
SLTM(BldHdr)
SLTM(LostHeader)
SLTM(VCL_call)
SLTM(VCL_trace)
SLTM(VCL_return)
SLTM(XID)
SLTM(Hit)
SLTM(ExpBan)
SLTM(ExpPick)
SLTM(ExpKill)

Add shmem tag for Hits

Add shmem tag for Hits

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


#ifndef __SETTINGS_H_
#define __SETTINGS_H_
#include <Arduino.h>
#include "Device.h"

// This section is for devices and their configuration
//Kit:
#define HAS_STD_LIGHTS (1)
#define LIGHTS_PIN 5
#define HAS_STD_CAPE (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_PILOT (1)
#define HAS_STD_CAMERAMOUNT (1)
#define CAMERAMOUNT_PIN 3
#define CAPE_VOLTAGE_PIN 0
#define CAPE_CURRENT_PIN 3

//After Market:
#define HAS_STD_CALIBRATIONLASERS (0)
#define CALIBRATIONLASERS_PIN 6
#define HAS_POLOLU_MINIMUV (1)
#define HAS_MS5803_14BA (0)
#define MS5803_14BA_I2C_ADDRESS 0x76

#define MIDPOINT 1500
#define LOGGING (1)

class Settings : public Device {
  public:
    static int smoothingIncriment; //How aggressive the throttle changes
    static int deadZone_min;
    static int deadZone_max;
    static int capability_bitarray;

    Settings():Device(){};
    void device_setup();
    void device_loop(Command cmd);
};

#endif

#ifndef __SETTINGS_H_
#define __SETTINGS_H_
#include <Arduino.h>
#include "Device.h"

// This section is for devices and their configuration
//Kit:
#define HAS_STD_LIGHTS (1)
#define LIGHTS_PIN 5
#define HAS_STD_CAPE (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_PILOT (1)
#define HAS_STD_CAMERAMOUNT (1)
#define CAMERAMOUNT_PIN 3
#define CAPE_VOLTAGE_PIN 0
#define CAPE_CURRENT_PIN 3

//After Market:
#define HAS_STD_CALIBRATIONLASERS (0)
#define CALIBRATIONLASERS_PIN 6
#define HAS_POLOLU_MINIMUV (0)
#define HAS_MS5803_14BA (0)
#define MS5803_14BA_I2C_ADDRESS 0x76

#define MIDPOINT 1500
#define LOGGING (1)

class Settings : public Device {
  public:
    static int smoothingIncriment; //How aggressive the throttle changes
    static int deadZone_min;
    static int deadZone_max;
    static int capability_bitarray;

    Settings():Device(){};
    void device_setup();
    void device_loop(Command cmd);
};

#endif

Reset default settings to stock kit configuration