#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

/*
 * Tell <ctype.h> to generate extern versions of all its inline
 * functions.  The extern versions get called if the system doesn't
 * support inlines or the user defines _DONT_USE_CTYPE_INLINE_
 * before including <ctype.h>.
 */
#define _EXTERNALIZE_CTYPE_INLINES_

#include <ctype.h>

#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");

/*
 * Tell <ctype.h> to generate extern versions of all its inline
 * functions.  The extern versions get called if the system doesn't
 * support inlines or the user defines _DONT_USE_CTYPE_INLINE_
 * before including <ctype.h>.
 */
#define _EXTERNALIZE_CTYPE_INLINES_

/*
 * Also make sure <runetype.h> does not generate an inline definition
 * of __getCurrentRuneLocale().
 */
#define __RUNETYPE_INTERNAL

#include <ctype.h>

Fix build of libc.so after r232620.  This caused a duplicate definition
of __getCurrentRuneLocale().

Pointy hat to:	me


/*
 * GeeXboX Valhalla: tiny media scanner API.
 * Copyright (C) 2016 Mathieu Schroeter <mathieu@schroetersa.ch>
 *
 * This file is part of libvalhalla.
 *
 * libvalhalla 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.
 *
 * libvalhalla 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 libvalhalla; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#ifndef VALHALLA_JSON_UTILS_H
#define VALHALLA_JSON_UTILS_H

#include <json-c/json_tokener.h>

char *vh_json_get_str (json_object *json, const char *path);
int vh_json_get_int (json_object *json, const char *path);

#endif /* VALHALLA_JSON_UTILS_H */

/*
 * GeeXboX Valhalla: tiny media scanner API.
 * Copyright (C) 2016 Mathieu Schroeter <mathieu@schroetersa.ch>
 *
 * This file is part of libvalhalla.
 *
 * libvalhalla 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.
 *
 * libvalhalla 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 libvalhalla; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

#ifndef VALHALLA_JSON_UTILS_H
#define VALHALLA_JSON_UTILS_H

#include <json-c/json_tokener.h>

json_object *vh_json_get (json_object *json, const char *path);
char *vh_json_get_str (json_object *json, const char *path);
int vh_json_get_int (json_object *json, const char *path);

#endif /* VALHALLA_JSON_UTILS_H */

Add vh_json_get in the API

Add vh_json_get in the API


//
//  AIResponseData.h
//  AdjustIo
//
//  Created by Christian Wellenbrock on 07.02.14.
//  Copyright (c) 2014 adeven. All rights reserved.
//

typedef enum {
    AIActivityKindUnknown = 0,
    AIActivityKindSession = 1,
    AIActivityKindEvent   = 2,
    AIActivityKindRevenue = 3,

    // only possible when server could be reached because the SDK can't know
    // whether or not a session might be an install or reattribution
    AIActivityKindInstall       = 4,
    AIActivityKindReattribution = 5,
} AIActivityKind;

@interface AIResponseData : NSObject

@property (nonatomic, assign) AIActivityKind activityKind;

@property (nonatomic, copy) NSString *trackerToken;
@property (nonatomic, copy) NSString *trackerName;
@property (nonatomic, copy) NSString *error;

+ (AIResponseData *)dataWithJsonString:(NSString *)string;

- (id)initWithJsonString:(NSString *)string;

@end

//
//  AIResponseData.h
//  AdjustIo
//
//  Created by Christian Wellenbrock on 07.02.14.
//  Copyright (c) 2014 adeven. All rights reserved.
//

typedef enum {
    AIActivityKindUnknown = 0,
    AIActivityKindSession = 1,
    AIActivityKindEvent   = 2,
    AIActivityKindRevenue = 3,

    // only possible when server could be reached because the SDK can't know
    // whether or not a session might be an install or reattribution
    AIActivityKindInstall       = 4,
    AIActivityKindReattribution = 5,
} AIActivityKind;

@class AIActivityPackage;

/*
 * Information about the result of a tracking attempt
 *
 * Will be passed to the delegate function adjustIoTrackedActivityWithResponse
 */
@interface AIResponseData : NSObject

// the kind of activity (install, session, event, etc.)
// see the AIActivity definition above
@property (nonatomic, assign) AIActivityKind activityKind;

// true when the activity was tracked successfully
// might be true even if response could not be parsed
@property (nonatomic, assign) BOOL success;

// true if the server was not reachable and the request will be tried again later
@property (nonatomic, assign) BOOL willRetry;

// nil if activity was tracked successfully and response could be parsed
// might be not nil even when activity was tracked successfully
@property (nonatomic, copy) NSString *error;

// the following attributes are only set when error is nil
// (when activity was tracked successfully and response could be parsed)

// tracker token of current device
@property (nonatomic, copy) NSString *trackerToken;

// tracker name of current device
@property (nonatomic, copy) NSString *trackerName;

+ (AIResponseData *)dataWithJsonString:(NSString *)string;
+ (AIResponseData *)dataWithError:(NSString *)error;

- (id)initWithJsonString:(NSString *)string;
- (id)initWithError:(NSString *)error;

@end

Add flags success and willRetry to ResponseData


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

// RUN: grep '@r = common global \[1 x .*\] zeroinitializer' %t &&

int r[];
int (*a)[] = &r;

struct s0;
struct s0 x;
// RUN: grep '@x = common global .struct.s0 zeroinitializer' %t &&

struct s0 y;
// RUN: grep '@y = common global .struct.s0 zeroinitializer' %t &&
struct s0 *f0() {
  return &y;
}

struct s0 {
  int x;
};

// RUN: grep '@b = common global \[1 x .*\] zeroinitializer' %t &&
int b[];
int *f1() {
  return b;
}

// Check that the most recent tentative definition wins.
// RUN: grep '@c = common global \[4 x .*\] zeroinitializer' %t &&
int c[];
int c[4];

// RUN: true

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

// RUN: grep '@r = common global \[1 x .*\] zeroinitializer' %t &&

int r[];
int (*a)[] = &r;

struct s0;
struct s0 x;
// RUN: grep '@x = common global .struct.s0 zeroinitializer' %t &&

struct s0 y;
// RUN: grep '@y = common global .struct.s0 zeroinitializer' %t &&
struct s0 *f0() {
  return &y;
}

struct s0 {
  int x;
};

// RUN: grep '@b = common global \[1 x .*\] zeroinitializer' %t &&
int b[];
int *f1() {
  return b;
}

// Check that the most recent tentative definition wins.
// RUN: grep '@c = common global \[4 x .*\] zeroinitializer' %t &&
int c[];
int c[4];

// Check that we emit static tentative definitions
// RUN: grep '@c5 = internal global \[1 x .*\] zeroinitializer' %t &&
static int c5[];
static int func() { return c5[0]; }
int callfunc() { return func(); }

// RUN: true

Add testcase that illustrates the problem from r69699 regarding tentative definitions of statics

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


/*
    resource.h

    KNode, the KDE newsreader
    Copyright (c) 1999-2005 the KNode authors.
    See file AUTHORS for details

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

#ifndef RESSOURCE_H
#define RESSOURCE_H

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

//========= KNode Version Information ============

#define KNODE_VERSION "0.9.91"

//================= StatusBar ====================

#define SB_MAIN     4000005
#define SB_GROUP      4000010
#define SB_FILTER   4000030

//================== Folders =====================

#define FOLD_DRAFTS 200010
#define FOLD_SENT   200020
#define FOLD_OUTB   200030

#endif // RESOURCE_H

/*
    resource.h

    KNode, the KDE newsreader
    Copyright (c) 1999-2005 the KNode authors.
    See file AUTHORS for details

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

#ifndef RESSOURCE_H
#define RESSOURCE_H

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

//========= KNode Version Information ============

#define KNODE_VERSION "0.9.92"

//================= StatusBar ====================

#define SB_MAIN     4000005
#define SB_GROUP      4000010
#define SB_FILTER   4000030

//================== Folders =====================

#define FOLD_DRAFTS 200010
#define FOLD_SENT   200020
#define FOLD_OUTB   200030

#endif // RESOURCE_H

Increment version number for 3.5 beta2.

Increment version number for 3.5 beta2.

svn path=/branches/KDE/3.5/kdepim/; revision=466310


#include <stdio.h>

typedef struct {
  char last_name[20];
  char first_name[15];
  int  age;
} Person;

int ask() {
  printf("1. Add user\n");
  printf("2. Quit\n");
  return getchar() - 48;
}

Person createPerson() {
  Person p;

  printf("Last name: ");
  scanf("%s", p.last_name);

  printf("First name: ");
  scanf("%s", p.first_name);

  printf("Age: ");
  scanf("%d", &p.age);

  return p;
}

int main() {
  FILE *f;

  if ((f = fopen("users.txt", "a")) != NULL) {

    int choice;
    while ((choice = ask()) != 2) {
      if (choice == 1) {
	Person p = createPerson();
	fprintf(f, "%s_%s_%d\n", p.last_name, p.first_name, p.age);
      }
    }

    fclose(f);
  } else {
    printf("Error while opening users.txt\n");
  }

  return 0;
}

Add SIT151 C PC3 Ex1

Add SIT151 C PC3 Ex1


// For License please refer to LICENSE file in the root of FastEasyMapping project
#import <Foundation/Foundation.h>

typedef __nullable id (^FEMMapBlock)(id value __nonnull);

// For License please refer to LICENSE file in the root of FastEasyMapping project
#import <Foundation/Foundation.h>

typedef __nullable id (^FEMMapBlock)(__nonnull id value);

Add nullability specifiers to FEMMapBlock


////////////////////////////////////////////////////////////////////////////
//
// TIGHTDB CONFIDENTIAL
// __________________
//
//  [2011] - [2014] TightDB Inc
//  All Rights Reserved.
//
// NOTICE:  All information contained herein is, and remains
// the property of TightDB Incorporated and its suppliers,
// if any.  The intellectual and technical concepts contained
// herein are proprietary to TightDB Incorporated
// and its suppliers and may be covered by U.S. and Foreign Patents,
// patents in process, and are protected by trade secret or copyright law.
// Dissemination of this information or reproduction of this material
// is strictly forbidden unless prior written permission is obtained
// from TightDB Incorporated.
//
////////////////////////////////////////////////////////////////////////////

#import "RLMObject.h"
#import "RLMAccessor.h"
#import "RLMObjectSchema.h"

// RLMObject accessor and read/write realm
@interface RLMObject () <RLMAccessor>

@property (nonatomic, readwrite) RLMRealm *realm;
@property (nonatomic) RLMObjectSchema *schema;

@end

////////////////////////////////////////////////////////////////////////////
//
// TIGHTDB CONFIDENTIAL
// __________________
//
//  [2011] - [2014] TightDB Inc
//  All Rights Reserved.
//
// NOTICE:  All information contained herein is, and remains
// the property of TightDB Incorporated and its suppliers,
// if any.  The intellectual and technical concepts contained
// herein are proprietary to TightDB Incorporated
// and its suppliers and may be covered by U.S. and Foreign Patents,
// patents in process, and are protected by trade secret or copyright law.
// Dissemination of this information or reproduction of this material
// is strictly forbidden unless prior written permission is obtained
// from TightDB Incorporated.
//
////////////////////////////////////////////////////////////////////////////

#import "RLMObject.h"
#import "RLMAccessor.h"
#import "RLMObjectSchema.h"

// RLMObject accessor and read/write realm
@interface RLMObject () <RLMAccessor>
-(instancetype)initWithDefaultValues:(BOOL)useDefaults;

@property (nonatomic, readwrite) RLMRealm *realm;
@property (nonatomic) RLMObjectSchema *schema;

@end

Declare initWithDefaultValues in private category


#ifndef SUPPORT_H
#define SUPPORT_H

#include <stdio.h>

struct tagTModule;

typedef struct tagTExtensionModule {
        char *module;
        void *handle;
} TExtensionModule;

typedef struct tagTExtensions {
    TExtensionModule *modules;
    size_t size;
} TExtenstions;

void path_initPaths(const char *source_path);
void path_freePaths();
void path_readModule(struct tagTModule *m);
void path_dumpPaths();

FILE *path_findModule(const char *name, char *modulePath);

char *path_getFileNameOnly(char *path);
char *path_getPathOnly(char *path);

TExtensionModule *ext_findModule(const char *moduleName);
void ext_insertModule(const char *name, void *handle);
void ext_cleanup(void);

#endif

Fix incorrect indentation in TExtensionModule struct


#include "pycall_internal.h"

#if defined(PYCALL_THREAD_WIN32)
int pycall_tls_create(pycall_tls_key *tls_key)
{
  *tls_key = TlsAlloc();
  return *tls_key == TLS_OUT_OF_INDEXES;
}

void *pycall_tls_get(pycall_tls_key tls_key)
{
  return TlsGetValue(tls_key);
}

int pycall_tls_set(pycall_tls_key tls_key, void *ptr)
{
  return TlsSetValue(tls_key, th) == 0;
}
#endif

#if defined(PYCALL_THREAD_PTHREAD)
int pycall_tls_create(pycall_tls_key *tls_key)
{
  return pthread_key_create(tls_key, NULL);
}

void *pycall_tls_get(pycall_tls_key tls_key)
{
  return pthread_getspecific(tls_key);
}

int pycall_tls_set(pycall_tls_key tls_key, void *ptr)
{
  return pthread_setspecific(tls_key, ptr);
}
#endif

#include "pycall_internal.h"

#if defined(PYCALL_THREAD_WIN32)
int pycall_tls_create(pycall_tls_key *tls_key)
{
  *tls_key = TlsAlloc();
  return *tls_key == TLS_OUT_OF_INDEXES;
}

void *pycall_tls_get(pycall_tls_key tls_key)
{
  return TlsGetValue(tls_key);
}

int pycall_tls_set(pycall_tls_key tls_key, void *ptr)
{
  return 0 == TlsSetValue(tls_key, ptr);
}
#endif

#if defined(PYCALL_THREAD_PTHREAD)
int pycall_tls_create(pycall_tls_key *tls_key)
{
  return pthread_key_create(tls_key, NULL);
}

void *pycall_tls_get(pycall_tls_key tls_key)
{
  return pthread_getspecific(tls_key);
}

int pycall_tls_set(pycall_tls_key tls_key, void *ptr)
{
  return pthread_setspecific(tls_key, ptr);
}
#endif

Fix compile error on Windows

Fix compile error on Windows


#include "lib/timing.h"

task main()
{
	writeDebugStreamLine("Waiting 1 second");
	resetTimeDelta();
	getTimeDelta();
	wait1Msec(1000);
	writeDebugStreamLine("delta: %d", getTimeDelta());

	writeDebugStreamLine("Waiting 5 seconds");
	resetTimeDelta();
	getTimeDelta();
	wait1Msec(5000);
	writeDebugStreamLine("delta: %d", getTimeDelta());

	writeDebugStreamLine("Waiting 10 seconds");
	resetTimeDelta();
	getTimeDelta();
	wait1Msec(10000);
	writeDebugStreamLine("delta: %d", getTimeDelta());
}

#include "lib/timing.h"

task main()
{
	// getTimeDelta()
	writeDebugStreamLine("Testing getTimeDelta()");
	writeDebugStreamLine("Waiting 1 second");
	resetTimeDelta();
	getTimeDelta();
	wait1Msec(1000);
	writeDebugStreamLine("delta: %d", getTimeDelta());

	writeDebugStreamLine("Waiting 5 seconds");
	resetTimeDelta();
	getTimeDelta();
	wait1Msec(5000);
	writeDebugStreamLine("delta: %d", getTimeDelta());

	writeDebugStreamLine("Waiting 10 seconds");
	resetTimeDelta();
	getTimeDelta();
	wait1Msec(10000);
	writeDebugStreamLine("delta: %d", getTimeDelta());

	writeDebugStreamLine("Testing getTimeDeltaTimer() (using default timer)");
	writeDebugStreamLine("Waiting 1 second");
	resetTimeDeltaTimer();
	getTimeDeltaTimer();
	wait1Msec(1000);
	writeDebugStreamLine("delta: %d", getTimeDeltaTimer());

	writeDebugStreamLine("Waiting 5 seconds");
	resetTimeDeltaTimer();
	getTimeDeltaTimer();
	wait1Msec(5000);
	writeDebugStreamLine("delta: %d", getTimeDeltaTimer());

	writeDebugStreamLine("Waiting 10 seconds");
	resetTimeDeltaTimer();
	getTimeDeltaTimer();
	wait1Msec(10000);
	writeDebugStreamLine("delta: %d", getTimeDeltaTimer());
}

Add tests for alternative timing method

Add tests for alternative timing method


#import <Foundation/Foundation.h>

#import <React/RCTBridgeModule.h>

#if __has_include(<React/RCTBridge.h>)
// React Native >= 0.40
#import <React/RCTBridge.h>
#else
// React Native <= 0.39
#import "RCTBridge.h"
#endif

@class BugsnagConfiguration;

@interface BugsnagReactNative: NSObject <RCTBridgeModule>

/**
 * Initializes the crash handler with the default options and using the API key
 * stored in the Info.plist using the key "BugsnagAPIKey"
 */
+ (void)start;
/**
 * Initializes the crash handler with the default options
 * @param APIKey the API key to use when sending error reports
 */
+ (void)startWithAPIKey:(NSString *)APIKey;
/**
 * Initializes the crash handler with custom options
 * @param config the configuration options to use
 */
+ (void)startWithConfiguration:(BugsnagConfiguration *)config;

- (void)startWithOptions:(NSDictionary *)options;
- (void)leaveBreadcrumb:(NSDictionary *)options;
- (void)notify:(NSDictionary *)payload;
- (void)setUser:(NSDictionary *)userInfo;
- (void)clearUser;
- (void)startSession;

@end

#import <Foundation/Foundation.h>

#import <React/RCTBridgeModule.h>

#if __has_include(<React/RCTBridge.h>)
// React Native >= 0.40
#import <React/RCTBridge.h>
#else
// React Native <= 0.39
#import "RCTBridge.h"
#endif

@class BugsnagConfiguration;

@interface BugsnagReactNative: NSObject <RCTBridgeModule>

/**
 * Initializes the crash handler with the default options and using the API key
 * stored in the Info.plist using the key "BugsnagAPIKey"
 */
+ (void)start;
/**
 * Initializes the crash handler with the default options
 * @param APIKey the API key to use when sending error reports
 */
+ (void)startWithAPIKey:(NSString *)APIKey;
/**
 * Initializes the crash handler with custom options
 * @param config the configuration options to use
 */
+ (void)startWithConfiguration:(BugsnagConfiguration *)config;

- (void)startWithOptions:(NSDictionary *)options;
- (void)leaveBreadcrumb:(NSDictionary *)options;
- (void)notify:(NSDictionary *)payload
       resolve:(RCTPromiseResolveBlock)resolve
        reject:(RCTPromiseRejectBlock)reject;
- (void)setUser:(NSDictionary *)userInfo;
- (void)clearUser;
- (void)startSession;

@end

Synchronize decl and impl of notify(…)

fix: Synchronize decl and impl of notify(…)


#ifdef __CLING__

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

// Only for the autoload, autoparse. No IO of these classes is foreseen!
#pragma link C++ class ROOT::Internal::TPoolManager-;
#pragma link C++ class ROOT::TThreadExecutor-;
#pragma link C++ class ROOT::Experimental::TTaskGroup-;

#endif

#ifdef __CLING__

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

// Only for the autoload, autoparse. No IO of these classes is foreseen!
// Exclude in case ROOT does not have IMT support
#ifdef R__USE_IMT
#pragma link C++ class ROOT::Internal::TPoolManager-;
#pragma link C++ class ROOT::TThreadExecutor-;
#pragma link C++ class ROOT::Experimental::TTaskGroup-;
#endif

#endif

[IMT] Fix warning during dictionary generation in no-imt builds


// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Copyright (c) 2014-2017 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_VALIDATION_H
#define BITCOIN_VALIDATION_H

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

static const int64_t DEFAULT_MAX_TIP_AGE = 6 * 60 * 60; // ~144 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin

extern int64_t nMaxTipAge;

FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb");
FILE* AppendBlockFile(unsigned int& nFileRet);

bool IsInitialBlockDownload();

#endif // BITCOIN_VALIDATION_H

// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2015 The Bitcoin Core developers
// Copyright (c) 2014-2017 The Dash Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_VALIDATION_H
#define BITCOIN_VALIDATION_H

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

static const int64_t DEFAULT_MAX_TIP_AGE = 1 * 60 * 60; // ~45 blocks behind -> 2 x fork detection time, was 24 * 60 * 60 in bitcoin

extern int64_t nMaxTipAge;

FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb");
FILE* AppendBlockFile(unsigned int& nFileRet);

bool IsInitialBlockDownload();

#endif // BITCOIN_VALIDATION_H

Adjust default max tip age

Adjust default max tip age


// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "isequencedtaskexecutor.h"
#include <vector>

namespace vespalib {
    struct ExecutorStats;
    class SyncableThreadExecutor;
}

namespace search {

/**
 * Class to run multiple tasks in parallel, but tasks with same
 * id has to be run in sequence.
 */
class SequencedTaskExecutor final : public ISequencedTaskExecutor
{
    using Stats = vespalib::ExecutorStats;
    std::unique_ptr<std::vector<std::unique_ptr<vespalib::SyncableThreadExecutor>>> _executors;

    SequencedTaskExecutor(std::unique_ptr<std::vector<std::unique_ptr<vespalib::SyncableThreadExecutor>>> executor);
public:
    enum class Optimize {LATENCY, THROUGHPUT};
    using ISequencedTaskExecutor::getExecutorId;

    ~SequencedTaskExecutor();

    void setTaskLimit(uint32_t taskLimit) override;
    void executeTask(ExecutorId id, vespalib::Executor::Task::UP task) override;
    void sync() override;
    Stats getStats() override;
    static std::unique_ptr<ISequencedTaskExecutor> create(uint32_t threads, uint32_t taskLimit = 1000, Optimize optimize = Optimize::THROUGHPUT);
};

} // namespace search

// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "isequencedtaskexecutor.h"
#include <vector>

namespace vespalib {
    struct ExecutorStats;
    class SyncableThreadExecutor;
}

namespace search {

/**
 * Class to run multiple tasks in parallel, but tasks with same
 * id has to be run in sequence.
 */
class SequencedTaskExecutor final : public ISequencedTaskExecutor
{
    using Stats = vespalib::ExecutorStats;
    std::unique_ptr<std::vector<std::unique_ptr<vespalib::SyncableThreadExecutor>>> _executors;

    SequencedTaskExecutor(std::unique_ptr<std::vector<std::unique_ptr<vespalib::SyncableThreadExecutor>>> executor);
public:
    enum class Optimize {LATENCY, THROUGHPUT};
    using ISequencedTaskExecutor::getExecutorId;

    ~SequencedTaskExecutor();

    void setTaskLimit(uint32_t taskLimit) override;
    void executeTask(ExecutorId id, vespalib::Executor::Task::UP task) override;
    void sync() override;
    Stats getStats() override;

    /*
     * Note that if you choose Optimize::THROUGHPUT, you must ensure only a single producer, or synchronize on the outside.
     */
    static std::unique_ptr<ISequencedTaskExecutor>
    create(uint32_t threads, uint32_t taskLimit = 1000, Optimize optimize = Optimize::LATENCY);
};

} // namespace search

Add comment about thread safety.

Add comment about thread safety.


/* See LICENSE file for copyright and license details. */
#include <errno.h>
#include <stdio.h>
#include <string.h>

#include "../util.h"

const char *
run_command(const char *cmd)
{
	char *p;
	FILE *fp;

	if (!(fp = popen(cmd, "r"))) {
		warn("popen '%s':", cmd);
		return NULL;
	}
	p = fgets(buf, sizeof(buf) - 1, fp);
	pclose(fp);
	if (!p) {
		return NULL;
	}
	if ((p = strrchr(buf, '\n'))) {
		p[0] = '\0';
	}

	return buf[0] ? buf : NULL;
}

/* See LICENSE file for copyright and license details. */
#include <errno.h>
#include <stdio.h>
#include <string.h>

#include "../util.h"

const char *
run_command(const char *cmd)
{
	char *p;
	FILE *fp;

	if (!(fp = popen(cmd, "r"))) {
		warn("popen '%s':", cmd);
		return NULL;
	}
	p = fgets(buf, sizeof(buf) - 1, fp);
	if (pclose(fp) < 0) {
		warn("pclose '%s':", cmd);
		return NULL;
	}
	if (!p) {
		return NULL;
	}
	if ((p = strrchr(buf, '\n'))) {
		p[0] = '\0';
	}

	return buf[0] ? buf : NULL;
}

Check return value of pclose()

Check return value of pclose()


/*
 * This file is part of Kotaka, a mud library for DGD
 * http://github.com/shentino/kotaka
 *
 * Copyright (C) 2018  Raymond Jennings
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include <kotaka/paths/system.h>
#include <kotaka/privilege.h>

inherit LIB_INITD;
inherit UTILITY_COMPILE;

private void load()
{
	load_dir("sys");
}

private void set_limits()
{
	reset_limits();
}

static void create()
{
	load();

	set_limits();
}

void upgrade()
{
	ACCESS_CHECK(previous_program() == OBJECTD);

	set_limits();
}

/*
 * This file is part of Kotaka, a mud library for DGD
 * http://github.com/shentino/kotaka
 *
 * Copyright (C) 2018  Raymond Jennings
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#include <kotaka/paths/system.h>
#include <kotaka/privilege.h>

inherit LIB_INITD;
inherit UTILITY_COMPILE;

private void load()
{
	load_dir("sys");
}

private void set_limits()
{
	reset_limits();
}

static void create()
{
	set_limits();

	load();
}

void upgrade()
{
	ACCESS_CHECK(previous_program() == OBJECTD);

	set_limits();
}

Set resource limits before loading

Set resource limits before loading


// PARAM: --enable annotation.int.enabled
#include <stdlib.h>
#include <goblint.h>
struct slotvec {
   size_t size ;
   char *val ;
};
static char slot0[256] ;
static struct slotvec slotvec0 = {sizeof(slot0), slot0};

static void install_signal_handlers(void)
{
  { if(!(slotvec0.val == & slot0[0LL])) {  reach_error(); abort(); } };
}

int main(int argc , char **argv )
{
  // Goblint used to consider both branches in this condition to be dead, because the meet on addresses with different active int domains was broken
  { if(!(slotvec0.val == & slot0[0LL])) { reach_error(); abort(); } };
  install_signal_handlers();

  // Should be reachable
  __goblint_check(1);
  return 0;
}

// PARAM: --enable annotation.int.enabled
// This option enables ALL int domains for globals
#include <stdlib.h>
#include <goblint.h>
struct slotvec {
   size_t size ;
   char *val ;
};
static char slot0[256] ;
static struct slotvec slotvec0 = {sizeof(slot0), slot0};

static void install_signal_handlers(void)
{
  { if(!(slotvec0.val == & slot0[0LL])) {  reach_error(); abort(); } };
}

int main(int argc , char **argv )
{
  // Goblint used to consider both branches in this condition to be dead, because the meet on addresses with different active int domains was broken
  { if(!(slotvec0.val == & slot0[0LL])) { reach_error(); abort(); } };
  install_signal_handlers();

  // Should be reachable
  __goblint_check(1);
  return 0;
}

Add comment explaining impact of option in test case

Co-authored-by: Michael Schwarz <002afe8b64400fa3cb5439d4dd87a0dc9a516d5f@gmail.com>


#include <pal.h>

/**
 *
 * Calculates the natural logarithm of 'a', (where the base is 'e'=2.71828)
 *
 * @param a     Pointer to input vector
 *
 * @param c     Pointer to output vector
 *
 * @param n     Size of 'a' and 'c' vector.
 *
 * @param p     Number of processor to use (task parallelism)
 *
 * @param team  Team to work with
 *
 * @return      None
 *
 */
#include <math.h>
void p_ln_f32(const float *a, float *c, int n, int p, p_team_t team)
{

    int i;
    for (i = 0; i < n; i++) {
        *(c + i) = logf(*(a + i));
    }
}

#include <pal.h>

/**
 *
 * Calculates the natural logarithm of 'a', (where the base is 'e'=2.71828)
 *
 * @param a     Pointer to input vector
 *
 * @param c     Pointer to output vector
 *
 * @param n     Size of 'a' and 'c' vector.
 *
 * @param p     Number of processor to use (task parallelism)
 *
 * @param team  Team to work with
 *
 * @return      None
 *
 */

void p_ln_f32(const float *a, float *c, int n, int p, p_team_t team)
{
    int i;
    for (i = 0; i < n; i++) {
        union
        {
            float f;
            uint32_t i;
        } u = { *(a + i) };

        // Calculate the exponent (which is the floor of the logarithm) minus one
        int e = ((u.i >> 23) & 0xff) - 0x80;

        // Mask off the exponent, leaving just the mantissa
        u.i = (u.i & 0x7fffff) + 0x3f800000;

        // Interpolate using a cubic minimax polynomial derived with
        // the Remez exchange algorithm. Coefficients courtesy of Alex Kan.
        // This approximates 1 + log2 of the mantissa.
        float r = ((0.15824870f * u.f - 1.05187502f) * u.f + 3.04788415f) * u.f - 1.15360271f;

        // The log2 of the complete value is then the sum
        // of the previous quantities (the 1's cancel), and
        // we find the natural log by scaling by log2(e).
        *(c + i) = (e + r) * 0.69314718f;
    }
}

Implement faster natural log function

Implement faster natural log function

Signed-off-by: Warren Moore <4fdbf0932cf8fc9903ee31afa97cf723d35eb3f3@warrenmoore.net>


//===-- llvm/CodeGen/SSARegMap.h --------------------------------*- C++ -*-===//
//
// Map register numbers to register classes that are correctly sized (typed) to
// hold the information. Assists register allocation. Contained by
// MachineFunction, should be deleted by register allocator when it is no
// longer needed.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_SSAREGMAP_H
#define LLVM_CODEGEN_SSAREGMAP_H

#include "llvm/Target/MRegisterInfo.h"

class TargetRegisterClass;

class SSARegMap {
  std::vector<const TargetRegisterClass*> RegClassMap;

  unsigned rescale(unsigned Reg) {
    return Reg - MRegisterInfo::FirstVirtualRegister;
  }

 public:
  const TargetRegisterClass* getRegClass(unsigned Reg) {
    unsigned actualReg = rescale(Reg);
    assert(actualReg < RegClassMap.size() && "Register out of bounds");
    return RegClassMap[actualReg];
  }

  void addRegMap(unsigned Reg, const TargetRegisterClass* RegClass) {
    assert(rescale(Reg) == RegClassMap.size() &&
           "Register mapping not added in sequential order!");
    RegClassMap.push_back(RegClass);
  }
};

#endif

//===-- llvm/CodeGen/SSARegMap.h --------------------------------*- C++ -*-===//
//
// Map register numbers to register classes that are correctly sized (typed) to
// hold the information. Assists register allocation. Contained by
// MachineFunction, should be deleted by register allocator when it is no
// longer needed.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_SSAREGMAP_H
#define LLVM_CODEGEN_SSAREGMAP_H

#include "llvm/Target/MRegisterInfo.h"

class TargetRegisterClass;

class SSARegMap {
  std::vector<const TargetRegisterClass*> RegClassMap;

  unsigned rescale(unsigned Reg) {
    return Reg - MRegisterInfo::FirstVirtualRegister;
  }

 public:
  const TargetRegisterClass* getRegClass(unsigned Reg) {
    unsigned actualReg = rescale(Reg);
    assert(actualReg < RegClassMap.size() && "Register out of bounds");
    return RegClassMap[actualReg];
  }

  /// createVirtualRegister - Create and return a new virtual register in the
  /// function with the specified register class.
  ///
  unsigned createVirtualRegister(const TargetRegisterClass *RegClass) {
    RegClassMap.push_back(RegClass);
    return RegClassMap.size()+MRegisterInfo::FirstVirtualRegister-1;
  }
};

#endif

Simplify interface to creating a register

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


// Copyright (C) 2011  Carl Rogers
// Released under MIT License
// Simplied by Weichao Qiu (qiuwch@gmail.com) from https://github.com/rogersce/cnpy
#pragma once
#include <vector>

namespace cnpy {
	template<typename T>
	std::vector<char> create_npy_header(const T* data, const std::vector<int> shape);

	template<typename T>
	std::vector<char>& operator+=(std::vector<char>& lhs, const T rhs) {
		//write in little endian
		for (char byte = 0; byte < sizeof(T); byte++) {
			char val = *((char*)&rhs + byte);
			lhs.push_back(val);
		}
		return lhs;
	}
	template<>
	std::vector<char>& operator+=(std::vector<char>& lhs, const std::string rhs);
	template<>
	std::vector<char>& operator+=(std::vector<char>& lhs, const char* rhs);
}

// Copyright (C) 2011  Carl Rogers
// Released under MIT License
// Simplied by Weichao Qiu (qiuwch@gmail.com) from https://github.com/rogersce/cnpy
#pragma once
#include <vector>
#include <string>

namespace cnpy {
	template<typename T>
	std::vector<char> create_npy_header(const T* data, const std::vector<int> shape);

	template<typename T>
	std::vector<char>& operator+=(std::vector<char>& lhs, const T rhs) {
		//write in little endian
		for (char byte = 0; byte < sizeof(T); byte++) {
			char val = *((char*)&rhs + byte);
			lhs.push_back(val);
		}
		return lhs;
	}
	template<>
	std::vector<char>& operator+=(std::vector<char>& lhs, const std::string rhs);
	template<>
	std::vector<char>& operator+=(std::vector<char>& lhs, const char* rhs);
}

Fix a compilation error for UE4.12.

Fix a compilation error for UE4.12.


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

#define URL "https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505\
(v=vs.85).aspx"
#define VERSION "0.1.0"

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine,
                   int nShowCmd)
{
    LPWSTR *szArgList;
    int argCount;

    szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount);
    if (szArgList == NULL) {
        fprintf(stderr, "Unable to parse the command line.\n");
        return 255;
    }
    if (argCount < 3 || argCount > 4) {
        fprintf(stderr, "Batch MessageBox v" VERSION "\n", szArgList[0]);
        fprintf(stderr, "Usage: %ls message title [type]\n\n", szArgList[0]);

        fprintf(stderr, "Calls MessageBoxW() with the given arguments. See\n"
                        URL "\nfor the possible values of \"type\". "
                        "ERRORLEVEL is the return value or 255 on\nerror.\n");
        return 255;
    }
    int type = _wtoi(szArgList[3]);
    int button = MessageBoxW(NULL, szArgList[1], szArgList[2], type);
    LocalFree(szArgList);
    return button;
}

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

#define URL "https://msdn.microsoft.com/en-us/library/windows/desktop/ms645505\
(v=vs.85).aspx"
#define VERSION "0.1.0"

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPSTR lpCmdLine,
                   int nShowCmd)
{
    LPWSTR *szArgList;
    int argCount;

    szArgList = CommandLineToArgvW(GetCommandLineW(), &argCount);
    if (szArgList == NULL) {
        fprintf(stderr, "Unable to parse the command line.\n");
        return 255;
    }
    if (argCount < 3 || argCount > 4) {
        fprintf(stderr, "Batch MessageBox v" VERSION "\n");
        fprintf(stderr, "Usage: %ls message title [type]\n\n", szArgList[0]);

        fprintf(stderr, "Calls MessageBoxW() with the given arguments. See\n"
                        URL "\nfor the possible values of \"type\". "
                        "ERRORLEVEL is the return value or 255 on\nerror.\n");
        return 255;
    }
    /* Ignore _wtoi errors. */
    int type = _wtoi(szArgList[3]);
    int button = MessageBoxW(NULL, szArgList[1], szArgList[2], type);
    LocalFree(szArgList);
    return button;
}

Remove unused fprintf arg; add comment on _wtoi


#ifndef DATUM_H
#define DATUM_H

#include "hexutil/basics/atom.h"

// The variant must be wrapped like this, otherwise the compiler will get confused about which overload to use
struct Datum {
    Datum(): value(0) { }
    Datum(int x): value(x) { }

    boost::variant<Atom, int, float, std::string> value;

    Datum& operator=(const Datum& x) {
        value = x.value;
        return *this;
    }

    bool operator==(const Datum& x) const { return value == x.value; }

    Datum& operator=(const int& x) { value = x; return *this; }
    bool operator==(const int& x) const { return boost::get<int>(value) == x; }

    template<typename T>
    operator T() const { return boost::get<T>(value); }

    template<typename T>
    bool is() const {
        return boost::get<T>(&value) != nullptr;
    }

    template<typename T>
    const T& get() const {
        return boost::get<T>(value);
    }

    std::string get_as_str() const;
    Atom get_as_atom() const;
    int get_as_int() const;
};

std::ostream& operator<<(std::ostream& os, const Datum& atom);

#endif

#ifndef DATUM_H
#define DATUM_H

#include "hexutil/basics/atom.h"

// The variant must be wrapped like this, otherwise the compiler will get confused about which overload to use
struct Datum {
    Datum(): value(0) { }
    Datum(int x): value(x) { }
    Datum(const std::string& x): value(x) { }

    boost::variant<Atom, int, float, std::string> value;

    Datum& operator=(const Datum& x) {
        value = x.value;
        return *this;
    }

    bool operator==(const Datum& x) const { return value == x.value; }

    Datum& operator=(const Atom& x) { value = x; return *this; }
    bool operator==(const Atom& x) const { return boost::get<Atom>(value) == x; }

    Datum& operator=(const int& x) { value = x; return *this; }
    bool operator==(const int& x) const { return boost::get<int>(value) == x; }

    template<typename T>
    operator T() const { return boost::get<T>(value); }

    template<typename T>
    bool is() const {
        return boost::get<T>(&value) != nullptr;
    }

    template<typename T>
    const T& get() const {
        return boost::get<T>(value);
    }

    std::string get_as_str() const;
    Atom get_as_atom() const;
    int get_as_int() const;
};

std::ostream& operator<<(std::ostream& os, const Datum& atom);

#endif

Support comparing Datums against Atoms.

Support comparing Datums against Atoms.


/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#pragma once

#include "Analyzer.h"
#include "CallGraph.h"
#include "DexClass.h"
#include "MonotonicFixpointIterator.h"

namespace sparta_interprocedural {

struct AnalysisAdaptorBase {
  using Function = const DexMethod*;
  using Program = const Scope&;
  using CallGraphInterface = call_graph::GraphInterface;

  // Uses the serial fixpoint iterator by default. The user can override this
  // type alias to use the parallel fixpoint.
  template <typename GraphInterface, typename Domain>
  using FixpointIteratorBase =
      sparta::MonotonicFixpointIterator<GraphInterface, Domain>;

  // The summary argument is unused in the adaptor base. Only certain
  // analyses will require this argument, in which case this function
  // should be *overriden* in the derived class.
  template <typename FunctionSummaries>
  static call_graph::Graph call_graph_of(const Scope& scope,
                                         FunctionSummaries* /*summaries*/) {
    // TODO: build method override graph and merge them together?
    // TODO: build once and cache it in the memory because the framework
    // will call it on every top level iteration.
    return call_graph::single_callee_graph(scope);
  }
};

} // namespace sparta_interprocedural

Create IR adaptor for sparta interprocedural facilities

Summary: If the IR has a call graph and the GraphInterface is already defined for Sparta, this should be easy.

Reviewed By: jeremydubreil

Differential Revision: D19665016

fbshipit-source-id: f987f9a94152e1040f2d82c7d3d72f18282d2309


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

int main() {
  printf("Test goes here.\n");
}

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include "rtree.h"
#include "minunit.h"
#include "main.h"

int tests_run = 0;

static char *test_all_kept() {
  for (int count = 0; count < 1000; count++) {
    rtree_t *rt = rtree_create();
    for (uintptr_t i = 0; i < count; i++) {
      rtree_add(rt, (void *) i, (double) drand48());
    }
    char *recvd = calloc(count, sizeof(char));
    for (int i = 0; i < count; i++) {
      int pos = (int) ((uintptr_t) rtree_rpop(rt));
      recvd[pos]++;
    }
    for (int i = 0; i < count; i++) {
      char *err_msg = calloc(80, sizeof(char));
      sprintf(err_msg, "Expected exactly 1 elt with value %d, but was %d\n", i,
              recvd[i]);
      mu_assert(err_msg, recvd[i] == 1);
      free(err_msg);
    }
    free(recvd);
    rtree_destroy(rt);
  }
  return 0;
}

static char *all_tests() {
  mu_run_test(test_all_kept);
  return 0;
}

int main() {
  char *result = all_tests();
  if (result != 0) {
    printf("%s\n", result);
  }
  else {
    printf("All tests passed.\n");
  }
  printf("Tests run: %d\n", tests_run);

  return result != 0;
}

Add in check to ensure all elements are included.


#ifndef OMNICORE_STO_H
#define OMNICORE_STO_H

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

namespace mastercore
{
//! Comparator for owner/receiver entries
struct SendToOwners_compare
{
    bool operator()(const std::pair<int64_t, std::string>& p1, const std::pair<int64_t, std::string>& p2) const;
};

//! Fee required to be paid per owner/receiver, nominated in willets
const int64_t TRANSFER_FEE_PER_OWNER = 1;
const int64_t TRANSFER_FEE_PER_OWNER_V1 = 100;

//! Set of owner/receivers, sorted by amount they own or might receive
typedef std::set<std::pair<int64_t, std::string>, SendToOwners_compare> OwnerAddrType;

/** Determines the receivers and amounts to distribute. */
OwnerAddrType STO_GetReceivers(const std::string& sender, uint32_t property, int64_t amount);
}

#endif // OMNICORE_STO_H

#ifndef OMNICORE_STO_H
#define OMNICORE_STO_H

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

namespace mastercore
{
//! Comparator for owner/receiver entries
struct SendToOwners_compare
{
    bool operator()(const std::pair<int64_t, std::string>& p1, const std::pair<int64_t, std::string>& p2) const;
};

//! Fee required to be paid per owner/receiver, nominated in willets
const int64_t TRANSFER_FEE_PER_OWNER = 1;
const int64_t TRANSFER_FEE_PER_OWNER_V1 = 1000;

//! Set of owner/receivers, sorted by amount they own or might receive
typedef std::set<std::pair<int64_t, std::string>, SendToOwners_compare> OwnerAddrType;

/** Determines the receivers and amounts to distribute. */
OwnerAddrType STO_GetReceivers(const std::string& sender, uint32_t property, int64_t amount);
}

#endif // OMNICORE_STO_H

Change STOv1 fee per recipient to 0.00001000 OMNI


/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.version.c - version 1.0.3 */
/* $Header: hack.version.c,v 1.5 85/05/09 00:40:41 aeb Exp $ */

#include	"date.h"

doversion(){
	pline("%s 1.0.3 - last edit %s.", (
#ifdef QUEST
		"Quest"
#else
		"Hack"
#endif QUEST
		), datestring);
	return(0);
}

/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* hack.version.c - version 1.0.3 */
/* $Id$ */

#include	"date.h"

doversion(){
	pline("%s 1.0.3 - last edit %s.", (
#ifdef QUEST
		"Quest"
#else
		"Hack"
#endif QUEST
		), datestring);
	return(0);
}

Use Id instead of Header.

Use Id instead of Header.


// RUN: %llvmgcc -S %s -o - | grep {getelementptr i32}
extern void f(int *);
int e(int m, int n) {
  int x[n];
  f(x);
  return x[m];
}

// RUN: %llvmgcc -S %s -o - | grep {getelementptr \\\[0 x i32\\\]}
extern void f(int *);
int e(int m, int n) {
  int x[n];
  f(x);
  return x[m];
}

Adjust this test for recent llvm-gcc changes.

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


//
//  NearbyObjectProtocol.h
//  ARIS
//
//  Created by Brian Deith on 5/15/09.
//  Copyright 2009 __MyCompanyName__. All rights reserved.
//

enum {
	NearbyObjectNPC			= 1,
	NearbyObjectItem		= 2,
	NearbyObjectNode		= 3
};
typedef UInt32 nearbyObjectKind;

@protocol NearbyObjectProtocol
- (NSString *)name;
- (nearbyObjectKind)kind;
- (BOOL)forcedDisplay;
- (void)display;
@end

Include nearby object protocol file

Include nearby object protocol file


//===-- X86InstrBuilder.h - Functions to aid building x86 insts -*- C++ -*-===//
//
// This file exposes functions that may be used with BuildMI from the
// MachineInstrBuilder.h file to handle X86'isms in a clean way.
//
// The BuildMem function may be used with the BuildMI function to add entire
// memory references in a single, typed, function call.  X86 memory references
// can be very complex expressions (described in the README), so wrapping them
// up behind an easier to use interface makes sense.  Descriptions of the
// functions are included below.
//
//===----------------------------------------------------------------------===//

#ifndef X86INSTRBUILDER_H
#define X86INSTRBUILDER_H

#include "llvm/CodeGen/MachineInstrBuilder.h"

/// addDirectMem - This function is used to add a direct memory reference to the
/// current instruction.  Because memory references are always represented with
/// four values, this adds: Reg, [1, NoReg, 0] to the instruction
///
inline const MachineInstrBuilder &addDirectMem(const MachineInstrBuilder &MIB,
                                               unsigned Reg) {
  return MIB.addReg(Reg).addZImm(1).addMReg(0).addSImm(0);
}

#endif

Add functions to buld X86 specific constructs

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


#include <kernel/kernel.h>
#include <kotaka/paths/account.h>

static int is_control_garbage(string input)
{
	if (strlen(input) >= 1 && input[0] < ' ') {
		return 1;
	}

	return 0;
}

static int is_http_garbage(string input)
{
	if (strlen(input) >= 4 && input[0 .. 3] == "GET ") {
		return 1;
	}

	return 0;
}

static string garbage(string input)
{
	if (is_http_garbage(input)) {
		return "http";
	}

	if (is_control_garbage(input)) {
		return "control";
	}

	return nil;
}

static void siteban(string ip, string reason)
{
	string creator;
	mapping ban;

	ban = ([ ]);

	creator = DRIVER->creator(object_name(this_object()));

	ban["message"] = reason;
	ban["expire"] = time() + 90 * 86400;
	ban["issuer"] = creator;

	BAND->ban_site(ip + "/32", ban);
}

#include <kernel/kernel.h>
#include <kotaka/paths/account.h>

static int is_control_garbage(string input)
{
	if (strlen(input) >= 1 && input[0] < ' ') {
		return 1;
	}

	return 0;
}

static int is_http_garbage(string input)
{
	if (strlen(input) >= 4 && input[0 .. 3] == "GET ") {
		return 1;
	}

	return 0;
}

static string garbage(string input)
{
	if (is_control_garbage(input)) {
		return "control";
	}

	if (is_http_garbage(input)) {
		return "http";
	}

	return nil;
}

static void siteban(string ip, string reason)
{
	string creator;
	mapping ban;

	ban = ([ ]);

	creator = DRIVER->creator(object_name(this_object()));

	ban["message"] = reason;
	ban["expire"] = time() + 90 * 86400;
	ban["issuer"] = creator;

	BAND->ban_site(ip + "/32", ban);
}

Check for control garbage before http garbage, httpd isn't detecting control garbage because it has http whitelisted


#pragma once

#include <stdint.h>
#include <cpuid.h>

#define cpu_equals(name) __builtin_cpu_is(name)
#define cpu_supports(feature) __builtin_cpu_supports(feature)
#define get_cpuid(a, b, c, d) __get_cpuid(0, a, b, c, d)

typedef struct regs {
    uint32_t gs, fs, es, ds;
    uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax;
    uint32_t int_no, err_code;
    uint32_t eip, cs, eflags, useresp, ss;
} regs_t;

#define IRQ_CHAIN_SIZE 16
#define IRQ_CHAIN_DEPTH 4

typedef void (*irq_handler_t) (regs_t *);
typedef int (*irq_handler_chain_t) (regs_t *);

#pragma once

#include <stdint.h>
#include <cpuid.h>

#define cpu_equals(name) __builtin_cpu_is(name)
#define cpu_supports(feature) __builtin_cpu_supports(feature)
#define get_cpuid(in, a, b, c, d) __get_cpuid(in, a, b, c, d)

typedef struct regs {
    uint32_t gs, fs, es, ds;
    uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax;
    uint32_t int_no, err_code;
    uint32_t eip, cs, eflags, useresp, ss;
} regs_t;

#define IRQ_CHAIN_SIZE 16
#define IRQ_CHAIN_DEPTH 4

typedef void (*irq_handler_t) (regs_t *);
typedef int (*irq_handler_chain_t) (regs_t *);

Add first parameter to get_cpuid definition.


/* Copyright (c) 2019 Mahmoud Fayed <msfclipper@yahoo.com> */

#define RING_EXTENSION	// Don't call : windows.h (Avoid conflict with raylib.h)
#include <ring.h>

#include <raylib.h>

RING_FUNC(ring_InitWindow)
{
	if ( RING_API_PARACOUNT != 3 ) {
		RING_API_ERROR(RING_API_MISS3PARA);
		return ;
	}
	if ( ! RING_API_ISNUMBER(1) ) {
		RING_API_ERROR(RING_API_BADPARATYPE);
		return ;
	}
	if ( ! RING_API_ISNUMBER(2) ) {
		RING_API_ERROR(RING_API_BADPARATYPE);
		return ;
	}
	if ( ! RING_API_ISSTRING(3) ) {
		RING_API_ERROR(RING_API_BADPARATYPE);
		return ;
	}
	InitWindow( (int ) RING_API_GETNUMBER(1), (int ) RING_API_GETNUMBER(2),RING_API_GETSTRING(3));
}

RING_API void ringlib_init(RingState *pRingState)
{
	ring_vm_funcregister("initwindow",ring_InitWindow);
}

/* Copyright (c) 2019 Mahmoud Fayed <msfclipper@yahoo.com> */

#define RING_EXTENSION	// Don't call : windows.h (Avoid conflict with raylib.h)
#include <ring.h>

#include <raylib.h>

RING_FUNC(ring_InitWindow)
{
	if ( RING_API_PARACOUNT != 3 ) {
		RING_API_ERROR(RING_API_MISS3PARA);
		return ;
	}
	if ( ! RING_API_ISNUMBER(1) ) {
		RING_API_ERROR(RING_API_BADPARATYPE);
		return ;
	}
	if ( ! RING_API_ISNUMBER(2) ) {
		RING_API_ERROR(RING_API_BADPARATYPE);
		return ;
	}
	if ( ! RING_API_ISSTRING(3) ) {
		RING_API_ERROR(RING_API_BADPARATYPE);
		return ;
	}
	InitWindow( (int ) RING_API_GETNUMBER(1), (int ) RING_API_GETNUMBER(2),RING_API_GETSTRING(3));
}

RING_FUNC(ring_WindowShouldClose)
{
	if ( RING_API_PARACOUNT != 0 ) {
		RING_API_ERROR(RING_API_BADPARACOUNT);
		return ;
	}
	RING_API_RETNUMBER(WindowShouldClose());
}

RING_API void ringlib_init(RingState *pRingState)
{
	ring_vm_funcregister("initwindow",ring_InitWindow);
	ring_vm_funcregister("windowshouldclose",ring_WindowShouldClose);
}

Update RingRayLib - raylib.c - Add Function : bool WindowShouldClose(void)


uint32_t _rng_state = millis()

void init_rng() {
  _rng_state = 75380540 - millis()
  for (int i=0; i<100; i++)
	tiny_prng()
}

uint32_t tiny_prng() {
	uint32_t x = _rng_state;
	x ^= x << 13;
	x ^= x >> 17;
	x ^= x << 5;
	_rng_state = x;
	return x;
}

Add tiny rng for volume control

Add tiny rng for volume control


/*
							MIT License
					Copyright (c) 2017 ZeroUnix
	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.

*/

// **Note: Please read the 'README.md' first
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the DLLEXPORTPROJ_EXPORTS
// symbol defined on the command line. This symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// DLLEXPORTPROJ_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
#ifdef DLLEXPORTPROJ_EXPORTS
#define DLLEXPORTPROJ_API __declspec(dllexport)
#else
#define DLLEXPORTPROJ_API __declspec(dllimport)
#endif

//Windows Header
#include <windows.h>

#include <windowsx.h>

#include <AccCtrl.h>
#include <AclAPI.h>

#include <shellapi.h>
#include <stdlib.h>

DLLEXPORTPROJ_API BOOL AdministratorPrivilege(VOID);

DLLEXPORTPROJ_API VOID ElevateCurrentProcess(VOID);

DLLEXPORTPROJ_API BOOL IsStartup(LPWSTR pszAppName, LPWSTR hSubKey);

DLLEXPORTPROJ_API BOOL RegisterApp(LPWSTR pszAppName, LPWSTR pathToExe, LPWSTR args, LPWSTR hSubKey);

DLLEXPORTPROJ_API VOID EnableStartup(LPWSTR pszAppName, LPWSTR args);

Add functions, headers & description

Add functions, headers & description


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

#ifndef CRATE_DEMO_GRAPHICS_MANAGER_H
#define CRATE_DEMO_GRAPHICS_MANAGER_H

#include "common/graphics_manager_base.h"

#include <d3d11.h>

namespace CrateDemo {

class GameStateManager;
class GraphicsManager : public Common::GraphicsManagerBase {
public:
	GraphicsManager(GameStateManager *gameStateManager);

private:
	GameStateManager *m_gameStateManager;

	ID3D11RenderTargetView *m_renderTargetView;

public:
	bool Initialize(int clientWidth, int clientHeight, HWND hwnd);
	void Shutdown();
	void DrawFrame();
	void OnResize(int newClientWidth, int newClientHeight);
	void GamePaused();
	void GameUnpaused();
};

} // End of namespace CrateDemo

#endif

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

#ifndef CRATE_DEMO_GRAPHICS_MANAGER_H
#define CRATE_DEMO_GRAPHICS_MANAGER_H

#include "common/graphics_manager_base.h"

#include <d3d11.h>
#include "DirectXMath.h"

namespace CrateDemo {

class GameStateManager;

struct Vertex {
	DirectX::XMFLOAT3 pos;
	DirectX::XMFLOAT4 color;
};

class GraphicsManager : public Common::GraphicsManagerBase {
public:
	GraphicsManager(GameStateManager *gameStateManager);

private:
	GameStateManager *m_gameStateManager;

	ID3D11RenderTargetView *m_renderTargetView;

public:
	bool Initialize(int clientWidth, int clientHeight, HWND hwnd);
	void Shutdown();
	void DrawFrame();
	void OnResize(int newClientWidth, int newClientHeight);
	void GamePaused();
	void GameUnpaused();
};

} // End of namespace CrateDemo

#endif

CRATE_DEMO: Create Vertex struct to hold vertex info


// Copyright (c) 2009 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 WEBMIMEREGISTRY_IMPL_H_
#define WEBMIMEREGISTRY_IMPL_H_

#include "third_party/WebKit/WebKit/chromium/public/WebMimeRegistry.h"

namespace webkit_glue {

class SimpleWebMimeRegistryImpl : public WebKit::WebMimeRegistry {
 public:
  // WebMimeRegistry methods:
  virtual WebKit::WebMimeRegistry::SupportsType supportsMIMEType(
      const WebKit::WebString&);
  virtual WebKit::WebMimeRegistry::SupportsType supportsImageMIMEType(
      const WebKit::WebString&);
  virtual WebKit::WebMimeRegistry::SupportsType supportsJavaScriptMIMEType(
      const WebKit::WebString&);
  virtual WebKit::WebMimeRegistry::SupportsType supportsMediaMIMEType(
      const WebKit::WebString&, const WebKit::WebString&);
  virtual WebKit::WebMimeRegistry::SupportsType supportsNonImageMIMEType(
      const WebKit::WebString&);
  virtual WebKit::WebString mimeTypeForExtension(const WebKit::WebString&);
  virtual WebKit::WebString mimeTypeFromFile(const WebKit::WebString&);
  virtual WebKit::WebString preferredExtensionForMIMEType(
      const WebKit::WebString&);
};

}  // namespace webkit_glue

#endif  // WEBMIMEREGISTRY_IMPL_H_

// Copyright (c) 2009 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 WEBMIMEREGISTRY_IMPL_H_
#define WEBMIMEREGISTRY_IMPL_H_

#include "third_party/WebKit/WebKit/chromium/public/WebMimeRegistry.h"

namespace webkit_glue {

class SimpleWebMimeRegistryImpl : public WebKit::WebMimeRegistry {
 public:
  SimpleWebMimeRegistryImpl() {}
  virtual ~SimpleWebMimeRegistryImpl() {}

  // WebMimeRegistry methods:
  virtual WebKit::WebMimeRegistry::SupportsType supportsMIMEType(
      const WebKit::WebString&);
  virtual WebKit::WebMimeRegistry::SupportsType supportsImageMIMEType(
      const WebKit::WebString&);
  virtual WebKit::WebMimeRegistry::SupportsType supportsJavaScriptMIMEType(
      const WebKit::WebString&);
  virtual WebKit::WebMimeRegistry::SupportsType supportsMediaMIMEType(
      const WebKit::WebString&, const WebKit::WebString&);
  virtual WebKit::WebMimeRegistry::SupportsType supportsNonImageMIMEType(
      const WebKit::WebString&);
  virtual WebKit::WebString mimeTypeForExtension(const WebKit::WebString&);
  virtual WebKit::WebString mimeTypeFromFile(const WebKit::WebString&);
  virtual WebKit::WebString preferredExtensionForMIMEType(
      const WebKit::WebString&);
};

}  // namespace webkit_glue

#endif  // WEBMIMEREGISTRY_IMPL_H_

Add a virtual destructor to SimpleWebMimeRegistryImpl so that child class destructors get called correctly.

BUG=62828
TEST=No memory leak in TestShellWebMimeRegistryImpl
Review URL: http://codereview.chromium.org/4880002

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


//
//  NSUserDefaults+RACSupport.h
//  ReactiveCocoa
//
//  Created by Matt Diephouse on 12/19/13.
//  Copyright (c) 2013 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

@class RACChannelTerminal;

@interface NSUserDefaults (RACSupport)

// Creates and returns a terminal for binding the user defaults key.
//
// key - The user defaults key to create the channel terminal for.
//
// This makes it easy to bind a property to a default by assigning to
// `RACChannelTo`.
//
// Returns a channel terminal.
- (RACChannelTerminal *)rac_channelTerminalForKey:(NSString *)key;

@end

//
//  NSUserDefaults+RACSupport.h
//  ReactiveCocoa
//
//  Created by Matt Diephouse on 12/19/13.
//  Copyright (c) 2013 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

@class RACChannelTerminal;

@interface NSUserDefaults (RACSupport)

// Creates and returns a terminal for binding the user defaults key.
//
// key - The user defaults key to create the channel terminal for.
//
// This makes it easy to bind a property to a default by assigning to
// `RACChannelTo`.
//
// The terminal will send the value of the user defaults key upon subscription.
//
// Returns a channel terminal.
- (RACChannelTerminal *)rac_channelTerminalForKey:(NSString *)key;

@end

Clarify that the terminal sends a value upon subscription


/*
 *  The OpenDiamond Platform for Interactive Search
 *  Version 4
 *
 *  Copyright (c) 2002-2005 Intel Corporation
 *  All rights reserved.
 *
 *  This software is distributed under the terms of the Eclipse Public
 *  License, Version 1.0 which can be found in the file named LICENSE.
 *  ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS SOFTWARE CONSTITUTES
 *  RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT
 */

#ifndef _SYS_ATTR_H_
#define _SYS_ATTR_H_

/*
 * Names for some of the system defined attributes.
 * XXX update these from the spec.
 */

#define	SIZE		"SYS_SIZE"
#define	UID		"SYS_UID"
#define	GID		"SYS_GID"
#define	BLK_SIZE	"SYS_BLKSIZE"
#define	ATIME		"SYS_ATIME"
#define	MTIME		"SYS_MTIME"
#define	CTIME		"SYS_CTIME"

#define OBJ_ID		"_ObjectID"
#define OBJ_DATA	""

#define DISPLAY_NAME    "Display-Name"
#define DEVICE_NAME     "Device-Name"

#define OBJ_PATH        "_path.cstring"
#define FLTRTIME        "_FIL_TIME.time"
#define FLTRTIME_FN     "_FIL_TIME_%s.time"
#define PERMEABILITY_FN "_FIL_STAT_%s_permeability.float"

#endif /* _SYS_ATTR_H_ */

/*
 *  The OpenDiamond Platform for Interactive Search
 *  Version 4
 *
 *  Copyright (c) 2002-2005 Intel Corporation
 *  All rights reserved.
 *
 *  This software is distributed under the terms of the Eclipse Public
 *  License, Version 1.0 which can be found in the file named LICENSE.
 *  ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS SOFTWARE CONSTITUTES
 *  RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT
 */

#ifndef _SYS_ATTR_H_
#define _SYS_ATTR_H_

/*
 * Names for some of the system defined attributes.
 */

#define OBJ_ID		"_ObjectID"
#define OBJ_DATA	""

#define DISPLAY_NAME    "Display-Name"
#define DEVICE_NAME     "Device-Name"

#define FLTRTIME        "_FIL_TIME.time"
#define FLTRTIME_FN     "_FIL_TIME_%s.time"

#endif /* _SYS_ATTR_H_ */

Drop definitions of unused object attributes


/*
 *  include/asm-sh/gpio.h
 *
 * Generic GPIO API and pinmux table support for SuperH.
 *
 * Copyright (c) 2008 Magnus Damm
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 */
#ifndef __ASM_SH_GPIO_H
#define __ASM_SH_GPIO_H

#include <linux/kernel.h>
#include <linux/errno.h>

#if defined(CONFIG_CPU_SH3)
#include <cpu/gpio.h>
#endif

#define ARCH_NR_GPIOS 512
#include <linux/sh_pfc.h>

#ifdef CONFIG_GPIOLIB

static inline int gpio_get_value(unsigned gpio)
{
	return __gpio_get_value(gpio);
}

static inline void gpio_set_value(unsigned gpio, int value)
{
	__gpio_set_value(gpio, value);
}

static inline int gpio_cansleep(unsigned gpio)
{
	return __gpio_cansleep(gpio);
}

static inline int gpio_to_irq(unsigned gpio)
{
	WARN_ON(1);
	return -ENOSYS;
}

static inline int irq_to_gpio(unsigned int irq)
{
	WARN_ON(1);
	return -EINVAL;
}

#endif /* CONFIG_GPIOLIB */

#endif /* __ASM_SH_GPIO_H */

/*
 *  include/asm-sh/gpio.h
 *
 * Generic GPIO API and pinmux table support for SuperH.
 *
 * Copyright (c) 2008 Magnus Damm
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License.  See the file "COPYING" in the main directory of this archive
 * for more details.
 */
#ifndef __ASM_SH_GPIO_H
#define __ASM_SH_GPIO_H

#include <linux/kernel.h>
#include <linux/errno.h>

#if defined(CONFIG_CPU_SH3)
#include <cpu/gpio.h>
#endif

#define ARCH_NR_GPIOS 512
#include <linux/sh_pfc.h>

#ifdef CONFIG_GPIOLIB

static inline int gpio_get_value(unsigned gpio)
{
	return __gpio_get_value(gpio);
}

static inline void gpio_set_value(unsigned gpio, int value)
{
	__gpio_set_value(gpio, value);
}

static inline int gpio_cansleep(unsigned gpio)
{
	return __gpio_cansleep(gpio);
}

static inline int gpio_to_irq(unsigned gpio)
{
	return __gpio_to_irq(gpio);
}

static inline int irq_to_gpio(unsigned int irq)
{
	return -ENOSYS;
}

#endif /* CONFIG_GPIOLIB */

#endif /* __ASM_SH_GPIO_H */

sh: Allow GPIO chips to register IRQ mappings.

As non-PFC chips are added that may support IRQs, pass through to the
generic helper instead of triggering the WARN_ON().

Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>


/*************************************************/
/*           DO NOT MODIFY THIS HEADER           */
/*                                               */
/*                     MASTODON                  */
/*                                               */
/*    (c) 2015 Battelle Energy Alliance, LLC     */
/*            ALL RIGHTS RESERVED                */
/*                                               */
/*   Prepared by Battelle Energy Alliance, LLC   */
/*     With the U. S. Department of Energy       */
/*                                               */
/*     See COPYRIGHT for full restrictions       */
/*************************************************/

/**
 * This action automatically creates the displacement Variables and the
 * velocity, acceleration, stress and strain AuxVariables based on the dimension of the mesh
 * of the problem.
 **/

#ifndef MASTODONADDVARIABLEACTION_H
#define MASTODONADDVARIABLEACTION_H

#include "Action.h"

class MastodonAddVariableAction : public Action
{
public:
  MastodonAddVariableAction(const InputParameters & params);

  virtual void act() override;

private:
};

template <>
InputParameters validParams<MastodonAddVariableAction>();

#endif // MASTODONADDVARIABLEACTION_H

/*************************************************/
/*           DO NOT MODIFY THIS HEADER           */
/*                                               */
/*                     MASTODON                  */
/*                                               */
/*    (c) 2015 Battelle Energy Alliance, LLC     */
/*            ALL RIGHTS RESERVED                */
/*                                               */
/*   Prepared by Battelle Energy Alliance, LLC   */
/*     With the U. S. Department of Energy       */
/*                                               */
/*     See COPYRIGHT for full restrictions       */
/*************************************************/

/**
 * This action automatically creates the displacement Variables and the
 * velocity, acceleration, stress and strain AuxVariables based on the dimension of the mesh
 * of the problem.
 **/

#ifndef MASTODONADDVARIABLEACTION_H
#define MASTODONADDVARIABLEACTION_H

#include "Action.h"

class MastodonAddVariableAction : public Action
{
public:
  MastodonAddVariableAction(const InputParameters & params);

  virtual void act() override;
};

template <>
InputParameters validParams<MastodonAddVariableAction>();

#endif // MASTODONADDVARIABLEACTION_H

Remove private keyword that is not needed

(refs #100)


// Copyright 2014 Google Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd

#ifndef MEDIA_FILE_FILE_CLOSER_H_
#define MEDIA_FILE_FILE_CLOSER_H_

#include "packager/base/logging.h"
#include "packager/media/file/file.h"

namespace edash_packager {
namespace media {

/// Used by scoped_ptr to automatically close the file when it goes out of
/// scope.
struct FileCloser {
  inline void operator()(File* file) const {
    if (file != NULL && !file->Close()) {
      LOG(WARNING) << "Failed to close the file properly: "
                   << file->file_name();
    }
  }
};

}  // namespace media
}  // namespace edash_packager

#endif  // MEDIA_FILE_FILE_CLOSER_H_

// Copyright 2014 Google Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd

#ifndef MEDIA_FILE_FILE_CLOSER_H_
#define MEDIA_FILE_FILE_CLOSER_H_

#include "packager/base/logging.h"
#include "packager/media/file/file.h"

namespace edash_packager {
namespace media {

/// Used by scoped_ptr to automatically close the file when it goes out of
/// scope.
struct FileCloser {
  inline void operator()(File* file) const {
    if (file != NULL) {
      const std::string filename = file->file_name();
      if (!file->Close()) {
        LOG(WARNING) << "Failed to close the file properly: "
                     << filename;
      }
    }
  }
};

}  // namespace media
}  // namespace edash_packager

#endif  // MEDIA_FILE_FILE_CLOSER_H_

Fix a possible crash if a file fails to be closed

Change-Id: I6bc806a68b81ea5bde09bada1175f257c296afcd


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

#ifndef GrVkDefines_DEFINED
#define GrVkDefines_DEFINED

#ifdef SK_VULKAN

#if defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_WIN32)
#   if !defined(VK_USE_PLATFORM_WIN32_KHR)
#      define VK_USE_PLATFORM_WIN32_KHR
#   endif
#elif defined(SK_BUILD_FOR_ANDROID)
#   if !defined(VK_USE_PLATFORM_ANDROID_KHR)
#      define VK_USE_PLATFORM_ANDROID_KHR
#   endif
#elif defined(SK_BUILD_FOR_UNIX)
#   if defined(__Fuchsia__)
#     if !defined(VK_USE_PLATFORM_MAGMA_KHR)
#       define VK_USE_PLATFORM_MAGMA_KHR
#     endif
#   else
#     if !defined(VK_USE_PLATFORM_XCB_KHR)
#        define VK_USE_PLATFORM_XCB_KHR
#     endif
#   endif
#endif

#include <vulkan/vulkan.h>

#define SKIA_REQUIRED_VULKAN_HEADER_VERSION 17
#if VK_HEADER_VERSION < SKIA_REQUIRED_VULKAN_HEADER_VERSION
#error "Vulkan header version is too low"
#endif

#endif

#endif

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

#ifndef GrVkDefines_DEFINED
#define GrVkDefines_DEFINED

#ifdef SK_VULKAN

#if defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_WIN32)
#   if !defined(VK_USE_PLATFORM_WIN32_KHR)
#      define VK_USE_PLATFORM_WIN32_KHR
#   endif
#elif defined(SK_BUILD_FOR_ANDROID)
#   if !defined(VK_USE_PLATFORM_ANDROID_KHR)
#      define VK_USE_PLATFORM_ANDROID_KHR
#   endif
#elif defined(SK_BUILD_FOR_UNIX)
#   if defined(__Fuchsia__)
#     if !defined(VK_USE_PLATFORM_MAGMA_KHR)
#       define VK_USE_PLATFORM_MAGMA_KHR
#     endif
#   else
#     if !defined(VK_USE_PLATFORM_XCB_KHR)
#        define VK_USE_PLATFORM_XCB_KHR
#     endif
#   endif
#endif

// We create our own function table and never directly call any functions via vk*(). So no need to
// include the prototype functions.
#ifndef VK_NO_PROTOTYPES
#define VK_NO_PROTOTYPES
#endif

#include <vulkan/vulkan.h>

#define SKIA_REQUIRED_VULKAN_HEADER_VERSION 17
#if VK_HEADER_VERSION < SKIA_REQUIRED_VULKAN_HEADER_VERSION
#error "Vulkan header version is too low"
#endif

#endif

#endif

Set VK_NO_PROTOTYPES for vulkan backend

Set VK_NO_PROTOTYPES for vulkan backend

Bug: skia:
Change-Id: Id740efe6030b70271b0eb3a3bd6a111202f28fd8
Reviewed-on: https://skia-review.googlesource.com/69160
Commit-Queue: Greg Daniel <39df0a804564ccb6cf75f18db79653821f37c1c5@google.com>
Reviewed-by: Chris Dalton <ef7fc3a08ada7d31f16e9a18b5f3c728256e041e@google.com>


//
//  Constants.h
//  hashtag-warrior
//
//  Created by Daniel Wood on 20/04/2013.
//  Copyright (c) 2013 Ossum Games. All rights reserved.
//

#ifndef hashtag_warrior_Constants_h
#define hashtag_warrior_Constants_h

// UI & appearance
#define kHWBackgroundColor ccc4(142, 193, 218, 255)
#define kHWTextColor ccc3(8, 90, 124);
#define kHWTextHeadingFamily @"Marker Felt"
#define kHWTextBodyFamily @"Arial"

// Gameplay
#define kHWMinProjectileSize 2.0f          // TODO net yet used
#define kHWMaxProjectileSize 10.0f         // TODO net yet used
#define kHWMinProjectileStartVelocity 2.0f // TODO net yet used
#define kHWMaxProjectileStartVelocity 8.0f // TODO net yet used
#define kHWMinProjectileStartAngle -5      // TODO net yet used
#define kHWMaxProjectileStartAngle 30      // TODO net yet used

// Environment
#define kHWMaxVelocity 10.0f
#define kHWForceMagnifier 5

#endif

//
//  Constants.h
//  hashtag-warrior
//
//  Created by Daniel Wood on 20/04/2013.
//  Copyright (c) 2013 Ossum Games. All rights reserved.
//

#ifndef hashtag_warrior_Constants_h
#define hashtag_warrior_Constants_h

// UI & appearance
#define kHWBackgroundColor ccc4(142, 193, 218, 255)
#define kHWTextColor ccc3(8, 90, 124);
#define kHWTextHeadingFamily @"Marker Felt"
#define kHWTextBodyFamily @"Arial"

// Gameplay
#define kHWMinProjectileSize 2.0f          // TODO net yet used
#define kHWMaxProjectileSize 10.0f         // TODO net yet used
#define kHWMinProjectileStartVelocity 2.0f // TODO net yet used
#define kHWMaxProjectileStartVelocity 8.0f // TODO net yet used
#define kHWMinProjectileStartAngle -5      // TODO net yet used
#define kHWMaxProjectileStartAngle 30      // TODO net yet used

// Environment
#define kHWMaxVelocity 10.0f
#define kHWForceMagnifier 5

// Misc
#define kHWIsDebug 0

#endif

Add a constant for detecting whether we are in debug mode.


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

#ifndef PPAPI_C_PPB_FIND_H_
#define PPAPI_C_PPB_FIND_H_

#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_stdint.h"

#define PPB_FIND_INTERFACE "PPB_Find;1"

typedef struct _ppb_Find {
  // Updates the number of find results for the current search term.  If
  // there are no matches 0 should be passed in.  Only when the plugin has
  // finished searching should it pass in the final count with finalResult set
  // to true.
  void NumberOfFindResultsChanged(PP_Instance instance,
                                  int32_t total,
                                  bool final_result);

  // Updates the index of the currently selected search item.
  void SelectedFindResultChanged(PP_Instance instance,
                                 int32_t index);

} PPB_Find;

#endif  // PPAPI_C_PPB_FIND_H_

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

#ifndef PPAPI_C_PPB_FIND_H_
#define PPAPI_C_PPB_FIND_H_

#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_stdint.h"

#define PPB_FIND_INTERFACE "PPB_Find;1"

typedef struct _ppb_Find {
  // Updates the number of find results for the current search term.  If
  // there are no matches 0 should be passed in.  Only when the plugin has
  // finished searching should it pass in the final count with finalResult set
  // to true.
  void (*NumberOfFindResultsChanged)(PP_Instance instance,
                                     int32_t total,
                                     bool final_result);

  // Updates the index of the currently selected search item.
  void (*SelectedFindResultChanged)(PP_Instance instance,
                                    int32_t index);

} PPB_Find;

#endif  // PPAPI_C_PPB_FIND_H_

Structure member should be function pointer

BUG=none
TEST=compiles

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


//===-- CPPTargetMachine.h - TargetMachine for the C++ backend --*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the TargetMachine that is used by the C++ backend.
//
//===----------------------------------------------------------------------===//

#ifndef CPPTARGETMACHINE_H
#define CPPTARGETMACHINE_H

#include "llvm/IR/DataLayout.h"
#include "llvm/Target/TargetMachine.h"

namespace llvm {

class formatted_raw_ostream;

struct CPPTargetMachine : public TargetMachine {
  CPPTargetMachine(const Target &T, StringRef TT,
                   StringRef CPU, StringRef FS, const TargetOptions &Options,
                   Reloc::Model RM, CodeModel::Model CM,
                   CodeGenOpt::Level OL)
    : TargetMachine(T, TT, CPU, FS, Options) {}

  bool addPassesToEmitFile(PassManagerBase &PM, formatted_raw_ostream &Out,
                           CodeGenFileType FileType, bool DisableVerify,
                           AnalysisID StartAfter,
                           AnalysisID StopAfter) override;

  const DataLayout *getDataLayout() const override { return nullptr; }
};

extern Target TheCppBackendTarget;

} // End llvm namespace

#endif

//===-- CPPTargetMachine.h - TargetMachine for the C++ backend --*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the TargetMachine that is used by the C++ backend.
//
//===----------------------------------------------------------------------===//

#ifndef CPPTARGETMACHINE_H
#define CPPTARGETMACHINE_H

#include "llvm/IR/DataLayout.h"
#include "llvm/Target/TargetMachine.h"
#include "llvm/Target/TargetSubtargetInfo.h"

namespace llvm {

class formatted_raw_ostream;

class CPPSubtarget : public TargetSubtargetInfo {
};

struct CPPTargetMachine : public TargetMachine {
  CPPTargetMachine(const Target &T, StringRef TT,
                   StringRef CPU, StringRef FS, const TargetOptions &Options,
                   Reloc::Model RM, CodeModel::Model CM,
                   CodeGenOpt::Level OL)
    : TargetMachine(T, TT, CPU, FS, Options), Subtarget() {}
private:
  CPPSubtarget Subtarget;

public:
  const CPPSubtarget *getSubtargetImpl() const override { return &Subtarget; }
  bool addPassesToEmitFile(PassManagerBase &PM, formatted_raw_ostream &Out,
                           CodeGenFileType FileType, bool DisableVerify,
                           AnalysisID StartAfter,
                           AnalysisID StopAfter) override;
};

extern Target TheCppBackendTarget;

} // End llvm namespace

#endif

Add a dummy subtarget to the CPP backend target machine. This will
allow us to forward all of the standard TargetMachine calls to the
subtarget and still return null as we were before.

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


// framework.h
#ifndef HEADER_FRAMEWORK
#define HEADER_FRAMEWORK

// forward declaration
typedef struct wookie_framework wookie_framework;

/* Send an HTTP request back to the framework */
void *wookie_framework_request(void*);

#include "../http_parser/parser.h"
#include "../server.h"
#include "framework.c"

/* Create new framework */
wookie_framework *wookie_new_framework(char*, int);

/* Add a route to the framework */
void wookie_add_route(wookie_framework*, wookie_route*);

/* Start the framework */
int wookie_start_framework(wookie_framework*);

#endif

// framework.h
#ifndef HEADER_FRAMEWORK
#define HEADER_FRAMEWORK

// forward declaration
typedef struct wookie_framework wookie_framework;

/* Send an HTTP request back to the framework */
void *wookie_framework_request(void*);

#include "../http_parser/parser.h"
#include "../http_parser/http_response.h"
#include "../server.h"
#include "framework.c"

/* Create new framework */
wookie_framework *wookie_new_framework(char*, int);

/* Add a route to the framework */
void wookie_add_route(wookie_framework*, wookie_route*);

/* Start the framework */
int wookie_start_framework(wookie_framework*);

#endif

Include HTTP responses in server

Include HTTP responses in server


#include <sys/inotify.h>
#include <unistd.h>
#include <sys/wait.h>
#include <limits.h>

#define BUF_LEN ( sizeof(struct inotify_event) + NAME_MAX + 1 )

int main(int argc, char *argv[])
{
	int notify;
	char buf[BUF_LEN];
	struct inotify_event *event;
	const char *watchpath = "/home/ian/.PRINT";

	notify = inotify_init();

	if (inotify_add_watch(notify, watchpath, IN_CLOSE_WRITE) == -1)
		return 1;
	if (chdir(watchpath) !=0)
		return 1;

	while (1)
	{
		read(notify, buf, BUF_LEN);
		event = (struct inotify_event *) &buf[0];
		if (event->name[0] == '.')
			continue;
		if(fork() == 0) {
			execlp("lpr" ,"-r" , event->name, NULL);
			return 0;
		}
		wait(NULL);
		unlink(event->name);
	}
}

Replace tab w/ 4-space indent

Replace tab w/ 4-space indent


#include <sys/inotify.h>
#include <unistd.h>
#include <limits.h>
#include <cups/cups.h>

#define BUF_LEN ( sizeof(struct inotify_event) + NAME_MAX + 1 )

int main(int argc, char *argv[]) {
    int notify;
    char buf[BUF_LEN];
    struct inotify_event *event;
    cups_dest_t *dest;
    char *printer;
    char *filename;
    int job_id;
    const char *watchpath = "/home/ian/.PRINT";

    notify = inotify_init();

    if (inotify_add_watch(notify, watchpath, IN_CLOSE_WRITE) == -1)
        return 1;
    if (chdir(watchpath) !=0)
        return 1;

    //Get default printer
    if ((dest = cupsGetNamedDest(NULL, NULL, NULL)) == NULL )
	    return 1;
    printer = dest->name;

    while (1) {
        read(notify, buf, BUF_LEN);
        event = (struct inotify_event *) &buf[0];
	filename = event->name;
        if (filename[0] == '.')
            continue;

        job_id = cupsPrintFile(printer, filename, filename, 0, NULL);
        cupsStartDocument(CUPS_HTTP_DEFAULT, printer,
	                  job_id, NULL, CUPS_FORMAT_AUTO, 1);
        unlink(filename);
    }
}

#include <sys/inotify.h>
#include <unistd.h>
#include <limits.h>
#include <cups/cups.h>

#define BUF_LEN ( sizeof(struct inotify_event) + NAME_MAX + 1 )

int main(int argc, char *argv[]) {
    int notify;
    cups_dest_t *dest;
    char *printer;
    const char *watchpath = "/home/ian/.PRINT";

    notify = inotify_init();

    if (inotify_add_watch(notify, watchpath, IN_CLOSE_WRITE) == -1)
        return 1;
    if (chdir(watchpath) !=0)
        return 1;

    //Get default printer
    if ((dest = cupsGetNamedDest(NULL, NULL, NULL)) == NULL )
	    return 1;
    printer = dest->name;

    while (1) {
        char buf[BUF_LEN];
        struct inotify_event *event;
        char *filename;
        int job_id;

        read(notify, buf, BUF_LEN);
        event = (struct inotify_event *) &buf[0];
	filename = event->name;
        if (filename[0] == '.')
            continue;

        job_id = cupsPrintFile(printer, filename, filename, 0, NULL);
        cupsStartDocument(CUPS_HTTP_DEFAULT, printer,
	                  job_id, NULL, CUPS_FORMAT_AUTO, 1);
        unlink(filename);
    }
}

Move variable declarations to while loop


#pragma once
#include <array>

namespace filter {

template <typename T, size_t N>
class MovingAverage {
    public:
        MovingAverage(T initial_value=static_cast<T>(0));
        T output() const; // return average of data in buffer
        T output(T input); // add new value to buffer and return average

    private:
        std::array<T, N> m_data; // circular buffer containing samples
        size_t m_data_index; // index of oldest circular buffer element
        T m_sum; // sum of all elements in buffer
};

} // namespace filter

#include "filter/movingaverage.hh"

#pragma once
#include <array>

namespace filter {

/*
 * Warning: This class does not protect against sum overflow. It is possible
 * that the sum of values exceeds the maximum value T can store.
 */

template <typename T, size_t N>
class MovingAverage {
    public:
        MovingAverage(T initial_value=static_cast<T>(0));
        T output() const; // return average of data in buffer
        T output(T input); // add new value to buffer and return average

    private:
        std::array<T, N> m_data; // circular buffer containing samples
        size_t m_data_index; // index of oldest circular buffer element
        T m_sum; // sum of all elements in buffer
};

} // namespace filter

#include "filter/movingaverage.hh"

Document possibility of sum overflow in MovingAverage


#ifdef E_TYPEDEFS
#else
# ifndef E_SMART_RANDR_H
#  define E_SMART_RANDR_H

Evas_Object *e_smart_randr_add(Evas *evas);
void e_smart_randr_layout_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
void e_smart_randr_current_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
void e_smart_randr_monitors_create(Evas_Object *obj);
void e_smart_randr_monitor_add(Evas_Object *obj, Evas_Object *mon);
void e_smart_randr_monitor_del(Evas_Object *obj, Evas_Object *mon);
Eina_List *e_smart_randr_monitors_get(Evas_Object *obj);
Eina_Bool e_smart_randr_changed_get(Evas_Object *obj);
void e_smart_randr_changes_apply(Evas_Object *obj, Ecore_X_Window root);

# endif
#endif

#ifdef E_TYPEDEFS
#else
# ifndef E_SMART_RANDR_H
#  define E_SMART_RANDR_H

Evas_Object *e_smart_randr_add(Evas *evas);
void e_smart_randr_layout_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h);
void e_smart_randr_current_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
void e_smart_randr_monitors_create(Evas_Object *obj);
void e_smart_randr_monitor_add(Evas_Object *obj, Evas_Object *mon);
void e_smart_randr_monitor_del(Evas_Object *obj, Evas_Object *mon);
Eina_List *e_smart_randr_monitors_get(Evas_Object *obj);
Eina_Bool e_smart_randr_changed_get(Evas_Object *obj);
void e_smart_randr_changes_apply(Evas_Object *obj);

# endif
#endif

Remove root window as a function paramater (not used anymore).

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 81262


#ifndef SSPAPPLICATION_CORE_SYSTEM_H
#define SSPAPPLICATION_CORE_SYSTEM_H
#include <SDL.h>
#include <SDL_syswm.h>
#include <iostream>
#include "../GraphicsDLL/GraphicsHandler.h"
#include "../GraphicsDLL/Camera.h"
#include "InputHandler.h"
#include "../physicsDLL/physicsDLL/PhysicsHandler.h"
#pragma comment (lib, "../Debug/PhysicsDLL")

const int SCREEN_WIDTH = 1280;
const int SCREEN_HEIGHT = 720;
class System
{
private:
	bool m_fullscreen;
	bool m_running;
	//The glorious window handle for the sdl window
	HWND m_hwnd;
	HINSTANCE m_hinstance;
	LPCWSTR m_applicationName;
	//This is the window we render to
	SDL_Window* m_window;

	Camera* m_camera;
	//These are the subsystems
	GraphicsHandler* m_graphicsHandler;
	InputHandler* m_inputHandler;
	//this is a physicsHandler
	PhysicsHandler m_physicsHandler;
public:
	System();
	~System();
	int Shutdown();

	int Initialize();
	//Do not place things here without talking to the system designers. Place any update method in the System::Update(float dt) method
	int Run();
	int Update(float deltaTime);

private:
	int HandleEvents();
	int FullscreenToggle();
};

#endif

#ifndef SSPAPPLICATION_CORE_SYSTEM_H
#define SSPAPPLICATION_CORE_SYSTEM_H
#include <SDL.h>
#include <SDL_syswm.h>
#include <iostream>
#include "../GraphicsDLL/GraphicsHandler.h"
#include "../GraphicsDLL/Camera.h"
#include "InputHandler.h"
#include "../physicsDLL/PhysicsHandler.h"
#pragma comment (lib, "../Debug/PhysicsDLL")

const int SCREEN_WIDTH = 1280;
const int SCREEN_HEIGHT = 720;
class System
{
private:
	bool m_fullscreen;
	bool m_running;
	//The glorious window handle for the sdl window
	HWND m_hwnd;
	HINSTANCE m_hinstance;
	LPCWSTR m_applicationName;
	//This is the window we render to
	SDL_Window* m_window;

	Camera* m_camera;
	//These are the subsystems
	GraphicsHandler* m_graphicsHandler;
	InputHandler* m_inputHandler;
	//this is a physicsHandler
	PhysicsHandler m_physicsHandler;
public:
	System();
	~System();
	int Shutdown();

	int Initialize();
	//Do not place things here without talking to the system designers. Place any update method in the System::Update(float dt) method
	int Run();
	int Update(float deltaTime);

private:
	int HandleEvents();
	int FullscreenToggle();
};

#endif

FIX physicsDLL include path FOR DLL to work


#import <UIKit/UIKit.h>

@protocol NBNPhotoChooserViewControllerDelegate;

@interface NBNPhotoChooserViewController : UIViewController

- (instancetype)initWithDelegate:(id<NBNPhotoChooserViewControllerDelegate>)delegate;
- (instancetype)initWithDelegate:(id<NBNPhotoChooserViewControllerDelegate>)delegate
                     maxCellWidth:(CGFloat)maxCellWidth
                     cellSpacing:(CGFloat)cellSpacing;

@property (nonatomic) NSString *navigationBarTitle;
@property (nonatomic) NSString *cancelButtonTitle;
@property (nonatomic) BOOL shouldAnimateImagePickerTransition;

@end

@protocol NBNPhotoChooserViewControllerDelegate <NSObject>

- (void)photoChooserController:(NBNPhotoChooserViewController *)photoChooser didChooseImage:(UIImage *)image;
- (void)photoChooserDidCancel:(NBNPhotoChooserViewController *)photoChooser;

@end

#import <UIKit/UIKit.h>

@protocol NBNPhotoChooserViewControllerDelegate;

@interface NBNPhotoChooserViewController : UIViewController

- (instancetype)initWithDelegate:(id<NBNPhotoChooserViewControllerDelegate>)delegate;
- (instancetype)initWithDelegate:(id<NBNPhotoChooserViewControllerDelegate>)delegate
                     maxCellWidth:(CGFloat)maxCellWidth
                     cellSpacing:(CGFloat)cellSpacing;

@property (nonatomic) NSString *navigationBarTitle;
@property (nonatomic) NSString *cancelButtonTitle;
@property (nonatomic) BOOL shouldAnimateImagePickerTransition;

@end

@protocol NBNPhotoChooserViewControllerDelegate <NSObject>

- (void)photoChooserController:(NBNPhotoChooserViewController *)photoChooser didChooseImage:(UIImage *)image;

@optional
- (void)photoChooserDidCancel:(NBNPhotoChooserViewController *)photoChooser;

@end

Make delegate method optional (cancellation is handled automatically when using UINavigationController)


/**
 *
 * Authors:
 *   Tim Dwyer <tgdwyer@gmail.com>
 *
 * Copyright (C) 2005 Authors
 *
 * This version is released under the CPL (Common Public License) with
 * the Graphviz distribution.
 * A version is also available under the LGPL as part of the Adaptagrams
 * project: http://sourceforge.net/projects/adaptagrams.
 * If you make improvements or bug fixes to this code it would be much
 * appreciated if you could also contribute those changes back to the
 * Adaptagrams repository.
 */
#ifndef SEEN_REMOVEOVERLAP_VARIABLE_H
#define SEEN_REMOVEOVERLAP_VARIABLE_H

#include <vector>
#include <iostream>
class Block;
class Constraint;
#include "block.h"

typedef std::vector<Constraint*> Constraints;
class Variable
{
	friend std::ostream& operator <<(std::ostream &os, const Variable &v);
public:
	const int id; // useful in log files
	double desiredPosition;
	const double weight;
	double offset;
	Block *block;
	bool visited;
	Constraints in;
	Constraints out;
	char *toString();
	inline Variable(const int id, const double desiredPos, const double weight)
		: id(id)
		, desiredPosition(desiredPos)
		, weight(weight)
		, offset(0)
		, visited(false)
	{
	}
	inline double Variable::position() const {
		return block->posn+offset;
	}
	//double position() const;
	~Variable(void){
		in.clear();
		out.clear();
	}
};
#endif // SEEN_REMOVEOVERLAP_VARIABLE_H

Add the vpsc library for IPSEPCOLA features


#import <CareKit/CareKit.h>

typedef void(^CMHCareSaveCompletion)(NSString *_Nullable uploadStatus, NSError *_Nullable error);

@interface OCKCarePlanEvent (CMHealth)

@property (nonatomic, nonnull, readonly) NSString *cmh_objectId;
- (void)cmh_saveWithCompletion:(_Nullable CMHCareSaveCompletion)block;

@end

#import <CareKit/CareKit.h>

typedef void(^CMHCareSaveCompletion)(NSString *_Nullable uploadStatus, NSError *_Nullable error);

/**
 *  This category adds properties and methods to the `OCKCarePlanEvent` class which
 *  allow instances to be identified uniquely and saved to CloudMine's
 *  HIPAA compliant Connected Health Cloud.
 */
@interface OCKCarePlanEvent (CMHealth)

/**
 *  The unique identifier  assigned to this event based on its `OCKCarePlanActivity`
 *  identifier, its schedule, and its days since start.
 *
 *  @warning the CareKit component of this SDK is experimental and subject to change. Your
 *  feedback is welcomed!
 */
@property (nonatomic, nonnull, readonly) NSString *cmh_objectId;

/**
 *  Save a representation of this `OCKCarePlanEvent` isntance to CloudMine.
 *  The event is given a unique identifier based on its `OCKCarePlanActivity` identifier,
 *  its schedule, and its days since start. Saving an event multiple times will update
 *  the instance of that event on CloudMine. The callback will provide a string value
 *  of `created` or `updated` if the operation was successful.
 *
 *  @warning the CareKit component of this SDK is experimental and subject to change. Your
 *  feedback is welcomed!
 *
 *  @param block Executes when the request completes successfully or fails with an error.
 */
- (void)cmh_saveWithCompletion:(_Nullable CMHCareSaveCompletion)block;

@end

Add appledoc header comments to the 'OCKCarePlanEvent' class


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

#include "supervisor/board.h"

void board_init(void) {
}

bool board_requests_safe_mode(void) {
    return false;
}

void reset_board(void) {

}

void board_deinit(void) {
}

Add new line for pre-commit

Add new line for pre-commit


#include <windows.h>
#include "CroquetPlugin.h"

static int loaded = 0;
static HMODULE hAdvApi32 = NULL;
static BOOLEAN (*RtlGenRandom)(PVOID, ULONG) = NULL;

int ioGatherEntropy(char *bufPtr, int bufSize) {
  if(!loaded) {
    loaded = 1;
    hAdvApi32 = LoadLibrary("advapi32.dll");
    (void*)RtlGenRandom = GetProcAddress(hAdvApi32, "SystemFunction036");
  }
  if(!RtlGenRandom) return 0;
  return RtlGenRandom(bufPtr, bufSize);
}

Add Win32 specific code for CroquetPlugin.

git-svn-id: f18ccec24f938f15aa42574278fe0cc52f637e81@1398 fa1542d4-bde8-0310-ad64-8ed1123d492a


/*
 *  linux/fs/ext3/bitmap.c
 *
 * Copyright (C) 1992, 1993, 1994, 1995
 * Remy Card (card@masi.ibp.fr)
 * Laboratoire MASI - Institut Blaise Pascal
 * Universite Pierre et Marie Curie (Paris VI)
 */

#ifdef EXT3FS_DEBUG

#include <linux/buffer_head.h>

#include "ext3_fs.h"

static int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};

unsigned long ext3_count_free (struct buffer_head * map, unsigned int numchars)
{
	unsigned int i;
	unsigned long sum = 0;

	if (!map)
		return (0);
	for (i = 0; i < numchars; i++)
		sum += nibblemap[map->b_data[i] & 0xf] +
			nibblemap[(map->b_data[i] >> 4) & 0xf];
	return (sum);
}

#endif  /*  EXT3FS_DEBUG  */

/*
 *  linux/fs/ext3/bitmap.c
 *
 * Copyright (C) 1992, 1993, 1994, 1995
 * Remy Card (card@masi.ibp.fr)
 * Laboratoire MASI - Institut Blaise Pascal
 * Universite Pierre et Marie Curie (Paris VI)
 */

#include <linux/buffer_head.h>
#include <linux/jbd.h>
#include <linux/ext3_fs.h>

#ifdef EXT3FS_DEBUG

static int nibblemap[] = {4, 3, 3, 2, 3, 2, 2, 1, 3, 2, 2, 1, 2, 1, 1, 0};

unsigned long ext3_count_free (struct buffer_head * map, unsigned int numchars)
{
	unsigned int i;
	unsigned long sum = 0;

	if (!map)
		return (0);
	for (i = 0; i < numchars; i++)
		sum += nibblemap[map->b_data[i] & 0xf] +
			nibblemap[(map->b_data[i] >> 4) & 0xf];
	return (sum);
}

#endif  /*  EXT3FS_DEBUG  */

[PATCH] ext3: Fix debug logging-only compilation error

When EXT3FS_DEBUG is #define-d, the compile breaks due to #include file
issues.

Signed-off-by: Kirk True <c65a0fb7e74ffd2c9fc3a0f9aacb0f6a24b0a68b@kirkandsheila.com>
Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org>
Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@osdl.org>


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

#ifndef UI_GFX_FAVICON_SIZE_H_
#define UI_GFX_FAVICON_SIZE_H_
#pragma once

namespace gfx {

// Size (along each axis) of the favicon.
extern const int kFaviconSize;

// If the width or height is bigger than the favicon size, a new width/height
// is calculated and returned in width/height that maintains the aspect
// ratio of the supplied values.
void CalculateFaviconTargetSize(int* width, int* height);

}  // namespace gfx

#endif  // UI_GFX_FAVICON_SIZE_H_

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

#ifndef UI_GFX_FAVICON_SIZE_H_
#define UI_GFX_FAVICON_SIZE_H_
#pragma once

#include "ui/base/ui_export.h"

namespace gfx {

// Size (along each axis) of the favicon.
UI_EXPORT extern const int kFaviconSize;

// If the width or height is bigger than the favicon size, a new width/height
// is calculated and returned in width/height that maintains the aspect
// ratio of the supplied values.
UI_EXPORT void CalculateFaviconTargetSize(int* width, int* height);

}  // namespace gfx

#endif  // UI_GFX_FAVICON_SIZE_H_

ui/gfx: Fix Linux shared build by adding missing UI_EXPORT annotations.

TBR=sky@chromium.org

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

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