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

#ifndef CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_
#define CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_

#include "base/basictypes.h"

#include "testing/gtest/include/gtest/gtest_prod.h"

class Browser;
class FilePath;
namespace IPC {
class Message;
}

class PrintDialogCloud {
 public:
  // Called on the IO thread.
  static void CreatePrintDialogForPdf(const FilePath& path_to_pdf);

 private:
  FRIEND_TEST(PrintDialogCloudTest, HandlersRegistered);

  explicit PrintDialogCloud(const FilePath& path_to_pdf);
  ~PrintDialogCloud();

  // Called as a task from the UI thread, creates an object instance
  // to run the HTML/JS based print dialog for printing through the cloud.
  static void CreateDialogImpl(const FilePath& path_to_pdf);

  Browser* browser_;

  DISALLOW_COPY_AND_ASSIGN(PrintDialogCloud);
};

#endif  // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_

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

#ifndef CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_
#define CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_

#include "base/basictypes.h"

#include "testing/gtest/include/gtest/gtest_prod.h"

class Browser;
class FilePath;
namespace IPC {
class Message;
}

class PrintDialogCloud {
 public:
  // Called on the IO thread.
  static void CreatePrintDialogForPdf(const FilePath& path_to_pdf);

 private:
  FRIEND_TEST(PrintDialogCloudTest, HandlersRegistered);
  FRIEND_TEST(PrintDialogCloudTest, DISABLED_HandlersRegistered);

  explicit PrintDialogCloud(const FilePath& path_to_pdf);
  ~PrintDialogCloud();

  // Called as a task from the UI thread, creates an object instance
  // to run the HTML/JS based print dialog for printing through the cloud.
  static void CreateDialogImpl(const FilePath& path_to_pdf);

  Browser* browser_;

  DISALLOW_COPY_AND_ASSIGN(PrintDialogCloud);
};

#endif  // CHROME_BROWSER_PRINTING_PRINT_DIALOG_CLOUD_H_

Fix the build by updating FRIEND_TEST line.

TBR=maruel

BUG=44547

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

git-svn-id: http://src.chromium.org/svn/trunk/src@47646 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: b756479cc600c3c5ca9c0ab66c4d59e98afcb34d


Solve Time Conversion in c

Solve Time Conversion in c


// Raster Library
// Copyright (C) 2015 David Capello

#ifndef RASTER_BUFFER_VIEW_INCLUDED_H
#define RASTER_BUFFER_VIEW_INCLUDED_H
#pragma once

#include <cassert>
#include <cstdint>
#include <vector>

#include "raster/image_spec.h"

namespace raster {

  // Wrapper for an array of bytes. It doesn't own the data.
  class buffer_view {
  public:
    typedef uint8_t value_type;
    typedef value_type* pointer;
    typedef value_type& reference;

    buffer_view(size_t size, pointer data)
      : m_size(size)
      , m_data(data) {
    }

    template<typename T>
    buffer_view(std::vector<T>& vector)
      : m_size(vector.size())
      , m_data(&vector[0]) {
    }

    size_t size() const { return m_size; }
    pointer begin() { return m_data; }
    pointer end() { return m_data+m_size; }
    const pointer begin() const { return m_data; }
    const pointer end() const { return m_data+m_size; }

    reference operator[](int i) const {
      assert(i >= 0 && i < int(m_size));
      return m_data[i];
    }

  private:
    size_t m_size;
    pointer m_data;
  };

} // namespace raster

#endif

// Raster Library
// Copyright (C) 2015-2016 David Capello

#ifndef RASTER_BUFFER_VIEW_INCLUDED_H
#define RASTER_BUFFER_VIEW_INCLUDED_H
#pragma once

#include <cassert>
#include <cstddef>
#include <cstdint>
#include <vector>

#include "raster/image_spec.h"

namespace raster {

  // Wrapper for an array of bytes. It doesn't own the data.
  class buffer_view {
  public:
    typedef std::uint8_t value_type;
    typedef value_type* pointer;
    typedef value_type& reference;

    buffer_view(std::size_t size, pointer data)
      : m_size(size)
      , m_data(data) {
    }

    template<typename T>
    buffer_view(std::vector<T>& vector)
      : m_size(vector.size())
      , m_data(&vector[0]) {
    }

    std::size_t size() const { return m_size; }
    pointer begin() { return m_data; }
    pointer end() { return m_data+m_size; }
    const pointer begin() const { return m_data; }
    const pointer end() const { return m_data+m_size; }

    reference operator[](int i) const {
      assert(i >= 0 && i < int(m_size));
      return m_data[i];
    }

  private:
    size_t m_size;
    pointer m_data;
  };

} // namespace raster

#endif

Add std:: namespace to int types

Add std:: namespace to int types


/*
 * GoBackward.h
 *
 *  Created on: Mar 25, 2014
 *      Author: user
 */

#ifndef GOBACKWARD_H_
#define GOBACKWARD_H_

#include "Behavior.h"
#include "../Robot.h"
class GoBackward: public Behavior {
public:
	GoBackward(Robot* robot);
	bool startCondition();
	bool stopCondition();
	void action();
	virtual ~GoBackward();
};

#endif /* GOBACKWARD_H_ */

/*
 * GoBackward.h
 *
 *  Created on: Mar 25, 2014
 *      Author: user
 */

#ifndef GOBACKWARD_H_
#define GOBACKWARD_H_

#include "Behavior.h"
#include "../Robot.h"
class GoBackward: public Behavior
{

public:
	GoBackward(Robot* robot);

	bool startCondition();
	bool stopCondition();
	void action();
	virtual ~GoBackward();

private:
	int _steps_count;

};

#endif /* GOBACKWARD_H_ */

Add logic to this behavior

Add logic to this behavior


#ifndef CC_ANALYSIS_ANALYSIS_OPTIONS_H_
#define CC_ANALYSIS_ANALYSIS_OPTIONS_H_

#include <cstddef>

struct AnalysisOptions {
    AnalysisOptions() :
        track_index_translation(true),
        destutter_max_consecutive(3),
        track_chr2drop(true),
        replace_html_entities(true)
    {}

    // General flags:
    // * Map tokens to spans in the original text.
    bool track_index_translations;

    // Preprocessing flags:
    // * Maximum number of consecutive code points before we start dropping them.
    // * Whether to keep track of code point drop counts from destuttering.
    size_t destutter_max_consecutive;
    bool track_chr2drop;

    // Tokenization flags:
    // * Whether to replace HTML entities in the text with their Unicode
    //   equivalents.
    bool replace_html_entities;
};

#endif  // CC_ANALYSIS_ANALYSIS_OPTIONS_H_

#ifndef CC_ANALYSIS_ANALYSIS_OPTIONS_H_
#define CC_ANALYSIS_ANALYSIS_OPTIONS_H_

#include <cstddef>

struct AnalysisOptions {
    AnalysisOptions() :
        destutter_max_consecutive(3),
        replace_html_entities(true)
    {}

    // Preprocessing flags:
    // * Maximum number of consecutive code points before we start dropping them.
    size_t destutter_max_consecutive;

    // Tokenization flags:
    // * Whether to replace HTML entities in the text with their Unicode
    //   equivalents.
    bool replace_html_entities;
};

#endif  // CC_ANALYSIS_ANALYSIS_OPTIONS_H_

Remove them. Deal with them later if perf is actually an issue here.


int
foo(void, int x)
{
	return 0;
}

int
main()
{
	return foo();
}

int
a(void, int i)
{
	return 0;
}

int
b(int i, void)
{
	return 0;
}

int
c(void, void)
{
	return 0;
}

int
d(void, ...)
{
	return 0;
}

int
main()
{
	return 0;
}

Improve error test for void parameter

[tests] Improve error test for void parameter


#ifndef THERMALCONFIG_H
#define THERMALCONFIG_H

#ifndef M_PI
const double M_PI = 3.141592653;
#endif

const double T0 = 273.15;  // [C]

const double R_TSV = 5e-6;  // [m]

/* Thermal conductance */
const double Ksi = 148.0;  // Silicon
const double Kcu = 401.0;  // Copper
const double Kin = 1.5;    // insulator
const double Khs = 2.0;    // Heat sink

/* Thermal capacitance */
const double Csi = 1.66e6;  // Silicon
const double Ccu = 3.2e6;   // Copper
const double Cin = 1.65e6;  // insulator
const double Chs = 2.42e6;  // Heat sink

/* Layer Hight */
const double Hsi = 400e-6;   // Silicon
const double Hcu = 5e-6;     // Copper
const double Hin = 20e-6;    // Insulator
const double Hhs = 1000e-6;  // Heat sink

#endif

#ifndef THERMALCONFIG_H
#define THERMALCONFIG_H

#ifndef M_PI
const double M_PI = 3.141592653;
#endif

const double T0 = 273.15;  // [C]

const double R_TSV = 5e-6;  // [m]

/* Thermal conductance */
const double Ksi = 148.0;  // Silicon
const double Kcu = 401.0;  // Copper
const double Kin = 1.5;    // insulator
const double Khs = 4.0;    // Heat sink

/* Thermal capacitance */
const double Csi = 1.66e6;  // Silicon
const double Ccu = 3.2e6;   // Copper
const double Cin = 1.65e6;  // insulator
const double Chs = 2.42e6;  // Heat sink

/* Layer Hight */
const double Hsi = 400e-6;   // Silicon
const double Hcu = 5e-6;     // Copper
const double Hin = 20e-6;    // Insulator
const double Hhs = 1000e-6;  // Heat sink

#endif

Change default khs to 4

Change default khs to 4


// RUN: %clang_cc1 -verify -fsyntax-only %s

extern int g0 __attribute__((weak));
extern int g1 __attribute__((weak_import));
int g2 __attribute__((weak));
int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
int __attribute__((weak_import)) g4(void);
void __attribute__((weak_import)) g5(void) {
}

struct __attribute__((weak)) s0 {}; // expected-warning {{'weak' attribute only applies to variables, functions, and classes}}
struct __attribute__((weak_import)) s1 {}; // expected-warning {{'weak_import' attribute only applies to variables and functions}}

static int x __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

// rdar://9538608
int C; // expected-note {{previous definition is here}}
extern int C __attribute__((weak_import)); // expected-warning {{an already-declared variable is made a weak_import declaration}}

static int pr14946_x;
extern int pr14946_x  __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

static void pr14946_f();
void pr14946_f() __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

// RUN: %clang_cc1 -verify -fsyntax-only %s

extern int f0() __attribute__((weak));
extern int g0 __attribute__((weak));
extern int g1 __attribute__((weak_import));
int f2() __attribute__((weak));
int g2 __attribute__((weak));
int g3 __attribute__((weak_import)); // expected-warning {{'weak_import' attribute cannot be specified on a definition}}
int __attribute__((weak_import)) g4(void);
void __attribute__((weak_import)) g5(void) {
}

struct __attribute__((weak)) s0 {}; // expected-warning {{'weak' attribute only applies to variables, functions, and classes}}
struct __attribute__((weak_import)) s1 {}; // expected-warning {{'weak_import' attribute only applies to variables and functions}}

static int f() __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}
static int x __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

// rdar://9538608
int C; // expected-note {{previous definition is here}}
extern int C __attribute__((weak_import)); // expected-warning {{an already-declared variable is made a weak_import declaration}}

static int pr14946_x;
extern int pr14946_x  __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

static void pr14946_f();
void pr14946_f() __attribute__((weak)); // expected-error {{weak declaration cannot have internal linkage}}

Add tests for weak functions

[Sema] Add tests for weak functions

I found these checks to be missing, just add some simple cases.

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

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


/**
 * \file express_tests.h
 * \date Jul 4, 2009
 * \author anton
 * \details
 */
#ifndef EXPRESS_TESTS_H_
#define EXPRESS_TESTS_H_

typedef struct _EXPRESS_TEST_DESCRIPTOR {
	const char *name;
	int (*exec)();
} EXPRESS_TEST_DESCRIPTOR;

#define REGISTER_EXPRESS_TEST(descr) static void _register_express_test(){ \
    __asm__( \
            ".section .express_tests\n\t" \
            ".word %0\n\t" \
            ".text\n" \
            : :"i"(&descr)); \
            }

#define DECLARE_EXPRESS_TEST(name, exec) \
	static int exec(); \
	static const EXPRESS_TEST_DESCRIPTOR _descriptor = { name, exec }; \
	REGISTER_EXPRESS_TEST(_descriptor);

int express_tests_execute();

#endif /* EXPRESS_TESTS_H_ */

/**
 * \file express_tests.h
 * \date Jul 4, 2009
 * \author anton
 * \details
 */
#ifndef EXPRESS_TESTS_H_
#define EXPRESS_TESTS_H_

typedef struct _EXPRESS_TEST_DESCRIPTOR {
	const char *name;
	int (*exec)();
} EXPRESS_TEST_DESCRIPTOR;

/*
#define REGISTER_EXPRESS_TEST(descr) static void _register_express_test(){ \
    __asm__( \
            ".section .express_tests\n\t" \
            ".word %0\n\t" \
            ".text\n" \
            : :"i"(&descr)); \
            }

#define DECLARE_EXPRESS_TEST(name, exec) \
	static int exec(); \
	static const EXPRESS_TEST_DESCRIPTOR _descriptor = { name, exec }; \
	REGISTER_EXPRESS_TEST(_descriptor);
*/

#define DECLARE_EXPRESS_TEST(name, exec) \
    static int exec(); \
    static const EXPRESS_TEST_DESCRIPTOR _descriptor = { name, exec }; \
    static const EXPRESS_TEST_DESCRIPTOR *_pdescriptor __attribute__ ((section(".express_tests"))) = &_descriptor;

int express_tests_execute();

#endif /* EXPRESS_TESTS_H_ */

Change declaration express test macros

Change declaration express test macros


// RUN: rm -f %S/statements.ll
// RUN: %clang_cc1 -Wreturn-type %s -emit-llvm-only

void test1(int x) {
switch (x) {
case 111111111111111111111111111111111111111:
bar();
}
}

// Mismatched type between return and function result.
int test2() { return; }
void test3() { return 4; }

void test4() {
bar:
baz:
blong:
bing:
 ;

// PR5131
static long x = &&bar - &&baz;
static long y = &&baz;
  &&bing;
  &&blong;
  if (y)
    goto *y;

  goto *x;
}

// PR3869
int test5(long long b) {
  static void *lbls[] = { &&lbl };
  goto *b;
 lbl:
  return 0;
}

Revert "Clean up in buildbot directories."

This reverts commit 113814.

This patch was never intended to stay in the repository. If you are reading this
from the future, we apologize for the noise.

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


/* * This file is part of meego-im-framework *
 *
 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * Contact: Nokia Corporation (directui@nokia.com)
 *
 * If you have questions regarding the use of this file, please contact
 * Nokia at directui@nokia.com.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 2.1 as published by the Free Software Foundation
 * and appearing in the file LICENSE.LGPL included in the packaging
 * of this file.
 */

#ifndef UT_MIMROTATIONANIMATION_H
#define UT_MIMROTATIONANIMATION_H

#include <QtTest/QtTest>
#include <QObject>

class MIMApplication;

class Ut_MImRotationAnimation : public QObject
{
    Q_OBJECT

private Q_SLOTS:
    void initTestCase();
    void cleanupTestCase();

    void testPassthruHiddenDuringRotation();

private:
    MIMApplication *app;
};

#endif // UT_MIMROTATIONANIMATION_H

Add missing header from previous commit

Changes: Add missing header from previous commit


#ifndef FIX_UNISTD_H
#define FIX_UNISTD_H

#include <unistd.h>

/*
  For some reason the g++ include files on Ultrix 4.3 fail to provide
  these prototypes, even though the Ultrix 4.2 versions did...
  Once again, OSF1 also chokes, unless _AES_SOURCE(?) is defined JCP
*/
#if defined(ULTRIX43) || defined(OSF1)

#if defined(__cplusplus)
extern "C" {
#endif

#if defined(__STDC__) || defined(__cplusplus)
	int symlink( const char *, const char * );
	char *sbrk( int );
	int gethostname( char *, int );
#else
	int symlink();
	char *sbrk();
	int gethostname();
#endif

#if defined(__cplusplus)
}
#endif

#endif	/* ULTRIX43 */

#endif

#ifndef FIX_UNISTD_H
#define FIX_UNISTD_H

#include <unistd.h>

/*
  For some reason the g++ include files on Ultrix 4.3 fail to provide
  these prototypes, even though the Ultrix 4.2 versions did...
  Once again, OSF1 also chokes, unless _AES_SOURCE(?) is defined JCP
*/
#if defined(ULTRIX43) || defined(OSF1)

#if defined(__cplusplus)
extern "C" {
#endif

#if defined(__STDC__) || defined(__cplusplus)
	int symlink( const char *, const char * );
	void *sbrk( ssize_t );
	int gethostname( char *, int );
#else
	int symlink();
	char *sbrk();
	int gethostname();
#endif

#if defined(__cplusplus)
}
#endif

#endif	/* ULTRIX43 */

#endif

Change sbrk() prototype to sensible version with void * and ssize_t.


// RUN: %llvmgcc %s -fasm-blocks -S -o - | grep {\\\*1192}
// Complicated expression as jump target
// XFAIL: *
// XTARGET: darwin

asm void Method3()
{
    mov   eax,[esp+4]
    jmp   [eax+(299-1)*4]
}

Test for llvm-gcc patch 78762.

Test for llvm-gcc patch 78762.

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


// from vim(os_unix.c)

/*
 * Find out if the stack grows upwards or downwards.
 * "p" points to a variable on the stack of the caller.
 */
    static void
check_stack_growth(p)
    char        *p;
{
    int         i;

    stack_grows_downwards = (p > (char *)&i);
}

[C] Copy code from vim to check stack grow direction.


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

#include "common.h"
#include "commands.h"
#include "imap-expunge.h"

bool cmd_close(struct client_command_context *cmd)
{
	struct client *client = cmd->client;
	struct mailbox *mailbox = client->mailbox;
	struct mail_storage *storage;

	if (!client_verify_open_mailbox(cmd))
		return TRUE;

	storage = mailbox_get_storage(mailbox);
	client->mailbox = NULL;

	if (!imap_expunge(mailbox, NULL))
		client_send_untagged_storage_error(client, storage);

	if (mailbox_close(&mailbox) < 0)
                client_send_untagged_storage_error(client, storage);
	client_update_mailbox_flags(client, NULL);

	client_send_tagline(cmd, "OK Close completed.");
	return TRUE;
}

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

#include "common.h"
#include "commands.h"
#include "imap-expunge.h"

bool cmd_close(struct client_command_context *cmd)
{
	struct client *client = cmd->client;
	struct mailbox *mailbox = client->mailbox;
	struct mail_storage *storage;

	if (!client_verify_open_mailbox(cmd))
		return TRUE;

	storage = mailbox_get_storage(mailbox);
	client->mailbox = NULL;

	if (!imap_expunge(mailbox, NULL))
		client_send_untagged_storage_error(client, storage);
	else if (mailbox_sync(mailbox, 0, 0, NULL) < 0)
		client_send_untagged_storage_error(client, storage);

	if (mailbox_close(&mailbox) < 0)
                client_send_untagged_storage_error(client, storage);
	client_update_mailbox_flags(client, NULL);

	client_send_tagline(cmd, "OK Close completed.");
	return TRUE;
}

CLOSE: Synchronize the mailbox after expunging messages to actually get them
expunged.


#ifndef HELPERS_H
#define HELPERS_H

#include <stdlib.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <errno.h>

#include <string>

#define RCV_SIZE 2

char * get_ip_str(const struct sockaddr *sa, char *s, size_t maxlen);

char * addrinfo_to_ip(const addrinfo info, char * ip);

void *get_in_addr(const sockaddr *sa);

std::string recieveFrom(const int sock, char * buffer);

std::string split_message(std::string * key, std::string message);

#endif // HELPERS_H

#ifndef HELPERS_H
#define HELPERS_H

#include <stdlib.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <errno.h>
#include <cstring>

#include <string>

#define RCV_SIZE 2

char * get_ip_str(const struct sockaddr *sa, char *s, size_t maxlen);

char * addrinfo_to_ip(const addrinfo info, char * ip);

void *get_in_addr(const sockaddr *sa);

std::string recieveFrom(const int sock, char * buffer);

std::string split_message(std::string * key, std::string message);

#endif // HELPERS_H

[code/server] Fix ‘strncpy’ was not declared in this scope


/*
 * Copyright 2014, NICTA
 *
 * This software may be distributed and modified according to the terms of
 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
 * See "LICENSE_BSD2.txt" for details.
 *
 * @TAG(NICTA_BSD)
 */

#include <stdint.h>
#include <platsupport/clock.h>

#include <clk.h>

clock_sys_t clock_sys;

unsigned int clktree_get_spi1_freq(void){
    clk_t* clk;
    clk = clk_get_clock(&clock_sys, CLK_SPI1);
    return clk_get_freq(clk);
}

unsigned int clktree_set_spi1_freq(unsigned int rate){
    clk_t* clk;
    clk = clk_get_clock(&clock_sys, CLK_SPI1);
    return clk_set_freq(clk, rate);
}

void clktree__init(void){
    int err;
    err = exynos5_clock_sys_init(cmu_cpu_clk,
                                 cmu_core_clk,
                                 NULL,
                                 NULL,
                                 cmu_top_clk,
                                 NULL,
                                 NULL,
                                 NULL,
                                 NULL,
                                 &clock_sys);
    assert(!err);
    if(err){
        printf("Failed to initialise clock tree\n");
    }
}

/*
 * Copyright 2014, NICTA
 *
 * This software may be distributed and modified according to the terms of
 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
 * See "LICENSE_BSD2.txt" for details.
 *
 * @TAG(NICTA_BSD)
 */

#include <stdint.h>
#include <platsupport/clock.h>

#include <clk.h>

clock_sys_t clock_sys;

unsigned int clktree_get_spi1_freq(void){
    clk_t* clk;
    clk = clk_get_clock(&clock_sys, CLK_SPI1);
    return clk_get_freq(clk);
}

unsigned int clktree_set_spi1_freq(unsigned int rate){
    clk_t* clk;
    clk = clk_get_clock(&clock_sys, CLK_SPI1);
    return clk_set_freq(clk, rate);
}

void clktree__init(void){
    int err;
    err = exynos5_clock_sys_init(cmu_cpu_clk,
                                 cmu_core_clk,
                                 NULL,
                                 NULL,
                                 cmu_top_clk,
                                 NULL,
                                 NULL,
                                 NULL,
                                 NULL,
				 NULL,
                                 &clock_sys);
    assert(!err);
    if(err){
        printf("Failed to initialise clock tree\n");
    }
}

Fix due to the changes in libplatsupport.


// RUN: %clang -target i686-unknown-unknown -O3 -emit-llvm -S -o - %s | FileCheck %s

long long f0(void) {
 struct { unsigned f0 : 32; } x = { 18 };
 return (long long) (x.f0 - (int) 22);
}
// CHECK: @f0()
// CHECK: ret i64 4294967292

long long f1(void) {
 struct { unsigned f0 : 31; } x = { 18 };
 return (long long) (x.f0 - (int) 22);
}
// CHECK: @f1()
// CHECK: ret i64 -4

long long f2(void) {
 struct { unsigned f0     ; } x = { 18 };
 return (long long) (x.f0 - (int) 22);
}
// CHECK: @f2()
// CHECK: ret i64 4294967292

// RUN: %clang -O3 -emit-llvm -S -o - %s | FileCheck %s

long long f0(void) {
 struct { unsigned f0 : 32; } x = { 18 };
 return (long long) (x.f0 - (int) 22);
}
// CHECK: @f0()
// CHECK: ret i64 4294967292

long long f1(void) {
 struct { unsigned f0 : 31; } x = { 18 };
 return (long long) (x.f0 - (int) 22);
}
// CHECK: @f1()
// CHECK: ret i64 -4

long long f2(void) {
 struct { unsigned f0     ; } x = { 18 };
 return (long long) (x.f0 - (int) 22);
}
// CHECK: @f2()
// CHECK: ret i64 4294967292

llvm/ConstantFolding.cpp: Make ReadDataFromGlobal() and FoldReinterpretLoadFromConstPtr() Big-endian-aware.

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


/** @file

  Copyright (c) 2022, Ventana Micro Systems Inc. All rights reserved.<BR>

  This program and the accompanying materials
  are licensed and made available under the terms and conditions of the BSD License
  which accompanies this distribution.  The full text of the license may be found at
  http://opensource.org/licenses/bsd-license.php

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

**/
/*++

Module Name:

  RiscVBoot.h

Abstract:

  This UEFI protocol for RISC-V systems provides early information to the bootloaders or Operating
  Systems. Firmwares like EDK2/u-boot need to implement this protocol on RISC-V UEFI systems.
--*/

#ifndef _RISCV_BOOT_H_
#define _RISCV_BOOT_H_

//
// Global ID for the RISC-V Boot Protocol
//
#define RISCV_EFI_BOOT_PROTOCOL_GUID \
	{ 0xccd15fec, 0x6f73, 0x4eec, { 0x83, 0x95, 0x3e, 0x69, 0xe4, 0xb9, 0x40, 0xbf } }

typedef struct _RISCV_EFI_BOOT_PROTOCOL RISCV_EFI_BOOT_PROTOCOL;

typedef
EFI_STATUS
(EFIAPI *EFI_GET_BOOT_HARTID) (
  IN RISCV_EFI_BOOT_PROTOCOL    *This,
  OUT UINTN 			*BootHartId
  )
/*++

  Routine Description:
    This interface provides the hartid of the boot cpu.

  Arguments:
    This          - Protocol instance pointer.
    BootHartId    - Pointer to the variable receiving the hartid of the boot cpu.

  Returns:
    EFI_SUCCESS 	  - The boot hart id could be returned.
    EFI_INVALID_PARAMETER - This parameter is NULL or does not point to a valid
			    RISCV_EFI_BOOT_PROTOCOL implementation.
    EFI_INVALID_PARAMETER - BootHartId parameter is NULL.

--*/
;

//
// Interface structure for the RISC-V Boot Protocol
//
struct _RISCV_EFI_BOOT_PROTOCOL {
  UINTN    		Revision;
  EFI_GET_BOOT_HARTID  	GetBootHartId;
};

extern EFI_GUID gBlackBoxEfiRiscVBootProtocolGuid;

#endif

uefi-sct/SctPkg: Add header file for RISCV_EFI_BOOT_PROTOCOL

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3837

RISC-V platforms need to support new RISCV_EFI_BOOT_PROTOCOL
to communicate the boot hart ID to the operating system. Add
the required header file for this protocol.

The specification of the protocol is maintained at:
https://github.com/riscv-non-isa/riscv-uefi

Cc: G Edhaya Chandran <Edhaya.Chandran@arm.com>
Cc: Barton Gao <gaojie@byosoft.com.cn>
Cc: Carolyn Gjertsen <Carolyn.Gjertsen@amd.com>
Cc: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
Cc: Eric Jin <eric.jin@intel.com>
Cc: Arvin Chen <arvinx.chen@intel.com>
Cc: Supreeth Venkatesh <Supreeth.Venkatesh@amd.com>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Heinrich Schuchardt <d0f16556e4bb5a699e5016a06ebfc6cd472096d1@canonical.com>
Cc: Abner Chang <abner.chang@hpe.com>

Signed-off-by: Sunil V L <2e3cbc10ab186f96566b5c56fac07befa110be79@ventanamicro.com>
Reviewed-by: Heinrich Schuchardt <d0f16556e4bb5a699e5016a06ebfc6cd472096d1@canonical.com>
Tested-by: Heinrich Schuchardt <d0f16556e4bb5a699e5016a06ebfc6cd472096d1@canonical.com>


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

#ifndef UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_
#define UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_

#include <limits.h>

namespace ui {

#define EVDEV_LONG_BITS (CHAR_BIT * sizeof(long))
#define EVDEV_BITS_TO_LONGS(x) (((x) + EVDEV_LONG_BITS - 1) / EVDEV_LONG_BITS)

static inline int EvdevBitIsSet(const unsigned long* data, int bit) {
  return data[bit / EVDEV_LONG_BITS] & (1UL << (bit % EVDEV_LONG_BITS));
}

}  // namespace ui

#endif  // UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_

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

#ifndef UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_
#define UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_

#include <limits.h>

namespace ui {

#define EVDEV_LONG_BITS (CHAR_BIT * sizeof(long))
#define EVDEV_BITS_TO_LONGS(x) (((x) + EVDEV_LONG_BITS - 1) / EVDEV_LONG_BITS)

static inline bool EvdevBitIsSet(const unsigned long* data, int bit) {
  return data[bit / EVDEV_LONG_BITS] & (1UL << (bit % EVDEV_LONG_BITS));
}

}  // namespace ui

#endif  // UI_EVENTS_OZONE_EVDEV_EVENT_DEVICE_UTIL_H_

Make EvdevBitIsSet return a bool

Make EvdevBitIsSet return a bool

Can't return an int since the result of the operation is a long, so it
can overflow an int leading to errors. Since all usages of EvdevBitIsSet
are looking for a boolean response change it to bool.

BUG=none
NOTRY=true

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

Cr-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#298887}


/*
 * Copyright (c) 2011, Swedish Institute of Computer Science
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the Institute nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * This file is part of the Contiki operating system.
 *
 * Sets up some commands for the CC2420 radio chip.
 */

#include "contiki.h"
#include "contiki-net.h"
#include "cooja-radio.h"
#include "cmd.h"
#include <stdio.h>
#include <string.h>
#include "net/mac/frame802154.h"

int
cmd_handler_cooja(const uint8_t *data, int len)
{
  if(data[0] == '!') {
    if(data[1] == 'C' && len == 3) {
      printf("cooja_cmd: setting channel: %d\n", data[2]);
      radio_set_channel(data[2]);
      return 1;
    } else if(data[1] == 'M' && len == 10) {
        printf("cooja_cmd: Got MAC\n");
        memcpy(uip_lladdr.addr, data+2, sizeof(uip_lladdr.addr));
        linkaddr_set_node_addr((linkaddr_t *) uip_lladdr.addr);
        return 1;
      }
  } else if(data[0] == '?') {
    if(data[1] == 'C' && len == 2) {
      uint8_t buf[4];
      printf("cooja_cmd: getting channel: %d\n", data[2]);
      buf[0] = '!';
      buf[1] = 'C';
      buf[2] = 0;
      cmd_send(buf, 3);
      return 1;
    }
  }
  return 0;
}

Add slip-radio interface module for cooja-radio


//
//  Copyright (c) 2015 Google Inc.
//
//  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.
//

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end

//
//  Copyright (c) 2015 Google Inc.
//
//  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.
//

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (nonatomic, strong) UIWindow *window;

@end

Fix order of property attributes

Fix order of property attributes

Change-Id: I7a313d25a6707bada03328b0799300f07a26ba3b


#include <stdarg.h>

#include "col-internal.h"

struct ColLogger
{
    ColInstance *col;
    /* This is reset on each call to col_log() */
    apr_pool_t *tmp_pool;
};

ColLogger *
logger_make(ColInstance *col)
{
    ColLogger *logger;

    logger = apr_pcalloc(col->pool, sizeof(*logger));
    logger->tmp_pool = make_subpool(col->pool);

    return logger;
}

void
col_log(ColInstance *col, const char *fmt, ...)
{
    va_list args;
    char *str;

    va_start(args, fmt);
    str = apr_pvsprintf(col->log->tmp_pool, fmt, args);
    va_end(args);

    fprintf(stdout, "LOG: %s\n", str);
    apr_pool_clear(col->log->tmp_pool);
}

char *
log_tuple(ColInstance *col, Tuple *tuple)
{
    char *tuple_str = tuple_to_str(tuple, col->log->tmp_pool);
    return apr_pstrcat(col->log->tmp_pool, "{", tuple_str, "}", NULL);
}

char *
log_datum(ColInstance *col, Datum datum, DataType type)
{
    StrBuf *sbuf;

    sbuf = sbuf_make(col->log->tmp_pool);
    datum_to_str(datum, type, sbuf);
    sbuf_append_char(sbuf, '\0');
    return sbuf->data;
}

#include <stdarg.h>

#include "col-internal.h"

struct ColLogger
{
    ColInstance *col;
    /* This is reset on each call to col_log() */
    apr_pool_t *tmp_pool;
};

ColLogger *
logger_make(ColInstance *col)
{
    ColLogger *logger;

    logger = apr_pcalloc(col->pool, sizeof(*logger));
    logger->tmp_pool = make_subpool(col->pool);

    return logger;
}

void
col_log(ColInstance *col, const char *fmt, ...)
{
    va_list args;
    char *str;

    va_start(args, fmt);
    str = apr_pvsprintf(col->log->tmp_pool, fmt, args);
    va_end(args);

    fprintf(stdout, "LOG (%d): %s\n", col->port, str);
    apr_pool_clear(col->log->tmp_pool);
}

char *
log_tuple(ColInstance *col, Tuple *tuple)
{
    char *tuple_str = tuple_to_str(tuple, col->log->tmp_pool);
    return apr_pstrcat(col->log->tmp_pool, "{", tuple_str, "}", NULL);
}

char *
log_datum(ColInstance *col, Datum datum, DataType type)
{
    StrBuf *sbuf;

    sbuf = sbuf_make(col->log->tmp_pool);
    datum_to_str(datum, type, sbuf);
    sbuf_append_char(sbuf, '\0');
    return sbuf->data;
}

Include port number in col_log() output.


/* @(#)root/eg:$Name:  $:$Id: LinkDef.h,v 1.2 2000/09/06 15:15:18 brun Exp $ */

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifdef __CINT__

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

#pragma link C++ class TParticle-;
#pragma link C++ class TAttParticle;
#pragma link C++ class TPrimary;
#pragma link C++ class TGenerator-;
#pragma link C++ class TDatabasePDG+;
#pragma link C++ class TParticlePDG+;

#endif

/* @(#)root/eg:$Name:  $:$Id: LinkDef.h,v 1.3 2000/09/08 16:42:12 brun Exp $ */

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifdef __CINT__

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

#pragma link C++ class TParticle-;
#pragma link C++ class TAttParticle+;
#pragma link C++ class TPrimary+;
#pragma link C++ class TGenerator+;
#pragma link C++ class TDatabasePDG+;
#pragma link C++ class TParticlePDG+;

#endif

Use option + for TAttParticle and TPrimary

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


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

#import "SQLPackRat.h"
#import <sqlite3.h>

Include sqlite3 in bridging header.

Include sqlite3 in bridging header.


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

#include "Index.h"

#include "clang/Index/IndexDataConsumer.h"
#include "clang/Index/IndexSymbol.h"

namespace clang {
namespace clangd {

// Collect all symbols from an AST.
//
// Clients (e.g. clangd) can use SymbolCollector together with
// index::indexTopLevelDecls to retrieve all symbols when the source file is
// changed.
class SymbolCollector : public index::IndexDataConsumer {
public:
  SymbolCollector() = default;

  bool
  handleDeclOccurence(const Decl *D, index::SymbolRoleSet Roles,
                      ArrayRef<index::SymbolRelation> Relations, FileID FID,
                      unsigned Offset,
                      index::IndexDataConsumer::ASTNodeInfo ASTNode) override;

  void finish() override;

  SymbolSlab takeSymbols() const { return std::move(Symbols); }

private:
  // All Symbols collected from the AST.
  SymbolSlab Symbols;
};

} // namespace clangd
} // namespace clang

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

#include "Index.h"

#include "clang/Index/IndexDataConsumer.h"
#include "clang/Index/IndexSymbol.h"

namespace clang {
namespace clangd {

// Collect all symbols from an AST.
//
// Clients (e.g. clangd) can use SymbolCollector together with
// index::indexTopLevelDecls to retrieve all symbols when the source file is
// changed.
class SymbolCollector : public index::IndexDataConsumer {
public:
  SymbolCollector() = default;

  bool
  handleDeclOccurence(const Decl *D, index::SymbolRoleSet Roles,
                      ArrayRef<index::SymbolRelation> Relations, FileID FID,
                      unsigned Offset,
                      index::IndexDataConsumer::ASTNodeInfo ASTNode) override;

  void finish() override;

  SymbolSlab takeSymbols() { return std::move(Symbols); }

private:
  // All Symbols collected from the AST.
  SymbolSlab Symbols;
};

} // namespace clangd
} // namespace clang

[clangd] Remove the const specifier of the takeSymbol method

otherwise we will copy an object.

git-svn-id: a34e9779ed74578ad5922b3306b3d80a0c825546@320574 91177308-0d34-0410-b5e6-96231b3b80d8


/*
 * Copyright IBM Corp. 2001,2008
 *
 * This file contains the IRQ specific code for hvc_console
 *
 */

#include <linux/interrupt.h>

#include "hvc_console.h"

static irqreturn_t hvc_handle_interrupt(int irq, void *dev_instance)
{
	/* if hvc_poll request a repoll, then kick the hvcd thread */
	if (hvc_poll(dev_instance))
		hvc_kick();
	return IRQ_HANDLED;
}

/*
 * For IRQ based systems these callbacks can be used
 */
int notifier_add_irq(struct hvc_struct *hp, int irq)
{
	int rc;

	if (!irq) {
		hp->irq_requested = 0;
		return 0;
	}
	rc = request_irq(irq, hvc_handle_interrupt, IRQF_DISABLED,
			   "hvc_console", hp);
	if (!rc)
		hp->irq_requested = 1;
	return rc;
}

void notifier_del_irq(struct hvc_struct *hp, int irq)
{
	if (!irq)
		return;
	free_irq(irq, hp);
	hp->irq_requested = 0;
}

void notifier_hangup_irq(struct hvc_struct *hp, int irq)
{
	notifier_del_irq(hp, irq);
}

/*
 * Copyright IBM Corp. 2001,2008
 *
 * This file contains the IRQ specific code for hvc_console
 *
 */

#include <linux/interrupt.h>

#include "hvc_console.h"

static irqreturn_t hvc_handle_interrupt(int irq, void *dev_instance)
{
	/* if hvc_poll request a repoll, then kick the hvcd thread */
	if (hvc_poll(dev_instance))
		hvc_kick();
	return IRQ_HANDLED;
}

/*
 * For IRQ based systems these callbacks can be used
 */
int notifier_add_irq(struct hvc_struct *hp, int irq)
{
	int rc;

	if (!irq) {
		hp->irq_requested = 0;
		return 0;
	}
	rc = request_irq(irq, hvc_handle_interrupt, IRQF_DISABLED,
			   "hvc_console", hp);
	if (!rc)
		hp->irq_requested = 1;
	return rc;
}

void notifier_del_irq(struct hvc_struct *hp, int irq)
{
	if (!hp->irq_requested)
		return;
	free_irq(irq, hp);
	hp->irq_requested = 0;
}

void notifier_hangup_irq(struct hvc_struct *hp, int irq)
{
	notifier_del_irq(hp, irq);
}

hvc_console: Call free_irq() only if request_irq() was successful

Only call free_irq if we marked the request_irq has having succeeded
instead of whenever the the sub-driver identified the interrupt to use.

Signed-off-by: Milton Miller <8bd50e0fc26e21e23b28837d9acdf866b237c39d@bga.com>
Signed-off-by: Benjamin Herrenschmidt <a7089bb6e7e92505d88aaff006cbdd60cc9120b6@kernel.crashing.org>


#include <ruby.h>
#include <uuid/uuid.h>

// Define our module constant
VALUE CUUID = Qnil;

// Prototype this
void Init_cuuid();

// Prototype CUUID.generate
VALUE method_generate();

// Define CUUID and the fact it has a class method called generate
void Init_cuuid() {
  int arg_count = 0;
  CUUID = rb_define_module("CUUID");
  rb_define_module_function(CUUID, "generate", method_generate, arg_count);
}

// Implement CUUID.generate
VALUE method_generate(VALUE self) {
  uuid_t uuid_id;
  char uuid_str[128];

  // Generate UUID and grab string version of it
  uuid_generate(uuid_id);
  uuid_unparse(uuid_id, uuid_str);

  // Cast it into a ruby string and return it
  return rb_str_new2(uuid_str);
}

#include <ruby.h>
#include <uuid/uuid.h>

// Define our module constant
VALUE CUUID = Qnil;

// Prototype this
void Init_cuuid();

// Prototype CUUID.generate
VALUE method_generate();

// Define CUUID and the fact it has a class method called generate
void Init_cuuid() {
  int arg_count = 0;
  CUUID = rb_define_module("CUUID");
  rb_define_module_function(CUUID, "generate", method_generate, arg_count);
}

// Implement CUUID.generate
static VALUE method_generate(VALUE self) {
  uuid_t uuid_id;
  char uuid_str[128];

  // Generate UUID and grab string version of it
  uuid_generate(uuid_id);
  uuid_unparse(uuid_id, uuid_str);

  // Cast it into a ruby string and return it
  return rb_str_new2(uuid_str);
}

Make method_generate a static method

Make method_generate a static method

Thanks to @gnufied for the advice!


/*
 * AVR32 endian-conversion functions.
 */
#ifndef __ASM_AVR32_BYTEORDER_H
#define __ASM_AVR32_BYTEORDER_H

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

#ifdef __CHECKER__
extern unsigned long __builtin_bswap_32(unsigned long x);
extern unsigned short __builtin_bswap_16(unsigned short x);
#endif

#define __arch__swab32(x) __builtin_bswap_32(x)
#define __arch__swab16(x) __builtin_bswap_16(x)

#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
# define __BYTEORDER_HAS_U64__
# define __SWAB_64_THRU_32__
#endif

#include <linux/byteorder/big_endian.h>

#endif /* __ASM_AVR32_BYTEORDER_H */

/*
 * AVR32 endian-conversion functions.
 */
#ifndef __ASM_AVR32_BYTEORDER_H
#define __ASM_AVR32_BYTEORDER_H

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

#ifdef __CHECKER__
extern unsigned long __builtin_bswap_32(unsigned long x);
extern unsigned short __builtin_bswap_16(unsigned short x);
#endif

/*
 * avr32-linux-gcc versions earlier than 4.2 improperly sign-extends
 * the result.
 */
#if !(__GNUC__ == 4 && __GNUC_MINOR__ < 2)
#define __arch__swab32(x) __builtin_bswap_32(x)
#define __arch__swab16(x) __builtin_bswap_16(x)
#endif

#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
# define __BYTEORDER_HAS_U64__
# define __SWAB_64_THRU_32__
#endif

#include <linux/byteorder/big_endian.h>

#endif /* __ASM_AVR32_BYTEORDER_H */

Work around byteswap bug in gcc < 4.2

avr32: Work around byteswap bug in gcc < 4.2

gcc versions earlier than 4.2 sign-extends the result of le16_to_cpu()
and friends when we implement __arch__swabX() using
__builtin_bswap_X(). Disable our arch-specific optimizations when those
gcc versions are being used.

Signed-off-by: Haavard Skinnemoen <de7418319212d7eab32260a76732c1f83e514852@atmel.com>


/* sunserialcore.h
 *
 * Generic SUN serial/kbd/ms layer.  Based entirely
 * upon drivers/sbus/char/sunserial.h which is:
 *
 * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
 *
 * Port to new UART layer is:
 *
 * Copyright (C) 2002 David S. Miller (davem@redhat.com)
 */

#ifndef _SERIAL_SUN_H
#define _SERIAL_SUN_H

/* Serial keyboard defines for L1-A processing... */
#define SUNKBD_RESET		0xff
#define SUNKBD_L1		0x01
#define SUNKBD_UP		0x80
#define SUNKBD_A		0x4d

extern unsigned int suncore_mouse_baud_cflag_next(unsigned int, int *);
extern int suncore_mouse_baud_detection(unsigned char, int);

extern int sunserial_register_minors(struct uart_driver *, int);
extern void sunserial_unregister_minors(struct uart_driver *, int);

extern int sunserial_console_match(struct console *, struct device_node *,
				   struct uart_driver *, int, bool);
extern void sunserial_console_termios(struct console *,
				      struct device_node *);

#endif /* !(_SERIAL_SUN_H) */

/* sunserialcore.h
 *
 * Generic SUN serial/kbd/ms layer.  Based entirely
 * upon drivers/sbus/char/sunserial.h which is:
 *
 * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
 *
 * Port to new UART layer is:
 *
 * Copyright (C) 2002 David S. Miller (davem@redhat.com)
 */

#ifndef _SERIAL_SUN_H
#define _SERIAL_SUN_H

#include <linux/device.h>
#include <linux/serial_core.h>
#include <linux/console.h>

/* Serial keyboard defines for L1-A processing... */
#define SUNKBD_RESET		0xff
#define SUNKBD_L1		0x01
#define SUNKBD_UP		0x80
#define SUNKBD_A		0x4d

extern unsigned int suncore_mouse_baud_cflag_next(unsigned int, int *);
extern int suncore_mouse_baud_detection(unsigned char, int);

extern int sunserial_register_minors(struct uart_driver *, int);
extern void sunserial_unregister_minors(struct uart_driver *, int);

extern int sunserial_console_match(struct console *, struct device_node *,
				   struct uart_driver *, int, bool);
extern void sunserial_console_termios(struct console *,
				      struct device_node *);

#endif /* !(_SERIAL_SUN_H) */

pps: Fix build breakage from decoupling pps from tty

Fixes:
tree:   git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-next
head:   bc80fbe46be7430487a45ad92841932bb2eaa3e6
commit: 593fb1ae457aab28b392ac114f6e3358788da985 pps: Move timestamp read into PPS code proper
date:   78 minutes ago
config: make ARCH=sparc defconfig

All error/warnings:

   In file included from drivers/tty/serial/suncore.c:20:0:
>> include/linux/sunserialcore.h:29:15: warning: 'struct device_node' declared inside parameter list [enabled by default]
>> include/linux/sunserialcore.h:29:15: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
>> include/linux/sunserialcore.h:31:18: warning: 'struct device_node' declared inside parameter list [enabled by default]
>> drivers/tty/serial/suncore.c:55:5: error: conflicting types for 'sunserial_console_match'
   include/linux/sunserialcore.h:28:12: note: previous declaration of 'sunserial_console_match' was here
>> drivers/tty/serial/suncore.c:83:1: error: conflicting types for 'sunserial_console_match'
   include/linux/sunserialcore.h:28:12: note: previous declaration of 'sunserial_console_match' was here
>> drivers/tty/serial/suncore.c:85:6: error: conflicting types for 'sunserial_console_termios'
   include/linux/sunserialcore.h:30:13: note: previous declaration of 'sunserial_console_termios' was here

Reported-by: kbuild test robot <24f7fe9d205c8a9f6ade0c2894e14303ca16087f@intel.com>
Cc: George Spelvin <ba324ca7b1c77fc20bb970d5aff6eea9377918a5@horizon.com>
Signed-off-by: Peter Hurley <4b8373d016f277527198385ba72fda0feb5da015@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@linuxfoundation.org>


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

#ifndef CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
#define CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
#pragma once

#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPageOverlay.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebRect.h"

namespace content {
class RenderView;
}

// This class draws the given color on a PageOverlay of a WebView.
class WebViewColorOverlay : public WebKit::WebPageOverlay {
 public:
  WebViewColorOverlay(content::RenderView* render_view, SkColor color);
  virtual ~WebViewColorOverlay();

 private:
  // WebKit::WebPageOverlay implementation:
  virtual void paintPageOverlay(WebKit::WebCanvas* canvas);

  content::RenderView* render_view_;
  SkColor color_;

  DISALLOW_COPY_AND_ASSIGN(WebViewColorOverlay);
};

#endif  // CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_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 CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
#define CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
#pragma once

#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "third_party/skia/include/core/SkColor.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPageOverlay.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebRect.h"

namespace content {
class RenderView;
}

// This class draws the given color on a PageOverlay of a WebView.
class WebViewColorOverlay : public WebKit::WebPageOverlay {
 public:
  WebViewColorOverlay(content::RenderView* render_view, SkColor color);
  virtual ~WebViewColorOverlay();

 private:
  // WebKit::WebPageOverlay implementation:
  virtual void paintPageOverlay(WebKit::WebCanvas* canvas);

  content::RenderView* render_view_;
  SkColor color_;

  DISALLOW_COPY_AND_ASSIGN(WebViewColorOverlay);
};

#endif  // CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_

Fix build break from the future.

Fix build break from the future.

TBR=pfeldman
Review URL: http://codereview.chromium.org/8801036

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


// PARAM: --disable ana.mutex.disjoint_types --set ana.activated[+] "'var_eq'"  --set ana.activated[+] "'symb_locks'"
// copy of 06/02 with additional index accesses
#include<pthread.h>
#include<stdio.h>

struct cache_entry {
  int refs;
  pthread_mutex_t refs_mutex;
} cache[10];

void cache_entry_addref(struct cache_entry *entry) {
  pthread_mutex_lock(&entry->refs_mutex);
  entry->refs++; // NORACE
  (*entry).refs++; // NORACE
  entry[0].refs++; // NORACE
  pthread_mutex_unlock(&entry->refs_mutex);
}

void *t_fun(void *arg) {
  int i;
  for(i=0; i<10; i++)
    cache_entry_addref(&cache[i]); // NORACE
  return NULL;
}

int main () {
  for (int i = 0; i < 10; i++)
    pthread_mutex_init(&cache[i].refs_mutex, NULL);

  int i;
  pthread_t t1;
  pthread_create(&t1, NULL, t_fun, NULL);
  for(i=0; i<10; i++)
    cache_entry_addref(&cache[i]); // NORACE
  return 0;
}

Add symb_locks test with irrelevant index access


/**
    For conditions of distribution and use, see copyright notice in LICENSE

    @file   AttributeChangeType.h
    @brief  Dummy class containing enumeration of attribute/component change types for replication.
            This is done in separate file in order to overcome cyclic inclusion dependency
            between IAttribute and IComponent. */

#pragma once

#include "TundraCoreApi.h"

namespace Tundra
{

/// Dummy class containing enumeration of attribute/component change types for replication.
class TUNDRACORE_API AttributeChange
{
public:
    /// Enumeration of attribute/component change types for replication
    enum Type
    {
        /// Use the current sync method specified in the IComponent this attribute is part of
        Default = 0,
        /// The value will be changed, but no notifications will be sent (even locally). This
        /// is useful when you are doing batch updates of several attributes at a time and want to minimize
        /// the amount of re-processing that is done.
        Disconnected,
        /// The value change will be signalled locally immediately after the change occurs, but
        /// it is not sent to the network.
        LocalOnly,
        /// Replicate: After changing the value, the change will be signalled locally and this change is
        /// transmitted to the network as well.
        Replicate
    };
};

}

/**
    For conditions of distribution and use, see copyright notice in LICENSE

    @file   AttributeChangeType.h
    @brief  Enumeration of attribute/component change types for replication.
            This is done in separate file in order to overcome cyclic inclusion dependency
            between IAttribute and IComponent. */

#pragma once

#include "TundraCoreApi.h"

namespace Tundra
{
namespace AttributeChange
{
/// Enumeration of attribute/component change types for replication
enum Type
{
    /// Use the current sync method specified in the IComponent this attribute is part of
    Default = 0,
    /// The value will be changed, but no notifications will be sent (even locally). This
    /// is useful when you are doing batch updates of several attributes at a time and want to minimize
    /// the amount of re-processing that is done.
    Disconnected,
    /// The value change will be signalled locally immediately after the change occurs, but
    /// it is not sent to the network.
    LocalOnly,
    /// Replicate: After changing the value, the change will be signalled locally and this change is
    /// transmitted to the network as well.
    Replicate
};
} // ~AttributeChange
} // ~Tundra

Make totally unnecessary AttributeChange class namespace instead keeping syntax intact.


/** @file
Utility functions which helps in opcode creation, HII configuration string manipulations,
pop up window creations, setup browser persistence data set and get.

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

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

**/

#ifndef _IFRLIBRARY_INTERNAL_H_
#define _IFRLIBRARY_INTERNAL_H_

#include <Uefi.h>

#include <Protocol/DevicePath.h>

#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/BaseLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/IfrSupportLib.h>

#endif

/** @file
Utility functions which helps in opcode creation, HII configuration string manipulations,
pop up window creations, setup browser persistence data set and get.

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

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

**/

#ifndef _IFRLIBRARY_INTERNAL_H_
#define _IFRLIBRARY_INTERNAL_H_

#include <Uefi.h>

#include <Protocol/DevicePath.h>
#include <Protocol/HiiConfigRouting.h>
#include <Protocol/FormBrowser2.h>

#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/BaseLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/IfrSupportLib.h>

#endif

Add missing protocol header file.

Add missing protocol header file.

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


//
//  AVEHTTPRequestOperationBuilder.h
//  Avenue
//
//  Created by MediaHound on 10/31/14.
//
//

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

#import "AVERequestBuilder.h"

/**
 * A simple AVERequestBuilder that can be configured with a baseURL, request/response serializers,
 * and a security policy.
 *
 * Typically, you can instantiate and configure a single AVEHTTPRequestOperationBuilder,
 * and reususe it when passing in a builder to `AVENetworkManager` methods.
 */
@interface AVEHTTPRequestOperationBuilder : NSObject <AVERequestBuilder>

/**
 * Creates a builder with a base URL.
 */
- (instancetype)initWithBaseURL:(NSString*)url;

/**
 * The builders' base URL
 * All operations built will use this base URL.
 */
@property (strong, nonatomic) NSURL* baseURL;

/**
 * The request serializer for all built operations
 */
@property (strong, nonatomic) AFHTTPRequestSerializer<AFURLRequestSerialization>* requestSerializer;

/**
 * The response serializer for all built operations
 */
@property (strong, nonatomic) AFHTTPResponseSerializer<AFURLResponseSerialization>* responseSerializer;

/**
 * The security policy for all built operations
 */
@property (strong, nonatomic) AFSecurityPolicy* securityPolicy;

@end

//
//  AVEHTTPRequestOperationBuilder.h
//  Avenue
//
//  Created by MediaHound on 10/31/14.
//
//

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

#import "AVERequestBuilder.h"

/**
 * A simple AVERequestBuilder that can be configured with a baseURL, request/response serializers,
 * and a security policy.
 *
 * Typically, you can instantiate and configure a single AVEHTTPRequestOperationBuilder,
 * and reususe it when passing in a builder to `AVENetworkManager` methods.
 */
@interface AVEHTTPRequestOperationBuilder : NSObject <AVERequestBuilder>

/**
 * Creates a builder with a base URL.
 */
- (instancetype)initWithBaseURL:(NSURL*)url;

/**
 * The builders' base URL
 * All operations built will use this base URL.
 */
@property (strong, nonatomic) NSURL* baseURL;

/**
 * The request serializer for all built operations
 */
@property (strong, nonatomic) AFHTTPRequestSerializer<AFURLRequestSerialization>* requestSerializer;

/**
 * The response serializer for all built operations
 */
@property (strong, nonatomic) AFHTTPResponseSerializer<AFURLResponseSerialization>* responseSerializer;

/**
 * The security policy for all built operations
 */
@property (strong, nonatomic) AFSecurityPolicy* securityPolicy;

@end

Update initWithBaseURL to take a URL

Update initWithBaseURL to take a URL


//===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file exposes an interface to promote alloca instructions to SSA
// registers, by using the SSA construction algorithm.
//
//===----------------------------------------------------------------------===//

#ifndef TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
#define TRANSFORMS_UTILS_PROMOTEMEMTOREG_H

#include <vector>

namespace llvm {

class AllocaInst;
class DominatorTree;
class DominanceFrontier;
class AliasSetTracker;

/// isAllocaPromotable - Return true if this alloca is legal for promotion.
/// This is true if there are only loads and stores to the alloca...
///
bool isAllocaPromotable(const AllocaInst *AI);

/// PromoteMemToReg - Promote the specified list of alloca instructions into
/// scalar registers, inserting PHI nodes as appropriate.  This function makes
/// use of DominanceFrontier information.  This function does not modify the CFG
/// of the function at all.  All allocas must be from the same function.
///
/// If AST is specified, the specified tracker is updated to reflect changes
/// made to the IR.
///
void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
                     DominatorTree &DT, AliasSetTracker *AST = 0);

} // End llvm namespace

#endif

//===- PromoteMemToReg.h - Promote Allocas to Scalars -----------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file exposes an interface to promote alloca instructions to SSA
// registers, by using the SSA construction algorithm.
//
//===----------------------------------------------------------------------===//

#ifndef TRANSFORMS_UTILS_PROMOTEMEMTOREG_H
#define TRANSFORMS_UTILS_PROMOTEMEMTOREG_H

#include <vector>

namespace llvm {

class AllocaInst;
class DominatorTree;
class AliasSetTracker;

/// isAllocaPromotable - Return true if this alloca is legal for promotion.
/// This is true if there are only loads and stores to the alloca...
///
bool isAllocaPromotable(const AllocaInst *AI);

/// PromoteMemToReg - Promote the specified list of alloca instructions into
/// scalar registers, inserting PHI nodes as appropriate.  This function makes
/// use of DominanceFrontier information.  This function does not modify the CFG
/// of the function at all.  All allocas must be from the same function.
///
/// If AST is specified, the specified tracker is updated to reflect changes
/// made to the IR.
///
void PromoteMemToReg(const std::vector<AllocaInst*> &Allocas,
                     DominatorTree &DT, AliasSetTracker *AST = 0);

} // End llvm namespace

#endif

Remove a stale forward declaration.

Remove a stale forward declaration.

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


//
// Toolkit header to include the main headers of the 'AFToolkit' library.
//

// Macros
#import "AFDefines.h"
#import "AFKeypath.h"

// Categories
#import "NSObject+Runtime.h"
#import "NSBundle+Universal.h"
#import "UITableViewCell+Universal.h"
#import "UITableView+Universal.h"
#import "UIView+Render.h"

// Common
#import "AFArray.h"
#import "AFArrayView.h"
#import "AFFileHelper.h"
#import "AFKVO.h"
#import "AFLogHelper.h"
#import "AFMutableArray.h"
#import "AFPlatformHelper.h"
#import "AFReachability.h"

// Object provider
#import "AFObjectProvider.h"

// Database
#import "AFDBClient.h"

// MVC
#import "AFView.h"
#import "AFViewController.h"
#import "AFTableView.h"

//
// Toolkit header to include the main headers of the 'AFToolkit' library.
//

// Macros
#import "AFDefines.h"
#import "AFKeypath.h"

// Categories
#import "NSObject+Runtime.h"
#import "NSBundle+Universal.h"
#import "UITableViewCell+Universal.h"
#import "UITableView+Universal.h"
#import "UIView+Render.h"

// Common
#import "AFArray.h"
#import "AFArrayView.h"
#import "AFFileHelper.h"
#import "AFKVO.h"
#import "AFLogHelper.h"
#import "AFMutableArray.h"
#import "AFPlatformHelper.h"
#import "AFReachability.h"

// Object provider
#import "AFObjectProvider.h"
#import "AFObjectModel.h"

// Database
#import "AFDBClient.h"

// MVC
#import "AFView.h"
#import "AFViewController.h"
#import "AFTableView.h"

Add object model to toolkit.h.

Add object model to toolkit.h.


//
//  HTMLElement.h
//  HTMLKit
//
//  Created by Iska on 05/10/14.
//  Copyright (c) 2014 BrainCookie. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface HTMLElement : NSObject

@end

//
//  HTMLElement.h
//  HTMLKit
//
//  Created by Iska on 05/10/14.
//  Copyright (c) 2014 BrainCookie. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface HTMLElement : NSObject

@property (nonatomic, strong, readonly) NSString *tagName;

@end

Add tagname attribute for HTML Element

Add tagname attribute for HTML Element


#ifndef NRF52_HAL_CONF_H__
#define NRF52_HAL_CONF_H__

#define HAL_UART_MODULE_ENABLED
#define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#define HAL_PWM_MODULE_ENABLED
#define HAL_RTC_MODULE_ENABLED
#define HAL_TIMER_MODULE_ENABLED
#define HAL_TWI_MODULE_ENABLED
#define HAL_ADCE_MODULE_ENABLED
#define HAL_TEMP_MODULE_ENABLED
// #define HAL_UARTE_MODULE_ENABLED
// #define HAL_SPIE_MODULE_ENABLED
// #define HAL_TWIE_MODULE_ENABLED

#endif // NRF52_HAL_CONF_H__

#ifndef NRF52_HAL_CONF_H__
#define NRF52_HAL_CONF_H__

#define HAL_UART_MODULE_ENABLED
#define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#define HAL_PWM_MODULE_ENABLED
#define HAL_RTC_MODULE_ENABLED
#define HAL_TIMER_MODULE_ENABLED
#define HAL_TWI_MODULE_ENABLED
#define HAL_ADCE_MODULE_ENABLED
#define HAL_TEMP_MODULE_ENABLED
#define HAL_RNG_MODULE_ENABLED
// #define HAL_UARTE_MODULE_ENABLED
// #define HAL_SPIE_MODULE_ENABLED
// #define HAL_TWIE_MODULE_ENABLED

#endif // NRF52_HAL_CONF_H__

nrf/boards/arduino_primo: Add missing hal_rng config used by random mod.


//PARAM: --sets ana.int.refinement once  --enable ana.int.enums
int main() {
  int x;
  _Bool c;
  if(c) { x--;}
  else { x--;}
  // The veryfier claimed that the fixed-point was not reached here due to a bug in Enums.leq
  // The leq wrongly returned false for the Enums {0} and not{}[0,1]
  return 0;
}

Add failing test case due to buggy Enums.leq


#pragma once

#include <truth/types.h>

#define CPUID_SMAP (1 << 20)
#define CPUID_SMEP (1 << 7)

static inline void cpuid(uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) {
    __asm__ volatile ("cpuid" :
            "=a"(*eax),
            "=b"(*ebx),
            "=c"(*ecx),
            "=d"(*edx)
            : "0" (*eax), "2" (*ecx)
            :);
}

static inline void cpu_flags_set_ac(void) {
    __asm__ volatile ("stac" ::: "cc");
}

static inline void cpu_flags_clear_ac(void) {
    __asm__ volatile ("clac" ::: "cc");
}

static inline void cpu_cr4_set_bit(int bit) {
    __asm__ volatile ("push %%rax\n"
                      "movq %%cr4, %%rax\n"
                      "orq $0, %%rax\n"
                      "movq %%rax, %%cr4\n"
                      "pop %%rax\n"
            : : "a"(bit));
}

static inline void cpu_cr4_clear_bit(int bit) {
    int mask = ~(1 << bit);
    __asm__ volatile ("andq %0, %%cr4" : : "a"(mask));
}

#pragma once

#include <truth/types.h>

#define CPUID_SMAP (1 << 20)
#define CPUID_SMEP (1 << 7)

#define CPU_CR4_SMEP_BIT 20
#define CPU_CR4_SMAP_BIT 21

static inline void cpuid(uint32_t *eax, uint32_t *ebx, uint32_t *ecx, uint32_t *edx) {
    __asm__ volatile ("cpuid" :
            "=a"(*eax),
            "=b"(*ebx),
            "=c"(*ecx),
            "=d"(*edx)
            : "0" (*eax), "2" (*ecx)
            :);
}

static inline void cpu_flags_set_ac(void) {
    __asm__ volatile ("stac" ::: "cc");
}

static inline void cpu_flags_clear_ac(void) {
    __asm__ volatile ("clac" ::: "cc");
}

static inline void cpu_cr4_set_bit(int bit) {
    __asm__ volatile ("push %%rax\n"
                      "movq %%cr4, %%rax\n"
                      "orq $0, %%rax\n"
                      "movq %%rax, %%cr4\n"
                      "pop %%rax\n"
            : : "a"(bit));
}

static inline void cpu_cr4_clear_bit(int bit) {
    int mask = ~(1 << bit);
    __asm__ volatile ("andq %0, %%cr4" : : "a"(mask));
}

Define cr4 SMEP & SMAP bits

Define cr4 SMEP & SMAP bits


/*
 * (C) Copyright 2013 Kurento (http://kurento.org/)
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-2.1.html
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 */
#include <config.h>
#include <gst/gst.h>

#include "kmscrowddetector.h"

static gboolean
init (GstPlugin * plugin)
{
  if (!kms_crowd_detector_plugin_init (plugin))
    return FALSE;

  return TRUE;
}

GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
    GST_VERSION_MINOR,
    kmscrowddetector,
    "Kurento plate detector",
    init, VERSION, GST_LICENSE_UNKNOWN, "Kurento", "http://kurento.com/")

/*
 * (C) Copyright 2013 Kurento (http://kurento.org/)
 *
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser General Public License
 * (LGPL) version 2.1 which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/lgpl-2.1.html
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 */
#include <config.h>
#include <gst/gst.h>

#include "kmscrowddetector.h"

static gboolean
init (GstPlugin * plugin)
{
  if (!kms_crowd_detector_plugin_init (plugin))
    return FALSE;

  return TRUE;
}

GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
    GST_VERSION_MINOR,
    kmscrowddetector,
    "Kurento crowd detector",
    init, VERSION, GST_LICENSE_UNKNOWN, "Kurento", "http://kurento.com/")

Fix error in plugin description

Fix error in plugin description

Change-Id: I2d51e500ed5babb084e5f281c13843bd43f9a690


//
//  PBWebViewController.h
//  Pinbrowser
//
//  Created by Mikael Konutgan on 11/02/2013.
//  Copyright (c) 2013 Mikael Konutgan. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface PBWebViewController : UIViewController <UIWebViewDelegate>

@property (strong, nonatomic) NSURL *URL;

@property (strong, nonatomic) NSArray *activityItems;
@property (strong, nonatomic) NSArray *applicationActivities;
@property (strong, nonatomic) NSArray *excludedActivityTypes;

/**
 * A Boolean indicating whether the web view controller’s toolbar,
 * which displays a stop/refresh, back, forward and share button, is shown.
 * The default value of this property is `YES`.
 */
@property (assign, nonatomic) BOOL showsNavigationToolbar;

- (void)load;
- (void)clear;

@end

//
//  PBWebViewController.h
//  Pinbrowser
//
//  Created by Mikael Konutgan on 11/02/2013.
//  Copyright (c) 2013 Mikael Konutgan. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface PBWebViewController : UIViewController <UIWebViewDelegate>

/**
 * The URL that will be loaded by the web view controller.
 * If there is one present when the web view appears, it will be automatically loaded, by calling `load`,
 * Otherwise, you can set a `URL` after the web view has already been loaded and then manually call `load`.
 */
@property (strong, nonatomic) NSURL *URL;

/** The array of data objects on which to perform the activity. */
@property (strong, nonatomic) NSArray *activityItems;

/** An array of UIActivity objects representing the custom services that your application supports. */
@property (strong, nonatomic) NSArray *applicationActivities;

/** The list of services that should not be displayed. */
@property (strong, nonatomic) NSArray *excludedActivityTypes;

/**
 * A Boolean indicating whether the web view controller’s toolbar,
 * which displays a stop/refresh, back, forward and share button, is shown.
 * The default value of this property is `YES`.
 */
@property (assign, nonatomic) BOOL showsNavigationToolbar;

/**
 * Loads the given `URL`. This is called automatically when the when the web view appears if a `URL` exists,
 * otehrwise it can be called manually.
 */
- (void)load;

/**
 * Clears the contents of the web view.
 */
- (void)clear;

@end

Document all the public properties and methods


// [WriteFile Name=SetInitialMapLocation, Category=Maps]
// [Legal]
// Copyright 2015 Esri.

// 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.
s// [Legal]

#ifndef SET_INITIAL_MAP_LOCATION_H
#define SET_INITIAL_MAP_LOCATION_H

namespace Esri
{
    namespace ArcGISRuntime
    {
        class Map;
        class MapQuickView;
    }
}

#include <QQuickItem>

class SetInitialMapLocation : public QQuickItem
{
    Q_OBJECT

public:
    SetInitialMapLocation(QQuickItem* parent = 0);
    ~SetInitialMapLocation();

    void componentComplete() Q_DECL_OVERRIDE;

private:
    Esri::ArcGISRuntime::Map* m_map;
    Esri::ArcGISRuntime::MapQuickView* m_mapView;
};

#endif // SET_INITIAL_MAP_LOCATION_H

// [WriteFile Name=SetInitialMapLocation, Category=Maps]
// [Legal]
// Copyright 2015 Esri.

// 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.
// [Legal]

#ifndef SET_INITIAL_MAP_LOCATION_H
#define SET_INITIAL_MAP_LOCATION_H

namespace Esri
{
    namespace ArcGISRuntime
    {
        class Map;
        class MapQuickView;
    }
}

#include <QQuickItem>

class SetInitialMapLocation : public QQuickItem
{
    Q_OBJECT

public:
    SetInitialMapLocation(QQuickItem* parent = 0);
    ~SetInitialMapLocation();

    void componentComplete() Q_DECL_OVERRIDE;

private:
    Esri::ArcGISRuntime::Map* m_map;
    Esri::ArcGISRuntime::MapQuickView* m_mapView;
};

#endif // SET_INITIAL_MAP_LOCATION_H

Fix legal comment build error

Fix legal comment build error


#include<2D_element_arithmetic.h>

matrix * elem_matrix_operation(elem (*fp)(elem, float), matrix * m,
        float param) {
    int i, j = 0;
    for(i = 0; i < m->rows; i++) {
        for(j =0; j < m->columns; j++) {
            set_matrix_member(m, i+1, j+1,
                    (*fp)(m->arr[i*m->columns +j], param));
        }
    }
    return m;
}

elem pow_elem(elem x, float p) {
    return (elem)pow(x, p);
}

elem sqroot_elem(elem x, float p) {
    float r = (float)1 / p;
    return pow_elem(x, r);
}

#include<2D_element_arithmetic.h>

matrix * elem_matrix_operation(elem (*fp)(elem, float), matrix * m,
        float param) {
    int i, j = 0;
    for(i = 0; i < m->rows; i++) {
        for(j =0; j < m->columns; j++) {
            set_matrix_member(m, i+1, j+1,
                    (*fp)(m->arr[i*m->columns +j], param));
        }
    }
    return m;
}

elem pow_elem(elem x, float p) {
    return (elem)floor(pow((float)x, p));
}

elem sqroot_elem(elem x, float p) {
    float r = (float)1 / p;
    return pow_elem(x, r);
}

Make explicit the casts and floor division in pow_elem function


// RUN: clang -checker-simple -verify %s

int* f1() {
  int x = 0;
  return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}}
}

int* f2(int y) {
  return &y;  // expected-warning{{Address of stack memory associated with local variable 'y' returned.}} expected-warning{{address of stack memory associated with local variable 'y' returned}}
}

int* f3(int x, int *y) {
  int w = 0;

  if (x)
    y = &w;

  return y; // expected-warning{{Address of stack memory associated with local variable 'w' returned.}}
}

void* compound_literal(int x) {
  if (x)
    return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}} expected-warning{{braces around scalar initializer}}

  int* array[] = {};
  struct s { int z; double y; int w; };
  return &((struct s){ 2, 0.4, 5 * 8 }); // expected-warning{{Address of stack memory}}
}

// RUN: clang -checker-simple -verify %s

int* f1() {
  int x = 0;
  return &x; // expected-warning{{Address of stack memory associated with local variable 'x' returned.}} expected-warning{{address of stack memory associated with local variable 'x' returned}}
}

int* f2(int y) {
  return &y;  // expected-warning{{Address of stack memory associated with local variable 'y' returned.}} expected-warning{{address of stack memory associated with local variable 'y' returned}}
}

int* f3(int x, int *y) {
  int w = 0;

  if (x)
    y = &w;

  return y; // expected-warning{{Address of stack memory associated with local variable 'w' returned.}}
}

void* compound_literal(int x, int y) {
  if (x)
    return &(unsigned short){((unsigned short)0x22EF)}; // expected-warning{{Address of stack memory}} expected-warning{{braces around scalar initializer}}

  int* array[] = {};
  struct s { int z; double y; int w; };

  if (y)
    return &((struct s){ 2, 0.4, 5 * 8 }); // expected-warning{{Address of stack memory}}

  void* p = &((struct s){ 42, 0.4, x ? 42 : 0 });
  return p;
}

Enhance compound literal test case.

Enhance compound literal test case.

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


/*===---- varargs.h - Variable argument handling -------------------------------------===
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*===-----------------------------------------------------------------------===
*/
#ifndef __VARARGS_H
#define __VARARGS_H
  #error "Please use <stdarg.h> instead of <varargs.h>"
#endif

Add a newline at the end of the file.

Add a newline at the end of the file.

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


/*
 * Copyright (c) 2021 Espressif Systems (Shanghai) Co., Ltd.
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#pragma once
#include <mcuboot_config/mcuboot_logging.h>

#define ESP_LOGE(tag, fmt, ...) MCUBOOT_LOG_ERR(fmt, ##__VA_ARGS__)
#define ESP_LOGW(tag, fmt, ...) MCUBOOT_LOG_WRN(fmt, ##__VA_ARGS__)
#define ESP_LOGI(tag, fmt, ...) MCUBOOT_LOG_INF(fmt, ##__VA_ARGS__)
#define ESP_LOGD(tag, fmt, ...) MCUBOOT_LOG_DBG(fmt, ##__VA_ARGS__)

/*
 * SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD
 *
 * SPDX-License-Identifier: Apache-2.0
 */

#pragma once
#include <mcuboot_config/mcuboot_logging.h>

#define ESP_LOGE(tag, fmt, ...) MCUBOOT_LOG_ERR("[%s] " fmt, tag, ##__VA_ARGS__)
#define ESP_LOGW(tag, fmt, ...) MCUBOOT_LOG_WRN("[%s] " fmt, tag, ##__VA_ARGS__)
#define ESP_LOGI(tag, fmt, ...) MCUBOOT_LOG_INF("[%s] " fmt, tag, ##__VA_ARGS__)
#define ESP_LOGD(tag, fmt, ...) MCUBOOT_LOG_DBG("[%s] " fmt, tag, ##__VA_ARGS__)
#define ESP_LOGV(tag, fmt, ...) MCUBOOT_LOG_DBG("[%s] " fmt, tag, ##__VA_ARGS__)

#define ESP_EARLY_LOGE(tag, fmt, ...) MCUBOOT_LOG_ERR("[%s] " fmt, tag, ##__VA_ARGS__)
#define ESP_EARLY_LOGW(tag, fmt, ...) MCUBOOT_LOG_WRN("[%s] " fmt, tag, ##__VA_ARGS__)
#define ESP_EARLY_LOGI(tag, fmt, ...) MCUBOOT_LOG_INF("[%s] " fmt, tag, ##__VA_ARGS__)
#define ESP_EARLY_LOGD(tag, fmt, ...) MCUBOOT_LOG_DBG("[%s] " fmt, tag, ##__VA_ARGS__)
#define ESP_EARLY_LOGV(tag, fmt, ...) MCUBOOT_LOG_DBG("[%s] " fmt, tag, ##__VA_ARGS__)

espressif: Use "TAG" field from ESP_LOG* macros from IDF libraries

Signed-off-by: Gustavo Henrique Nihei <42b1270cfd1a4f11d4db08d9d441d5d8452cd3b6@espressif.com>


/** @file
Implement a utility function named R8_EfiLibCompareLanguage.

  Copyright (c) 2007 - 2008, Intel Corporation

  All rights reserved. This program and the accompanying materials
  are licensed and made available under the terms and conditions of the BSD License
  which accompanies this distribution.  The full text of the license may be found at
  http://opensource.org/licenses/bsd-license.php

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

**/

#ifndef __R8_LIB_H__
#define __R8_LIB_H__

/**
  Compare whether two names of languages are identical.

  @param  Language1              Name of language 1
  @param  Language2              Name of language 2

  @retval TRUE                   same
  @retval FALSE                  not same

**/
BOOLEAN
R8_EfiLibCompareLanguage (
  IN  CHAR8  *Language1,
  IN  CHAR8  *Language2
  )
;

#endif

Update to use DOS format

Update to use DOS format

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


//
//  LKManager.h
//
//  Created by Vlad Gorbenko on 4/21/15.
//  Copyright (c) 2015 Vlad Gorbenko. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "LKLanguage.h"

extern NSString *const LKLanguageDidChangeNotification;

extern NSString *const LKSourceDefault;
extern NSString *const LKSourcePlist;

NSString *LKLocalizedString(NSString *key, NSString *comment);

@interface LKManager : NSObject{
    NSDictionary *_vocabluary;
}

@property (nonatomic, strong) LKLanguage *currentLanguage;
@property (nonatomic, readonly) NSArray *languages;

+ (void)setLocalizationFilename:(NSString *)localizationFilename;

+ (LKManager*)sharedInstance;
+ (void)nextLanguage;

- (NSString *)titleForKeyPathIdentifier:(NSString *)keyPathIdentifier;

+ (NSMutableArray *)simpleViews;
+ (NSMutableArray *)rightToLeftLanguagesCodes;

+ (void)addLanguage:(LKLanguage *)language;
+ (void)removeLanguage:(LKLanguage *)language;

- (NSString *)setLocalizationSource:(NSString *)source;

@end

//
//  LKManager.h
//
//  Created by Vlad Gorbenko on 4/21/15.
//  Copyright (c) 2015 Vlad Gorbenko. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "LKLanguage.h"

extern NSString *const LKLanguageDidChangeNotification;

extern NSString *const LKSourceDefault;
extern NSString *const LKSourcePlist;

NSString *LKLocalizedString(NSString *key, NSString *comment);

@interface LKManager : NSObject{
    NSDictionary *_vocabluary;
}

@property (nonatomic, strong) LKLanguage *currentLanguage;
@property (nonatomic, readonly) NSArray *languages;

+ (void)setLocalizationFilename:(NSString *)localizationFilename;

+ (LKManager*)sharedInstance;
+ (void)nextLanguage;

- (NSString *)titleForKeyPathIdentifier:(NSString *)keyPathIdentifier;

+ (NSMutableArray *)simpleViews;
+ (NSMutableArray *)rightToLeftLanguagesCodes;

+ (void)addLanguage:(LKLanguage *)language;
+ (void)removeLanguage:(LKLanguage *)language;

- (LKLanguage *)languageByCode:(NSString *)code;

- (NSString *)setLocalizationSource:(NSString *)source;

@end

Make language by code public.

Make language by code public.


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

int main(int argc, char *argv[]) {
  int numprocs, rank, namelen;
  char processor_name[MPI_MAX_PROCESSOR_NAME];

  MPI_Init(&argc, &argv);
  MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
  MPI_Comm_rank(MPI_COMM_WORLD, &rank);
  MPI_Get_processor_name(processor_name, &namelen);

  // TODO

  MPI_Finalize();
  return 0;
}

// mat_x num of rows equals to
// mat_a num of rows
#define A_ROWS 3
#define X_ROWS 3
// mat_x num of cols equals to
// mat_b num of cols
#define B_COLS 3
#define X_COLS 3
// mat_a num of cols should be equals to
// mat_b num of rows
#define A_COLS 2
#define B_ROWS 2

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

void print_matrix(char* name, int rows, int cols, int matrix[rows][cols]) {

    printf("\n%s [%d][%d]\n", name, rows, cols);
    for (int row = 0; row < rows; row++){
        for (int col = 0; col < cols; col++)
            printf("%d ", matrix[row][col]);
        printf("\n");
    }
}

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

    int matrix_a [A_ROWS][A_COLS] = {
        {9, 0},
        {5, 6},
        {1, 2}
    };

    int matrix_b [B_ROWS][B_COLS] = {
        {2, 4, 3},
        {7, 8, 9}
    };

    int matrix_x [X_ROWS][X_COLS];

    // multipy matrices a and b
    for (int row = 0; row < A_ROWS; row++) {
        for (int col = 0; col < B_COLS; col++) {
            int sum = 0;
            for (int ctrl = 0; ctrl < B_ROWS; ctrl++)
                sum = sum + matrix_a[row][ctrl] * matrix_b[ctrl][col];
            matrix_x[row][col] = sum;
        }
    }

    print_matrix("Matrix A", A_ROWS, A_COLS, matrix_a);
    print_matrix("Matrix B", B_ROWS, B_COLS, matrix_b);
    print_matrix("Matrix X", X_ROWS, X_COLS, matrix_x);

    printf("\n");

    // TODO

    // int numprocs, rank, namelen;
    // char processor_name[MPI_MAX_PROCESSOR_NAME];

    // MPI_Init(&argc, &argv);
    // MPI_Comm_size(MPI_COMM_WORLD, &numprocs);
    // MPI_Comm_rank(MPI_COMM_WORLD, &rank);
    // MPI_Get_processor_name(processor_name, &namelen);

    // MPI_Finalize();

    return 0;
}

Add matrix multiplication code in C

Add matrix multiplication code in C


/* This file was auto-generated by KreMLin! */
#ifndef __Random_H
#define __Random_H

#include "kremlib.h"
#include "config.h"
#include "drng.h"
#include "cpuid.h"

typedef uint8_t u8;

typedef uint32_t u32;

typedef uint64_t u64;

typedef uint8_t *bytes;

uint32_t random_uint32();

uint64_t random_uint64();

void random_bytes(uint8_t *rand, uint32_t n);

uint32_t randseed_uint32();

uint64_t randseed_uint64();
#endif

/* This file was auto-generated by KreMLin! */
#ifndef __Random_H
#define __Random_H

#include "kremlib.h"
#include "config.h"
#include "drng.h"
#include "cpuid.h"

typedef uint8_t u8;

typedef uint32_t u32;

typedef uint64_t u64;

uint32_t random_uint32();

uint64_t random_uint64();

void random_bytes(uint8_t *rand, uint32_t n);

uint32_t randseed_uint32();

uint64_t randseed_uint64();
#endif

Remove a redifinition of type 'bytes'

Remove a redifinition of type 'bytes'


/**
 @mainpage M-Stack

 @section Intro
 This is M-Stack, a free USB Device Stack for PIC Microcontrollers. For more information, see the Public API Page.

 */

/**
 @mainpage M-Stack

 @section Intro
 This is M-Stack, a free USB Device Stack for PIC Microcontrollers.

 For more information, see the main web page.

 For API documentation, see the Public API Page.

 */

doxygen: Add web page link to the main doxygen page


/// @file
/// @brief Defines SpeciedDialog class.

#ifndef SPECIES_DIALOG_H
#define SPECIES_DIALOG_H

namespace fish_detector {

class SpeciesDialog : public QDialog {
  Q_OBJECT
#ifndef NO_TESTING
  friend class TestSpeciesDialog;
#endif
public:
  /// @brief Constructor.
  ///
  /// @param parent Parent widget.
  explicit SpeciesDialog(QWidget *parent = 0);

private slots:
  /// @brief Emits the accepted signal.
  void on_ok_clicked();

  /// @brief Emits the rejected signal.
  void on_cancel_clicked();

  /// @brief Removes currently selected subspecies.
  void on_removeSubspecies_clicked();

  /// @brief Adds a new subspecies.
  void on_addSubspecies_clicked();

  /// @brief Returns a Species object corresponding to the dialog values.
  ///
  /// @return Species object corresponding to the dialog values.
  Species getSpecies();
};

} // namespace fish_detector

#endif // SPECIES_DIALOG_H

/// @file
/// @brief Defines SpeciesDialog class.

#ifndef SPECIES_DIALOG_H
#define SPECIES_DIALOG_H

#include <memory>

#include <QWidget>
#include <QDialog>

#include "fish_detector/common/species.h"

namespace Ui {
  class SpeciesDialog;
}

namespace fish_detector {

class SpeciesDialog : public QDialog {
  Q_OBJECT
#ifndef NO_TESTING
  friend class TestSpeciesDialog;
#endif
public:
  /// @brief Constructor.
  ///
  /// @param parent Parent widget.
  explicit SpeciesDialog(QWidget *parent = 0);

  /// @brief Returns a Species object corresponding to the dialog values.
  ///
  /// @return Species object corresponding to the dialog values.
  Species getSpecies();

private slots:
  /// @brief Emits the accepted signal.
  void on_ok_clicked();

  /// @brief Emits the rejected signal.
  void on_cancel_clicked();

  /// @brief Removes currently selected subspecies.
  void on_removeSubspecies_clicked();

  /// @brief Adds a new subspecies.
  void on_addSubspecies_clicked();

private:
  /// @brief Widget loaded from ui file.
  std::unique_ptr<Ui::SpeciesDialog> ui_;
};

} // namespace fish_detector

#endif // SPECIES_DIALOG_H

Add function returning Species object

Add function returning Species object


// 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_PLUGINS_PPAPI_PPP_PDF_H_
#define WEBKIT_PLUGINS_PPAPI_PPP_PDF_H_

#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_point.h"
#include "ppapi/c/pp_var.h"

#define PPP_PDF_INTERFACE_1 "PPP_Pdf;1"

struct PPP_Pdf_1 {
  // Returns an absolute URL if the position is over a link.
  PP_Var (*GetLinkAtPosition)(PP_Instance instance,
                              PP_Point point);
};

typedef PPP_Pdf_1 PPP_Pdf;

#endif  // WEBKIT_PLUGINS_PPAPI_PPP_PDF_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_PLUGINS_PPAPI_PPP_PDF_H_
#define WEBKIT_PLUGINS_PPAPI_PPP_PDF_H_

#include "ppapi/c/pp_instance.h"
#include "ppapi/c/pp_point.h"
#include "ppapi/c/pp_var.h"

#define PPP_PDF_INTERFACE_1 "PPP_Pdf;1"
#define PPP_PDF_INTERFACE PPP_PDF_INTERFACE_1

struct PPP_Pdf_1 {
  // Returns an absolute URL if the position is over a link.
  PP_Var (*GetLinkAtPosition)(PP_Instance instance,
                              PP_Point point);
};

typedef PPP_Pdf_1 PPP_Pdf;

#endif  // WEBKIT_PLUGINS_PPAPI_PPP_PDF_H_

Add missing unversioned interface-name macro for PPP_Pdf.

BUG=107398

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

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


#include "syshead.h"
#include "dst.h"
#include "ip.h"
#include "arp.h"

int dst_neigh_output(struct sk_buff *skb)
{
    struct iphdr *iphdr = ip_hdr(skb);
    struct netdev *netdev = skb->netdev;
    uint8_t *dmac = arp_get_hwaddr(iphdr->daddr);
    int rc;

    if (dmac) {
        return netdev_transmit(skb, dmac, ETH_P_IP);
    } else {
        rc = arp_request(iphdr->saddr, iphdr->daddr, netdev);
        free_skb(skb);
        return rc;
    }
}

#include "syshead.h"
#include "dst.h"
#include "ip.h"
#include "arp.h"

int dst_neigh_output(struct sk_buff *skb)
{
    struct iphdr *iphdr = ip_hdr(skb);
    struct netdev *netdev = skb->netdev;
    uint8_t *dmac = arp_get_hwaddr(iphdr->daddr);
    int rc;

    if (dmac) {
        return netdev_transmit(skb, dmac, ETH_P_IP);
    } else {
        rc = arp_request(iphdr->saddr, iphdr->daddr, netdev);

        while ((dmac = arp_get_hwaddr(iphdr->daddr)) == NULL) {
            sleep(1);
        }

        return netdev_transmit(skb, dmac, ETH_P_IP);
    }
}

Add ugly hack for waiting that ARP cache gets populated

We do not have a retransmission system implemented yet,
so let's sleep here for a while in order to get the ARP entry
if it is missing.


/*
 * Copyright (c) 2008 Digital Bazaar, Inc.  All rights reserved.
 */
#ifndef db_util_Macros_H
#define db_util_Macros_H

/**
 * Miscellaneous general use macros.
 */

/**
 * Macro statement wrapper.  Adapted from glib.
 * Use:
 * if(x) DB_STMT_START { ... } DB_STMT_END; else ...
 */
#define DB_STMT_START do
#define DB_STMT_END while (0)

/**
 * Convert argument to a string
 */
#define DB_STRINGIFY(arg) #arg

/**
 * String representing the current code location.
 */
#define DB_STRLOC __FILE__ ":" DB_STRINGIFY(__LINE__)

#endif

/*
 * Copyright (c) 2008 Digital Bazaar, Inc.  All rights reserved.
 */
#ifndef db_util_Macros_H
#define db_util_Macros_H

/**
 * Miscellaneous general use macros.
 */

/**
 * Macro statement wrapper.  Adapted from glib.
 * Use:
 * if(x) DB_STMT_START { ... } DB_STMT_END; else ...
 */
#define DB_STMT_START do
#define DB_STMT_END while (0)

/**
 * Convert argument to a string
 */
#define DB_STRINGIFY_ARG(arg) #arg
#define DB_STRINGIFY(arg) DB_STRINGIFY_ARG(arg)

/**
 * String representing the current code location.
 */
#define DB_STRLOC __FILE__ ":" DB_STRINGIFY(__LINE__)

#endif

Fix DB_STRINGIFY to indirectly convert arg to a string.


// RUN: %clang_cc1 -verify -fsyntax-only -Wformat -Wno-format-y2k
// rdar://9504680

void foo(const char *, ...) __attribute__((__format__ (__printf__, 1, 2)));

void bar(unsigned int a) {
        foo("%s", a); // expected-warning {{format specifies type 'char *' but the argument has type 'unsigned int'}}
}

// RUN: %clang_cc1 -verify -fsyntax-only -Wformat -Wno-format-y2k %s
// rdar://9504680

void foo(const char *, ...) __attribute__((__format__ (__printf__, 1, 2)));

void bar(unsigned int a) {
        foo("%s", a); // expected-warning {{format specifies type 'char *' but the argument has type 'unsigned int'}}
}

Make this test actually test something

Make this test actually test something

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


#include "clacks_common.h"
#include "id_client.h"
#include "TraceMessage.pb-c.h"
#include "../transport-client/cl_transport_domsock_client.h"
#include <stdio.h>

#include "clacks.h"

/* API Back-End */
void _clacks_trace_string_id(char *str, char *id) {
  int ret;

  TraceMessage t_msg = TRACE_MESSAGE__INIT;
  t_msg.act_id = "TEST";
  t_msg.msg = str;
  t_msg.flags = 0;

  ret = send_trace_message(&t_msg);
}

/* API Front-End */
void clacks_trace_string(char *str) {
  clacks_trace_string_id(str, "NULLID");
}

void clacks_trace_string_id(char *str, char *id) {
  if (str != NULL && id != NULL) {
    _clacks_trace_string_id(str, id);
  }
}

int clacks_new_id(char *id) {
  if (id == NULL) {
    return -1;
  }
  return get_new_id(id);
}

#include "clacks_common.h"
#include "id_client.h"
#include "TraceMessage.pb-c.h"
#include "../transport-client/cl_transport_domsock_client.h"
#include <stdio.h>

#include "clacks.h"

/* API Back-End */
void _clacks_trace_string_id(char *str, char *id) {
  int ret;

  TraceMessage t_msg = TRACE_MESSAGE__INIT;
  t_msg.act_id = id;
  t_msg.msg = str;
  t_msg.flags = 0;

  ret = send_trace_message(&t_msg);
}

/* API Front-End */
void clacks_trace_string(char *str) {
  clacks_trace_string_id(str, "NULLID");
}

void clacks_trace_string_id(char *str, char *id) {
  if (str != NULL && id != NULL) {
    _clacks_trace_string_id(str, id);
  }
}

int clacks_new_id(char *id) {
  if (id == NULL) {
    return -1;
  }
  return get_new_id(id);
}

Set the id for the trace message

Set the id for the trace message


/**
 * @file cl_trees.c
 * @author Rastislav Szabo <raszabo@cisco.com>, Lukas Macko <lmacko@cisco.com>,
 *         Milan Lenco <milan.lenco@pantheon.tech>
 * @brief Iterative tree loading using internal sysrepo requests.
 *
 * @copyright
 * Copyright 2016 Cisco Systems, Inc.
 *
 * 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 "sr_common.h"
#include "client_library.h"
#include "sysrepo/trees.h"
#include "trees_internal.h"

sr_node_t *
sr_node_get_child(sr_session_ctx_t *session, sr_node_t *node)
{
    int rc = SR_ERR_OK;

    if (NULL != node) {
        if (NULL != node->first_child && SR_TREE_ITERATOR_T == node->first_child->type) {
            rc = sr_get_subtree_next_chunk(session, node);
            if (SR_ERR_OK != rc) {
                return NULL;
            }
        }
        return node->first_child;
    } else {
        return NULL;
    }
}

sr_node_t *
sr_node_get_next_sibling(sr_session_ctx_t *session, sr_node_t *node)
{
    int rc = SR_ERR_OK;

    if (NULL != node) {
        if (NULL != node->next && SR_TREE_ITERATOR_T == node->next->type) {
            rc = sr_get_subtree_next_chunk(session, node->parent);
            if (SR_ERR_OK != rc) {
                return NULL;
            }
        }
        return node->next;
    } else {
        return NULL;
    }
}

sr_node_t *
sr_node_get_parent(sr_session_ctx_t *session, sr_node_t *node)
{
    (void)session;
    if (NULL != node) {
        return node->parent;
    } else {
        return NULL;
    }
}

Add forgotten source file cl_test.c

Add forgotten source file cl_test.c