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

static MP_INLINE U32 mpxs_APR__OS_current_thread_id(pTHX)
{
#if APR_HAS_THREADS
    return apr_os_thread_current();
#else
    return 0;
#endif
}

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

static MP_INLINE U32 mpxs_APR__OS_current_thread_id(pTHX)
{
#if APR_HAS_THREADS
    return (U32)apr_os_thread_current();
#else
    return 0;
#endif
}

Make a proper case to U32 to avoid a warning

PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: b4be4a41b2a3352907de631eb6da1671a2f7b614@71435 13f79535-47bb-0310-9956-ffa450edef68


/* appinit.c -- Tcl and Tk application initialization. */

#include <tcl.h>
#include <tk.h>

int
Tcl_AppInit (interp)
	Tcl_Interp *interp;
{
	Tk_Window main;

	main = Tk_MainWindow(interp);

	if (Tcl_Init (interp) == TCL_ERROR)
		return TCL_ERROR;
	if (Tk_Init (interp) == TCL_ERROR)
		return TCL_ERROR;

#ifdef WITH_MOREBUTTONS
	{
		extern Tcl_CmdProc studButtonCmd;
		extern Tcl_CmdProc triButtonCmd;

		Tcl_CreateCommand(interp, "studbutton", studButtonCmd,
				  (ClientData) main, NULL);
		Tcl_CreateCommand(interp, "tributton", triButtonCmd,
				  (ClientData) main, NULL);
	}
#endif
#ifdef WITH_XXX

#endif
	return TCL_OK;
}

/* appinit.c -- Tcl and Tk application initialization. */

#include <tcl.h>
#include <tk.h>

int
Tcl_AppInit (interp)
	Tcl_Interp *interp;
{
	Tk_Window main;

	main = Tk_MainWindow(interp);

	if (Tcl_Init (interp) == TCL_ERROR)
		return TCL_ERROR;
	if (Tk_Init (interp) == TCL_ERROR)
		return TCL_ERROR;

#ifdef WITH_MOREBUTTONS
	{
		extern Tcl_CmdProc studButtonCmd;
		extern Tcl_CmdProc triButtonCmd;

		Tcl_CreateCommand(interp, "studbutton", studButtonCmd,
				  (ClientData) main, NULL);
		Tcl_CreateCommand(interp, "tributton", triButtonCmd,
				  (ClientData) main, NULL);
	}
#endif

#ifdef WITH_PIL /* 0.2b5 and later -- not yet released as of May 14 */
	{
		extern void TkImaging_Init(Tcl_Interp *interp);
		TkImaging_Init(interp);
	}
#endif

#ifdef WITH_PIL_OLD /* 0.2b4 and earlier */
	{
		extern void TkImaging_Init(void);
		TkImaging_Init();
	}
#endif

#ifdef WITH_XXX

#endif
	return TCL_OK;
}

Add sections for PIL (Fred Lundh).

Add sections for PIL (Fred Lundh).


#include <stdbool.h>

#include "core.h"
#include "crypto_onetimeauth.h"

static bool initialized;

int
sodium_init(void)
{
    if (initialized != 0) {
        return 1;
    }
    initialized = 1;
    if (crypto_onetimeauth_pick_best_implementation() == NULL) {
        return -1;
    }
    return 0;
}

#include <stdbool.h>

#include "core.h"
#include "crypto_onetimeauth.h"

static bool initialized;

int
sodium_init(void)
{
    if (initialized != 0) {
        return 1;
    }
    if (crypto_onetimeauth_pick_best_implementation() == NULL) {
        return -1;
    }
    initialized = 1;

    return 0;
}

Set initialized=1 when everything has actually been initialized


/*
 * An area light with a sphere geometry.
 *
 * TODO(dinow): Extract a middle class called GeometryLight which contains the
 * intersect code and the geometry pointer.
 * Author: Dino Wernli
 */

#ifndef SPHERE_LIGHT_H_
#define SPHERE_LIGHT_H_

#include "scene/geometry/sphere.h"
#include "util/random.h"

class SphereLight : public Light {
 public:
  SphereLight(const Point3& center, Scalar radius, const Color3& color)
      : Light(color), sphere_(new Sphere(center, radius)) {
  }
  virtual ~SphereLight() {};

  virtual Ray GenerateRay(const Point3& target) const {
    // TODO(dinow): Generate a ray from a random point on the proper half of the
    // sphere to target.
    return Ray;
  }

  // No ray ever intersects a dimensionless point light.
  virtual bool Intersect(const Ray& ray, IntersectionData* data) const {
    bool result = sphere_->Intersect(ray, data);
    if (result) {
      // Make sure the data object knows it intersected a light.
      data->set_light(this);
    }
    return result;
  }

 private:
  std::unique_ptr<Sphere> sphere_;
  Random random_;
};

#endif  /* SPHERE_LIGHT_H_ */

Add a sphere light stub.

Add a sphere light stub.


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

#ifndef ARCH_GENERIC_INCS_AC_XSTR_H
#define ARCH_GENERIC_INCS_AC_XSTR_H

// Stringification of macro parameters
// [See](https://gcc.gnu.org/onlinedocs/cpp/Stringification.html)

#define AC_XSTR(s) AC_STR(s)
#define AC_STR(s) #s

#endif

Add AC_XSTR and AC_STR macros.

Add AC_XSTR and AC_STR macros.

[See](https://gcc.gnu.org/onlinedocs/cpp/Stringification.html)


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

#ifndef CHROME_NACL_NACL_BROKER_LISTENER_H_
#define CHROME_NACL_NACL_BROKER_LISTENER_H_
#pragma once

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

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

  void Listen();

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

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

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

  DISALLOW_COPY_AND_ASSIGN(NaClBrokerListener);
};

#endif  // CHROME_NACL_NACL_BROKER_LISTENER_H_

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

#ifndef CHROME_NACL_NACL_BROKER_LISTENER_H_
#define CHROME_NACL_NACL_BROKER_LISTENER_H_
#pragma once

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

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

  void Listen();

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

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

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

  DISALLOW_COPY_AND_ASSIGN(NaClBrokerListener);
};

#endif  // CHROME_NACL_NACL_BROKER_LISTENER_H_

NaCl: Remove declaration of non-existent method

BUG=none
TEST=none

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

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


#include <unistd.h>
#include "erl_nif.h"

static int
load(ErlNifEnv* env, void** priv, ERL_NIF_TERM info)
{
    ErlNifSysInfo sys_info;
    enif_system_info(&sys_info, sizeof(ErlNifSysInfo));
    if (!sys_info.smp_support || !sys_info.dirty_scheduler_support)
        return 1;
    return 0;
}

static ERL_NIF_TERM
dirty_sleeper(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
#ifdef ERL_NIF_DIRTY_SCHEDULER_SUPPORT
    sleep(3);
#endif
    return enif_make_atom(env, "ok");
}

static ErlNifFunc funcs[] = {
#ifdef ERL_NIF_DIRTY_SCHEDULER_SUPPORT
    {"dirty_sleeper", 0, dirty_sleeper, ERL_NIF_DIRTY_JOB_IO_BOUND}
#else
    {"dirty_sleeper", 0, dirty_sleeper, 0}
#endif
};

ERL_NIF_INIT(scheduler_SUITE, funcs, &load, NULL, NULL, NULL);

#ifndef __WIN32__
#include <unistd.h>
#endif
#include "erl_nif.h"

static int
load(ErlNifEnv* env, void** priv, ERL_NIF_TERM info)
{
    ErlNifSysInfo sys_info;
    enif_system_info(&sys_info, sizeof(ErlNifSysInfo));
    if (!sys_info.smp_support || !sys_info.dirty_scheduler_support)
        return 1;
    return 0;
}

static ERL_NIF_TERM
dirty_sleeper(ErlNifEnv* env, int argc, const ERL_NIF_TERM argv[])
{
#ifdef ERL_NIF_DIRTY_SCHEDULER_SUPPORT
#ifdef __WIN32__
    Sleep(3000);
#else
    sleep(3);
#endif
#endif
    return enif_make_atom(env, "ok");
}

static ErlNifFunc funcs[] = {
#ifdef ERL_NIF_DIRTY_SCHEDULER_SUPPORT
    {"dirty_sleeper", 0, dirty_sleeper, ERL_NIF_DIRTY_JOB_IO_BOUND}
#else
    {"dirty_sleeper", 0, dirty_sleeper, 0}
#endif
};

ERL_NIF_INIT(scheduler_SUITE, funcs, &load, NULL, NULL, NULL);

Fix dirty scheduler tc on windows

Fix dirty scheduler tc on windows


/*
 * MbedHardware
 *
 *  Created on: Aug 17, 2011
 *      Author: nucho
 */

#ifndef ROS_MBED_HARDWARE_H_
#define ROS_MBED_HARDWARE_H_

#include "mbed.h"

#include "MODSERIAL.h"

#define ROSSERIAL_BAUDRATE 57600

class MbedHardware {
  public:
    MbedHardware(MODSERIAL* io , long baud= ROSSERIAL_BAUDRATE)
      :iostream(*io){
      baud_ = baud;
      t.start();
    }

    MbedHardware()
      :iostream(USBTX, USBRX) {
        baud_ = ROSSERIAL_BAUDRATE;
        t.start();
    }
    MbedHardware(MbedHardware& h)
      :iostream(h.iostream) {
      this->baud_ = h.baud_;
      t.start();
    }

    void setBaud(long baud){
      this->baud_= baud;
    }

    int getBaud(){return baud_;}

    void init(){
        iostream.baud(baud_);
    }

    int read(){
        if (iostream.readable()) {
            return iostream.getc();
        } else {
            return -1;
        }
    };
    void write(uint8_t* data, int length) {
        for (int i=0; i<length; i++)
             iostream.putc(data[i]);
    }

    unsigned long time(){return t.read_ms();}

protected:
    MODSERIAL iostream;
    long baud_;
    Timer t;
};

#endif /* ROS_MBED_HARDWARE_H_ */

/*
 * MbedHardware
 *
 *  Created on: Aug 17, 2011
 *      Author: nucho
 */

#ifndef ROS_MBED_HARDWARE_H_
#define ROS_MBED_HARDWARE_H_

#include "mbed.h"

#include "MODSERIAL.h"

class MbedHardware {
  public:
    MbedHardware(PinName tx, PinName rx, long baud = 57600)
      :iostream(tx, rx){
      baud_ = baud;
      t.start();
    }

    MbedHardware()
      :iostream(USBTX, USBRX) {
        baud_ = 57600;
        t.start();
    }

    void setBaud(long baud){
      this->baud_= baud;
    }

    int getBaud(){return baud_;}

    void init(){
        iostream.baud(baud_);
    }

    int read(){
        if (iostream.readable()) {
            return iostream.getc();
        } else {
            return -1;
        }
    };
    void write(uint8_t* data, int length) {
        for (int i=0; i<length; i++)
             iostream.putc(data[i]);
    }

    unsigned long time(){return t.read_ms();}

protected:
    MODSERIAL iostream;
    long baud_;
    Timer t;
};

#endif /* ROS_MBED_HARDWARE_H_ */

Fix unnderlying issue with Stream class being private


#ifndef SRC_UTILS_IMAGE_PERSISTER_H_

#define SRC_UTILS_IMAGE_PERSISTER_H_

#include <string>
#include <vector>
#include <Magick++.h>
#include <Eigen/Core>

/**
 * \brief Provides static functions to load and save images
 *
 */
class ImagePersister
{
 public:
  template <class T>
  static void saveRGBA32F(T *data, int width, int height, std::string filename)
  {
    Magick::InitializeMagick("");
    Magick::Image image(width, height, "RGBA", Magick::StorageType::FloatPixel,
                        data);
    image.write(filename);
  }

  static std::vector<Eigen::Vector4f> loadRGBA32F(std::string filename)
  {
    Magick::Image image(filename);
    std::vector<Eigen::Vector4f> result(image.columns() * image.rows());

    image.write(0, 0, image.columns(), image.rows(), "RGBA",
                Magick::StorageType::FloatPixel, result.data());

    return result;
  }
};

#endif  // SRC_UTILS_IMAGE_PERSISTER_H_

#ifndef SRC_UTILS_IMAGE_PERSISTER_H_

#define SRC_UTILS_IMAGE_PERSISTER_H_

#include <string>
#include <vector>
#include <Magick++.h>
#include <Eigen/Core>

/**
 * \brief Provides static functions to load and save images
 *
 */
class ImagePersister
{
 public:
  template <class T>
  static void saveRGBA32F(T *data, int width, int height, std::string filename)
  {
    Magick::InitializeMagick("");
    Magick::Image image(width, height, "RGBA", Magick::StorageType::FloatPixel,
                        data);
    image.write(filename);
  }

  static void saveR32F(float *data, int width, int height, std::string filename)
  {
    Magick::InitializeMagick("");
    Magick::Image image(width, height, "R", Magick::StorageType::FloatPixel,
                        data);
    image.write(filename);
  }

  static std::vector<Eigen::Vector4f> loadRGBA32F(std::string filename)
  {
    Magick::Image image(filename);
    std::vector<Eigen::Vector4f> result(image.columns() * image.rows());

    image.write(0, 0, image.columns(), image.rows(), "RGBA",
                Magick::StorageType::FloatPixel, result.data());

    return result;
  }
};

#endif  // SRC_UTILS_IMAGE_PERSISTER_H_

Add method to save a single component float image.


/**	@file	Utils.h
	@author	Philip Abbet

	Declaration of some utilities related to scripting
*/

#ifndef _ATHENA_SCRIPTING_UTILS_H_
#define _ATHENA_SCRIPTING_UTILS_H_

#include <Athena-Scripting/Prerequisites.h>
#include <v8.h>

namespace Athena {
namespace Scripting {

    //------------------------------------------------------------------------------------
    /// @brief	Convert an JavaScript Object to a C++ one
    //------------------------------------------------------------------------------------
    template<typename T>
    T* CastJSObject(v8::Handle<v8::Value> const &h)
    {
        if (!h->IsObject())
            return 0;

        v8::Local<v8::Object> obj = h->ToObject();
        if (obj->InternalFieldCount() != 1)
            return 0;

        v8::Local<v8::External> external = v8::Local<v8::External>::Cast(obj->GetInternalField(0));

        return static_cast<T*>(external->Value());
    }
}
}

#endif

Add an utility function (CastJSObject)

Add an utility function (CastJSObject)


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

#define QLA4XXX_DRIVER_VERSION	"5.03.00-k10"

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

#define QLA4XXX_DRIVER_VERSION	"5.03.00-k11"

Update driver version to 5.03.00-k11

[SCSI] qla4xxx: Update driver version to 5.03.00-k11

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


#include <inc/hw_types.h>
#include <driverlib/sysctl.h>
#include <stdio.h>
#include <string.h>
#include <inc/hw_memmap.h>
#include <inc/hw_sysctl.h>
#include <driverlib/gpio.h>
#include <driverlib/debug.h>

int UP=0;
int i;

int main(){

	SysCtlClockSet(SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);

	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
	GPIOPinTypeGPIOInput(GPIO_PORTE_BASE,GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3);
	GPIOPadConfigSet(GPIO_PORTE_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);

	SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
	GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,GPIO_PIN_0);
	GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);

	while(1){

		UP = GPIOPinRead(GPIO_PORTE_BASE,(GPIO_PIN_0));
		UP = UP&0x01;

		if (UP== 0x01)
			GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, 0x00);
		else
			GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, 0xFF);
	}
}

Add blinking led example for TI Kit

Add blinking led example for TI Kit


//
// Created by matti on 16.9.2015.
//

#include <stdio.h>

#define MAXLINE 1000

int max;
char line[MAXLINE];
char longest[MAXLINE];

int getline(void);
void copy(void);

int main() {
    int len;
    extern int max;
    extern char longest[];

    max = 0;
    while((len = getline()) > 0) {
        if (len > max) {
            max = len;
            copy();
        }
        if (max > 0) {
            printf("%s", longest);
        }
        return 0;
    }
}

int getline(void) {
    int c, i;
    extern char line[];

    for(i = 0; i < MAXLINE - 1 && (c=getchar()) != EOF && c != '\n'; ++i) {
        line[i] = c;
        if (c == '\n') {
            line[i] = c;
            ++i;
        }
        line[i] = '\0';
        return i;

    }
}

Add unfinished 1-10 external example

Add unfinished 1-10 external example


// RUN: %check %s

int x __attribute((constructor)); // CHECK: warning: constructor attribute on non-function

int main()
{
	void f() __attribute((constructor)); // CHECK: warning: constructor attribute on non-global function
}

// RUN: %check %s

int x __attribute((constructor)); // CHECK: warning: constructor attribute on non-function

struct Q {
	int x __attribute((constructor)); // CHECK: warning: constructor attribute on non-function
};

int main()
{
	void f() __attribute((constructor)); // CHECK: warning: constructor attribute on non-global function
}

Check ctor/dtor attribute on members

Check ctor/dtor attribute on members


sharedMainLayoutScripts: closeWindowHaltScript
Close Window [ Current Window ]
Halt Script
February 9, 平成26 10:24:51 Imagination Quality Management.fp7 - closeWindowHaltScript -1-

Create window closing script with halt command.

I was selecting Halt command from the button options, but felt it is
better practice to put all commands in scripts, not buttons for better
transparency.


#import <Foundation/Foundation.h>

@interface NSString (TDTAdditions)

/**
 @return a string representing a newly generated version 4 random UUID
 */
+ (instancetype)randomUUID;

/**
 @return The SHA1 of the receiver
 */
- (NSString *)sha1Digest;

/**
 @return a new string by trimming non alphanumeric characters from the receiver
 */
- (NSString *)stringByTrimmingNonAlphaNumericCharacters;

/**
 @return `nil` if the receiver is blank, otherwise returns the receiver.
 */
- (NSString *)stringByNillingBlanks;

/**
 There is no platform agnostic format specifier for an `NSUInteger`. Ergo this.
 */
+ (NSString *)stringWithUnsignedInteger:(NSUInteger)uInteger;

@end

#import <Foundation/Foundation.h>

@interface NSString (TDTAdditions)

/**
 @return A string representing a newly generated version 4 random UUID
 */
+ (instancetype)randomUUID;

/**
 @return The SHA1 of the receiver
 */
- (NSString *)sha1Digest;

/**
 @return A new string by trimming non alphanumeric characters from the receiver
 */
- (NSString *)stringByTrimmingNonAlphaNumericCharacters;

/**
 @return `nil` if the receiver is blank, otherwise returns the receiver.
 */
- (NSString *)stringByNillingBlanks;

/**
 There is no platform agnostic format specifier for an `NSUInteger`. Ergo this.
 */
+ (NSString *)stringWithUnsignedInteger:(NSUInteger)uInteger;

@end

Fix initial case for header documentation sentences


/* The Halfling Project - A Graphics Engine and Projects
 *
 * The Halfling Project is the legal property of Adrian Astley
 * Copyright Adrian Astley 2013
 */

#ifndef COMMON_HALFLING_SYS_H
#define COMMON_HALFLING_SYS_H

#include "common/typedefs.h"

// Only include the base windows libraries
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <comip.h>

// GDI+
#include <gdiplus.h>

// Un-define min and max from the windows headers
#ifdef min
	#undef min
#endif

#ifdef max
	#undef max
#endif
#endif

/* The Halfling Project - A Graphics Engine and Projects
 *
 * The Halfling Project is the legal property of Adrian Astley
 * Copyright Adrian Astley 2013
 */

#ifndef COMMON_HALFLING_SYS_H
#define COMMON_HALFLING_SYS_H

#include "common/typedefs.h"

// Only include the base windows libraries
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <comip.h>

// GDI+
#include <gdiplus.h>

// Un-define min and max from the windows headers
#ifdef min
	#undef min
#endif

#ifdef max
	#undef max
#endif

#define AssertMsg(condition, message) \
	do {                                                                        \
		if (!(condition)) {                                                     \
			std::cerr << "Assertion `" #condition "` failed in " << __FILE__    \
			<< " line " << __LINE__ << ": " << message << std::endl;            \
			std::exit(EXIT_FAILURE);                                            \
		}                                                                       \
	} while (false)

#endif

COMMON: Create define for asserting with a message


//===- CodeGenRegisters.h - Register and RegisterClass Info -----*- 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 structures to encapsulate information gleaned from the
// target register and register class definitions.
//
//===----------------------------------------------------------------------===//

#ifndef CODEGEN_REGISTERS_H
#define CODEGEN_REGISTERS_H

#include <string>

namespace llvm {
  class Record;

  /// CodeGenRegister - Represents a register definition.
  struct CodeGenRegister {
    Record *TheDef;
    const std::string &getName() const;

    CodeGenRegister(Record *R) : TheDef(R) {}
  };

  struct CodeGenRegisterClass {

  };
}

#endif

Add initial support for register and register class representation.
Obviously this is not done.

git-svn-id: a4a6f32337ebd29ad4763b423022f00f68d1c7b7@15804 91177308-0d34-0410-b5e6-96231b3b80d8


/* File:			connection.h
 *
 * Description:		See "md.h"
 *
 * Comments:		See "notice.txt" for copyright and license information.
 *
 */

#ifndef __MD5_H__
#define __MD5_H__

#include "psqlodbc.h"

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

#ifdef	WIN32
#define	MD5_ODBC
#define	FRONTEND
#endif
#define MD5_PASSWD_LEN	35

/* From c.h */
#ifndef __BEOS__

#ifndef __cplusplus

#ifndef bool
typedef char bool;
#endif

#ifndef true
#define true	((bool) 1)
#endif

#ifndef false
#define false	((bool) 0)
#endif
#endif   /* not C++ */
#endif   /* __BEOS__ */

/* Also defined in include/c.h */
#if SIZEOF_UINT8 == 0
typedef unsigned char uint8;	/* == 8 bits */
typedef unsigned short uint16;	/* == 16 bits */
typedef unsigned int uint32;	/* == 32 bits */
#endif   /* SIZEOF_UINT8 == 0 */

extern bool md5_hash(const void *buff, size_t len, char *hexsum);
extern bool EncryptMD5(const char *passwd, const char *salt,
		   size_t salt_len, char *buf);

#endif

/* File:			md5.h
 *
 * Description:		See "md5.c"
 *
 * Comments:		See "notice.txt" for copyright and license information.
 *
 */

#ifndef __MD5_H__
#define __MD5_H__

#include "psqlodbc.h"

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

#ifdef	WIN32
#define	MD5_ODBC
#define	FRONTEND
#endif
#define MD5_PASSWD_LEN	35

/* From c.h */
#ifndef __BEOS__

#ifndef __cplusplus

#ifndef bool
typedef char bool;
#endif

#ifndef true
#define true	((bool) 1)
#endif

#ifndef false
#define false	((bool) 0)
#endif
#endif   /* not C++ */
#endif   /* __BEOS__ */

/* Also defined in include/c.h */
#if SIZEOF_UINT8 == 0
typedef unsigned char uint8;	/* == 8 bits */
typedef unsigned short uint16;	/* == 16 bits */
typedef unsigned int uint32;	/* == 32 bits */
#endif   /* SIZEOF_UINT8 == 0 */

extern bool md5_hash(const void *buff, size_t len, char *hexsum);
extern bool EncryptMD5(const char *passwd, const char *salt,
		   size_t salt_len, char *buf);

#endif

Fix comment at top of file to match file name.


int main() {
  struct A {} a;

  // error: '&&' operator requires scalar operands
  a && a;

  // error: '||' operator requires scalar operands
  a || a;

  // error: '!' operator requires scalar operand
  !a;
}

int main() {
  struct A {} a;

  // error: '&&' operator requires scalar operands
  a && a;

  // error: '||' operator requires scalar operands
  1 || a;

  // error: '||' operator requires scalar operands
  a || 1;

  // error: '!' operator requires scalar operand
  !a;
}

Improve tests for boolean operators

Improve tests for boolean operators


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

#include <stdio.h>

#if defined(__GLIBC__)
#include <unistd.h>
#else
/*
 * TODO(bsy): remove when newlib toolchain catches up
 * http://code.google.com/p/nativeclient/issues/detail?id=2714
 */
#include "native_client/src/trusted/service_runtime/include/sys/unistd.h"
#endif

int main(void) {
#if defined(__GLIBC__)
  long rv = sysconf(_SC_PAGESIZE);
#else
  long rv = sysconf(NACL_ABI__SC_PAGESIZE);
#endif

  printf("%ld\n", rv);
  return rv != (1<<16);
}

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

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

int main(void) {
  long rv = sysconf(_SC_PAGESIZE);
  printf("%ld\n", rv);
  return rv != (1<<16);
}

Clean up sysconf() test to address a TODO that depended on a toolchain roll

BUG=https://code.google.com/p/nativeclient/issues/detail?id=3909
BUG=https://code.google.com/p/nativeclient/issues/detail?id=2714
TEST=run_sysconf_pagesize_test

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

git-svn-id: 721b910a23eff8a86f00c8fd261a7587cddf18f8@13915 fcba33aa-ac0c-11dd-b9e7-8d5594d729c2


#ifndef NME_NME_API_H
#define NME_NME_API_H

#include "Pixel.h"

namespace nme
{

enum { NME_API_VERSION = 100 };

class NmeApi
{
public:
    virtual int getApiVersion() { return NME_API_VERSION; }
    virtual bool getC0IsRed() { return gC0IsRed; }
};

extern NmeApi gNmeApi;

} // end namespace nme

#endif

Put ImageBuffer into separate header

Put ImageBuffer into separate header


/*
 * Copyright (c) 2007, 2008, 2009, ETH Zurich.
 * All rights reserved.
 *
 * This file is distributed under the terms in the attached LICENSE file.
 * If you do not find this file, copies can be found by writing to:
 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
 */

#ifndef DIRENT_H_
#define DIRENT_H_

#include <sys/cdefs.h>

#define NAME_MAX 512

struct dirent {
//    long d_ino;
//    off_t d_off;
//    unsigned short d_reclen;
    char d_name[NAME_MAX + 1];
};

typedef struct {
    struct dirent dirent;
    void *vh; // really a vfs_handle_t
} DIR;

__BEGIN_DECLS
DIR *opendir(const char *pathname);
struct dirent *readdir(DIR* dir);
int closedir(DIR *dir);
__END_DECLS

#endif

/*
 * Copyright (c) 2007, 2008, 2009, ETH Zurich.
 * All rights reserved.
 *
 * This file is distributed under the terms in the attached LICENSE file.
 * If you do not find this file, copies can be found by writing to:
 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
 */

#ifndef DIRENT_H_
#define DIRENT_H_

#include <sys/cdefs.h>

// Depending on header include order, this may collide with the definition in
// newlib's <dirent.h>  See open issue: https://code.systems.ethz.ch/T58#1169
#ifndef NAME_MAX
#define NAME_MAX 512
#endif

struct dirent {
//    long d_ino;
//    off_t d_off;
//    unsigned short d_reclen;
    char d_name[NAME_MAX + 1];
};

typedef struct {
    struct dirent dirent;
    void *vh; // really a vfs_handle_t
} DIR;

__BEGIN_DECLS
DIR *opendir(const char *pathname);
struct dirent *readdir(DIR* dir);
int closedir(DIR *dir);
__END_DECLS

#endif

Duplicate definition of NAME_MAX macro

Duplicate definition of NAME_MAX macro

I broke the build in rBFIaee0075101b1; this is just a temporary band-aid and
only masks the more general issue described in T58.  If you have an idea for a
better fix, please let me know.

Signed-off-by: Zaheer Chothia <418c8e101762410c9c1204e516611673b0b87d3d@inf.ethz.ch>


#ifndef CONFIG_H
#define CONFIG_H

//#define QEMU
#define SIM
#define OS_CALL 0xC0000000
#define DTB 0xC3000000

#endif

#ifndef CONFIG_H
#define CONFIG_H

//#define QEMU
#define SIM

#ifndef OS_CALL
#define OS_CALL 0xC0000000
#endif

#ifndef DTB
#define DTB 0xC3000000
#endif

#endif

Allow to set custom DTB/OS_CALL addresses

Setting those from command line during compilation allows
to create a custom setup without the need of modifying the
sources.


// RUN: %clang_cc1 -emit-llvm < %s | FileCheck %s

void __fastcall f1(void);
void __stdcall f2(void);
void __thiscall f3(void);
void __fastcall f4(void) {
// CHECK: define x86_fastcallcc void @f4()
  f1();
// CHECK: call x86_fastcallcc void @f1()
}
void __stdcall f5(void) {
// CHECK: define x86_stdcallcc void @f5()
  f2();
// CHECK: call x86_stdcallcc void @f2()
}
void __thiscall f6(void) {
// CHECK: define x86_thiscallcc void @f6()
  f3();
// CHECK: call x86_thiscallcc void @f3()
}

// PR5280
void (__fastcall *pf1)(void) = f1;
void (__stdcall *pf2)(void) = f2;
void (__thiscall *pf3)(void) = f3;
void (__fastcall *pf4)(void) = f4;
void (__stdcall *pf5)(void) = f5;
void (__thiscall *pf6)(void) = f6;

int main(void) {
    f4(); f5(); f6();
    // CHECK: call x86_fastcallcc void @f4()
    // CHECK: call x86_stdcallcc void @f5()
    // CHECK: call x86_thiscallcc void @f6()
    pf1(); pf2(); pf3(); pf4(); pf5(); pf6();
    // CHECK: call x86_fastcallcc void %{{.*}}()
    // CHECK: call x86_stdcallcc void %{{.*}}()
    // CHECK: call x86_thiscallcc void %{{.*}}()
    // CHECK: call x86_fastcallcc void %{{.*}}()
    // CHECK: call x86_stdcallcc void %{{.*}}()
    // CHECK: call x86_thiscallcc void %{{.*}}()
    return 0;
}

// PR7117
void __stdcall f7(foo) int foo; {}
void f8(void) {
  f7(0);
  // CHECK: call x86_stdcallcc void (...)* bitcast
}

Add missing test case, provided by Steven Watanabe.

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


// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

#ifndef BROWSER_NET_LOG_H_
#define BROWSER_NET_LOG_H_

#include "base/files/scoped_file.h"
#include "net/log/net_log.h"
#include "net/log/file_net_log_observer.h"

namespace brightray {

class NetLog : public net::NetLog {
 public:
  NetLog();
  ~NetLog() override;

  void StartLogging(net::URLRequestContext* url_request_context);

 private:
  base::ScopedFILE log_file_;
  net::FileNetLogObserver write_to_file_observer_;

  DISALLOW_COPY_AND_ASSIGN(NetLog);
};

}  // namespace brightray

#endif  // BROWSER_NET_LOG_H_

// Copyright (c) 2015 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.

#ifndef BROWSER_NET_LOG_H_
#define BROWSER_NET_LOG_H_

#include "base/files/scoped_file.h"
#include "net/log/net_log.h"
#include "net/log/file_net_log_observer.h"
#include "net/url_request/url_request_context.h"

namespace brightray {

class NetLog : public net::NetLog {
 public:
  NetLog();
  ~NetLog() override;

  void StartLogging(net::URLRequestContext* url_request_context);

 private:
  base::ScopedFILE log_file_;
  net::FileNetLogObserver write_to_file_observer_;

  DISALLOW_COPY_AND_ASSIGN(NetLog);
};

}  // namespace brightray

#endif  // BROWSER_NET_LOG_H_

Add missing explicit include of net/url_request/url_request_context.h


// REQUIRES: x86_64-linux
// RUN: %host_cc -O0 -g %s -o %t 2>&1
// RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s
//
// See PR31870 for more details on the XFAIL
// XFAIL: avr

#include <stdio.h>

int inc(int a) {
  return a + 1;
}

int main() {
  printf("%p\n", inc);
  return 0;
}

// CHECK: inc
// CHECK: print_context.c:7
// CHECK: 5  : #include
// CHECK: 6  :
// CHECK: 7 >: int inc
// CHECK: 8  :   return
// CHECK: 9  : }

// REQUIRES: x86_64-linux
// RUN: %host_cc -O0 -g %s -o %t 2>&1
// RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s

#include <stdio.h>

int inc(int a) {
  return a + 1;
}

int main() {
  printf("%p\n", inc);
  return 0;
}

// CHECK: inc
// CHECK: print_context.c:7
// CHECK: 5  : #include
// CHECK: 6  :
// CHECK: 7 >: int inc
// CHECK: 8  :   return
// CHECK: 9  : }

Revert "[AVR] Mark a failing symbolizer test as XFAIL"

This reverts commit 83a0e876349adb646ba858eb177b22b0b4bfc59a.

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


#ifndef RESTRICTMACRO_H_
#define RESTRICTMACRO_H_

#ifdef COBRA_RESTRICT

#define COBRA_RESTRICT_BREAK \
	  break; \

#define COBRA_RESTRICT_EXCEED_N_BREAK( EXP, NUM ) \
	if (EXP > NUM) \
	break; \

#define COBRA_RESTRICT_EXCEED_N_RETURN_FALSE( EXP, NUM ) \
	if ( EXP > NUM ) \
	return false; \

#else

#define COBRA_RESTRICT_BREAK
#define COBRA_RESTRICT_N_BREAK( EXP, NUM )
#define COBRA_RESTRICT_N_RETURN_FALSE( EXP, NUM )

#endif

#endif /*RESTRICTMACRO_H_*/

#ifndef RESTRICTMACRO_H_
#define RESTRICTMACRO_H_

#ifdef COBRA_RESTRICT

#define COBRA_RESTRICT_BREAK \
	  break; \

#define COBRA_RESTRICT_EXCEED_N_BREAK( EXP, NUM ) \
	if (EXP > NUM) \
	break; \

#define COBRA_RESTRICT_EXCEED_N_RETURN_FALSE( EXP, NUM ) \
	if ( EXP > NUM ) \
	return false; \

#else

#define COBRA_RESTRICT_BREAK
#define COBRA_RESTRICT_EXCEED_N_BREAK( EXP, NUM )
#define COBRA_RESTRICT_EXCEED_N_RETURN_FALSE( EXP, NUM )

#endif

#endif /*RESTRICTMACRO_H_*/

Fix compilation error of RestrictionMacro.h in sf1 if COBRA_RESTRICT is not defined.


#include "vk_default_loader.h"
#include "vulkan/vulkan.h"

#if defined(_WIN32)
#elif defined(unix) || defined(__unix__) || defined(__unix)
#include <dlfcn.h>
static void* (*loadSym)(void* lib, const char* procname);
static void* loadSymWrap(VkInstance instance, const char* vkproc) {
	return (*loadSym)(instance, vkproc);
}
#endif

void* getDefaultProcAddr() {
    #if defined(_WIN32)
    // TODO: WIN32 Vulkan loader
    #elif defined(__APPLE__) && defined(__MACH__)
	// TODO: Darwin Vulkan loader (via MoltenVK)
    #elif defined(unix) || defined(__unix__) || defined(__unix)
	void* libvulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
    if (libvulkan == NULL) {
        return NULL;
    }

	loadSym = dlsym(libvulkan, "vkGetInstanceProcAddr");
	if (loadSym == NULL) {
		return NULL;
	}

	return &loadSymWrap;
    #else
    // Unknown operating system
    #endif
}

#include "vk_default_loader.h"
#include "vulkan/vulkan.h"

#if defined(_WIN32)
#elif defined(unix) || defined(__unix__) || defined(__unix)
    #include <dlfcn.h>
    static void* (*symLoader)(void* lib, const char* procname);
    static void* loaderWrap(VkInstance instance, const char* vkproc) {
        return (*symLoader)(instance, vkproc);
    }
#elif defined(__APPLE__) && defined(__MACH__)
    // #include <GLFW/glfw3.h>
    // static void* loaderWrap(VkInstance instance, const char* vkproc) {
    //     return glfwGetInstanceProcAddress(instance, vkproc);
    // }
#endif

void* getDefaultProcAddr() {
    #if defined(_WIN32)
        // TODO: WIN32 Vulkan loader
        return NULL;
    #elif defined(__APPLE__) && defined(__MACH__)
        // return &loaderWrap;
        return NULL;
    #elif defined(unix) || defined(__unix__) || defined(__unix)
        void* libvulkan = dlopen("libvulkan.so", RTLD_NOW | RTLD_LOCAL);
        if (libvulkan == NULL) {
            return NULL;
        }
        symLoader = dlsym(libvulkan, "vkGetInstanceProcAddr");
        if (symLoader == NULL) {
            return NULL;
        }
        return &loaderWrap;
    #else
        // Unknown operating system
        return NULL;
    #endif
}

Fix no-return warning in loader, also change the internal variable names.


// Copyright (C) 2016 Elviss Strazdins
// This file is part of the Ouzel engine.

#pragma once

#include <algorithm>
#include <memory>
#include "Types.h"
#include "Noncopyable.h"
#include "Size2.h"

namespace ouzel
{
    namespace graphics
    {
        class Renderer;
        class Texture;

        class RenderTarget: public Noncopyable
        {
            friend Renderer;
        public:
            virtual ~RenderTarget();

            virtual bool init(const Size2& newSize, bool useDepthBuffer);

            TexturePtr getTexture() const { return texture; }

        protected:
            RenderTarget();

            Size2 size;
            bool depthBuffer = false;

            TexturePtr texture;
        };
    } // namespace graphics
} // namespace ouzel

// Copyright (C) 2016 Elviss Strazdins
// This file is part of the Ouzel engine.

#pragma once

#include <algorithm>
#include <memory>
#include "Types.h"
#include "Noncopyable.h"
#include "Size2.h"
#include "Color.h"

namespace ouzel
{
    namespace graphics
    {
        class Renderer;
        class Texture;

        class RenderTarget: public Noncopyable
        {
            friend Renderer;
        public:
            virtual ~RenderTarget();

            virtual bool init(const Size2& newSize, bool useDepthBuffer);

            virtual void setClearColor(Color color) { clearColor = color; }
            virtual Color getClearColor() const { return clearColor; }

            TexturePtr getTexture() const { return texture; }

        protected:
            RenderTarget();

            Size2 size;
            bool depthBuffer = false;

            Color clearColor;
            TexturePtr texture;
        };
    } // namespace graphics
} // namespace ouzel

Add clear color to render target

Add clear color to render target


//
//  ImojiSDKUI
//
//  Created by Nima Khoshini
//  Copyright (C) 2015 Imoji
//
//  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.
//

#import <Foundation/Foundation.h>

@class IMCollectionView;
@class IMImojiSession;

@interface IMSuggestionView : UIView

@property(nonatomic, strong, readonly) IMCollectionView *collectionView;

/**
 * @abstract Creates a collection view with the specified Imoji session
 */
+ (nonnull instancetype)imojiSuggestionViewWithSession:(nonnull IMImojiSession *)session;

@end

//
//  ImojiSDKUI
//
//  Created by Nima Khoshini
//  Copyright (C) 2015 Imoji
//
//  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.
//

#import <Foundation/Foundation.h>

@class IMCollectionView;
@class IMImojiSession;

@interface IMSuggestionView : UIView

@property(nonatomic, strong, readonly, nonnull) IMCollectionView *collectionView;

/**
 * @abstract Creates a collection view with the specified Imoji session
 */
+ (nonnull instancetype)imojiSuggestionViewWithSession:(nonnull IMImojiSession *)session;

@end

Fix warning with nonnull member for SuggetionView


/*
 * QLogic Fibre Channel HBA Driver
 * Copyright (c)  2003-2012 QLogic Corporation
 *
 * See LICENSE.qla2xxx for copyright and licensing details.
 */
/*
 * Driver version
 */
#define QLA2XXX_VERSION      "8.04.00.07-k"

#define QLA_DRIVER_MAJOR_VER	8
#define QLA_DRIVER_MINOR_VER	4
#define QLA_DRIVER_PATCH_VER	0
#define QLA_DRIVER_BETA_VER	0

/*
 * QLogic Fibre Channel HBA Driver
 * Copyright (c)  2003-2012 QLogic Corporation
 *
 * See LICENSE.qla2xxx for copyright and licensing details.
 */
/*
 * Driver version
 */
#define QLA2XXX_VERSION      "8.04.00.08-k"

#define QLA_DRIVER_MAJOR_VER	8
#define QLA_DRIVER_MINOR_VER	4
#define QLA_DRIVER_PATCH_VER	0
#define QLA_DRIVER_BETA_VER	0

[SCSI] qla2xxx: Update the driver version to 8.04.00.08-k.

Signed-off-by: Giridhar Malavali <799b6491fce2c7a80b5fedcf9a728560cc9eb954@qlogic.com>
Signed-off-by: Saurav Kashyap <88d6fd94e71a9ac276fc44f696256f466171a3c0@qlogic.com>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>


#pragma once
#include "ProcessPlatform.h"

namespace ugly
{
    namespace process
    {
        class ProcessNative : public ProcessPlatform
        {
        public:
            ProcessNative(const std::string& path, const std::string& arguments);

            const std::string& GetFullCommandLine() const override { return commandLine; }
        private:
            const std::string& commandLine;
        };
    }
}

#pragma once
#include "ProcessPlatform.h"

namespace ugly
{
    namespace process
    {
        class ProcessNative : public ProcessPlatform
        {
        public:
            ProcessNative(const std::string& path, const std::string& arguments);

            const std::string& GetFullCommandLine() const override { return commandLine; }
        private:
            std::string commandLine;
        };
    }
}

Fix memory corruption, trailing & in member variable type.


/*****************************************************************************
* PROGRAM NAME: CUDFunctionDB.h
* PROGRAMMER: Wei Sun	wsun@vt.edu
* PURPOSE: Define the user defined function DB object to hold all the user
*		   defined function
*****************************************************************************/
#ifndef COPASI_CUDFunctionDB
#define	COPASI_CUDFunctionDB

#include <string>

#include "copasi.h"
#include "output/output.h"
#include "utilities/utilities.h"

class CUDFunctionDB
{
private:
  /**
   * "User-defined functions" string in gps file
   */
  string mNameStr;
  /**
   * The number of user defined function
   */
  C_INT16 mItems;
  /**
   *  Vector of user defined functions
   */
  CCopasiVectorN < CBaseFunction > mUDFunctions;

public:
  /**
   *
   */
  CUDFunctionDB();

  /**
   *
   */
  ~CUDFunctionDB();

  /**
   *
   */
  void cleanup();

  /**
   *  Loads an object with data coming from a CReadConfig object.
   *  (CReadConfig object reads an input stream)
   *  @param pconfigbuffer reference to a CReadConfig object.
   *  @return mFail
   */
  C_INT32 load(CReadConfig & configbuffer);

  /**
   *  Saves the contents of the object to a CWriteConfig object.
   *  (Which usually has a file attached but may also have socket)
   *  @param pconfigbuffer reference to a CWriteConfig object.
   *  @return mFail
   */
  C_INT32 save(CWriteConfig & configbuffer);

  /**
   *  Add the function to the database
   *  @param CUDFunction &function
   *  @return C_INT32 Fail
   */
  void add(CUDFunction & function);

  /**
   * Get the number of user defined functions
   */
  C_INT16 getItems() const;
  /**
   * Set the number of user defined funcstion
   */
  void setItems(const C_INT16 items);

  /**
   * Get the "User-defined functions" string
   */
  string getNameStr() const;
};

#endif

Define a vector to hold user defined functions


// RUN: %llvmgcc -S -O0 -g %s -o - | grep DW_TAG_lexical_block | count 3
int foo(int i) {
	if (i) {
		int j = 2;
	}
	else {
		int j = 3;
	}
	return i;
}

// RUN: %llvmgcc -S -O0 -g %s -o - | grep DW_TAG_lexical_block | count 2
int foo(int i) {
	if (i) {
		int j = 2;
	}
	else {
		int j = 3;
	}
	return i;
}

Adjust test case for lexical block pruning.  Follow-on to r104842 and Radar 7424645.

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


// RUN: %llvmgcc -S %s -o - | grep {align 16}
extern p(int *);
int q(void) {
  int x __attribute__ ((aligned (16)));
  p(&x);
  return x;
}

Test that local variables are aligned as the user requested.

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


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

#ifndef _VDP1_MAP_H_
#define _VDP1_MAP_H_

#include <scu-internal.h>

/* Macros specific for processor */
#define VDP1(x)         (0x25D00000 + (x))

/* Helpers specific to this processor */

#define TVMR		0x0000
#define FBCR		0x0002
#define PTMR		0x0004
#define EWDR		0x0006
#define EWLR		0x0008
#define EWRR		0x000A
#define ENDR		0x000C
#define EDSR		0x000E
#define LOPR		0x0010
#define COPR		0x0012
#define MODR		0x0014

#endif /* !_VDP1_MAP_H_ */

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

#ifndef _VDP1_MAP_H_
#define _VDP1_MAP_H_

#include <scu-internal.h>

/* Macros specific for processor */
#define VDP1(x)         (0x25D00000 + (x))

/* Helpers specific to this processor */

#define TVMR		0x0000
#define FBCR		0x0002
#define PTMR		0x0004
#define EWDR		0x0006
#define EWLR		0x0008
#define EWRR		0x000A
#define ENDR		0x000C
#define EDSR		0x0010
#define LOPR		0x0012
#define COPR		0x0014
#define MODR		0x0016

#endif /* !_VDP1_MAP_H_ */

Fix offsets to VDP1 registers

Fix offsets to VDP1 registers


#include "libinterop_kt43502_api.h"

int main() {
    libinterop_kt43502_symbols()->kotlin.root.printExternPtr();
}

#include "testlib_api.h"

int main() {
    testlib_symbols()->kotlin.root.printExternPtr();
}

Fix KT-43502 testcase on windows

Fix KT-43502 testcase on windows


/****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jolla.com>
**
****************************************************************************/

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef DECLARATIVEWEBUTILS_H
#define DECLARATIVEWEBUTILS_H

#include <QObject>
#include <QString>
#include <QColor>
#include <qqml.h>

class DeclarativeWebUtils : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString homePage READ homePage NOTIFY homePageChanged FINAL)
    Q_PROPERTY(bool firstUseDone READ firstUseDone NOTIFY firstUseDoneChanged FINAL)

public:
    explicit DeclarativeWebUtils(QObject *parent = 0);

    Q_INVOKABLE int getLightness(QColor color) const;
    Q_INVOKABLE QString displayableUrl(QString fullUrl) const;

    static DeclarativeWebUtils *instance();

    QString homePage() const;
    bool firstUseDone() const;
    void setFirstUseDone(bool firstUseDone);

signals:
    void homePageChanged();
    void firstUseDoneChanged();

private:
    QString m_homePage;
    bool m_firstUseDone;
};

QML_DECLARE_TYPE(DeclarativeWebUtils)

#endif

/****************************************************************************
**
** Copyright (C) 2014 Jolla Ltd.
** Contact: Raine Makelainen <raine.makelainen@jolla.com>
**
****************************************************************************/

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
 * You can obtain one at http://mozilla.org/MPL/2.0/. */

#ifndef DECLARATIVEWEBUTILS_H
#define DECLARATIVEWEBUTILS_H

#include <QObject>
#include <QString>
#include <QColor>
#include <qqml.h>

class DeclarativeWebUtils : public QObject
{
    Q_OBJECT
    Q_PROPERTY(QString homePage READ homePage NOTIFY homePageChanged FINAL)
    Q_PROPERTY(bool firstUseDone READ firstUseDone NOTIFY firstUseDoneChanged FINAL)

public:
    explicit DeclarativeWebUtils(QObject *parent = 0);

    Q_INVOKABLE int getLightness(QColor color) const;
    Q_INVOKABLE QString displayableUrl(QString fullUrl) const;

    static DeclarativeWebUtils *instance();

    QString homePage() const;
    bool firstUseDone() const;
    void setFirstUseDone(bool firstUseDone);

signals:
    void homePageChanged();
    void firstUseDoneChanged();
    void beforeShutdown();

private:
    QString m_homePage;
    bool m_firstUseDone;
};

QML_DECLARE_TYPE(DeclarativeWebUtils)

#endif

Add beforeShutdown signal to mock object


//
//  xkcdAppDelegate.h
//  xkcd
//
//  Created by Joshua Bleecher Snyder on 8/25/09.
//  Copyright Treeline Labs 2009. All rights reserved.
//

#define GENERATE_DEFAULT_PNG 0

#define AppDelegate ((xkcdAppDelegate *)[UIApplication sharedApplication].delegate)
#define kUseragent @"xkcd iPhone app (xkcdapp@treelinelabs.com; http://bit.ly/rZtDq). Thank you for the API!"

@class ComicListViewController;

@interface xkcdAppDelegate : NSObject<UIApplicationDelegate> {
  UINavigationController *navigationController;
  ComicListViewController *listViewController;

  NSManagedObjectModel *managedObjectModel;
  NSManagedObjectContext *managedObjectContext;
  NSPersistentStoreCoordinator *persistentStoreCoordinator;

  NSUserDefaults *userDefaults;

  UIWindow *window;
}

- (void)save;

- (BOOL)rotate;
- (BOOL)downloadNewComics;
- (BOOL)openZoomedOut;
- (BOOL)openAfterDownload;

@property(nonatomic, strong, readonly) NSManagedObjectModel *managedObjectModel;
@property(nonatomic, strong, readonly) NSManagedObjectContext *managedObjectContext;
@property(nonatomic, strong, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;

@property(weak, nonatomic, readonly) NSString *applicationDocumentsDirectory;

@property(nonatomic, strong) IBOutlet UIWindow *window;

@end

//
//  xkcdAppDelegate.h
//  xkcd
//
//  Created by Joshua Bleecher Snyder on 8/25/09.
//  Copyright Treeline Labs 2009. All rights reserved.
//

#define GENERATE_DEFAULT_PNG 0

#define AppDelegate ((xkcdAppDelegate *)[UIApplication sharedApplication].delegate)
#define kUseragent @"xkcd iPhone app (josh@treelinelabs.com; http://bit.ly/xkcdapp). Thank you for the API!"

@class ComicListViewController;

@interface xkcdAppDelegate : NSObject<UIApplicationDelegate> {
  UINavigationController *navigationController;
  ComicListViewController *listViewController;

  NSManagedObjectModel *managedObjectModel;
  NSManagedObjectContext *managedObjectContext;
  NSPersistentStoreCoordinator *persistentStoreCoordinator;

  NSUserDefaults *userDefaults;

  UIWindow *window;
}

- (void)save;

- (BOOL)rotate;
- (BOOL)downloadNewComics;
- (BOOL)openZoomedOut;
- (BOOL)openAfterDownload;

@property(nonatomic, strong, readonly) NSManagedObjectModel *managedObjectModel;
@property(nonatomic, strong, readonly) NSManagedObjectContext *managedObjectContext;
@property(nonatomic, strong, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;

@property(weak, nonatomic, readonly) NSString *applicationDocumentsDirectory;

@property(nonatomic, strong) IBOutlet UIWindow *window;

@end

Update the useragent a bit

Update the useragent a bit


//
//  NSBezierPath_CoreImageExtensions.h
//  Bibdesk
//
//  Created by Adam Maxwell on 10/26/05.
/*
 This software is Copyright (c) 2005,2007
 Adam Maxwell. All rights reserved.

 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions
 are met:

 - Redistributions of source code must retain the above copyright
 notice, this list of conditions and the following disclaimer.

 - Redistributions in binary form must reproduce the above copyright
 notice, this list of conditions and the following disclaimer in
 the documentation and/or other materials provided with the
 distribution.

 - Neither the name of Adam Maxwell nor the names of any
 contributors may be used to endorse or promote products derived
 from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#import <Cocoa/Cocoa.h>

@interface NSBezierPath (BDSKGradientExtensions)

- (void)fillPathVertically:(BOOL)isVertical withStartColor:(CIColor *)startColor endColor:(CIColor *)endColor;
- (void)fillPathVerticallyWithStartColor:(CIColor *)inStartColor endColor:(CIColor *)inEndColor;

- (void)fillPathWithHorizontalGradientFromColor:(CIColor *)fgStartColor toColor:(CIColor *)fgEndColor blendedAtTop:(BOOL)top ofVerticalGradientFromColor:(CIColor *)bgStartColor toColor:(CIColor *)bgEndColor;

- (void)fillPathWithVerticalGradientFromColor:(CIColor *)inFgStartColor toColor:(CIColor *)inFgEndColor blendedAtRight:(BOOL)right ofHorizontalGradientFromColor:(CIColor *)inBgStartColor toColor:(CIColor *)inBgEndColor;
- (void)fillPathWithColor:(CIColor *)inFgColor blendedAtRight:(BOOL)right ofVerticalGradientFromColor:(CIColor *)inBgStartColor toColor:(CIColor *)inBgEndColor;

@end

Copy bezier path category from bibdesk to skim


/* Exercise 1-20: Write a program "detab" that replaces tabs in the input with
 * the proper number of blanks to space to the next tab stop. Assume a fixed
 * set of tab stops, say every "n" columns. Should "n" be a variable or a
 * symbolic parameter? */

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

int main(int argc, char **argv)
{
  int32_t character = 0;
  uint32_t line_length = 0;
  uint32_t tab_width = 8;
  while ((character = getchar()) != EOF) {
    if (character == '\t') {
      uint32_t spaces_to_add = tab_width - (line_length % tab_width);
      printf("%*c", spaces_to_add, ' ');
      line_length += spaces_to_add;
    } else {
      putchar(character);
      line_length = (character != '\n') ? ++line_length : 0;
    }
  }
  return EXIT_SUCCESS;
}

Add solution to Exercise 1-20.

Add solution to Exercise 1-20.


#pragma once

#include "expanduino-subdevice.h"
#include "classes/meta.h"

#define EXPANDUINO_MAX_RESPONSE_SIZE 128

class ExpanduinoInterruption {
public:
  ExpanduinoSubdevice* source;
  ExpanduinoInterruption* next;
};

class Expanduino {
  MetaExpanduinoSubdevice metaSubdevice;
  const char* vendorName;
  const char* productName;
  const char* serialNumber;
  const char* shortName;
  ExpanduinoInterruption* nextInterruption;

  friend class ExpanduinoSubdevice;
  friend class MetaExpanduinoSubdevice;

public:
  Expanduino();
  uint8_t getNumSubdevices();
  ExpanduinoSubdevice* getDevice(uint8_t devNumber);
  void dispatch(uint8_t cmd, Stream& request, Print& response);
  void getVendorName(Print& out);
  void getProductName(Print& out);
  void getSerialNumber(Print& out);
  void getShortName(Print& out);
  void beginSubdevices();
  void endSubdevices();
  void reset();

  virtual bool readInterruptionData(Print& response);
  virtual bool requestInterruption(ExpanduinoSubdevice* dev);

};

#pragma once

#include "expanduino-subdevice.h"
#include "classes/meta.h"

#define EXPANDUINO_MAX_RESPONSE_SIZE 128

class ExpanduinoInterruption {
public:
  ExpanduinoSubdevice* source;
  ExpanduinoInterruption* next;
};

class Expanduino {
protected:
  MetaExpanduinoSubdevice metaSubdevice;
  ExpanduinoInterruption* nextInterruption;

  friend class ExpanduinoSubdevice;
  friend class MetaExpanduinoSubdevice;

public:
  Expanduino();
  uint8_t getNumSubdevices();
  ExpanduinoSubdevice* getDevice(uint8_t devNumber);
  void dispatch(uint8_t cmd, Stream& request, Print& response);
  void getVendorName(Print& out);
  void getProductName(Print& out);
  void getSerialNumber(Print& out);
  void getShortName(Print& out);
  void beginSubdevices();
  void endSubdevices();
  void reset();

  virtual bool readInterruptionData(Print& response);
  virtual bool requestInterruption(ExpanduinoSubdevice* dev);

  const char* vendorName;
  const char* productName;
  const char* serialNumber;
  const char* shortName;
};

Make public some attributes of Expanduino


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

extern DDLogLevel magDebugKitLogLevel;
extern BOOL magDebugKitAsyncLogs;
#define LOG_ASYNC_ENABLED magDebugKitAsyncLogs
#define LOG_LEVEL_DEF magDebugKitLogLevel

@interface MAGLogging : NSObject

+ (instancetype)sharedInstance;

@property (nonatomic) DDLogLevel logLevel;

@property (nonatomic) BOOL fileLoggingEnabled;
@property (nonatomic) BOOL ttyLoggingEnabled;
@property (nonatomic) BOOL aslLoggingEnabled;

// Send logs via TCP socket.
@property (nonatomic) NSNumber *remoteLoggingEnabled;
@property (nonatomic, copy) NSString *remoteLoggingHost;
@property (nonatomic) NSNumber *remoteLoggingPort;
@property (nonatomic, copy) NSDictionary *remoteLoggingDictionary;

@end

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

extern DDLogLevel magDebugKitLogLevel;
extern BOOL magDebugKitAsyncLogs;

#ifdef LOG_ASYNC_ENABLED
	#undef LOG_ASYNC_ENABLED
#endif
#define LOG_ASYNC_ENABLED magDebugKitAsyncLogs

#ifdef LOG_LEVEL_DEF
	#undef LOG_LEVEL_DEF
#endif
#define LOG_LEVEL_DEF magDebugKitLogLevel

@interface MAGLogging : NSObject

+ (instancetype)sharedInstance;

@property (nonatomic) DDLogLevel logLevel;

@property (nonatomic) BOOL fileLoggingEnabled;
@property (nonatomic) BOOL ttyLoggingEnabled;
@property (nonatomic) BOOL aslLoggingEnabled;

// Send logs via TCP socket.
@property (nonatomic) NSNumber *remoteLoggingEnabled;
@property (nonatomic, copy) NSString *remoteLoggingHost;
@property (nonatomic) NSNumber *remoteLoggingPort;
@property (nonatomic, copy) NSDictionary *remoteLoggingDictionary;

@end

Fix some warnings (redefined macro definitions)


#ifndef LUMINO_MATH_H
#define LUMINO_MATH_H

#include "Lumino/Math/MathUtils.h"
#include "Lumino/Math/Vector2.h"
#include "Lumino/Math/Vector3.h"
#include "Lumino/Math/Vector4.h"
#include "Lumino/Math/Matrix.h"
#include "Lumino/Math/Quaternion.h"
#include "Lumino/Math/AttitudeTransform.h"
#include "Lumino/Math/Geometries.h"
#include "Lumino/Math/Plane.h"
#include "Lumino/Math/ViewFrustum.h"
#include "Lumino/Math/Random.h"

#endif // LUMINO_MATH_H

#ifndef LUMINO_MATH_H
#define LUMINO_MATH_H

#pragma push_macro("min")
#pragma push_macro("max")
#undef min
#undef max

#include "Lumino/Math/MathUtils.h"
#include "Lumino/Math/Vector2.h"
#include "Lumino/Math/Vector3.h"
#include "Lumino/Math/Vector4.h"
#include "Lumino/Math/Matrix.h"
#include "Lumino/Math/Quaternion.h"
#include "Lumino/Math/AttitudeTransform.h"
#include "Lumino/Math/Geometries.h"
#include "Lumino/Math/Plane.h"
#include "Lumino/Math/ViewFrustum.h"
#include "Lumino/Math/Random.h"

#pragma pop_macro("min")
#pragma pop_macro("max")

#endif // LUMINO_MATH_H

Improve windows min max macro for MFC

Improve windows min max macro for MFC


// Test the -fwritable-strings option.

// RUN: %llvmgcc -O3 -S -o - -emit-llvm -fwritable-strings %s | \
// RUN:    grep {private global}
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {private constant}

char *X = "foo";

// Test the -fwritable-strings option.

// RUN: %llvmgcc -O3 -S -o - -emit-llvm -fwritable-strings %s | \
// RUN:    grep {internal global}
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep {private constant}

char *X = "foo";

Update test to match 95961.

Update test to match 95961.

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


// RUN: c-index-test -test-load-source all %s | FileCheck %s
// RUN: %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck -check-prefix=ERR %s

// CHECK: annotate-comments-unterminated.c:9:5: VarDecl=x:{{.*}} RawComment=[/** Aaa. */]{{.*}} BriefComment=[ Aaa. \n]
// CHECK: annotate-comments-unterminated.c:11:5: VarDecl=y:{{.*}} RawComment=[/**< Bbb. */]{{.*}} BriefComment=[ Bbb. \n]
// CHECK-ERR: error: unterminated

/** Aaa. */
int x;

int y; /**< Bbb. */
/**< Ccc.
 * Ddd.

Add a test for unterminated /* comments.

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


// RUN: $llvmgcc $test -c -o /dev/null |& \
// RUN: egrep {(14|15|22): warning:} |	\
// RUN: wc -l | grep --quiet 3
// TARGET: *-*-darwin
// XFAIL: alpha|ia64|sparc
// END.
// Insist upon warnings for inappropriate weak attributes.
// Note the line numbers (14|15|22) embedded in the check.

// O.K.
extern int ext_weak_import __attribute__ ((__weak_import__));

// These are inappropriate, and should generate warnings:
int decl_weak_import __attribute__ ((__weak_import__));
int decl_initialized_weak_import __attribute__ ((__weak_import__)) = 13;

// O.K.
extern int ext_f(void) __attribute__ ((__weak_import__));

// These are inappropriate, and should generate warnings:
int def_f(void) __attribute__ ((__weak_import__));
int __attribute__ ((__weak_import__)) decl_f(void) {return 0;};

Check for warnings about inappropriate weak_imports.
Darwin-specific; marked XFAIL for others.

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


// PARAM: --set ana.activated[+] "'var_eq'"  --set ana.activated[+] "'symb_locks'"
#include <stdlib.h>
#include <pthread.h>

typedef struct { int myint; pthread_mutex_t mymutex; } mystruct;

void acc(mystruct *s) { s->myint=s->myint+1; } // NORACE

void *foo(void *arg) {
  mystruct *s = (mystruct *) arg;

  pthread_mutex_lock(&s->mymutex);
  acc(s);
  pthread_mutex_unlock(&s->mymutex);

  return NULL;
}

int main() {
  mystruct *s = (mystruct *) malloc(sizeof(*s));
  pthread_mutex_init(&s->mymutex, NULL);

  pthread_t id1, id2;
  pthread_create(&id1, NULL, foo, s);
  pthread_create(&id2, NULL, foo, s);
  pthread_join(id1, NULL);
  pthread_join(id2, NULL);
}

Add symb_locks test for access in function


#pragma once

#include <vector>
#include <memory>

#include <boost/noncopyable.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/iterator/transform_iterator.hpp>

#include "../factory.h"
#include "../visualisation.h"
#include "../agents.h"

namespace scenarios {

class base : public boost::noncopyable {
	public:
		virtual ~base() {};

		virtual agents apply(const agents& source) const = 0;
};

template<typename DERIVED>
class scenario : public base {
	public:
		scenario(const boost::property_tree::ptree& config);
		virtual ~scenario() override;

	protected:
	private:
		static factory<base, boost::property_tree::ptree>::registration<DERIVED> s_factory;
};

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

template<typename DERIVED>
factory<base, boost::property_tree::ptree>::registration<DERIVED> scenario<DERIVED>::s_factory;

template<typename DERIVED>
scenario<DERIVED>::scenario(const boost::property_tree::ptree& config) {
}

template<typename DERIVED>
scenario<DERIVED>::~scenario() {
	// a dummy statement to make sure the factory doesn't get optimized away by GCC
	boost::lexical_cast<std::string>(&s_factory);
}

}

#pragma once

#include <vector>
#include <memory>

#include <boost/noncopyable.hpp>
#include <boost/property_tree/ptree.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/iterator/transform_iterator.hpp>

#include "../factory.h"
#include "../visualisation.h"
#include "../agents.h"

namespace scenarios {

class base : public boost::noncopyable {
	public:
		base(const boost::property_tree::ptree& config) {}
		virtual ~base() {};

		virtual agents apply(const agents& source) const = 0;
};

template<typename DERIVED, typename BASE = base>
class scenario : public BASE {
	public:
		scenario(const boost::property_tree::ptree& config);
		virtual ~scenario() override;

	protected:
	private:
		static factory<base, boost::property_tree::ptree>::registration<DERIVED> s_factory;
};

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

template<typename DERIVED, typename BASE>
factory<base, boost::property_tree::ptree>::registration<DERIVED> scenario<DERIVED, BASE>::s_factory;

template<typename DERIVED, typename BASE>
scenario<DERIVED, BASE>::scenario(const boost::property_tree::ptree& config) : BASE(config) {
}

template<typename DERIVED, typename BASE>
scenario<DERIVED, BASE>::~scenario() {
	// a dummy statement to make sure the factory doesn't get optimized away by GCC
	boost::lexical_cast<std::string>(&s_factory);
}

}

Allow scenarios inheritance for scenarios::scenario template


// RUN: cp %s %t
// RUN: %clang_cc1 -pedantic -fixit %t
// RUN: echo %clang_cc1 -pedantic -Werror -x c %t

/* This is a test of the various code modification hints that are
   provided as part of warning or extension diagnostics. All of the
   warnings will be fixed by -fixit, and the resulting file should
   compile cleanly with -Werror -pedantic. */

// FIXME: If you put a space at the end of the line, it doesn't work yet!
char *s = "hi\
there";

// The following line isn't terminated, don't fix it.
int i; // expected-error{{no newline at end of file}}

// RUN: cp %s %t
// RUN: %clang_cc1 -pedantic -fixit %t
// RUN: %clang_cc1 -pedantic -Werror -x c %t

/* This is a test of the various code modification hints that are
   provided as part of warning or extension diagnostics. All of the
   warnings will be fixed by -fixit, and the resulting file should
   compile cleanly with -Werror -pedantic. */

// FIXME: If you put a space at the end of the line, it doesn't work yet!
char *s = "hi\
there";

// The following line isn't terminated, don't fix it.
int i; // expected-error{{no newline at end of file}}

Fix test to actually check the FixIt-applied code

r102230 added an 'echo' making this a no-op.

Also fixes FAIL on native Windows with no shell/GnuWin32.

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


/*
 * glib-compat.c
 * Functions copied from glib 2.10
 *
 * Copyright 2005 David Schleef <ds@schleef.org>
 */

#ifndef __GLIB_COMPAT_PRIVATE_H__
#define __GLIB_COMPAT_PRIVATE_H__

#include <glib.h>

G_BEGIN_DECLS

#if !GLIB_CHECK_VERSION(2,25,0)
typedef struct stat GStatBuf;
#endif

#if GLIB_CHECK_VERSION(2,26,0)
#define GLIB_HAS_GDATETIME
#endif

/* copies */

/* adaptations */

G_END_DECLS

#endif

/*
 * glib-compat.c
 * Functions copied from glib 2.10
 *
 * Copyright 2005 David Schleef <ds@schleef.org>
 */

#ifndef __GLIB_COMPAT_PRIVATE_H__
#define __GLIB_COMPAT_PRIVATE_H__

#include <glib.h>

G_BEGIN_DECLS

#if !GLIB_CHECK_VERSION(2,25,0)

#if defined (_MSC_VER) && !defined(_WIN64)
typedef struct _stat32 GStatBuf;
#else
typedef struct stat GStatBuf;
#endif

#endif

#if GLIB_CHECK_VERSION(2,26,0)
#define GLIB_HAS_GDATETIME
#endif

/* copies */

/* adaptations */

G_END_DECLS

#endif

Fix GStatBuf definition for win32 when building against older glib. Now matches upstream glib definition.


int main() {
  // Issue: 3: error: integer literal too large to be represented by any integer type
  1000000000000000000000000000;
}

Add test for large integers

Add test for large integers


// Copyright 2014-present Bill Fisher. All rights reserved.

#ifndef OFP_ACTIONID_H_
#define OFP_ACTIONID_H_

#include "ofp/constants.h"
#include "ofp/actiontype.h"

namespace ofp {

class ActionID {
 public:
 public:
  enum {
    ProtocolIteratorSizeOffset = sizeof(OFPActionType),
    ProtocolIteratorAlignment = 4
  };

  explicit ActionID(OFPActionType type = OFPAT_OUTPUT, UInt32 experimenter = 0)
      : type_(type, type == OFPAT_EXPERIMENTER ? 8U : 4U),
        experimenter_{experimenter} {}

  explicit ActionID(ActionType type, UInt32 experimenter = 0)
      : ActionID{type.enumType(), experimenter} {}

  ActionType type() const { return type_.zeroLength(); }
  UInt32 experimenter() const { return experimenter_; }

 private:
  ActionType type_;
  Big32 experimenter_;

  size_t length() const { return type_.length(); }

  friend class ActionIDList;
};

}  // namespace ofp

#endif  // OFP_ACTIONID_H_

// Copyright 2014-present Bill Fisher. All rights reserved.

#ifndef OFP_ACTIONID_H_
#define OFP_ACTIONID_H_

#include "ofp/constants.h"
#include "ofp/actiontype.h"

namespace ofp {

class ActionID {
 public:
  enum {
    ProtocolIteratorSizeOffset = sizeof(OFPActionType),
    ProtocolIteratorAlignment = 4
  };

  explicit ActionID(OFPActionType type = OFPAT_OUTPUT, UInt32 experimenter = 0)
      : type_(type, type == OFPAT_EXPERIMENTER ? 8U : 4U),
        experimenter_{experimenter} {}

  explicit ActionID(ActionType type, UInt32 experimenter = 0)
      : ActionID{type.enumType(), experimenter} {}

  ActionType type() const { return type_.zeroLength(); }
  UInt32 experimenter() const { return experimenter_; }

 private:
  ActionType type_;
  Big32 experimenter_;

  size_t length() const { return type_.length(); }

  friend class ActionIDList;
};

}  // namespace ofp

#endif  // OFP_ACTIONID_H_

Remove extra public access modifier.

Remove extra public access modifier.


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

// 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.45f;

// 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'

Increase version to 1.44 in preparation for new release


#include <stm32f3discovery.conf.h>

CONFIG {
	uarts[1].status = ENABLED;
}

#include <stm32f3discovery.conf.h>

CONFIG {
	uarts[1].status = ENABLED;

	leds[0].status = ENABLED;
	leds[1].status = ENABLED;
	leds[2].status = ENABLED;
	leds[3].status = ENABLED;
	leds[4].status = ENABLED;
	leds[5].status = ENABLED;
	leds[6].status = ENABLED;
	leds[7].status = ENABLED;
}

templates: Add LEDs enable to platform/stm32/f3/stm32f3-discovery/


/*
 * Copyright (c) 2021 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */
#ifndef ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_
#define ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_

#include <kernel.h>

#ifdef __cplusplus
extern "C" {
#endif

/* The file contains definitions of Zephyr specific mgmt commands */

#define ZEPHYR_MGMT_GRP_BASE		MGMT_GROUP_ID_PERUSER

/* Basic group */
#define ZEPHYR_MGMT_GRP_BASIC		ZEPHYR_MGMT_GRP_BASE
#define ZEPHYR_MGMT_GRP_BASIC_CMD_ERASE_STORAGE	0	/* Command to erase storage partition */

#ifdef __cplusplus
}
#endif

#endif /* ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ */

/*
 * Copyright (c) 2021 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: Apache-2.0
 */
#ifndef ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_
#define ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_

#include <kernel.h>

#ifdef __cplusplus
extern "C" {
#endif

/* The file contains definitions of Zephyr specific mgmt commands. The group numbers decrease
 * from PERUSER to avoid collision with user defined groups.
 */
#define ZEPHYR_MGMT_GRP_BASE		(MGMT_GROUP_ID_PERUSER - 1)

/* Basic group */
#define ZEPHYR_MGMT_GRP_BASIC		ZEPHYR_MGMT_GRP_BASE
#define ZEPHYR_MGMT_GRP_BASIC_CMD_ERASE_STORAGE	0	/* Command to erase storage partition */

#ifdef __cplusplus
}
#endif

#endif /* ZEPHYR_INCLUDE_ZEPHYR_MCUMGR_GRP_H_ */

Fix collision with user defined groups

subsys/mgmt/mcumgr: Fix collision with user defined groups

The commit moves definition of Zephyr specific mcumgr basic group to
PERUSER - 1.  This has been done to avoid collision with application
specific groups, defined by users.

Signed-off-by: Dominik Ermel <1a1d45a9cc0c98a37f8d0a0d2dbe3cacc0b2344f@nordicsemi.no>


#if !defined(ED_XMLFILE_H)
#define ED_XMLFILE_H

void* ED_createXML(const char* fileName);
void ED_destroyXML(void* _xml);
double ED_getDoubleFromXML(void* _xml, const char* varName);
const char* ED_getStringFromXML(void* _xml, const char* varName);
int ED_getIntFromXML(void* _xml, const char* varName);
void ED_getDoubleArray1DFromXML(void* _xml, const char* varName, double* a, size_t n);
void ED_getDoubleArray2DFromXML(void* _xml, const char* varName, double* a, size_t m, size_t n);

#endif

#if !defined(ED_XMLFILE_H)
#define ED_XMLFILE_H

#include <stdlib.h>

void* ED_createXML(const char* fileName);
void ED_destroyXML(void* _xml);
double ED_getDoubleFromXML(void* _xml, const char* varName);
const char* ED_getStringFromXML(void* _xml, const char* varName);
int ED_getIntFromXML(void* _xml, const char* varName);
void ED_getDoubleArray1DFromXML(void* _xml, const char* varName, double* a, size_t n);
void ED_getDoubleArray2DFromXML(void* _xml, const char* varName, double* a, size_t m, size_t n);

#endif

Fix missing include (for size_t)

Fix missing include (for size_t)


/*
 * preventfork.c
 * Copyright (C) 2010 Adrian Perez <aperez@igalia.com>
 *
 * Distributed under terms of the MIT license.
 */

#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

pid_t
fork (void)
{
    return 0;
}

int
daemon (int nochdir, int noclose)
{
    if (!nochdir == 0) {
        if (chdir ("/"))
            return -1;
    }
    if (!noclose) {
        close (0);
        if (open ("/dev/null", O_RDONLY, 0) != 0)
            return -1;
        close (1);
        if (open ("/dev/null", O_WRONLY, 0) != 1)
            return -1;
        close (2);
        if (dup (1) != 2)
            return -1;
    }
    return 0;
}

/*
 * nofork.c
 * Copyright (C) 2010 Adrian Perez <aperez@igalia.com>
 *
 * Distributed under terms of the MIT license.
 */

#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>

pid_t
fork (void)
{
    return 0;
}

int
daemon (int nochdir, int noclose)
{
    if (!nochdir == 0) {
        if (chdir ("/"))
            return -1;
    }
    if (!noclose) {
        close (0);
        if (open ("/dev/null", O_RDONLY, 0) != 0)
            return -1;
        close (1);
        if (open ("/dev/null", O_WRONLY, 0) != 1)
            return -1;
        close (2);
        if (dup (1) != 2)
            return -1;
    }
    return 0;
}

Fix file name in comment header

Fix file name in comment header


#ifndef G__IOSFWD_H
#define G__IOSFWD_H
#include <iostream.h>
typedef basic_streambuf<char, char_traits<char> > streambuf;
#endif

#ifndef G__IOSFWD_H
#define G__IOSFWD_H
#include <iostream.h>
#endif

Undo change proposed by Philippe. Too many side effects.

git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@5468 27541ba8-7e3a-0410-8455-c3a389f83636


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

#pragma once

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

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

namespace wangle {

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

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

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

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

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

} // namespace wangle

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

#pragma once

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

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

namespace wangle {

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

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

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

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

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

} // namespace wangle

Switch various calls to folly::setThreadName to set the current thread's name

Summary: This is in preparation for killing the pthread_t overload of folly::setThreadName.

Reviewed By: yfeldblum

Differential Revision: D5012627

fbshipit-source-id: a4e6e2c2cb5bd02b1ebea85c305eac59355a7d42


//
// Created by Dawid Drozd aka Gelldur on 05.02.16.
//

#pragma once

#include <string>
#include <memory>

#include <api/ApiThreadPool.h>
#include <data/Preferences.h>
#include <platform/Bridge.h>
#include <screen/ScreenCreator.h>

#include "UILoop.h"

class Application
{
public:
	Application(CrossMobile::Platform::Bridge* bridge, ScreenCreator* screenCreator);
	virtual ~Application() = default;

	virtual void onCreate();

	virtual void startScreen(const std::string& screenName);

	UILoop& getUILoop()
	{
		return _uiLoop;
	}

	ApiThreadPool& getApiThreadPool()
	{
		return *_apiThreadPool;
	}

	Preferences& getPreferences()
	{
		return _preferences;
	}

	const std::unique_ptr<ScreenCreator>& getScreenCreator() const;

	CrossMobile::Platform::Bridge& getBridge();

	static Application* getInstance();

private:
	UILoop _uiLoop;
	std::unique_ptr<ApiThreadPool> _apiThreadPool;
	Preferences _preferences;
	std::unique_ptr<CrossMobile::Platform::Bridge> _bridge;
	std::unique_ptr<ScreenCreator> _screenCreator;
};

//
// Created by Dawid Drozd aka Gelldur on 05.02.16.
//

#pragma once

#include <string>
#include <memory>

#include <api/ApiThreadPool.h>
#include <data/Preferences.h>
#include <platform/Bridge.h>
#include <screen/ScreenCreator.h>

#include "UILoop.h"

class Application
{
public:
	Application(CrossMobile::Platform::Bridge* bridge, ScreenCreator* screenCreator);
	virtual ~Application() = default;

	virtual void onCreate();

	virtual void startScreen(const std::string& screenName);

	UILoop& getUILoop()
	{
		return _uiLoop;
	}

	ApiThreadPool& getApiThreadPool()
	{
		return _apiThreadPool;
	}

	Preferences& getPreferences()
	{
		return _preferences;
	}

	const std::unique_ptr<ScreenCreator>& getScreenCreator() const;

	CrossMobile::Platform::Bridge& getBridge();

	static Application* getInstance();

private:
	UILoop _uiLoop;
	ApiThreadPool _apiThreadPool;
	Preferences _preferences;
	std::unique_ptr<CrossMobile::Platform::Bridge> _bridge;
	std::unique_ptr<ScreenCreator> _screenCreator;
};

Fix ApiThreadPool after android changes

Fix ApiThreadPool after android changes


//
//  TLKSocketIOSignalingDelegate.h
//  Copyright (c) 2014 &yet, LLC and TLKWebRTC contributors
//

#import <Foundation/Foundation.h>

@class TLKSocketIOSignaling;

@protocol TLKSocketIOSignalingDelegate <NSObject>

@optional

// Called when a connect request has failed due to a bad room key. Delegate is expected to
// get the room key from the user, and then call connect again with the correct key
 -(void)serverRequiresPassword:(TLKSocketIOSignaling*)server;

-(void)addedStream:(TLKMediaStreamWrapper*)stream;
-(void)removedStream:(TLKMediaStreamWrapper*)stream;

-(void)peer:(NSString*)peer toggledAudioMute:(BOOL)mute;
-(void)peer:(NSString*)peer toggledVideoMute:(BOOL)mute;
-(void)lockChange:(BOOL)locked;

@end

//
//  TLKSocketIOSignalingDelegate.h
//  Copyright (c) 2014 &yet, LLC and TLKWebRTC contributors
//

#import <Foundation/Foundation.h>

@class TLKSocketIOSignaling;
@class TLKMediaStreamWrapper;

@protocol TLKSocketIOSignalingDelegate <NSObject>

@optional

// Called when a connect request has failed due to a bad room key. Delegate is expected to
// get the room key from the user, and then call connect again with the correct key
 -(void)serverRequiresPassword:(TLKSocketIOSignaling*)server;

-(void)addedStream:(TLKMediaStreamWrapper*)stream;
-(void)removedStream:(TLKMediaStreamWrapper*)stream;

-(void)peer:(NSString*)peer toggledAudioMute:(BOOL)mute;
-(void)peer:(NSString*)peer toggledVideoMute:(BOOL)mute;
-(void)lockChange:(BOOL)locked;

@end

Fix missing class forward declaration that could cause build errors with some include orders.


/*
 * seq_setprev.c -- set the Previous-Sequence
 *
 * This code is Copyright (c) 2002, by the authors of nmh.  See the
 * COPYRIGHT file in the root directory of the nmh distribution for
 * complete copyright information.
 */

#include <h/mh.h>

/*
 * Add all the messages currently SELECTED to
 * the Previous-Sequence.  This way, when the next
 * command is given, there is a convenient way to
 * selected all the messages used in the previous
 * command.
 */

void
seq_setprev (struct msgs *mp)
{
    char **ap, *cp, *dp;

    /*
     * Get the list of sequences for Previous-Sequence
     * and split them.
     */
    if ((cp = context_find (psequence))) {
	dp = getcpy (cp);
	if (!(ap = brkstring (dp, " ", "\n")) || !*ap) {
	    free (dp);
	    return;
	}
    } else {
	return;
    }

    /* Now add all SELECTED messages to each sequence */
    for (; *ap; ap++)
	seq_addsel (mp, *ap, -1, 1);

    free (dp);
}

/*
 * seq_setprev.c -- set the Previous-Sequence
 *
 * This code is Copyright (c) 2002, by the authors of nmh.  See the
 * COPYRIGHT file in the root directory of the nmh distribution for
 * complete copyright information.
 */

#include <h/mh.h>
#include <h/utils.h>

/*
 * Add all the messages currently SELECTED to
 * the Previous-Sequence.  This way, when the next
 * command is given, there is a convenient way to
 * selected all the messages used in the previous
 * command.
 */

void
seq_setprev (struct msgs *mp)
{
    char **ap, *cp, *dp;

    /*
     * Get the list of sequences for Previous-Sequence
     * and split them.
     */
    if ((cp = context_find (psequence))) {
	dp = mh_xstrdup(cp);
	if (!(ap = brkstring (dp, " ", "\n")) || !*ap) {
	    free (dp);
	    return;
	}
    } else {
	return;
    }

    /* Now add all SELECTED messages to each sequence */
    for (; *ap; ap++)
	seq_addsel (mp, *ap, -1, 1);

    free (dp);
}

Replace getcpy() with mh_xstrdup() where the string isn't NULL.


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

#include "honk-windows.h"

#if !(defined(_WIN32))
#  error This file can only be used on Microsoft Windows systems.
#endif

#include <windows.h>

/**
 * Windows doesn't need a handle to the console,
 * so we just use an arbitrary value instead
 */
static const int default_handle = 42;

int
beep_open() {
    return default_handle;
    }

int
beep_do(handle_t handle, double freq, double len) {
    /* Check the user passed in the same handle we gave them earlier */
    if (handle != default_handle)
        FAIL;

    /* Perform the beep */
    Beep((DWORD) freq, (DWORD) (len * 1000));

    /* Return the handle */
    return handle;
    }

void
beep_close(handle_t handle) {
    /* Turn off the speaker, if it is running */
    Beep(0, 0);
    }

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

#include "honk.h"

#if !(defined(_WIN32))
#  error This file can only be used on Microsoft Windows systems.
#endif

#include <windows.h>

/**
 * Windows doesn't need a handle to the console,
 * so we just use an arbitrary value instead
 */
static const int default_handle = 42;

int
beep_open() {
    return default_handle;
    }

int
beep_do(handle_t handle, double freq, double len) {
    /* Check the user passed in the same handle we gave them earlier */
    if (handle != default_handle)
        FAIL;

    /* Perform the beep */
    Beep((DWORD) freq, (DWORD) (len * 1000));

    /* Return the handle */
    return handle;
    }

void
beep_close(handle_t handle) {
    /* Turn off the speaker, if it is running */
    Beep(0, 0);
    }

Fix typo in header name

Fix typo in header name


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

#ifndef CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
#define CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
#pragma once

#import <Foundation/Foundation.h>

// You should think twice every single time you use anything from this
// namespace.
namespace ObjcEvilDoers {

// Enable zombies.  Returns NO if it fails to enable.
//
// When |zombieAllObjects| is YES, all objects inheriting from
// NSObject become zombies on -dealloc.  If NO, -shouldBecomeCrZombie
// is queried to determine whether to make the object a zombie.
//
// |zombieCount| controls how many zombies to store before freeing the
// oldest.  Set to 0 to free objects immediately after making them
// zombies.
BOOL ZombieEnable(BOOL zombieAllObjects, size_t zombieCount);

// Disable zombies.
void ZombieDisable();

}  // namespace ObjcEvilDoers

@interface NSObject (CrZombie)
- (BOOL)shouldBecomeCrZombie;
@end

#endif  // CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_

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

#ifndef CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
#define CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_
#pragma once

#import <Foundation/Foundation.h>

// You should think twice every single time you use anything from this
// namespace.
namespace ObjcEvilDoers {

// Enable zombie object debugging. This implements a variant of Apple's
// NSZombieEnabled which can help expose use-after-free errors where messages
// are sent to freed Objective-C objects in production builds.
//
// Returns NO if it fails to enable.
//
// When |zombieAllObjects| is YES, all objects inheriting from
// NSObject become zombies on -dealloc.  If NO, -shouldBecomeCrZombie
// is queried to determine whether to make the object a zombie.
//
// |zombieCount| controls how many zombies to store before freeing the
// oldest.  Set to 0 to free objects immediately after making them
// zombies.
BOOL ZombieEnable(BOOL zombieAllObjects, size_t zombieCount);

// Disable zombies.
void ZombieDisable();

}  // namespace ObjcEvilDoers

@interface NSObject (CrZombie)
- (BOOL)shouldBecomeCrZombie;
@end

#endif  // CHROME_BROWSER_COCOA_NSOBJECT_ZOMBIE_H_

Add link to explanation of what we mean by zombie
The person triaging / debugging a zombie crash may never have heard of this before.

BUG=None
TEST=None

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

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


/*
**
** Author(s):
**  - Cedric GESTES <gestes@aldebaran-robotics.com>
**
** Copyright (C) 2012 Aldebaran Robotics
*/

#ifndef _QIMESSAGING_OBJECT_H_
#define _QIMESSAGING_OBJECT_H_

#include <qimessaging/c/api_c.h>

#ifdef __cplusplus
extern "C"
{
#endif

  typedef struct qi_object_t_s  {} qi_object_t;

  //forward declaration
  typedef struct qi_message_t_s qi_message_t;
  typedef struct qi_future_t_s  qi_future_t;

  QIMESSAGING_API typedef void (*qi_object_method_t)(const char *complete_signature, qi_message_t *msg, qi_message_t *ret, void *data);
  QIMESSAGING_API qi_object_t *qi_object_create(const char *name);
  QIMESSAGING_API void         qi_object_destroy(qi_object_t *object);

  QIMESSAGING_API int          qi_object_register_method(qi_object_t *object, const char *complete_signature, qi_object_method_t func, void *data);

  QIMESSAGING_API qi_future_t *qi_object_call(qi_object_t *object, const char *signature, qi_message_t *message);

#ifdef __cplusplus
}
#endif

#endif

/*
**
** Author(s):
**  - Cedric GESTES <gestes@aldebaran-robotics.com>
**
** Copyright (C) 2012 Aldebaran Robotics
*/

#ifndef _QIMESSAGING_OBJECT_H_
#define _QIMESSAGING_OBJECT_H_

#include <qimessaging/c/api_c.h>

#ifdef __cplusplus
extern "C"
{
#endif

  typedef struct qi_object_t_s  {} qi_object_t;

  //forward declaration
  typedef struct qi_message_t_s qi_message_t;
  typedef struct qi_future_t_s  qi_future_t;

  typedef void (*qi_object_method_t)(const char *complete_signature, qi_message_t *msg, qi_message_t *ret, void *data);
  QIMESSAGING_API qi_object_t *qi_object_create(const char *name);
  QIMESSAGING_API void         qi_object_destroy(qi_object_t *object);

  QIMESSAGING_API int          qi_object_register_method(qi_object_t *object, const char *complete_signature, qi_object_method_t func, void *data);

  QIMESSAGING_API qi_future_t *qi_object_call(qi_object_t *object, const char *signature, qi_message_t *message);

#ifdef __cplusplus
}
#endif

#endif

Remove unnecessary API export on typedef

Change-Id: Id9b225ad5a7a645763f4377c7f949e9c9bd4f890
Reviewed-on: http://gerrit.aldebaran.lan:8080/4588
Reviewed-by: llec <42f1a1c02cacc0f5b0188f0127ea77bedfdcf21a@aldebaran-robotics.com>
Tested-by: llec <42f1a1c02cacc0f5b0188f0127ea77bedfdcf21a@aldebaran-robotics.com>


// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#pragma once

#include <boost/tuple/tuple.hpp>

namespace std {
  template<typename... Ts>
  class tuple {
  public:
    tuple(const Ts&... ele):
      m_tuple(ele...)
    {}
    virtual ~tuple(void){}

    bool operator==(const tuple<Ts...>& other) const {
      return m_tuple == other.m_tuple;
    }

    bool operator<(const tuple<Ts...>& other) const {
      return m_tuple < other.m_tuple;
    }

    boost::tuple<Ts...> m_tuple;
  };

  template<int I, typename... Ts>
  auto get(const ::std::tuple<Ts...>& tup) -> decltype(boost::get<I>(tup.m_tuple)) {
    return boost::get<I>(tup.m_tuple);
  }

  template<typename... Ts>
  ::std::tuple<Ts...> make_tuple(const Ts&... ele) {
    return ::std::tuple<Ts...>(ele...);
  }

}//namespace std

// Copyright (C) 2012-2014 Leap Motion, Inc. All rights reserved.
#pragma once

#include <boost/tuple/tuple.hpp>
#include "boost/tuple/tuple_comparison.hpp"

namespace std {
  template<typename... Ts>
  class tuple {
  public:
    tuple(const Ts&... ele):
      m_tuple(ele...)
    {}
    virtual ~tuple(void){}

    bool operator==(const tuple<Ts...>& other) const {
      return m_tuple == other.m_tuple;
    }

    bool operator<(const tuple<Ts...>& other) const {
      return m_tuple < other.m_tuple;
    }

    boost::tuple<Ts...> m_tuple;
  };

  template<int I, typename... Ts>
  auto get(const ::std::tuple<Ts...>& tup) -> decltype(boost::get<I>(tup.m_tuple)) {
    return boost::get<I>(tup.m_tuple);
  }

  template<typename... Ts>
  ::std::tuple<Ts...> make_tuple(const Ts&... ele) {
    return ::std::tuple<Ts...>(ele...);
  }

}//namespace std

Add boost tuple comparison header

Add boost tuple comparison header


// This file is distributed under the MIT license.
// See the LICENSE file for details.

#pragma once

#ifndef VSNRAY_MATH_RAY_H
#define VSNRAY_MATH_RAY_H 1

#include "config.h"
#include "vector.h"

namespace MATH_NAMESPACE
{

template <typename T>
class basic_ray
{
public:

    typedef T scalar_type;
    typedef vector<3, T> vec_type;

public:

    vec_type ori;
    vec_type dir;

    basic_ray() = default;
    MATH_FUNC basic_ray(vector<3, T> const& o, vector<3, T> const& d);

};

} // MATH_NAMESPACE

#include "detail/ray.inl"

#endif // VSNRAY_MATH_RAY_H

// This file is distributed under the MIT license.
// See the LICENSE file for details.

#pragma once

#ifndef VSNRAY_MATH_RAY_H
#define VSNRAY_MATH_RAY_H 1

#include "config.h"
#include "vector.h"

namespace MATH_NAMESPACE
{

template <typename T>
class basic_ray
{
public:

    typedef T scalar_type;
    typedef vector<3, T> vec_type;

public:

    vec_type ori;
    vec_type dir;

    MATH_FUNC basic_ray() = default;
    MATH_FUNC basic_ray(vector<3, T> const& o, vector<3, T> const& d);

};

} // MATH_NAMESPACE

#include "detail/ray.inl"

#endif // VSNRAY_MATH_RAY_H

Mark default ctor host/device for hcc

Mark default ctor host/device for hcc


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

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

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

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

// Initialize the POSIX filesystem.
//
// In general, the `TF_InitPlugin` symbol doesn't need to be exposed in a header
// file, since the plugin registration will look for the symbol in the DSO file
// that provides the filesystem functionality. However, the POSIX filesystem
// needs to be statically registered in some tests and utilities for building
// the API files at the time of creating the pip package. Hence, we need to
// expose this function so that this filesystem can be statically registered
// when needed.
void TF_InitPlugin(TF_FilesystemPluginInfo* info);

#endif  // TENSORFLOW_C_EXPERIMENTAL_FILESYSTEM_MODULAR_FILESYSTEM_H_

Add a header file for the POSIX filesystem.

This header only exposes `TF_InitPlugin` as we need to call this
function when registering the local filesystems statically.


#include <kotaka/privilege.h>
#include <kotaka/paths.h>
#include <kotaka/log.h>

#include <trace.h>
#include <type.h>
#include <status.h>

inherit "call_guard";
inherit "callout_guard";
inherit "touch";
inherit "object";

object canary;

/**********/
/* status */
/**********/

void set_canary(object new_canary)
{
	ACCESS_CHECK(SYSTEM());

	canary = new_canary;
}

object query_canary()
{
	ACCESS_CHECK(SYSTEM());

	return canary;
}

nomask void _F_dummy()
{
}

nomask mixed _F_status(mixed args ...)
{
	ACCESS_CHECK(SYSTEM());

	return status(this_object(), args ...);
}

#if 0
nomask void save_object(string filename)
{
	error("save_object is disabled");
}

nomask void restore_object(string filename)
{
	error("restore_object is disabled");
}
#endif

Allow disable of save/restore object

Allow disable of save/restore object