#pragma once

#include "Sprite.h"
#include "FontAsset.h"

class Text : public Sprite {
private:
	std::shared_ptr<FontAsset> asset;
	std::string str;
public:
	Text(std::shared_ptr<FontAsset> asset, const std::string str, const Point2 pos = Point2(0), const Origin origin = Origin::BottomLeft,
		const Point4 color = Point4(1), const Point2 scale = Point2(-1))
		: asset(asset), str(str), Sprite(pos, origin, color, scale) {}

	void RenderMe() override final {
		SDL(surface = TTF_RenderUTF8_Blended(asset->font, str.data(), { 255, 255, 255, 255 }));
	}

	void SetText(const std::string str) {
		this->str = str;
		Render();
	}
};

#pragma once

#include "Sprite.h"
#include "FontAsset.h"

class Text : public Sprite {
private:
	std::shared_ptr<FontAsset> asset;
	std::string str;
public:
	Text(std::shared_ptr<FontAsset> asset, const std::string str, const Point2 pos = Point2(0), const Origin origin = Origin::BottomLeft,
		const Point4 color = Point4(1), const Point2 scale = Point2(-1))
		: asset(asset), str(str), Sprite(pos, origin, color, scale) {}

	void RenderMe() override final {
		// we render the outline first to make a drop-shadow effect

		SDL(TTF_SetFontOutline(asset->font, 2));
		SDL(surface = TTF_RenderUTF8_Blended(asset->font, str.data(), { 0, 0, 0, 255 }));

		// then we render the foreground and blit it on top of the outline

		SDL(TTF_SetFontOutline(asset->font, 0));
		SDL_Surface *fg;
		SDL(fg = TTF_RenderUTF8_Blended(asset->font, str.data(), { 255, 255, 255, 255 }));
		SDL(SDL_BlitSurface(fg, NULL, surface, NULL));
		SDL(SDL_FreeSurface(fg));
	}

	void SetText(const std::string str) {
		this->str = str;
		Render();
	}
};

Add black drop-shadow outline to text

Add black drop-shadow outline to text


/*
 * Wifi.h
 *
 * Copyright (C) 2018 [ A Legge Up ]
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

#ifndef MAIN_WIFI_H_
#define MAIN_WIFI_H_

#include "esp_err.h"
#include "esp_wifi.h"

class Wifi {

    public:
        Wifi();
        virtual ~Wifi();

        esp_err_t eventHandler(void *ctx, system_event_t *event);
};

#endif /* MAIN_WIFI_H_ */

/*
 * Wifi.h
 *
 * Copyright (C) 2018 [ A Legge Up ]
 *
 * This software may be modified and distributed under the terms
 * of the MIT license.  See the LICENSE file for details.
 */

#ifndef MAIN_WIFI_H_
#define MAIN_WIFI_H_

#include "esp_err.h"
#include "esp_wifi.h"

class Wifi {

    public:
        Wifi();
        virtual ~Wifi();

        static esp_err_t eventHandler(void *ctx, system_event_t *event);
};

#endif /* MAIN_WIFI_H_ */

Change eventHandler to static member

Change eventHandler to static member


/* 18 bits => 0x00000 - 0x3FFFF => 256kb */
#define	ADDR_W			18

#define ZWC_CS_W		4
#define ZWC_WB_ADR_W		ADDR_W - ZMC_CS_W - 3
#define ZWC_CS_SIZE		( (1<<ZWC_WB_ADR_W)-1 )

/*
 * 0x00000 - 0x1FFFF: RAM
 * 0x20000 - 0x2FFFF: phiIO
 * 0x30000 - 0x3FFFF: zwishbone
 *
 *
 */
#define		IO_MASK			(1<<(ADDR_W-1))
#define		ZWC_MASK		(1<<(ADDR_W-2))

/*
 * 0x30000          : ZWC_CONFIG
 * 0x30004          : ZWC_STATUS
 * 0x38000 - 0x37ff : ZWC_0_BASE
 * 0x38800 - 0x38ff : ZWC_1_BASE
 * 0x38900 - 0x39ff : ZWC_2_BASE
 * 0x38a00 - 0x3aff : ZWC_3_BASE

#define		ZWC_CONFIG		(IO_MASK | ZWC_MASK)
#define		ZWC_STATUS		(IO_MASK | ZWC_MASK | 4)

#define		ZWC_0_BASE		(IO_MASK | ZWC_MASK | ZWC_BUS_MASK)
#define		ZWC_1_BASE		(ZWC_0_BASE + ZWC_CS_SIZE)
#define		ZWC_2_BASE		(ZWC_1_BASE + ZWC_CS_SIZE)
#define		ZWC_3_BASE		(ZWC_2_BASE + ZWC_CS_SIZE)
/* etc... */

Add basic memory and io map.

Add basic memory and io map.


#ifndef lcthw_List_algos_h
#define lcthw_List_algos_h

#include <lcthw/list.h>

typedef int (*List_compare)(void *a, void *b);

int List_bubble_sort(List *list, List_compare cmp);

List *List_merge_sort(List *list, List_compare cmp);

#endif

#ifndef lcthw_List_algos_h
#define lcthw_List_algos_h

#include <lcthw/list.h>

typedef int (*List_compare)(const void *a, const void *b);

int List_bubble_sort(List *list, List_compare cmp);

List *List_merge_sort(List *list, List_compare cmp);

#endif

Make the compare const void.

Make the compare const void.


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

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

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

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

#include "svn_private_config.h"

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

git-svn-id: f8a4e5e023278da1e04e203c7fe051e3c4285d88@868248 13f79535-47bb-0310-9956-ffa450edef68


#ifndef COWGOL_CGEN_H
#define COWGOL_CGEN_H

#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>

typedef uint8_t i1;
typedef uint16_t i2;
typedef uint32_t i4;
typedef uint64_t i8;

typedef int8_t s1;
typedef int16_t s2;
typedef int32_t s4;
typedef int64_t s8;

extern i8* __top;
extern i8* __himem;
extern i8* global_argv;

typedef union data data;
union data
{
	i8 i8;
	i4 i4[2];
	void* ptr;
};

#endif

#ifndef COWGOL_CGEN_H
#define COWGOL_CGEN_H

#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <endian.h>

#if BYTE_ORDER == BIG_ENDIAN
#error "Sorry, cowgol cgen doesn't work on big endian machines yet."
#endif

typedef uint8_t i1;
typedef uint16_t i2;
typedef uint32_t i4;
typedef uint64_t i8;

typedef int8_t s1;
typedef int16_t s2;
typedef int32_t s4;
typedef int64_t s8;

extern i8* __top;
extern i8* __himem;
extern i8* global_argv;

typedef union data data;
union data
{
	i8 i8;
	i4 i4[2];
	void* ptr;
};

#endif

Annotate that we don't work on big-endian systems yet..


#ifndef _SWAY_EXTENSIONS_H
#define _SWAY_EXTENSIONS_H

#include <wayland-server.h>
#include <wlc/wlc-wayland.h>
#include "wayland-desktop-shell-server-protocol.h"
#include "list.h"

struct background_config {
        wlc_handle output;
        wlc_resource surface;
        // we need the wl_resource of the surface in the destructor
        struct wl_resource *wl_surface_res;
        // used to determine if client is a background
	struct wl_client *client;
};

struct panel_config {
        // wayland resource used in callbacks, is used to track this panel
        struct wl_resource *wl_resource;
        wlc_handle output;
        wlc_resource surface;
        // we need the wl_resource of the surface in the destructor
        struct wl_resource *wl_surface_res;
        enum desktop_shell_panel_position panel_position;
        // used to determine if client is a panel
	struct wl_client *client;
};

struct desktop_shell_state {
        list_t *backgrounds;
        list_t *panels;
        list_t *lock_surfaces;
        bool is_locked;
};

struct swaylock_state {
        bool active;
        wlc_handle output;
        wlc_resource surface;
};

extern struct desktop_shell_state desktop_shell;

void register_extensions(void);

#endif

Fix formatting guide violations (spaces instead of tabs)


/*
 * Copyright (C) 2014, Galois, Inc.
 * This sotware is distributed under a standard, three-clause BSD license.
 * Please see the file LICENSE, distributed with this software, for specific
 * terms and conditions.
 */
#ifndef MINLIBC_SYS_SELECT_H
#define MINLIBC_SYS_SELECT_H

#include <time.h>

typedef struct {} fd_set;

int select(int nfds, fd_set *readfds, fd_set *writefds,
              fd_set *exceptfds, struct timeval *timeout);

#define FD_SET(x,y) /* */
#define FD_ZERO(x) /* */

#endif

/*
 * Copyright (C) 2014, Galois, Inc.
 * This sotware is distributed under a standard, three-clause BSD license.
 * Please see the file LICENSE, distributed with this software, for specific
 * terms and conditions.
 */
#ifndef MINLIBC_SYS_SELECT_H
#define MINLIBC_SYS_SELECT_H

#include <time.h>

typedef struct {} fd_set;

int select(int nfds, fd_set *readfds, fd_set *writefds,
              fd_set *exceptfds, struct timeval *timeout);

#define FD_SET(x,y) /* */
#define FD_ZERO(x) /* */
#define FD_SETSIZE 1024

#endif

Add a definition for FD_SETSIZE.

Add a definition for FD_SETSIZE.


// RUN: %clang_cc1 -emit-llvm < %s | grep i1 | count 1
// All of these should uses the memory representation of _Bool
struct teststruct1 {_Bool a, b;} test1;
_Bool* test2;
_Bool test3[10];
_Bool (*test4)[];
void f(int x) {
  _Bool test5;
  _Bool test6[x];
}

// RUN: %clang_cc1 -triple i686-pc-linux -emit-llvm < %s | FileCheck %s
// All of these should uses the memory representation of _Bool

// CHECK-LABEL: %struct.teststruct1 = type { i8, i8 }
// CHECK-LABEL: @test1 = common global %struct.teststruct1
struct teststruct1 {_Bool a, b;} test1;

// CHECK-LABEL: @test2 = common global i8* null
_Bool* test2;

// CHECK-LABEL: @test3 = common global [10 x i8]
_Bool test3[10];

// CHECK-LABEL: @test4 = common global [0 x i8]* null
_Bool (*test4)[];

// CHECK-LABEL: define void @f(i32 %x)
void f(int x) {
  // CHECK: alloca i8, align 1
  _Bool test5;

  // CHECK: alloca i8, i32 %{{.*}}, align 1
  _Bool test6[x];
}

Convert test to FileCheck and make it more strict.

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


#ifndef KERNEL_PORT_BITWHACK_H
#define KERNEL_PORT_BITWHACK_H

/* Helpers for bitwhacking. */

/**
 * Macros for constructing bit masks.
 *
 * When bitwise-anded with another value:
 *
 * MASK_LO(n) masks out the lowest n bits.
 * MASK_HI(n) masks out all but the lowest n bits.
 * MASK_RANGE(lo, hi) masks out all of the bits on the interval [lo, hi]
 * (inclusive).
 *
 * The KEEP_* macros produce masks that are the inverse of their MASK_*
 * counterparts.
 */
#define MASK_LO(bits) ((-1)<<(bits))
#define KEEP_LO(bits) (~MASK_LO(bits))
#define MASK_HI(bits) KEEP_LO(bits)
#define KEEP_HI(bits) MASK_LO(bits)
#define KEEP_RANGE(lo, hi) (MASK_LO(lo) & MASK_HI(hi))
#define MASK_RANGE(lo, hi) (~KEEP_RANGE(lo, hi))

#endif

#ifndef KERNEL_PORT_BITWHACK_H
#define KERNEL_PORT_BITWHACK_H

/* Helpers for bitwhacking. */

/**
 * Macros for constructing bit masks.
 *
 * When bitwise-anded with another value:
 *
 * MASK_LO(n) masks out the lowest n bits.
 * MASK_HI(n) masks out all but the lowest n bits.
 * MASK_RANGE(lo, hi) masks out all of the bits on the interval [lo, hi]
 * (inclusive).
 *
 * The KEEP_* macros produce masks that are the inverse of their MASK_*
 * counterparts.
 */
#define MASK_LO(bits) ((~0u)<<(bits))
#define KEEP_LO(bits) (~MASK_LO(bits))
#define MASK_HI(bits) KEEP_LO(bits)
#define KEEP_HI(bits) MASK_LO(bits)
#define KEEP_RANGE(lo, hi) (MASK_LO(lo) & MASK_HI(hi))
#define MASK_RANGE(lo, hi) (~KEEP_RANGE(lo, hi))

#endif

Fix warning re: signed shift

Fix warning re: signed shift

Clang complained that shifting a negative number is UB. So we make sure
the constant is unsigned.


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

    This file is part of FLINT.

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

    FLINT 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 FLINT; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

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

    Copyright (C) 2009, 2010 William Hart
    Copyright (C) 2010 Sebastian Pancratz

******************************************************************************/

#include <stdio.h>
#include <stdlib.h>
#include <mpir.h>
#include "flint.h"
#include "fmpz.h"
#include "fmpz_vec.h"
#include "ulong_extras.h"

int
main(void)
{
    int result;
    printf("scalar_divexact_fmpz....");
    fflush(stdout);

    _fmpz_vec_randinit();

    // Check aliasing of a and b
    for (ulong i = 0; i < 10000UL; i++)
    {
        fmpz *a, *b, *c;
        fmpz_t n;
        ulong length = n_randint(100);
        fmpz_init(n);
        fmpz_randtest(n, 100);
        if (n_randint(2))
            fmpz_neg(n, n);

        a = _fmpz_vec_init(length);
        b = _fmpz_vec_init(length);
        _fmpz_vec_randtest(a, length, n_randint(200));

        _fmpz_vec_scalar_mul_fmpz(b, a, length, n);
        _fmpz_vec_scalar_mul_fmpz(a, a, length, n);

        result = (_fmpz_vec_equal(a, b, length));
        if (!result)
        {
            printf("FAIL:\n");
            _fmpz_vec_print(a, length), printf("\n\n");
            _fmpz_vec_print(b, length), printf("\n\n");
            abort();
        }

        _fmpz_vec_clear(a, length);
        _fmpz_vec_clear(b, length);
        fmpz_clear(n);
    }

    _fmpz_vec_randclear();

    _fmpz_cleanup();
    printf("PASS\n");
    return 0;
}

Add a test for fmpz_vec_scalar_divexact_fmpz


#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.32f;

#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;

Increment version number from 1.32 to 1.40

The code that checked for new versions was discarding the last digit of
the version numbers that it read from the releases web page. This means
that it wouldn't notice new versions until the 0.1 column changes. So
I'm changing it. Apologies for the hack. The version checking code has
been fixed so incrementing the 0.01 column will be sufficient next time.


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

#ifdef __ROOTCLING__

// All these are there for the autoloading
#pragma link C++ class ROOT::Experimental::TDataFrame-;
#pragma link C++ class ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameFilterBase>-;
#pragma link C++ class ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>-;

#endif

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

#ifdef __ROOTCLING__

// All these are there for the autoloading
#pragma link C++ class ROOT::Experimental::TDataFrame-;
#pragma link C++ class ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameFilterBase>-;
#pragma link C++ class ROOT::Experimental::TDataFrameInterface<ROOT::Detail::TDataFrameBranchBase>-;
#pragma link C++ class ROOT::Detail::TDataFrameImpl-;

#endif

[TDF] Add another autoload key for TDataFrameImpl'


// RUN: %clang_cc1 -analyze -analyzer-stats %s 2> FileCheck

void foo() {
  ;
}
// CHECK: ... Statistics Collected ...

// RUN: %clang_cc1 -analyze -analyzer-stats %s 2>&1 | FileCheck %s
// XFAIL: *

void foo() {
  ;
}
// CHECK: ... Statistics Collected ...

Fix a test case that was added in r151570.  The redirect of output was broken
so no testing was actually done.  Further, the commands produce no output.
The redirection has been fixed and the test has been disabled.

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


/*
 * Copyright (c) 2012-2016 Israel Jacquez
 * See LICENSE for details.
 *
 * Israel Jacquez <mrkotfw@gmail.com>
 */

#include <vdp2/scrn.h>

#include <assert.h>

#include "vdp2-internal.h"

void
vdp2_scrn_reduction_set(uint8_t scrn, uint16_t horz_reduction)
{
#ifdef DEBUG
        /* Check if the background passed is valid */
        assert((scrn == SCRN_NBG0) ||
               (scrn == SCRN_NBG1));

        assert((horz_reduction == SCRN_REDUCTION_NONE) ||
               (horz_reduction == SCRN_REDUCTION_HALF) ||
               (horz_reduction == SCRN_REDUCTION_QUARTER));
#endif /* DEBUG */

        switch (scrn) {
        case SCRN_NBG0:
                vdp2_state.buffered_regs.zmctl &= 0xFFFC;
                vdp2_state.buffered_regs.zmctl |= horz_reduction;
                break;
        case SCRN_NBG1:
                vdp2_state.buffered_regs.zmctl &= 0xFCFF;
                vdp2_state.buffered_regs.zmctl |= horz_reduction << 8;
                break;
        default:
                return;
        }

        /* Write to memory */
        MEMORY_WRITE(16, VDP2(MZCTL), vdp2_state.buffered_regs.zmctl);
}

/*
 * Copyright (c) 2012-2016 Israel Jacquez
 * See LICENSE for details.
 *
 * Israel Jacquez <mrkotfw@gmail.com>
 */

#include <vdp2/scrn.h>

#include <assert.h>

#include "vdp2-internal.h"

void
vdp2_scrn_reduction_set(uint8_t scrn, uint16_t horz_reduction)
{
#ifdef DEBUG
        /* Check if the background passed is valid */
        assert((scrn == SCRN_NBG0) ||
               (scrn == SCRN_NBG1));

        assert((horz_reduction == SCRN_REDUCTION_NONE) ||
               (horz_reduction == SCRN_REDUCTION_HALF) ||
               (horz_reduction == SCRN_REDUCTION_QUARTER));
#endif /* DEBUG */

        switch (scrn) {
        case SCRN_NBG0:
                vdp2_state.buffered_regs.zmctl &= 0xFFFC;
                vdp2_state.buffered_regs.zmctl |= horz_reduction;
                break;
        case SCRN_NBG1:
                vdp2_state.buffered_regs.zmctl &= 0xFCFF;
                vdp2_state.buffered_regs.zmctl |= horz_reduction << 8;
                break;
        default:
                return;
        }

        /* Write to memory */
        MEMORY_WRITE(16, VDP2(ZMCTL), vdp2_state.buffered_regs.zmctl);
}

Fix writing to wrong register

Fix writing to wrong register


/*
 *  Copyright (c) 2015, Facebook, Inc.
 *  All rights reserved.
 *
 *  This source code is licensed under the BSD-style license found in the
 *  LICENSE file in the root directory of this source tree. An additional grant
 *  of patent rights can be found in the PATENTS file in the same directory.
 *
 */
#pragma once

#include <proxygen/lib/utils/TraceEventObserver.h>

namespace proxygen {
/*
 * A no-op trace event observer
 */
struct NullTraceEventObserver : public TraceEventObserver {
  void traceEventAvailable(TraceEvent) noexcept override {}
};

}

Move sample policy logic to be pre-sending request

Summary:
This is a further java memory allocation to reduce unnecessary TraceEvent instance numbers. From the memory profiling result I ran the other day, the most significant memory allocation in java is for trace events, most of which are actually wasted because of the sample policy. This diff move the sample logic to be before sending request. So we
can prevent the trace event instance from being generated at all if it is not sampled.

Test Plan: Still passed

Reviewed By: seanc@fb.com

Subscribers: bmatheny, seanc, ranjeeth, kmdent, shikong, pgriess

FB internal diff: D1946217

Tasks: 6540655

Signature: t1:1946217:1428422016:198c850e6d5a3919202d347e591a4b21813c214d


#ifndef SSPAPPLICATION_AI_LEVELDIRECTOR_H
#define SSPAPPLICATION_AI_LEVELDIRECTOR_H
#include "Observer.h"
#include <vector>
class LevelDirector
{
private:	// Variables
	/* TEMP STATE STRUCTURE */
	static enum State
	{
		NONE = 0,
		START,
		DEFAULT,
		GOAL
	};
	State m_currentState;
	State m_defaultState;
	//State m_goalState;// A state which is the current goal for the FSM

	// Change State to State* after temp structure is removed
	std::vector<State> m_states;
public:
	LevelDirector();
	~LevelDirector();
	int Shutdown();

	int Initialize();
	int Update(float deltaTime);

	int React(int entityID, EVENT event);

private:	// Helper functions
	void AddState(State newState);
	void SetDefaultState(State state);
	bool ChangeState(State state);

};
#endif

#ifndef SSPAPPLICATION_AI_LEVELDIRECTOR_H
#define SSPAPPLICATION_AI_LEVELDIRECTOR_H
#include "Observer.h"
#include <vector>
//#define NUMSTATES 3
namespace FSMEnvironment
{

#pragma region temp
	enum Hint
	{
		NONE = 0,
		EXAMPLE
	};
	struct State
	{
		int stateID = -1;
		int timeDelay = -1;
		Hint hint = Hint::NONE;

		int CheckTransitions();
		void Enter();
		void Exit();
		void Update(float deltaTime);
	};
#pragma endregion

	class LevelDirector
	{
	private:	// Variables
		State* m_currentState;
		State* m_defaultState;
		State* m_goalState; // A state which is the current goal for the FSM
		int m_goalID;
		std::vector<State> m_states;
	public:
		LevelDirector();
		~LevelDirector();
		int Shutdown();

		int Initialize();
		int Update(float deltaTime);

		int React(int entityID, EVENT event);

	private:	// Helper functions
		// TODO:
		// Depending on what kind of array/vector we end up with to hold our states
		// the argument list should be updated accordingly
		void AddState(State* newState);
		void SetDefaultState(State* state);
		bool ChangeState(int state);

	};
}
#endif

FIX cleaned up header file to resemble FSM environment


/* See LICENSE file for copyright and license details. */

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

#include "../util.h"

static void venprintf(int, const char *, va_list);

void
eprintf(const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	venprintf(EXIT_FAILURE, fmt, ap);
	va_end(ap);
}

void
enprintf(int status, const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	venprintf(status, fmt, ap);
	va_end(ap);
}

void
venprintf(int status, const char *fmt, va_list ap)
{
	vfprintf(stderr, fmt, ap);

	if(fmt[0] && fmt[strlen(fmt)-1] == ':') {
		fputc(' ', stderr);
		perror(NULL);
	}

	exit(status);
}

void
weprintf(const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	vfprintf(stderr, fmt, ap);
	va_end(ap);
	if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
		fputc(' ', stderr);
		perror(NULL);
	}
}

/* See LICENSE file for copyright and license details. */

#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../util.h"

static void venprintf(int, const char *, va_list);

void
eprintf(const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	venprintf(EXIT_FAILURE, fmt, ap);
	va_end(ap);
}

void
enprintf(int status, const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	venprintf(status, fmt, ap);
	va_end(ap);
}

static void
venprintf(int status, const char *fmt, va_list ap)
{
	vfprintf(stderr, fmt, ap);

	if(fmt[0] && fmt[strlen(fmt)-1] == ':') {
		fputc(' ', stderr);
		perror(NULL);
	}

	exit(status);
}

void
weprintf(const char *fmt, ...)
{
	va_list ap;

	va_start(ap, fmt);
	vfprintf(stderr, fmt, ap);
	va_end(ap);
	if (fmt[0] && fmt[strlen(fmt)-1] == ':') {
		fputc(' ', stderr);
		perror(NULL);
	}
}

Mark venprintf() as static explicitly, not just in the decl


#ifdef OS_WINDOWS

#endif

#ifdef LINUX

 #define SWAP(valX,valY)                              \
        {                                             \
          typeof (valX) valZ;                         \
          valZ = valX;                                \
          valX = valY;                                \
          valY = valZ;                                \
        }

#endif

/*Swap 2 integer number by xor method*/
void swap2int(int *,int *);

char *decimal_to_binary(size_t);

/*Inverse number like 1136 -> 6311*/
int inverse_number(int);

char * base64_decoder(const char *);
char * base64_encoder(const char *);
char * url_decoder(const char *);
char * url_encoder(const char *);

/*ASCII values convert HEX values*/
char *ascii2hex(const char  *,size_t);

/*HEX values convert ASCII values*/
char *hex2ascii(const char  *,size_t);

const int is_little_endian_ival = 1;
#define is_little_endian() ( ( *((char*) &is_little_endian_ival) ) == 1 )

Check system is big endian or little endian function added

Check system is big endian or little endian?


//
//  Constants.h
//  Pods
//
//  Created by Danil Tulin on 1/30/16.
//
//

@import Foundation;

#ifndef Constants_h
#define Constants_h

const static NSString *defaultPrimaryColor = @"1A1A1C";
const static NSString *darkPrimaryColor = @"121315";

const static NSInteger bottomToolbarHeight = 50;

const static CGFloat defaultAnimationDuration = .3f;

const static NSInteger predscriptionViewCornerViewOffset = 25;
#endif /* Constants_h */

//
//  Constants.h
//  Pods
//
//  Created by Danil Tulin on 1/30/16.
//
//

@import Foundation;

#ifndef Constants_h
#define Constants_h

const static NSString *defaultPrimaryColor = @"1A1A1C";
const static NSString *darkPrimaryColor = @"121315";

const static NSInteger bottomToolbarHeight = 50;

const static CGFloat defaultAnimationDuration = .3f;

const static NSInteger predscriptionViewCornerViewOffset = 25;

const static CGSize SERoundButtonsContainerOffset = {25, 20};
#endif /* Constants_h */

Add new constant for button

Add new constant for button


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

#pragma once

#include "Stdafx.h"

#include "include\cef_callback.h"

namespace CefSharp
{
    public ref class CefCallbackWrapper : public ICallback
    {
    private:
        MCefRefPtr<CefCallback> _callback;

    public:
        CefCallbackWrapper(CefRefPtr<CefCallback> &callback) : _callback(callback)
        {

        }

        !CefCallbackWrapper()
        {
            _callback = NULL;
        }

        ~CefCallbackWrapper()
        {
            this->!CefCallbackWrapper();
        }

        virtual void Cancel()
        {
            if (_callback.get() == nullptr)
            {
                return;
            }

            _callback->Cancel();

            delete this;
        }

        virtual void Continue()
        {
            if (_callback.get() == nullptr)
            {
                return;
            }

            _callback->Continue();

            delete this;
        }
    };
}

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

#pragma once

#include "Stdafx.h"

#include "include\cef_callback.h"

namespace CefSharp
{
    public ref class CefCallbackWrapper : public ICallback
    {
    private:
        MCefRefPtr<CefCallback> _callback;

    public:
        CefCallbackWrapper(CefRefPtr<CefCallback> &callback) : _callback(callback)
        {

        }

        !CefCallbackWrapper()
        {
            _callback = NULL;
        }

        ~CefCallbackWrapper()
        {
            this->!CefCallbackWrapper();
        }

        virtual void Cancel()
        {
            if (_callback.get())
            {
                _callback->Cancel();

                delete this;
            }
        }

        virtual void Continue()
        {
            if (_callback.get())
            {
                _callback->Continue();

                delete this;
            }
        }
    };
}

Change 'if' style for null _callback check


/*
 *     Copyright 2013 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 SRC_CONFIG_H
#define SRC_CONFIG_H 1

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>

#ifdef _WIN32
#include <windows.h>
typedef unsigned __int8 cbsasl_uint8_t;
typedef unsigned __int16 cbsasl_uint16_t;
typedef unsigned __int32 cbsasl_uint32_t;
#else
#include <unistd.h>
#include <stdint.h>
typedef uint8_t cbsasl_uint8_t;
typedef uint16_t cbsasl_uint16_t;
typedef uint32_t cbsasl_uint32_t;
#endif

#endif /* SRC_CONFIG_H */

/*
 *     Copyright 2013 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 SRC_CONFIG_H
#define SRC_CONFIG_H 1

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include <platform/platform.h>

typedef uint8_t cbsasl_uint8_t;
typedef uint16_t cbsasl_uint16_t;
typedef uint32_t cbsasl_uint32_t;

#endif /* SRC_CONFIG_H */

Include platform.h instead of ifdef'ing

Include platform.h instead of ifdef'ing

Change-Id: I23b3202563623b46d94c10459837581be231f58e
Reviewed-on: http://review.couchbase.org/30386
Reviewed-by: Michael Wiederhold <a17fed27eaa842282862ff7c1b9c8395a26ac320@couchbase.com>
Tested-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>


/*	$OpenBSD: spinlock.h,v 1.1 1999/01/08 08:25:34 d Exp $	*/

#ifndef _MACHINE_SPINLOCK_H_
#define _MACHINE_SPINLOCK_H_

#define _SPINLOCK_UNLOCKED	(1)
#define _SPINLOCK_LOCKED	(0)
typedef int _spinlock_lock_t;

#endif

/*	$OpenBSD: spinlock.h,v 1.2 2005/12/19 21:30:10 marco Exp $	*/

#ifndef _MACHINE_SPINLOCK_H_
#define _MACHINE_SPINLOCK_H_

#define _SPINLOCK_UNLOCKED	(1)
#define _SPINLOCK_LOCKED	(0)
typedef int _spinlock_lock_t __attribute__((__aligned__(16)));

#endif

Fix hppa ldcw alignment issue.

Fix hppa ldcw alignment issue.

Help deraadt, tedu, kettenis
Ok tedu, kettenis


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

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

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

	if (!client_verify_open_mailbox(cmd))
		return TRUE;

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

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

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

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

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

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

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

	if (!client_verify_open_mailbox(cmd))
		return TRUE;

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

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

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

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

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


//
//  BDSKOAIGroupServer.h
//  Bibdesk
//
//  Created by Christiaan Hofman on 1/1/07.
//  Copyright 2007 __MyCompanyName__. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "BDSKSearchGroup.h"

@class BDSKServerInfo;

@interface BDSKOAIGroupServer : NSObject <BDSKSearchGroupServer>
{
    BDSKSearchGroup *group;
    BDSKServerInfo *serverInfo;
    NSString *searchTerm;
    NSString *resumptionToken;
    NSArray *sets;
    NSString *filePath;
    NSURLDownload *URLDownload;
    BOOL failedDownload;
    BOOL isRetrieving;
    BOOL needsReset;
    int availableResults;
    int fetchedResults;
}
- (void)setServerInfo:(BDSKServerInfo *)info;
- (BDSKServerInfo *)serverInfo;
- (void)setSearchTerm:(NSString *)string;
- (NSString *)searchTerm;
- (void)setSets:(NSArray *)newSets;
- (NSArray *)sets;
- (void)setResumptionToken:(NSString *)newResumptionToken;
- (NSString *)resumptionToken;
- (void)resetSearch;
- (void)fetchSets;
- (void)fetch;
- (void)startDownloadFromURL:(NSURL *)theURL;

@end

Add new header file. (or: xcode is stupid)


// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.global.annotations
// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.var.annotation | count 3

#include <stdio.h>

/* Global variable with attribute */
int X __attribute__((annotate("GlobalValAnnotation")));

/* Function with attribute */
int foo(int y) __attribute__((annotate("GlobalValAnnotation")))
               __attribute__((noinline));

int foo(int y __attribute__((annotate("LocalValAnnotation")))) {
  int x __attribute__((annotate("LocalValAnnotation")));
  x = 34;
  return y + x;
}

int main() {
  static int a __attribute__((annotate("GlobalValAnnotation")));
  a = foo(2);
  printf("hello world%d\n", a);
  return 0;
}

// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.global.annotations
// RUN: %clang_cc1 -emit-llvm %s -o - | grep llvm.var.annotation | count 3

/* Global variable with attribute */
int X __attribute__((annotate("GlobalValAnnotation")));

/* Function with attribute */
int foo(int y) __attribute__((annotate("GlobalValAnnotation")))
               __attribute__((noinline));

int foo(int y __attribute__((annotate("LocalValAnnotation")))) {
  int x __attribute__((annotate("LocalValAnnotation")));
  x = 34;
  return y + x;
}

int main() {
  static int a __attribute__((annotate("GlobalValAnnotation")));
  a = foo(2);
  return 0;
}

Make this test portable on Win32.

Make this test portable on Win32.

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


#ifndef PSTR_HELPER_H
#define PSTR_HELPER_H

#include <avr/pgmspace.h>

// Modified PSTR that pushes string into a char* buffer for easy use.
//
// There is only one buffer so this will cause problems if you need to pass two
// strings to one function.
#define PSTR2(x) PSTRtoBuffer_P(PSTR(x))
#define PSTR2_BUFFER_SIZE 32 // May need adjusted depending on your needs.

char *PSTRtoBuffer_P(PGM_P str);

#endif

#ifndef PSTR_HELPER_H
#define PSTR_HELPER_H

#include <avr/pgmspace.h>

// Modified PSTR that pushes string into a char* buffer for easy use.
//
// There is only one buffer so this will cause problems if you need to pass two
// strings to one function.
#define PSTR2(x) PSTRtoBuffer_P(PSTR(x))
#define PSTR2_BUFFER_SIZE 48 // May need adjusted depending on your needs.

char *PSTRtoBuffer_P(PGM_P str);

#endif

Increase PSTR2 buffer (fix broken calibration)

- No idea how this didn't cause problems before. Luck?


/*
 * Copyright (C) 1998, 1999, 2002, 2003, 2005 Hewlett-Packard Co
 *	David Mosberger-Tang <davidm@hpl.hp.com>
 *
 * Register stack engine related helper functions.  This file may be
 * used in applications, so be careful about the name-space and give
 * some consideration to non-GNU C compilers (though __inline__ is
 * fine).
 */
#ifndef RSE_H
#define RSE_H

#include <libunwind.h>

static inline uint64_t
rse_slot_num (uint64_t addr)
{
	return (addr >> 3) & 0x3f;
}

/*
 * Return TRUE if ADDR is the address of an RNAT slot.
 */
static inline uint64_t
rse_is_rnat_slot (uint64_t addr)
{
	return rse_slot_num (addr) == 0x3f;
}

/*
 * Returns the address of the RNAT slot that covers the slot at
 * address SLOT_ADDR.
 */
static inline uint64_t
rse_rnat_addr (uint64_t slot_addr)
{
	return slot_addr | (0x3f << 3);
}

/*
 * Calculate the number of registers in the dirty partition starting at
 * BSPSTORE and ending at BSP.  This isn't simply (BSP-BSPSTORE)/8
 * because every 64th slot stores ar.rnat.
 */
static inline uint64_t
rse_num_regs (uint64_t bspstore, uint64_t bsp)
{
	uint64_t slots = (bsp - bspstore) >> 3;

	return slots - (rse_slot_num(bspstore) + slots)/0x40;
}

/*
 * The inverse of the above: given bspstore and the number of
 * registers, calculate ar.bsp.
 */
static inline uint64_t
rse_skip_regs (uint64_t addr, long num_regs)
{
	long delta = rse_slot_num(addr) + num_regs;

	if (num_regs < 0)
		delta -= 0x3e;
	return addr + ((num_regs + delta/0x3f) << 3);
}

#endif /* RSE_H */

Include "libunwind_i.h" instead of "internal.h".

2005/05/19 08:11:38-07:00 hp.com!davidm
Rename: include/ia64/rse.h -> include/tdep-ia64/rse.h

(Logical change 1.294)


#ifndef	THREAD_POSIX_H
#define	THREAD_POSIX_H

struct ThreadState {
	pthread_t td_;

	static void start(pthread_key_t key, Thread *td)
	{
		pthread_t self = pthread_self();

		td->state_->td_ = self;

		int rv = pthread_setspecific(key, td);
		if (rv == -1) {
			ERROR("/thread/state/start") << "Could not set thread-local Thread pointer.";
			return;
		}

#if defined(__FreeBSD__)
		pthread_set_name_np(self, td->name_.c_str());
#elif defined(__APPLE__)
		pthread_setname_np(td->name_.c_str());
#endif
	}
};

#endif /* !THREAD_POSIX_H */

Add missed file in previous revision.

Add missed file in previous revision.


#ifndef __GAME__
#define __GAME__

#include<vector>
#include<SDL2/SDL.h>
#include"GameObject.h"
#include"GameStateMachine.h"

class Game
{
    public:
        static Game *getInstance()
        {
            if (!instance) {
                instance = new Game();
            }

            return instance;
        }

        bool init(const char *title, int xPosition, int yPosition, int height, int width, bool fullScreen);

        void render();
        void update();
        void handleEvents();
        void clean();

        bool isRunning() { return running; }

        SDL_Renderer *getRenderer() const { return renderer; }

    private:
        static Game *instance;

        bool running;
        SDL_Window *window;
        SDL_Renderer *renderer;
        GameStateMachine *gameStateMachine;

        std::vector<GameObject*> gameObjects;

        Game() {}
        ~Game() {}
};

typedef Game TheGame;

#endif

#ifndef __GAME__
#define __GAME__

#include<vector>
#include<SDL2/SDL.h>
#include"GameObject.h"
#include"GameStateMachine.h"

class Game
{
    public:
        static Game *getInstance()
        {
            if (!instance) {
                instance = new Game();
            }

            return instance;
        }

        bool init(const char *title, int xPosition, int yPosition, int height, int width, bool fullScreen);

        void render();
        void update();
        void handleEvents();
        void clean();

        bool isRunning() { return running; }

        SDL_Renderer *getRenderer() const { return renderer; }
        GameStateMachine* getStateMachine() { return gameStateMachine; }

    private:
        static Game *instance;

        bool running;
        SDL_Window *window;
        SDL_Renderer *renderer;
        GameStateMachine *gameStateMachine;

        std::vector<GameObject*> gameObjects;

        Game() {}
        ~Game() {}
};

typedef Game TheGame;

#endif

Include method to return pointer to object gameStateMachine


/*
 *  Copyright (c) 2017, Facebook, Inc.
 *  All rights reserved.
 *
 *  This source code is licensed under the BSD-style license found in the
 *  LICENSE file in the root directory of this source tree. An additional grant
 *  of patent rights can be found in the PATENTS file in the same directory.
 *
 */

#pragma once

#include <atomic>
#include <string>
#include <thread>

#include <wangle/concurrent/ThreadFactory.h>
#include <folly/Conv.h>
#include <folly/Range.h>
#include <folly/ThreadName.h>

namespace wangle {

class NamedThreadFactory : public ThreadFactory {
 public:
  explicit NamedThreadFactory(folly::StringPiece prefix)
    : prefix_(prefix.str()), suffix_(0) {}

  std::thread newThread(folly::Func&& func) override {
    auto thread = std::thread([&](folly::Func&& funct) {
      folly::setThreadName(folly::to<std::string>(prefix_, suffix_++));
      funct();
    }, std::move(func));
    return thread;
  }

  void setNamePrefix(folly::StringPiece prefix) {
    prefix_ = prefix.str();
  }

  std::string getNamePrefix() {
    return prefix_;
  }

 private:
  std::string prefix_;
  std::atomic<uint64_t> suffix_;
};

} // namespace wangle

/*
 *  Copyright (c) 2017, Facebook, Inc.
 *  All rights reserved.
 *
 *  This source code is licensed under the BSD-style license found in the
 *  LICENSE file in the root directory of this source tree. An additional grant
 *  of patent rights can be found in the PATENTS file in the same directory.
 *
 */

#pragma once

#include <atomic>
#include <string>
#include <thread>

#include <wangle/concurrent/ThreadFactory.h>
#include <folly/Conv.h>
#include <folly/Range.h>
#include <folly/ThreadName.h>

namespace wangle {

class NamedThreadFactory : public ThreadFactory {
 public:
  explicit NamedThreadFactory(folly::StringPiece prefix)
    : prefix_(prefix.str()), suffix_(0) {}

  std::thread newThread(folly::Func&& func) override {
    auto thread = std::thread(std::move(func));
    folly::setThreadName(
        thread.native_handle(),
        folly::to<std::string>(prefix_, suffix_++));
    return thread;
  }

  void setNamePrefix(folly::StringPiece prefix) {
    prefix_ = prefix.str();
  }

  std::string getNamePrefix() {
    return prefix_;
  }

 private:
  std::string prefix_;
  std::atomic<uint64_t> suffix_;
};

} // namespace wangle

Revert D5012627: [FBCode] Switch various calls to folly::setThreadName to set the current thread's name

Summary: This reverts commit a4e6e2c2cb5bd02b1ebea85c305eac59355a7d42

Differential Revision: D5012627

fbshipit-source-id: ff4b8ff94d5f5e76f0777b96d03975d3f7834a17


//
//  ImageLoader.h
//  ImageLoader
//
//  Created by Hirohisa Kawasaki on 10/16/14.
//  Copyright (c) 2014 Hirohisa Kawasaki. All rights reserved.
//

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

FOUNDATION_EXPORT double ImageLoaderVersionNumber;
FOUNDATION_EXPORT const unsigned char ImageLoaderVersionString[];

//
//  ImageLoader.h
//  ImageLoader
//
//  Created by Hirohisa Kawasaki on 10/16/14.
//  Copyright (c) 2014 Hirohisa Kawasaki. All rights reserved.
//

#import <Foundation/Foundation.h>

FOUNDATION_EXPORT double ImageLoaderVersionNumber;
FOUNDATION_EXPORT const unsigned char ImageLoaderVersionString[];

Remove import `UIKit` from header file

Remove import `UIKit` from header file


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

#ifndef BASE_MUTEX_H_
#define BASE_MUTEX_H_

#include <pthread.h>
#include "base/common.h"

namespace threading {

class Mutex {
 public:
  Mutex();
  ~Mutex();
  void Lock();

  /*!
      Attempts to lock the mutex. If the lock was obtained, this function
      returns true. If another thread has locked the mutex, this
      function returns false immediately.

      If the lock was obtained, the mutex must be unlocked with Unlock()
      before another thread can successfully lock it.
  */
  bool TryLock();
  void Unlock();

 private:
  pthread_mutex_t mutex_;
  DISALLOW_COPY_AND_ASSIGN(Mutex)
};

// A helper class that acquires the given Mutex while the MutexLock is in scope
class MutexLock {
 public:
  explicit MutexLock(Mutex *m): mutex_(m) {
    CHECK(mutex_ != NULL);
    mutex_->Lock();
  }

  ~MutexLock() {
    mutex_->Unlock();
  }

 private:
  Mutex * const mutex_;
  DISALLOW_COPY_AND_ASSIGN(MutexLock)
};

}  // namespace threading

#endif  // BASE_MUTEX_H_

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

#ifndef BASE_MUTEX_H_
#define BASE_MUTEX_H_

#include <pthread.h>
#include "base/common.h"

namespace threading {

// OS-independent wrapper for mutex/critical section synchronization primitive.
// This Mutex is NOT re-entrant!
//
// TODO(DimanNe): add DCHECKs for
//  * locking a Mutex twice from the same thread,
//  * unlocking a Mutex which is not locked,
//  * destroying a locked Mutex.
class Mutex {
 public:
  Mutex();
  ~Mutex();
  void Lock();

  /*!
      Attempts to lock the mutex. If the lock was obtained, this function
      returns true. If another thread has locked the mutex, this
      function returns false immediately.

      If the lock was obtained, the mutex must be unlocked with Unlock()
      before another thread can successfully lock it.
  */
  bool TryLock();
  void Unlock();

 private:
  pthread_mutex_t mutex_;
  DISALLOW_COPY_AND_ASSIGN(Mutex)
};

// A helper class that acquires the given Mutex while the MutexLock is in scope
class MutexLock {
 public:
  explicit MutexLock(Mutex *m): mutex_(m) {
    CHECK(mutex_ != NULL);
    mutex_->Lock();
  }

  ~MutexLock() {
    mutex_->Unlock();
  }

 private:
  Mutex * const mutex_;
  DISALLOW_COPY_AND_ASSIGN(MutexLock)
};

}  // namespace threading

#endif  // BASE_MUTEX_H_

Add a comment with a 'TODO: add DCHECKS' for class Mutex


/*
 * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
 * Copyright 2016 Cryptography Research, Inc.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 *
 * Originally written by Mike Hamburg
 */

#ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H
# define OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H

# define ARCH_WORD_BITS 64

static ossl_inline uint64_t word_is_zero(uint64_t a)
{
    /* let's hope the compiler isn't clever enough to optimize this. */
    return (((__uint128_t) a) - 1) >> 64;
}

static ossl_inline uint128_t widemul(uint64_t a, uint64_t b)
{
    return ((uint128_t) a) * b;
}

#endif                          /* OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H */

/*
 * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
 * Copyright 2016 Cryptography Research, Inc.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 *
 * Originally written by Mike Hamburg
 */

#ifndef OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H
# define OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H

# include "internal/constant_time.h"

# define ARCH_WORD_BITS 64

# define word_is_zero(a)     constant_time_is_zero_64(a)

static ossl_inline uint128_t widemul(uint64_t a, uint64_t b)
{
    return ((uint128_t) a) * b;
}

#endif                          /* OSSL_CRYPTO_EC_CURVE448_ARCH_64_INTRINSICS_H */

Use constant time zero check function

curve448: Use constant time zero check function

Signed-off-by: Amitay Isaacs <amitay@ozlabs.org>

Reviewed-by: Tomas Mraz <2bc6038c3dfca09b2da23c8b6da8ba884dc2dcc2@openssl.org>
Reviewed-by: Matt Caswell <1fa2ef4755a9226cb9a0a4840bd89b158ac71391@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14784)


#include "Python.h"
#include "osdefs.h"

#ifndef PYTHONPATH
#define PYTHONPATH ".:/usr/local/lib/python"
#endif

/* Return the initial python search path.  This is called once from
   initsys() to initialize sys.path.  The environment variable
   PYTHONPATH is fetched and the default path appended.  The default
   path may be passed to the preprocessor; if not, a system-dependent
   default is used. */

char *
getpythonpath()
{
	char *path = getenv("PYTHONPATH");
	char *defpath = PYTHONPATH;
	static char *buf = NULL;
	char *p;
	int n;

	if (path == NULL)
		path = "";
	n = strlen(path) + strlen(defpath) + 2;
	if (buf != NULL) {
		free(buf);
		buf = NULL;
	}
	buf = malloc(n);
	if (buf == NULL)
		Py_FatalError("not enough memory to copy module search path");
	strcpy(buf, path);
	p = buf + strlen(buf);
	if (p != buf)
		*p++ = DELIM;
	strcpy(p, defpath);
	return buf;
}

#include "Python.h"
#include "osdefs.h"

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#else
extern char *getenv Py_PROTO((const char *));
#endif

#ifndef PYTHONPATH
#define PYTHONPATH ".:/usr/local/lib/python"
#endif

/* Return the initial python search path.  This is called once from
   initsys() to initialize sys.path.  The environment variable
   PYTHONPATH is fetched and the default path appended.  The default
   path may be passed to the preprocessor; if not, a system-dependent
   default is used. */

char *
getpythonpath()
{
	char *path = getenv("PYTHONPATH");
	char *defpath = PYTHONPATH;
	static char *buf = NULL;
	char *p;
	int n;

	if (path == NULL)
		path = "";
	n = strlen(path) + strlen(defpath) + 2;
	if (buf != NULL) {
		free(buf);
		buf = NULL;
	}
	buf = malloc(n);
	if (buf == NULL)
		Py_FatalError("not enough memory to copy module search path");
	strcpy(buf, path);
	p = buf + strlen(buf);
	if (p != buf)
		*p++ = DELIM;
	strcpy(p, defpath);
	return buf;
}

Include stdlib.h or declare getenv

Include stdlib.h or declare getenv


//
// Created by david on 2019-03-18.
//

#pragma once

#include <general/eigen_tensor_fwd_decl.h>

class class_state_finite;
class class_model_finite;
class class_edges_finite;
class class_tensors_finite;
class class_algorithm_status;
class class_tic_toc;
enum class OptSpace;
enum class OptType;
enum class OptMode;
enum class StateRitz;
namespace tools::finite::opt {
    class opt_mps;

    using Scalar = std::complex<double>;
    extern opt_mps find_excited_state(const class_tensors_finite &tensors, const opt_mps &initial_mps, const class_algorithm_status &status,
                                        OptMode optMode, OptSpace optSpace, OptType optType);
    extern opt_mps find_excited_state(const class_tensors_finite &tensors, const class_algorithm_status &status, OptMode optMode, OptSpace optSpace,
                                        OptType optType);
    extern Eigen::Tensor<Scalar, 3> find_ground_state(const class_tensors_finite &tensors, StateRitz ritz);
}

//
// Created by david on 2019-03-18.
//

#pragma once

#include <general/eigen_tensor_fwd_decl.h>

class class_state_finite;
class class_model_finite;
class class_edges_finite;
class class_tensors_finite;
class class_algorithm_status;
class class_tic_toc;
namespace eig {class solver;}
enum class OptSpace;
enum class OptType;
enum class OptMode;
enum class StateRitz;
namespace tools::finite::opt {
    class opt_mps;

    using Scalar = std::complex<double>;
    using real = double;
    using cplx = std::complex<double>;
    extern void                     extract_solutions(const opt_mps &initial_mps,const class_tensors_finite &tensors, eig::solver &solver, std::vector<tools::finite::opt::opt_mps> &eigvecs_mps, const std::string & tag = "");
    extern opt_mps find_excited_state(const class_tensors_finite &tensors, const opt_mps &initial_mps, const class_algorithm_status &status,
                                        OptMode optMode, OptSpace optSpace, OptType optType);
    extern opt_mps find_excited_state(const class_tensors_finite &tensors, const class_algorithm_status &status, OptMode optMode, OptSpace optSpace,
                                        OptType optType);
    extern Eigen::Tensor<Scalar, 3> find_ground_state(const class_tensors_finite &tensors, StateRitz ritz);
}

Use forward declarations to speed up compilation

Former-commit-id: 58cb24dbf6102d6be5cf36336ae6547d9b6b544e


/*
 *  antifreeze.h
 *  StatusSpec project
 *
 *  Copyright (c) 2014-2015 Forward Command Post
 *  BSD 2-Clause License
 *  http://opensource.org/licenses/BSD-2-Clause
 *
 */

#pragma once

#include "cdll_int.h"
#include "vgui/VGUI.h"

#include "../modules.h"

class ConCommand;
class ConVar;
class IConVar;
class KeyValues;

namespace vgui {
	class EditablePanel;
};

class AntiFreeze : public Module {
public:
	AntiFreeze(std::string name);

	static bool CheckDependencies(std::string name);
private:
	class DisplayPanel;
	class RefreshPanel;
	DisplayPanel *displayPanel;
	RefreshPanel *refreshPanel;

	ConVar *display;
	ConCommand *display_reload_settings;
	ConVar *display_threshold;
	ConVar *enabled;
	void ChangeDisplayThreshold(IConVar *var, const char *pOldValue, float flOldValue);
	void ReloadSettings();
	void ToggleDisplay(IConVar *var, const char *pOldValue, float flOldValue);
	void ToggleEnabled(IConVar *var, const char *pOldValue, float flOldValue);
};

/*
 *  antifreeze.h
 *  StatusSpec project
 *
 *  Copyright (c) 2014-2015 Forward Command Post
 *  BSD 2-Clause License
 *  http://opensource.org/licenses/BSD-2-Clause
 *
 */

#pragma once

#include "../modules.h"

class ConCommand;
class ConVar;
class IConVar;

class AntiFreeze : public Module {
public:
	AntiFreeze(std::string name);

	static bool CheckDependencies(std::string name);
private:
	class DisplayPanel;
	class RefreshPanel;
	DisplayPanel *displayPanel;
	RefreshPanel *refreshPanel;

	ConVar *display;
	ConCommand *display_reload_settings;
	ConVar *display_threshold;
	ConVar *enabled;
	void ChangeDisplayThreshold(IConVar *var, const char *pOldValue, float flOldValue);
	void ReloadSettings();
	void ToggleDisplay(IConVar *var, const char *pOldValue, float flOldValue);
	void ToggleEnabled(IConVar *var, const char *pOldValue, float flOldValue);
};

Remove unneeded declarations and headers.


/* Begin CVS Header
   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/copasiversion.h,v $
   $Revision: 1.3 $
   $Name:  $
   $Author: shoops $
   $Date: 2004/02/19 03:28:58 $
   End CVS Header */

#ifndef COPASI_VERSION
#define COPASI_VERSION

#define COPASI_VERSION_MAJOR 4
#define COPASI_VERSION_MINOR 0
#define COPASI_VERSION_BUILD 2

#endif // COPASI_VERSION

/* Begin CVS Header
   $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/copasiversion.h,v $
   $Revision: 1.4 $
   $Name:  $
   $Author: shoops $
   $Date: 2004/02/20 18:15:46 $
   End CVS Header */

#ifndef COPASI_VERSION
#define COPASI_VERSION

#define COPASI_VERSION_MAJOR 4
#define COPASI_VERSION_MINOR 0
#define COPASI_VERSION_BUILD 3

#endif // COPASI_VERSION

Build number increased to 3.

Build number increased to 3.


Check dir have to be done

Check dir have to be done


/* $OpenBSD: param.h,v 1.2 2010/10/11 15:51:06 syuu Exp $ */
/* public domain */

#ifndef _MACHINE_PARAM_H_
#define _MACHINE_PARAM_H_

#define	MACHINE		"octeon"
#define	_MACHINE	octeon
#define MACHINE_ARCH	"mips64"
#define _MACHINE_ARCH	mips64
/* not the canonical endianness */
#define	MACHINE_CPU	"mips64"
#define	_MACHINE_CPU	mips64

#define MID_MACHINE	MID_MIPS64

/*
 * The Loongson level 1 cache expects software to prevent virtual
 * aliases. Unfortunately, since this cache is physically tagged,
 * this would require all virtual address to have the same bits 14
 * and 13 as their physical addresses, which is not something the
 * kernel can guarantee unless the page size is at least 16KB.
 */
#define	PAGE_SHIFT	14

#include <mips64/param.h>

#endif	/* _MACHINE_PARAM_H_ */

/* $OpenBSD: param.h,v 1.3 2011/06/25 19:38:47 miod Exp $ */
/* public domain */

#ifndef _MACHINE_PARAM_H_
#define _MACHINE_PARAM_H_

#define	MACHINE		"octeon"
#define	_MACHINE	octeon
#define MACHINE_ARCH	"mips64"
#define _MACHINE_ARCH	mips64

#define MID_MACHINE	MID_MIPS64

#define	PAGE_SHIFT	14

#include <mips64/param.h>

#endif	/* _MACHINE_PARAM_H_ */

Remove irrelevant comments borrowed from loongson.


/*===- ConfinementForce.h - libSimulation -=====================================
*
*                                  DEMON
*
* This file is distributed under the BSD Open Source License. See LICENSE.TXT
* for details.
*
*===-----------------------------------------------------------------------===*/

#ifndef CONFINEMENTFORCE_H
#define CONFINEMENTFORCE_H

#include "Force.h"

class ConfinementForce : public Force {
public:
	ConfinementForce(Cloud * const C, double confineConst)
	: Force(C), confine(confineConst) {}
	// IMPORTANT: In the above constructor, confineConst must be positive!
	~ConfinementForce() {}

	void force1(const double currentTime); // rk substep 1
	void force2(const double currentTime); // rk substep 2
	void force3(const double currentTime); // rk substep 3
	void force4(const double currentTime); // rk substep 4

	void writeForce(fitsfile * const file, int * const error) const;
	void readForce(fitsfile * const file, int * const error);

private:
	double confine; // [V/m^2]

	void force(const cloud_index currentParticle, const __m128d currentPositionX, const __m128d currentPositionY);
};

#endif // CONFINEMENTFORCE_H

/*===- ConfinementForce.h - libSimulation -=====================================
*
*                                  DEMON
*
* This file is distributed under the BSD Open Source License. See LICENSE.TXT
* for details.
*
*===-----------------------------------------------------------------------===*/

#ifndef CONFINEMENTFORCE_H
#define CONFINEMENTFORCE_H

#include "Force.h"

class ConfinementForce : public Force {
public:
	ConfinementForce(Cloud * const C, double confineConst)
	: Force(C), confine(confineConst) {}
	// IMPORTANT: In the above constructor, confineConst must be positive!
	~ConfinementForce() {}

	virtual void force1(const double currentTime); // rk substep 1
	virtual void force2(const double currentTime); // rk substep 2
	virtual void force3(const double currentTime); // rk substep 3
	virtual void force4(const double currentTime); // rk substep 4

	virtual void writeForce(fitsfile * const file, int * const error) const;
	virtual void readForce(fitsfile * const file, int * const error);

private:
	double confine; // [V/m^2]

	void force(const cloud_index currentParticle, const __m128d currentPositionX, const __m128d currentPositionY);
};

#endif // CONFINEMENTFORCE_H

Add virtual to methods that get overridden.


//
//  main.c
//  d16-asm
//
//  Created by Michael Nolan on 6/17/16.
//  Copyright © 2016 Michael Nolan. All rights reserved.
//

#include <stdio.h>
#include <stdlib.h>
#include "parser.h"
#include "assembler.h"
#include <string.h>
#include "instruction.h"

extern int yyparse (FILE* output_file);
extern FILE* yyin;
extern int yydebug;
int main(int argc, const char * argv[]) {

    if(argc != 3){
        fprintf(stderr, "Usage d16-asm [file] [output]\n");
        exit(-1);
    }
    FILE* f = fopen(argv[1], "r");
    FILE* o = fopen(argv[2], "wb");
    if(f == NULL){
        fprintf(stderr, "Error opening file %s\n",argv[1]);
        exit(-1);
    }
    if(o == NULL){
        fprintf(stderr, "Error opening file %s for writing\n",argv[2]);
        exit(2);
    }
    yyin = f;

	  init_hash_table();
    do {
        yyparse(o);
    } while (!feof(yyin));
    fclose(f);
    fclose(o);
    return 0;
}

//
//  main.c
//  d16-asm
//
//  Created by Michael Nolan on 6/17/16.
//  Copyright © 2016 Michael Nolan. All rights reserved.
//

#include <stdio.h>
#include <stdlib.h>
#include "parser.h"
#include "assembler.h"
#include <string.h>
#include "instruction.h"
#include <unistd.h>
extern int yyparse (FILE* output_file);
extern FILE* yyin;
extern int yydebug;
int main(int argc, char * const argv[]) {
    FILE *f,*o;
    opterr = 0;
    int c;
    while ((c=getopt(argc,argv,"o:")) != -1){
        switch(c){
            case 'o':
                o = fopen(optarg,"wb");

        }
    }
    if(optind<argc) f = fopen(argv[optind],"r");
    else{
        fprintf(stderr,"d16: No input files specified\n");
        exit(-1);
    }
    if(o==NULL){
        o=fopen("a.out","wb");
    }

    yyin = f;

	  init_hash_table();
    do {
        yyparse(o);
    } while (!feof(yyin));
    fclose(f);
    fclose(o);
    return 0;
}

Convert assembler to use getopt for arguments


/*
 * Copyright 2011-2013 Blender Foundation
 *
 * 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
 */

#if defined(__x86_64__) || defined(_M_X64)

/* no SSE2 kernel on x86-64, part of regular kernel */
#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3
#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE41

#endif

#if defined(i386) || defined(_M_IX86)

#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE2
#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3
#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE41

#endif

/*
 * Copyright 2011-2013 Blender Foundation
 *
 * 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
 */

#if defined(__x86_64__) || defined(_M_X64)

/* no SSE2 kernel on x86-64, part of regular kernel */
#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3
#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE41

/* VC2008 is not ready for sse41, probably broken blendv intrinsic... */
#if defined(_MSC_VER) && (_MSC_VER < 1700)
#undef WITH_CYCLES_OPTIMIZED_KERNEL_SSE41
#endif

#endif

#if defined(i386) || defined(_M_IX86)

#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE2
#define WITH_CYCLES_OPTIMIZED_KERNEL_SSE3

#endif

Cycles: Disable SSE41 kernel on 32bit, we don't use intrinsics here anyway. Also disable it for Visual Studio < 2012, broken blendv instruction.


/* Write a program to count blanks, tabs, and newlines. */

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

int main(int argc, char **argv)
{
  uint32_t blank_count, tab_count, newline_count;
  int16_t character;
  blank_count = tab_count = newline_count = 0;
  while ((character = getchar()) != EOF) {
    switch (character) {
      case ' ':
        blank_count++;
        break;
      case '\t':
        tab_count++;
        break;
      case '\n':
        newline_count++;
        break;
    }
  }
  printf("Number of blanks: %d\n", blank_count);
  printf("Number of tabs: %d\n", tab_count);
  printf("Number of newlines: %d\n", newline_count);
  return EXIT_SUCCESS;
}

Add solution to Exercise 1-8.

Add solution to Exercise 1-8.


#include "packet_queue.h"

#include "error.h"
#include "radio.h"

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

uint32_t packet_queue_init(packet_queue_t * queue)
{
    queue->head = 0;
    queue->tail = 0;

    return SUCCESS;
}

bool packet_queue_is_empty(packet_queue_t * queue)
{
    return queue->head == queue->tail;
}

bool packet_queue_is_full(packet_queue_t * queue)
{
    return abs(queue->head - queue->tail) == PACKET_QUEUE_SIZE;
}

uint32_t packet_queue_add(packet_queue_t * queue, radio_packet_t * packet)
{
    if (packet_queue_is_full(queue))
        return NO_MEMORY;

    memcpy(&queue->packets[0], packet, sizeof(packet));

    queue->tail++;

    return SUCCESS;
}

uint32_t packet_queue_get(packet_queue_t * queue, radio_packet_t ** packet)
{
    if (packet_queue_is_empty(queue))
        return NOT_FOUND;

    *packet = &queue->packets[queue->head];

    queue->head++;

    return SUCCESS;
}

#include "packet_queue.h"

#include "error.h"
#include "radio.h"

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

uint32_t packet_queue_init(packet_queue_t * queue)
{
    queue->head = 0;
    queue->tail = 0;

    return SUCCESS;
}

bool packet_queue_is_empty(packet_queue_t * queue)
{
    return queue->head == queue->tail;
}

bool packet_queue_is_full(packet_queue_t * queue)
{
    return abs(queue->head - queue->tail) == PACKET_QUEUE_SIZE;
}

uint32_t packet_queue_add(packet_queue_t * queue, radio_packet_t * packet)
{
    if (packet_queue_is_full(queue))
        return NO_MEMORY;

    memcpy(&queue->packets[0], packet, sizeof(*packet));

    queue->tail++;

    return SUCCESS;
}

uint32_t packet_queue_get(packet_queue_t * queue, radio_packet_t ** packet)
{
    if (packet_queue_is_empty(queue))
        return NOT_FOUND;

    *packet = &queue->packets[queue->head];

    queue->head++;

    return SUCCESS;
}

Fix bug in add, copy size.

Fix bug in add, copy size.


// PARAM: --enable ana.int.interval --sets exp.solver.td3.side_widen cycle_self
#include <pthread.h>
#include <assert.h>

int g = 6;
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t B = PTHREAD_MUTEX_INITIALIZER;

void *t_fun(void *arg) {
  int x = 1;
  pthread_mutex_lock(&A);
  assert(g == 6);
  assert(x == 1);
  g = 5;
  assert(g == 5);
  assert(x == 1);
  pthread_mutex_lock(&B);
  assert(g == 5);
  assert(x == 1);
  pthread_mutex_unlock(&B);
  assert(g == 5);
  assert(x == 1);
  x = g;
  assert(x == 5);
  g = x + 1;
  assert(g == 6);
  x = g;          // added
  assert(g == 6); // added
  assert(x == 6); // added
  pthread_mutex_unlock(&A);
  assert(x == 6); // modified
  return NULL;
}

int main(void) {
  pthread_t id;
  assert(g == 6);
  pthread_create(&id, NULL, t_fun, NULL);
  assert(5 <= g);
  assert(g <= 6);
  pthread_join(id, NULL);
  return 0;
}

Add ignored example from traces paper

Add ignored example from traces paper


typedef enum json_type {
	JSON_HASH, JSON_ARRAY, JSON_NUMBER, JSON_STRING, JSON_TRUE, JSON_FALSE, JSON_NULL,
	JSON_COMMA, JSON_COLON, JSON_ITEM, JSON_KEY, JSON_VALUE,
} json_type;

typedef struct json_object {
	json_type type;
	struct json_object *parent;

	char *string;
	double number;

	struct json_object **array;
	struct json_object **keys;
	struct json_object **values;
	int length;

	int expect;
} json_object;

struct json_pull {
	json_object *root;
	char *error;

	int (*read)(struct json_pull *);
	int (*peek)(struct json_pull *);
	void *source;
	int line;

	json_object *container;
};
typedef struct json_pull json_pull;

typedef void (*json_separator_callback)(json_type type, json_pull *j, void *state);

json_pull *json_begin_file(FILE *f);
json_pull *json_begin_string(char *s);
json_object *json_parse(json_pull *j);
json_object *json_parse_with_separators(json_pull *j, json_separator_callback cb, void *state);
void json_free(json_object *j);

json_object *json_hash_get(json_object *o, char *s);

typedef enum json_type {
	// These types can be returned by json_parse()
	JSON_HASH, JSON_ARRAY, JSON_NUMBER, JSON_STRING, JSON_TRUE, JSON_FALSE, JSON_NULL,

	// These and JSON_HASH and JSON_ARRAY can be called back by json_parse_with_separators()
	JSON_COMMA, JSON_COLON,

	// These are only used internally as expectations of what comes next
	JSON_ITEM, JSON_KEY, JSON_VALUE,
} json_type;

typedef struct json_object {
	json_type type;
	struct json_object *parent;

	char *string;
	double number;

	struct json_object **array;
	struct json_object **keys;
	struct json_object **values;
	int length;

	int expect;
} json_object;

struct json_pull {
	json_object *root;
	char *error;

	int (*read)(struct json_pull *);
	int (*peek)(struct json_pull *);
	void *source;
	int line;

	json_object *container;
};
typedef struct json_pull json_pull;

typedef void (*json_separator_callback)(json_type type, json_pull *j, void *state);

json_pull *json_begin_file(FILE *f);
json_pull *json_begin_string(char *s);
json_object *json_parse(json_pull *j);
json_object *json_parse_with_separators(json_pull *j, json_separator_callback cb, void *state);
void json_free(json_object *j);

json_object *json_hash_get(json_object *o, char *s);

Clarify what types are used where

Clarify what types are used where


#ifndef __ADR_MAIN_H__
#define __ADR_MAIN_H__

// Libraries //
#include "craftable.h"
#include "resource.h"
#include "villager.h"
#include "location.h"

// Forward Declarations //
struct adr_state {
    enum LOCATION adr_loc;
    enum FIRE_STATE adr_fire;
    enum ROOM_TEMP adr_temp;
    unsigned int adr_rs [ALIEN_ALLOY + 1];
    unsigned short adr_cs [RIFLE + 1];
    unsigned short adr_vs [MUNITIONIST + 1];
};

#endif // __ADR_MAIN_H__
// vim: set ts=4 sw=4 et:

#ifndef __ADR_MAIN_H__
#define __ADR_MAIN_H__

// Libraries //
#include "craftable.h"
#include "resource.h"
#include "villager.h"
#include "location.h"

// Forward Declarations //
struct adr_state {
    enum LOCATION loc;
    enum FIRE_STATE fire;
    enum ROOM_TEMP temp;
    unsigned int rs [ALIEN_ALLOY + 1];
    unsigned short cs [RIFLE + 1];
    unsigned short vs [MUNITIONIST + 1];
};

#endif // __ADR_MAIN_H__
// vim: set ts=4 sw=4 et:

Remove unnecessary state variable adr_ prefixes


// RUN: %clang -O1 -fvectorize -Rpass-analysis=loop-vectorize -emit-llvm -S %s -o - 2>&1 | FileCheck %s

// CHECK: {{.*}}:9:11: remark: loop not vectorized: vectorization requires changes in the order of operations, however IEEE 754 floating-point operations are not commutative; allow commutativity by specifying '#pragma clang loop vectorize(enable)' before the loop or by providing the compiler option '-ffast-math'

double foo(int N) {
  double v = 0.0;

  for (int i = 0; i < N; i++)
    v = v + 1.0;

  return v;
}

// RUN: %clang -O1 -fvectorize -target x86_64-unknown-unknown -Rpass-analysis=loop-vectorize -emit-llvm -S %s -o - 2>&1 | FileCheck %s

// CHECK: {{.*}}:9:11: remark: loop not vectorized: vectorization requires changes in the order of operations, however IEEE 754 floating-point operations are not commutative; allow commutativity by specifying '#pragma clang loop vectorize(enable)' before the loop or by providing the compiler option '-ffast-math'

double foo(int N) {
  double v = 0.0;

  for (int i = 0; i < N; i++)
    v = v + 1.0;

  return v;
}

Make frontend floating-point commutivity test X86 specific to avoid cost-model related problems on arm-thumb and hexagon.

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


// Copyright 2015 Ben Trask
// MIT licensed (see LICENSE for details)

#include <stdarg.h>

char *vaasprintf(char const *const fmt, va_list ap);
char *aasprintf(char const *const fmt, ...) __attribute__((format(printf, 1, 2)));

int time_iso8601(char *const out, size_t const max);

void valogf(char const *const fmt, va_list ap);
void alogf(char const *const fmt, ...);

// Copyright 2015 Ben Trask
// MIT licensed (see LICENSE for details)

#include <stdarg.h>

char *vaasprintf(char const *const fmt, va_list ap);
char *aasprintf(char const *const fmt, ...) __attribute__((format(printf, 1, 2)));

int time_iso8601(char *const out, size_t const max);

void valogf(char const *const fmt, va_list ap);
void alogf(char const *const fmt, ...) __attribute__((format(printf, 1, 2)));

Add printf __attribute__ to log function.


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

#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
#error "Only <glib-object.h> can be included directly."
#endif

G_DEFINE_AUTO_CLEANUP_FREE_FUNC(GStrv, g_strfreev, NULL)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GObject, g_object_unref)
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GValue, g_value_unset)

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

#if !defined (__GLIB_GOBJECT_H_INSIDE__) && !defined (GOBJECT_COMPILATION)
#error "Only <glib-object.h> can be included directly."
#endif

G_DEFINE_AUTO_CLEANUP_FREE_FUNC(GStrv, g_strfreev, NULL)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GObject, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GInitiallyUnowned, g_object_unref)
G_DEFINE_AUTO_CLEANUP_CLEAR_FUNC(GValue, g_value_unset)

gobject: Add missing autocleanup for GInitiallyUnowned

We are missing the auto cleanup function for this type, which means
G_DECLARE_* macros won't work with classes inheriting from
GInitiallyUnowned.


#ifndef RUBYSPEC_CAPI_MRI_H
#define RUBYSPEC_CAPI_MRI_H

/* #undef any HAVE_ defines that MRI does not have. */
#undef HAVE_RB_HASH_LOOKUP
#undef HAVE_RB_HASH_SIZE

#undef HAVE_RB_OBJ_FROZEN_P

#undef HAVE_RB_STR_PTR
#undef HAVE_RB_STR_PTR_READONLY

#undef HAVE_THREAD_BLOCKING_REGION

#ifdef RUBY_VERSION_IS_1_9
#undef HAVE_RARRAY
#undef HAVE_RFLOAT
#undef HAVE_RSTRING
#undef HAVE_STR2CSTR
#undef HAVE_RB_STR2CSTR
#undef HAVE_RB_CVAR_SET
#undef HAVE_RB_SET_KCODE
#endif

/* Macros that may not be defined in old versions */
#ifndef RARRAY_PTR
#define RARRAY_PTR(s) (*(VALUE *const *)&RARRAY(s)->ptr)
#endif

#ifndef RARRAY_LEN
#define RARRAY_LEN(s) (*(const long *)&RARRAY(s)->len)
#endif

#ifndef RFLOAT_VALUE
#define RFLOAT_VALUE(v) (RFLOAT(v)->value)
#endif

#endif

#ifndef RUBYSPEC_CAPI_MRI_H
#define RUBYSPEC_CAPI_MRI_H

/* #undef any HAVE_ defines that MRI does not have. */
#undef HAVE_RB_HASH_LOOKUP
#undef HAVE_RB_HASH_SIZE

#undef HAVE_RB_OBJ_FROZEN_P

#undef HAVE_RB_STR_PTR
#undef HAVE_RB_STR_PTR_READONLY

#undef HAVE_THREAD_BLOCKING_REGION

#ifdef RUBY_VERSION_IS_1_9
#undef HAVE_RARRAY
#undef HAVE_RFLOAT
#undef HAVE_RSTRING
#undef HAVE_STR2CSTR
#undef HAVE_RB_STR2CSTR
#undef HAVE_RB_CVAR_SET
#undef HAVE_RB_SET_KCODE
#endif

/* RubySpec assumes following are public API */
#ifndef rb_proc_new
VALUE rb_proc_new _((VALUE (*)(ANYARGS/* VALUE yieldarg[, VALUE procarg] */), VALUE));
#endif
#ifndef rb_str_len
int rb_str_len(VALUE);
#endif
#ifndef rb_set_errinfo
void rb_set_errinfo(VALUE);
#endif

/* Macros that may not be defined in old versions */
#ifndef RARRAY_PTR
#define RARRAY_PTR(s) (*(VALUE *const *)&RARRAY(s)->ptr)
#endif

#ifndef RARRAY_LEN
#define RARRAY_LEN(s) (*(const long *)&RARRAY(s)->len)
#endif

#ifndef RFLOAT_VALUE
#define RFLOAT_VALUE(v) (RFLOAT(v)->value)
#endif

#endif

Add prototype of non public API of MRI.

Add prototype of non public API of MRI.

RubySpec may want to test some APIs even if they are not declared as
public API by MRI team. This commit is not to confirm they are public.


//===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=//
//
// This functionality is implemented by the lib/Bytecode/Reader library.
// This library is used to read VM bytecode files from an iostream.
//
// Note that performance of this library is _crucial_ for performance of the
// JIT type applications, so we have designed the bytecode format to support
// quick reading.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_BYTECODE_READER_H
#define LLVM_BYTECODE_READER_H

#include <string>

class Module;

// Parse and return a class...
//
Module *ParseBytecodeFile(const std::string &Filename,
                          std::string *ErrorStr = 0);
Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned BufferSize,
                            std::string *ErrorStr = 0);

#endif

//===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=//
//
// This functionality is implemented by the lib/Bytecode/Reader library.
// This library is used to read VM bytecode files from an iostream.
//
// Note that performance of this library is _crucial_ for performance of the
// JIT type applications, so we have designed the bytecode format to support
// quick reading.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_BYTECODE_READER_H
#define LLVM_BYTECODE_READER_H

#include <string>
#include <vector>

class Module;

// Parse and return a class...
//
Module *ParseBytecodeFile(const std::string &Filename,
                          std::string *ErrorStr = 0);
Module *ParseBytecodeBuffer(const unsigned char *Buffer, unsigned BufferSize,
                            std::string *ErrorStr = 0);

// ReadArchiveFile - Read bytecode files from the specfied .a file, returning
// true on error, or false on success.
//
bool ReadArchiveFile(const std::string &Filename, std::vector<Module*> &Objects,
                     std::string *ErrorStr = 0);

#endif

Add prototype to read .a files

Add prototype to read .a files

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


//
//  SWXSLTransform.h
//  This file is part of the "SWXMLMapping" project, and is distributed under the MIT License.
//
//  Created by Samuel Williams on 23/02/12.
//  Copyright (c) 2012 Samuel Williams. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface SWXSLTransform : NSObject {
	NSURL * _baseURL;
	void * _stylesheet;
}

/// The base URL that was used to load the stylesheet:
@property(nonatomic,strong) NSURL * baseURL;

/// Initialize the XSL stylesheet from the given URL:
- (instancetype) initWithURL:(NSURL *)url NS_DESIGNATED_INITIALIZER;

/// Use the XSL stylesheet to process a string containing XML with a set of arguments.
/// Arguments are typically evaluated by the XSLT processor, so, for example, strings must be passed with an additional set of quotes.
- (NSData *) processDocument:(NSString *)xmlBuffer arguments:(NSDictionary *)arguments;

@end

//
//  SWXSLTransform.h
//  This file is part of the "SWXMLMapping" project, and is distributed under the MIT License.
//
//  Created by Samuel Williams on 23/02/12.
//  Copyright (c) 2012 Samuel Williams. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface SWXSLTransform : NSObject {
	NSURL * _baseURL;
	void * _stylesheet;
}

/// The base URL that was used to load the stylesheet:
@property(nonatomic,strong) NSURL * baseURL;

- (instancetype) init NS_UNAVAILABLE;

/// Initialize the XSL stylesheet from the given URL:
- (instancetype) initWithURL:(NSURL *)url NS_DESIGNATED_INITIALIZER;

/// Use the XSL stylesheet to process a string containing XML with a set of arguments.
/// Arguments are typically evaluated by the XSLT processor, so, for example, strings must be passed with an additional set of quotes.
- (NSData *) processDocument:(NSString *)xmlBuffer arguments:(NSDictionary *)arguments;

@end

Mark init as being unavailable.

Mark init as being unavailable.


/*!
 * @brief Template C++-header file
 *
 * This is a template C++-header file
 * @author  <+AUTHOR+>
 * @date    <+DATE+>
 * @file    <+FILE+>
 * @version 0.1
 */
#ifndef <+FILE_CAPITAL+>_H
#define <+FILE_CAPITAL+>_H

/*!
 * @brief Template class
 */
class <+FILEBASE+>
{
private:
public:
  <+FILEBASE+>() {
    <+CURSOR+>
  }
};  // class <+FILEBASE+>

#endif  // <+FILE_CAPITAL+>_H

/*!
 * @brief Template C++-header file
 *
 * This is a template C++-header file
 * @author  <+AUTHOR+>
 * @date    <+DATE+>
 * @file    <+FILE+>
 * @version 0.1
 */
#ifndef <+FILE_CAPITAL+>_H
#define <+FILE_CAPITAL+>_H

#include <iostream>

/*!
 * @brief Template class
 */
class <+FILE_PASCAL+>
{
private:
public:
  <+FILEBASE+>() {
    <+CURSOR+>
  }

  template<typename CharT, typename Traits>
    friend std::basic_ostream<CharT, Traits>&
    operator<<(std::basic_ostream<CharT, Traits>& os, const CoutTest& this_);

  template<typename CharT, typename Traits>
    friend std::basic_istream<CharT, Traits>&
    operator>>(std::basic_istream<CharT, Traits>& is, CoutTest& this_);
};  // class <+FILE_PASCAL+>

template<typename CharT, typename Traits>
std::basic_ostream<CharT, Traits>&
operator<<(std::basic_ostream<CharT, Traits>& os, const CoutTest& this_)
{

  return os;
}

template<typename CharT, typename Traits>
std::basic_istream<CharT, Traits>&
operator>>(std::basic_istream<CharT, Traits>& is, CoutTest& this_)
{

  return is;
}

#endif  // <+FILE_CAPITAL+>_H

Enable to treat with std::cout and std::cin


/*
 * Copyright (c) 2012-2016 Israel Jacquez
 * See LICENSE for details.
 *
 * Israel Jacquez <mrkotfw@gmail.com>
 */

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

#include "stack.h"

char *
stack_backtrace(void)
{
        extern void *_text_start;
        extern void *_text_end;

        static char buf[1024];

        uintptr_t fp;
        uintptr_t pr;

        int level;

        /* Obtain address of the caller and its frame pointer before it
         * is clobbered by any subsequent calls */
        STACK_RET_ADDRESS(pr);
        STACK_FPTR(fp);

        level = 0;
        *buf = '\0';
        do {
                (void)sprintf(buf, "%s #%i 0x%08X in ??? ()\n",
                    buf, level, (uintptr_t)pr);

                pr = STACK_FPTR_RET_ADDRESS_GET(fp);
                fp = STACK_FPTR_NEXT_GET(fp);

                level++;
        } while (((pr >= (uint32_t)&_text_start)) && (pr < ((uint32_t)&_text_end)));

        return buf;
}

/*
 * Copyright (c) 2012-2016 Israel Jacquez
 * See LICENSE for details.
 *
 * Israel Jacquez <mrkotfw@gmail.com>
 */

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

#include "stack.h"

char *
stack_backtrace(void)
{
        extern void *_text_start;
        extern void *_text_end;

        static char buf[256];

        uintptr_t fp;
        uintptr_t pr;

        int level;

        /* Obtain address of the caller and its frame pointer before it
         * is clobbered by any subsequent calls */
        STACK_RET_ADDRESS(pr);
        STACK_FPTR(fp);

        level = 0;
        *buf = '\0';
        do {
                (void)snprintf(buf, 256, "%s #%i 0x%08X in ??? ()\n",
                    buf, level, (uintptr_t)pr);

                pr = STACK_FPTR_RET_ADDRESS_GET(fp);
                fp = STACK_FPTR_NEXT_GET(fp);

                level++;
        } while (((pr >= (uint32_t)&_text_start)) && (pr < ((uint32_t)&_text_end)));

        return buf;
}

Use snprintf() instead of sprintf()

Use snprintf() instead of sprintf()


#pragma once

#include <ORATYPES.H>

using namespace System;
using namespace System::Runtime::InteropServices;

namespace Ndapi
{
	[Serializable]
	public ref class NdapiException : public Exception
	{
	private:
		long _status;

	public:
		property long Status
		{
			long get()
			{
				return _status;
			}
		};

	public protected:
		NdapiException() : Exception() {}
		NdapiException(String^ message) : Exception(message) {}
		NdapiException(String^ message, Exception^ inner) : Exception(message, inner) {}
		NdapiException(String^ message, long status) : Exception(message)
		{
			_status = status;
		}
	};

	template<class T>
	class NativeString
	{
	private:
		T* value;
		NativeString(const NativeString&);
		NativeString& operator = (const NativeString&);

	public:
		NativeString(String^ s);
		~NativeString() { Marshal::FreeHGlobal(IntPtr(value)); }
		operator T* () { return value; }
	};
}

#pragma once

#include <ORATYPES.H>

using namespace System;
using namespace System::Runtime::InteropServices;

namespace Ndapi
{
	[Serializable]
	public ref class NdapiException : public Exception
	{
	private:
		long _status;

	public:
		property long Status
		{
			long get()
			{
				return _status;
			}
		};

	public protected:
		NdapiException() : Exception() {}
		NdapiException(String^ message) : Exception(message) {}
		NdapiException(String^ message, Exception^ inner) : Exception(message, inner) {}
		NdapiException(String^ message, long status) : Exception(message)
		{
			_status = status;
		}
	};

	template<class T>
	class NativeString
	{
	private:
		T* value;

	public:
		NativeString(String^ s);
		NativeString(const NativeString&) = delete;
		NativeString& operator = (const NativeString&) = delete;
		~NativeString() { Marshal::FreeHGlobal(IntPtr(value)); }
		operator T* () { return value; }
	};
}

Use =delete to disallow copy

Use =delete to disallow copy


#ifndef __MOTORS_H_
#define __MOTORS_H_

#include <Servo.h>

#define MIDPOINT 128

class Motors {
  private:
    Servo port, vertical, starbord;
    int port_pin, vertical_pin, starbord_pin;

  public:

    Motors(int p_pin, int v_pin, int s_pin);
    void reset();
    void go(int p, int v, int s);
    void stop();

};

#endif

#ifndef __MOTORS_H_
#define __MOTORS_H_

#include <Servo.h>

#define MIDPOINT 90

class Motors {
  private:
    Servo port, vertical, starbord;
    int port_pin, vertical_pin, starbord_pin;

  public:

    Motors(int p_pin, int v_pin, int s_pin);
    void reset();
    void go(int p, int v, int s);
    void stop();

};

#endif

Set MIDPOINT to 90 instead of 128 (servo lib goes from 0 to 180)


#ifndef ROOT_ROOTCoreTeam
#define ROOT_ROOTCoreTeam

namespace ROOT {
namespace ROOTX {

//This string will be updated by external script, reading names from http://root.cern.ch/gitstats/authors.html.
//The string has an internal linkage (it has a definition here, not in rootxx.cxx or rootx-cocoa.mm files.
//So this header can be included in different places (as soon as you know what you're doing).
//Please, do not modify this file.

//[STRINGTOREPLACE
const char * gROOTCoreTeam = "Andrei Gheata, Axel Naumann, Bertrand Bellenot, Cristina Cristescu,"
                             " Danilo Piparo, Fons Rademakers, Gerardo Ganis, Ilka Antcheva,"
                             " Lorenzo Moneta, Matevz Tadel, Olivier Couet, Paul Russo, Pere Mato,"
                             " Philippe Canal, Rene Brun, Timur Pocheptsov, Valeri Onuchin,"
                             " Vassil Vassilev, Wim Lavrijsen, Wouter Verkerke\n\n";
//STRINGTOREPLACE]

}
}

#endif

#ifndef ROOT_ROOTCoreTeam
#define ROOT_ROOTCoreTeam

namespace ROOT {
namespace ROOTX {

//This string will be updated by external script, reading names from http://root.cern.ch/gitstats/authors.html.
//The names are sorted in alphabetical order.
//The string has an internal linkage (it has a definition here, not in rootxx.cxx or rootx-cocoa.mm files.
//So this header can be included in different places (as soon as you know what you're doing).
//Please, do not modify this file.

const char * gROOTCoreTeam =
//[STRINGTOREPLACE
"Andrei Gheata, Axel Naumann, Bertrand Bellenot, Cristina Cristescu,"
" Danilo Piparo, Fons Rademakers, Gerardo Ganis, Ilka Antcheva,"
" Lorenzo Moneta, Matevz Tadel, Olivier Couet, Paul Russo, Pere Mato,"
" Philippe Canal, Rene Brun, Timur Pocheptsov, Valeri Onuchin,"
" Vassil Vassilev, Wim Lavrijsen, Wouter Verkerke.\n\n";
//STRINGTOREPLACE]

}
}

#endif

Make it even simpler for a script to replace.


#include <assert.h>
#include <stdlib.h>

int main(){
    char* str = "Hello";
    char* str2 = "Hello";
    char* str3 = "hi";
    char* str4 = "other string";

    // Unknown since the there may be multiple copies of the same string
    __goblint_check(str != str2); // UNKNOWN!

    __goblint_check(str == str);
    __goblint_check(str != str3);

    char *ptr = NULL;
    int top = rand();

    if(top){
        ptr = str2;
    } else {
        ptr = str3;
    }
    __goblint_check(*ptr == *str); //UNKNOWN

    // This is unknwon due to only keeping one string pointer in abstract address sets
    __goblint_check(*ptr == *str4); //UNKNOWN

    return 0;
}

Add test for string pointer analysis

Add test for string pointer analysis


#include <stdio.h>

int main()
{
  printf("Hello, world!\n");
}

#include <stdio.h>

int main()
{
  printf("Hello, world!\n");

  return 0;
}

Add proper return code to test software.


/* Copyright 2016 The TensorFlow Authors. All Rights Reserved.

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

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

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

Add licenses to empty files. Change: 137204888


//
//  MCSMKeychainItem.h
//  MCSMFoundation
//
//  Created by Spencer MacDonald on 12/10/2011.
//  Copyright 2012 Square Bracket Software. All rights reserved.
//

#import <Foundation/Foundation.h>
#if TARGET_OS_MAC && !TARGET_IPHONE_SIMULATOR
#import <Carbon/Carbon.h>
#endif
#import <Security/Security.h>

@interface MCSMKeychainItem : NSObject

#if TARGET_OS_MAC && !TARGET_IPHONE_SIMULATOR

+ (void)lockKeychain;
+ (void)unlockKeychain;

#endif

@property (readonly, copy) NSString *username;
@property (readonly, copy) NSString *password;

- (BOOL)removeFromKeychain;

@end

@interface MCSMGenericKeychainItem : MCSMKeychainItem

@property (readonly, copy) NSString *service;

+ (MCSMGenericKeychainItem *)genericKeychainItemForService:(NSString *)service
                                                  username:(NSString *)username;

+ (MCSMGenericKeychainItem *)genericKeychainItemWithService:(NSString *)service
                                                   username:(NSString *)username
                                                   password:(NSString *)password;
@end

//
//  MCSMKeychainItem.h
//  MCSMFoundation
//
//  Created by Spencer MacDonald on 12/10/2011.
//  Copyright 2012 Square Bracket Software. All rights reserved.
//

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

@interface MCSMKeychainItem : NSObject

#if TARGET_OS_MAC && !TARGET_IPHONE_SIMULATOR

+ (void)lockKeychain;
+ (void)unlockKeychain;

#endif

@property (readonly, copy) NSString *username;
@property (readonly, copy) NSString *password;

- (BOOL)removeFromKeychain;

@end

@interface MCSMGenericKeychainItem : MCSMKeychainItem

@property (readonly, copy) NSString *service;

+ (MCSMGenericKeychainItem *)genericKeychainItemForService:(NSString *)service
                                                  username:(NSString *)username;

+ (MCSMGenericKeychainItem *)genericKeychainItemWithService:(NSString *)service
                                                   username:(NSString *)username
                                                   password:(NSString *)password;
@end

Remove the need for the Carbon Framework on OS X

The Carbon Framework was left in the header from previous versions.