/*
 * Copyright (c) 2017 Contributors as noted in the AUTHORS file
 *
 * This file is part of Solo5, a unikernel base layer.
 *
 * Permission to use, copy, modify, and/or 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.
 */

#include "../kernel.h"
#include "sinfo.h"
#include "writer.h"

#define DEBUGLOG_PROTO 0xf00789094b6f70cfUL

struct log_msg {
    uint64_t timestamp;
    char data[56];
} __attribute__((packed));

static struct muchannel *channel_out;
static struct log_msg msg_buffer;
static int msg_index;

static void clear_buffer()
{
    msg_index = 0;
    memset(&msg_buffer, 0, sizeof(struct log_msg));
}

static void flush()
{
    msg_buffer.timestamp = muen_get_sched_start();
    muen_channel_write(channel_out, &msg_buffer);
    clear_buffer();
}

int platform_puts(const char *buf, int n)
{
    int i;

    for (i = 0; i < n; i++) {
        if (buf[i] && buf[i] != 0x0d)
        {
            msg_buffer.data[msg_index] = buf[i];
            if (msg_index == 55 || buf[i] == 0x0a)
                flush();
            else
                msg_index++;
        }
    }

    return n;
}

int solo5_console_write(const char *, size_t)
    __attribute__ ((alias("platform_puts")));

void console_init(void)
{
    struct muen_channel_info channel;
    uint64_t epoch;

    if (!muen_get_channel_info("debuglog", &channel)) {
        return;
    }

    clear_buffer();
    epoch        = muen_get_sched_start();
    channel_out  = (struct muchannel *)(channel.address);
    muen_channel_init_writer(channel_out, DEBUGLOG_PROTO, sizeof(struct log_msg),
            channel.size, epoch);
    log(INFO, "Solo5: Console: Muen Channel @ 0x%lx, size 0x%lx, epoch 0x%lx\n",
        channel.address, channel.size, epoch);
}

Add console implementation for Muen

Add console implementation for Muen

The console writes output using a shared memory stream channel.


/* Copyright (c) 2005-2008 Dovecot authors, see the included COPYING file */

#include "lib.h"
#include "istream-internal.h"
#include "istream-zlib.h"

#ifdef HAVE_BZLIB
#include <bzlib.h>

#define BZLIB_INCLUDE

#define gzFile BZFILE
#define gzdopen BZ2_bzdopen
#define gzclose BZ2_bzclose
#define gzread BZ2_bzread
#define gzseek BZ2_bzseek

#define i_stream_create_zlib i_stream_create_bzlib
#include "istream-zlib.c"
#endif

/* Copyright (c) 2005-2008 Dovecot authors, see the included COPYING file */

#include "lib.h"
#include "istream-internal.h"
#include "istream-zlib.h"

#ifdef HAVE_BZLIB
#include <stdio.h>
#include <bzlib.h>

#define BZLIB_INCLUDE

#define gzFile BZFILE
#define gzdopen BZ2_bzdopen
#define gzclose BZ2_bzclose
#define gzread BZ2_bzread
#define gzseek BZ2_bzseek

#define i_stream_create_zlib i_stream_create_bzlib
#include "istream-zlib.c"
#endif

bzlib: Include stdio.h in case bzlib.h needs it.


// Copyright 2017 Massachusetts Institute of Technology
#pragma once

#include <csignal>
#include <deque>
#include <vector>
#include <mutex>

#include "pcl_ros/point_cloud.h"

namespace global_mapper {

typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;

class GlobalMapper {
 public:
  explicit GlobalMapper(volatile std::sig_atomic_t* stop_signal_ptr_);
  ~GlobalMapper();
  void PushPointCloud(const PointCloud::ConstPtr& point_cloud);
  const PointCloud::ConstPtr PopPointCloud();
  const PointCloud::ConstPtr TransformPointCloud(const PointCloud::ConstPtr& point_cloud);
  void InsertPointCloud(const PointCloud::ConstPtr& point_cloud);
  void Run();

  volatile std::sig_atomic_t* stop_signal_ptr_;
  // std::mutex mutex_;

 private:
  std::deque<PointCloud::ConstPtr > point_cloud_buffer_;
  int global_map_size_x_;
  int global_map_size_y_;
  int global_map_size_z_;
  std::vector<float> global_map_;
};
}  // namespace global_mapper

// Copyright 2017 Massachusetts Institute of Technology
#pragma once

#include <csignal>
#include <deque>
#include <vector>
#include <mutex>

#include "pcl_ros/point_cloud.h"

namespace global_mapper {

typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;

class GlobalMapper {
 public:
  explicit GlobalMapper(volatile std::sig_atomic_t* stop_signal_ptr_);
  ~GlobalMapper();

  GlobalMapper(const GlobalMapper& rhs) = delete;
  GlobalMapper& operator=(const GlobalMapper& rhs) = delete;

  GlobalMapper(GlobalMapper&& rhs) = delete;
  GlobalMapper& operator=(GlobalMapper&& rhs) = delete;

  void PushPointCloud(const PointCloud::ConstPtr& point_cloud);
  const PointCloud::ConstPtr PopPointCloud();
  const PointCloud::ConstPtr TransformPointCloud(const PointCloud::ConstPtr& point_cloud);
  void InsertPointCloud(const PointCloud::ConstPtr& point_cloud);
  void Run();

  volatile std::sig_atomic_t* stop_signal_ptr_;
  // std::mutex mutex_;

 private:
  std::deque<PointCloud::ConstPtr > point_cloud_buffer_;
  int global_map_size_x_;
  int global_map_size_y_;
  int global_map_size_z_;
  std::vector<float> global_map_;
};
}  // namespace global_mapper

Delete copy and move constructors.

Delete copy and move constructors.


// Don't crash.

// RUN: %clang_cc1 -DCAKE -x c-header %S/modified-header-crash.h -emit-pch -o %t
// RUN: touch %S/modified-header-crash.h
// RUN: not %clang_cc1 %s -include-pch %t -fsyntax-only

void f(void) {
  foo = 3;
}

// Don't crash.

// RUN: %clang_cc1 -DCAKE -x c-header %S/modified-header-crash.h -emit-pch -o %t
// RUN: touch %S/modified-header-crash.h
// RUN: not %clang_cc1 %s -include-pch %t -fsyntax-only

// FIXME: On Windows we don't detect that the header was modified ?
// XFAIL: win32

void f(void) {
  foo = 3;
}

Disable a test that fails on windows; for some reason we don't detect that the header has different timestamp.

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


//
// Created by Jake Kinsella on 6/19/17.
//

#include <assert.h>
#include "../src/matcher/matcher.h"

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

    return 0;
}

//
// Created by Jake Kinsella on 6/19/17.
//

#include <assert.h>
#include "../src/matcher/matcher.h"
#include "../src/registers.h"

void dst_run(uint8_t *dst_register);
void src_run(const uint8_t src_register);
void rp_run(RegisterPair *dst_register_pair);
void dst_src_run(uint8_t *dst_register, const uint8_t src_register);

int value_register1 = 0;
int value_register2 = 0;

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

    return 0;
}

void dst_run(uint8_t *dst_register)
{
    value_register1 = *dst_register;
}

void src_run(const uint8_t src_register)
{
    value_register1 = src_register;
}

void rp_run(RegisterPair *dst_register_pair)
{
    value_register1 = combine_bytes(*dst_register_pair->register1, *dst_register_pair->register2);
}

void dst_src_run(uint8_t *dst_register, const uint8_t src_register)
{
    value_register1 = *dst_register;
    value_register2 = src_register;
}

Create dummy functions for future matcher tests


/*Copyright 2010-2015 George Karagoulis

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

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

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

#ifndef GUTIL_NO_GUI_FUNCTIONALITY

#ifndef GUTIL_MESSAGEBOXLOGGER_H
#define GUTIL_MESSAGEBOXLOGGER_H

#include <gutil/ilog.h>
#include <QObject>
class QWidget;

namespace GUtil{ namespace Qt{

/** A logger implementation which displays the message in a modal dialog box. */
class MessageBoxLogger : public QObject, public GUtil::ILog
{
    Q_OBJECT
    QWidget *m_parentWidget;
public:

    explicit MessageBoxLogger(QWidget *parent = 0);
    virtual ~MessageBoxLogger() {}

    /** Displays a modal dialog box with the title and message, with the
        appropriate severity.
    */
    virtual void Log(const LoggingData &) noexcept;

private slots:

    void _log(const LoggingData &);

};

}}

#endif // GUTIL_MESSAGEBOXLOGGER_H

#endif // GUI_FUNCTIONALITY

/*Copyright 2010-2015 George Karagoulis

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

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

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

#ifndef GUTIL_NO_GUI_FUNCTIONALITY

#ifndef GUTIL_MESSAGEBOXLOGGER_H
#define GUTIL_MESSAGEBOXLOGGER_H

#include <gutil/ilog.h>
#include <QObject>
class QWidget;

namespace GUtil{ namespace Qt{

/** A logger implementation which displays the message in a modal dialog box. */
class MessageBoxLogger : public QObject, public GUtil::ILog
{
    Q_OBJECT
    QWidget *m_parentWidget;
public:

    explicit MessageBoxLogger(QWidget *parent = 0);
    virtual ~MessageBoxLogger() {}

    void SetParentWidget(QWidget *parent){ m_parentWidget = parent; }
    QWidget *GetParentWidget() const{ return m_parentWidget; }

    /** Displays a modal dialog box with the title and message, with the
        appropriate severity.
    */
    virtual void Log(const LoggingData &) noexcept;

private slots:

    void _log(const LoggingData &);

};

}}

#endif // GUTIL_MESSAGEBOXLOGGER_H

#endif // GUI_FUNCTIONALITY

Allow to change the parent widget after construction. Sometimes your main widget changes and you don't want to make a new logger.


// Copyright (c) 2014 Andrew Toulouse.
// Distributed under the MIT License.

#ifndef __libol__Chunks__
#define __libol__Chunks__

#include <vector>
#include <cstdint>

namespace libol {
    namespace Chunks {
        static std::vector<uint8_t> decrypt(std::vector<uint8_t> bytes, std::vector<uint8_t> key);
    }
}

#endif /* defined(__libol__Chunks__) */

// Copyright (c) 2014 Andrew Toulouse.
// Distributed under the MIT License.

#ifndef __libol__Chunks__
#define __libol__Chunks__

#include <vector>
#include <cstdint>

namespace libol {
    namespace Chunks {
        std::vector<uint8_t> decryptAndDecompress(std::vector<uint8_t> bytes, std::vector<uint8_t> key);
    }
}

#endif /* defined(__libol__Chunks__) */

Fix dumb header issue (didn't update implementation)


// RUN: %clang_cc1 %s -triple i386-unknown-unknown -fasm-blocks -emit-llvm -o - | FileCheck %s

// CHECK: .byte 64
// CHECK: .byte 64
// CHECK: .byte 64
// CHECK:  .even
void t1() {
  __asm {
    .byte 64
    .byte 64
    .byte 64
    EVEN
    mov eax, ebx
  }
}

Add support for MS 'EVEN' directive

[X86][inline-asm] Add support for MS 'EVEN' directive

MS assembly syntax provide us with the 'EVEN' directive as a synonymous to at&t '.even'.
This patch include the (small, simple) changes need to allow it.

llvm-side:
https://reviews.llvm.org/D27417

Differential Revision: https://reviews.llvm.org/D27418

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


#ifndef SYSTEM_H
#define SYSTEM_H

#define FIXED_ADDRESS_MEMORY
#define IN_DATA_BUFFER_ADDRESS_TAG __at(0x200) // for CDC device (XC8)
#define OUT_DATA_BUFFER_ADDRESS_TAG __at(0x240)
#define CONTROL_BUFFER_ADDRESS_TAG __at(0x280)
#define DRIVER_DATA_ADDRESS_TAG __at(0x2C0)

#endif

Use static USB buffer positions.

Use static USB buffer positions.


// 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_GLUE_WEBKIT_CONSTANTS_H_
#define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_

namespace webkit_glue {

// Chromium sets the minimum interval timeout to 4ms, overriding the
// default of 10ms.  We'd like to go lower, however there are poorly
// coded websites out there which do create CPU-spinning loops.  Using
// 4ms prevents the CPU from spinning too busily and provides a balance
// between CPU spinning and the smallest possible interval timer.
const double kForegroundTabTimerInterval = 0.004;

// Provides control over the minimum timer interval for background tabs.
const double kBackgroundTabTimerInterval = 0.004;

} // namespace webkit_glue

#endif  // WEBKIT_GLUE_WEBKIT_CONSTANTS_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_GLUE_WEBKIT_CONSTANTS_H_
#define WEBKIT_GLUE_WEBKIT_CONSTANTS_H_

namespace webkit_glue {

// Chromium sets the minimum interval timeout to 4ms, overriding the
// default of 10ms.  We'd like to go lower, however there are poorly
// coded websites out there which do create CPU-spinning loops.  Using
// 4ms prevents the CPU from spinning too busily and provides a balance
// between CPU spinning and the smallest possible interval timer.
const double kForegroundTabTimerInterval = 0.004;

// Provides control over the minimum timer interval for background tabs.
const double kBackgroundTabTimerInterval = 1.0;

} // namespace webkit_glue

#endif  // WEBKIT_GLUE_WEBKIT_CONSTANTS_H_

Increase the minimum interval for timers on background tabs to reduce
their CPU consumption.

The new interval is 1000 ms, or once per second. We can easily adjust
this value up or down, but this seems like a reasonable value to judge
the compatibility impact of this change.

BUG=66078
TEST=none (tested manually with minimal test case)

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

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


// Copyright (c) 2006-2008 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_GLUE_UNITTEST_TEST_SERVER_H__
#define WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__

#include "net/base/load_flags.h"
#include "net/test/test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/appcache/appcache_interfaces.h"

class UnittestTestServer : public net::TestServer {
 public:
  UnittestTestServer()
      : net::TestServer(net::TestServer::TYPE_HTTP,
                        FilePath(FILE_PATH_LITERAL("webkit/data"))) {
  }
};

#endif  // WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__

// Copyright (c) 2012 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_GLUE_UNITTEST_TEST_SERVER_H__
#define WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__

#include "net/base/load_flags.h"
#include "net/test/test_server.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "webkit/appcache/appcache_interfaces.h"

class UnittestTestServer : public net::TestServer {
 public:
  UnittestTestServer()
      : net::TestServer(net::TestServer::TYPE_HTTP,
                        net::TestServer::kLocalhost,
                        FilePath(FILE_PATH_LITERAL("webkit/data"))) {
  }
};

#endif  // WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__

Remove usage of a deprecated TestServer constructor.

Hostname must now be explicitly specified (previously default was 127.0.0.1). See the following CL for further details:

http://codereview.chromium.org/9369029/

A follow-up CL will remove the deprecated constructor:

http://codereview.chromium.org/9431002/

BUG=114369
TEST=everything still compiles and passes

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

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


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

#include "test_pits.h"
#include "test_pits_impl.h"

psa_its_status_t test_psa_its_reset(void)
{
    return test_psa_its_reset_impl();
}

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

#ifndef TARGET_PSA
#error [NOT_SUPPORTED] ITS tests can run only on PSA-enabled targets.
#endif // TARGET_PSA

#include "test_pits.h"
#include "test_pits_impl.h"

psa_its_status_t test_psa_its_reset(void)
{
    return test_psa_its_reset_impl();
}

Fix its tests in non-psa targets

Fix its tests in non-psa targets


/*
 * This file is part of btag.
 *
 * © 2011 Fernando Tarlá Cardoso Lemos
 *
 * Refer to the LICENSE file for licensing information.
 *
 */

#ifndef CONFIRMATION_HANDLER_H
#define CONFIRMATION_HANDLER_H

#include <string>

#include "BasicStringFilter.h"
#include "InteractiveTerminal.h"

class ConfirmationHandler
{
    public:
        ConfirmationHandler(InteractiveTerminal &terminal,
                BasicStringFilter *input_filter = NULL, BasicStringFilter *output_filter = NULL);

        void reset();
        void set_local_default(const std::wstring &local);
        bool ask(const std::wstring &question);

        bool complies() const { return m_complies; }
        const std::wstring &answer() const { return m_output; }

    private:
        bool do_ask(const std::wstring &question);

        InteractiveTerminal &m_terminal;
        BasicStringFilter *m_input_filter, *m_output_filter;

        std::wstring m_global_def, m_local_def, m_output;
        bool m_retry, m_complies;
};

#endif

/*
 * This file is part of btag.
 *
 * © 2011 Fernando Tarlá Cardoso Lemos
 *
 * Refer to the LICENSE file for licensing information.
 *
 */

#ifndef CONFIRMATION_HANDLER_H
#define CONFIRMATION_HANDLER_H

#include <string>

#include "BasicStringFilter.h"
#include "InteractiveTerminal.h"

class ConfirmationHandler
{
    public:
        ConfirmationHandler(InteractiveTerminal &terminal,
                BasicStringFilter *input_filter = NULL, BasicStringFilter *output_filter = NULL);

        void reset();
        void set_local_default(const std::wstring &local);
        bool ask(const std::wstring &question);

        bool complies() const { return m_complies; }
        const std::wstring &answer() const { return m_output; }

    private:
        bool do_ask(const std::wstring &question);

        InteractiveTerminal &m_terminal;
        BasicStringFilter *m_input_filter, *m_output_filter;

        std::wstring m_global_def, m_local_def, m_output;
        bool m_complies;
};

#endif

Remove unused private instance variable

Remove unused private instance variable

btag now compiles again in OS X without warnings.


#define EV_STANDALONE              /* keeps ev from requiring config.h */
#ifdef _WIN32
# define EV_SELECT_IS_WINSOCKET 1   /* configure libev for windows select */
# define FD_SETSIZE 2048 /* wishful thinking, as msvcrt6 [?] seems to only allow 512 fd's and 256 sockets max */
#endif

#include "../libev/ev.h"

#define EV_STANDALONE              /* keeps ev from requiring config.h */

#ifdef _WIN32
#define EV_SELECT_IS_WINSOCKET 1   /* configure libev for windows select */
#define EV_USE_MONOTONIC 0
#define EV_USE_REALTIME 0
#endif

#include "../libev/ev.h"

Remove unnecessary definition and disable EV_USE_MONOTONIC and EV_USE_REALTIME on windows


//
//  NSString+RACKeyPathUtilities.h
//  ReactiveCocoa
//
//  Created by Uri Baghin on 05/05/2013.
//  Copyright (c) 2013 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString (RACKeyPathUtilities)

// Returns an array of the components of the receiver, or nil if the receiver is
// not a valid key path.
- (NSArray *)rac_keyPathComponents;

// Returns a key path with all the components of the receiver except for the
// last one or nil if the receiver is not a valid key path, or has only one
// component.
- (NSString *)rac_keyPathByDeletingLastKeyPathComponent;

// Returns a key path with all the components of the receiver expect for the
// first one or nil if the receiver is not a valid key path, or has only one
// component.
- (NSString *)rac_keyPathByDeletingFirstKeyPathComponent;

@end

//
//  NSString+RACKeyPathUtilities.h
//  ReactiveCocoa
//
//  Created by Uri Baghin on 05/05/2013.
//  Copyright (c) 2013 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NSString (RACKeyPathUtilities)

// Returns an array of the components of the receiver.
//
// Calling this method on a string that isn't a key path is considered undefined
// behavior.
- (NSArray *)rac_keyPathComponents;

// Returns a key path with all the components of the receiver except for the
// last one.
//
// Calling this method on a string that isn't a key path is considered undefined
// behavior.
- (NSString *)rac_keyPathByDeletingLastKeyPathComponent;

// Returns a key path with all the components of the receiver expect for the
// first one.
//
// Calling this method on a string that isn't a key path is considered undefined
// behavior.
- (NSString *)rac_keyPathByDeletingFirstKeyPathComponent;

@end

Change RACKeyPathUtilities to be undefined on strings that aren't key paths.


/**
 * \usergroup{SceUpdateMgr}
 * \usage{psp2/update.h,SceSblSsUpdateMgr_stub}
 */

#ifndef _PSP2_UPDATE_MGR_H_
#define _PSP2_UPDATE_MGR_H_

#include <psp2/types.h>

typedef char SceUpdateMode;

#define SCE_UPDATE_MODE_SWU_GUI 0x10
#define SCE_UPDATE_MODE_SWU_CUI 0x30

/**
 * Getting system update mode on boot
 *
 * @param[out] mode - The pointer of SceUpdateMode variable
 *
 * @return 0 on success, < 0 on error.
 */
int sceSblUsGetUpdateMode(SceUpdateMode *mode);

/**
 * Setting system update mode on boot
 *
 * @param[in] mode - The update mode
 *
 * @return 0 on success, < 0 on error.
 */
int sceSblUsSetUpdateMode(SceUpdateMode mode);

/**
 * Verify PUP
 *
 * @param[in] path - The PUP path
 *
 * @return 0 on success, < 0 on error.
 *
 * note - If verify CEX PUP on Devkit system, got error.
 */
int sceSblUsVerifyPup(const char *path);

#endif /* _PSP2_UPDATE_MGR_H_ */

/**
 * \usergroup{SceUpdateMgr}
 * \usage{psp2/update.h,SceSblSsUpdateMgr_stub}
 */

#ifndef _PSP2_UPDATE_MGR_H_
#define _PSP2_UPDATE_MGR_H_

#include <psp2/types.h>

typedef char SceUpdateMode;

#define SCE_UPDATE_MODE_SWU_GUI 0x10
#define SCE_UPDATE_MODE_SWU_CUI 0x30

/**
 * Getting system update mode on boot
 *
 * @param[out] mode - The pointer of SceUpdateMode variable
 *
 * @return 0 on success, < 0 on error.
 */
int sceSblUsGetUpdateMode(SceUpdateMode *mode);

#define sceSblSsUpdateMgrGetBootMode sceSblUsGetUpdateMode

/**
 * Setting system update mode on boot
 *
 * @param[in] mode - The update mode
 *
 * @return 0 on success, < 0 on error.
 */
int sceSblUsSetUpdateMode(SceUpdateMode mode);

#define sceSblSsUpdateMgrSetBootMode sceSblUsSetUpdateMode

/**
 * Verify PUP
 *
 * @param[in] path - The PUP path
 *
 * @return 0 on success, < 0 on error.
 *
 * note - If verify CEX PUP on Devkit system, got error.
 */
int sceSblUsVerifyPup(const char *path);

#endif /* _PSP2_UPDATE_MGR_H_ */

Fix compatibility with some modules

Fix compatibility with some modules


#ifndef _ASM_X86_JUMP_LABEL_H
#define _ASM_X86_JUMP_LABEL_H

#ifdef __KERNEL__

#include <linux/types.h>
#include <asm/nops.h>

#define JUMP_LABEL_NOP_SIZE 5

# define JUMP_LABEL_INITIAL_NOP ".byte 0xe9 \n\t .long 0\n\t"

# define JUMP_LABEL(key, label)					\
	do {							\
		asm goto("1:"					\
			JUMP_LABEL_INITIAL_NOP			\
			".pushsection __jump_table,  \"a\" \n\t"\
			_ASM_PTR "1b, %l[" #label "], %c0 \n\t" \
			".popsection \n\t"			\
			: :  "i" (key) :  : label);		\
	} while (0)

#endif /* __KERNEL__ */

#ifdef CONFIG_X86_64
typedef u64 jump_label_t;
#else
typedef u32 jump_label_t;
#endif

struct jump_entry {
	jump_label_t code;
	jump_label_t target;
	jump_label_t key;
};

#endif

#ifndef _ASM_X86_JUMP_LABEL_H
#define _ASM_X86_JUMP_LABEL_H

#ifdef __KERNEL__

#include <linux/types.h>
#include <asm/nops.h>

#define JUMP_LABEL_NOP_SIZE 5

# define JUMP_LABEL_INITIAL_NOP ".byte 0xe9 \n\t .long 0\n\t"

# define JUMP_LABEL(key, label)					\
	do {							\
		asm goto("1:"					\
			JUMP_LABEL_INITIAL_NOP			\
			".pushsection __jump_table,  \"aw\" \n\t"\
			_ASM_PTR "1b, %l[" #label "], %c0 \n\t" \
			".popsection \n\t"			\
			: :  "i" (key) :  : label);		\
	} while (0)

#endif /* __KERNEL__ */

#ifdef CONFIG_X86_64
typedef u64 jump_label_t;
#else
typedef u32 jump_label_t;
#endif

struct jump_entry {
	jump_label_t code;
	jump_label_t target;
	jump_label_t key;
};

#endif

x86: Fix jump label with RO/NX module protection crash

If we use jump table in module init, there are marked
as removed in __jump_table section after init is done.

But we already applied ro permissions on the module, so
we can't modify a read only section (crash in
remove_jump_label_module_init).

Make the __jump_table section rw.

Signed-off-by: Matthieu CASTET <2b6a54c52e56976a5646892b66a1a13421db0d2c@free.fr>
Cc: Xiaotian Feng <ac8085f9c424e98c8fe0d0e67b1c7a8a00757580@gmail.com>
Cc: Jason Baron <af9bd1db766a43cb09b647251c97dbddcd2e59dc@redhat.com>
Cc: Steven Rostedt <43232e92d70cc7aa53504ad0397085ee47bad87f@goodmis.org>
Cc: Frederic Weisbecker <e8a1bf9163cb25e93cfd6540f223b3872ea7ee55@gmail.com>
Cc: Peter Zijlstra <645ca7d3a8d3d4f60557176cd361ea8351edc32b@chello.nl>
Cc: Arjan van de Ven <9043bf4b08f6c93a2cb55d98c3494b123858348f@linux.intel.com>
Cc: Siarhei Liakh <04848bc4c6728e62385922426cceead13c9e9458@gmail.com>
Cc: Xuxian Jiang <4e7b08952acae50abec9e06cac9ae2c424c73473@cs.ncsu.edu>
Cc: James Morris <10d11de3abc355eabe955bb734f0f8e71da56e16@namei.org>
Cc: Rusty Russell <df9728c9e5104131c08c7adb03af425394842596@rustcorp.com.au>
Cc: Dave Jones <d5ec0d24602845f6f4b6a35ef729998d1fba5507@redhat.com>
Cc: Kees Cook <e9b0cc8b545b1477b7cee8fbfcd6abb9c2d70cb5@canonical.com>
Cc: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>
Cc: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@linux-foundation.org>
LKML-Reference: <839f467c9c1c781060a2c104d5ccbd3605c01c1a@free.fr>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>


// REQUIRES: x86-registered-target
// RUN: %clang_cc1 %s -triple i386-apple-darwin10 -fasm-blocks -emit-llvm -o - | FileCheck %s --check-prefix=DARWIN
// RUN: %clang_cc1 %s -triple i686-pc-win32 -fasm-blocks -emit-llvm -o - | FileCheck %s --check-prefix=WINDOWS

// On Windows, .align is in bytes, and on Darwin, .align is in log2 form. The
// Intel inline assembly parser should rewrite to the appropriate form depending
// on the platform.

void align_test() {
  __asm align 8
  __asm align 16;
  __asm align 128;
  __asm ALIGN 256;
}

// DARWIN-LABEL: define void @align_test()
// DARWIN: call void asm sideeffect inteldialect
// DARWIN-SAME: .align 3
// DARWIN-SAME: .align 4
// DARWIN-SAME: .align 7
// DARWIN-SAME: .align 8
// DARWIN-SAME: "~{dirflag},~{fpsr},~{flags}"()

// WINDOWS-LABEL: define void @align_test()
// WINDOWS: call void asm sideeffect inteldialect
// WINDOWS-SAME: .align 8
// WINDOWS-SAME: .align 16
// WINDOWS-SAME: .align 128
// WINDOWS-SAME: .align 256
// WINDOWS-SAME: "~{dirflag},~{fpsr},~{flags}"()

[ms-inline-asm] Test case for alignment directive change in LLVM r251418

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


#include <X11/Xlib.h>
#include <X11/extensions/Xinerama.h>
#include <stdbool.h>
#include <stdio.h>

int main() {
    Display *dpy = XOpenDisplay(NULL);
    int xinerama_event_base;
    int xinerama_error_base;
    bool xinerama_ready = XineramaQueryExtension(dpy,&xinerama_event_base, &xinerama_error_base);

    if (!xinerama_ready)
        fprintf(stderr, "No Xinerama support detected, mod_xinerama won't do anything.");
    else {
        int nRects,i;
        XineramaScreenInfo* sInfo = XineramaQueryScreens(dpy, &nRects);
        for(i = 0 ; i < nRects ; ++i) {
            fprintf(stdout, "Screen %d: %dx%d+%d+%d\n", i, sInfo[i].width, sInfo[i].height, sInfo[i].x_org, sInfo[i].y_org);
        }
    }

    return 0;
}

#include <X11/Xlib.h>
#include <X11/extensions/Xinerama.h>
#include <stdbool.h>
#include <stdio.h>

int main() {
    Display *dpy = XOpenDisplay(NULL);
    int xinerama_event_base;
    int xinerama_error_base;
    bool xinerama_ready = XineramaQueryExtension(dpy,&xinerama_event_base, &xinerama_error_base);

    fprintf(stdout, "Basic Xinerama screen information - for all the details run 'xdpyinfo -ext XINERAMA'\n");

    if (!xinerama_ready)
        fprintf(stderr, "No Xinerama support detected, mod_xinerama won't do anything.");
    else {
        int nRects,i;
        XineramaScreenInfo* sInfo = XineramaQueryScreens(dpy, &nRects);
        for(i = 0 ; i < nRects ; ++i) {
            fprintf(stdout, "Screen %d: %dx%d+%d+%d\n", i, sInfo[i].width, sInfo[i].height, sInfo[i].x_org, sInfo[i].y_org);
        }
    }

    return 0;
}

Document command to get even more details


/* Header for general data acquisition definitions.
 */

#ifndef	_SYS_DATAACQ_H_
#define	_SYS_DATAACQ_H_

#include <sys/ioccom.h>

/* Period in microseconds between analog I/O samples.
 */
#define AD_MICRO_PERIOD_SET _IOW('A', 1, long)
#define AD_MICRO_PERIOD_GET _IOR('A', 2, long)

/* Gain list support.  Initially all gains are 1.  If the board
 * supports no gains at all then AD_NGAINS_GET will return a 0.
 *
 * AD_NGAINS_GET: Return the number of gains the board supports
 *
 * AD_SUPPORTED_GAINS: Get the supported gains.
 * The driver will copy out "ngains" doubles,
 * where "ngains" is obtained with AD_NGAINS_GET.
 *
 * AD_GAINS_SET: Set the gain list.  The driver will copy in "ngains" ints.
 *
 * AD_GAINS_GET: Get the gain list.  The driver will copy out "ngains" ints.
 */

#define AD_NGAINS_GET     _IOR('A', 3, int)
#define AD_NCHANS_GET     _IOR('A', 4, int)
#define AD_SUPPORTED_GAINS _IO('A', 5)
#define AD_GAINS_SET       _IO('A', 6)
#define AD_GAINS_GET       _IO('A', 7)

#endif /* !_SYS_DATAACQ_H_ */

Put back this wholly innocent victim of Mike's drive-by shooting on alog; it belongs to the labpc driver. Mike will be in the corner wearing the pointed hat, should anyone be looking for him.


/*
 * Called by the Gradle CUnit launcher to register all CUnit tests.
 */
void gradle_cunit_register();

Add newline to end of generated cunit header file


#include "preamble.h"

int main(int argc, char const *argv[]) {
  hvm_gen *gen = hvm_new_gen();
  hvm_obj_ref *obj0 = NULL;
  hvm_obj_ref *obj1 = NULL;

  byte reg0 = hvm_vm_reg_gen(0);
  byte reg1 = hvm_vm_reg_gen(1);

  // Immediately jump to the code that's going to throw the exception
  hvm_gen_goto_label(gen->block, "main");

  // Label for the code to actually catch the exception
  hvm_gen_label(gen->block, "catch");
  // Do a straight die so the test harness can check the register and make
  // sure there's an exception object in it
  hvm_gen_die(gen->block);

  hvm_gen_label(gen->block, "main");
  // Register our exception handler for the frame
  hvm_gen_catch_label(gen->block, "catch", reg0);
  hvm_gen_structnew(gen->block, reg1);
  hvm_gen_throw(gen->block, reg1);
  hvm_gen_die(gen->block);

  hvm_vm *vm = gen_chunk_and_run(gen);

  obj0 = vm->general_regs[0];
  obj1 = vm->general_regs[1];
  // Make sure the object thrown and the object in the catch register are
  // the same
  assert_true(obj0 == obj1, "Expected thrown object and caught object to be the same");

  return done();
}

Add basic exceptions unit test

Add basic exceptions unit test


#include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;

List* List_Create(void);

#endif

#include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;

List* List_Create(void);
void List_Destroy(List* l);

#endif

Add List destroy function declaration

Add List destroy function declaration


// 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 CHROME_NACL_NACL_BROKER_LISTENER_H_
#define CHROME_NACL_NACL_BROKER_LISTENER_H_
#pragma once

#include "base/memory/scoped_ptr.h"
#include "base/process.h"
#include "chrome/common/nacl_types.h"
#include "ipc/ipc_channel.h"

// The BrokerThread class represents the thread that handles the messages from
// the browser process and starts NaCl loader processes.
class NaClBrokerListener : public IPC::Channel::Listener {
 public:
  NaClBrokerListener();
  ~NaClBrokerListener();

  void Listen();

  // IPC::Channel::Listener implementation.
  virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
  virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
  virtual void OnChannelError() OVERRIDE;

 private:
  void OnLaunchLoaderThroughBroker(const std::wstring& loader_channel_id);
  void OnShareBrowserHandle(int browser_handle);
  void OnStopBroker();

  base::ProcessHandle browser_handle_;
  scoped_ptr<IPC::Channel> channel_;

  DISALLOW_COPY_AND_ASSIGN(NaClBrokerListener);
};

#endif  // CHROME_NACL_NACL_BROKER_LISTENER_H_

// Copyright (c) 2012 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 CHROME_NACL_NACL_BROKER_LISTENER_H_
#define CHROME_NACL_NACL_BROKER_LISTENER_H_
#pragma once

#include "base/memory/scoped_ptr.h"
#include "base/process.h"
#include "chrome/common/nacl_types.h"
#include "ipc/ipc_channel.h"

// The BrokerThread class represents the thread that handles the messages from
// the browser process and starts NaCl loader processes.
class NaClBrokerListener : public IPC::Channel::Listener {
 public:
  NaClBrokerListener();
  ~NaClBrokerListener();

  void Listen();

  // IPC::Channel::Listener implementation.
  virtual void OnChannelConnected(int32 peer_pid) OVERRIDE;
  virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
  virtual void OnChannelError() OVERRIDE;

 private:
  void OnLaunchLoaderThroughBroker(const std::wstring& loader_channel_id);
  void OnStopBroker();

  base::ProcessHandle browser_handle_;
  scoped_ptr<IPC::Channel> channel_;

  DISALLOW_COPY_AND_ASSIGN(NaClBrokerListener);
};

#endif  // CHROME_NACL_NACL_BROKER_LISTENER_H_

NaCl: Remove declaration of non-existent method

BUG=none
TEST=none

Review URL: https://chromiumcodereview.appspot.com/9592039

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


// PARAM: --set ana.activated[+] deadlock
#include <pthread.h>
#include <stdio.h>

int g1, g2;
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t mutex3 = PTHREAD_MUTEX_INITIALIZER;

void *t1(void *arg) {
  pthread_mutex_lock(&mutex3); // NODEADLOCK
  pthread_mutex_lock(&mutex1); // TODO NODEADLOCK (common mutex3)
  pthread_mutex_lock(&mutex2); // TODO NODEADLOCK (common mutex3)
  g1 = g2 + 1;
  pthread_mutex_unlock(&mutex2);
  pthread_mutex_unlock(&mutex1);
  return NULL;
}

void *t2(void *arg) {
  pthread_mutex_lock(&mutex3); // NODEADLOCK
  pthread_mutex_lock(&mutex2); // TODO NODEADLOCK (common mutex3)
  pthread_mutex_lock(&mutex1); // TODO NODEADLOCK (common mutex3)
  g2 = g1 + 1;
  pthread_mutex_unlock(&mutex1);
  pthread_mutex_unlock(&mutex2);
  return NULL;
}

int main(void) {
  pthread_t id1, id2;
  int i;
  for (i = 0; i < 10000; i++) {
    pthread_create(&id1, NULL, t1, NULL);
    pthread_create(&id2, NULL, t2, NULL);
    pthread_join (id1, NULL);
    pthread_join (id2, NULL);
    printf("%d: g1 = %d, g2 = %d.\n", i, g1, g2);
  }
  return 0;
}

Add TODO no deadlock test due to common mutex


/******************************************************************************
**
** Copyright (C) 2009-2011 Kyle Lutz <kyle.r.lutz@gmail.com>
**
** This file is part of chemkit. For more information see
** <http://www.chemkit.org>.
**
** chemkit 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 3 of the License, or
** (at your option) any later version.
**
** chemkit 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 chemkit. If not, see <http://www.gnu.org/licenses/>.
**
******************************************************************************/

#ifndef CHEMKIT_VECTOR3_H
#define CHEMKIT_VECTOR3_H

#include "chemkit.h"

#include "genericvector.h"

namespace chemkit {

/// A three-dimensional vector.
typedef GenericVector<Float> Vector3;

typedef GenericVector<float> Vector3f;
typedef GenericVector<double> Vector3d;

} // end chemkit namespace

#endif // CHEMKIT_VECTOR3_H

/******************************************************************************
**
** Copyright (C) 2009-2011 Kyle Lutz <kyle.r.lutz@gmail.com>
**
** This file is part of chemkit. For more information see
** <http://www.chemkit.org>.
**
** chemkit 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 3 of the License, or
** (at your option) any later version.
**
** chemkit 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 chemkit. If not, see <http://www.gnu.org/licenses/>.
**
******************************************************************************/

#ifndef CHEMKIT_VECTOR3_H
#define CHEMKIT_VECTOR3_H

#include "chemkit.h"

#include "genericvector.h"

namespace chemkit {

/// A three-dimensional vector.
typedef GenericVector<Float> Vector3;

/// A three-dimensional vector containing \c float values.
typedef GenericVector<float> Vector3f;

/// A three-dimensional vector containing \c double values.
typedef GenericVector<double> Vector3d;

} // end chemkit namespace

#endif // CHEMKIT_VECTOR3_H

Add documentation to Vector3 typedefs

Add documentation to Vector3 typedefs

This adds documentation for the Vector3f and Vector3d
typedefs.


/*
 * A solution to Exercise 2-3 in The C Programming Language (Second Edition).
 *
 * This file was written by Damien Dart <damiendart@pobox.com>. This is free
 * and unencumbered software released into the public domain. For more
 * information, please refer to the accompanying "UNLICENCE" file.
 */

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

int32_t htoi(char *);

int main(void)
{
  /* This whole this is pretty fragile. Don't feed it exotic input and things
   * should be ok. A few checks here and there wouldn't go amiss.
   * TODO: Handle invalid and exotic input properly. */
  char *buffer = NULL;
  uint32_t buffer_length = 0;
  char character = 0;
  while ((character = getchar()) != EOF) {
    if (!(isspace(character))) {
      buffer = realloc(buffer, ++buffer_length * sizeof(char));
      buffer[buffer_length - 1] = character;
    }
  }
  buffer = realloc(buffer, ++buffer_length * sizeof(char));
  buffer[buffer_length - 1] = '\0';
  printf("%d\n", htoi(buffer));
  return EXIT_SUCCESS;
}

int32_t htoi(char *string)
{
  int32_t value = 0;
  uint32_t start_position = string[0] == '-' ? 1 : 0;
  if (string[start_position] == '0' &&
      (string[start_position + 1] == 'x' ||
      string[start_position + 1] == 'X')) {
    start_position += 2;
  }
  uint32_t i = 0;
  for ( ; string[i] != '\0'; i++);
  for (uint32_t j = 0; i > start_position; i--, j++) {
    if (string[i - 1] >= '0' && string[i - 1] <= '9') {
      value += (string[i - 1] - '0') * (int)pow(16, j);
    } else if (string[i - 1] >= 'a' && string[i - 1] <= 'f') {
      value += ((string[i - 1] - 'a') + 10) * (int)pow(16, j);
    } else if (string[i - 1] >= 'A' && string[i - 1] <= 'F') {
      value += ((string[i - 1] - 'A') + 10) * (int)pow(16, j);
    } else {
      /* FIXME: Handle invalid input properly. */
      return 0;
    }
  }
  return string[0] == '-' ? -(value) : value;
}

Add solution to Exercise 2-3.

Add solution to Exercise 2-3.


// Copyright (c) 2015, the scalloc project authors.  All rights reserved.
// Please see the AUTHORS file for details.  Use of this source code is governed
// by a BSD license that can be found in the LICENSE file.

#ifndef SCALLOC_PLATFORM_ASSERT_H_
#define SCALLOC_PLATFORM_ASSERT_H_

#include "log.h"

#define DISALLOW_COPY_AND_ASSIGN(TypeName)                                     \
private:                                                                       \
  TypeName(const TypeName&);                                                   \
  void operator=(const TypeName&)

#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)                               \
private:                                                                       \
  TypeName();                                                                  \
  DISALLOW_COPY_AND_ASSIGN(TypeName)

#define DISALLOW_ALLOCATION()                                                  \
public:                                                                        \
  void operator delete(void* pointer) {                                        \
    UNREACHABLE();                                                             \
  }                                                                            \
private:                                                                       \
  void* operator new(size_t size);

#define QUOTEME(x) #x

#ifdef DEBUG

#define ScallocAssert(c) do {                                                  \
  if (!(c)) {                                                                  \
    Fatal("assertion failed: " QUOTEME((c)));                                  \
  }                                                                            \
} while (0)

#else  // !DEBUG

#define ScallocAssert(c) do {                                                  \
} while (0)

#endif  // DEBUG

#define UNREACHABLE()                                                          \
  Fatal("unreachable code segment");

#endif  // SCALLOC_PLATFORM_ASSERT_H_

// Copyright (c) 2015, the scalloc project authors.  All rights reserved.
// Please see the AUTHORS file for details.  Use of this source code is governed
// by a BSD license that can be found in the LICENSE file.

#ifndef SCALLOC_PLATFORM_ASSERT_H_
#define SCALLOC_PLATFORM_ASSERT_H_

#include "log.h"

#define DISALLOW_COPY_AND_ASSIGN(TypeName)                                     \
private:                                                                       \
  TypeName(const TypeName&);                                                   \
  void operator=(const TypeName&)

#define DISALLOW_IMPLICIT_CONSTRUCTORS(TypeName)                               \
private:                                                                       \
  TypeName();                                                                  \
  DISALLOW_COPY_AND_ASSIGN(TypeName)

#define DISALLOW_ALLOCATION()                                                  \
public:                                                                        \
  void operator delete(void* pointer) {                                        \
    UNREACHABLE();                                                             \
  }                                                                            \
private:                                                                       \
  void* operator new(size_t size);

#define QUOTEME(x) #x

#ifdef DEBUG

#define ScallocAssert(c) do {                                                  \
  if (!(c)) {                                                                  \
    Fatal("assertion failed: " QUOTEME((c)));                                  \
  }                                                                            \
} while (0)

#else  // !DEBUG

#define ScallocAssert(c) do {                                                  \
  if (c) {}                                                                    \
} while (0)

#endif  // DEBUG

#define UNREACHABLE()                                                          \
  Fatal("unreachable code segment");

#endif  // SCALLOC_PLATFORM_ASSERT_H_

Allow ScallocAssert() to be used in Release code


/**
arm-016-util.h
*/

#ifndef RPI_UTIL_H
#define RPI_UTIL_H

#define SCREEN_WIDTH    640
#define SCREEN_HEIGHT   480
#define SCREEN_DEPTH    24      /* 16 or 32-bit */

#define COLOUR_DELTA    0.05    /* Float from 0 to 1 incremented by this amount */

#include <math.h>

typedef struct {
    float r;
    float g;
    float b;
    float a;
    } colour_t;

extern void setColor(volatile unsigned char* fb, colour_t pixel, long x, long y, long pitch);

int * getCoordinates();
double scale_to_x_origin(int);
int scale_to_y_pixel(double);

#endif

/**
arm-016-util.h
*/

#ifndef RPI_UTIL_H
#define RPI_UTIL_H

#define SCREEN_WIDTH    640
#define SCREEN_HEIGHT   480
#define SCREEN_DEPTH    24      /* 16 or 32-bit */

#define COLOUR_DELTA    0.05    /* Float from 0 to 1 incremented by this amount */

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

typedef struct {
    float r;
    float g;
    float b;
    float a;
    } colour_t;

extern void setColor(volatile unsigned char* fb, colour_t pixel, long x, long y, long pitch);

extern int * getCoordinates();
extern double scale_to_x_origin(int);
extern int scale_to_y_pixel(double);

#endif

Include stdlib.h and changed function declaration to extern


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

/**
 * @file Software interrupts utility code - ARM implementation
 */

#include <nanokernel.h>
#include <irq_offload.h>

static irq_offload_routine_t offload_routine;
static void *offload_param;

/* Called by __svc */
void _irq_do_offload(void)
{
	offload_routine(offload_param);
}

void irq_offload(irq_offload_routine_t routine, void *parameter)
{
	int key;

	key = irq_lock();
	offload_routine = routine;
	offload_param = parameter;

	__asm__ volatile ("svc #1");

	irq_unlock(key);
}

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

/**
 * @file Software interrupts utility code - ARM implementation
 */

#include <nanokernel.h>
#include <irq_offload.h>

static irq_offload_routine_t offload_routine;
static void *offload_param;

/* Called by __svc */
void _irq_do_offload(void)
{
	offload_routine(offload_param);
}

void irq_offload(irq_offload_routine_t routine, void *parameter)
{
	int key;

	key = irq_lock();
	offload_routine = routine;
	offload_param = parameter;

	__asm__ volatile ("svc #1" : : : "memory");

	irq_unlock(key);
}

arm: Fix irq offload inline asm memory ordering.

Add a "memory" clobber to inline asm SVC call to ensure the compiler
does not reorder the instruction relative to other memory accesses.

Issue found by inspect the source code.  There is no evidence to
suggest that this bug will manifest for any current ARM target using a
current compiler.

Change-Id: I32b1e5ede02a6dbea02bb8f98729fff1cca1ef2a
Signed-off-by: Marcus Shawcroft <cf6354583ee83038f2010cbcbe1b1f2adb85107d@arm.com>


/**
 * PANDA 3D SOFTWARE
 * Copyright (c) Carnegie Mellon University.  All rights reserved.
 *
 * All use of this software is subject to the terms of the revised BSD
 * license.  You should have received a copy of this license along
 * with this source code in a file named "LICENSE."
 *
 * @file stdtypedefs.h
 * @author drose
 * @date 2000-05-12
 */

// This file, and all the other files in this directory, aren't
// intended to be compiled--they're just parsed by CPPParser (and
// interrogate) in lieu of the actual system headers, to generate the
// interrogate database.

#ifndef STDTYPEDEFS_H
#define STDTYPEDEFS_H

typedef long time_t;
typedef long clock_t;

typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned short ushort;
typedef unsigned char uchar;

inline namespace std {
#ifdef _WIN64
  typedef unsigned long long size_t;
  typedef long long ssize_t;
  typedef long long ptrdiff_t;
#else
  typedef unsigned long size_t;
  typedef long ssize_t;
  typedef long ptrdiff_t;
#endif
}

#ifdef __cplusplus
#define NULL 0L
#else
#define NULL ((void *)0)
#endif

// One day, we might extend interrogate to be able to parse this,
// but we currently don't need it.
#define alignas(x)

#endif

/**
 * PANDA 3D SOFTWARE
 * Copyright (c) Carnegie Mellon University.  All rights reserved.
 *
 * All use of this software is subject to the terms of the revised BSD
 * license.  You should have received a copy of this license along
 * with this source code in a file named "LICENSE."
 *
 * @file stdtypedefs.h
 * @author drose
 * @date 2000-05-12
 */

// This file, and all the other files in this directory, aren't
// intended to be compiled--they're just parsed by CPPParser (and
// interrogate) in lieu of the actual system headers, to generate the
// interrogate database.

#ifndef STDTYPEDEFS_H
#define STDTYPEDEFS_H

typedef long time_t;
typedef long clock_t;

typedef unsigned int uint;
typedef unsigned long ulong;
typedef unsigned short ushort;
typedef unsigned char uchar;

inline namespace std {
#ifdef _WIN64
  typedef unsigned long long size_t;
  typedef long long ssize_t;
  typedef long long ptrdiff_t;
#else
  typedef unsigned long size_t;
  typedef long ssize_t;
  typedef long ptrdiff_t;
#endif
}

struct timeval;

#ifdef __cplusplus
#define NULL 0L
#else
#define NULL ((void *)0)
#endif

// One day, we might extend interrogate to be able to parse this,
// but we currently don't need it.
#define alignas(x)

#endif

Fix issue with Windows build

Fix issue with Windows build


@interface DEIgorParserException : NSObject

+ (NSException *)exceptionWithReason:(NSString *)reason scanner:(NSScanner *)scanner;

@end

@interface DEIgorParserException : NSException

+ (NSException *)exceptionWithReason:(NSString *)reason scanner:(NSScanner *)scanner;

@end

Make Igor parser exception extend NSParserException


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

int
main (int argc, char *argv[])
{
  int rank, size, length;
  char name[BUFSIZ];

  MPI_Init (&argc, &argv);
  MPI_Comm_rank (MPI_COMM_WORLD, &rank);
  MPI_Comm_size (MPI_COMM_WORLD, &size);
  MPI_Get_processor_name (name, &length);

  printf ("%s: hello world from process %d of %d\n", name, rank, size);

  MPI_Finalize ();

  return EXIT_SUCCESS;
}

Add missing file for the MPI test.

Add missing file for the MPI test.

git-svn-id: 71c8032c709790ec749031c4215f8515ac00dc5a@27337 70bd8c7a-acb8-0310-9f0d-9cc1c95dcdbb


#include <stdio.h>
#include <unistd.h>

int main(int argc, char const *argv[]) {
    // Waiting to be attached by the debugger.
    int temp = 0;
    while (temp < 30) // Waiting to be attached...
    {
        sleep(1);
        temp++;
    }

    printf("Exiting now\n");
}

#include <stdio.h>
#include <unistd.h>

#if defined(__linux__)
#include <sys/prctl.h>
#endif

int main(int argc, char const *argv[]) {
    int temp;
#if defined(__linux__)
    // Immediately enable any ptracer so that we can allow the stub attach
    // operation to succeed.  Some Linux kernels are locked down so that
    // only an ancestor process can be a ptracer of a process.  This disables that
    // restriction.  Without it, attach-related stub tests will fail.
#if defined(PR_SET_PTRACER) && defined(PR_SET_PTRACER_ANY)
    int prctl_result;

    // For now we execute on best effort basis.  If this fails for
    // some reason, so be it.
    prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0);
    (void) prctl_result;
#endif
#endif

    // Waiting to be attached by the debugger.
    temp = 0;

    while (temp < 30) // Waiting to be attached...
    {
        sleep(1);
        temp++;
    }

    printf("Exiting now\n");
}

Fix TestProcessAttach for Linux ptracer lock-down and llgs-local.

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@220660 91177308-0d34-0410-b5e6-96231b3b80d8


/**
 * \brief A block is a group of variables that must be moved together to improve
 * the goal function without violating already active constraints.
 * The variables in a block are spanned by a tree of active constraints.
 *
 * Authors:
 *   Tim Dwyer <tgdwyer@gmail.com>
 *
 * Copyright (C) 2005 Authors
 *
 * This version is released under the CPL (Common Public License) with
 * the Graphviz distribution.
 * A version is also available under the LGPL as part of the Adaptagrams
 * project: http://sourceforge.net/projects/adaptagrams.
 * If you make improvements or bug fixes to this code it would be much
 * appreciated if you could also contribute those changes back to the
 * Adaptagrams repository.
 */

#ifndef SEEN_REMOVEOVERLAP_BLOCK_H
#define SEEN_REMOVEOVERLAP_BLOCK_H

#include <vector>
#include <iostream>
class Variable;
class Constraint;
template <class T> class PairingHeap;
class StupidPriorityQueue;

class Block
{
	friend std::ostream& operator <<(std::ostream &os,const Block &b);
public:
	std::vector<Variable*> *vars;
	double posn;
	double weight;
	double wposn;
	Block(Variable *v=NULL);
	~Block(void);
	Constraint* findMinLM();
	Constraint* findMinLMBetween(Variable* lv, Variable* rv);
	Constraint* findMinInConstraint();
	Constraint* findMinOutConstraint();
	void deleteMinInConstraint();
	void deleteMinOutConstraint();
	double desiredWeightedPosition();
	void merge(Block *b, Constraint *c, double dist);
	void merge(Block *b, Constraint *c);
	void mergeIn(Block *b);
	void mergeOut(Block *b);
	void split(Block *&l, Block *&r, Constraint *c);
	Constraint* splitBetween(Variable* vl, Variable* vr, Block* &lb, Block* &rb);
	void setUpInConstraints();
	void setUpOutConstraints();
	double cost();
	bool deleted;
	long timeStamp;
	PairingHeap<Constraint*> *in;
	PairingHeap<Constraint*> *out;
private:
	typedef enum {NONE, LEFT, RIGHT} Direction;
	typedef std::pair<double, Constraint*> Pair;
	void reset_active_lm(Variable *v, Variable *u);
	double compute_dfdv(Variable *v, Variable *u, Constraint *&min_lm);
	Pair compute_dfdv_between(
			Variable*, Variable*, Variable*, Direction, bool);
	bool canFollowLeft(Constraint *c, Variable *last);
	bool canFollowRight(Constraint *c, Variable *last);
	void populateSplitBlock(Block *b, Variable *v, Variable *u);
	void addVariable(Variable *v);
	void setUpConstraintHeap(PairingHeap<Constraint*>* &h,bool in);
};

#endif // SEEN_REMOVEOVERLAP_BLOCK_H

Add the vpsc library for IPSEPCOLA features


int f(int x[static volatile /*const*/ 10])
{
	return *++x;
}

main()
{
	int x[5];
	x[1] = 2;
	f(x);
	//int y[1];
	//int *y;
	//#define y (void *)0
	//pipe(y);
}

int f(int x[static /*const*/ 10])
{
	return *++x;
}

main()
{
	int x[5];
	x[1] = 2;
	f(x);
	//int y[1];
	//int *y;
	//#define y (void *)0
	//pipe(y);
}

Remove volatile from test (decl_equal doesn't check properly for now)


/* SPDX-License-Identifier: GPL-2.0 */
/* Copyright (C) 2016-2020 Authors of Cilium */

/*
 * This is just a dummy header with dummy values to allow for test
 * compilation without the full code generation engine backend.
 */
#define DROP_NOTIFY
#ifndef SKIP_DEBUG
#define DEBUG
#endif
#define ENCAP_IFINDEX 1
#define SECLABEL 2
#define SECLABEL_NB 0xfffff
#define CALLS_MAP test_cilium_calls_65535

bpf: Replace CALLS_MAP symbol in compile-tested binaries

Because we don't define CALLS_MAP for several programs, the binaries end
up with 'CALLS_MAP' as the actual map name:

    $ for f in $(ls bpf/*.o); do ( readelf -s $f | grep -q CALLS_MAP ) && echo $f; done
    bpf/bpf_alignchecker.o
    bpf/bpf_network.o
    bpf/bpf_overlay.o
    bpf/bpf_xdp.o

That can lead to warnings when trying to load the programs with
test/bpf/verifier-test.sh. This commit fixes it.

    $ for f in $(ls bpf/*.o); do ( readelf -s $f | grep -q CALLS_MAP ) && echo $f; done
    bpf/bpf_alignchecker.o

Signed-off-by: Paul Chaignon <a027184a55211cd23e3f3094f1fdc728df5e0500@cilium.io>


#define INTERCOM_FLATTEN_DECLARATIONS
#include <intercom.h>
#include "../../intercom-cpp/src/msdef.h"

// Interface definitions.
#ifdef _MSC_VER
#include "msvc/import.h"
#endif

// Platform specific runtime initialization.
void InitializeRuntime();

// Platform specific runtime uninitialization.
void UninitializeRuntime();

// Create Intercom object instance.
HRESULT CreateInstance( REFCLSID clsid, REFIID iid, void** pout );

// Create Intercom object instance.
template <class TInterface>
HRESULT CreateInstance( REFCLSID clsid, REFIID iid, TInterface** pout )
{
	return CreateInstance( clsid, iid, reinterpret_cast< void** >( pout ) );
}

// Interface definitions.
#ifdef _MSC_VER
#include "msvc/import.h"
#else

// Include declarations on non-Windows platforms.
#define INTERCOM_FLATTEN_DECLARATIONS
#include <intercom.h>
#include "../../intercom-cpp/src/msdef.h"

#endif

// Platform specific runtime initialization.
void InitializeRuntime();

// Platform specific runtime uninitialization.
void UninitializeRuntime();

// Create Intercom object instance.
HRESULT CreateInstance( REFCLSID clsid, REFIID iid, void** pout );

// Create Intercom object instance.
template <class TInterface>
HRESULT CreateInstance( REFCLSID clsid, REFIID iid, TInterface** pout )
{
	return CreateInstance( clsid, iid, reinterpret_cast< void** >( pout ) );
}

Include specific declarations only on ńon-Windows platform

The "intercom.h" is not currently visible on Windows build chain.


#include <ent/ent.h>

#if defined __OPENBSD__ || (defined __linux__ && defined _DEFAULT_SOURCE)
# include <unistd.h>
# define getentropy_impl getentropy
#elif defined __APPLE__ && defined __MACH__
# include <sys/random.h>
# define getentropy_impl getentropy
#else
# error "Port: getentropy unimplemented"
#endif

int
ent_getentropy(void *buf, size_t buflen)
{
  return getentropy_impl(buf, buflen);
}

#include <ent/ent.h>

#if defined __OPENBSD__ || (defined __linux__ && defined _DEFAULT_SOURCE)
# include <unistd.h>
# define getentropy_impl getentropy
#elif defined __APPLE__ && defined __MACH__
# include <unistd.h>
# include <sys/random.h>
# define getentropy_impl getentropy
#else
# error "Port: getentropy unimplemented"
#endif

int
ent_getentropy(void *buf, size_t buflen)
{
  return getentropy_impl(buf, buflen);
}

Fix build on OS X

Fix build on OS X


#ifndef BLOCK_PAGE_SIZE
# define BLOCK_PAGE_SIZE 65536
#endif

#include <stddef.h>

struct block {
    void **pages;
    size_t *offsets;
    size_t count;
    size_t size;
};

struct block *block_new(void);

void block_free(struct block*);

void *block_alloc(struct block*, size_t bytes);

#ifndef BLOCK_PAGE_SIZE
# define BLOCK_PAGE_SIZE 4096
#endif

#include <stddef.h>

struct block {
    void **pages;
    size_t *offsets;
    size_t count;
    size_t size;
};

struct block *block_new(void);

void block_free(struct block*);

void *block_alloc(struct block*, size_t bytes);

Use 4KB as the default page size

Use 4KB as the default page size


//============================================================================//
// File:          demo_buffer_fifo.c                                          //
// Description:   Example for CANpie FIFO configuration                       //
//                                                                            //
// Copyright (C) MicroControl GmbH & Co. KG                                   //
// 53844 Troisdorf - Germany                                                  //
// www.microcontrol.net                                                       //
//                                                                            //
//----------------------------------------------------------------------------//
// 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, the following disclaimer and           //
//    the referenced file 'LICENSE'.                                          //
// 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. Neither the name of MicroControl nor the names of its contributors      //
//    may be used to endorse or promote products derived from this software   //
//    without specific prior written permission.                              //
//                                                                            //
// Provided that this notice is retained in full, this software may be        //
// distributed under the terms of the GNU Lesser General Public License       //
// ("LGPL") version 3 as distributed in the 'LICENSE' file.                   //
//                                                                            //
//============================================================================//

#include "cp_core.h"
#include "cp_msg.h"

#define  FIFO_RCV_SIZE  32

static CpFifo_ts        tsFifoRcvS;
static CpCanMsg_ts      atsCanMsgRcvS[FIFO_RCV_SIZE];

//----------------------------------------------------------------------------//
// DemoFifoConfig()                                                           //
//                                                                            //
//----------------------------------------------------------------------------//
void DemoFifoConfig(CpPort_ts * ptsCanPortV)
{
   //------------------------------------------------------
   // set message buffer 2 as receive buffer for classic
   // CAN frame with identifier 180h .. 18Fh
   //
   CpCoreBufferConfig(ptsCanPortV, eCP_BUFFER_2,
                      (uint32_t) 0x180,
                      (uint32_t) 0x7F0,   // mask
                      CP_MSG_FORMAT_CBFF,
                      eCP_BUFFER_DIR_RCV);

   CpFifoInit(&tsFifoRcvS, &atsCanMsgRcvS[0], FIFO_RCV_SIZE);
   CpCoreFifoConfig(ptsCanPortV, eCP_BUFFER_2, &tsFifoRcvS);
}

//----------------------------------------------------------------------------//
// DemoFifoRead()                                                             //
//                                                                            //
//----------------------------------------------------------------------------//
void DemoFifoRead(CpPort_ts * ptsCanPortV)
{
   CpCanMsg_ts  tsCanMsgReadT;
   uint32_t     ulMsgCntT;
   //------------------------------------------------------
   // try to read one CAN message
   //
   ulMsgCntT = 1;
   CpCoreFifoRead(ptsCanPortV, eCP_BUFFER_2,
                  &tsCanMsgReadT,
                  &ulMsgCntT);
}

Add example code for FIFO

Add example code for FIFO


//
//  SouqTask-Bridging-Header.h
//  SouqTask
//
//  Created by Ma'moun Diraneyya on 3/4/16.
//  Copyright © 2016 Mamouneyya. All rights reserved.
//
//  NOTE This workaround is used to import important libraries everywhere in the app
//  REF http://stackoverflow.com/questions/26408612/implicitly-import-specific-swift-module
//

@import Alamofire;
@import AlamofireImage;
@import ObjectMapper;
@import SwiftyUserDefaults;

Create a bridging header so we can import important libraries implicitly.


#include <stdio.h>

#define INPUTS 3
#define HIDDEN 5
#define OUTPUTS 2
#define ROWS 5

typedef struct {
    double input[HIDDEN][INPUTS];
    double hidden[ROWS - 3][HIDDEN][HIDDEN];
    double output[OUTPUTS][HIDDEN];
} Links;

typedef struct {
    int input[INPUTS];
    int hidden[HIDDEN];
    int output[OUTPUTS];
} Neurons;

typedef struct {
    Links weights;
    Neurons values;
} ANN;

int main(void)
{
    return 0;
}

#include <stdio.h>

#define INPUTS 3
#define HIDDEN 5
#define OUTPUTS 2
#define ROWS 5

typedef struct {
    double input[HIDDEN][INPUTS];
    double hidden[ROWS - 3][HIDDEN][HIDDEN];
    double output[OUTPUTS][HIDDEN];
} Links;

typedef struct {
    int input[INPUTS];
    int hidden[ROWS - 3][HIDDEN];
    int output[OUTPUTS];
} Neurons;

typedef struct {
    Links weights;
    Neurons values;
} ANN;

int main(void)
{
    return 0;
}

Fix Neurons struct so that hidden is 2D

Fix Neurons struct so that hidden is 2D


#pragma once

#include "Tab.h"

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

private:
    virtual DLGPROC Command(unsigned short nCode, unsigned short ctrlId);
    virtual DLGPROC Notification(NMHDR *nHdr);

    virtual void Initialize();
    virtual void LoadSettings();

    void OnPositionChanged();
    void OnCustomCheckChanged();
    void OnAnimationChanged();

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

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

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

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

#pragma once

#include "Tab.h"

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

private:
    virtual DLGPROC Command(unsigned short nCode, unsigned short ctrlId);
    virtual DLGPROC Notification(NMHDR *nHdr);

    virtual void Initialize();
    virtual void LoadSettings();

    void OnPositionChanged();
    void OnCustomCheckChanged();
    void OnAnimationChanged();

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

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

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

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

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

Add strings (will be used for translation)


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

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

Update Skia milestone to 95

Update Skia milestone to 95

Change-Id: I17a6adf5f14cfc160c13a2341453e9767ab39f0a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/439158
Reviewed-by: Eric Boren <0e499112533c8544f0505ea0d08394fb5ad7d8fa@google.com>


int main() {
	printf("Hello World!\n");
	return 0;
}

#include <bwio.h>

int main() {
	bwsetfifo(COM2, OFF);
	bwprintf(COM2, "Hello World!\n");
	return 0;
}

Add Makefile, bwio lib, headers and compile script


//
//  Velib.h
//  Bicyclette
//
//  Created by Nicolas on 09/10/10.
//  Copyright 2010 Nicolas Bouilleaud. All rights reserved.
//

#import "CoreDataManager.h"

#import <MapKit/MapKit.h>

#define kVelibStationsListURL		@"http://www.velib.paris.fr/service/carto"
#define kVelibStationsStatusURL		@"http://www.velib.paris.fr/service/stationdetails/"

/****************************************************************************/
#pragma mark -

@class Station;
@class DataUpdater;

@interface VelibModel : CoreDataManager

@property (nonatomic, retain, readonly) DataUpdater * updater;
@property (readonly) BOOL updatingXML;

@property (readonly, nonatomic) MKCoordinateRegion regionContainingData;

@property (readonly, nonatomic, retain) CLRegion * hardcodedLimits;
@end

// reverse link to obtain the CoreDataManager from a moc, for example in the objects implementation.
@interface NSManagedObjectContext (AssociatedModel)
@property (nonatomic, retain, readonly) VelibModel * model;
@end

//
//  Velib.h
//  Bicyclette
//
//  Created by Nicolas on 09/10/10.
//  Copyright 2010 Nicolas Bouilleaud. All rights reserved.
//

#import "CoreDataManager.h"

#import <MapKit/MapKit.h>

#define kVelibStationsListURL		@"http://www.velib.paris.fr/service/carto"
#define kVelibStationsStatusURL		@"http://www.velib.paris.fr/service/stationdetails/paris/"

/****************************************************************************/
#pragma mark -

@class Station;
@class DataUpdater;

@interface VelibModel : CoreDataManager

@property (nonatomic, retain, readonly) DataUpdater * updater;
@property (readonly) BOOL updatingXML;

@property (readonly, nonatomic) MKCoordinateRegion regionContainingData;

@property (readonly, nonatomic, retain) CLRegion * hardcodedLimits;
@end

// reverse link to obtain the CoreDataManager from a moc, for example in the objects implementation.
@interface NSManagedObjectContext (AssociatedModel)
@property (nonatomic, retain, readonly) VelibModel * model;
@end

Fix stations details request url (webservices were updated)


#ifndef VIDEO_SOFTWARE_H
#define VIDEO_SOFTWARE_H

#include "gba-video.h"

#include <pthread.h>

struct GBAVideoSoftwareRenderer {
	struct GBAVideoRenderer d;

	uint16_t* outputBuffer;
	unsigned outputBufferStride;

	union GBARegisterDISPCNT dispcnt;

	pthread_mutex_t mutex;
	pthread_cond_t cond;
};

void GBAVideoSoftwareRendererCreate(struct GBAVideoSoftwareRenderer* renderer);

#endif

#ifndef VIDEO_SOFTWARE_H
#define VIDEO_SOFTWARE_H

#include "gba-video.h"

#include <pthread.h>

struct GBAVideoSoftwareBackground {
	int index;
	int enabled;
	int priority;
	uint32_t charBase;
	int mosaic;
	int multipalette;
	uint32_t screenBase;
	int overflow;
	int size;
	uint16_t x;
	uint16_t y;
	uint32_t refx;
	uint32_t refy;
	uint16_t dx;
	uint16_t dmx;
	uint16_t dy;
	uint16_t dmy;
	uint32_t sx;
	uint32_t sy;
};

struct GBAVideoSoftwareRenderer {
	struct GBAVideoRenderer d;

	uint16_t* outputBuffer;
	unsigned outputBufferStride;

	union GBARegisterDISPCNT dispcnt;

	struct GBAVideoSoftwareBackground bg[4];

	pthread_mutex_t mutex;
	pthread_cond_t cond;
};

void GBAVideoSoftwareRendererCreate(struct GBAVideoSoftwareRenderer* renderer);

#endif

Add struct for keeping track of background state


/*
 *  Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License
 */
/*
 * @file        cynara-creds-commons.h
 * @author      Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
 * @version     1.0
 * @brief       This file contains common APIs for Cynara credentials helper.
 */

#ifndef CYNARA_CREDS_COMMONS_H
#define CYNARA_CREDS_COMMONS_H

#ifdef __cplusplus
extern "C" {
#endif

/* empty initial file */

#ifdef __cplusplus
}
#endif

#endif /* CYNARA_CREDS_COMMONS_H */

/*
 *  Copyright (c) 2014 Samsung Electronics Co., Ltd All Rights Reserved
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License
 */
/*
 * @file        cynara-creds-commons.h
 * @author      Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
 * @author      Radoslaw Bartosiak <r.bartosiak@samsung.com>
 * @author      Aleksander Zdyb <a.zdyb@partner.samsung.com>
 * @version     1.0
 * @brief       This file contains common APIs for Cynara credentials helper.
 */

#ifndef CYNARA_CREDS_COMMONS_H
#define CYNARA_CREDS_COMMONS_H

enum cynara_client_creds {
    CLIENT_METHOD_SMACK,
    CLIENT_METHOD_PID
};

enum cynara_user_creds {
    USER_METHOD_UID,
    USER_METHOD_GID
};

#ifdef __cplusplus
extern "C" {
#endif

/* empty initial file */

#ifdef __cplusplus
}
#endif

#endif /* CYNARA_CREDS_COMMONS_H */

Add enums for credentials acquire methods

Change-Id: I5719a7622a78ae6d1ca86a7dcce986c69abb3e23


#include "../../include/mid.h"
#include <SDL/SDL_error.h>
#include <stdarg.h>
#include <errno.h>
#include <string.h>

enum { Bufsz = 1024 };

static char curerr[Bufsz + 1];

void seterrstr(const char *fmt, ...)
{
	va_list ap;
	va_start(ap, fmt);
	vsnprintf(curerr, Bufsz + 1, fmt, ap);
	va_end(ap);
}

const char *miderrstr(void){
	int err = errno;

	if (curerr[0] != '\0') {
		static char retbuf[Bufsz + 1];
		strncpy(retbuf, curerr, Bufsz);
		retbuf[Bufsz] = '\0';
		curerr[0] = '\0';
		return retbuf;
	}

	const char *e = SDL_GetError();
	if(e[0] != '\0')
		return e;

	return strerror(err);
}

#include "../../include/mid.h"
#include <SDL/SDL_error.h>
#include <stdarg.h>
#include <errno.h>
#include <string.h>

enum { Bufsz = 1024 };

static char curerr[Bufsz];

void seterrstr(const char *fmt, ...)
{
	va_list ap;
	va_start(ap, fmt);
	vsnprintf(curerr, Bufsz, fmt, ap);
	va_end(ap);
}

const char *miderrstr(void){
	int err = errno;

	if (curerr[0] != '\0') {
		static char retbuf[Bufsz];
		strncpy(retbuf, curerr, Bufsz - 1);
		retbuf[Bufsz - 1] = '\0';
		curerr[0] = '\0';
		return retbuf;
	}

	const char *e = SDL_GetError();
	if(e[0] != '\0')
		return e;

	return strerror(err);
}

Change buffer sizes to ease stk5.

Change buffer sizes to ease stk5.


// RUN: %clang -MD -MP -c -x c %s -xc++ %s -Wall -MJ - 2>&1 | FileCheck %s
// RUN: not %clang -c -x c %s -MJ %s/non-existant 2>&1 | FileCheck --check-prefix=ERROR %s

// CHECK: { "directory": "[[CWD:[^"]+]]",  "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc", "[[SRC]]", "-c", "-Wall", "--target={{[^"]+}}"]},
// CHECK: { "directory": "[[CWD:[^"]+]]",  "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc++", "[[SRC]]", "-c", "-Wall", "--target={{[^"]+}}"]},
// ERROR: error: compilation database '{{.*}}/non-existant' could not be opened:

int main(void) {
  return 0;
}

// RUN: %clang -MD -MP --sysroot=somewhere -c -x c %s -xc++ %s -Wall -MJ - 2>&1 | FileCheck %s
// RUN: not %clang -c -x c %s -MJ %s/non-existant 2>&1 | FileCheck --check-prefix=ERROR %s

// CHECK: { "directory": "[[CWD:[^"]+]]",  "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc", "[[SRC]]", "--sysroot=somewhere", "-c", "-Wall", "--target={{[^"]+}}"]},
// CHECK: { "directory": "[[CWD:[^"]+]]",  "file": "[[SRC:[^"]+[/|\\]compilation_database.c]]", "output": "compilation_database.o", "arguments": ["{{[^"]*}}clang{{[^"]*}}", "-xc++", "[[SRC]]", "--sysroot=somewhere", "-c", "-Wall", "--target={{[^"]+}}"]},
// ERROR: error: compilation database '{{.*}}/non-existant' could not be opened:

int main(void) {
  return 0;
}

Make test case slightly more robust by explicitly passing --sysroot.
Otherwise it would change when DEFAULT_SYSROOT is provided.

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


#ifndef __GRAPHICS_TB_H__
#define __GRAPHICS_TB_H__

#include <termbox.h>

#include "models.h"
#include "graphics.h"

typedef struct {}   graphics_tb_t;

// graphics_tb initialize the graphic module.
graphics_tb_t *graphics_tb_init();

// graphics_tb_draw draws the given state on the screen.
void graphics_tb_draw(void *context, state_to_draw_t *state);

// graphics_tb_quit terminate the graphic module.
void graphics_tb_quit(graphics_tb_t *tg);

#endif

#ifndef __GRAPHICS_TB_H__
#define __GRAPHICS_TB_H__

#include <termbox.h>

#include "models.h"
#include "graphics.h"

typedef struct {}   graphics_tb_t;

// graphics_tb initializes the graphic module.
graphics_tb_t *graphics_tb_init();

// graphics_tb_draw draws the given state on the screen.
//
// We do not use `graphics_tb_t *tg` but `void *context` because this function
// is used as a callback and the caller shouldn't have to know about
// graphics_tb. This way, this module is pluggable.
void graphics_tb_draw(void *context, state_to_draw_t *state);

// graphics_tb_quit terminates the graphic module.
void graphics_tb_quit(graphics_tb_t *tg);

#endif

Add an explanation for graphics_*_draw prototype


// vim: sw=4 ts=4 et filetype=c
#include <stdio.h>
#include <stdlib.h>

#include "overseer.h"
#include "iface_lcd.h"
#include "iface_uart.h"
#include "iface_w1_gpio.h"

int main()
{
    sensor_t *sensor_array = malloc(SENSOR_ARRAY_LENGTH * sizeof(*sensor_array));
    size_t actualsize      = getSensorList(sensor_array);
    char outbuf[16];

    (void)uartInit();

    lcdClear();

    int i = 0;

    for (i = 0; i < (int)actualsize; i++)
    {
        printf("Sensor %d (%s) = %g degrees C\n",
               i, sensor_array[i].filename, sensor_array[i].reading);
        snprintf(outbuf, 16, "s%d = %3.1f", i, sensor_array[i].reading);
        lcdWrite(outbuf);
    }
    return 0;
}

// vim: sw=4 ts=4 et filetype=c
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

#include "overseer.h"
#include "iface_lcd.h"
#include "iface_uart.h"
#include "iface_w1_gpio.h"

int main()
{
    sensor_t *sensor_array = malloc(SENSOR_ARRAY_LENGTH * sizeof(*sensor_array));
    size_t actualsize      = getSensorList(sensor_array);
    char outbuf[16];
    int i = 0;
    time_t t;
    struct tm *tmp;

    // Initialize the display
    (void)uartInit();
    lcdClear();

    // Produce a hunk of output for munin
    for (i = 0; i < (int)actualsize; i++)
    {
        printf("sensor_%s.value %g\n",
               sensor_array[i].filename, sensor_array[i].reading);
    }

    // Output the current time to the display
    t = time(NULL);
    tmp = localtime(&t);
    if (tmp == NULL)
    {
        snprintf(outbuf, 16, "Time: NULL");
    }
    else if (strftime(outbuf, 16, "%a %H:%M", tmp) == 0)
    {
        snprintf(outbuf, 16, "Time: INVALID");
    }
    lcdWrite(outbuf);

    // Output two temperatures to the display
    if((int)actualsize > 1)
    {
        snprintf(outbuf, 16, "0=%3.1f 1=%3.1f",
                 sensor_array[0].reading, sensor_array[1].reading);
    }
    else if((int)actualsize > 0)
    {
        snprintf(outbuf, 16, "Temp: %3.1f", sensor_array[0].reading);
    }
    else
    {
        snprintf(outbuf, 16, "NO DATA");
    }
    lcdWrite(outbuf);

    return 0;
}

Adjust output to LCD and console

Adjust output to LCD and console

Better kitchen usefulness w/ a timestamp.
Also munin support!


//===-- HostInfoFreeBSD.h ---------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef lldb_Host_freebsd_HostInfoFreeBSD_h_
#define lldb_Host_freebsd_HostInfoFreeBSD_h_

#include "lldb/Host/posix/HostInfoPosix.h"

namespace lldb_private
{

class HostInfoFreeBSD : public HostInfoPosix
{
  public:
    bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
    bool GetOSBuildString(std::string &s);
    bool GetOSKernelDescription(std::string &s);
};
}

#endif

//===-- HostInfoFreeBSD.h ---------------------------------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

#ifndef lldb_Host_freebsd_HostInfoFreeBSD_h_
#define lldb_Host_freebsd_HostInfoFreeBSD_h_

#include "lldb/Host/posix/HostInfoPosix.h"

namespace lldb_private
{

class HostInfoFreeBSD : public HostInfoPosix
{
  public:
    static bool GetOSVersion(uint32_t &major, uint32_t &minor, uint32_t &update);
    static bool GetOSBuildString(std::string &s);
    static bool GetOSKernelDescription(std::string &s);
};
}

#endif

Fix FreeBSD build after r215992

Fix FreeBSD build after r215992

git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@216021 91177308-0d34-0410-b5e6-96231b3b80d8


// Copyright 2017, Jeffrey E. Bedard
#include "text_widget.h"
#include "XSTextWidget.h"
#include "font.h"
#include "xdata.h"
short xstatus_draw_text_widget(struct XSTextWidget * widget)
{
	xcb_connection_t * xc = widget->connection;
	struct JBDim font_size = xstatus_get_font_size();
	xcb_image_text_8(xc, widget->buffer_size, xstatus_get_window(xc),
		xstatus_get_gc(xc), widget->offset, font_size.height,
		widget->buffer);
	return widget->offset + font_size.width * widget->buffer_size;
}

// Copyright 2017, Jeffrey E. Bedard
#include "text_widget.h"
#include "XSTextWidget.h"
#include "config.h"
#include "font.h"
#include "xdata.h"
short xstatus_draw_text_widget(struct XSTextWidget * widget)
{
	xcb_connection_t * xc = widget->connection;
	struct JBDim font_size = xstatus_get_font_size();
	xcb_image_text_8(xc, widget->buffer_size, xstatus_get_window(xc),
		xstatus_get_gc(xc), widget->offset, font_size.height,
		widget->buffer);
	return widget->offset + font_size.width * widget->buffer_size
		+ XSTATUS_CONST_PAD;
}

Include configured padding in offset calculation.


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

#pragma once

#ifdef _MSC_VER
  #define THRUST_CPP_VER _MSVC_LANG
#else
  #define THRUST_CPP_VER __cplusplus
#endif

#if   THRUST_CPP_VER < 201103L
  #define THRUST_CPP03
  #define THRUST_CPP_DIALECT 2003
#elif THRUST_CPP_VER < 201402L
  #define THRUST_CPP11
  #define THRUST_CPP_DIALECT 2011
#elif THRUST_CPP_VER < 201703L
  #define THRUST_CPP14
  #define THRUST_CPP_DIALECT 2014
#else
  #define THRUST_CPP17
  #define THRUST_CPP_DIALECT 2017
#endif

#undef THRUST_CPP_VER

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

#pragma once

#if   __cplusplus < 201103L
  #define THRUST_CPP03
  #define THRUST_CPP_DIALECT 2003
#elif __cplusplus < 201402L
  #define THRUST_CPP11
  #define THRUST_CPP_DIALECT 2011
#elif __cplusplus < 201703L
  #define THRUST_CPP14
  #define THRUST_CPP_DIALECT 2014
#else
  #define THRUST_CPP17
  #define THRUST_CPP_DIALECT 2017
#endif

Revert "Handle MSVC's definition of __cplusplus"

This reverts commit 20e1c433e05c7147af5c267e0e0a38a781a6efb4.


#ifndef TDCChannel_h
#define TDCChannel_h

#include <fstream>
#include <TObject.h>
#include <TClonesArray.h>
#include <iostream>

#define MAX_FULL_HITS 100

class TDCChannel : public TObject {

protected:
  Int_t channel;

	double leadTime1;
	double trailTime1;
	double tot1;
	double referenceDiff1;

	double leadTimes[MAX_FULL_HITS];
	double trailTimes[MAX_FULL_HITS];
	double tots[MAX_FULL_HITS];
	double referenceDiffs[MAX_FULL_HITS];
	int hitsNum;

public:

  TDCChannel();
  ~TDCChannel();

  void SetChannel(Int_t channel) { this->channel = channel; }
	int GetChannel() { return channel; }

	int GetHitsNum() { return hitsNum; }

	void AddHit(double lead, double trail, double ref);
	void AddHit(double lead, double trail);
	double GetLeadTime1() { return leadTime1; }
	double GetLeadTime(int mult) { return leadTimes[mult]; }
	double GetTrailTime1() { return trailTime1; }
	double GetTrailTime(int mult) { return trailTimes[mult]; }
	double GetTOT1() { return tot1; }
	int GetMult() { return hitsNum; }
	double GetTOT(int mult) { return tots[mult]; }

  ClassDef(TDCChannel,1);
};

#endif

#ifndef TDCChannel_h
#define TDCChannel_h

#include <fstream>
#include <TObject.h>
#include <TClonesArray.h>
#include <iostream>

#define MAX_FULL_HITS 50

class TDCChannel : public TObject {

protected:
  Int_t channel;

	double leadTime1;
	double trailTime1;
	double tot1;
	double referenceDiff1;

	double leadTimes[MAX_FULL_HITS];
	double trailTimes[MAX_FULL_HITS];
	double tots[MAX_FULL_HITS];
	double referenceDiffs[MAX_FULL_HITS];
	int hitsNum;

public:

  TDCChannel();
  ~TDCChannel();

  void SetChannel(Int_t channel) { this->channel = channel; }
	int GetChannel() { return channel; }

	int GetHitsNum() { return hitsNum; }

	void AddHit(double lead, double trail, double ref);
	void AddHit(double lead, double trail);
	double GetLeadTime1() { return leadTime1; }
	double GetLeadTime(int mult) { return leadTimes[mult]; }
	double GetTrailTime1() { return trailTime1; }
	double GetTrailTime(int mult) { return trailTimes[mult]; }
	double GetTOT1() { return tot1; }
	int GetMult() { return hitsNum; }
	double GetTOT(int mult) { return tots[mult]; }

  ClassDef(TDCChannel,1);
};

#endif

Change TDCHits array size from 100 to 50

For consistency with the standalone version
of the Unpacker.


/*
 * $Id$
 */

#include "common.h"
#include "miniobj.h"

extern struct evbase	*mgt_evb;

/* mgt_child.c */
void mgt_run(int dflag);
void mgt_start_child(void);
void mgt_stop_child(void);
extern pid_t mgt_pid, child_pid;

/* mgt_cli.c */

void mgt_cli_init(void);
void mgt_cli_setup(int fdi, int fdo, int verbose);
int mgt_cli_askchild(int *status, char **resp, const char *fmt, ...);
void mgt_cli_start_child(int fdi, int fdo);
void mgt_cli_stop_child(void);

/* mgt_vcc.c */
void mgt_vcc_init(void);
int mgt_vcc_default(const char *bflag, const char *fflag);
int mgt_push_vcls_and_start(int *status, char **p);

/* tcp.c */
int open_tcp(const char *port);

#include "stevedore.h"

extern struct stevedore sma_stevedore;
extern struct stevedore smf_stevedore;

#include "hash_slinger.h"

extern struct hash_slinger hsl_slinger;
extern struct hash_slinger hcl_slinger;

/*
 * $Id$
 */

#include "common.h"
#include "miniobj.h"

extern struct evbase	*mgt_evb;

/* mgt_child.c */
void mgt_run(int dflag);
extern pid_t mgt_pid, child_pid;

/* mgt_cli.c */

void mgt_cli_init(void);
void mgt_cli_setup(int fdi, int fdo, int verbose);
int mgt_cli_askchild(int *status, char **resp, const char *fmt, ...);
void mgt_cli_start_child(int fdi, int fdo);
void mgt_cli_stop_child(void);

/* mgt_vcc.c */
void mgt_vcc_init(void);
int mgt_vcc_default(const char *bflag, const char *fflag);
int mgt_push_vcls_and_start(int *status, char **p);

/* tcp.c */
int open_tcp(const char *port);

#include "stevedore.h"

extern struct stevedore sma_stevedore;
extern struct stevedore smf_stevedore;

#include "hash_slinger.h"

extern struct hash_slinger hsl_slinger;
extern struct hash_slinger hcl_slinger;

Remove prototypes for no longer existing functions

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


#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H

//
// client versioning
//

// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR       0
#define CLIENT_VERSION_MINOR       8
#define CLIENT_VERSION_REVISION    0
#define CLIENT_VERSION_BUILD       0

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE  true

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X

#endif // CLIENTVERSION_H

#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H

//
// client versioning
//

// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR       0
#define CLIENT_VERSION_MINOR       8
#define CLIENT_VERSION_REVISION    1
#define CLIENT_VERSION_BUILD       99

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE  false

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X

#endif // CLIENTVERSION_H

Switch version numbers to 0.8.1.99

Switch version numbers to 0.8.1.99


#import "CoreDataAdditions/NSManagedObject+TDTAdditions.h"
#import "CoreDataAdditions/NSManagedObjectContext+TDTAdditions.h"
#import "CoreDataAdditions/TDTCoreDataUtilityMacros.h"

#ifdef TARGET_IPHONE_OS
  #import "CoreDataAdditions/NSFetchedResultsController+TDTAdditions.h"
#endif

#import "CoreDataAdditions/NSManagedObject+TDTAdditions.h"
#import "CoreDataAdditions/NSManagedObjectContext+TDTAdditions.h"
#import "CoreDataAdditions/TDTCoreDataUtilityMacros.h"

#import "TargetConditionals.h"
#if TARGET_OS_IPHONE
  #import "CoreDataAdditions/NSFetchedResultsController+TDTAdditions.h"
#endif

Fix conditional compilation mechanism for ios


#ifndef __STD_FP16_H__
#define __STD_FP16_H__

typedef struct {
  int16_t integer;
  uint16_t fraction;
} Q16T;

void CastFloatQ16(Q16T *result asm("a0"), float value asm("fp0"));
void CastIntQ16(Q16T *result asm("a0"), int value asm("d0"));
void IAddQ16(Q16T *result asm("a0"), Q16T value asm("d0"));

#endif

Add stubs for fp 16.16 handling rountines.


#import <WebKit/WebKit.h>

typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) {
    WMFWKScriptMessagePeek,
    WMFWKScriptMessageConsoleMessage,
    WMFWKScriptMessageClickLink,
    WMFWKScriptMessageClickImage,
    WMFWKScriptMessageClickReference,
    WMFWKScriptMessageClickEdit,
    WMFWKScriptMessageNonAnchorTouchEndedWithoutDragging,
    WMFWKScriptMessageLateJavascriptTransform,
    WMFWKScriptMessageArticleState,
    WMFWKScriptMessageUnknown
};

@interface WKScriptMessage (WMFScriptMessage)

+ (WMFWKScriptMessageType)wmf_typeForMessageName:(NSString*)name;
+ (Class)wmf_expectedMessageBodyClassForType:(WMFWKScriptMessageType)type;

@end

#import <WebKit/WebKit.h>

typedef NS_ENUM (NSInteger, WMFWKScriptMessageType) {
    WMFWKScriptMessageUnknown,
    WMFWKScriptMessagePeek,
    WMFWKScriptMessageConsoleMessage,
    WMFWKScriptMessageClickLink,
    WMFWKScriptMessageClickImage,
    WMFWKScriptMessageClickReference,
    WMFWKScriptMessageClickEdit,
    WMFWKScriptMessageNonAnchorTouchEndedWithoutDragging,
    WMFWKScriptMessageLateJavascriptTransform,
    WMFWKScriptMessageArticleState
};

@interface WKScriptMessage (WMFScriptMessage)

+ (WMFWKScriptMessageType)wmf_typeForMessageName:(NSString*)name;
+ (Class)wmf_expectedMessageBodyClassForType:(WMFWKScriptMessageType)type;

@end

Move unknown enum entry to top.

Move unknown enum entry to top.


#define REQUIRE_EXPLICIT_ATOMICS 1
#include "rmc.h"

int foo;

// LLVM will want to propagate the knowledge that p == &foo into the
// conditional, breaking our chain. We need to make sure that doesn't
// happen. The optimization is performed by -gvn.
int test(_Rmc(int *)* pp) {
    XEDGE(a, b);
    int *p = L(a, rmc_load(pp));
    if (p == &foo) {
        return L(b, *p);
    }
    return -1;
}

Add a (broken) test for consume-style things where we compare the pointer.


/**
 ******************************************************************************
 * Xenia : Xbox 360 Emulator Research Project                                 *
 ******************************************************************************
 * Copyright 2017 Ben Vanik. All rights reserved.                             *
 * Released under the BSD license - see LICENSE in the root for more details. *
 ******************************************************************************
 */

#ifndef XENIA_BASE_BIT_FIELD_H_
#define XENIA_BASE_BIT_FIELD_H_

#include <cstdint>
#include <cstdlib>
#include <type_traits>

namespace xe {

// Bitfield, where position starts at the LSB.
template <typename T, size_t position, size_t n_bits>
struct bf {
  bf() = default;
  inline operator T() const { return value(); }

  inline T value() const {
    return static_cast<T>((storage & mask()) >> position);
  }

  // For enum values, we strip them down to an underlying type.
  typedef
      typename std::conditional<std::is_enum<T>::value, std::underlying_type<T>,
                                std::identity<T>>::type::type value_type;
  inline value_type mask() const {
    return (((value_type)~0) >> (8 * sizeof(value_type) - n_bits)) << position;
  }

  value_type storage;
};

}  // namespace xe

#endif  // XENIA_BASE_BIT_FIELD_H_

/**
 ******************************************************************************
 * Xenia : Xbox 360 Emulator Research Project                                 *
 ******************************************************************************
 * Copyright 2017 Ben Vanik. All rights reserved.                             *
 * Released under the BSD license - see LICENSE in the root for more details. *
 ******************************************************************************
 */

#ifndef XENIA_BASE_BIT_FIELD_H_
#define XENIA_BASE_BIT_FIELD_H_

#include <cstdint>
#include <cstdlib>
#include <type_traits>

namespace xe {

// Bitfield, where position starts at the LSB.
template <typename T, size_t position, size_t n_bits>
struct bf {
  bf() = default;
  inline operator T() const { return value(); }

  inline T value() const {
    return static_cast<T>((storage & mask()) >> position);
  }

  // For enum values, we strip them down to an underlying type.
  typedef
      typename std::conditional<std::is_enum<T>::value, std::underlying_type<T>,
                                std::remove_reference<T>>::type::type
          value_type;
  inline value_type mask() const {
    return (((value_type)~0) >> (8 * sizeof(value_type) - n_bits)) << position;
  }

  value_type storage;
};

}  // namespace xe

#endif  // XENIA_BASE_BIT_FIELD_H_

Remove usage of non standard identity struct

std::identity was removed from the standards, but Visual Studio kept
it as an extension.

Replace it by std::remove_reference, which does just a little bit
more than std::identity does, but without impact in this case.