#ifndef SCRAPPIE_H
#define SCRAPPIE_H

#ifdef __cplusplus
extern "C" {
#endif

#include <immintrin.h>
#include <stdbool.h>

/*  Structure definitions from fast5_interface.h  */
typedef struct {
	double start;
	float length;
	float mean, stdv;
	int pos, state;
} event_t;

typedef struct {
	unsigned int n, start, end;
	event_t * event;
} event_table;

typedef struct {
	unsigned int n, start, end;
	float * raw;
} raw_table;

/*  Matrix definitions from util.h  */
typedef struct {
        unsigned int nr, nrq, nc;
        union {
                __m128 * v;
                float * f;
        } data;
} _Mat;
typedef _Mat * scrappie_matrix;

scrappie_matrix nanonet_posterior(const event_table events, float min_prob, bool return_log);
scrappie_matrix nanonet_raw_posterior(const raw_table signal, float min_prob, bool return_log);

scrappie_matrix free_scrappie_matrix(scrappie_matrix mat);

#ifdef __cplusplus
}
#endif

#endif /* SCRAPPIE_H */

#ifndef SCRAPPIE_H
#define SCRAPPIE_H

#ifdef __cplusplus
extern "C" {
#endif

#include <immintrin.h>
#include <stdbool.h>

/*  Structure definitions from scrappie_structures.h  */
typedef struct {
	double start;
	float length;
	float mean, stdv;
	int pos, state;
} event_t;

typedef struct {
	unsigned int n, start, end;
	event_t * event;
} event_table;

typedef struct {
	unsigned int n, start, end;
	float * raw;
} raw_table;

/*  Matrix definitions from scrappie_matrix.h  */
typedef struct {
        unsigned int nr, nrq, nc;
        union {
                __m128 * v;
                float * f;
        } data;
} _Mat;
typedef _Mat * scrappie_matrix;

scrappie_matrix nanonet_posterior(const event_table events, float min_prob, bool return_log);
scrappie_matrix nanonet_raw_posterior(const raw_table signal, float min_prob, bool return_log);

scrappie_matrix free_scrappie_matrix(scrappie_matrix mat);

#ifdef __cplusplus
}
#endif

#endif /* SCRAPPIE_H */

Update where various definitions have come from


// vim: sw=4 ts=4 et :
#include "config.h"

// Parser for win_ section
conf_t win_conf(char *key) {
    conf_t rc;

    rc.ival = 0;

    (void)key;
    return rc;
}

// Prefixes for config sections/subsections with parser pointers
struct conf_prefix {
    char *prefix;
    conf_t (*parser)(char *);
} pr_global[] = {
    { "win_", win_conf }
};

// Entry point to get all config values
conf_t conf(char *key) {
    conf_t rc;

    for (size_t i = 0; i < sizeof(pr_global); i++) {
        if (strstr(key, pr_global[i].prefix) == 0) {
            rc = win_conf(key + strlen(pr_global[i].prefix));
            break;
        }
    }

    return rc;
}

// vim: sw=4 ts=4 et :
#include "config.h"
#include "itmmorgue.h"

// Parser for win_ section
conf_t win_conf(char *key) {
    conf_t rc;

    // TODO implement real parser
    if (key == strstr(key, "area_y")) rc.ival = 3;
    if (key == strstr(key, "area_x")) rc.ival = 2;
    if (key == strstr(key, "area_max_y")) rc.ival = 10;
    if (key == strstr(key, "area_max_x")) rc.ival = 45;
    if (key == strstr(key, "area_state")) rc.ival = 2;

    return rc;
}

// Prefixes for config sections/subsections with parser pointers
struct conf_prefix {
    char *prefix;
    conf_t (*parser)(char *);
} pr_global[] = {
    { "win_", win_conf }
};

// Entry point to get all config values
conf_t conf(char *key) {
    conf_t rc;

    for (size_t i = 0;
            i < sizeof(pr_global) / sizeof(struct conf_prefix);
            i++) {
        if (key == strstr(key, pr_global[i].prefix)) {
            rc = win_conf(key + strlen(pr_global[i].prefix));
            break;
        }
    }

    return rc;
}

Fix the first (sic!) Segmentation fault

Fix the first (sic!) Segmentation fault


#ifndef _CONFIG_H
#define _CONFIG_H

#define ENABLE_FUTILITY_DEPTH 1  // TODO: switch to at least 2
#define ENABLE_HISTORY 1
#define ENABLE_KILLERS 1
#define ENABLE_LMR 1
#define ENABLE_NNUE 0
#define ENABLE_NULL_MOVE_PRUNING 1
#define ENABLE_REVERSE_FUTILITY_DEPTH 0  // TODO: switch to at least 2
#define ENABLE_TT_CUTOFFS 1
#define ENABLE_TT_MOVES 1

#endif

#ifndef _CONFIG_H
#define _CONFIG_H

#define ENABLE_FUTILITY_DEPTH 1  // TODO: switch to at least 2
#define ENABLE_HISTORY 1
#define ENABLE_KILLERS 1
#define ENABLE_LMR 1
#define ENABLE_NNUE 0
#define ENABLE_NULL_MOVE_PRUNING 1
#define ENABLE_REVERSE_FUTILITY_DEPTH 1  // TODO: switch to at least 2
#define ENABLE_TT_CUTOFFS 1
#define ENABLE_TT_MOVES 1

#endif

Enable reverse futility at depth 1

Enable reverse futility at depth 1


#ifndef XAPIAND_INCLUDED_SERVER_H
#define XAPIAND_INCLUDED_SERVER_H

#include <ev++.h>

#include "threadpool.h"
#include "database.h"

const int XAPIAND_HTTP_PORT_DEFAULT = 8880;
const int XAPIAND_BINARY_PORT_DEFAULT = 8890;

class XapiandServer : public Task {
private:
	ev::dynamic_loop loop;
	ev::sig sig;
	ev::async quit;

	ev::io http_io;
	int http_sock;

	ev::io binary_io;
	int binary_sock;

	DatabasePool database_pool;

	void bind_http();
	void bind_binary();

	void io_accept_http(ev::io &watcher, int revents);
	void io_accept_binary(ev::io &watcher, int revents);

	void signal_cb(ev::sig &signal, int revents);
	void quit_cb(ev::async &watcher, int revents);

public:
	XapiandServer(int http_sock_, int binary_sock_);
	~XapiandServer();

	void run();
};

#endif /* XAPIAND_INCLUDED_SERVER_H */

#ifndef XAPIAND_INCLUDED_SERVER_H
#define XAPIAND_INCLUDED_SERVER_H

#include <ev++.h>

#include "threadpool.h"
#include "database.h"

const int XAPIAND_HTTP_PORT_DEFAULT = 8880;
const int XAPIAND_BINARY_PORT_DEFAULT = 8890;

class XapiandServer : public Task {
private:
	ev::dynamic_loop dynamic_loop;
	ev::loop_ref *loop;
	ev::sig sig;
	ev::async quit;

	ev::io http_io;
	int http_sock;

	ev::io binary_io;
	int binary_sock;

	DatabasePool database_pool;

	void bind_http();
	void bind_binary();

	void io_accept_http(ev::io &watcher, int revents);
	void io_accept_binary(ev::io &watcher, int revents);

	void signal_cb(ev::sig &signal, int revents);
	void quit_cb(ev::async &watcher, int revents);

public:
	XapiandServer(int http_sock_, int binary_sock_, ev::loop_ref *loop_=NULL);
	~XapiandServer();

	void run();
};

#endif /* XAPIAND_INCLUDED_SERVER_H */

Allow passing an event loop to XapianServer


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

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

Update Skia milestone to 91

Update Skia milestone to 91

TBR reed

Change-Id: Ibfb76e9b08f5b427ff693f023419130107f857ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/376138
Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
Commit-Queue: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>


/*
 * Paramer.h
 *
 *  Created on: Aug 20, 2015
 *      Author: fsedlaze
 */

#ifndef PARAMER_H_
#define PARAMER_H_

#include <string.h>
#include <string>
#include <vector>
#include <stdlib.h>
#include <iostream>
#include <ctime>

class Parameter {
private:
	Parameter() {
		min_freq=-1;
		version ="1.0.4";
	}
	~Parameter() {

	}
	static Parameter* m_pInstance;

public:
	std::string version;
	int max_dist;
	int max_caller;
	bool use_type;
	bool use_strand;
	bool dynamic_size;
	int min_length;
	float min_freq;
	int min_support;

	static Parameter* Instance() {
		if (!m_pInstance) {
			m_pInstance = new Parameter;
		}
		return m_pInstance;
	}

	double meassure_time(clock_t begin ,std::string msg){
		return 0;
		clock_t end = clock();
		double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
		std::cout << msg<<" " << elapsed_secs<<std::endl;
		return elapsed_secs;
	}
};

#endif /* PARAMER_H_ */

/*
 * Paramer.h
 *
 *  Created on: Aug 20, 2015
 *      Author: fsedlaze
 */

#ifndef PARAMER_H_
#define PARAMER_H_

#include <string.h>
#include <string>
#include <vector>
#include <stdlib.h>
#include <iostream>
#include <ctime>

class Parameter {
private:
	Parameter() {
		min_freq=-1;
		version ="1.0.5";
	}
	~Parameter() {

	}
	static Parameter* m_pInstance;

public:
	std::string version;
	int max_dist;
	int max_caller;
	bool use_type;
	bool use_strand;
	bool dynamic_size;
	int min_length;
	float min_freq;
	int min_support;

	static Parameter* Instance() {
		if (!m_pInstance) {
			m_pInstance = new Parameter;
		}
		return m_pInstance;
	}

	double meassure_time(clock_t begin ,std::string msg){
		return 0;
		clock_t end = clock();
		double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;
		std::cout << msg<<" " << elapsed_secs<<std::endl;
		return elapsed_secs;
	}
};

#endif /* PARAMER_H_ */

Increment version to clean things up

Increment version to clean things up


/**
 * This file is part of the librailcan library.
 *
 * Copyright (C) 2015 Reinder Feenstra <reinderfeenstra@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
 * USA
 */

#include "librailcan.h"
#include <string.h>

int debug_level = LIBRAILCAN_DEBUGLEVEL_DEBUG;//LIBRAILCAN_DEBUGLEVEL_NONE;

int librailcan_set_debug_level( int level )
{
  if( level < LIBRAILCAN_DEBUGLEVEL_NONE ||
      level > LIBRAILCAN_DEBUGLEVEL_DEBUG )
    return LIBRAILCAN_STATUS_INVALID_PARAM;

  debug_level = level;

  return LIBRAILCAN_STATUS_SUCCESS;
}

/**
 * This file is part of the librailcan library.
 *
 * Copyright (C) 2015 Reinder Feenstra <reinderfeenstra@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
 * USA
 */

#include "librailcan.h"
#include <string.h>

int debug_level = LIBRAILCAN_DEBUGLEVEL_NONE;

int librailcan_set_debug_level( int level )
{
  if( level < LIBRAILCAN_DEBUGLEVEL_NONE ||
      level > LIBRAILCAN_DEBUGLEVEL_DEBUG )
    return LIBRAILCAN_STATUS_INVALID_PARAM;

  debug_level = level;

  return LIBRAILCAN_STATUS_SUCCESS;
}

Set default debug level to none.

Set default debug level to none.


#include <stdlib.h>
#include <string.h>

#include <stdint.h>

#include "cc.h"

static void
out_of_memory(void)
{
	/* TODO: deal with out of memory errors */
	error("out of memory");
}

void *
xmalloc(size_t size)
{
	register void *p = malloc(size);

	if (!p)
		out_of_memory();
	return p;
}

void *
xcalloc(size_t nmemb, size_t size)
{
	register size_t nbytes = nmemb * size;
	register void *p = xmalloc(nbytes);

	return memset(p, nbytes, 0);
}

char *
xstrdup(const char *s)
{
	register size_t len = strlen(s);
	register char *p = xmalloc(len);

	return memcpy(p, s, len);
}

void *
xrealloc(void *buff, register size_t size)
{
	register void *p = realloc(buff, size);

	if (!p)
		out_of_memory();
	return p;
}

#include <stdlib.h>
#include <string.h>

#include <stdint.h>

#include "cc.h"

static void
out_of_memory(void)
{
	/* TODO: deal with out of memory errors */
	error("out of memory");
}

void *
xmalloc(size_t size)
{
	register void *p = malloc(size);

	if (!p)
		out_of_memory();
	return p;
}

void *
xcalloc(size_t nmemb, size_t size)
{
	register size_t nbytes = nmemb * size;
	register void *p = xmalloc(nbytes);

	return memset(p, nbytes, 0);
}

char *
xstrdup(const char *s)
{
	register size_t len = strlen(s) + 1;
	register char *p = xmalloc(len);

	return memcpy(p, s, len);
}

void *
xrealloc(void *buff, register size_t size)
{
	register void *p = realloc(buff, size);

	if (!p)
		out_of_memory();
	return p;
}

Copy end of string in xstrdup

Copy end of string in xstrdup

the size of a string is length of the string + 1 due to the
end of string.


int main(void)
{
    int i = 0;

    while (1) {
        if (i == 42) break;
        i += 1;
    }

    return i;
}

int main(void)
{
    int i = 0;;;

    while (1) {
        if (i == 42) break;
        i += 1;
    }

    return i;
}

Test null statements. Just because.

Test null statements. Just because.


/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla Public License Version
 * 1.1 (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.mozilla.org/MPL/
 *
 * Software distributed under the License is distributed on an "AS IS" basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 * for the specific language governing rights and limitations under the
 * License.
 *
 * The Original Code is [Open Source Virtual Machine.].
 *
 * The Initial Developer of the Original Code is
 * Adobe System Incorporated.
 * Portions created by the Initial Developer are Copyright (C) 2004-2006
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   Adobe AS3 Team
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#ifndef __avmplus_ClassClosure_inlines__
#define __avmplus_ClassClosure_inlines__

namespace avmplus
{

REALLY_INLINE ScriptObject* ClassClosure::prototypePtr()
{
	return prototype;
}

REALLY_INLINE VTable* ClassClosure::ivtable() const
{
	return vtable->ivtable;
}

// Called from C++ to alloc a new instance.  Generated code calls createInstance directly.
REALLY_INLINE ScriptObject* ClassClosure::newInstance()
{
	VTable* ivtable = this->ivtable();
	return ivtable->createInstance(this, ivtable);
}

}

#endif /* __avmplus_ClassClosure_inlines__ */

Add a file that should have been added with changeset: 3564:36fb63a6d3b7


#pragma once

#include <algorithm>
#include "Types.h"

class CGsCachedArea
{
public:
	typedef uint64 DirtyPageHolder;

	enum
	{
		MAX_DIRTYPAGES_SECTIONS = 8,
		MAX_DIRTYPAGES = sizeof(DirtyPageHolder) * 8 * MAX_DIRTYPAGES_SECTIONS
	};

								CGsCachedArea();

	void						SetArea(uint32 psm, uint32 bufPtr, uint32 bufWidth, uint32 height);

	std::pair<uint32, uint32>	GetPageRect() const;
	uint32						GetPageCount() const;
	uint32						GetSize() const;

	void						Invalidate(uint32, uint32);
	bool						IsPageDirty(uint32) const;
	void						SetPageDirty(uint32);
	bool						HasDirtyPages() const;
	void						ClearDirtyPages();

private:
	uint32						m_psm = 0;
	uint32						m_bufPtr = 0;
	uint32						m_bufWidth = 0;
	uint32						m_height = 0;

	DirtyPageHolder				m_dirtyPages[MAX_DIRTYPAGES_SECTIONS];
};

#pragma once

#include <utility>
#include "Types.h"

class CGsCachedArea
{
public:
	typedef uint64 DirtyPageHolder;

	enum
	{
		MAX_DIRTYPAGES_SECTIONS = 8,
		MAX_DIRTYPAGES = sizeof(DirtyPageHolder) * 8 * MAX_DIRTYPAGES_SECTIONS
	};

								CGsCachedArea();

	void						SetArea(uint32 psm, uint32 bufPtr, uint32 bufWidth, uint32 height);

	std::pair<uint32, uint32>	GetPageRect() const;
	uint32						GetPageCount() const;
	uint32						GetSize() const;

	void						Invalidate(uint32, uint32);
	bool						IsPageDirty(uint32) const;
	void						SetPageDirty(uint32);
	bool						HasDirtyPages() const;
	void						ClearDirtyPages();

private:
	uint32						m_psm = 0;
	uint32						m_bufPtr = 0;
	uint32						m_bufWidth = 0;
	uint32						m_height = 0;

	DirtyPageHolder				m_dirtyPages[MAX_DIRTYPAGES_SECTIONS];
};

Use better header for std::pair.

Use better header for std::pair.


#ifndef STINGRAYKIT_METAPROGRAMMING_TYPECOMPLETENESS_H
#define STINGRAYKIT_METAPROGRAMMING_TYPECOMPLETENESS_H

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

#include <stingraykit/metaprogramming/CompileTimeAssert.h>

namespace stingray
{
	template < typename T > struct StaticAssertCompleteType : CompileTimeAssert<sizeof(T)> { typedef T	ValueT; };
}

#endif

#ifndef STINGRAYKIT_METAPROGRAMMING_TYPECOMPLETENESS_H
#define STINGRAYKIT_METAPROGRAMMING_TYPECOMPLETENESS_H

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

#include <stingraykit/metaprogramming/CompileTimeAssert.h>

namespace stingray
{

	template < typename T > struct StaticAssertCompleteType : CompileTimeAssert<sizeof(T) == sizeof(T)> { typedef T	ValueT; };

}

#endif

Fix compile ui.shell, fckng non-standard behaviour

Revert "metaprogramming: Get rid of excess check in IsComplete"

This reverts commit dc328c6712e9d23b3a58f7dd14dbdfa8e5a196db.


//===-- llvm/Support/Visibility.h - visibility(hidden) support --*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by Chris Lattner and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines the VISIBILITY_HIDDEN macro, used for marking classes with
// the GCC-specific visibility("hidden") attribute.
//
//===----------------------------------------------------------------------===//

#ifndef VISIBILITY_HIDDEN

#if __GNUC__ >= 4
#define VISIBILITY_HIDDEN __attribute__ ((visibility("hidden")))
#else
#define VISIBILITY_HIDDEN
#endif

#endif

Add support for hidden visibility

Add support for hidden visibility

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


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

#include "base_fw_config.h"
#include "board_fw_config.h"

bool board_is_convertible(void)
{
	return 1;
}

bool board_has_kblight(void)
{
	return (get_fw_config_field(FW_CONFIG_KBLIGHT_OFFSET,
			FW_CONFIG_KBLIGHT_WIDTH) == FW_CONFIG_KBLIGHT_YES);
}

enum board_usb_c1_mux board_get_usb_c1_mux(void)
{
	return USB_C1_MUX_PS8818;
};

enum board_usb_a1_retimer board_get_usb_a1_retimer(void)
{
	return USB_A1_RETIMER_PS8811;
};

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

#include "base_fw_config.h"
#include "board_fw_config.h"

bool board_is_convertible(void)
{
	return 1;
}

bool board_has_kblight(void)
{
	return (get_fw_config_field(FW_CONFIG_KBLIGHT_OFFSET,
			FW_CONFIG_KBLIGHT_WIDTH) == FW_CONFIG_KBLIGHT_YES);
}

enum board_usb_c1_mux board_get_usb_c1_mux(void)
{
	return USB_C1_MUX_PS8818;
};

enum board_usb_a1_retimer board_get_usb_a1_retimer(void)
{
	return USB_A1_RETIMER_UNKNOWN;
};

Set Type A1 retimer to unknown

Dewatt: Set Type A1 retimer to unknown

Let board_get_usb_a1_retimer always return
USB_A1_RETIMER_UNKNOWN for Dewatt doesn't
have type A port 1.

BUG=none
BRANCH=none
TEST=EC console won't show
     "A1: PS8811 retimer not detected!"

Signed-off-by: Sue Chen <7d23cdcf270f71747b77aeecc793a9342f6d5c9e@quanta.corp-partner.google.com>
Change-Id: I9a7c292ffc739e81fd1e553617f17abd25a67564
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3346760
Reviewed-by: Rob Barnes <3ced0940a2329ce70499686f01d3d60685ec66ed@google.com>


/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
/* Copyright Authors of Cilium */

#ifndef __BPF_HELPERS_SOCK__
#define __BPF_HELPERS_SOCK__

#include <linux/bpf.h>

#include "helpers.h"

/* Only used helpers in Cilium go below. */

/* Events for user space */
static int BPF_FUNC_REMAP(sock_event_output, struct bpf_sock_addr *sock, void *map,
			  __u64 index, const void *data, __u32 size) =
			 (void *)BPF_FUNC_perf_event_output;

#endif /* __BPF_HELPERS_SOCK__ */

bpf: Define helper to send perf events for socket context

This is a preparatory commit that defines a
helper to send traces via perf event ring buffer with
socket context.

Signed-off-by: Aditi Ghag <436242e0c0af36e461a395c937165372864a99f9@cilium.io>


// PARAM: --enable ana.int.def_exc --disable ana.int.interval
#include<assert.h>
// Some unsigned long constant that is larger than 2^63-1
#define SIZE_MAX	18446744073709551615UL

int foo(){
    int top;
    int a = 3;
    if (top < SIZE_MAX / (8 * sizeof(int))){ // parts of the expression errorneously evaluate to bottom
        assert(1);
    }
    return 0;
}

Add test for large unsigned long constants in expressions


#ifndef __POSIX_SIGNAL_SIGTABLES_H

typedef struct {
    int signal;
    char *name;
} Signal;

typedef struct {
    int len;
    int items[];
} SignalVector;

extern const Signal signals[];
extern const int nsigs;

extern int max_signum;

#define SIGOFFSET(SIG) ((SIG) - 1)

void
InitSignalTables (void);

SignalVector*
CreateSignalVector (void);

void
FreeSignalVector(
    SignalVector *svPtr
    );

int
GetSignalIdFromObj (
    Tcl_Interp *interp,
    Tcl_Obj *nameObj
    );

#define __POSIX_SIGNAL_SIGTABLES_H
#endif /* __POSIX_SIGNAL_SIGTABLES_H */

/* vim: set ts=8 sts=4 sw=4 sts=4 noet: */

#ifndef __POSIX_SIGNAL_SIGTABLES_H

typedef struct {
    int signal;
    char *name;
} Signal;

typedef struct {
    int len;
    int items[];
} SignalVector;

MODULE_SCOPE const Signal signals[];
MODULE_SCOPE const int nsigs;

MODULE_SCOPE int max_signum;

#define SIGOFFSET(SIG) ((SIG) - 1)

void
InitSignalTables (void);

SignalVector*
CreateSignalVector (void);

void
FreeSignalVector(
    SignalVector *svPtr
    );

int
GetSignalIdFromObj (
    Tcl_Interp *interp,
    Tcl_Obj *nameObj
    );

#define __POSIX_SIGNAL_SIGTABLES_H
#endif /* __POSIX_SIGNAL_SIGTABLES_H */

/* vim: set ts=8 sts=4 sw=4 sts=4 noet: */

Hide global data symbols related to signal tables

'extern' decls for "signals", "nsigs" and "max_signum"
changed to 'MODULE_SCOPE' in unix/sigtables.h
to remove it from the symbol table of the generated
shared object file.


// Submission #3365787
#include <stdio.h>
#define MAXN 8
#define TRUE  1
#define FALSE 0

int len;
unsigned char used[MAXN] = { FALSE };
char s[MAXN], generated[MAXN];
void dfs(int depth)
{
    if (depth == len) puts(generated);
    else {
        int i;
        for (i = 0; i < len; ++i) if (!used[i]) {
            used[i] = TRUE;
            generated[depth] = s[i];
            dfs(depth + 1);
            used[i] = FALSE;
        }
    }
}

int main()
{
    gets(s);
    len = strlen(s);
    dfs(0);
    return 0;
}

// Submission #3365787
#include <stdio.h>
#include <string.h>
#define MAXN 8
#define TRUE  1
#define FALSE 0

int len;
unsigned char used[MAXN] = { FALSE };
char s[MAXN], generated[MAXN];
void dfs(int depth)
{
    if (depth == len) puts(generated);
    else {
        int i;
        for (i = 0; i < len; ++i) if (!used[i]) {
            used[i] = TRUE;
            generated[depth] = s[i];
            dfs(depth + 1);
            used[i] = FALSE;
        }
    }
}

int main()
{
    gets(s);
    len = strlen(s);
    dfs(0);
    return 0;
}

Fix a warning that causes compile error in G++


#ifndef _AL_THUNK_H_
#define _AL_THUNK_H_

#include "config.h"

#include "AL/al.h"
#include "AL/alc.h"

#ifdef __cplusplus
extern "C" {
#endif

#if (SIZEOF_VOIDP > SIZEOF_UINT)

void alThunkInit(void);
void alThunkExit(void);
ALuint alThunkAddEntry(ALvoid * ptr);
void alThunkRemoveEntry(ALuint index);
ALvoid *alThunkLookupEntry(ALuint index);

#define ALTHUNK_INIT()          alThunkInit()
#define ALTHUNK_EXIT()          alThunkExit()
#define ALTHUNK_ADDENTRY(p)     alThunkAddEntry(p)
#define ALTHUNK_REMOVEENTRY(i)  alThunkRemoveEntry(i)
#define ALTHUNK_LOOKUPENTRY(i)  alThunkLookupEntry(i)

#else

#define ALTHUNK_INIT()
#define ALTHUNK_EXIT()
#define ALTHUNK_ADDENTRY(p)     ((ALuint)p)
#define ALTHUNK_REMOVEENTRY(i)
#define ALTHUNK_LOOKUPENTRY(i)  ((ALvoid*)(i))

#endif // (SIZEOF_VOIDP > SIZEOF_INT)

#ifdef __cplusplus
}
#endif

#endif //_AL_THUNK_H_

#ifndef _AL_THUNK_H_
#define _AL_THUNK_H_

#include "config.h"

#include "AL/al.h"
#include "AL/alc.h"

#ifdef __cplusplus
extern "C" {
#endif

void alThunkInit(void);
void alThunkExit(void);
ALuint alThunkAddEntry(ALvoid * ptr);
void alThunkRemoveEntry(ALuint index);
ALvoid *alThunkLookupEntry(ALuint index);

#if (SIZEOF_VOIDP > SIZEOF_UINT)

#define ALTHUNK_INIT()          alThunkInit()
#define ALTHUNK_EXIT()          alThunkExit()
#define ALTHUNK_ADDENTRY(p)     alThunkAddEntry(p)
#define ALTHUNK_REMOVEENTRY(i)  alThunkRemoveEntry(i)
#define ALTHUNK_LOOKUPENTRY(i)  alThunkLookupEntry(i)

#else

#define ALTHUNK_INIT()
#define ALTHUNK_EXIT()
#define ALTHUNK_ADDENTRY(p)     ((ALuint)p)
#define ALTHUNK_REMOVEENTRY(i)
#define ALTHUNK_LOOKUPENTRY(i)  ((ALvoid*)(i))

#endif // (SIZEOF_VOIDP > SIZEOF_INT)

#ifdef __cplusplus
}
#endif

#endif //_AL_THUNK_H_

Move function declarations outside of the if-block


// abort.h
// hdpirun
//
// Utility header to abort the program on an unrecoverable error. Prints the message (printf format) and closes any open resources
//
// Author: Robbie Duncan
// Copyright: Copyright (c) 2016 Robbie Duncan
// License: See LICENSE
//
#import "log.h"
#import <stdio.h>

#ifndef ABORT_H
#define ABORT_H
#define __ABORT(message,...) __LOG(__LOG_CRITICAL,message,##__VA_ARGS__);if (__logFile!=stdout){fclose(__logFile);};exit(1);
#endif

// abort.h
// hdpirun
//
// Utility header to abort the program on an unrecoverable error. Prints the message (printf format) and closes any open resources
//
// Author: Robbie Duncan
// Copyright: Copyright (c) 2016 Robbie Duncan
// License: See LICENSE
//
#import "log.h"
#import <stdio.h>

#ifndef ABORT_H
#define ABORT_H
#define ABORT(message,...) __LOG(__LOG_CRITICAL,message,##__VA_ARGS__);if (__logFile!=stdout){fclose(__logFile);};exit(1);
#endif

Remove leading underscores as part of style clean up


#include <stdio.h>
#include <time.h>

static long n = 10000;

int
main(int argc, char* argv[]) {
	long i;
	clock_t t;

	t = clock();
	for (i = 0; i < n; ++i) {
            {{_cursor_}}
	}
	printf("%ld\n", clock() - t);

	return 0;
}

Add new template for bench on c

Add new template for bench on c


/*
 * QLogic iSCSI HBA Driver
 * Copyright (c)  2003-2010 QLogic Corporation
 *
 * See LICENSE.qla4xxx for copyright and licensing details.
 */

#define QLA4XXX_DRIVER_VERSION	"5.02.00-k11"

/*
 * QLogic iSCSI HBA Driver
 * Copyright (c)  2003-2010 QLogic Corporation
 *
 * See LICENSE.qla4xxx for copyright and licensing details.
 */

#define QLA4XXX_DRIVER_VERSION	"5.02.00-k12"

Update driver version to 5.02.00-k12

[SCSI] qla4xxx: Update driver version to 5.02.00-k12

Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>


/* encrypted keys */

static const uint32_t internal_device_number = 0;

static const uint8_t internal_dk_list[][21] = {
  {
  },
};

static const uint8_t internal_pk_list[][16] = {
  {
  },
};

static const uint8_t internal_hc_list[][112] = {
  {
  },
};

/* customize this function to "hide" the keys in the binary */

static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size)
{
    memcpy(out, in, size);
}

/* encrypted keys */

static const uint32_t internal_device_number = 0;

static const uint8_t internal_dk_list[][21] = {
  { 0 },
};

static const uint8_t internal_pk_list[][16] = {
  { 0 },
};

static const uint8_t internal_hc_list[][112] = {
  { 0 },
};

/* customize this function to "hide" the keys in the binary */

static void decrypt_key(uint8_t *out, const uint8_t *in, size_t size)
{
    memcpy(out, in, size);
}

Fix MSVC error C2133 : unknown size of multi-dimensional static const arrays (despite supposed support of C99). Have not confirmed if this breaks anything yet.


/*
 *     Copyright 2016 Couchbase, 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.
 */

#ifndef LCB_MCTX_HELPER_H
#define LCB_MCTX_HELPER_H
#include <libcouchbase/couchbase.h>

namespace lcb {

class MultiCmdContext : public lcb_MULTICMD_CTX {
protected:
    virtual lcb_error_t MCTX_addcmd(const lcb_CMDBASE* cmd) = 0;
    virtual lcb_error_t MCTX_done(const void *cookie) = 0;
    virtual void MCTX_fail() = 0;

    MultiCmdContext() {
        lcb_MULTICMD_CTX::addcmd = dispatch_mctx_addcmd;
        lcb_MULTICMD_CTX::done = dispatch_mctx_done;
        lcb_MULTICMD_CTX::fail = dispatch_mctx_fail;
    }

    virtual ~MultiCmdContext() {}

private:
    static lcb_error_t dispatch_mctx_addcmd(lcb_MULTICMD_CTX* ctx, const lcb_CMDBASE * cmd) {
        return static_cast<MultiCmdContext*>(ctx)->MCTX_addcmd(cmd);
    }
    static lcb_error_t dispatch_mctx_done(lcb_MULTICMD_CTX* ctx, const void *cookie) {
        return static_cast<MultiCmdContext*>(ctx)->MCTX_done(cookie);
    }
    static void dispatch_mctx_fail(lcb_MULTICMD_CTX* ctx) {
        static_cast<MultiCmdContext*>(ctx)->MCTX_fail();
    }
};

}

#endif

Add C++ helper for MULTICMD_CTX

Add C++ helper for MULTICMD_CTX

This allows us to use virtual functions rather than C-style callbacks

Change-Id: Id8d40c5f36b5700f941400118acb30a2284a4027
Reviewed-on: http://review.couchbase.org/71370
Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Reviewed-by: Brett Lawson <c8c4369773d7d7226e031f0c4af62e3f38a08510@gmail.com>


#include "server/bedrock.h"
#include "server/command.h"

void command_version(struct bedrock_client *client, int bedrock_attribute_unused argc, const char bedrock_attribute_unused **argv)
{
	command_reply(client, "Bedrock version %d.%d%s Compiled on %s %s.", BEDROCK_VERSION_MAJOR, BEDROCK_VERSION_MINOR, BEDROCK_VERSION_EXTRA, __DATE__, __TIME__);
}

#include "server/bedrock.h"
#include "server/command.h"

void command_version(struct bedrock_client *client, int bedrock_attribute_unused argc, const char bedrock_attribute_unused **argv)
{
	command_reply(client, "Bedrock version %d.%d%s, built on %s %s.", BEDROCK_VERSION_MAJOR, BEDROCK_VERSION_MINOR, BEDROCK_VERSION_EXTRA, __DATE__, __TIME__);
}

Change /version output to be more like -version


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

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

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

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

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


//===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains functions used to do a variety of low-level, often
// system-specific, tasks.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_SUPPORT_SYSTEMUTILS_H
#define LLVM_SUPPORT_SYSTEMUTILS_H

#include <string>

namespace llvm {
  class raw_ostream;
  namespace sys { class Path; }

/// Determine if the raw_ostream provided is connected to the outs() and
/// displayed or not (to a console window). If so, generate a warning message
/// advising against display of bitcode and return true. Otherwise just return
/// false
/// @brief Check for output written to a console
bool CheckBitcodeOutputToConsole(
  raw_ostream &stream_to_check, ///< The stream to be checked
  bool print_warning = true     ///< Control whether warnings are printed
);

/// FindExecutable - Find a named executable, giving the argv[0] of program
/// being executed. This allows us to find another LLVM tool if it is built in
/// the same directory.  If the executable cannot be found, return an
/// empty string.
/// @brief Find a named executable.
sys::Path FindExecutable(const std::string &ExeName,
                         const char *Argv0, void *MainAddr);

} // End llvm namespace

#endif

//===- SystemUtils.h - Utilities to do low-level system stuff ---*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file contains functions used to do a variety of low-level, often
// system-specific, tasks.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_SUPPORT_SYSTEMUTILS_H
#define LLVM_SUPPORT_SYSTEMUTILS_H

#include <string>

namespace llvm {
  class raw_ostream;
  namespace sys { class Path; }

/// Determine if the raw_ostream provided is connected to a terminal. If so,
/// generate a warning message to errs() advising against display of bitcode
/// and return true. Otherwise just return false.
/// @brief Check for output written to a console
bool CheckBitcodeOutputToConsole(
  raw_ostream &stream_to_check, ///< The stream to be checked
  bool print_warning = true     ///< Control whether warnings are printed
);

/// FindExecutable - Find a named executable, giving the argv[0] of program
/// being executed. This allows us to find another LLVM tool if it is built in
/// the same directory.  If the executable cannot be found, return an
/// empty string.
/// @brief Find a named executable.
sys::Path FindExecutable(const std::string &ExeName,
                         const char *Argv0, void *MainAddr);

} // End llvm namespace

#endif

Reword this comment. Don't mention outs(), as that's not what
this code is actually testing for.

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


#ifndef QMAPBOXGL_P_H
#define QMAPBOXGL_P_H

#include <mbgl/map/map.hpp>
#include <mbgl/map/view.hpp>
#include <mbgl/storage/default_file_source.hpp>

namespace mbgl {

class Map;
class FileSource;

}  // namespace mbgl

class QOpenGLContext;

class QMapboxGLPrivate : public mbgl::View
{
public:
    explicit QMapboxGLPrivate(QMapboxGL *q);
    virtual ~QMapboxGLPrivate();

    // mbgl::View implementation.
    void activate() override {}
    void deactivate() override;
    void notify() override {}
    void invalidate(std::function<void()> renderCallback) override;

    mbgl::DefaultFileSource fileSource;
    mbgl::Map map;

    int lastX = 0;
    int lastY = 0;

    QOpenGLContext *context = nullptr;

    QMapboxGL *q_ptr;
};

#endif // QMAPBOXGL_P_H

#ifndef QMAPBOXGL_P_H
#define QMAPBOXGL_P_H

#include <mbgl/map/map.hpp>
#include <mbgl/map/view.hpp>
#include <mbgl/storage/default_file_source.hpp>

namespace mbgl {

class Map;
class FileSource;

}  // namespace mbgl

class QOpenGLContext;

class QMapboxGLPrivate : public mbgl::View
{
public:
    explicit QMapboxGLPrivate(QMapboxGL *q);
    virtual ~QMapboxGLPrivate();

    // mbgl::View implementation.
    void activate() final {}
    void deactivate() final;
    void notify() final {}
    void invalidate(std::function<void()> renderCallback) final;

    mbgl::DefaultFileSource fileSource;
    mbgl::Map map;

    int lastX = 0;
    int lastY = 0;

    QOpenGLContext *context = nullptr;

    QMapboxGL *q_ptr;
};

#endif // QMAPBOXGL_P_H

Use final for virtual methods on private impl of mbgl::View

This is a private implementation, so we know that no one else will
inherit from that.


// RUN: %llvmgcc -S %s -o - | llvm-as | llc -march=c | \
// RUN:  grep '(unsigned short'

int Z = -1;

int test(unsigned short X, short Y) { return X+Y+Z; }

Add a test case for PR1086

Add a test case for PR1086

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


///\file

/******************************************************************************
The MIT License(MIT)

Embedded Template Library.

Copyright(c) 2014 jwellbelove

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 __ETL_PARAMETER__
#define __ETL_PARAMETER__

namespace etl
{
  //*************************************************************************
  /// Determine how to pass parameters.
  //*************************************************************************
  template <typename U, const bool should_pass_by_value>
  struct parameter_type;

  //*************************************************************************
  /// Pass by value.
  //*************************************************************************
  template <typename U>
  struct parameter_type<U, true>
  {
    typedef U type;
  };

  //*************************************************************************
  /// Pass by const reference.
  //*************************************************************************
  template <typename U>
  struct parameter_type<U, false>
  {
    typedef const U& type;
  };
}

#endif

Choose between value and const reference type

Choose between value and const reference based on boolean template
parameter


#ifndef SIMHASH_TOKENIZERS__UTIL_H
#define SIMHASH_TOKENIZERS__UTIL_H

#include <string.h>

namespace Simhash {
    struct Strspn {
        /* Return the length of the token starting at last */
        const char* operator()(const char* last) {
            size_t s = strspn(last,
                "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
            return (*last != '\0') ? last + s : NULL;
        }
    };
}

#endif

#ifndef SIMHASH_TOKENIZERS_STRSPN_H
#define SIMHASH_TOKENIZERS_STRSPN_H

#include <string.h>

namespace Simhash {
    struct Strspn {
        /* Return the length of the token starting at last */
        const char* operator()(const char* last) {
            size_t s = strspn(last,
                "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
            return (*last != '\0') ? last + s : NULL;
        }
    };
}

#endif

Fix illegal (double underscore) include guard.


/*
 * This file is covered by the Internet Software Consortium (ISC) License
 * Reference: ../License.txt
 *
 * __nohang_waitpid is linked directly into Synth but it's related to synthexec
 * so let's keep the C files together.
 * return:
 *    0 when process is still running
 *    1 when process exited normally
 *    2 when process exited with error
 *
 * __launch_process takes a pointer to an array of null-terminated string
 * pointers are returns the pid of the child process, or -1 upon failure
 */

#include <sys/types.h>
#include <sys/wait.h>

u_int8_t
__nohang_waitpid (pid_t process_pid)
{
  int status = 0;

  int pid = waitpid (process_pid, &status, WNOHANG);

  if (pid == 0)
    {
      return 0;
    }
  if (WIFEXITED (status) && (WEXITSTATUS (status) == 0))
    {
      return 1;
    }
  else
    {
      return 2;
    }
}

/*
 * This file is covered by the Internet Software Consortium (ISC) License
 * Reference: ../License.txt
 *
 * __nohang_waitpid is linked directly into Synth but it's related to synthexec
 * so let's keep the C files together.
 * return:
 *    0 when process is still running
 *    1 when process exited normally
 *    2 when process exited with error
 */

#include <sys/types.h>
#include <sys/wait.h>

u_int8_t
__nohang_waitpid (pid_t process_pid)
{
  int status = 0;

  int pid = waitpid (process_pid, &status, WNOHANG);

  if (pid == 0)
    {
      return 0;
    }
  if (WIFEXITED (status) && (WEXITSTATUS (status) == 0))
    {
      return 1;
    }
  else
    {
      return 2;
    }
}

Remove comment that is no longer applicable


#pragma once

// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
const float kCurrentVersion = 1.40f;

#pragma once

// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
const float kCurrentVersion = 1.41f;

Increment version number to 1.41

Increment version number to 1.41


#include "redislite.h"
#include <string.h>

static void test_add_key(redislite *db)
{
	int rnd = arc4random();
	char key[14];
	sprintf(key, "%d", rnd);
	int size = strlen(key);

	redislite_insert_key(db, key, size, 0);
}

int main() {
	redislite *db = redislite_open_database("test.db");
	int i;
	for (i=0; i < 100; i++)
		test_add_key(db);
	redislite_close_database(db);
	return 0;
}

#include "redislite.h"
#include <string.h>

static void test_add_key(redislite *db)
{
	int rnd = rand();
	char key[14];
	sprintf(key, "%d", rnd);
	int size = strlen(key);

	redislite_insert_key(db, key, size, 0);
}

int main() {
	redislite *db = redislite_open_database("test.db");
	int i;
	for (i=0; i < 100; i++)
		test_add_key(db);
	redislite_close_database(db);
	return 0;
}

Use rand instead of arc4random (linux doesn't support it)


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

#ifndef INDEXED_ARRAY_QUEUE_H
#define INDEXED_ARRAY_QUEUE_H

#include <pthread.h>

#include "../function_queue_element.h"
#include "../function_queue.h"
#include "../qterror.h"

/*
 * This structure is used to store the function queue elements and any
 * persistant data necessary for the manipulation procedures.
 */
struct fqindexedarray {
	/* a pointer to an element array */
	struct function_queue_element* elements;
	pthread_mutex_t lock; /* unused */
	pthread_cond_t wait; /* unused */
	unsigned int front; /* the index of the "first" element */
	unsigned int back; /* the index of the "last" element */
};

extern const struct fqdispatchtable fqdispatchtableia;

#endif

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

#ifndef INDEXED_ARRAY_QUEUE_H
#define INDEXED_ARRAY_QUEUE_H

#include <pthread.h>

#include "../function_queue_element.h"
#include "../function_queue.h"
#include "../qterror.h"

/*
 * This structure is used to store the function queue elements and any
 * persistant data necessary for the manipulation procedures.
 */
struct fqindexedarray {
	/* a pointer to an element array */
	struct function_queue_element* elements;
	unsigned int front; /* the index of the "first" element */
	unsigned int back; /* the index of the "last" element */
};

extern const struct fqdispatchtable fqdispatchtableia;

#endif

Remove unused members in fqindexedarray structure


//
//  ProfileViewController.h
//  PlayPlan
//
//  Created by Zeacone on 15/11/8.
//  Copyright © 2015年 Zeacone. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "PlayPlan.h"

@class ProfileViewController;

@protocol MainDelegate <NSObject>

- (void)dismissViewController:(MainViewController *)mainViewController;

@end

@interface ProfileViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>

@end

//
//  ProfileViewController.h
//  PlayPlan
//
//  Created by Zeacone on 15/11/8.
//  Copyright © 2015年 Zeacone. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "PlayPlan.h"

@class ProfileViewController;

@protocol MainDelegate <NSObject>

- (void)dismissViewController:(ProfileViewController *)mainViewController;

@end

@interface ProfileViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>

@end

Add delegate for profile view controller.


//
//  VYNFCNDEFPayloadParser.h
//  VYNFCKit
//
//  Created by Vince Yuan on 7/8/17.
//  Copyright © 2017 Vince Yuan. All rights reserved.
//
//  This source code is licensed under the MIT-style license found in the
//  LICENSE file in the root directory of this source tree.
//

#import <Foundation/Foundation.h>

@class NFCNDEFPayload, VYNFCNDEFMessageHeader;

@interface VYNFCNDEFPayloadParser : NSObject

+ (nullable id)parse:(nullable NFCNDEFPayload *)payload;
+ (nullable VYNFCNDEFMessageHeader *)parseMessageHeader:(nullable unsigned char*)payloadBytes length:(NSUInteger)length;

@end

//
//  VYNFCNDEFPayloadParser.h
//  VYNFCKit
//
//  Created by Vince Yuan on 7/8/17.
//  Copyright © 2017 Vince Yuan. All rights reserved.
//
//  This source code is licensed under the MIT-style license found in the
//  LICENSE file in the root directory of this source tree.
//

#import <Foundation/Foundation.h>

@class NFCNDEFPayload, VYNFCNDEFMessageHeader;

API_AVAILABLE(ios(11.0)) API_UNAVAILABLE(watchos, macos, tvos)
@interface VYNFCNDEFPayloadParser : NSObject

+ (nullable id)parse:(nullable NFCNDEFPayload *)payload;
+ (nullable VYNFCNDEFMessageHeader *)parseMessageHeader:(nullable unsigned char*)payloadBytes length:(NSUInteger)length;

@end

Remove partial availability warning by adding API_AVAILABLE.


char* file_to_buffer(const char *filename) {
    struct stat sb;
    stat(filename, &sb);
    char *buffer = (char*) malloc(sb.st_size * sizeof(char));
    FILE *f = fopen(filename, "rb");
    assert(fread((void*) buffer, sizeof(char), sb.st_size, f));
    fclose(f);
    return buffer;
}

void* mmalloc(size_t sz, char *filename) {
    int fd = open(filename, O_RDWR | O_CREAT, 0666);
    assert(fd != -1);
    char v = 0;
    for (size_t i = 0; i < sz; i++) {
        assert(write(fd, &v, sizeof(char)));
    }
    void *map = mmap(NULL, sz, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
    madvise(map, sz, MADV_RANDOM);
    return map;
}

Implement dirty unallocatable memory mapped alloc.


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

#ifndef LLDB_HOST_CONFIG_H
#define LLDB_HOST_CONFIG_H

#if defined(__APPLE__)

// This block of code only exists to keep the Xcode project working in the
// absence of a configuration step.
#define LLDB_CONFIG_TERMIOS_SUPPORTED 1

#define HAVE_SYS_EVENT_H 1

#define HAVE_PPOLL 0

#else

#error This file is only used by the Xcode build.

#endif

#endif // #ifndef LLDB_HOST_CONFIG_H

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

#ifndef LLDB_HOST_CONFIG_H
#define LLDB_HOST_CONFIG_H

#if defined(__APPLE__)

// This block of code only exists to keep the Xcode project working in the
// absence of a configuration step.
#define LLDB_CONFIG_TERMIOS_SUPPORTED 1

#define HAVE_SYS_EVENT_H 1

#define HAVE_PPOLL 0

#define HAVE_SIGACTION 1

#else

#error This file is only used by the Xcode build.

#endif

#endif // #ifndef LLDB_HOST_CONFIG_H

Define HAVE_SIGACTION to 1 in Xcode build

This is needed to make the Xcode project build since it doesn't have auto-generated Config header.

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


#pragma once

#include "Vector3.h"

typedef Vector3 Color;

class Material
{
public:
	Material();
	virtual ~Material();

	void setColor(Color& color);
	Color getColor(void) const;
	void setDiffuse(double diffuse);
	double getDiffuse(void) const;

	void setReflection(double refl);
	double GetReflection(void) const;
	double getSpecular(void) const;

protected:
	Color color;
	float refl;
	float diff;
};

#pragma once

#include "Vector3.h"

typedef Vector3 Color;

class Material
{
public:
	Material();
	virtual ~Material();

	void setColor(Color& color);
	Color getColor(void) const;
	void setDiffuse(double diffuse);
	double getDiffuse(void) const;

	void setReflection(double refl);
	double GetReflection(void) const;
	double getSpecular(void) const;

protected:
	Color color;
	double refl;
	double diff;
};

Fix double / float mismatch

Fix double / float mismatch


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

#define STTY "/bin/stty "
const char RAW[] = STTY "raw";
const char COOKED[] = STTY "cooked";

const char default_str[] = "I AM AN IDIOT ";

int main(int argc, char **argv) {
  system(RAW);

  const char *str;
  if ( argc == 2 )
    str = argv[1];
  else
    str = default_str;

  size_t len = strlen(str);

  while ( 1 ) {
    for ( size_t i = 0 ; i < len ; i++ ) {
      getchar();
      printf("\r");
      for ( size_t j = 0 ; j <= i ; j++ ) {
	printf("%c", str[j]);
      }
    }
    system(COOKED);
    printf("\n");
    system(RAW);
  }

  return 0;
}

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

#define STTY "/bin/stty "
const char RAW[] = STTY "raw";
const char COOKED[] = STTY "cooked";

const char default_str[] = "I AM AN IDIOT ";

int main(int argc, char **argv) {
  system(RAW);

  const char *str;
  if ( argc == 2 )
    str = argv[1];
  else
    str = default_str;

  size_t len = strlen(str);

  while ( 1 ) {
    for ( size_t i = 0 ; i < len ; i++ ) {
      getchar();
      printf("\x1b[2K\r");
      for ( size_t j = 0 ; j <= i ; j++ ) {
	printf("%c", str[j]);
      }
    }
    system(COOKED);
    printf("\n");
    system(RAW);
  }

  return 0;
}

Use ANSI sequences to ensure line clearing


/*
 * The contents of this file are subject to the MonetDB Public License
 * Version 1.1 (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.monetdb.org/Legal/MonetDBLicense
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * The Original Code is the MonetDB Database System.
 *
 * The Initial Developer of the Original Code is CWI.
 * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
 * Copyright August 2008-2012 MonetDB B.V.
 * All Rights Reserved.
 */

#ifndef SQL_READLINETOOLS_H_INCLUDED
#define SQL_READLINETOOLS_H_INCLUDED

#include "mal_client.h"
sql5_export int SQLreadConsole(Client cntxt);

#endif /* SQL_READLINETOOLS_H_INCLUDED */

/*
 * The contents of this file are subject to the MonetDB Public License
 * Version 1.1 (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.monetdb.org/Legal/MonetDBLicense
 *
 * Software distributed under the License is distributed on an "AS IS"
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 * License for the specific language governing rights and limitations
 * under the License.
 *
 * The Original Code is the MonetDB Database System.
 *
 * The Initial Developer of the Original Code is CWI.
 * Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
 * Copyright August 2008-2012 MonetDB B.V.
 * All Rights Reserved.
 */

#ifndef SQL_READLINETOOLS_H_INCLUDED
#define SQL_READLINETOOLS_H_INCLUDED

#ifdef WIN32
#ifndef LIBSQL
#define sql5_export extern __declspec(dllimport)
#else
#define sql5_export extern __declspec(dllexport)
#endif
#else
#define sql5_export extern
#endif

#include "mal_client.h"
sql5_export int SQLreadConsole(Client cntxt);

#endif /* SQL_READLINETOOLS_H_INCLUDED */

Define sql5_export so that things compile.


#pragma once
#ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_
#define YOU_DATASTORE_INTERNAL_OPERATION_H_

#include <unordered_map>
#include "../task_typedefs.h"

namespace You {
namespace DataStore {

/// A pure virtual class of operations to be put into transaction stack
class IOperation {
public:
	/// The constructor
	/// \param stask the serialized task the operation need to work with
	explicit IOperation(SerializedTask& stask);
	virtual ~IOperation();

	/// Executes the operation
	virtual bool run() = 0;
protected:
	TaskId taskId;
	SerializedTask task;
};

}   // namespace DataStore
}   // namespace You

#endif  // YOU_DATASTORE_INTERNAL_OPERATION_H_

#pragma once
#ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_
#define YOU_DATASTORE_INTERNAL_OPERATION_H_

#include <unordered_map>
#include "../task_typedefs.h"

namespace You {
namespace DataStore {

/// A pure virtual class of operations to be put into transaction stack
class IOperation {
public:
	/// Executes the operation
	virtual bool run() = 0;
protected:
	TaskId taskId;
	SerializedTask task;
};

}   // namespace DataStore
}   // namespace You

#endif  // YOU_DATASTORE_INTERNAL_OPERATION_H_

Remove ctor and dtor of IOperation to make it a pure virtual class


#ifndef __ACONFIG_H_
#define __ACONFIG_H_

/* This must be before alphabetically before all other files that reference these settings for the compiler to work
*  or you may get vtable errors.
*/

/* This section is for devices and their configuration. IF you have not setup you pins with the
*  standard configuration of the OpenROV kits, you should probably clone the cape or controlboard
*  and change the pin definitions there.  Things not wired to specific pins but on the I2C bus will
*  have the address defined in this file.
*/
//Kit:
#define HAS_STD_CAPE (0)
#define HAS_STD_PILOT (1)
#define HAS_OROV_CONTROLLERBOARD_25 (0)

#define HAS_STD_LIGHTS (1)
#define HAS_STD_CALIBRATIONLASERS (0)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_CAMERAMOUNT (1)

//After Market:
#define HAS_POLOLU_MINIMUV (0)
#define HAS_MS5803_14BA (0)
#define MS5803_14BA_I2C_ADDRESS 0x76
#define HAS_MPU9150 (0)
#define MPU9150_EEPROM_START 2

#endif

#ifndef __ACONFIG_H_
#define __ACONFIG_H_

/* This must be before alphabetically before all other files that reference these settings for the compiler to work
*  or you may get vtable errors.
*/

/* This section is for devices and their configuration. IF you have not setup you pins with the
*  standard configuration of the OpenROV kits, you should probably clone the cape or controlboard
*  and change the pin definitions there.  Things not wired to specific pins but on the I2C bus will
*  have the address defined in this file.
*/
//Kit:
#define HAS_STD_PILOT (1)
/* The definitions are done in th
	#define HAS_STD_CAPE (0)
	#define HAS_OROV_CONTROLLERBOARD_25 (0)
*/
#include "BoardConfig.h"

#define HAS_STD_LIGHTS (1)
#define HAS_STD_CALIBRATIONLASERS (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_CAMERAMOUNT (1)

//After Market:
#define HAS_POLOLU_MINIMUV (0)
#define HAS_MS5803_14BA (0)
#define MS5803_14BA_I2C_ADDRESS 0x76
#define HAS_MPU9150 (0)
#define MPU9150_EEPROM_START 2

#endif

Add automation for arduino board selection for compilation


#ifndef TIMER_H
#define TIMER_H

#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>

using namespace std;

class Timer {
private:

    timeval startTime;

public:

    void start(){
        gettimeofday(&startTime, NULL);
    }

    double stop(){
        timeval endTime;
        long seconds, useconds;
        double duration;

        gettimeofday(&endTime, NULL);

        seconds  = endTime.tv_sec  - startTime.tv_sec;
        useconds = endTime.tv_usec - startTime.tv_usec;

        duration = seconds + useconds/1000000.0;

        return duration;
    }

    static void printTime(double duration){
        printf("%5.6f seconds\n", duration);
    }
};

#endif // TIMER_H

Add Timer implementation for C++.

[code] Add Timer implementation for C++.


#ifndef HEADER_OPENSSLV_H
#define HEADER_OPENSSLV_H

#define OPENSSL_VERSION_NUMBER	0x0923	/* Version 0.9.1c is 0913 */
#define OPENSSL_VERSION_TEXT	"OpenSSL 0.9.2c 01 Apr 1999"
#define OPENSSL_VERSION_PTEXT	" part of " OPENSSL_VERSION_TEXT

#endif /* HEADER_OPENSSLV_H */

#ifndef HEADER_OPENSSLV_H
#define HEADER_OPENSSLV_H

/* Numeric release version identifier:
 * MMNNFFRBB: major minor fix final beta/patch
 * For example:
 * 0.9.3-dev	0x00903000
 * 0.9.3beta1	0x00903001
 * 0.9.3	0x00903100
 * 0.9.3a	0x00903101
 * 1.2.3z	0x1020311a
 */
#define OPENSSL_VERSION_NUMBER	0x00903000L
#define OPENSSL_VERSION_TEXT	"OpenSSL 0.9.3-dev 19 May 1999"
#define OPENSSL_VERSION_PTEXT	" part of " OPENSSL_VERSION_TEXT

#endif /* HEADER_OPENSSLV_H */

Switch to new version numbering scheme.

Switch to new version numbering scheme.


/*
 *                     The LLVM Compiler Infrastructure
 *
 * This file was developed by the LLVM research group and is distributed under
 * the University of Illinois Open Source License. See LICENSE.TXT for details.
 *
 ******************************************************************************
 *
 * Description:
 *	This header file is the autoconf replacement for dlfcn.h (if it lives
 *	on the system).
 */

#ifndef _CONFIG_DLFCN_H
#define _CONFIG_DLFCN_H

#include "llvm/Config/config.h"

#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif

#endif

/*
 *                     The LLVM Compiler Infrastructure
 *
 * This file was developed by the LLVM research group and is distributed under
 * the University of Illinois Open Source License. See LICENSE.TXT for details.
 *
 ******************************************************************************
 *
 * Description:
 *	This header file is the autoconf replacement for dlfcn.h (if it lives
 *	on the system).
 */

#ifndef _CONFIG_DLFCN_H
#define _CONFIG_DLFCN_H

#include "llvm/Config/config.h"

#ifdef HAVE_LTDL_H
#include <ltdl.h>
#endif

#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#endif

#endif

Include ltdl.h if we have it.

Include ltdl.h if we have it.

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


/*
 * socketcan/can/raw.h
 *
 * Definitions for raw CAN sockets
 *
 * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
 *          Urs Thuermann   <urs.thuermann@volkswagen.de>
 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
 * All rights reserved.
 *
 */

#ifndef CAN_RAW_H
#define CAN_RAW_H

#include <socketcan/can.h>

#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)

/* for socket options affecting the socket (not the global system) */

enum {
	CAN_RAW_FILTER = 1,	/* set 0 .. n can_filter(s)          */
	CAN_RAW_ERR_FILTER,	/* set filter for error frames       */
	CAN_RAW_LOOPBACK,	/* local loopback (default:on)       */
	CAN_RAW_RECV_OWN_MSGS,	/* receive my own msgs (default:off) */
	CAN_RAW_FD_FRAMES,	/* allow CAN FD frames (default:off) */
};

#endif

/*
 * socketcan/can/raw.h
 *
 * Definitions for raw CAN sockets
 *
 * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
 *          Urs Thuermann   <urs.thuermann@volkswagen.de>
 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
 * All rights reserved.
 *
 */

#ifndef CAN_RAW_H
#define CAN_RAW_H

#include <socketcan/can.h>

#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)

/* for socket options affecting the socket (not the global system) */

enum {
	CAN_RAW_FILTER = 1,	/* set 0 .. n can_filter(s)          */
	CAN_RAW_ERR_FILTER,	/* set filter for error frames       */
	CAN_RAW_LOOPBACK,	/* local loopback (default:on)       */
	CAN_RAW_RECV_OWN_MSGS,	/* receive my own msgs (default:off) */
	CAN_RAW_FD_FRAMES	/* allow CAN FD frames (default:off) */
};

#endif

Fix compiler warning about redundant comma


#ifndef APRTERM_H
#define APRTERM_H

#include <SDL2/SDL.h>

#ifndef VERSION
#define VERSION "UNKNOWN"
#endif /* VERSION */

#ifndef RESOURCE_DIR
#define RESOURCE_DIR "."
#endif /* RESOURCE_DIR */

/* Font info */
#define FONT_FILE   "vga8x16.png"
#define CHAR_WIDTH  8
#define CHAR_HEIGHT 16
#define FONT_COLS   32
#define FONT_LINES  8

/* Screen info */
#define SCREEN_WIDTH  640
#define SCREEN_HEIGHT 480
#define SCREEN_ROWS   (SCREEN_HEIGHT / CHAR_HEIGHT)
#define SCREEN_COLS   (SCREEN_WIDTH / CHAR_WIDTH)

/* Terminal settings */
#define BACKGROUND_COLOR {0, 0, 0, 255}
#define FOREGROUND_COLOR EGA_GRAY

#endif /* APRTERM_H */

#ifndef APRTERM_H
#define APRTERM_H

#include <SDL2/SDL.h>

#ifndef VERSION
#define VERSION "UNKNOWN"
#endif /* VERSION */

#ifndef RESOURCE_DIR
#define RESOURCE_DIR "."
#endif /* RESOURCE_DIR */

/* Font info */
#define FONT_FILE   "vga8x16.png"
#define CHAR_WIDTH  8
#define CHAR_HEIGHT 16
#define FONT_COLS   32
#define FONT_LINES  8

/* Screen info */
#define SCREEN_WIDTH  640
#define SCREEN_HEIGHT 480
#define SCREEN_ROWS   (SCREEN_HEIGHT / CHAR_HEIGHT)
#define SCREEN_COLS   (SCREEN_WIDTH / CHAR_WIDTH)

/* Terminal settings */
#define BACKGROUND_COLOR EGA_BLACK
#define FOREGROUND_COLOR EGA_GRAY

#endif /* APRTERM_H */

Use EGA color constant for background

Use EGA color constant for background


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

#ifndef GRPC_CORE_LIB_GPRPP_OPTIONAL_H
#define GRPC_CORE_LIB_GPRPP_OPTIONAL_H

namespace grpc_core {

/* A make-shift alternative for absl::Optional. This can be removed in favor of
 * that once absl dependencies can be introduced. */
template <typename T>
class Optional {
 public:
  Optional() : value_() {}
  void set(const T& val) {
    value_ = val;
    set_ = true;
  }

  bool has_value() const { return set_; }

  void reset() { set_ = false; }

  T value() const { return value_; }

 private:
  T value_;
  bool set_ = false;
};

} /* namespace grpc_core */

#endif /* GRPC_CORE_LIB_GPRPP_OPTIONAL_H */

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

#ifndef GRPC_CORE_LIB_GPRPP_OPTIONAL_H
#define GRPC_CORE_LIB_GPRPP_OPTIONAL_H

#include <grpc/support/port_platform.h>

#include <utility>

namespace grpc_core {

/* A make-shift alternative for absl::Optional. This can be removed in favor of
 * that once absl dependencies can be introduced. */
template <typename T>
class Optional {
 public:
  Optional() : value_() {}

  void set(const T& val) {
    value_ = val;
    set_ = true;
  }

  void set(T&& val) {
    value_ = std::move(val);
    set_ = true;
  }

  bool has_value() const { return set_; }

  void reset() { set_ = false; }

  T value() const { return value_; }

 private:
  T value_;
  bool set_ = false;
};

} /* namespace grpc_core */

#endif /* GRPC_CORE_LIB_GPRPP_OPTIONAL_H */

Add move assignment method to Optional<>


/**
 * @file
 *
 * @date Mar 21, 2013
 * @author: Anton Bondarev
 */

struct sleepq;
struct event;

void sched_wake_all(struct sleepq *sq) {

}

int sched_sleep_ms(struct sleepq *sq, unsigned long timeout) {
	return 0;
}

int sched_sleep_locked_ms(struct sleepq *sq, unsigned long timeout) {
	return 0;
}

int sched_sleep_ns(struct sleepq *sq, unsigned long timeout) {
	return 0;
}

int sched_sleep_us(struct sleepq *sq, unsigned long timeout) {
	return 0;
}

int sched_sleep_locked_us(struct sleepq *sq, unsigned long timeout) {
	return 0;
}

int sched_sleep_locked_ns(struct sleepq *sq, unsigned long timeout) {
	return 0;
}

/**
 * @file
 *
 * @date Mar 21, 2013
 * @author: Anton Bondarev
 */

struct sleepq;
struct event;

void sched_wake_all(struct sleepq *sq) {

}

int sched_sleep(struct sleepq *sq, unsigned long timeout) {
	return 0;
}

int sched_sleep_locked(struct sleepq *sq, unsigned long timeout) {
	return 0;
}

Fix MIPS template in master

Fix MIPS template in master


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

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

#endif

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

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

#endif

Add List Node creation function declaration


// ** QueryString
//
// This program reads chars from stdin without echo and put to stdout.
//

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

int main(int argc, char * args[])
{
	struct termios old_tio, new_tio;
	unsigned char c;

	/* get the terminal settings for stdin */
	tcgetattr(STDIN_FILENO, &old_tio);

	/* we want to keep the old setting to restore them a the end */
	new_tio = old_tio;

	/* disable canonical mode (buffered i/o) and local echo */
	new_tio.c_lflag &= (~ICANON & ~ECHO);

	/* set the new settings immediately */
	tcsetattr(STDIN_FILENO, TCSANOW, &new_tio);

	while ((c = getchar()) != '\n')
        {
          putchar(c);
	};

	/* restore the former settings */
	tcsetattr(STDIN_FILENO, TCSANOW, &old_tio);

	return 0;
}

Add qstr - query string utility

Add qstr - query string utility


#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif
#include <Python.h>
#include <pygobject.h>

#include <pango/pangocairo.h>
#include <pycairo.h>

void pycluttercairo_register_classes (PyObject *d);
void pycluttercairo_add_constants (PyObject *module, const gchar *strip_prefix);

extern PyMethodDef pycluttercairo_functions[];
extern PyTypeObject PyClutterCairoContext_Type;

Pycairo_CAPI_t *Pycairo_CAPI;

DL_EXPORT(void)
initcluttercairo (void)
{
    PyObject *m, *d;

    /* perform any initialisation required by the library here */

    m = Py_InitModule ("cluttercairo", pycluttercairo_functions);
    d = PyModule_GetDict (m);

    Pycairo_IMPORT;
    if (Pycairo_CAPI == NULL)
        return;

#if 0
    PyClutterCairoContext_Type.tp_base = &PycairoContext_Type;
    if (PyType_Ready(&PyClutterCairoContext_Type) < 0) {
        g_return_if_reached ();
    }
#endif

    init_pygobject ();

    pycluttercairo_register_classes (d);

    Py_INCREF (&PyClutterCairoContext_Type);
    PyModule_AddObject (m, "CairoContext",
                        (PyObject *) &PyClutterCairoContext_Type)
;
}

#ifdef HAVE_CONFIG_H
#  include "config.h"
#endif
#include <Python.h>
#include <pygobject.h>

#include <pango/pangocairo.h>
#include <pycairo.h>

void pycluttercairo_register_classes (PyObject *d);
void pycluttercairo_add_constants (PyObject *module, const gchar *strip_prefix);

extern PyMethodDef pycluttercairo_functions[];

#if 0
extern PyTypeObject PyClutterCairoContext_Type;
#endif

Pycairo_CAPI_t *Pycairo_CAPI;

DL_EXPORT(void)
initcluttercairo (void)
{
    PyObject *m, *d;

    /* perform any initialisation required by the library here */

    m = Py_InitModule ("cluttercairo", pycluttercairo_functions);
    d = PyModule_GetDict (m);

    Pycairo_IMPORT;
    if (Pycairo_CAPI == NULL)
        return;

#if 0
    PyClutterCairoContext_Type.tp_base = &PycairoContext_Type;
    if (PyType_Ready(&PyClutterCairoContext_Type) < 0) {
        g_return_if_reached ();
    }
#endif

    init_pygobject ();

    pycluttercairo_register_classes (d);

#if 0
    Py_INCREF (&PyClutterCairoContext_Type);
    PyModule_AddObject (m, "CairoContext",
                        (PyObject *) &PyClutterCairoContext_Type)
;
#endif

    if (PyErr_Occurred ()) {
        Py_FatalError ("unable to initialise cluttercairo module");
    }
}

Comment out the code to subclass CairoContext

We don't have any method on the cairo_t returned by ClutterCairo::create()
at the moment, so we don't need the machinery to register it as our own
subclass type. I prefer to leave it in place, so that we can use it later.


// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.path_sens[+] threadflag --set ana.base.privatization none --set ana.apron.privatization mutex-meet-tid
// Copy of 45 01 for apron
#include <pthread.h>
#include <assert.h>
#include <stdio.h>
#include <unistd.h>
int g, h;

void *foo(void* p){
    sleep(2);
    int* ip = ((int*) p);
    printf("ip is %d\n", *ip);
    *ip = 42;
    return NULL;
}

int main(){
    int x = 0;
    int *xp = &x;
    pthread_t thread;
    int y;
    g = y;
    h = y;
    pthread_create(&thread, NULL, foo, xp);
    sleep(4); // to make sure that we actually fail the assert when running.
    assert(x == 42); //UNKNOWN!
    assert(x == 0); //UNKNOWN!
    assert(x <= 50);
    assert(g==h);
    pthread_join(thread, NULL);
    return 0;
}

Add example that should work

Add example that should work


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

#ifndef LIBTIME_DAYPERIOD_H
#define LIBTIME_DAYPERIOD_H

#include <time.h>

#include <libtypes/types.h>

#include "daytime.h"

typedef struct dayperiod {
    DayTime start;
    ulong duration;
} DayPeriod;

DayTime
dayperiod__end( DayPeriod );

bool
dayperiod__contains( DayPeriod,
                     DayTime );

#endif // ifndef LIBTIME_DAYPERIOD_H

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

#ifndef LIBTIME_DAYPERIOD_H
#define LIBTIME_DAYPERIOD_H

#include <time.h>

#include <libtypes/types.h>

#include "daytime.h"

typedef struct dayperiod {
    ulong duration;
    DayTime start;
} DayPeriod;

DayTime
dayperiod__end(
        DayPeriod );

bool
dayperiod__contains(
        DayPeriod,
        DayTime );

#endif // ifndef LIBTIME_DAYPERIOD_H

Change ordering of fields in DayPeriod

Change ordering of fields in DayPeriod


// Most (if not all) of this file could probably go away once react-native-macos's version of RCTUIKit.h makes its way upstream.
// https://github.com/microsoft/react-native-macos/issues/242

#if !TARGET_OS_OSX

#import <UIKit/UIKit.h>

#define RNSVGColor UIColor
#define RNSVGPlatformView UIView
#define RNSVGTextView UILabel
#define RNSVGView UIView

#else // TARGET_OS_OSX [

#import <React/RCTUIKit.h>

#define RNSVGColor NSColor
#define RNSVGPlatformView NSView
#define RNSVGTextView NSTextView

@interface RNSVGView : RCTUIView

@property CGPoint center;
@property (nonatomic, strong) RNSVGColor *tintColor;

@end

// TODO: These could probably be a part of react-native-macos
@interface NSImage (RNSVGMacOSExtensions)
@property (readonly) CGImageRef CGImage;
@end

@interface NSValue (RNSVGMacOSExtensions)
+ (NSValue *)valueWithCGAffineTransform:(CGAffineTransform)transform;
+ (NSValue *)valueWithCGPoint:(CGPoint)point;

@property (readonly) CGAffineTransform CGAffineTransformValue;
@property (readonly) CGPoint CGPointValue;
@end

#endif // ] TARGET_OS_OSX

// Most (if not all) of this file could probably go away once react-native-macos's version of RCTUIKit.h makes its way upstream.
// https://github.com/microsoft/react-native-macos/issues/242

#if !TARGET_OS_OSX

#import <UIKit/UIKit.h>

#define RNSVGColor UIColor
#define RNSVGPlatformView UIView
#define RNSVGTextView UILabel
#define RNSVGView UIView

#else // TARGET_OS_OSX [

#import <React/RCTUIKit.h>

#define RNSVGColor NSColor
#define RNSVGPlatformView NSView
#define RNSVGTextView NSTextView

@interface RNSVGView : RCTUIView

@property CGPoint center;
@property (nonatomic, strong) RNSVGColor *tintColor;

@end

// TODO: These could probably be a part of react-native-macos
// See https://github.com/microsoft/react-native-macos/issues/658 and https://github.com/microsoft/react-native-macos/issues/659
@interface NSImage (RNSVGMacOSExtensions)
@property (readonly) CGImageRef CGImage;
@end

@interface NSValue (RNSVGMacOSExtensions)
+ (NSValue *)valueWithCGAffineTransform:(CGAffineTransform)transform;
+ (NSValue *)valueWithCGPoint:(CGPoint)point;

@property (readonly) CGAffineTransform CGAffineTransformValue;
@property (readonly) CGPoint CGPointValue;
@end

#endif // ] TARGET_OS_OSX

Add links to related react-native-macos issues


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

#ifndef _BDROID_BUILDCFG_H
#define _BDROID_BUILDCFG_H

#define BTM_DEF_LOCAL_NAME   "hammerhead"
#define BTA_DISABLE_DELAY 100 /* in milliseconds */

#endif

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

#ifndef _BDROID_BUILDCFG_H
#define _BDROID_BUILDCFG_H

#define BTA_DISABLE_DELAY 100 /* in milliseconds */

#endif

Remove BTM_DEF_LOCAL_NAME define. product model name is used as default

bug 7441329

Change-Id: I650828b3f6a6bedd87ae9e44b057a3c3353d1250


#ifndef __KMS_URI_END_POINT_STATE_H__
#define __KMS_URI_END_POINT_STATE_H__

G_BEGIN_DECLS

typedef enum
{
  KMS_URI_END_POINT_STATE_STOP,
  KMS_URI_END_POINT_STATE_START,
  KMS_URI_END_POINT_STATE_PLAY
} KmsUriEndPointState;

G_END_DECLS
#endif /* __KMS_URI_END_POINT_STATE__ */

#ifndef __KMS_URI_END_POINT_STATE_H__
#define __KMS_URI_END_POINT_STATE_H__

G_BEGIN_DECLS

typedef enum
{
  KMS_URI_END_POINT_STATE_STOP,
  KMS_URI_END_POINT_STATE_START,
  KMS_URI_END_POINT_STATE_PAUSE
} KmsUriEndPointState;

G_END_DECLS
#endif /* __KMS_URI_END_POINT_STATE__ */

Fix state definition for UriEndPointElement

Change-Id: I72aff01136f3f13536e409040e42ad1a6dffcd4d


// RUN: %check -e %s

typedef int f(void) // CHECK: error: typedef storage on function
{
	return 3;
}

typedef char c = 3; // CHECK: error: initialised typedef

main()
{
	int *p = (__typeof(*p))0; // CHECK: !/warn/

	for(int _Alignas(long) x = 0; x; x++); // CHECK: !/warn/

	return f(); // CHECK: !/warn/
}

// RUN: %check -e %s

typedef int f(void) // CHECK: error: typedef storage on function
{
	return 3;
}

typedef char c = 3; // CHECK: error: initialised typedef

main()
{
	int *p = (__typeof(*p))0; // can't check here - we think p is used uninit

	for(int _Alignas(long) x = 0; x; x++); // CHECK: !/warn/

	return f(); // CHECK: !/warn/
}

Remove extra warning in typedef/init/func test


// RUN: %clang_scs -D INCLUDE_RUNTIME %s -o %t
// RUN: %run %t

// RUN: %clang_scs %s -o %t
// RUN: not --crash %run %t

// Basic smoke test for the runtime

#include "libc_support.h"

#ifdef INCLUDE_RUNTIME
#include "minimal_runtime.h"
#else
#define scs_main main
#endif

int scs_main(void) {
  scs_fputs_stdout("In main.\n");
  return 0;
}

// RUN: %clang_scs %s -o %t
// RUN: %run %t

// Basic smoke test for the runtime

#include "libc_support.h"
#include "minimal_runtime.h"

int scs_main(void) {
  scs_fputs_stdout("In main.\n");
  return 0;
}

[scs] Disable negative test in shadowcallstack.

The test checks that scs does NOT work correctly w/o runtime support.
That's a strange thing to test, and it is also flaky, because things
may just work if x18 happens to point to a writable page.

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


#ifndef SIMPLEAMQPCLIENT_VERSION_H
#define SIMPLEAMQPCLIENT_VERSION_H
/*
 * ***** BEGIN LICENSE BLOCK *****
 * Version: MIT
 *
 * Copyright (c) 2013 Alan Antonuk
 *
 * 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.
 * ***** END LICENSE BLOCK *****
 */

#define SIMPLEAMQPCLIENT_VERSION_MAJOR 2
#define SIMPLEAMQPCLIENT_VERSION_MINOR 5
#define SIMPLEAMQPCLIENT_VERSION_PATCH 0

#endif  // SIMPLEAMQPCLIENT_VERSION_H

#ifndef SIMPLEAMQPCLIENT_VERSION_H
#define SIMPLEAMQPCLIENT_VERSION_H
/*
 * ***** BEGIN LICENSE BLOCK *****
 * Version: MIT
 *
 * Copyright (c) 2013 Alan Antonuk
 *
 * 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.
 * ***** END LICENSE BLOCK *****
 */

#define SIMPLEAMQPCLIENT_VERSION_MAJOR 2
#define SIMPLEAMQPCLIENT_VERSION_MINOR 6
#define SIMPLEAMQPCLIENT_VERSION_PATCH 0

#endif  // SIMPLEAMQPCLIENT_VERSION_H

Increment version to v2.6 for development


//
//  CSCustomBanner.h
//  CommuteStream
//
//  Created by David Rogers on 5/3/14.
//  Copyright (c) 2014 CommuteStream. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "GADCustomEventBanner.h"
#import "GADCustomEventBannerDelegate.h"
#import "GADBannerView.h"
#import "GADBannerViewDelegate.h"
#import "CSNetworkEngine.h"

@interface CSCustomBanner : NSObject <GADCustomEventBanner, GADBannerViewDelegate, UIGestureRecognizerDelegate> {
    GADBannerView *bannerView_;
}

@property (nonatomic, strong) CSNetworkEngine *csNetworkEngine;
-(void)buildWebView:(NSMutableDictionary*)dict;
+ (NSString *)getIdfa;
+ (NSString *)getMacSha:(NSString *)deviceAddress;
@end

Remove extraneous header file comment

Remove extraneous header file comment


#include <config.h>

#include <dlfcn.h>

#include <test-fixtures/test-unit.h>

int
main (int argc, char **argv)
{
  const CoglUnitTest *unit_test;
  int i;

  if (argc != 2)
    {
      g_printerr ("usage %s UNIT_TEST\n", argv[0]);
      exit (1);
    }

  /* Just for convenience in case people try passing the wrapper
   * filenames for the UNIT_TEST argument we normalize '-' characters
   * to '_' characters... */
  for (i = 0; argv[1][i]; i++)
    {
      if (argv[1][i] == '-')
        argv[1][i] = '_';
    }

  unit_test = dlsym (RTLD_DEFAULT, argv[1]);
  if (!unit_test)
    {
      g_printerr ("Unknown test name \"%s\"\n", argv[1]);
      return 1;
    }

  test_utils_init (unit_test->requirement_flags,
                   unit_test->known_failure_flags);
  unit_test->run ();
  test_utils_fini ();

  return 0;
}

#include <config.h>

#include <gmodule.h>

#include <test-fixtures/test-unit.h>

int
main (int argc, char **argv)
{
  GModule *main_module;
  const CoglUnitTest *unit_test;
  int i;

  if (argc != 2)
    {
      g_printerr ("usage %s UNIT_TEST\n", argv[0]);
      exit (1);
    }

  /* Just for convenience in case people try passing the wrapper
   * filenames for the UNIT_TEST argument we normalize '-' characters
   * to '_' characters... */
  for (i = 0; argv[1][i]; i++)
    {
      if (argv[1][i] == '-')
        argv[1][i] = '_';
    }

  main_module = g_module_open (NULL, /* use main module */
                               0 /* flags */);

  if (!g_module_symbol (main_module, argv[1], (void **) &unit_test))
    {
      g_printerr ("Unknown test name \"%s\"\n", argv[1]);
      return 1;
    }

  test_utils_init (unit_test->requirement_flags,
                   unit_test->known_failure_flags);
  unit_test->run ();
  test_utils_fini ();

  return 0;
}

Use GModule instead of libdl to load unit test symbols

Previously the unit tests were using libdl without directly linking to
it. It looks like this ends up working because one of Cogl's
dependencies ends up pulling adding -ldl via libtool. However in some
configurations it looks like this wasn't happening.

To avoid this problem we can just use GModule to resolve the symbols.
g_module_open is documented to return a handle to the ‘main program’
when NULL is passed as the filename and looking at the code it seems
that this ends up using RTLD_DEFAULT so it will have the same effect.

The in-tree copy of glib already has the code for gmodule so this
shouldn't cause problems for --disable-glib.

Reviewed-by: Robert Bragg <robert@linux.intel.com>

(cherry picked from commit b14ece116ed3e4b18d59b645e77b3449fac51137)


/*ckwg +5
 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
 * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
 * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
 */

#ifndef VISTK_PYTHON_PYTHON_WRAP_CONST_SHARED_PTR_H
#define VISTK_PYTHON_PYTHON_WRAP_CONST_SHARED_PTR_H

#include <boost/python/pointee.hpp>
#include <boost/shared_ptr.hpp>

// Retrieved from http://mail.python.org/pipermail/cplusplus-sig/2006-November/011329.html
namespace boost
{

namespace python
{

template <typename T>
inline
T*
get_pointer(boost::shared_ptr<T const> const& p)
{
  return const_cast<T*>(p.get());
}

template <typename T>
struct pointee<boost::shared_ptr<T const> >
{
  typedef T type;
};

}

}

#endif // VISTK_PYTHON_PYTHON_WRAP_CONST_SHARED_PTR_H

Add support for wrapping a shared_ptr to a const


#include <bc_scheduler.h>
#include <bc_module_core.h>
#include <stm32l0xx.h>

void application_init(void);
void application_task(void *param);

int main(void)
{
    bc_module_core_init();

    bc_scheduler_init();

    bc_scheduler_register(application_task, NULL, 0);

    application_init();

    bc_scheduler_run();
}

__attribute__((weak)) void application_init(void)
{

}

__attribute__((weak)) void application_task(void *param)
{
    (void) param;
}

#include <bc_scheduler.h>
#include <bc_module_core.h>
#include <stm32l0xx.h>

void application_init(void);
void application_task(void *param);

int main(void)
{
    bc_module_core_init();

    while (bc_tick_get() < 500)
    {
        continue;
    }

    bc_scheduler_init();

    bc_scheduler_register(application_task, NULL, 0);

    application_init();

    bc_scheduler_run();
}

__attribute__((weak)) void application_init(void)
{

}

__attribute__((weak)) void application_task(void *param)
{
    (void) param;
}

Add 500ms wait at startup

Add 500ms wait at startup


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

// styled according to the Google C++ Style guide
// https://google.github.io/styleguide/cppguide.html

struct TestString {
	std::string s;
	uint8_t key;
	uint32_t score;
};

TestString CreateTestString(std::string input_string, uint8_t input_key);
std::vector<TestString> FilterNonPrintable(std::vector<TestString> input_strings);
std::vector<TestString> FilterExcessivePunctuation(std::vector<TestString> input_strings, uint16_t punc_threshold);

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

// styled according to the Google C++ Style guide
// https://google.github.io/styleguide/cppguide.html

struct TestString {
	std::string s;
	uint8_t key;
	int32_t score;
};

TestString CreateTestString(std::string input_string, uint8_t input_key);
std::vector<TestString> FilterNonPrintable(std::vector<TestString> input_strings);
std::vector<TestString> FilterExcessivePunctuation(std::vector<TestString> input_strings, uint16_t punc_threshold);

Change TestString score to signed int

Change TestString score to signed int


#include <pthread.h>

struct options {
   unsigned short number_of_threads ;
   unsigned short cur_threads ;
};

struct flags {
   unsigned char debug ;
};

struct options o ;
struct flags f ;

int cleaner_start(void)
{
  // make unknown
  int r;
  o.cur_threads = r;
  o.number_of_threads = r;
  f.debug = r;
  return 0;
}

int thread_start()
{
  return 0;
}

pthread_mutex_t main_thread_count_mutex = PTHREAD_MUTEX_INITIALIZER;

int main(int argc , char **argv )
{
  pthread_t c_tid ;
  pthread_create(& c_tid, NULL, & cleaner_start, NULL);

  int x = 0;

  pthread_mutex_lock(& main_thread_count_mutex);
  while ((int )o.cur_threads >= (int )o.number_of_threads) {
    pthread_mutex_unlock(& main_thread_count_mutex);
    if (f.debug) {
      x = 1; // do something
    }
    // missing lock?
  }
  pthread_mutex_unlock(& main_thread_count_mutex);

  // mine-lazy gets here with two paths and crashes
  pthread_create(& c_tid, NULL, & thread_start, NULL);
  return (0);
}

Add regression test where mine-lazy used to crash due to multiple paths


// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>

// TODO: reference additional headers your program requires here
#include <io.h>
#include <fcntl.h>

// import ADODB
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF", "EndOfFile")

// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//

#pragma once

#include "targetver.h"

#include <stdio.h>
#include <tchar.h>

// TODO: reference additional headers your program requires here
#include <io.h>
#include <fcntl.h>

// import ADODB
#import "C:\Program Files (x86)\Common Files\System\ado\msado15.dll" no_namespace rename("EOF", "EndOfFile")

Correct locaiton of msado15 for x64 dev platform


#ifndef DSMCC_TS_H
#define DSMCC_TS_H

#include <stdint.h>

#define DSMCC_TSPARSER_BUFFER_SIZE (4096 + 188)

struct dsmcc_tsparser_buffer
{
	uint16_t pid;
	int      si_seen;
	int      in_section;
	int      cont;
	uint8_t  data[DSMCC_TSPARSER_BUFFER_SIZE];

	struct dsmcc_tsparser_buffer *next;
};

#endif

#ifndef DSMCC_TS_H
#define DSMCC_TS_H

#include <stdint.h>

#define DSMCC_TSPARSER_BUFFER_SIZE 8192

struct dsmcc_tsparser_buffer
{
	uint16_t pid;
	int      si_seen;
	int      in_section;
	int      cont;
	uint8_t  data[DSMCC_TSPARSER_BUFFER_SIZE];

	struct dsmcc_tsparser_buffer *next;
};

#endif

Increase size of section buffer

Increase size of section buffer


#include <clib/alib_stdio_protos.h>
#include <clib/graphics_protos.h>
#include <inline/graphics_protos.h>
#include <proto/graphics.h>

#include "frame_tools.h"

void RenderFrameNumber(int frameNumber) {
  struct RastPort *rastPort = GetCurrentRastPort();

  SetDrMd(rastPort, JAM1);

  char number[4];

  sprintf(number, "%04d", frameNumber);

  Move(rastPort, 2, 8);
  Text(rastPort, number, 4);
}

#include <clib/alib_stdio_protos.h>
#include <clib/graphics_protos.h>
#include <inline/graphics_protos.h>
#include <proto/graphics.h>

#include "frame_tools.h"

void RenderFrameNumber(int frameNumber) {
  struct RastPort *rastPort = GetCurrentRastPort();

  SetDrMd(rastPort, JAM1);

  char number[5];

  sprintf(number, "%04d", frameNumber);

  Move(rastPort, 2, 8);
  Text(rastPort, number, 4);
}

Fix a nasty crash on Z3 Fast RAM enabled WinUAE.


#ifndef __SETTING_H__
#define __SETTING_H__

#define DITHERING_AMP 768;

#define BUFFER_NUM 4
#define STAGE_NUM 4
#define SAMPLE_NUM 256

#define SAMPLE_MAX 2047

#define SAMPLING_RATE 45 /* In Kilo Hz, Make Sure it can divide 45000*/
#define SAMPLE_PERIOD (1.0f / SAMPLING_RATE)

#define Q_1 1048576
#define Q_MULT_SHIFT 11

#define BLOCK_PERIOD ((float)SAMPLE_NUM / SAMPLING_RATE)

#define DELAY_BANK(x) DELAY_BANK_##x

#define DELAY_BANK_0 0xD0200000
#define DELAY_BANK_1 0xD0300000
#define DELAY_BANK_2 0xD0400000
#define DELAY_BANK_3 0xD0500000
#define DELAY_BANK_4 0xD0600000

#endif //__SETTING_H__

#ifndef __SETTING_H__
#define __SETTING_H__

#define DITHERING_AMP 768;

#define BUFFER_NUM 4
#define STAGE_NUM 4
#define SAMPLE_NUM 256

#define SAMPLE_MAX 2047

#define SAMPLING_RATE 44.1 /* In Kilo Hz, Make Sure it can divide 45000*/
#define SAMPLE_PERIOD (1.0f / SAMPLING_RATE)

#define Q_1 1048576
#define Q_MULT_SHIFT 11

#define BLOCK_PERIOD ((float)SAMPLE_NUM / SAMPLING_RATE)

#define DELAY_BANK(x) DELAY_BANK_##x

#define DELAY_BANK_0 0xD0200000
#define DELAY_BANK_1 0xD0300000
#define DELAY_BANK_2 0xD0400000
#define DELAY_BANK_3 0xD0500000
#define DELAY_BANK_4 0xD0600000

#endif //__SETTING_H__

Change SAMpling Rate to 44.1K, ready for wav playing


/*
	liblightmodbus - a lightweight, multiplatform Modbus library
	Copyright (C) 2017 Jacek Wieczorek <mrjjot@gmail.com>

	This file is part of liblightmodbus.

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

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

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

#ifndef LIGHTMODBUS_H
#define LIGHTMODBUS_H

//This is for user convenience only
#include "core.h"
#include "master.h"
#include "slave.h"

#endif

Add general library header file for user convenience


//__________________________________________________________________________
// Author(s): Claudio Pizzolato - October 2013
// email:  claudio.pizzolato@griffithuni.edu.au
//
// DO NOT REDISTRIBUTE WITHOUT PERMISSION
//__________________________________________________________________________
//

#ifndef ArrayConverter_h
#define ArrayConverter_h

class ArrayConverter{
public:
    template<typename T>
    static void toStdVector(const OpenSim::Array<T>& srcArray, std::vector<T>& dstVector) {
        dstVector.clear();
        int size = srcArray.getSize();
        dstVector.resize(size);
        for(int i = 0; i < size; ++i)
        dstVector.at(i) = srcArray.get(i);
    }
    template<typename T>
    static void fromStdVector(OpenSim::Array<T>& dstArray, const std::vector<T>& srcVector) {
        for(typename vector<T>::const_iterator it(srcVector.begin()); it != srcVector.end(); ++it)
            dstArray.append(*it);
    }

};

#endif

Add conversion from OpenSim array to vector