// This file is distributed under the MIT license.
// See the LICENSE file for details.

#pragma once

#ifndef VSNRAY_DETAIL_SPD_BLACKBODY_H
#define VSNRAY_DETAIL_SPD_BLACKBODY_H 1

#include <cmath>

#include "../macros.h"

namespace visionaray
{

//-------------------------------------------------------------------------------------------------
// Spectral power distribution for blackbody radiator
// See: http://www.spectralcalc.com/blackbody/units_of_wavelength.html
// Color temperature in Kelvin, sample SPD with wavelength (nm)
//

struct blackbody
{
    blackbody(float T = 1500.0) : T(T) {}

    VSNRAY_FUNC float operator()(float lambda /* nm */) const
    {
        double const k = 1.3806488E-23;
        double const h = 6.62606957E-34;
        double const c = 2.99792458E8;

        lambda *= 1E-3; // nm to microns

        return ( ( 2.0 * 1E24 * h * c * c ) / pow(lambda, 5.0) )
             * ( 1.0 / (exp((1E6 * h * c) / (lambda * k * T)) - 1.0) );
    }

private:

    double T;

};

} // visionaray

#endif // VSNRAY_DETAIL_SPD_BLACKBODY_H

// This file is distributed under the MIT license.
// See the LICENSE file for details.

#pragma once

#ifndef VSNRAY_DETAIL_SPD_BLACKBODY_H
#define VSNRAY_DETAIL_SPD_BLACKBODY_H 1

#include <cmath>

#include "../macros.h"

namespace visionaray
{

//-------------------------------------------------------------------------------------------------
// Spectral power distribution for blackbody radiator
// See: http://www.spectralcalc.com/blackbody/units_of_wavelength.html
// Color temperature in Kelvin, sample SPD with wavelength (nm)
//

class blackbody
{
public:

    blackbody(float T = 1500.0) : T(T) {}

    VSNRAY_FUNC float operator()(float lambda /* nm */) const
    {
        double const k = 1.3806488E-23;
        double const h = 6.62606957E-34;
        double const c = 2.99792458E8;

        lambda *= 1E-3; // nm to microns

        return ( ( 2.0 * 1E24 * h * c * c ) / pow(lambda, 5.0) )
             * ( 1.0 / (exp((1E6 * h * c) / (lambda * k * T)) - 1.0) );
    }

private:

    double T;

};

} // visionaray

#endif // VSNRAY_DETAIL_SPD_BLACKBODY_H

Use class for non-trivial types

Use class for non-trivial types


//
// Copyright (c) 2018 The nanoFramework project contributors
// Portions Copyright (c) Microsoft Corporation.  All rights reserved.
// See LICENSE file in the project root for full license information.
//

#ifndef _NF_NETWORKING_SNTP_H_
#define _NF_NETWORKING_SNTP_H_

#include <nanoCLR_Interop.h>
#include <nanoCLR_Runtime.h>
#include <nanoCLR_Checks.h>
#include <nanoHAL_time.h>

extern "C"
{
#include <apps/sntp.h>
}

struct Library_nf_networking_sntp_nanoFramework_Networking_Sntp
{
    NANOCLR_NATIVE_DECLARE(Start___STATIC__VOID);
    NANOCLR_NATIVE_DECLARE(Stop___STATIC__VOID);
    NANOCLR_NATIVE_DECLARE(UpdateNow___STATIC__VOID);
    NANOCLR_NATIVE_DECLARE(get_IsStarted___STATIC__BOOLEAN);
    NANOCLR_NATIVE_DECLARE(get_Server1___STATIC__STRING);
    NANOCLR_NATIVE_DECLARE(set_Server1___STATIC__VOID__STRING);
    NANOCLR_NATIVE_DECLARE(get_Server2___STATIC__STRING);
    NANOCLR_NATIVE_DECLARE(set_Server2___STATIC__VOID__STRING);

    //--//

};

extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Networking_Sntp;

#endif  //_NF_NETWORKING_SNTP_H_

//
// Copyright (c) 2018 The nanoFramework project contributors
// Portions Copyright (c) Microsoft Corporation.  All rights reserved.
// See LICENSE file in the project root for full license information.
//

#ifndef _NF_NETWORKING_SNTP_H_
#define _NF_NETWORKING_SNTP_H_

#include <nanoCLR_Interop.h>
#include <nanoCLR_Runtime.h>
#include <nanoCLR_Checks.h>
#include <nanoHAL_time.h>

extern "C"
{
#ifndef PLATFORM_ESP32
#include <apps/sntp.h>
#else
#include <apps/sntp/sntp.h>
#endif
}

struct Library_nf_networking_sntp_nanoFramework_Networking_Sntp
{
    NANOCLR_NATIVE_DECLARE(Start___STATIC__VOID);
    NANOCLR_NATIVE_DECLARE(Stop___STATIC__VOID);
    NANOCLR_NATIVE_DECLARE(UpdateNow___STATIC__VOID);
    NANOCLR_NATIVE_DECLARE(get_IsStarted___STATIC__BOOLEAN);
    NANOCLR_NATIVE_DECLARE(get_Server1___STATIC__STRING);
    NANOCLR_NATIVE_DECLARE(set_Server1___STATIC__VOID__STRING);
    NANOCLR_NATIVE_DECLARE(get_Server2___STATIC__STRING);
    NANOCLR_NATIVE_DECLARE(set_Server2___STATIC__VOID__STRING);

    //--//

};

extern const CLR_RT_NativeAssemblyData g_CLR_AssemblyNative_nanoFramework_Networking_Sntp;

#endif  //_NF_NETWORKING_SNTP_H_

Fix headers so SNTP builds on Esp32

Fix headers so SNTP builds on Esp32


//===- llvm/Transforms/Instrumentation/TraceValues.h - Tracing ---*- C++ -*--=//
//
// Support for inserting LLVM code to print values at basic block and method
// exits.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H
#define LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H

#include "llvm/Pass.h"

class InsertTraceCode : public Pass {
  bool TraceBasicBlockExits, TraceMethodExits;
public:
  InsertTraceCode(bool traceBasicBlockExits, bool traceMethodExits)
    : TraceBasicBlockExits(traceBasicBlockExits),
      TraceMethodExits(traceMethodExits) {}

  //--------------------------------------------------------------------------
  // Function InsertCodeToTraceValues
  //
  // Inserts tracing code for all live values at basic block and/or method exits
  // as specified by `traceBasicBlockExits' and `traceMethodExits'.
  //
  static bool doInsertTraceCode(Method *M, bool traceBasicBlockExits,
                                bool traceMethodExits);

  // doPerMethodWork - This method does the work.  Always successful.
  //
  bool doPerMethodWork(Method *M) {
    return doInsertTraceCode(M, TraceBasicBlockExits, TraceMethodExits);
  }
};

#endif /*LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H*/

//===- llvm/Transforms/Instrumentation/TraceValues.h - Tracing ---*- C++ -*--=//
//
// Support for inserting LLVM code to print values at basic block and method
// exits.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H
#define LLVM_TRANSFORMS_INSTRUMENTATION_TRACEVALUES_H

#include "llvm/Pass.h"
class Method;

class InsertTraceCode : public Pass {
  bool TraceBasicBlockExits, TraceMethodExits;
  Method *PrintfMeth;
public:
  InsertTraceCode(bool traceBasicBlockExits, bool traceMethodExits)
    : TraceBasicBlockExits(traceBasicBlockExits),
      TraceMethodExits(traceMethodExits) {}

  // Add a prototype for printf if it is not already in the program.
  //
  bool doPassInitialization(Module *M);

  //--------------------------------------------------------------------------
  // Function InsertCodeToTraceValues
  //
  // Inserts tracing code for all live values at basic block and/or method exits
  // as specified by `traceBasicBlockExits' and `traceMethodExits'.
  //
  static bool doit(Method *M, bool traceBasicBlockExits,
                   bool traceMethodExits, Method *Printf);

  // doPerMethodWork - This method does the work.  Always successful.
  //
  bool doPerMethodWork(Method *M) {
    return doit(M, TraceBasicBlockExits, TraceMethodExits, PrintfMeth);
  }
};

#endif

Refactor trace values to work as a proper pass.  Before it used to add
methods while the pass was running which was a no no.  Now it adds the
printf method at pass initialization

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


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

#include <string>
#include <vector>

// TODO(darin): Remove once this #include has been upstreamed to ImageDiff.cpp.
// ImageDiff.cpp expects that PATH_MAX has already been defined :-/
#include <limits.h>

namespace webkit_support {

// Decode a PNG into an RGBA pixel array.
bool DecodePNG(const unsigned char* input, size_t input_size,
               std::vector<unsigned char>* output,
               int* width, int* height);

// Encode an RGBA pixel array into a PNG.
bool EncodeRGBAPNG(const unsigned char* input,
                   int width,
                   int height,
                   int row_byte_width,
                   std::vector<unsigned char>* output);

// Encode an BGRA pixel array into a PNG.
bool EncodeBGRAPNG(const unsigned char* input,
                   int width,
                   int height,
                   int row_byte_width,
                   bool discard_transparency,
                   std::vector<unsigned char>* output);

bool EncodeBGRAPNGWithChecksum(const unsigned char* input,
                               int width,
                               int height,
                               int row_byte_width,
                               bool discard_transparency,
                               const std::string& checksum,
                               std::vector<unsigned char>* output);

}  // namespace webkit_support

#endif  // WEBKIT_SUPPORT_WEBKIT_SUPPORT_GFX_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 WEBKIT_SUPPORT_WEBKIT_SUPPORT_GFX_H_
#define WEBKIT_SUPPORT_WEBKIT_SUPPORT_GFX_H_

#include <string>
#include <vector>

namespace webkit_support {

// Decode a PNG into an RGBA pixel array.
bool DecodePNG(const unsigned char* input, size_t input_size,
               std::vector<unsigned char>* output,
               int* width, int* height);

// Encode an RGBA pixel array into a PNG.
bool EncodeRGBAPNG(const unsigned char* input,
                   int width,
                   int height,
                   int row_byte_width,
                   std::vector<unsigned char>* output);

// Encode an BGRA pixel array into a PNG.
bool EncodeBGRAPNG(const unsigned char* input,
                   int width,
                   int height,
                   int row_byte_width,
                   bool discard_transparency,
                   std::vector<unsigned char>* output);

bool EncodeBGRAPNGWithChecksum(const unsigned char* input,
                               int width,
                               int height,
                               int row_byte_width,
                               bool discard_transparency,
                               const std::string& checksum,
                               std::vector<unsigned char>* output);

}  // namespace webkit_support

#endif  // WEBKIT_SUPPORT_WEBKIT_SUPPORT_GFX_H_

Remove an include which has been upstreamed to ImageDiff.cpp.

BUG=none
TEST=none

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

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


// RUN: %clang_cc1 -triple arm-unknown-unknown -target-abi apcs-gnu -fsyntax-only -verify %s

struct s0 { double f0; int f1; };
char chk0[__alignof__(struct s0) == 4 ? 1 : -1];

double g1;
short chk1[__alignof__(g1) == 4 ? 1 : -1];
short chk2[__alignof__(double) == 4 ? 1 : -1];

long long g2;
short chk1[__alignof__(g2) == 4 ? 1 : -1];
short chk2[__alignof__(long long) == 4 ? 1 : -1];

_Complex double g3;
short chk1[__alignof__(g3) == 4 ? 1 : -1];
short chk2[__alignof__(_Complex double) == 4 ? 1 : -1];

Fix r135934.  Rename was intended, but without additional tests for double.

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


// REQUIRES: x86-registered-target
// RUN: %clang -target i386-unknown-linux -masm=intel %s -S -o - | FileCheck --check-prefix=CHECK-INTEL %s
// RUN: %clang -target i386-unknown-linux -masm=att %s -S -o - | FileCheck --check-prefix=CHECK-ATT %s
// RUN: not %clang -target i386-unknown-linux -masm=somerequired %s -S -o - 2>&1 | FileCheck --check-prefix=CHECK-SOMEREQUIRED %s
// REQUIRES: arm-registered-target
// RUN: %clang -target arm-unknown-eabi -masm=intel %s -S -o - 2>&1 | FileCheck --check-prefix=CHECK-ARM %s

int f() {
// CHECK-ATT: movl      $0, %eax
// CHECK-INTEL: mov     eax, 0
// CHECK-SOMEREQUIRED: error: unsupported argument 'somerequired' to option 'masm='
// CHECK-ARM: warning: argument unused during compilation: '-masm=intel'
  return 0;
}

// RUN: %clang -target i386-unknown-linux -masm=intel -S %s -### 2>&1 | FileCheck --check-prefix=CHECK-INTEL %s
// RUN: %clang -target i386-unknown-linux -masm=att -S %s -### 2>&1 | FileCheck --check-prefix=CHECK-ATT %s
// RUN: %clang -target i386-unknown-linux -S -masm=somerequired %s -### 2>&1 | FileCheck --check-prefix=CHECK-SOMEREQUIRED %s
// RUN: %clang -target arm-unknown-eabi -S -masm=intel %s -### 2>&1 | FileCheck --check-prefix=CHECK-ARM %s

int f() {
// CHECK-INTEL: -x86-asm-syntax=intel
// CHECK-ATT: -x86-asm-syntax=att
// CHECK-SOMEREQUIRED: error: unsupported argument 'somerequired' to option 'masm='
// CHECK-ARM: warning: argument unused during compilation: '-masm=intel'
  return 0;
}

Make this test target independent.

Make this test target independent.

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


#ifndef PYTHON_THREADS
#define PYTHON_THREADS

#ifdef __EMSCRIPTEN__

static inline void init_python_threads() { }

#else

#include "Python.h"

static inline void init_python_threads() { PyEval_InitThreads(); }

#endif

#endif

#ifndef PYTHON_THREADS
#define PYTHON_THREADS

#ifdef __EMSCRIPTEN__

static inline void init_python_threads(void) { }

#else

#include "Python.h"

static inline void init_python_threads(void) { PyEval_InitThreads(); }

#endif

#endif

Add prototype to prevent warning.

Add prototype to prevent warning.


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

#include "sky/shell/platform_view.h"

struct ANativeWindow;

namespace sky {
namespace shell {

class PlatformViewAndroid : public PlatformView {
 public:
  static bool Register(JNIEnv* env);
  ~PlatformViewAndroid() override;

  // Called from Java
  void Detach(JNIEnv* env, jobject obj);
  void SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface);
  void SurfaceDestroyed(JNIEnv* env, jobject obj);

 private:
  void ReleaseWindow();

  ANativeWindow* window_;

  DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid);
};

}  // namespace shell
}  // namespace sky

#endif  // SKY_SHELL_PLATFORM_VIEW_ANDROID_H_

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

#include "sky/shell/platform_view.h"

struct ANativeWindow;

namespace sky {
namespace shell {

class PlatformViewAndroid : public PlatformView {
 public:
  static bool Register(JNIEnv* env);
  ~PlatformViewAndroid() override;

  // Called from Java
  void Detach(JNIEnv* env, jobject obj);
  void SurfaceCreated(JNIEnv* env, jobject obj, jobject jsurface);
  void SurfaceDestroyed(JNIEnv* env, jobject obj);

 private:
  void ReleaseWindow();

  DISALLOW_COPY_AND_ASSIGN(PlatformViewAndroid);
};

}  // namespace shell
}  // namespace sky

#endif  // SKY_SHELL_PLATFORM_VIEW_ANDROID_H_

Stop SkyShell from crashing on startup

Stop SkyShell from crashing on startup

R=chinmaygarde@google.com

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


#ifndef LIBOPENSPOTIFY_BROWSE_H
#define LIBOPENSPOTIFY_BROWSE_H

#include "buf.h"
#include "sp_opaque.h"

#define BROWSE_RETRY_TIMEOUT	30

int browse_process(sp_session *session, struct request *req);

#endif

#ifndef LIBOPENSPOTIFY_BROWSE_H
#define LIBOPENSPOTIFY_BROWSE_H

#include <spotify/api.h>

#include "buf.h"
#include "request.h"

#define BROWSE_RETRY_TIMEOUT	30

int browse_process(sp_session *session, struct request *req);

#endif

Include spotify/api.h and request.h instead of sp_opaque.h


// PARAM: --sets solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','octApron']"
// Example from https://github.com/sosy-lab/sv-benchmarks/blob/master/c/bitvector-regression/signextension-1.c
#include "stdio.h"
#include <assert.h>
int main() {
  // This test is a part taken from of 24 13
  unsigned short int allbits = -1;
  short int signedallbits = allbits;
  int signedtosigned = signedallbits;

  assert(allbits == 65535);
  assert(signedallbits == -1);
  assert(signedtosigned == -1);

  if (signedtosigned == -1) {
    assert(1);
  }

  return (0);
}

Add a test for octagon

Add a test for octagon


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

#ifndef	LOADER_H
#define	LOADER_H

#include "bool.h"

bool load(const char * fileName);

#endif	/* LOADER_H */

/*
 * Written by Scott Bennett.
 * Public domain.
 */

#ifndef	LOADER_H
#define	LOADER_H

#include "bool.h"

bool load(const char * fileName);

#endif	/* LOADER_H */

Move this file into public domain; it's too simple to copyright...


// Ensure compatiblity of UBSan unreachable with ASan in the presence of
// noreturn functions
// RUN: %clang -O2 -fsanitize=address,unreachable %s -emit-llvm -S -o - | FileCheck %s
// REQUIRES: ubsan-asan

void bar(void) __attribute__((noreturn));

void foo() {
  bar();
}
// CHECK-LABEL: define void @foo()
// CHECK:       call void @__asan_handle_no_return
// CHECK-NEXT:  call void @bar
// CHECK-NEXT:  call void @__asan_handle_no_return
// CHECK-NEXT:  call void @__ubsan_handle_builtin_unreachable
// CHECK-NEXT:  unreachable

// Ensure compatiblity of UBSan unreachable with ASan in the presence of
// noreturn functions
// RUN: %clang -O2 -fPIC -fsanitize=address,unreachable %s -emit-llvm -S -o - | FileCheck %s
// REQUIRES: ubsan-asan

void bar(void) __attribute__((noreturn));

void foo() {
  bar();
}
// CHECK-LABEL: define void @foo()
// CHECK:       call void @__asan_handle_no_return
// CHECK-NEXT:  call void @bar
// CHECK-NEXT:  call void @__asan_handle_no_return
// CHECK-NEXT:  call void @__ubsan_handle_builtin_unreachable
// CHECK-NEXT:  unreachable

[ubsan] Fix test when isPICDefault() returns false after rCTE352003

git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@352013 91177308-0d34-0410-b5e6-96231b3b80d8


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

NSString *NSStringFromSPTPersistentCacheResponseCode(SPTPersistentCacheResponseCode code);

@interface SPTPersistentCacheResponse (Private)

- (instancetype)initWithResult:(SPTPersistentCacheResponseCode)result
                         error:(NSError *)error
                        record:(SPTPersistentCacheRecord *)record;

@end

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

extern NSString *NSStringFromSPTPersistentCacheResponseCode(SPTPersistentCacheResponseCode code);

@interface SPTPersistentCacheResponse (Private)

- (instancetype)initWithResult:(SPTPersistentCacheResponseCode)result
                         error:(NSError *)error
                        record:(SPTPersistentCacheRecord *)record;

@end

Add missing 'extern' when declaring NSStringFromSPTPersistentCacheResponseCode in header


/*
 * simulator.h - interface for simulator
 * Copyright 2018 MIPT-MIPS
 */

#ifndef SIMULATOR_H
#define SIMULATOR_H

#include <memory.h>

#include <infra/types.h>
#include <infra/log.h>

class Simulator : public Log {
public:
    Simulator( bool log = false) : Log( log) {}

    virtual void run(const std::string& tr, uint64 instrs_to_run) = 0;

    static std::unique_ptr<Simulator> create_simulator(const std::string& isa, bool functional_only, bool log);
};

#endif // SIMULATOR_H

/*
 * simulator.h - interface for simulator
 * Copyright 2018 MIPT-MIPS
 */

#ifndef SIMULATOR_H
#define SIMULATOR_H

#include <memory.h>

#include <infra/types.h>
#include <infra/log.h>

class Simulator : public Log {
public:
    explicit Simulator( bool log = false) : Log( log) {}

    virtual void run(const std::string& tr, uint64 instrs_to_run) = 0;

    static std::unique_ptr<Simulator> create_simulator(const std::string& isa, bool functional_only, bool log);
};

#endif // SIMULATOR_H

Add explicit specifier to Simulator ctor


/*
 * Copyright (c) 1993 Adam Glass
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by Adam Glass.
 * 4. The name of the Author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY Adam Glass ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	from: NetBSD: idprom.h,v 1.2 1998/09/05 23:57:26 eeh Exp
 *
 * $FreeBSD$
 */

#ifndef _MACHINE_IDPROM_H_
#define _MACHINE_IDPROM_H_

/*
 * ID prom format.  The ``host id'' is set up by taking the machine
 * ID as the top byte and the hostid field as the remaining three.
 * The id_xxx0 field appears to contain some other number.  The id_xxx1
 * contains a bunch of 00's and a5's on my machines, suggesting it is
 * not actually used.  The checksum seems to include them, however.
 */
struct idprom {
	u_char	id_format;		/* format identifier (= 1) */
	u_char	id_machine;		/* machine type (see param.h) */
	u_char	id_ether[6];		/* ethernet address */
	int	id_date;		/* date of manufacture */
	u_char	id_hostid[3];		/* ``host id'' bytes */
	u_char	id_checksum;		/* xor of everything else */
	char	id_undef[16];		/* undefined */
};

#define ID_SUN4_100	0x22
#define ID_SUN4_200	0x21
#define ID_SUN4_300	0x23
#define ID_SUN4_400	0x24

#define IDPROM_VERSION 1

#endif /* !_MACHINE_IDPROM_H_ */

Add a structure defintion for the id prom contents.

Obtained from:	NetBSD


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

static const char HEX[] = {
    '0', '1', '2', '3',
    '4', '5', '6', '7',
    '8', '9', 'A', 'B',
    'C', 'D', 'E', 'F',
};

void byteToHex(char byte, char* output) {
    output[0] = HEX[(byte >> 4) & 0x0F];
    output[1] = HEX[byte & 0x0F];
}

void dumpMemoryAsHex(char* data, char* dataEnd, int count) {
    static char hexbuff[2];
    int i = 0;
    while(i < count) {
        if(&data[i] >= dataEnd)
            break;
        byteToHex(data[i++], hexbuff);
        printf("%s ", hexbuff);
    }

    /* Print padding */
    for( ; i < count; i++) {
        printf(".. ");
    }
}

void dumpMemoryAsASCII(char* data, char* dataEnd, int count) {
    int i = 0;
    while(i < count) {
        char c;

        if(&data[i] >= dataEnd)
            break;

        c = data[i++];
        printf("%c", (c < ' ' || c == (char)(127)) ? '.' : c);
    }

    /* Print padding */
    for( ; i < count; i++) {
        printf(".");
    }
}

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

static const char HEX[] = {
    '0', '1', '2', '3',
    '4', '5', '6', '7',
    '8', '9', 'A', 'B',
    'C', 'D', 'E', 'F',
};

void byteToHex(char byte, char* output) {
    output[0] = HEX[(byte >> 4) & 0x0F];
    output[1] = HEX[byte & 0x0F];
}

void dumpMemoryAsHex(char* data, char* dataEnd, int count) {
    static char hexbuff[3] = {0, 0, 0};
    int i = 0;
    while(i < count) {
        if(&data[i] >= dataEnd)
            break;
        byteToHex(data[i++], hexbuff);
        printf("%s ", hexbuff);
    }

    /* Print padding */
    for( ; i < count; i++) {
        printf(".. ");
    }
}

void dumpMemoryAsASCII(char* data, char* dataEnd, int count) {
    int i = 0;
    while(i < count) {
        char c;

        if(&data[i] >= dataEnd)
            break;

        c = data[i++];
        printf("%c", (c < ' ' || c == (char)(127)) ? '.' : c);
    }

    /* Print padding */
    for( ; i < count; i++) {
        printf(".");
    }
}

Make hex string buffer guarantee a null terminator


//===-- llvm/Support/ValueHolder.h - Wrapper for Value's --------*- C++ -*-===//
//
// This class defines a simple subclass of User, which keeps a pointer to a
// Value, which automatically updates when Value::replaceAllUsesWith is called.
// This is useful when you have pointers to Value's in your pass, but the
// pointers get invalidated when some other portion of the algorithm is
// replacing Values with other Values.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_SUPPORT_VALUEHOLDER_H
#define LLVM_SUPPORT_VALUEHOLDER_H

#include "llvm/User.h"

struct ValueHolder : public User {
  ValueHolder(Value *V = 0);

  // Getters...
  const Value *get() const { return getOperand(0); }
  operator const Value*() const { return getOperand(0); }
  Value *get() { return getOperand(0); }
  operator Value*() { return getOperand(0); }

  // Setters...
  const ValueHolder &operator=(Value *V) {
    setOperand(0, V);
    return *this;
  }

  virtual void print(std::ostream& OS) const {
    OS << "ValueHolder";
  }
};

#endif

//===-- llvm/Support/ValueHolder.h - Wrapper for Value's --------*- C++ -*-===//
//
// This class defines a simple subclass of User, which keeps a pointer to a
// Value, which automatically updates when Value::replaceAllUsesWith is called.
// This is useful when you have pointers to Value's in your pass, but the
// pointers get invalidated when some other portion of the algorithm is
// replacing Values with other Values.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_SUPPORT_VALUEHOLDER_H
#define LLVM_SUPPORT_VALUEHOLDER_H

#include "llvm/User.h"

struct ValueHolder : public User {
  ValueHolder(Value *V = 0);
  ValueHolder(const ValueHolder &VH) : User(VH.getType(), Value::TypeVal) {}

  // Getters...
  const Value *get() const { return getOperand(0); }
  operator const Value*() const { return getOperand(0); }
  Value *get() { return getOperand(0); }
  operator Value*() { return getOperand(0); }

  // Setters...
  const ValueHolder &operator=(Value *V) {
    setOperand(0, V);
    return *this;
  }

  const ValueHolder &operator=(ValueHolder &VH) {
    setOperand(0, VH);
    return *this;
  }

  virtual void print(std::ostream& OS) const {
    OS << "ValueHolder";
  }
};

#endif

Add more methods to be more value-like

Add more methods to be more value-like

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


/* GIO - GLib Input, Output and Streaming Library
 *
 * Copyright 2010 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, see
 * <http://www.gnu.org/licenses/>.
 */

#include "config.h"

#include <gio/gio.h>

#include "gtlsbackend-gnutls.h"
#include "gtlsbackend-gnutls-pkcs11.h"

void
g_io_module_load (GIOModule *module)
{
  g_tls_backend_gnutls_register (module);
  g_tls_backend_gnutls_pkcs11_register (module);
}

void
g_io_module_unload (GIOModule *module)
{
}

gchar **
g_io_module_query (void)
{
  gchar *eps[] = {
    G_TLS_BACKEND_EXTENSION_POINT_NAME,
    NULL
  };
  return g_strdupv (eps);
}

/* GIO - GLib Input, Output and Streaming Library
 *
 * Copyright 2010 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General
 * Public License along with this library; if not, see
 * <http://www.gnu.org/licenses/>.
 */

#include "config.h"

#include <gio/gio.h>

#include "gtlsbackend-gnutls.h"
#include "gtlsbackend-gnutls-pkcs11.h"

void
g_io_module_load (GIOModule *module)
{
  g_tls_backend_gnutls_register (module);
#ifdef HAVE_PKCS11
  g_tls_backend_gnutls_pkcs11_register (module);
#endif
}

void
g_io_module_unload (GIOModule *module)
{
}

gchar **
g_io_module_query (void)
{
  gchar *eps[] = {
    G_TLS_BACKEND_EXTENSION_POINT_NAME,
    NULL
  };
  return g_strdupv (eps);
}

gnutls: Fix unresolved symbol when pkcs11 is disabled

 * Error would occur: libgiognutls.so: undefined symbol: \
	g_tls_backend_gnutls_pkcs11_register


#ifndef NME_BYTE_ARRAY_H
#define NME_BYTE_ARRAY_H

#include <nme/Object.h>
#include <nme/QuickVec.h>
#include "Utils.h"

namespace nme
{

// If you put this structure on the stack, then you do not have to worry about GC.
// If you store this in a heap structure, then you will need to use GC roots for mValue...
struct ByteArray
{
   ByteArray(int inSize);
   ByteArray(const ByteArray &inRHS);
   ByteArray();
   ByteArray(struct _value *Value);
   ByteArray(const QuickVec<unsigned char>  &inValue);
   ByteArray(const char *inResourceName);

   void          Resize(int inSize);
   int           Size() const;
   unsigned char *Bytes();
   const unsigned char *Bytes() const;
   bool          Ok() { return mValue!=0; }

   struct _value *mValue;

   static ByteArray FromFile(const OSChar *inFilename);
   #ifdef HX_WINDOWS
   static ByteArray FromFile(const char *inFilename);
   #endif
};

#ifdef ANDROID
ByteArray AndroidGetAssetBytes(const char *);

struct FileInfo
{
   int fd;
   off_t offset;
   off_t length;
};

FileInfo AndroidGetAssetFD(const char *);
#endif

}

#endif

#ifndef NME_BYTE_ARRAY_H
#define NME_BYTE_ARRAY_H

#include <nme/Object.h>
#include <nme/QuickVec.h>
#include "Utils.h"
#include <hx/CFFI.h>

namespace nme
{

// If you put this structure on the stack, then you do not have to worry about GC.
// If you store this in a heap structure, then you will need to use GC roots for mValue...
struct ByteArray
{
   ByteArray(int inSize);
   ByteArray(const ByteArray &inRHS);
   ByteArray();
   ByteArray(value Value);
   ByteArray(const QuickVec<unsigned char>  &inValue);
   ByteArray(const char *inResourceName);

   void          Resize(int inSize);
   int           Size() const;
   unsigned char *Bytes();
   const unsigned char *Bytes() const;
   bool          Ok() { return mValue!=0; }

   value mValue;

   static ByteArray FromFile(const OSChar *inFilename);
   #ifdef HX_WINDOWS
   static ByteArray FromFile(const char *inFilename);
   #endif
};

#ifdef ANDROID
ByteArray AndroidGetAssetBytes(const char *);

struct FileInfo
{
   int fd;
   off_t offset;
   off_t length;
};

FileInfo AndroidGetAssetFD(const char *);
#endif

}

#endif

Use correct cffi type for 'value'

Use correct cffi type for 'value'


C $Header$
C $Name$

C CPP options file for GM/Redi package
C
C Use this file for selecting options within the GM/Redi package
C
#ifndef GMREDI_OPTIONS_H
#define GMREDI_OPTIONS_H
#include "PACKAGES_CONFIG.h"

#ifdef ALLOW_GMREDI

#include "CPP_OPTIONS.h"

C Designed to simplify the Ajoint code:
C  exclude the clipping/tapering part of the code that is not used
#define GM_EXCLUDE_CLIPPING
#define GM_EXCLUDE_AC02_TAP
#define GM_EXCLUDE_FM07_TAP
#undef GM_EXCLUDE_TAPERING

C This allows to use Visbeck et al formulation to compute K_GM+Redi
#undef GM_VISBECK_VARIABLE_K

C This allows the leading diagonal (top two rows) to be non-unity
C (a feature required when tapering adiabatically).
#define  GM_NON_UNITY_DIAGONAL

C Allows to use different values of K_GM and K_Redi ; also to
C be used with the advective form (Bolus velocity) of GM
#define  GM_EXTRA_DIAGONAL

C Allows to use the advective form (Bolus velocity) of GM
C  instead of the Skew-Flux form (=default)
#define  GM_BOLUS_ADVEC

#endif /* ALLOW_GMREDI */
#endif /* GMREDI_OPTIONS_H */

Add a missing config header

Add a missing config header


extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern int __VERIFIER_nondet_int();

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

    // if (!(x + y == 1))
    if (x + y != 1)
        __VERIFIER_error();
    return 0;
}

// ./goblint --enable ana.sv-comp --enable ana.wp --enable witness.uncil --disable ana.int.def_exc --enable ana.int.interval --set ana.activated '["base"]' --set phases '[{}, {"ana": {"activated": ["base", "observer"], "path_sens": ["observer"]}}]' --html tests/sv-comp/observer/path_nofun_true-unreach-call.c

// ./goblint --enable ana.sv-comp --enable ana.wp --enable witness.uncil --disable ana.int.def_exc --enable ana.int.interval --set ana.activated '["base"]' --html tests/sv-comp/observer/path_nofun_true-unreach-call.c

extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern int __VERIFIER_nondet_int();

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

    // if (!(x + y == 1))
    if (x + y != 1)
        __VERIFIER_error();
    return 0;
}

// ./goblint --enable ana.sv-comp --enable ana.wp --enable witness.uncil --disable ana.int.def_exc --enable ana.int.interval --set ana.activated '["base"]' --html tests/sv-comp/observer/path_nofun_true-unreach-call.c

Remove phases command line from SV-COMP observer example


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

#include "yalex.h"

void replMessageCallback(const char* ptr) {
    if (ptr && strlen(ptr)>0) { printf("%s\n", ptr); }
}

int yalex(void) {
    yalex_world world;
    yalex_init(&world, replMessageCallback);

    replMessageCallback("welcome");
    char word[256];
    /**/
    yalex_repl(&world, ":fibstep (R1R R2R + R3S R2R R1S R3R R2S R4R 1 + R4S rec)");
    yalex_repl(&world, ":rec (R0R R4R 1 + < 'fibstep R3R select)");
    yalex_repl(&world, ":fib (R0S 0 R1S 1 R2S 0 R3S 1 R4S rec)");

    while (1) {
        word[0] = 0;
        fgets(word, sizeof(word), stdin);
        yalex_repl(&world, word);
    }
    return 0;
}

int main()
{
	yalex();
	return 0;
}

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

#include "yalex.h"

void replMessageCallback(const char* ptr) {
    if (ptr && strlen(ptr)>0) { printf("%s\n", ptr); }
}

int yalex(void) {
    yalex_world world;
    yalex_init(&world, replMessageCallback);

    replMessageCallback("welcome");
    char word[256];
    /**/
    yalex_repl(&world, ":nset (R0S)");
    yalex_repl(&world, ":n (R0R)");
    yalex_repl(&world, ":t1set (R1S)");
    yalex_repl(&world, ":t1 (R1R)");
    yalex_repl(&world, ":t2set (R2S)");
    yalex_repl(&world, ":t2 (R2R)");
    yalex_repl(&world, ":resset (R3S)");
    yalex_repl(&world, ":res (R3R)");
    yalex_repl(&world, ":iset (R4S)");
    yalex_repl(&world, ":i (R4R)");
    yalex_repl(&world, ":fibstep (t1 t2 + resset t2 t1set res t2set i 1 + iset rec)");
    yalex_repl(&world, ":rec (n i 1 + < 'fibstep res select)");
    yalex_repl(&world, ":fib (nset 0 t1set 1 t2set 0 resset 1 iset rec)");

    while (1) {
        word[0] = 0;
        fgets(word, sizeof(word), stdin);
        yalex_repl(&world, word);
    }
    return 0;
}

int main()
{
	yalex();
	return 0;
}

Add register alias for verbosity and readability?


#pragma once
#include "Rendering/BufferDX11.h"
#include "Rendering/ShaderDX11.h"

namespace Mile
{
   class MEAPI ConstantBufferDX11 : public BufferDX11
   {
   public:
      ConstantBufferDX11(RendererDX11* renderer);
      ~ConstantBufferDX11();

      bool Init(unsigned int size);
      template <typename Buffer>
      bool Init()
      {
         return Init(sizeof(Buffer));
      }

      virtual ERenderResourceType GetResourceType() const override { return ERenderResourceType::ConstantBuffer; }

      virtual void* Map(ID3D11DeviceContext& deviceContext) override;
      template <typename BufferType>
      BufferType* Map(ID3D11DeviceContext& deviceContext)
      {
         return reinterpret_cast<BufferType*>(Map(deviceContext));
      }

      virtual bool UnMap(ID3D11DeviceContext& deviceContext) override;

      bool Bind(ID3D11DeviceContext& deviceContext, unsigned int slot, EShaderType shaderType);
      void Unbind(ID3D11DeviceContext& deviceContext);

      FORCEINLINE bool IsBound() const { return m_bIsBound; }
      FORCEINLINE unsigned int GetBoundSlot() const { return m_boundSlot; }
      FORCEINLINE EShaderType GetBoundShaderType() const { return m_boundShader; }

   private:
      bool           m_bIsBound;
      unsigned int   m_boundSlot;
      EShaderType    m_boundShader;

   };
}

#pragma once
#include "Rendering/BufferDX11.h"
#include "Rendering/ShaderDX11.h"

namespace Mile
{
   class MEAPI ConstantBufferDX11 : public BufferDX11
   {
   public:
      ConstantBufferDX11(RendererDX11* renderer);
      ~ConstantBufferDX11();

      bool Init(unsigned int size);
      template <typename BufferType>
      bool Init()
      {
         return Init(sizeof(BufferType));
      }

      virtual ERenderResourceType GetResourceType() const override { return ERenderResourceType::ConstantBuffer; }

      virtual void* Map(ID3D11DeviceContext& deviceContext) override;
      template <typename BufferType>
      BufferType* Map(ID3D11DeviceContext& deviceContext)
      {
         return reinterpret_cast<BufferType*>(Map(deviceContext));
      }

      virtual bool UnMap(ID3D11DeviceContext& deviceContext) override;

      bool Bind(ID3D11DeviceContext& deviceContext, unsigned int slot, EShaderType shaderType);
      void Unbind(ID3D11DeviceContext& deviceContext);

      FORCEINLINE bool IsBound() const { return m_bIsBound; }
      FORCEINLINE unsigned int GetBoundSlot() const { return m_boundSlot; }
      FORCEINLINE EShaderType GetBoundShaderType() const { return m_boundShader; }

   private:
      bool           m_bIsBound;
      unsigned int   m_boundSlot;
      EShaderType    m_boundShader;

   };
}

Modify constant buffer init method template type name


#pragma once
#include <SDL2/SDL.h>
#include <string>

class Application
{
private:
    // Main loop flag
    bool quit;

    // The window
    SDL_Window* window;

    // The window renderer
    SDL_Renderer* renderer;

	// The background color
	SDL_Color backgroundColor;

    // Window properties
    std::string title;
    unsigned int windowWidth;
    unsigned int windowHeight;
    bool isFullscreen;

    bool init();
    void close();
	void draw();

protected:

	// Event called after initialized
    virtual void on_init();

	// Event called when before drawing the screen in the loop
    virtual void on_update();

	// Event called when drawing the screen in the loop
    virtual void on_draw(SDL_Renderer* renderer);

	void set_background_color(SDL_Color color);

public:
    Application();
    Application(std::string title);
	Application(std::string title, unsigned int width, unsigned int height);
    Application(std::string title, unsigned int width, unsigned int height, bool fullscreen);
    ~Application();

    void Run();
};

#pragma once
#include <SDL2/SDL.h>
#include <string>

class Application
{
private:
    // Main loop flag
    bool quit;

    // The window
    SDL_Window* window;

    // The window renderer
    SDL_Renderer* renderer;

	// The background color
	SDL_Color backgroundColor;

    // Window properties
    std::string title;
    unsigned int windowWidth;
    unsigned int windowHeight;
    bool isFullscreen;

    bool init();
    void close();
	void draw();

protected:

	// Event called after initialized
    virtual void on_init();

	// Event called when before drawing the screen in the loop
    virtual void on_update();

	// Event called when drawing the screen in the loop
    virtual void on_draw(SDL_Renderer* renderer);

	void set_background_color(SDL_Color color);

	unsigned int get_window_height()
	{
		return windowHeight;
	}

	unsigned int get_window_width()
	{
		return windowWidth;
	}

	bool is_fullscreen()
	{
		return isFullscreen;
	}

public:
    Application();
    Application(std::string title);
	Application(std::string title, unsigned int width, unsigned int height);
    Application(std::string title, unsigned int width, unsigned int height, bool fullscreen);
    ~Application();

    void Run();
};

Add getters for window constants

Add getters for window constants


/*
 * Copyright (c) 2006 KATO Kazuyoshi <kzys@8-p.info>
 * This source code is released under the MIT license.
 */

#import <Cocoa/Cocoa.h>

@interface CreamMonkey : NSObject {
}

@end

Add copyright and license header.

Add copyright and license header.


#ifndef QTVMBVIEWER_H
#define QTVMBVIEWER_H

// Qt dependencies
#include <QWidget>
#include <QLabel>
#include <QSlider>
// Local dependency
#include "VmbCamera.h"

// Qt widget to display the images from an Allied Vision camera through the Vimba SDK
class QtVmbViewer : public QWidget {
	// Macro to use Qt signals and slots
	Q_OBJECT
	// Public members
	public :
		// Constructor
		QtVmbViewer( QWidget *parent = 0 );
		// Destructor
		~QtVmbViewer();
	// Qt slots
	public slots :
		// Slot to get the image from the camera and update the widget
		void UpdateImage();
		// Slot to update the camera exposure
		void SetExposure();
	// Private members
	private :
		// Label to display the camera image
		QLabel* label;
		// Slider to set the camera exposure time
		QSlider* slider;
		// Allied Vision camera
		VmbCamera* camera;
};

#endif // QTVMBVIEWER_H

#ifndef QTVMBVIEWER_H
#define QTVMBVIEWER_H

// Qt dependencies
#include <QWidget>
#include <QLabel>
#include <QSlider>
// Local dependency
#include "VmbCamera.h"

// Qt widget to display the images from an Allied Vision camera through the Vimba SDK
class QtVmbViewer : public QWidget {
	// Macro to use Qt signals and slots
	Q_OBJECT
	// Public members
	public :
		// Constructor
		QtVmbViewer( QWidget *parent = 0 );
		// Destructor
		~QtVmbViewer();
	// Qt slots
	private slots :
		// Slot to get the image from the camera and update the widget
		void UpdateImage();
		// Slot to update the camera exposure
		void SetExposure();
	// Private members
	private :
		// Label to display the camera image
		QLabel* label;
		// Slider to set the camera exposure time
		QSlider* slider;
		// Allied Vision camera
		VmbCamera* camera;
};

#endif // QTVMBVIEWER_H

Change to private Qt slots.

Change to private Qt slots.


/* Faraday Faraday.h
 *
 * Copyright © 2015, 2016, Roy Ratcliffe, Pioneering Software, United Kingdom
 *
 * 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, EITHER
 * EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 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.
 *
 ******************************************************************************/

#import <Foundation/Foundation.h>

FOUNDATION_EXPORT double FaradayVersionNumber;
FOUNDATION_EXPORT const unsigned char FaradayVersionString[];

/* Faraday Faraday.h
 *
 * Copyright © 2015, 2016, Roy Ratcliffe, Pioneering Software, United Kingdom
 *
 * 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, EITHER
 * EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 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.
 *
 ******************************************************************************/

@import Foundation;

FOUNDATION_EXPORT double FaradayVersionNumber;
FOUNDATION_EXPORT const unsigned char FaradayVersionString[];

Use @import in Objective-C header

Use @import in Objective-C header


#include "src/math/reinterpret.h"
#include <stdint.h>
#include <assert.h>

uint64_t __fixunstfdi(long double);

static _Bool run(uint64_t a)
{
    return a == __fixunstfdi(a);
}

int main(void)
{
    const uint64_t delta = 0x0008D46BA87B5A22;

    for (uint64_t i = 0x3FFFFFFFFFFFFFFF; i < 0x4340000000000000; i += delta)
        assert(run(reinterpret(double, i)));

    for (uint64_t i = 0; i <= UINT64_MAX / delta; ++i)
        assert(run(i * delta));
}

Test uint64_t -> long double

Test uint64_t -> long double


#ifndef __OCL_COMMON_DEF_H__
#define __OCL_COMMON_DEF_H__

#define __OPENCL_VERSION__ 110
#define __CL_VERSION_1_0__ 100
#define __CL_VERSION_1_1__ 110
#define __ENDIAN_LITTLE__ 1
#define __IMAGE_SUPPORT__ 1
#define __kernel_exec(X, TYPE) __kernel __attribute__((work_group_size_hint(X,1,1))) \
                                        __attribute__((vec_type_hint(TYPE)))
#define kernel_exec(X, TYPE) __kernel_exec(X, TYPE)
#define cl_khr_global_int32_base_atomics
#define cl_khr_global_int32_extended_atomics
#define cl_khr_local_int32_base_atomics
#define cl_khr_local_int32_extended_atomics
#define cl_khr_byte_addressable_store
#define cl_khr_icd
#define cl_khr_gl_sharing

#endif /* end of __OCL_COMMON_DEF_H__ */

Add the ocl_defines header file into libocl

This file will be used to define some common defines
for both CL and the backend source code.

Signed-off-by: Junyan He <8f73a735c668918c9613b750d3a88ebf2489599f@linux.intel.com>
Reviewed-by: Zhigang Gong <e04a7b9b70b1e4c6318cf117dcd1a9056e14b97a@intel.com>


/*
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year>  <name of author>

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 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 General Public License for more details.

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

*/

///TODO: Make this something entirely different... QVariant wrapped Eigen types, wooh! ;)

#ifndef GLUON_VARIANTTYPES
#define GLUON_VARIANTTYPES

#ifndef EIGEN_CORE_H
#warning This needs to be included AFTER Eigen and friends
#endif

#include <QVariant>
#include <Eigen/Geometry>

Q_DECLARE_METATYPE(Eigen::Vector3d)
//qRegisterMetatype<Eigen::Vector3d>("Eigen::Vector3d");

#endif

/*
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year>  <name of author>

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 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 General Public License for more details.

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

*/

///TODO: Make this something entirely different... QVariant wrapped Eigen types, wooh! ;)

#ifndef GLUON_VARIANTTYPES
#define GLUON_VARIANTTYPES

#include <QVariant>
#include <QMetaType>
#include <Eigen/Geometry>

Q_DECLARE_METATYPE(Eigen::Vector3d)

namespace
{
    struct GluonVariantTypes
    {
        public:
            GluonVariantTypes()
            {
                qRegisterMetaType<Eigen::Vector3d>("Eigen::Vector3d");
            }
    };

    GluonVariantTypes gluonVariantTypes;
}
#endif

Make the varianttypes work more pleasantly - now you simply include the file, and stuff happens magically! (that is, Eigen::Vector3d is registered as a QVariant now... more to come!)


/*
 * Copyright (c) 2012 Israel Jacques
 * See LICENSE for details.
 *
 * Israel Jacques <mrko@eecs.berkeley.edu>
 */

#ifndef _SCU_INTERNAL_H_
#define _SCU_INTERNAL_H_

#include <inttypes.h>
#include <stddef.h>

/* Write and read directly to specified address */
#define MEMORY_WRITE(t, x, y)   (*(volatile uint ## t ## _t *)(x) = (y))
#define MEMORY_READ(t, x)       (*(volatile uint ## t ## _t *)(x))

/* Macros specific for processor */
#define SCU(x)          (0x25FE0000 + (x))
#define CS0(x)          (0x22400000 + (x))
#define CS1(x)          (0x24000000 + (x))
#define DUMMY(x)        (0x25000000 + (x))

/* SCU */
#define D0R     0x0000
#define D0W     0x0004
#define D0C     0x0008
#define D0AD    0x000C
#define D0EN    0x0010
#define D0MD    0x0014
#define D1R     0x0020
#define D1W     0x0024
#define D1C     0x0028
#define D1AD    0x002C
#define D1EN    0x0030
#define D1MD    0x0034
#define D2R     0x0040
#define D2W     0x0044
#define D2C     0x0048
#define D2AD    0x004C
#define D2EN    0x0050
#define D2MD    0x0054
#define DSTA    0x007C
#define PPAF    0x0080
#define PPD     0x0084
#define PDA     0x0088
#define PDD     0x008C
#define T0C     0x0090
#define T1S     0x0094
#define T1MD    0x0098
#define IMS     0x00A0
#define IST     0x00A4
#define AIACK   0x00A8
#define ASR0    0x00B0
#define ASR1    0x00B4
#define AREF    0x00B8
#define RSEL    0x00C4
#define VER     0x00C8

#endif /* !_SCU_INTERNAL_H_ */

Add global SCU internal header file

Add global SCU internal header file


/******************************************************************************
globus_rsl_assist.h

Description:
    This header contains the interface prototypes for the rsl_assist library.

CVS Information:

    $Source$
    $Date$
    $Revision$
    $Author$
******************************************************************************/
#ifndef _GLOBUS_RSL_ASSIST_INCLUDE_GLOBUS_RSL_ASSIST_H_
#define _GLOBUS_RSL_ASSIST_INCLUDE_GLOBUS_RSL_ASSIST_H_

#ifndef EXTERN_C_BEGIN
#ifdef __cplusplus
#define EXTERN_C_BEGIN extern "C" {
#define EXTERN_C_END }
#else
#define EXTERN_C_BEGIN
#define EXTERN_C_END
#endif
#endif

#include "globus_common.h"
#include "globus_rsl.h"

char*
globus_rsl_assist_get_rm_contact(char* resource);
int
globus_rsl_assist_replace_manager_name(globus_rsl_t * rsl);

#endif

/*
 * globus_rsl_assist.h
 *
 * Description:
 *
 *   This header contains the interface prototypes for the rsl_assist library.
 *
 * CVS Information:
 *
 * $Source$
 * $Date$
 * $Revision$
 * $Author$
******************************************************************************/
#ifndef _GLOBUS_RSL_ASSIST_INCLUDE_GLOBUS_RSL_ASSIST_H_
#define _GLOBUS_RSL_ASSIST_INCLUDE_GLOBUS_RSL_ASSIST_H_

#ifndef EXTERN_C_BEGIN
#ifdef __cplusplus
#define EXTERN_C_BEGIN extern "C" {
#define EXTERN_C_END }
#else
#define EXTERN_C_BEGIN
#define EXTERN_C_END
#endif
#endif

#include "globus_common.h"
#include "globus_rsl.h"

char*
globus_rsl_assist_get_rm_contact(char* resource);
int
globus_rsl_assist_replace_manager_name(globus_rsl_t * rsl);

#endif

Make comment conform to coding standard...


// PARAM: --enable ana.int.interval --enable ana.int.def_exc
// issue #120
#include <assert.h>

int main() {
    // should be LP64
    unsigned long n = 16;
    unsigned long size = 4912;

    assert(!(0xffffffffffffffffUL / size < n)); // UNKNOWN (for now)
}

// PARAM: --enable ana.int.interval --enable ana.int.def_exc
// issue #120
#include <assert.h>

int main() {
    // should be LP64
    unsigned long n = 16;
    unsigned long size = 4912;

    assert(!(0xffffffffffffffffUL / size < n));
}

Testcase: Remove UNKNOWN annotation from assert that now succeeds


/*
 * util.c:  Repository access utility routines.
 *
 * ====================================================================
 * Copyright (c) 2007 CollabNet.  All rights reserved.
 *
 * This software is licensed as described in the file COPYING, which
 * you should have received as part of this distribution.  The terms
 * are also available at http://subversion.tigris.org/license-1.html.
 * If newer versions of this license are posted there, you may use a
 * newer version instead, at your option.
 *
 * This software consists of voluntary contributions made by many
 * individuals.  For exact contribution history, see the revision
 * history and logs, available at http://subversion.tigris.org/.
 * ====================================================================
 */

/* ==================================================================== */

/*** Includes. ***/
#include <apr_pools.h>

#include "svn_types.h"
#include "svn_error.h"
#include "svn_error_codes.h"
#include "svn_ra.h"

#include "svn_private_config.h"

/* Return an error with code SVN_ERR_UNSUPPORTED_FEATURE, and an error
   message referencing PATH_OR_URL, if the "server" pointed to be
   RA_SESSION doesn't support Merge Tracking (e.g. is pre-1.5).
   Perform temporary allocations in POOL. */
svn_error_t *
svn_ra__assert_mergeinfo_capable_server(svn_ra_session_t *ra_session,
                                        const char *path_or_url,
                                        apr_pool_t *pool)
{
  svn_boolean_t mergeinfo_capable;
  SVN_ERR(svn_ra_has_capability(ra_session, &mergeinfo_capable,
                                SVN_RA_CAPABILITY_MERGEINFO, pool));
  if (! mergeinfo_capable)
    {
      if (path_or_url == NULL)
        {
          svn_error_t *err = svn_ra_get_session_url(ra_session, &path_or_url,
                                                    pool);
          if (err)
            {
              /* The SVN_ERR_UNSUPPORTED_FEATURE error is more important,
                 so dummy up the session's URL and chuck this error. */
              svn_error_clear(err);
              path_or_url = "<repository>";
            }
        }
      return svn_error_createf(SVN_ERR_UNSUPPORTED_FEATURE, NULL,
                               _("Retrieval of mergeinfo unsupported by '%s'"),
                               svn_path_local_style(path_or_url, pool));
    }
  return SVN_NO_ERROR;
}

Make 'svn mergeinfo' and its underlying APIs error out when talking to
a pre-1.5 repository.

This change includes tests capable of being run against either a 1.4
or 1.5 server (and was run against both).

[ Note: All but subversion/libsvn_ra/util.c was committed in r28172. ]

* TODO-1.5-branch
  Remove TODO item completed by this commit.

* subversion/include/svn_client.h
  (svn_client_mergeinfo_get_merged, svn_client_mergeinfo_get_available):
   Document that an error with the code SVN_ERR_UNSUPPORTED_FEATURE is
   returned when the server doesn't support Merge Tracking.

* subversion/include/svn_ra.h
  (svn_ra_get_mergeinfo): Ditto, with note about inapplicability to
   ra_local.

* subversion/include/private/svn_ra_private.h
  Add new Subversion-private header file, which currently declares
  only the svn_ra__assert_mergeinfo_capable_server() API.

* subversion/libsvn_client/mergeinfo.h
  (svn_client__get_repos_mergeinfo): Add SQUELCH_INCAPABLE parameter, used
   to ignore a SVN_ERR_UNSUPPORTED_FEATURE returned by a server that
   doesn't support Merge Tracking.

* subversion/libsvn_client/mergeinfo.c
  Include private/svn_ra_private.h.
  (svn_client__get_repos_mergeinfo): Add SQUELCH_INCAPABLE parameter, used
   to ignore a SVN_ERR_UNSUPPORTED_FEATURE returned by a server that
   doesn't support Merge Tracking.
  (svn_client__get_wc_or_repos_mergeinfo): Adjust for
   svn_client__get_repos_mergeinfo() API change.
  (get_mergeinfo): Return an error if the server doesn't support Merge
   Tracking.  Improve APR pool usage.
  (svn_client_mergeinfo_get_available): Call get_mergeinfo() first to
   leverage its new server Merge Tracking capabilities check.

* subversion/libsvn_client/copy.c
  (calculate_target_mergeinfo): Adjust for svn_client__get_repos_mergeinfo()
   API change

* subversion/libsvn_client/merge.c
  (filter_reflected_revisions): Ditto.

* subversion/libsvn_ra/ra_loader.c
  Include private/svn_ra_private.h.
  (svn_ra_get_mergeinfo): Return an error if the server doesn't
   support Merge Tracking.

* subversion/libsvn_ra/util.c
  Add new Subversion-private header file, which currently defines
  only the svn_ra__assert_mergeinfo_capable_server() API.

* subversion/libsvn_ra_svn/client.c
  (ra_svn_get_mergeinfo): Remove SVN_RA_SVN_CAP_MERGEINFO capabilities
   check, which is now handled by ra_loader.c.

* subversion/libsvn_ra_neon/mergeinfo.c
  (svn_ra_neon__get_mergeinfo)))): Don't squelch a 501 HTTP status
   code (which is otherwise subsequently converted into an
   svn_error_t) encountered while making a mergeinfo REPORT request.

* subversion/libsvn_ra_serf/mergeinfo.c
  (svn_ra_serf__get_mergeinfo): Don't squelch an SVN_ERR_UNSUPPORTED_FEATURE
   error encountered while making a mergeinfo REPORT request.

* subversion/tests/cmdline/mergeinfo_tests.py
  Import the server_has_mergeinfo() function.
  (adjust_error_for_server_version): Add a new function that returns
   the expected error regexp appropriate for the server version used by
   the test suite.
  (no_mergeinfo): Leverage adjust_error_for_server_version(), and
   adjust for run_and_verify_mergeinfo() API changes.
  (mergeinfo): Provide a very basic implementation of the test.

* subversion/tests/cmdline/svntest/actions.py
  (run_and_verify_mergeinfo): Replace EXPECTED_PATHS, EXPECTED_SOURCE_PATHS,
   and EXPECTED_ELIGIBLE_REVS parameters with EXPECTED_OUTPUT, which is a
   dict of the format:
     { path : { source path : (merged ranges, eligible ranges) } }
   Correct/add parser expectations, adjust for parser API changes, and
   re-implement function accordingly.  Be sure to bail out early if a
   1.4 server is detected.

* subversion/tests/cmdline/svntest/parsers.py
  (MergeinfoReportParser): Add a comment showing some sample output.
  (MergeinfoReportParser.STATE_MERGED_RANGES,
   MergeinfoReportParser.STATE_ELIGIBLE_RANGES): Add new constants,
   the latter a replacement for STATE_ELIGIBLE_REVS.
  (MergeinfoReportParser.STATE_TRANSITIONS): Correct/add possible
   state transitions.
  (MergeinfoReportParser.STATE_TOKENS): Correct/add tokens present in
   the output.
  (MergeinfoReportParser.__init__): Replace "paths", "source_paths",
   and "eligible_revs" instance members with "report" dict.  Add
   "cur_target_path" and "cur_source_path" members to maintain some
   necessary parser state.  Replace "state_to_storage" dict with
   "parser_callbacks" dict of callback functions.
  (parsed_target_path, parsed_source_path, parsed_merged_ranges,
   parsed_eligible_ranges): Add parser callback functions invoked from
   the "parser_callbacks" dict.
  (parse): Replace use of "state_to_storage" with "parser_callbacks".


// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <memory>
#include <mutex>
#include <map>

namespace document {

namespace internal {
    class InternalDocumenttypesType;
}

class DocumentTypeRepo;

/*
 * Factory class for document type repos. Same instance is returned
 * for equal config.
 */
class DocumentTypeRepoFactory {
    using DocumenttypesConfig = const internal::InternalDocumenttypesType;
    struct DocumentTypeRepoEntry {
        std::weak_ptr<const DocumentTypeRepo> repo;
        std::unique_ptr<const DocumenttypesConfig> config;

        DocumentTypeRepoEntry(std::weak_ptr<const DocumentTypeRepo> repo_in,
                      std::unique_ptr<const DocumenttypesConfig> config_in)
            : repo(std::move(repo_in)),
              config(std::move(config_in))
        {
        }
    };
    using DocumentTypeRepoMap = std::map<const void *, DocumentTypeRepoEntry>;
    class Deleter;

    static std::mutex _mutex;
    static DocumentTypeRepoMap _repos;

    static void deleteRepo(DocumentTypeRepo *repoRawPtr) noexcept;
public:
    static std::shared_ptr<const DocumentTypeRepo> make(const DocumenttypesConfig &config);
};

}

// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <memory>
#include <mutex>
#include <map>

namespace document {

namespace internal {
    class InternalDocumenttypesType;
}

class DocumentTypeRepo;

/*
 * Factory class for document type repos. Same instance is returned
 * for equal config.
 */
class DocumentTypeRepoFactory {
    using DocumenttypesConfig = const internal::InternalDocumenttypesType;
    struct DocumentTypeRepoEntry {
        std::weak_ptr<const DocumentTypeRepo> repo;
        std::unique_ptr<const DocumenttypesConfig> config;

        DocumentTypeRepoEntry(std::weak_ptr<const DocumentTypeRepo> repo_in,
                      std::unique_ptr<const DocumenttypesConfig> config_in)
            : repo(std::move(repo_in)),
              config(std::move(config_in))
        {
        }
    };
    using DocumentTypeRepoMap = std::map<const void *, DocumentTypeRepoEntry>;
    class Deleter;

    static std::mutex _mutex;
    static DocumentTypeRepoMap _repos;

    static void deleteRepo(DocumentTypeRepo *repoRawPtr) noexcept;
public:
    /*
     * Since same instance is returned for equal config, we return a shared
     * pointer to a const repo.  The repo should be considered immutable.
     */
    static std::shared_ptr<const DocumentTypeRepo> make(const DocumenttypesConfig &config);
};

}

Add comment for document::DocumentTypeRepoFactory::make method.


#include "FreeRTOS.h"
#include "Semphr.h"
#include "task.h"

/* The interrupt entry point. */
void vEMAC_ISR_Wrapper( void ) __attribute__((naked));

/* The handler that does the actual work. */
void vEMAC_ISR_Handler( void );

extern xSemaphoreHandle xEMACSemaphore;

void vEMAC_ISR_Handler( void )
{
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

    /* Clear the interrupt. */
    MAC_INTCLEAR = 0xffff;
    VICVectAddr = 0;

    /* Ensure the uIP task is not blocked as data has arrived. */
    xSemaphoreGiveFromISR( xEMACSemaphore, &xHigherPriorityTaskWoken );

	if( xHigherPriorityTaskWoken )
    {
    	/* Giving the semaphore woke a task. */
        portYIELD_FROM_ISR();
    }
}
/*-----------------------------------------------------------*/

void vEMAC_ISR_Wrapper( void )
{
	/* Save the context of the interrupted task. */
    portSAVE_CONTEXT();

    /* Call the handler.  This must be a separate function unless you can
    guarantee that no stack will be used. */
    vEMAC_ISR_Handler();

    /* Restore the context of whichever task is going to run next. */
    portRESTORE_CONTEXT();
}

#include "FreeRTOS.h"
#include "semphr.h"
#include "task.h"

/* The interrupt entry point. */
void vEMAC_ISR_Wrapper( void ) __attribute__((naked));

/* The handler that does the actual work. */
void vEMAC_ISR_Handler( void );

extern xSemaphoreHandle xEMACSemaphore;

void vEMAC_ISR_Handler( void )
{
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;

    /* Clear the interrupt. */
    MAC_INTCLEAR = 0xffff;
    VICVectAddr = 0;

    /* Ensure the uIP task is not blocked as data has arrived. */
    xSemaphoreGiveFromISR( xEMACSemaphore, &xHigherPriorityTaskWoken );

	if( xHigherPriorityTaskWoken )
    {
    	/* Giving the semaphore woke a task. */
        portYIELD_FROM_ISR();
    }
}
/*-----------------------------------------------------------*/

void vEMAC_ISR_Wrapper( void )
{
	/* Save the context of the interrupted task. */
    portSAVE_CONTEXT();

    /* Call the handler.  This must be a separate function unless you can
    guarantee that no stack will be used. */
    vEMAC_ISR_Handler();

    /* Restore the context of whichever task is going to run next. */
    portRESTORE_CONTEXT();
}

Correct case of include file to build on Linux.

git-svn-id: 43aea61533866f88f23079d48f4f5dc2d5288937@402 1d2547de-c912-0410-9cb9-b8ca96c0e9e2


//
//  SloppySwiper.h
//
//  Created by Arkadiusz on 29-05-14.
//

#import <Foundation/Foundation.h>

@interface SloppySwiper : NSObject <UINavigationControllerDelegate>

// Designated initializer if the class isn't set in the Interface Builder.
- (instancetype)initWithNavigationController:(UINavigationController *)navigationController;

@end

//
//  SloppySwiper.h
//
//  Created by Arkadiusz on 29-05-14.
//

#import <Foundation/Foundation.h>

@interface SloppySwiper : NSObject <UINavigationControllerDelegate>

/// Gesture recognizer used to recognize swiping to the right.
@property (weak, nonatomic) UIPanGestureRecognizer *panRecognizer;

/// Designated initializer if the class isn't used from the Interface Builder.
- (instancetype)initWithNavigationController:(UINavigationController *)navigationController;

@end

Improve comments in the header file

Improve comments in the header file


// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once

#include <string>
#include "core/common/status.h"
#include "core/graph/onnx_protobuf.h"
#include "core/session/onnxruntime_c_api.h"

namespace onnxruntime {
class ExternalDataInfo {
 private:
  std::basic_string<ORTCHAR_T> rel_path_;
  //-1 means doesn't exist
  ptrdiff_t offset_;
  //-1 means doesn't exist
  ptrdiff_t length_;
  std::string checksum_;

 public:
  const std::basic_string<ORTCHAR_T>& GetRelPath() const { return rel_path_; }

  ptrdiff_t GetOffset() const { return offset_; }
  ptrdiff_t GetLength() const { return length_; }

  const std::string& GetChecksum() const { return checksum_; }

  // If the value of 'offset' or 'length' field is larger the max value of ssize_t, this function will treat it as a
  // wrong value and return FAIL.
  static common::Status Create(const ::google::protobuf::RepeatedPtrField<::ONNX_NAMESPACE::StringStringEntryProto>& input,
                               std::unique_ptr<ExternalDataInfo>& out);
};
}  // namespace onnxruntime

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
#pragma once

#include <string>
#include "core/common/status.h"
#include "core/graph/onnx_protobuf.h"
#include "core/session/onnxruntime_c_api.h"

namespace onnxruntime {
class ExternalDataInfo {
 private:
  std::basic_string<ORTCHAR_T> rel_path_;
  ptrdiff_t offset_ = 0;
  ptrdiff_t length_ = 0;
  std::string checksum_;

 public:
  const std::basic_string<ORTCHAR_T>& GetRelPath() const { return rel_path_; }

  ptrdiff_t GetOffset() const { return offset_; }
  ptrdiff_t GetLength() const { return length_; }

  const std::string& GetChecksum() const { return checksum_; }

  // If the value of 'offset' or 'length' field is larger the max value of ssize_t, this function will treat it as a
  // wrong value and return FAIL.
  static common::Status Create(const ::google::protobuf::RepeatedPtrField<::ONNX_NAMESPACE::StringStringEntryProto>& input,
                               std::unique_ptr<ExternalDataInfo>& out);
};
}  // namespace onnxruntime

Fix a bug in ExternalDataInfo

Fix a bug in ExternalDataInfo


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

#import <UIKit/UIKit.h>

#import <React/RCTViewComponentView.h>

NS_ASSUME_NONNULL_BEGIN

/**
 * UIView class for root <ShimmeringView> component.
 */
@interface RCTActivityIndicatorViewComponentView : RCTViewComponentView

@end

NS_ASSUME_NONNULL_END

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

#import <UIKit/UIKit.h>

#import <React/RCTViewComponentView.h>

NS_ASSUME_NONNULL_BEGIN

/**
 * UIView class for root <ActivityIndicator> component.
 */
@interface RCTActivityIndicatorViewComponentView : RCTViewComponentView

@end

NS_ASSUME_NONNULL_END

Fix incorrect information in comment

Fix incorrect information in comment

Summary: `RCTActivityIndicatorViewComponentView` is a component for `ActivityIndicator` not for `ShimmeringView`.

Reviewed By: cpojer

Differential Revision: D16360505

fbshipit-source-id: d6f7685eea24060c9e1b43d5782a65396d6c375e


/*
name: TEST006
description: Basic test for if
output:
G1	M	c
F1
X2	F1	main
G2	F1	main	{
-
	j	L2	#I0	#I0	=I
	yI	#I1
	j	L3
L2
	j	L4	#I0	#I0	=I
	j	L5
L4
	j	L6	#I1	#I0	=I
	j	L7	G1	MI	#I0	=I
	yI	#I1
	j	L8
L7
	yI	#I0
L8
	j	L9
L6
	yI	#I1
L9
L5
L3
	yI	#I1
}
*/

char c;

int
main()
{
	if(0) {
		return 1;
	} else if(0) {
		/* empty */
	} else {
		if(1) {
			if(c)
				return 1;
			else
				return 0;
		} else {
			return 1;
		}
	}
	return 1;
}

Add test of IF statement

Add test of IF statement


// RUN: %libomp-compile-and-run
#include <stdio.h>
#include <omp.h>
#include "omp_my_sleep.h"

/*
 * This test creates tasks that themselves create a new task.
 * The runtime has to take care that they are correctly freed.
 */

int main()
{
  #pragma omp task
  {
    #pragma omp task
    {
      my_sleep( 0.1 );
    }
  }

  #pragma omp parallel num_threads(2)
  {
    #pragma omp single
    #pragma omp task
    {
      #pragma omp task
      {
        my_sleep( 0.1 );
      }
    }
  }

  printf("pass\n");
  return 0;
}

Add test case for nested creation of tasks

For discussion in D23115

git-svn-id: f99161ee8ccfe2101cbe1bdda2220bce2ed25485@277730 91177308-0d34-0410-b5e6-96231b3b80d8


#ifndef __VIRT_CONVERT__
#define __VIRT_CONVERT__

/*
 * Macros used for converting between virtual and physical mappings.
 */

#ifdef __KERNEL__

#include <linux/compiler.h>
#include <linux/mmzone.h>
#include <asm/setup.h>
#include <asm/page.h>

/*
 * Change virtual addresses to physical addresses and vv.
 */
static inline unsigned long virt_to_phys(void *address)
{
	return __pa(address);
}

static inline void *phys_to_virt(unsigned long address)
{
	return __va(address);
}

/* Permanent address of a page. */
#ifdef CONFIG_MMU
#ifdef CONFIG_SINGLE_MEMORY_CHUNK
#define page_to_phys(page) \
	__pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT))
#else
#define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
#endif
#else
#define page_to_phys(page)	(((page) - mem_map) << PAGE_SHIFT)
#endif

/*
 * IO bus memory addresses are 1:1 with the physical address,
 */
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt

#endif
#endif

#ifndef __VIRT_CONVERT__
#define __VIRT_CONVERT__

/*
 * Macros used for converting between virtual and physical mappings.
 */

#ifdef __KERNEL__

#include <linux/compiler.h>
#include <linux/mmzone.h>
#include <asm/setup.h>
#include <asm/page.h>

/*
 * Change virtual addresses to physical addresses and vv.
 */
static inline unsigned long virt_to_phys(void *address)
{
	return __pa(address);
}

static inline void *phys_to_virt(unsigned long address)
{
	return __va(address);
}

/* Permanent address of a page. */
#if defined(CONFIG_MMU) && defined(CONFIG_SINGLE_MEMORY_CHUNK)
#define page_to_phys(page) \
	__pa(PAGE_OFFSET + (((page) - pg_data_map[0].node_mem_map) << PAGE_SHIFT))
#else
#define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
#endif

/*
 * IO bus memory addresses are 1:1 with the physical address,
 */
#define virt_to_bus virt_to_phys
#define bus_to_virt phys_to_virt

#endif
#endif

m68knommu: Correct page_to_phys when PAGE_OFFSET is non-zero.

The definition of page_to_phys for nommu produces an incorrect value when
PAGE_OFFSET is non-zero.  The nommu version of page_to_pfn works correctly
for non-zero PAGE_OFFSET, so use that instead.

Signed-off-by: Steven King <a01a09c207e33d02e60d4b67c9ce2ea5390b7812@fdwdc.com>
Signed-off-by: Greg Ungerer <ed22c22dbde360207569092e60b4298397efb8da@uclinux.org>


//===-- include/Support/DataTypes.h - Define fixed size types ----*- C++ -*--=//
//
// This file contains definitions to figure out the size of _HOST_ data types.
// This file is important because different host OS's define different macros,
// which makes portability tough.  This file exports the following definitions:
//
//   LITTLE_ENDIAN: is #define'd if the host is little endian
//   int64_t      : is a typedef for the signed 64 bit system type
//   uint64_t     : is a typedef for the unsigned 64 bit system type
//
// No library is required when using these functinons.
//
//===----------------------------------------------------------------------===//

// TODO: This file sucks.  Not only does it not work, but this stuff should be
// autoconfiscated anyways. Major FIXME

#ifndef LLVM_SUPPORT_DATATYPES_H
#define LLVM_SUPPORT_DATATYPES_H

#include <inttypes.h>

#ifdef LINUX
#define __STDC_LIMIT_MACROS 1
#include <stdint.h>       // Defined by ISO C 99
#include <endian.h>

#else
#include <sys/types.h>
#ifdef _LITTLE_ENDIAN
#define LITTLE_ENDIAN 1
#endif
#endif

#endif

//===-- include/Support/DataTypes.h - Define fixed size types ----*- C++ -*--=//
//
// This file contains definitions to figure out the size of _HOST_ data types.
// This file is important because different host OS's define different macros,
// which makes portability tough.  This file exports the following definitions:
//
//   LITTLE_ENDIAN: is #define'd if the host is little endian
//   int64_t      : is a typedef for the signed 64 bit system type
//   uint64_t     : is a typedef for the unsigned 64 bit system type
//
// No library is required when using these functinons.
//
//===----------------------------------------------------------------------===//

// TODO: This file sucks.  Not only does it not work, but this stuff should be
// autoconfiscated anyways. Major FIXME

#ifndef LLVM_SUPPORT_DATATYPES_H
#define LLVM_SUPPORT_DATATYPES_H

#include <inttypes.h>

#ifdef __linux__
#define __STDC_LIMIT_MACROS 1
#include <stdint.h>       // Defined by ISO C 99
#include <endian.h>

#else
#include <sys/types.h>
#ifdef _LITTLE_ENDIAN
#define LITTLE_ENDIAN 1
#endif
#endif

#endif

Add better linux support by using the right macro.  This still should be
autoconfiscated, but for now this is sufficient.

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


/*
 *	Just a place holder.
 */

#ifndef _SPARC64_SETUP_H
#define _SPARC64_SETUP_H

#define COMMAND_LINE_SIZE	256

#endif /* _SPARC64_SETUP_H */

/*
 *	Just a place holder.
 */

#ifndef _SPARC64_SETUP_H
#define _SPARC64_SETUP_H

#define COMMAND_LINE_SIZE	2048

#endif /* _SPARC64_SETUP_H */

[SPARC64]: Increase command line size to 2048 like other arches.

Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>


#ifndef YGO_DATA_CARDDATA_H
#define YGO_DATA_CARDDATA_H

#include <string>

#include "CardType.h"

namespace ygo
{
namespace data
{

struct StaticCardData
{
    std::string name;
    CardType cardType;
    // monster only
    Attribute attribute;
    MonsterType monsterType;
    Type type;
    MonsterType monsterAbility;
    int level;
    int attack;
    int defense;
    int lpendulum;
    int rpendulum;
    // spell and trap only
    SpellType spellType;
    TrapType trapType;
    std::string text;
};

}
}

#endif

#ifndef YGO_DATA_CARDDATA_H
#define YGO_DATA_CARDDATA_H

#include <string>

#include "CardType.h"

namespace ygo
{
namespace data
{

struct StaticCardData
{
    std::string name;
    CardType cardType;
    // monster only
    Attribute attribute;
    MonsterType monsterType;
    Type type;
    MonsterType monsterAbility;
    int level;
    int attack;
    int defense;
    int lpendulum;
    int rpendulum;
    // spell and trap only
    SpellType spellType;
    TrapType trapType;
    // card text
    std::string text;
};

}
}

#endif

Clarify data in static card data

Clarify data in static card data


/*	$OpenBSD: isa_machdep.c,v 1.4 1999/03/05 19:17:44 niklas Exp $	*/

/*
 * Copyright (c) 1999 Niklas Hallqvist
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *      This product includes software developed by Niklas Hallqvist.
 * 4. The name of the author may not be used to endorse or promote products
 *    derived from this software without specific prior written permission
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <sys/types.h>
#include <sys/systm.h>
#include <sys/device.h>

#include <machine/intr.h>

#include <dev/isa/isareg.h>
#include <dev/isa/isavar.h>

/*
 * Just check to see if an IRQ is available/can be shared.
 * 0 = interrupt not available
 * 1 = interrupt shareable
 * 2 = interrupt all to ourself
 */
int
__isa_intr_check(irq, type, intrtype)
	int irq;
	int type;
	int *intrtype;
{
	if (type == IST_NONE)
		return (0);

	switch (intrtype[irq]) {
	case IST_NONE:
		return (2);
		break;
	case IST_LEVEL:
		if (type != intrtype[irq])
			return (0);
		return (1);
		break;
	case IST_EDGE:
	case IST_PULSE:
		if (type != IST_NONE)
			return (0);
	}
	return (1);
}

Add forgotten file, espie@ has checked it compiles


/*
 * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
#include <sys/param.h>

#include "pq-crypto/pq-random.h"

#include "utils/s2n_mem.h"

static int (*random_data_generator)(struct s2n_blob *) = &s2n_get_private_random_data;

int initialize_pq_crypto_generator(int (*generator_ptr)(struct s2n_blob *))
{
    if (generator_ptr == NULL) {
        return -1;
    }
    random_data_generator = generator_ptr;
    return 0;
}

int get_random_bytes(OUT unsigned char *buffer, unsigned int num_bytes)
{
    struct s2n_blob out = {.data = buffer,.size = num_bytes };
    return random_data_generator(&out);
}

/*
 * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License").
 * You may not use this file except in compliance with the License.
 * A copy of the License is located at
 *
 *  http://aws.amazon.com/apache2.0
 *
 * or in the "license" file accompanying this file. This file is distributed
 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
 * express or implied. See the License for the specific language governing
 * permissions and limitations under the License.
 */
#include <stdlib.h>
#include <sys/param.h>

#include "pq-crypto/pq-random.h"

#include "utils/s2n_mem.h"

static int (*random_data_generator)(struct s2n_blob *) = &s2n_get_private_random_data;

int initialize_pq_crypto_generator(int (*generator_ptr)(struct s2n_blob *))
{
    if (generator_ptr == NULL) {
        return -1;
    }
    random_data_generator = generator_ptr;
    return 0;
}

int get_random_bytes(OUT unsigned char *buffer, unsigned int num_bytes)
{
    struct s2n_blob out = {.data = buffer,.size = num_bytes };
    return random_data_generator(&out);
}

Enable compiling with older versions of GCC


#include <git2.h>
#include <stdio.h>

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

	const char *GIT_REPO_PATH = ".";

	git_repository *repo = NULL;
	git_repository_open(&repo, GIT_REPO_PATH);

	git_revwalk *walker = NULL;
	git_revwalk_new(&walker, repo);

	git_revwalk_sorting(walker, GIT_SORT_NONE);

	git_revwalk_push_head(walker);

	git_oid oid;
	while (!git_revwalk_next(&oid, walker))
	{
		git_commit *commit = NULL;
		git_commit_lookup(&commit, repo, &oid);

		printf("%s %s\n", git_oid_tostr_s(&oid), git_commit_summary(commit));

		git_commit_free(commit);
	}

	git_revwalk_free(walker);
	git_repository_free(repo);

	git_libgit2_shutdown();

	return 0;
}

Add libgit2 example to print all commit history inside current
directory.

Compile with:

gcc git_test.c -o git_test -lgit2


#ifndef HAL1_H
#define HAL1_H

// Configurable constants

extern int const MAIN_MOTOR_PWM_TOP;
extern int const MAIN_MOTOR_BRAKE_SPEED;
extern int const MAIN_MOTOR_MIN_SPEED;
extern int const MAIN_MOTOR_MED_SPEED;
extern int const MAIN_MOTOR_MAX_SPEED;
extern int const MAGNET_OPEN_WAIT;

void init(void);

void main_motor_stop();
void main_motor_cw_open(uint8_t speed);
void main_motor_ccw_close(uint8_t speed);
void aux_motor_stop();
void aux_motor_cw_close();
void aux_motor_ccw_open();
void magnet_off();
void magnet_on();
bool door_nearly_open();
bool door_fully_open();
bool door_fully_closed();

bool sensor_proximity();
bool button_openclose();
bool button_stop();
bool main_encoder();
bool aux_outdoor_limit();
bool aux_indoor_limit();
bool door_nearly_closed();
bool aux_encoder();

// Private functions

static void set_main_motor_speed(int speed);

#endif

#ifndef HAL1_H
#define HAL1_H

// Configurable constants

extern int const MAIN_MOTOR_PWM_TOP;
extern int const MAIN_MOTOR_BRAKE_SPEED;
extern int const MAIN_MOTOR_MIN_SPEED;
extern int const MAIN_MOTOR_MED_SPEED;
extern int const MAIN_MOTOR_MAX_SPEED;
extern int const MAGNET_OPEN_WAIT;

void init(void);

void main_motor_stop();
void main_motor_cw_open(uint8_t speed);
void main_motor_ccw_close(uint8_t speed);
void aux_motor_stop();
void aux_motor_cw_close(uint8_t speed);
void aux_motor_ccw_open(uint8_t speed);
void magnet_off();
void magnet_on();
bool door_nearly_open();
bool door_fully_open();
bool door_fully_closed();

bool sensor_proximity();
bool button_openclose();
bool button_stop();
bool main_encoder();
bool aux_outdoor_limit();
bool aux_indoor_limit();
bool door_nearly_closed();
bool aux_encoder();

// Private functions

static void set_main_motor_speed(int speed);

#endif

Add speed to aux motor functions.

Add speed to aux motor functions.


#include "helper.h"
#include <string> // string
#include <stdlib.h> // srand, rand
#include <time.h> // time - for rand seed
#include <algorithm> // sort

using namespace std;

class BaseSheet
{
    protected:
        int _level;
        int _str;
        int _dex;
        int _con;
        int _int;
        int _wis;
        int _cha;
        int _speed ;
        // All of these others have enums and a string
        // The string is to print out - maybe not the best way
        Size _size;
        string _size_text;
        Alignment_0 _alignment_0;
        Alignment_1 _alignment_1;
        string _alignment_text;
        Race _race;
        string _race_text;
        DndClass _class;
        string _class_text;
        void set_class(DndClass myClass);
    public:
        BaseSheet(DndClass myClass);
        void print_stats();
        void level_up();
        virtual void check_for_abilities();
        void roll_stats(int[]);
        virtual void assign_stats(int[]);
};

#include "helper.h"
#include <string> // string
#include <stdlib.h> // srand, rand
#include <time.h> // time - for rand seed
#include <algorithm> // sort
#include <functional> // std::greater for mac osx

using namespace std;

class BaseSheet
{
    protected:
        int _level;
        int _str;
        int _dex;
        int _con;
        int _int;
        int _wis;
        int _cha;
        int _speed ;
        // All of these others have enums and a string
        // The string is to print out - maybe not the best way
        Size _size;
        string _size_text;
        Alignment_0 _alignment_0;
        Alignment_1 _alignment_1;
        string _alignment_text;
        Race _race;
        string _race_text;
        DndClass _class;
        string _class_text;
        void set_class(DndClass myClass);
    public:
        BaseSheet(DndClass myClass);
        void print_stats();
        void level_up();
        virtual void check_for_abilities();
        void roll_stats(int[]);
        virtual void assign_stats(int[]);
};

Add include <functional> for osx

Add include <functional> for osx


/*	$OpenBSD: i8237reg.h,v 1.2 1996/04/18 23:47:19 niklas Exp $	*/
/*	$NetBSD: i8237reg.h,v 1.5 1996/03/01 22:27:09 mycroft Exp $	*/

/*
 * Intel 8237 DMA Controller
 */

#define	DMA37MD_WRITE	0x04	/* read the device, write memory operation */
#define	DMA37MD_READ	0x08	/* write the device, read memory operation */
#define	DMA37MD_LOOP	0x10	/* auto-initialize mode */
#define	DMA37MD_SINGLE	0x40	/* single pass mode */
#define	DMA37MD_CASCADE	0xc0	/* cascade mode */

#define	DMA37SM_CLEAR	0x00	/* clear mask bit */
#define	DMA37SM_SET	0x04	/* set mask bit */

/*	$OpenBSD: i8237reg.h,v 1.3 1999/08/04 23:07:49 niklas Exp $	*/
/*	$NetBSD: i8237reg.h,v 1.5 1996/03/01 22:27:09 mycroft Exp $	*/

/*
 * Intel 8237 DMA Controller
 */

#define	DMA37MD_DEMAND	0x00	/* demand mode */
#define	DMA37MD_WRITE	0x04	/* read the device, write memory operation */
#define	DMA37MD_READ	0x08	/* write the device, read memory operation */
#define	DMA37MD_LOOP	0x10	/* auto-initialize mode */
#define	DMA37MD_SINGLE	0x40	/* single pass mode */
#define	DMA37MD_CASCADE	0xc0	/* cascade mode */

#define	DMA37SM_CLEAR	0x00	/* clear mask bit */
#define	DMA37SM_SET	0x04	/* set mask bit */

Add new manifest constant for demand mode DMA; form NetBSD


#ifdef E_TYPEDEFS

typedef struct _E_Randr_Output_Config E_Randr_Output_Config;
typedef struct _E_Randr_Crtc_Config E_Randr_Crtc_Config;
typedef struct _E_Randr_Config E_Randr_Config;

#else
# ifndef E_RANDR_H
#  define E_RANDR_H

#define E_RANDR_CONFIG_FILE_EPOCH 1
#define E_RANDR_CONFIG_FILE_GENERATION 1
#define E_RANDR_CONFIG_FILE_VERSION \
   ((E_RANDR_CONFIG_FILE_EPOCH * 1000000) + E_RANDR_CONFIG_FILE_GENERATION)

struct _E_Randr_Output_Config
{
   unsigned int xid; // ecore_x_randr output id (xid)
   unsigned int crtc; // ecore_x_randr crtc id (xid)
   unsigned int policy; // value of the ecore_x_randr_output_policy
   unsigned char primary; // flag to indicate if primary output
   unsigned long edid_count; // monitor's edid length
   unsigned char *edid; // monitor's edid
   double timestamp; // config timestamp
};

struct _E_Randr_Crtc_Config
{
   unsigned int xid; // ecore_x_randr crtc id (xid)
   int x, y, width, height; // geometry
   unsigned int orient; // value of the ecore_x_randr_orientation
   unsigned int mode; // ecore_x_randr mode id (xid)
   Eina_List *outputs; // list of outputs for this crtc
   double timestamp; // config timestamp
};

struct _E_Randr_Config
{
   /* RANDR CONFIG
    *
    * Screen:
    *   width, height (int);
    *
    * list of crtcs
    *   each crtc having:
    *     unsigned int crtc_id (Ecore_X_ID);
    *     int x, y, w, h; (Eina_Rectangle);
    *     unsigned int orientation (Ecore_X_Randr_Orienation);
    *     unsigned int mode_id (Ecore_X_ID);
    *     list of outputs
    *       each output having:
    *         unsigned int output_id (Ecore_X_ID);
    *         unsigned int crtc_id (Ecore_X_ID);
    *         unsigned int output_policy;
    */

   int version; // INTERNAL CONFIG VERSION

   struct
     {
        int width, height; // geometry
        double timestamp; // config timestamp
     } screen;

   Eina_List *crtcs;
};

EINTERN Eina_Bool e_randr_init(void);
EINTERN int e_randr_shutdown(void);

EAPI Eina_Bool e_randr_config_save(void);

extern EAPI E_Randr_Config *e_randr_cfg;

# endif
#endif

Add new randr header file.

Add new randr header file.

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

SVN revision: 84109


#include "rmc.h"

// Some test cases that required some bogosity to not have the branches get
// optimized away.
//
// Also, if r doesn't get used usefully, that load gets optimized away.
// I can't decide whether that is totally fucked or not.

int global_p, global_q;

int bogus_ctrl_dep1() {
    XEDGE(read, write);

    L(read, int r = global_p);
    if (r == r) {
        L(write, global_q = 1);
    }

    return r;
}

// Do basically the same thing in each branch
int bogus_ctrl_dep2() {
    XEDGE(read, write);

    L(read, int r = global_p);
    if (r) {
        L(write, global_q = 1);
    } else {
        L(write, global_q = 1);
    }

    return r;
}

// Have a bogus ctrl dep
int bogus_ctrl_dep3() {
    XEDGE(read, write);

    L(read, int r = global_p);
    if (r) {};

    L(write, global_q = 1);

    return r;
}

#include "rmc.h"

// Some test cases that required some bogosity to not have the branches get
// optimized away.
//
// Also, if r doesn't get used usefully, that load gets optimized away.
// I can't decide whether that is totally fucked or not.

int global_p, global_q;

int bogus_ctrl_dep1() {
    XEDGE(read, write);

    L(read, int r = global_p);
    if (r == r) {
        L(write, global_q = 1);
    }

    return r;
}

// Do basically the same thing in each branch
int bogus_ctrl_dep2() {
    XEDGE(read, write);

    L(read, int r = global_p);
    if (r) {
        L(write, global_q = 1);
    } else {
        L(write, global_q = 1);
    }

    return r;
}

// Have a totally ignored ctrl dep
int bogus_ctrl_dep3() {
    XEDGE(read, write);

    L(read, int r = global_p);
    if (r) {};

    L(write, global_q = 1);

    return r;
}

// Have a ctrl dep that is redundant
int bogus_ctrl_dep4() {
    XEDGE(read, write);

    L(read, int r = global_p);
    if (r || 1) {
        L(write, global_q = 1);
    }

    return r;
}

Add another ctrl dep test that we get right!


/* Exercise 1-8: Write a program to copy its input to its output, replacing
 * each string of one of more blanks with a single blank. */

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

int main(int argc, char **argv)
{
  int16_t character, previous_character;
  while ((character = getchar()) != EOF) {
    if ((previous_character == ' ') && (character == ' ')) {
      continue;
    } else {
      putchar(character);
    previous_character = character;
    }
  }
  return EXIT_SUCCESS;
}

Add solution to Exercise 1-9.

Add solution to Exercise 1-9.


#include "e.h"

/* local subsystem functions */

/* local subsystem globals */

/* externally accessible functions */
EAPI void
e_error_message_show_internal(char *txt)
{
   /* FIXME: maybe log these to a file and display them at some point */
   printf("<<<< Enlightenment Error >>>>\n"
	  "%s\n",
	  txt);
}

/* local subsystem functions */

#include "e.h"

/* local subsystem functions */

/* local subsystem globals */

/* externally accessible functions */
EAPI void
e_error_message_show_internal(char *txt)
{
   /* FIXME: maybe log these to a file and display them at some point */
   printf("<<<< Enlightenment Error >>>>\n%s\n", txt);
}

/* local subsystem functions */

E: Fix formatting. (Really ??? 3 lines for something that can fit on
one ?)

SVN revision: 61614


/*
 * EMULAB-COPYRIGHT
 * Copyright (c) 2000-2002 University of Utah and the Flux Group.
 * All rights reserved.
 */

#define TBSERVER_PORT		7777
#define TBSERVER_PORT2		14443
#define MYBUFSIZE		2048
#define BOSSNODE_FILENAME	"bossnode"

/*
 * As the tmcd changes, incompatable changes with older version of
 * the software cause problems. Starting with version 3, the client
 * will tell tmcd what version they are. If no version is included,
 * assume its DEFAULT_VERSION.
 *
 * Be sure to update the versions as the TMCD changes. Both the
 * tmcc and tmcd have CURRENT_VERSION compiled in, so be sure to
 * install new versions of each binary when the current version
 * changes. libsetup.pm module also encodes a current version, so be
 * sure to change it there too!
 *
 * Note, this is assumed to be an integer. No need for 3.23.479 ...
 * NB: See ron/libsetup.pm. That is version 4! I'll merge that in.
 */
#define DEFAULT_VERSION		2
#define CURRENT_VERSION		6

/*
 * EMULAB-COPYRIGHT
 * Copyright (c) 2000-2002 University of Utah and the Flux Group.
 * All rights reserved.
 */

#define TBSERVER_PORT		7777
#define TBSERVER_PORT2		14447
#define MYBUFSIZE		2048
#define BOSSNODE_FILENAME	"bossnode"

/*
 * As the tmcd changes, incompatable changes with older version of
 * the software cause problems. Starting with version 3, the client
 * will tell tmcd what version they are. If no version is included,
 * assume its DEFAULT_VERSION.
 *
 * Be sure to update the versions as the TMCD changes. Both the
 * tmcc and tmcd have CURRENT_VERSION compiled in, so be sure to
 * install new versions of each binary when the current version
 * changes. libsetup.pm module also encodes a current version, so be
 * sure to change it there too!
 *
 * Note, this is assumed to be an integer. No need for 3.23.479 ...
 * NB: See ron/libsetup.pm. That is version 4! I'll merge that in.
 */
#define DEFAULT_VERSION		2
#define CURRENT_VERSION		6

Change alternate port number; seemed to be taken already!