/*
 * $FreeBSD$
 */
#ifndef _MACHINE_SMP_H_
#define _MACHINE_SMP_H_

#ifdef _KERNEL

/*
 * Interprocessor interrupts for SMP. The following values are indices
 * into the IPI vector table. The SAL gives us the vector used for AP
 * wake-up. Keep the IPI_AP_WAKEUP at index 0.
 */
#define	IPI_AP_WAKEUP		0
#define	IPI_AST			1
#define	IPI_CHECKSTATE		2
#define	IPI_INVLTLB		3
#define	IPI_RENDEZVOUS		4
#define	IPI_STOP		5

#define	IPI_COUNT		6

#ifndef LOCORE

extern int mp_hardware;
extern int mp_ipi_vector[];

void	ipi_all(int ipi);
void	ipi_all_but_self(int ipi);
void	ipi_selected(u_int64_t cpus, int ipi);
void	ipi_self(int ipi);

#endif /* !LOCORE */
#endif /* _KERNEL */
#endif /* !_MACHINE_SMP_H */

/*
 * $FreeBSD$
 */
#ifndef _MACHINE_SMP_H_
#define _MACHINE_SMP_H_

#ifdef _KERNEL

/*
 * Interprocessor interrupts for SMP. The following values are indices
 * into the IPI vector table. The SAL gives us the vector used for AP
 * wake-up. Keep the IPI_AP_WAKEUP at index 0.
 */
#define	IPI_AP_WAKEUP		0
#define	IPI_AST			1
#define	IPI_CHECKSTATE		2
#define	IPI_INVLTLB		3
#define	IPI_RENDEZVOUS		4
#define	IPI_STOP		5
#define	IPI_TEST		6

#define	IPI_COUNT		7

#ifndef LOCORE

extern int mp_hardware;
extern int mp_ipi_vector[];

void	ipi_all(int ipi);
void	ipi_all_but_self(int ipi);
void	ipi_selected(u_int64_t cpus, int ipi);
void	ipi_self(int ipi);

#endif /* !LOCORE */
#endif /* _KERNEL */
#endif /* !_MACHINE_SMP_H */

Add an IPI used for testing proper operation of delivering IPIs.


// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s

// Crashes on powerpc64be
// XFAIL: target-is-powerpc64be

#include "test.h"

int var;

void *Thread(void *x) {
  pthread_exit(&var);
  return 0;
}

int main() {
  pthread_t t;
  pthread_create(&t, 0, Thread, 0);
  void *retval = 0;
  pthread_join(t, &retval);
  if (retval != &var) {
    fprintf(stderr, "Unexpected return value\n");
    exit(1);
  }
  fprintf(stderr, "PASS\n");
  return 0;
}

// CHECK-NOT: WARNING: ThreadSanitizer:
// CHECK: PASS

// RUN: %clang_tsan -O1 %s -o %t && %run %t 2>&1 | FileCheck %s

// Crashes on powerpc64be
// UNSUPPORTED: powerpc64

#include "test.h"

int var;

void *Thread(void *x) {
  pthread_exit(&var);
  return 0;
}

int main() {
  pthread_t t;
  pthread_create(&t, 0, Thread, 0);
  void *retval = 0;
  pthread_join(t, &retval);
  if (retval != &var) {
    fprintf(stderr, "Unexpected return value\n");
    exit(1);
  }
  fprintf(stderr, "PASS\n");
  return 0;
}

// CHECK-NOT: WARNING: ThreadSanitizer:
// CHECK: PASS

[tsan] Remove debug logging and disable test on ppc64be

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


/* See LICENSE file for copyright and license details. */
#include "internals.h"

void
libzahl_realloc(z_t a, size_t need)
{
#if defined(__clang__) /* https://llvm.org/bugs/show_bug.cgi?id=26930 */
	volatile size_t j;
#else
# define j  i
#endif
	size_t i, x;
	zahl_char_t *new;

	/* Find n such that n is a minimal power of 2 ≥ need. */
	if (likely((need & (~need + 1)) != need)) {
		need |= need >> 1;
		need |= need >> 2;
		need |= need >> 4;
		for (j = sizeof(need), x = 8; j; j >>= 1, x <<= 1)
			need |= need >> x;
		need += 1;
	}

	i = libzahl_msb_nz_zu(need);

	if (likely(libzahl_pool_n[i])) {
		libzahl_pool_n[i]--;
		new = libzahl_pool[i][libzahl_pool_n[i]];
		zmemcpy(new, a->chars, a->alloced);
		zfree(a);
		a->chars = new;
	} else {
		a->chars = realloc(a->chars, need * sizeof(zahl_char_t));
		if (!a->chars) {
			if (!errno) /* sigh... */
				errno = ENOMEM;
			libzahl_failure(errno);
		}
	}
	a->alloced = need;
}

/* See LICENSE file for copyright and license details. */
#include "internals.h"

void
libzahl_realloc(z_t a, size_t need)
{
	size_t i, x;
	zahl_char_t *new;

	/* Find n such that n is a minimal power of 2 ≥ need. */
	if (likely((need & (~need + 1)) != need)) {
		need |= need >> 1;
		need |= need >> 2;
		need |= need >> 4;
		for (i = sizeof(need), x = 8; (i >>= 1); x <<= 1)
			need |= need >> x;
		need += 1;
	}

	i = libzahl_msb_nz_zu(need);

	if (likely(libzahl_pool_n[i])) {
		libzahl_pool_n[i]--;
		new = libzahl_pool[i][libzahl_pool_n[i]];
		zmemcpy(new, a->chars, a->alloced);
		zfree(a);
		a->chars = new;
	} else {
		a->chars = realloc(a->chars, need * sizeof(zahl_char_t));
		if (!a->chars) {
			if (!errno) /* sigh... */
				errno = ENOMEM;
			libzahl_failure(errno);
		}
	}
	a->alloced = need;
}

Fix so that no workaround is required.

Fix so that no workaround is required.

  Thanks to Alexis Megas.

Signed-off-by: Mattias Andrée <3d72f033b30d63e7ff5f0b71398e9c45b66386a1@kth.se>


#ifndef	CONFIG_EXPORTER_H
#define	CONFIG_EXPORTER_H

class ConfigClass;
class ConfigObject;
class ConfigValue;

class ConfigExporter {
protected:
	ConfigExporter(void)
	{ }

	~ConfigExporter()
	{ }

public:
	virtual void field(const ConfigValue *, const std::string&) = 0;
	virtual void object(const ConfigClass *, const ConfigObject *) = 0;
	virtual void value(const ConfigValue *, const std::string&) = 0;
};

#endif /* !CONFIG_EXPORTER_H */

#ifndef	CONFIG_EXPORTER_H
#define	CONFIG_EXPORTER_H

class ConfigClass;
class ConfigObject;
class ConfigValue;

class ConfigExporter {
protected:
	ConfigExporter(void)
	{ }

	virtual ~ConfigExporter()
	{ }

public:
	virtual void field(const ConfigValue *, const std::string&) = 0;
	virtual void object(const ConfigClass *, const ConfigObject *) = 0;
	virtual void value(const ConfigValue *, const std::string&) = 0;
};

#endif /* !CONFIG_EXPORTER_H */

Fix per Noris Datum's E-Mail.

Fix per Noris Datum's E-Mail.

git-svn-id: 9e2532540f1574e817ce42f20b9d0fb64899e451@783 4068ffdb-0463-0410-8185-8cc71e3bd399


// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

#ifndef RUNTIME_PLATFORM_FLOATING_POINT_H_
#define RUNTIME_PLATFORM_FLOATING_POINT_H_

#include <cmath>

inline double fmod_ieee(double x, double y) {
  return fmod(x, y);
}
inline double atan2_ieee(double y, double x) {
  return atan2(y, x);
}

#endif  // RUNTIME_PLATFORM_FLOATING_POINT_H_

// Copyright (c) 2012, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

#ifndef RUNTIME_PLATFORM_FLOATING_POINT_H_
#define RUNTIME_PLATFORM_FLOATING_POINT_H_

#include <math.h>

inline double fmod_ieee(double x, double y) {
  return fmod(x, y);
}
inline double atan2_ieee(double y, double x) {
  return atan2(y, x);
}

#endif  // RUNTIME_PLATFORM_FLOATING_POINT_H_

Fix import to fix Flutter build

[gardening] Fix import to fix Flutter build

How cmath is included changes whether the symbols are in the std:: namespace or not. This changes it back to how we have it everywhere in the codebase: math.h

Follow up of https://dart-review.googlesource.com/c/sdk/+/115707/

Change-Id: I383c1e9de0434d1367dfdb6302a8fb6db2c3062c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115920
Auto-Submit: Daco Harkes <930cbae0ca77f1954c53e32620d89cfcca318f00@google.com>
Reviewed-by: Martin Kustermann <a35dd5b79fac84b2bb3b026a16b8becc55af5961@google.com>
Commit-Queue: Daco Harkes <930cbae0ca77f1954c53e32620d89cfcca318f00@google.com>


/*
    Copyright 2015 Ahnaf Siddiqui

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

#include "D_typedefs.h"
#include "D_Texture.h"

namespace Diamond {
    struct AnimationSheet {
        Texture *sprite_sheet;

        /**
         The length of time in type of tD_delta of one animation frame
        */
        tD_delta    frame_length = 100;

        uint16_t    num_frames = 1;
        uint8_t     rows = 1, columns = 1;
    };
}

#endif // D_ANIMATION_SHEET_H

/*
    Copyright 2015 Ahnaf Siddiqui

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

#include "D_typedefs.h"
#include "D_Texture.h"

namespace Diamond {
    struct AnimationSheet {
        Texture *sprite_sheet = nullptr;

        /**
         The length of time in type of tD_delta of one animation frame
        */
        tD_delta    frame_length = 100;

        uint16_t    num_frames = 1;
        uint8_t     rows = 1, columns = 1;
    };
}

#endif // D_ANIMATION_SHEET_H

Set default nullptr value on animation sheet texture


/*
 * @file    main.c
 * @brief   Set PORTC I/O pins using data direction register,
 *          read input from pins and set high PORTC.0 2 and 3
 *          if input pin PORTC.6 is high.
 * @date    06 Jun 2016 10:28 PM
 */

#include <avr/io.h>
#include <util/delay.h>

#define __DELAY_BACKWARD_COMPATIBLE__

#ifndef F_CPU
#define F_CPU 16000000UL    /* 16 MHz clock speed */
#endif

int
main(void)
{
    DDRC = 0x0F;
    PORTC = 0x0C;

    /* lets assume a 4V supply comes to PORTC.6 and Vcc = 5V */
    if (PINC == 0b01000000) {
        PORTC = 0x0B;
        _delay_ms(1000);    /* delay 1s */
    } else {
        PORTC = 0x00;
    }
    return 0;
}

/*
 * @file    main.c
 * @brief   Set PORTC I/O pins using data direction register,
 *          read input from pins and set high PORTC.0 2 and 3
 *          if input pin PORTC.6 is high.
 * @date    06 Jun 2016 10:28 PM
 */

#define __DELAY_BACKWARD_COMPATIBLE__

#ifndef F_CPU
#define F_CPU 16000000UL    /* 16 MHz clock speed */
#endif

#include <avr/io.h>
#include <util/delay.h>

int
main(void)
{
    DDRC = 0x0F;
    PORTC = 0x0C;

    /* lets assume a 4V supply comes to PORTC.6 and Vcc = 5V */
    if (PINC == 0b01000000) {
        PORTC = 0x0B;
        _delay_ms(1000);    /* delay 1s */
    } else {
        PORTC = 0x00;
    }
    return 0;
}

Define clock frequency before includes

Define clock frequency before includes


/*
 * arch/ppc/platforms/4xx/virtex.h
 *
 * Include file that defines the Xilinx Virtex-II Pro processor
 *
 * Author: MontaVista Software, Inc.
 *         source@mvista.com
 *
 * 2002-2004 (c) MontaVista Software, Inc.  This file is licensed under the
 * terms of the GNU General Public License version 2.  This program is licensed
 * "as is" without any warranty of any kind, whether express or implied.
 */

#ifdef __KERNEL__
#ifndef __ASM_VIRTEX_H__
#define __ASM_VIRTEX_H__

/* serial defines */

#include <asm/ibm405.h>

/* Ugly, ugly, ugly! BASE_BAUD defined here to keep 8250.c happy. */
#if !defined(BASE_BAUD)
 #define BASE_BAUD		(0) /* dummy value; not used */
#endif

/* Device type enumeration for platform bus definitions */
#ifndef __ASSEMBLY__
enum ppc_sys_devices {
	VIRTEX_UART,
};
#endif

#endif				/* __ASM_VIRTEX_H__ */
#endif				/* __KERNEL__ */

/*
 * arch/ppc/platforms/4xx/virtex.h
 *
 * Include file that defines the Xilinx Virtex-II Pro processor
 *
 * Author: MontaVista Software, Inc.
 *         source@mvista.com
 *
 * 2002-2004 (c) MontaVista Software, Inc.  This file is licensed under the
 * terms of the GNU General Public License version 2.  This program is licensed
 * "as is" without any warranty of any kind, whether express or implied.
 */

#ifdef __KERNEL__
#ifndef __ASM_VIRTEX_H__
#define __ASM_VIRTEX_H__

/* serial defines */

#include <asm/ibm405.h>

/* Ugly, ugly, ugly! BASE_BAUD defined here to keep 8250.c happy. */
#if !defined(BASE_BAUD)
 #define BASE_BAUD		(0) /* dummy value; not used */
#endif

/* Device type enumeration for platform bus definitions */
#ifndef __ASSEMBLY__
enum ppc_sys_devices {
	VIRTEX_UART, NUM_PPC_SYS_DEVS,
};
#endif

#endif				/* __ASM_VIRTEX_H__ */
#endif				/* __KERNEL__ */

Fix compile error for ML300/403

[PATCH] Fix compile error for ML300/403

Needed due to changes in ppc_sys.c.

Signed-off-by: Grant Likely <9069e6f5a2b566e2674a0ba1e2bf39c12c195fad@secretlab.ca>
Signed-off-by: Paul Mackerras <19a0ba370c443ba08d20b5061586430ab449ee8c@samba.org>


/* Copyright 2021 The Chromium OS Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 *
 * ANX7491:10G USB 3.2 Re-timer (1-Port)
 */

#ifndef __CROS_EC_USB_RETIMER_ANX7491_H
#define __CROS_EC_USB_RETIMER_ANX7491_H

/* I2C interface addresses */
#define ANX7491_I2C_ADDR0_FLAGS		0x10
#define ANX7491_I2C_ADDR1_FLAGS		0x14
#define ANX7491_I2C_ADDR2_FLAGS		0x16
#define ANX7491_I2C_ADDR3_FLAGS		0x11

#endif /* __CROS_EC_USB_RETIMER_ANX7491_H */

Add header for ANX7491 retimer

guybrush: Add header for ANX7491 retimer

Adding a header to hold register values for ANX7491. ANX7491 should work
without configuration. More registers can be added as needed for
tuning.

BUG=b:184592168
TEST=Build
BRANCH=None

Signed-off-by: Rob Barnes <3ced0940a2329ce70499686f01d3d60685ec66ed@google.com>
Change-Id: If529bfdedff6b151147c8ef02840621b093be672
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809881
Reviewed-by: Diana Z <cb2016afc7183e5356c690dc63b4ba817470501a@chromium.org>


#if __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#else
#import <React/RCTBridgeModule.h>
#endif

#import  <UIKit/UIKit.h>
#include <libkern/OSAtomic.h>
#include <execinfo.h>

@interface ReactNativeExceptionHandler : NSObject <RCTBridgeModule>
+ (void) replaceNativeExceptionHandlerBlock:(void (^)(NSException *exception, NSString *readeableException))nativeCallbackBlock;
+ (void) releaseExceptionHold;
@end

#if __has_include(<React/RCTBridgeModule.h>)
#import <React/RCTBridgeModule.h>
#else
#import "RCTBridgeModule.h"
#endif

#import  <UIKit/UIKit.h>
#include <libkern/OSAtomic.h>
#include <execinfo.h>

@interface ReactNativeExceptionHandler : NSObject <RCTBridgeModule>
+ (void) replaceNativeExceptionHandlerBlock:(void (^)(NSException *exception, NSString *readeableException))nativeCallbackBlock;
+ (void) releaseExceptionHold;
@end

Change import priority of RCTBridgeModule

This appears to be the accepted fix for this issue: https://github.com/master-atul/react-native-exception-handler/issues/46 per https://github.com/facebook/react-native/issues/15775#issuecomment-326930316 and other posts in the same thread.


// The libMesh Finite Element Library.
// Copyright (C) 2002-2019 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner

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

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

// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

#ifndef LIBMESH_STRING_TO_ENUM_H
#define LIBMESH_STRING_TO_ENUM_H

// C++ includes
#include <string>

namespace libMesh
{

namespace Utility
{

/**
 * \returns the enumeration of type \p T which matches the string \p s.
 */
template <typename T>
T string_to_enum (const std::string & s);

} // namespace Utility
} // namespace libMesh

#endif // LIBMESH_STRING_TO_ENUM_H

// The libMesh Finite Element Library.
// Copyright (C) 2002-2019 Benjamin S. Kirk, John W. Peterson, Roy H. Stogner

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

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

// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

#ifndef LIBMESH_STRING_TO_ENUM_H
#define LIBMESH_STRING_TO_ENUM_H

// libMesh includes
 #include "libmesh/enum_to_string.h" // backwards compatibility

// C++ includes
#include <string>

namespace libMesh
{

namespace Utility
{

/**
 * \returns the enumeration of type \p T which matches the string \p s.
 */
template <typename T>
T string_to_enum (const std::string & s);

} // namespace Utility
} // namespace libMesh

#endif // LIBMESH_STRING_TO_ENUM_H

Include new header in old header for backwards compatibility.


//===-- X86TargetMachine.h - Define TargetMachine for the X86 ---*- C++ -*-===//
//
// This file declares the X86 specific subclass of TargetMachine.
//
//===----------------------------------------------------------------------===//

#ifndef X86TARGETMACHINE_H
#define X86TARGETMACHINE_H

#include "llvm/Target/TargetMachine.h"
#include "X86InstrInfo.h"

class X86TargetMachine : public TargetMachine {
  X86InstrInfo instrInfo;
public:
  X86TargetMachine();

  virtual const MachineInstrInfo &getInstrInfo() const { return instrInfo; }
  virtual const MachineSchedInfo &getSchedInfo() const { abort(); }
  virtual const MachineRegInfo   &getRegInfo()   const { abort(); }
  virtual const MachineFrameInfo &getFrameInfo() const { abort(); }
  virtual const MachineCacheInfo &getCacheInfo() const { abort(); }
  virtual const MachineOptInfo   &getOptInfo()   const { abort(); }

  /// addPassesToJITCompile - Add passes to the specified pass manager to
  /// implement a fast dynamic compiler for this target.  Return true if this is
  /// not supported for this target.
  ///
  virtual bool addPassesToJITCompile(PassManager &PM);
};

#endif

//===-- X86TargetMachine.h - Define TargetMachine for the X86 ---*- C++ -*-===//
//
// This file declares the X86 specific subclass of TargetMachine.
//
//===----------------------------------------------------------------------===//

#ifndef X86TARGETMACHINE_H
#define X86TARGETMACHINE_H

#include "llvm/Target/TargetMachine.h"
#include "X86InstrInfo.h"

class X86TargetMachine : public TargetMachine {
  X86InstrInfo instrInfo;
public:
  X86TargetMachine();

  virtual const MachineInstrInfo &getInstrInfo() const { return instrInfo; }
  virtual const MachineSchedInfo &getSchedInfo() const { abort(); }
  virtual const MachineRegInfo   &getRegInfo()   const { abort(); }
  virtual const MachineFrameInfo &getFrameInfo() const { abort(); }
  virtual const MachineCacheInfo &getCacheInfo() const { abort(); }
  virtual const MachineOptInfo   &getOptInfo()   const { abort(); }
  virtual const MRegisterInfo *getRegisterInfo() const {
    return &instrInfo.getRegisterInfo();
  }

  /// addPassesToJITCompile - Add passes to the specified pass manager to
  /// implement a fast dynamic compiler for this target.  Return true if this is
  /// not supported for this target.
  ///
  virtual bool addPassesToJITCompile(PassManager &PM);
};

#endif

Implement the new optional getRegisterInfo

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


/*
name: TEST003
description: Select function to call inside ternary operator
output:
*/

int
foo(void)
{
	return 42;
}

int
bar(void)
{
	return 24;
}

int
main(void)
{
	return (1 ? foo : bar)();
}

Add test for ternary operator

Add test for ternary operator

The test is currently failing.


#ifndef BORDERS_H
#define BORDERS_H

#include <cstdlib>
#include <cmath>

/** A line will be considered as having content if 0.25% of it is filled. */
const float filledRatioLimit = 0.0025;

/** When the threshold is closer to 1, less content will be cropped. **/
#define THRESHOLD 0.65

const uint16_t redThreshold_RGB_565 = ((uint16_t)(31.0 * THRESHOLD)) << (5 + 6);
const uint8_t  redTreshold_RGB_A8888 = (uint8_t)(255.0 * THRESHOLD);
const uint8_t  redTreshold_A8 = (uint8_t)(255.0 * THRESHOLD);

struct Borders {
    int left, top, right, bottom;
};

Borders findBorders_ARGB_8888(const void *pixels, int width, int height);

Borders findBorders_RGB_565(const void *pixels, int width, int height);

Borders findBorders_A8(const void *pixels, int width, int height);

#endif //BORDERS_H

#ifndef BORDERS_H
#define BORDERS_H

#include <cstdlib>
#include <cmath>

/** A line will be considered as having content if 0.25% of it is filled. */
const float filledRatioLimit = 0.0025;

/** When the threshold is closer to 1, less content will be cropped. **/
#define THRESHOLD 0.75

const uint16_t redThreshold_RGB_565 = ((uint16_t)(31.0 * THRESHOLD)) << (5 + 6);
const uint8_t  redTreshold_RGB_A8888 = (uint8_t)(255.0 * THRESHOLD);
const uint8_t  redTreshold_A8 = (uint8_t)(255.0 * THRESHOLD);

struct Borders {
    int left, top, right, bottom;
};

Borders findBorders_ARGB_8888(const void *pixels, int width, int height);

Borders findBorders_RGB_565(const void *pixels, int width, int height);

Borders findBorders_A8(const void *pixels, int width, int height);

#endif //BORDERS_H

Add a bit more threshold

Add a bit more threshold


/*
name: TEST015
description: Stress namespace mechanism
output:
test015.c:21: warning: 's1' defined but not used
S7	s2
(
M8	I	s
)
S4	s1
(
M5	I	s
M9	S7	s2
)
S2	s
(
M10	S4	s1
)
G11	S2	s
F1
G12	F1	main
{
-
	j	L2
A3	S2	s2
L4
	yI	G11	M10	.S4	M5	.I	G11	M10	.S4	M9	.S7	M8	.I	+I
L2
	yI	A3	M10	.S4	M9	.S7	M8	.I
}
*/

#line 1

struct s {
	struct s1 {
		int s;
		struct s2 {
			int s;
		} s2;
	} s1;
} s;

int
main(void)
{
	goto	s2;
	struct s s2;
	s1:
	return s.s1.s + s.s1.s2.s;
	s2:
	return s2.s1.s2.s;
}

Add test of namespaces and structs/unions


#ifndef CONTROL_LOOP_INL_H
#define CONTROL_LOOP_INL_H

#include "board.h"
#include "bitband.h"

namespace hardware {

inline
bool ControlLoop::hw_button_enabled()
{
  return MEM_ADDR(BITBAND(reinterpret_cast<uint32_t>(&(GPIOF->IDR)),
                          GPIOF_HW_SWITCH_PIN));
}

}

#endif

#ifndef CONTROL_LOOP_INL_H
#define CONTROL_LOOP_INL_H

#include "board.h"
#include "bitband.h"

namespace hardware {

inline
bool ControlLoop::hw_button_enabled() const
{
  return MEM_ADDR(BITBAND(reinterpret_cast<uint32_t>(&(GPIOF->IDR)),
                          GPIOF_HW_SWITCH_PIN));
}

}

#endif

Add const to hw_button_enabled() definition.


#ifndef FORMAT_H
#define FORMAT_H

#include <cstring>  // memmove

class Format
{
public:
    Format(void *p, size_t s = 0) : fp((char *)p), size(s) {};

    size_t Leanify(size_t size_leanified = 0)
    {
        if (size_leanified)
        {
            memmove(fp - size_leanified, fp, size);
            fp -= size_leanified;
        }

        return size;
    }

protected:
    // pointer to the file content
    char *fp;
    // size of the file
    size_t size;
};

#endif

#ifndef FORMAT_H
#define FORMAT_H

#include <cstddef>
#include <cstring>  // memmove

class Format
{
public:
    Format(void *p, size_t s = 0) : fp((char *)p), size(s) {};

    size_t Leanify(size_t size_leanified = 0)
    {
        if (size_leanified)
        {
            memmove(fp - size_leanified, fp, size);
            fp -= size_leanified;
        }

        return size;
    }

protected:
    // pointer to the file content
    char *fp;
    // size of the file
    size_t size;
};

#endif

Add missing cstddef header for size_t

Add missing cstddef header for size_t


#include "vpx_ports/config.h"

#include "opencl/vp8_opencl.h"
#include "opencl/vp8_decode_cl.h"

#include <stdio.h>

extern int cl_init_dequant();
extern int cl_destroy_dequant();

int cl_decode_destroy(){
    int err;

    err = cl_destroy_dequant();

    return CL_SUCCESS;
}

int cl_decode_init()
{
    int err;
    printf("Initializing opencl decoder-specific programs/kernels");

    //Initialize programs to null value
    //Enables detection of if they've been initialized as well.
    cl_data.dequant_program = NULL;

    err = cl_init_dequant();
    if (err != CL_SUCCESS)
        return err;

    printf(" .. done\n");

    return CL_SUCCESS;
}

#include "vpx_ports/config.h"

#include "../../common/opencl/vp8_opencl.h"
#include "vp8_decode_cl.h"

#include <stdio.h>

extern int cl_init_dequant();
extern int cl_destroy_dequant();

int cl_decode_destroy(){
    int err;

    err = cl_destroy_dequant();

    return CL_SUCCESS;
}

int cl_decode_init()
{
    int err;
    printf("Initializing opencl decoder-specific programs/kernels");

    //Initialize programs to null value
    //Enables detection of if they've been initialized as well.
    cl_data.dequant_program = NULL;

    err = cl_init_dequant();
    if (err != CL_SUCCESS)
        return err;

    return CL_SUCCESS;
}

Remove some debug output from decode initialization.


/* vim:set shiftwidth=4 ts=8: */

/**********************************************************
*      This software is part of the graphviz package      *
*                http://www.graphviz.org/                 *
*                                                         *
*            Copyright (c) 1994-2004 AT&T Corp.           *
*                and is licensed under the                *
*            Common Public License, Version 1.0           *
*                      by AT&T Corp.                      *
*                                                         *
*        Information and Software Systems Research        *
*              AT&T Research, Florham Park NJ             *
**********************************************************/

#ifndef TOPVIEWDATA_H
#define TOPVIEWDATA_H

#include <gtk/gtk.h>
#include "cgraph.h"
#include "smyrnadefs.h"
#include "tvnodes.h"

int prepare_nodes_for_groups(topview * t, topviewdata * td,
			     int groupindex);
int load_host_buttons(topview * t, Agraph_t * g, glCompSet * s);
int validate_group_node(tv_node * TV_Node, char *regex_string);
int click_group_button(int groupindex);
void glhost_button_clicked_Slot(void *p);
_BB void host_button_clicked_Slot(GtkWidget * widget, gpointer user_data);

#endif

/* vim:set shiftwidth=4 ts=8: */

/**********************************************************
*      This software is part of the graphviz package      *
*                http://www.graphviz.org/                 *
*                                                         *
*            Copyright (c) 1994-2004 AT&T Corp.           *
*                and is licensed under the                *
*            Common Public License, Version 1.0           *
*                      by AT&T Corp.                      *
*                                                         *
*        Information and Software Systems Research        *
*              AT&T Research, Florham Park NJ             *
**********************************************************/

#ifndef TOPVIEWDATA_H
#define TOPVIEWDATA_H

#include <gtk/gtk.h>
#include "cgraph.h"
#include "smyrnadefs.h"
#include "tvnodes.h"

int prepare_nodes_for_groups(topview * t, topviewdata * td,
			     int groupindex);
int load_host_buttons(topview * t, Agraph_t * g, glCompSet * s);
int click_group_button(int groupindex);
void glhost_button_clicked_Slot(void *p);
_BB void host_button_clicked_Slot(GtkWidget * widget, gpointer user_data);

#endif

Integrate topfish and sfdp into main tree, using GTS for triangulation; remove duplicated code


//
// This software was produced with support in part from the Defense Advanced
// Research Projects Agency (DARPA) through AFRL Contract FA8650-09-C-1915.
// Nothing in this work should be construed as reflecting the official policy or
// position of the Defense Department, the United States government, or
// Rice University.
//
#ifndef UNW_DATATYPES_SPECIFIC_H
#define UNW_DATATYPES_SPECIFIC_H

#include <libunwind.h>

#include <unwind/common/fence_enum.h>
#include <hpcrun/loadmap.h>
#include <utilities/ip-normalized.h>

typedef struct {
  load_module_t* lm;
} intvl_t;

typedef struct hpcrun_unw_cursor_t {
  void* pc_unnorm;

  fence_enum_t fence; // Details on which fence stopped an unwind
  unw_cursor_t uc;
  // normalized ip for first instruction in enclosing function
  ip_normalized_t the_function;

  ip_normalized_t pc_norm;
} hpcrun_unw_cursor_t;

#endif // UNW_DATATYPES_SPECIFIC_H

//
// This software was produced with support in part from the Defense Advanced
// Research Projects Agency (DARPA) through AFRL Contract FA8650-09-C-1915.
// Nothing in this work should be construed as reflecting the official policy or
// position of the Defense Department, the United States government, or
// Rice University.
//
#ifndef UNW_DATATYPES_SPECIFIC_H
#define UNW_DATATYPES_SPECIFIC_H

#include <libunwind.h>

#include <unwind/common/fence_enum.h>
#include <hpcrun/loadmap.h>
#include <utilities/ip-normalized.h>

typedef struct {
  load_module_t* lm;
} intvl_t;

typedef struct hpcrun_unw_cursor_t {
  void* pc_unnorm;

  unw_cursor_t uc;
  // normalized ip for first instruction in enclosing function
  ip_normalized_t the_function;

  ip_normalized_t pc_norm;
} hpcrun_unw_cursor_t;

#endif // UNW_DATATYPES_SPECIFIC_H

Drop another unused libunw cursor member.


// SKIP PARAM: --sets ana.activated[+] octApron
#include <pthread.h>
#include <assert.h>

void *t_fun(void *arg) {
  int x; // threadenter shouldn't pass value for x here
  assert(x == 3); // UNKNOWN!
  return NULL;
}

int main(void) {
  int x = 3;

  pthread_t id;
  pthread_create(&id, NULL, t_fun, NULL);

  return 0;
}

Add octApron test where threadenter doesn't remove locals


/*-
 * Copyright (c) 2005 David Xu <davidxu@freebsd.org>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
 *
 * $FreeBSD$
 */

#ifndef _MQUEUE_H_
#define _MQUEUE_H_

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

struct sigevent;
struct timespec;

int	mq_close(mqd_t);
int	mq_getattr(mqd_t, struct mq_attr *);
int	mq_notify(mqd_t, const struct sigevent *);
mqd_t	mq_open(const char *, int, ...);
ssize_t	mq_receive(mqd_t, char *, size_t, unsigned *);
int	mq_send(mqd_t, const char *, size_t, unsigned);
int	mq_setattr(mqd_t, const struct mq_attr *__restrict,
		struct mq_attr *__restrict);
ssize_t	mq_timedreceive(mqd_t, char *__restrict, size_t,
		unsigned *__restrict, const struct timespec *__restrict);
int	mq_timedsend(mqd_t, const char *, size_t, unsigned,
		const struct timespec *);
int	mq_unlink(const char *);
#endif

Bring in POSIX message queue header file.


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

#include "compiler.h"
#include "cJSON.h"
#include "parse.h"

int parse_message(const char *msg, uint32_t length)
{
	cJSON *root;
	const char *end_parse;

	root = cJSON_ParseWithOpts(msg, &end_parse, 0);
	if (unlikely(root == NULL)) {
		fprintf(stderr, "Could not parse JSON!\n");
		return -1;
	} else {
		uint32_t parsed_length = end_parse - msg;
		if (unlikely(parsed_length != length)) {
			fprintf(stderr, "length of parsed JSON does not match message length!\n");
			return -1;
		}
		cJSON_Delete(root);
		return 0;
	}
}

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

#include "compiler.h"
#include "cJSON.h"
#include "parse.h"

int parse_message(const char *msg, uint32_t length)
{
	cJSON *root;
	const char *end_parse;

	root = cJSON_ParseWithOpts(msg, &end_parse, 0);
	if (unlikely(root == NULL)) {
		fprintf(stderr, "Could not parse JSON!\n");
		return -1;
	} else {
		cJSON *method;
		const char *method_string;
		uint32_t parsed_length = end_parse - msg;
		if (unlikely(parsed_length != length)) {
			fprintf(stderr, "length of parsed JSON does not match message length!\n");
			return -1;
		}
		method = cJSON_GetObjectItem(root, "method");
		if (unlikely(method == NULL)) {
			goto no_method;
		}
		method_string = method->valuestring;
		if (unlikely(method_string == NULL)) {
			goto no_method;
		}

		if (strcmp(method_string, "set") == 0) {

		} else if (strcmp(method_string, "post") == 0) {

		} else if (strcmp(method_string, "add") == 0) {

		} else if (strcmp(method_string, "remove") == 0) {

		} else if (strcmp(method_string, "call") == 0) {

		} else if (strcmp(method_string, "fetch") == 0) {

		} else if (strcmp(method_string, "unfetch") == 0) {

		} else {
			fprintf(stderr, "Unsupported method: %s!\n", method_string);
			goto unsupported_method;
		}
		cJSON_Delete(root);
		return 0;

	no_method:
		fprintf(stderr, "Can not find supported method!\n");
	unsupported_method:
		cJSON_Delete(root);
		return -1;
	}
}

Add trampoline code to call function withn respect to the incoming JSON method.


/*
 * Copyright 2015 Google, Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

// FIXME: Workaround for skbug.com/4037
// Some of our test machines have an older version of clang that does not
// have
//    __builtin_bswap16
//
// But libwebp expects the builtin. We can change that by using this config.h
// file, which replaces the checks in endian_inl.h to decide whether we have
// particular builtins.

#ifdef __builtin_bswap64(x)
    #define HAVE_BUILTIN_BSWAP64
#endif

#ifdef __builtin_bswap32(x)
    #define HAVE_BUILTIN_BSWAP32
#endif

#ifdef __builtin_bswap16(x)
    #define HAVE_BUILTIN_BSWAP16
#endif

/*
 * Copyright 2015 Google, Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

// FIXME: Workaround for skbug.com/4037
// Some of our test machines have an older version of clang that does not
// have
//    __builtin_bswap16
//
// But libwebp expects the builtin. We can change that by using this config.h
// file, which replaces the checks in endian_inl.h to decide whether we have
// particular builtins.

#ifdef __builtin_bswap64
    #define HAVE_BUILTIN_BSWAP64
#endif

#ifdef __builtin_bswap32
    #define HAVE_BUILTIN_BSWAP32
#endif

#ifdef __builtin_bswap16
    #define HAVE_BUILTIN_BSWAP16
#endif

Fix webp compile warnings on windows

Fix webp compile warnings on windows

This fix was landed with:
https://codereview.chromium.org/1280073002/

The above CL was reverted due to an unrelated bug in libwebp.

The above CL contains multiple components, and I think that
reverting this part of the change was unintentional.

BUG=skia:

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


#ifndef MYTHREAD_H
#define MYTHREAD_H

#include <QThread>
#include "easylogging++.h"

class MyThread : public QThread {
  Q_OBJECT
  public:
    MyThread(int id) : threadId(id) {}
  private:
    int threadId;

  protected:
    void run() {
      LINFO <<"Writing from a thread " << threadId;

      LVERBOSE(2) << "This is verbose level 2 logging from thread #" << threadId;

      // Following line will be logged only once from second running thread (which every runs second into
      // this line because of interval 2)
      LWARNING_EVERY_N(2) << "This will be logged only once from thread who every reaches this line first. Currently running from thread #" << threadId;

      for (int i = 1; i <= 10; ++i) {
          LVERBOSE_EVERY_N(2, 3) << "Verbose level 3 log every two times. This is at " << i << " from thread #" << threadId;
      }

      // Following line will be logged once with every thread because of interval 1
      LINFO_EVERY_N(1) << "This interval log will be logged with every thread, this one is from thread #" << threadId;

      LINFO_IF(threadId == 2) << "This log is only for thread 2 and is ran by thread #" << threadId;

      std::vector<std::string> myLoggers;
      easyloggingpp::Loggers::getAllLogIdentifiers(myLoggers);
      for (unsigned int i = 0; i < myLoggers.size(); ++i) {
          std::cout << "Logger ID [" << myLoggers.at(i) << "]";
      }
      easyloggingpp::Configurations c;
      c.parseFromText("*ALL:\n\nFORMAT = %level");
    }
};
#endif

#ifndef MYTHREAD_H
#define MYTHREAD_H

#include <QThread>
#include "easylogging++.h"

class MyThread : public QThread {
  Q_OBJECT
  public:
    MyThread(int id) : threadId(id) {}
  private:
    int threadId;

  protected:
    void run() {
      LINFO <<"Writing from a thread " << threadId;

      LVERBOSE(2) << "This is verbose level 2 logging from thread #" << threadId;

      // Following line will be logged only once from second running thread (which every runs second into
      // this line because of interval 2)
      LWARNING_EVERY_N(2) << "This will be logged only once from thread who every reaches this line first. Currently running from thread #" << threadId;

      for (int i = 1; i <= 10; ++i) {
          LVERBOSE_EVERY_N(2, 3) << "Verbose level 3 log every two times. This is at " << i << " from thread #" << threadId;
      }

      // Following line will be logged once with every thread because of interval 1
      LINFO_EVERY_N(1) << "This interval log will be logged with every thread, this one is from thread #" << threadId;

      LINFO_IF(threadId == 2) << "This log is only for thread 2 and is ran by thread #" << threadId;

    }
};
#endif

Remove logger ids loop from sample

Remove logger ids loop from sample


#ifndef OI_OS
#define OI_OS 1

#if defined(_WIN32) || defined(__WIN32__)
#   define OI_WIN

#   ifdef _MSC_VER
#   define OI_MSVC
#   else
#   define OI_GCC
#   endif

#   ifndef WIN32_LEAN_AND_MEAN
#   define WIN32_LEAN_AND_MEAN
#   endif

#   include <windows.h>

#elif defined(linux) || defined(__linux)
#   define OI_LINUX
#   define OI_GCC

#   ifndef _XOPEN_SOURCE
#   define _XOPEN_SOURCE 500
#   endif

#   ifndef __USE_UNIX98
#   define __USE_UNIX98
#   endif

#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
#   define OI_MAC
#   define OI_GCC

#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#   define OI_FreeBSD
#   define OI_GCC

#else
#   warning oi does not recognize OS
#   define OI_UNKNOWN_OS
#   define OI_UNKNOWN_COMPILER
#endif
#endif

#ifndef OI_OS
#define OI_OS 1

#if defined(__GNUC__)
#   define OI_GCC
#elif defined(_MSC_VER)
#   define OI_MSVC
#else
#   warning oi does not recognize compiler
#   define OI_UNKNOWN_CC
#endif

#if defined(_WIN32) || defined(__WIN32__)
#   define OI_WIN
#
#   ifndef WIN32_LEAN_AND_MEAN
#   define WIN32_LEAN_AND_MEAN
#   endif
#
#   include <windows.h>
#
#elif defined(linux) || defined(__linux)
#   define OI_LINUX
#
#   ifndef _XOPEN_SOURCE
#   define _XOPEN_SOURCE 500
#   endif
#
#   ifndef __USE_UNIX98
#   define __USE_UNIX98
#   endif
#
#elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
#   define OI_MAC
#
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
#   define OI_FreeBSD
#
#else
#   warning oi does not recognize OS
#   define OI_UNKNOWN_OS
#endif
#endif

Set up actual compiler detections. Only supports gcc and msvc at the moment


#include <errno.h>
#include <unistd.h>
#include "iobuf.h"

static const char errmsg[] = "ibuf_refill called with non-empty buffer!\n";

int ibuf_refill(ibuf* in)
{
  iobuf* io;
  unsigned oldlen;
  unsigned rd;

  io = &(in->io);
  if (io->flags) return 0;
  if (io->bufstart != 0) {
    if (io->bufstart < io->buflen) {
      write(1, errmsg, sizeof errmsg);
      exit(1);
      /* io->buflen -= io->bufstart; */
      /* memcpy(io->buffer, io->buffer+io->bufstart, io->buflen); */
    }
    else
      io->buflen = 0;
    io->bufstart = 0;
  }
  oldlen = io->buflen;
  if(io->buflen < io->bufsize) {
    if (io->timeout && !iobuf_timeout(io, 0)) return 0;
    rd = read(io->fd, io->buffer+io->buflen, io->bufsize-io->buflen);
    if(rd == (unsigned)-1)
      IOBUF_SET_ERROR(io);
    else if(rd == 0)
      io->flags |= IOBUF_EOF;
    else {
      io->buflen += rd;
      io->offset += rd;
    }
  }
  return io->buflen > oldlen;
}

#include <errno.h>
#include <unistd.h>
#include "iobuf.h"

static const char errmsg[] = "ibuf_refill called with non-empty buffer!\n";

int ibuf_refill(ibuf* in)
{
  iobuf* io;
  unsigned oldlen;
  unsigned rd;

  io = &(in->io);
  if (io->flags) return 0;
  if (io->bufstart != 0) {
    if (io->bufstart < io->buflen) {
      write(1, errmsg, sizeof errmsg);
      _exit(1);
      /* io->buflen -= io->bufstart; */
      /* memcpy(io->buffer, io->buffer+io->bufstart, io->buflen); */
    }
    else
      io->buflen = 0;
    io->bufstart = 0;
  }
  oldlen = io->buflen;
  if(io->buflen < io->bufsize) {
    if (io->timeout && !iobuf_timeout(io, 0)) return 0;
    rd = read(io->fd, io->buffer+io->buflen, io->bufsize-io->buflen);
    if(rd == (unsigned)-1)
      IOBUF_SET_ERROR(io);
    else if(rd == 0)
      io->flags |= IOBUF_EOF;
    else {
      io->buflen += rd;
      io->offset += rd;
    }
  }
  return io->buflen > oldlen;
}

Call _exit instead of exit on assertion failure.


/*
 * Wrapper to run the svnserve process setgid.
 * The idea is to avoid the problem that some interpreters like bash
 * invoked by svnserve in hook scripts will reset the effective gid to
 * the real gid, nuking the effect of an ordinary setgid svnserve binary.
 * Sadly, to set the real gid portably, you need to be root, if only
 * for a moment.
 * Also smashes the environment to something known, so that games
 * can't be played to try to break the security of the hook scripts,
 * by setting IFS, PATH, and similar means.
 */
/*
 * Written by Perry Metzger, and placed into the public domain.
 */

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

#define REAL_PATH "/usr/bin/svnserve.real"

char *newenv[] = { "PATH=/bin:/usr/bin", "SHELL=/bin/sh", NULL };

int
main(int argc, char **argv)
{
	if (setgid(getegid()) == -1) {
		perror("setgid(getegid())");
		return 1;
	}

	if (seteuid(getuid()) == -1) {
		perror("seteuid(getuid())");
		return 1;
	}

	execve(REAL_PATH, argv, newenv);
	perror("attempting to exec " REAL_PATH " failed");
	return 1;
}

Add Perry Metzger's wrapper to run the svnserve process setgid,
since this can be very helpful to svn+ssh users.  Quoting from the
comments:

 * The idea is to avoid the problem that some interpreters like bash
 * invoked by svnserve in hook scripts will reset the effective gid to
 * the real gid, nuking the effect of an ordinary setgid svnserve binary.
 * Sadly, to set the real gid portably, you need to be root, if only
 * for a moment.
 * Also smashes the environment to something known, so that games
 * can't be played to try to break the security of the hook scripts,
 * by setting IFS, PATH, and similar means.

* tools/examples/svnserve-sgid.c:  new file.

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


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

#pragma once

#if defined (_WINDOWS)
#if defined(WEBSOCKET_MODULE_EXPORTS)
#define WEBSOCKET_SERVER_MODULE_API __declspec(dllexport)
#else
#define WEBSOCKET_SERVER_MODULE_API __declspec(dllimport)
#endif
#else
#define WEBSOCKET_MODULE_API
#endif

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

#pragma once

#if defined (_WINDOWS)
#if defined(WEBSOCKET_MODULE_EXPORTS)
#define WEBSOCKET_SERVER_MODULE_API __declspec(dllexport)
#else
#define WEBSOCKET_SERVER_MODULE_API __declspec(dllimport)
#endif
#else
#define WEBSOCKET_SERVER_MODULE_API
#endif

Correct macro spelling to fix Linux build


#include <mbstr.h>
#include <stdlib.h>
#include "../intern.h"

#ifdef __cplusplus
extern "C" {
#endif

char* __mbschr (char* str, mbchar_t c)
{
    if (c < 0x80) {
        return __strchr(str, c);
    }
    else {
        char buf[sizeof(mbchar_t)+1];
        *((mbchar_t*)buf) = c;
        buf[__min(sizeof(mbchar_t),MBMAXLEN)] = '\0';
        return __strstr(str, buf);
    }
}

char* mbschr (char* str, mbchar_t c) \
    _WEAK_ALIAS_OF("__mbschr");

#ifdef __cplusplus
}
#endif

#include <mbstr.h>
#include <stdlib.h>
#include "../intern.h"

#ifdef __cplusplus
extern "C" {
#endif

char* __mbschr (char* str, mbchar_t c)
{
    if (c < 0x80) {
        return __strchr(str, c);
    }
    else {
        char buf[sizeof(mbchar_t)+1];
        *((mbchar_t*)buf) = c;
        buf[__min(sizeof(mbchar_t),(size_t)MBMAXLEN)] = '\0';
        return __strstr(str, buf);
    }
}

char* mbschr (char* str, mbchar_t c) \
    _WEAK_ALIAS_OF("__mbschr");

#ifdef __cplusplus
}
#endif

Fix compilation error, cast was missing

Fix compilation error, cast was missing


// Takes in a character at a time and sends it right back out,
// displaying the ASCII value on the LEDs.
// Uses interrupt system instead of a blocking read.

#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/delay.h>
#include "USART.h"

// Single character for serial TX/RX and "byte received" flag
volatile char a;
volatile uint8_t newbyte;

// Run when USART receives a new byte.
// Reading from and writing to UDR0 trigger critical side-effects.
// UDR0 *must* be read inside this ISR.
// Otherwise, RXC0 will not be cleared, and another interrupt will follow.
// See 20.7.3 in the datasheet.
ISR(USART_RX_vect)
{
  a = UDR0; // Assigning to an lvalue also clears RXC0
  UDR0 = a; // Writes to TX shift register (echoes a back out)
  newbyte = 1;
}

int main(void)
{
  initUSART();

  // Set the RX Complete Interrupt Enable 0 bit
  UCSR0B |= (1 << RXCIE0);
  sei();

  // All DDRB pins to output mode
  DDRB = 0xff;

  newbyte = 0;
  while (1)
  {
    // Light up PORTB in the ASCII binary representation of a
    if (newbyte)
    {
      PORTB = a;
      newbyte = 0;
    }
  }

  return 0;
}

Use ISR for serial loopback instead of a blocking read


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

#pragma once

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

Increment version number to 1.32

Increment version number to 1.32


// PARAM: --enable ana.int.def_exc --enable ana.int.interval
// ldv-benchmarks: u__linux-concurrency_safety__drivers---net---ethernet---amd---pcnet32.ko.c
#include <assert.h>

int main() {
  int debug_value = -1;

  if ((unsigned int)debug_value > 31U)
    assert(1); // reachable
  else
    assert(1); // NOWARN (unreachable)

  return 0;
}

Add unsound negative int to unsigned int branch invariant test


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

#ifndef LockCppH__
#define LockCppH__

#include <memory>

namespace Wombat {

class COMMONExpDLL Lock
{
public:
    Lock       ();
    ~Lock      ();

    void lock   ();
    void unlock ();
private:
    Lock (const Lock& copy);    // no copy
    Lock& operator= (const Lock& rhs); // no assignment

    struct LockImpl;
    std::auto_ptr <LockImpl> mImpl;
};

}
#endif

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

#ifndef LockCppH__
#define LockCppH__

#include <memory>
#include "wombat/wConfig.h"

namespace Wombat {

class COMMONExpDLL Lock
{
public:
    Lock       ();
    ~Lock      ();

    void lock   ();
    void unlock ();
private:
    Lock (const Lock& copy);    // no copy
    Lock& operator= (const Lock& rhs); // no assignment

    struct LockImpl;
    std::auto_ptr <LockImpl> mImpl;
};

}
#endif

Build error when openmama patch for VS solution files caused Enterprise build fail.

Modification to Lock.h to correct build error when openmama patch for
Microsoft Visual Studio solution file updates caused Enterprise build to
fail.

Signed-off-by: A Ambrose <adf778e8f047b26f3e0544674b3bfe8e328348f7@nyx.com>


// 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 CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_
#define CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_
#pragma once

class TabContents;

namespace content {

class DevToolsFrontendWindowDelegate;

// Installs delegate for DevTools front-end loaded into |client_tab_contents|.
void SetupDevToolsFrontendDelegate(
    TabContents* client_tab_contents,
    DevToolsFrontendWindowDelegate* delegate);

}

#endif  // CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_

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

#ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_
#define CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_
#pragma once

class TabContents;

namespace content {

class DevToolsFrontendWindowDelegate;

// Installs delegate for DevTools front-end loaded into |client_tab_contents|.
CONTENT_EXPORT void SetupDevToolsFrontendDelegate(
    TabContents* client_tab_contents,
    DevToolsFrontendWindowDelegate* delegate);

}

#endif  // CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_

Add missing CONTENT_EXPORT to fix Linux shared build after r112415

BUG=104625
TEST=None
TBR=pfeldman

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

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


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

#ifndef _BDROID_BUILDCFG_H
#define _BDROID_BUILDCFG_H

#define BTA_DISABLE_DELAY 100 /* in milliseconds */

#define BLE_VND_INCLUDED TRUE
#define BTM_BLE_ADV_TX_POWER {-21, -15, -7, 1, 9}

/* Defined if the kernel does not have support for CLOCK_BOOTTIME_ALARM */
#define KERNEL_MISSING_CLOCK_BOOTTIME_ALARM TRUE
#endif

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

#ifndef _BDROID_BUILDCFG_H
#define _BDROID_BUILDCFG_H

#define BTA_DISABLE_DELAY 100 /* in milliseconds */

#define BLE_VND_INCLUDED TRUE
#define BTM_BLE_ADV_TX_POWER {-21, -15, -7, 1, 9}
#endif

Revert "bluetooth: Our kernel is missing CLOCK_BOOTTIME_ALARM (alarmtimer)"

This reverts commit 69cbe06c3c482cf78fa71b7e89c470ab83626523.

Change-Id: I34af7e9f564dd88654e105ea36d4a83d15d9acad


// Copyright 2016 Pierre Fourgeaud

#ifndef PF_CONSOLELOGGER_H_
#define PF_CONSOLELOGGER_H_

#include <iostream>
#include <string>
#include "./iloglistener.h"
#include "./Logger.h"

/**
 * @brief The FileLogger class
 *
 * Logger that will write the ouput to the console (cerr or cout depending on log level)
 */
class ConsoleLogger : public ILogListener {
public:
    ConsoleLogger() {}

    /**
     * Virtual destructor
     */
    virtual ~ConsoleLogger() {}

    /**
     * @brief Notify Mandatory method to implement for every log listener.
     *        Will be called everytime there is a new message to ouput it to the console.
     *
     *        if iLevel Critical or Error, output to cerr, otherwise to cout
     *
     * @param iLog The message
     * @param iLevel The log level
     */
    virtual void Notify(const std::string& iMsg, ELogLevel iLevel) {
        if (iLevel <= ELogLevel::Error) {
            std::cerr << iMsg;
        } else {
            std::cout << iMsg;
        }
    }
};

#endif // PF_CONSOLELOGGER_H_

// Copyright 2016 Pierre Fourgeaud

#ifndef PF_CONSOLELOGGER_H_
#define PF_CONSOLELOGGER_H_

#include <iostream>
#include <string>
#include "./iloglistener.h"
#include "./logger.h"

/**
 * @brief The FileLogger class
 *
 * Logger that will write the ouput to the console (cerr or cout depending on log level)
 */
class ConsoleLogger : public ILogListener {
public:
    ConsoleLogger() {}

    /**
     * Virtual destructor
     */
    virtual ~ConsoleLogger() {}

    /**
     * @brief Notify Mandatory method to implement for every log listener.
     *        Will be called everytime there is a new message to ouput it to the console.
     *
     *        if iLevel Critical or Error, output to cerr, otherwise to cout
     *
     * @param iLog The message
     * @param iLevel The log level
     */
    virtual void Notify(const std::string& iMsg, ELogLevel iLevel) {
        if (iLevel <= ELogLevel::Error) {
            std::cerr << iMsg;
        } else {
            std::cout << iMsg;
        }
    }
};

#endif // PF_CONSOLELOGGER_H_

Fix typo in include file

Fix typo in include file


#include<stdio.h>
#include<assert.h>

int main () {
  int i,j,k;

  i = k = 0; j = 7;
  while (i < 10) {
    i++;
    j = 7;
    k = 5;
  }
  assert(i == 10); // UNKNOWN!
  assert(k);  // UNKNOWN!
  // k is currenlty 0 \sqcup 5, if we unfolded the loops it would be 5
  assert(j==7);
  return 0;
}

#include<stdio.h>
#include<assert.h>

int main () {
  int i,j,k;

  i = k = 0; j = 7;
  while (i < 10) {
    i++;
    j = 7;
    k = 5;
  }
  // assert(i == 10); // UNKNOWN!
  // Removed this assertion as it is specific to flat ints and fails as soon as intervals or octagons correctly determine this
  assert(k);  // UNKNOWN!
  // k is currenlty 0 \sqcup 5, if we unfolded the loops it would be 5
  assert(j==7);
  return 0;
}

Remove assert specific to flat ints that will fail when using more poerful domain


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

#include <wocky/wocky-xmpp-connection.h>
#include <wocky/wocky-transport.h>
#include "test-transport.h"

#include <check.h>

START_TEST (test_instantiation)
{
  WockyXmppConnection *connection;
  TestTransport *transport;

  g_type_init();

  transport = test_transport_new(NULL, NULL);
  connection = wocky_xmpp_connection_new(WOCKY_TRANSPORT(transport));

  fail_if (connection == NULL);

  connection = wocky_xmpp_connection_new(NULL);

  fail_if (connection == NULL);
}
END_TEST

TCase *
make_wocky_xmpp_connection_tcase (void)
{
    TCase *tc = tcase_create ("XMPP Connection");
    tcase_add_test (tc, test_instantiation);
    return tc;
}

Add a testcase for WockyXmppConnection and check its istantiation

20070613140235-f974e-38a23919dc403a05ad6852760c6b13bd9ad2e6f5.gz


#ifndef	IO_PIPE_PAIR_SIMPLE_H
#define	IO_PIPE_PAIR_SIMPLE_H

#include <io/pipe_simple.h>
#include <io/pipe_simple_wrapper.h>

class PipePairSimple : public PipePair {
	PipeSimpleWrapper<PipePairSimple> *incoming_pipe_;
	PipeSimpleWrapper<PipePairSimple> *outgoing_pipe_;
protected:
	PipePairSimple(void)
	: incoming_pipe_(NULL),
	  outgoing_pipe_(NULL)
	{ }
public:
	virtual ~PipePairSimple()
	{
		if (incoming_pipe_ != NULL) {
			delete incoming_pipe_;
			incoming_pipe_ = NULL;
		}

		if (outgoing_pipe_ != NULL) {
			delete outgoing_pipe_;
			outgoing_pipe_ = NULL;
		}
	}

protected:
	virtual bool incoming_process(Buffer *, Buffer *) = 0;
	virtual bool outgoing_process(Buffer *, Buffer *) = 0;

public:
	Pipe *get_incoming(void)
	{
		ASSERT(incoming_pipe_ == NULL);
		incoming_pipe_ = new PipeSimpleWrapper<PipePairSimple>(this, &PipePairSimple::incoming_process);
		return (incoming_pipe_);
	}

	Pipe *get_outgoing(void)
	{
		ASSERT(outgoing_pipe_ == NULL);
		outgoing_pipe_ = new PipeSimpleWrapper<PipePairSimple>(this, &PipePairSimple::outgoing_process);
		return (outgoing_pipe_);
	}
};

#endif /* !IO_PIPE_PAIR_SIMPLE_H */

Add PipePairSimple which allows a user to simply construct a single object which implements a PipePair.


////////////////////////////////////////////////////////////////////////////////
//
//  JASPER BLUES
//  Copyright 2012 Jasper Blues
//  All Rights Reserved.
//
//  NOTICE: Jasper Blues permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

#import "XCAbstractDefinition.h"
#import "XCGroup.h"
#import "XCClassDefinition.h"
#import "XCFileOperationQueue.h"
#import "XCFrameworkDefinition.h"
#import "XCProject.h"
#import "XCSourceFile.h"
#import "XCSourceFileDefinition.h"
#import "XCSubProjectDefinition.h"
#import "XCTarget.h"
#import "XCEnumUtils.h"
#import "XCXibDefinition.h"

////////////////////////////////////////////////////////////////////////////////
//
//  JASPER BLUES
//  Copyright 2012 Jasper Blues
//  All Rights Reserved.
//
//  NOTICE: Jasper Blues permits you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

#import "XCAbstractDefinition.h"
#import "XCGroup.h"
#import "XCClassDefinition.h"
#import "XCFileOperationQueue.h"
#import "XCFrameworkDefinition.h"
#import "XCProject.h"
#import "XCSourceFile.h"
#import "XCSourceFileDefinition.h"
#import "XCSubProjectDefinition.h"
#import "XCTarget.h"
#import "XCXibDefinition.h"

Remove item from umbrella header.

Remove item from umbrella header.


#ifndef MACRO_H_
#define MACRO_H_

#include <stdio.h>

#define HEX_PRINT(X,Y) { int zz; for(zz = 0; zz < Y; zz++) fprintf(stderr, "%02X", X[zz]); fprintf(stderr, "\n"); }
#define MKINT_BE16(X) ( (X)[0] << 8 | (X)[1] )
#define MKINT_BE24(X) ( (X)[0] << 16 | (X)[1] << 8 | (X)[2] )
#define MKINT_BE32(X) ( (X)[0] << 24 | (X)[1] << 16 |  (X)[2] << 8 | (X)[3] )
#define X_FREE(X) do { if (X) free(X); X = NULL; } while(0)

#endif /* MACRO_H_ */

Include required header in source

Include required header in source


//
//  ETA_ModelObject.h
//  ETA-SDK
//
//  Created by Laurie Hufford on 7/11/13.
//  Copyright (c) 2013 eTilbudsavis. All rights reserved.
//

#import "Mantle.h"

#import "NSValueTransformer+ETAPredefinedValueTransformers.h"

@interface ETA_ModelObject : MTLModel <MTLJSONSerializing>

// setting either uuid or ern will keep the other updated
@property (nonatomic, readwrite, strong) NSString* uuid; // will always be lowercase, no matter the input case
@property (nonatomic, readwrite, strong) NSString* ern;

+ (NSString*) APIEndpoint; // base class returns nil.
+ (NSString*) ernForItemID:(NSString*)itemID; //uses the API Endpoint to generate the ern

+ (instancetype) objectFromJSONDictionary:(NSDictionary*)JSONDictionary;
- (NSDictionary*) JSONDictionary;

+ (NSArray*) objectsFromJSONArray:(NSArray*)JSONArray;

@end

//
//  ETA_ModelObject.h
//  ETA-SDK
//
//  Created by Laurie Hufford on 7/11/13.
//  Copyright (c) 2013 eTilbudsavis. All rights reserved.
//

#import "Mantle.h"

#import "NSValueTransformer+ETAPredefinedValueTransformers.h"

@interface ETA_ModelObject : MTLModel <MTLJSONSerializing>

// setting either uuid or ern will keep the other updated
@property (nonatomic, readwrite, strong, nonnull) NSString* uuid; // will always be lowercase, no matter the input case
@property (nonatomic, readwrite, strong, nonnull) NSString* ern;

+ (nullable NSString*) APIEndpoint; // base class returns nil.
+ (nullable NSString*) ernForItemID:(nullable NSString*)itemID; //uses the API Endpoint to generate the ern

+ (nullable instancetype) objectFromJSONDictionary:(nullable NSDictionary*)JSONDictionary;
- (nullable NSDictionary*) JSONDictionary;

+ (nullable NSArray*) objectsFromJSONArray:(nullable NSArray*)JSONArray;

@end

Add nullability info to root ModelObject


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

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

@class BDSKServerInfo;

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

@end

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

git-svn-id: cb3fc60f0f557b927b8032d8a94e869b6f9f230b@336 0fceea05-a30d-0410-8a8b-80ef821fb0a1


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

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

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

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

Update driver version to 8.07.00.18-k

qla2xxx: Update driver version to 8.07.00.18-k

Signed-off-by: Giridhar Malavali <799b6491fce2c7a80b5fedcf9a728560cc9eb954@qlogic.com>
Signed-off-by: Himanshu Madhani <a1599b7f51f3890722b2125e7c07879c181c9399@qlogic.com>
Reviewed-by: Hannes Reinecke <b0d1e9e4a4e27620745ff49be9000da3174a4cc6@suse.de>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Odin.com>


//
//  DemoViewController.h
//  REMarkerClustererExample
//
//  Created by Roman Efimov on 7/9/12.
//  Copyright (c) 2012 Roman Efimov. All rights reserved.
//

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

@interface DemoViewController : UIViewController <MKMapViewDelegate>

@property (strong, readonly, nonatomic) MKMapView *mapView;
@property (strong, readonly, nonatomic) REMarkerClusterer *clusterer;

@end

//
//  DemoViewController.h
//  REMarkerClustererExample
//
//  Created by Roman Efimov on 7/9/12.
//  Copyright (c) 2012 Roman Efimov. All rights reserved.
//

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

@interface DemoViewController : UIViewController <REMarkerClusterDelegate>

@property (strong, readonly, nonatomic) MKMapView *mapView;
@property (strong, readonly, nonatomic) REMarkerClusterer *clusterer;

@end

Rename delegate from MKMapViewDelegate to REMarkerClusterDelegate


// ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------

#ifndef WindowsAzureMobileServices_WindowsAzureMobileServices_h
#define WindowsAzureMobileServices_WindowsAzureMobileServices_h

#import "MSClient.h"
#import "MSTable.h"
#import "MSQuery.h"
#import "MSUser.h"
#import "MSFilter.h"
#import "MSError.h"
#import "MSLoginController.h"
#import "MSPush.h"

#define WindowsAzureMobileServicesSdkMajorVersion 1
#define WindowsAzureMobileServicesSdkMinorVersion 1
#define WindowsAzureMobileServicesSdkBuildVersion 0

#endif

// ----------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// ----------------------------------------------------------------------------

#ifndef WindowsAzureMobileServices_WindowsAzureMobileServices_h
#define WindowsAzureMobileServices_WindowsAzureMobileServices_h

#import "MSClient.h"
#import "MSTable.h"
#import "MSQuery.h"
#import "MSUser.h"
#import "MSFilter.h"
#import "MSError.h"
#import "MSLoginController.h"
#import "MSPush.h"

#define WindowsAzureMobileServicesSdkMajorVersion 1
#define WindowsAzureMobileServicesSdkMinorVersion 2
#define WindowsAzureMobileServicesSdkBuildVersion 0

#endif

Update iOS SDK Minor Version

Update iOS SDK Minor Version


#include <stdio.h>
#include <stdlib.h> /* for free */
#include <string.h> /* for strcmp */
#include <strings.h>

#include <platform/cbassert.h>

static void test_asprintf(void) {
    char *result = 0;
    (void)asprintf(&result, "test 1");
    cb_assert(strcmp(result, "test 1") == 0);
    free(result);

    (void)asprintf(&result, "test %d", 2);
    cb_assert(strcmp(result, "test 2") == 0);
    free(result);

    (void)asprintf(&result, "%c%c%c%c %d", 't', 'e', 's', 't', 3);
    cb_assert(strcmp(result, "test 3") == 0);
    free(result);
}

int main(void) {
    test_asprintf();
    return 0;
}

#include <stdio.h>
#include <stdlib.h> /* for free */
#include <string.h> /* for strcmp */
#include <strings.h>

#include <platform/cbassert.h>

static void test_asprintf(void) {
    char *result = 0;
    cb_assert(asprintf(&result, "test 1") > 0);
    cb_assert(strcmp(result, "test 1") == 0);
    free(result);

    cb_assert(asprintf(&result, "test %d", 2) > 0);
    cb_assert(strcmp(result, "test 2") == 0);
    free(result);

    cb_assert(asprintf(&result, "%c%c%c%c %d", 't', 'e', 's', 't', 3) > 0);
    cb_assert(strcmp(result, "test 3") == 0);
    free(result);
}

int main(void) {
    test_asprintf();
    return 0;
}

Check for return value for asprintf

Check for return value for asprintf

Change-Id: Ib163468aac1a5e52cef28c59b55be2287dc4ba43
Reviewed-on: http://review.couchbase.org/43023
Reviewed-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>
Tested-by: Trond Norbye <60edd2ef23891a753f231b0c6f161dc634079a93@gmail.com>


#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H

//
// client versioning and copyright year
//

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

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE  true

// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2021

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

#endif // CLIENTVERSION_H

#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H

//
// client versioning and copyright year
//

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

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE  true

// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2021

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

#endif // CLIENTVERSION_H

Mark Devcoin release version 0.8.9.0.

Mark Devcoin release version 0.8.9.0.


/*
* Base class for message authentiction codes
* (C) 1999-2007 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/

#ifndef BOTAN_MESSAGE_AUTH_CODE_BASE_H__
#define BOTAN_MESSAGE_AUTH_CODE_BASE_H__

#include <botan/buf_comp.h>
#include <botan/sym_algo.h>
#include <botan/scan_name.h>
#include <string>

namespace Botan {

/**
* This class represents Message Authentication Code (MAC) objects.
*/
class BOTAN_DLL MessageAuthenticationCode : public Buffered_Computation,
                                            public SymmetricAlgorithm
   {
   public:
      /**
      * Verify a MAC.
      * @param in the MAC to verify as a byte array
      * @param length the length of param in
      * @return true if the MAC is valid, false otherwise
      */
      virtual bool verify_mac(const byte in[], size_t length);

      /**
      * Get a new object representing the same algorithm as *this
      */
      virtual MessageAuthenticationCode* clone() const = 0;

      /**
      * Get the name of this algorithm.
      * @return name of this algorithm
      */
      virtual std::string name() const = 0;

      typedef SCAN_Name Spec;
   };

}

#endif

/*
* Base class for message authentiction codes
* (C) 1999-2007 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/

#ifndef BOTAN_MESSAGE_AUTH_CODE_BASE_H__
#define BOTAN_MESSAGE_AUTH_CODE_BASE_H__

#include <botan/buf_comp.h>
#include <botan/sym_algo.h>
#include <botan/scan_name.h>
#include <string>

namespace Botan {

/**
* This class represents Message Authentication Code (MAC) objects.
*/
class BOTAN_DLL MessageAuthenticationCode : public Buffered_Computation,
                                            public SymmetricAlgorithm
   {
   public:
      /**
      * Verify a MAC.
      * @param in the MAC to verify as a byte array
      * @param length the length of param in
      * @return true if the MAC is valid, false otherwise
      */
      virtual bool verify_mac(const byte in[], size_t length);

      /**
      * Get a new object representing the same algorithm as *this
      */
      virtual MessageAuthenticationCode* clone() const = 0;

      typedef SCAN_Name Spec;
   };

}

#endif

Remove duplicate definition of MessageAuthenticationCode::name()

The original definition is in the base class SymmetricAlgorithm.


#ifndef _SHAKE_H_
#define _SHAKE_H_

#include "shake_private.h"

struct shakeDev;

/* libShake functions */
int shakeInit();
void shakeQuit();
void shakeListDevices();
int shakeNumOfDevices();
shakeDev *shakeOpen(unsigned int id);
void shakeClose(shakeDev *dev);
int shakeQuery(shakeDev *dev);
void shakeSetGain(shakeDev *dev, int gain);
void shakeInitEffect(shakeEffect *effect, shakeEffectType type);
int shakeUploadEffect(shakeDev *dev, shakeEffect effect);
void shakeEraseEffect(shakeDev *dev, int id);
void shakePlay(shakeDev *dev, int id);
void shakeStop(shakeDev *dev, int id);

#endif /* _SHAKE_H_ */

#ifndef _SHAKE_H_
#define _SHAKE_H_

#ifdef __cplusplus
extern "C" {
#endif

#include "shake_private.h"

struct shakeDev;

/* libShake functions */
int shakeInit();
void shakeQuit();
void shakeListDevices();
int shakeNumOfDevices();
shakeDev *shakeOpen(unsigned int id);
void shakeClose(shakeDev *dev);
int shakeQuery(shakeDev *dev);
void shakeSetGain(shakeDev *dev, int gain);
void shakeInitEffect(shakeEffect *effect, shakeEffectType type);
int shakeUploadEffect(shakeDev *dev, shakeEffect effect);
void shakeEraseEffect(shakeDev *dev, int id);
void shakePlay(shakeDev *dev, int id);
void shakeStop(shakeDev *dev, int id);

#ifdef __cplusplus
}
#endif

#endif /* _SHAKE_H_ */

Use C calling convention when header is included by C++ code


#! /usr/bin/tcc -run

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

typedef struct slot
{
    ssize_t size;
    char *row;
}   slot;

    slot line;
    slot *text;

    char *ptr;

int main(void) {

    ptr = "this is my story";

    line.row = ptr;
    line.size = strlen(ptr);

    text = malloc(10*sizeof(slot));

    text[0] = line;
    printf("text[0].row = %s\n",text[0].row);

    ptr = "this is my song";
    line.row = ptr;
    line.size = strlen(ptr);

    text[1] = line;
    printf("text[1].row = %s\n",text[1].row);
    printf("text[0].row = %s\n",text[0].row);

    ptr = "tell me your song";
    line.row = ptr;
    line.size = strlen(ptr);

    text[3] = line;
    printf("text[3].row = %s\n",text[3].row);

    return 0;
}

#! /usr/bin/tcc -run

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

typedef struct slot
{
    ssize_t size;
    char *row;
}   slot;

    slot line;
    slot *text;
    slot *old;
    slot *new;

    char *ptr;

int main(void) {

    text = malloc(10*sizeof(slot));
    old  = malloc(10*sizeof(slot));
    new  = malloc(10*sizeof(slot));

    ptr = "this is my story";
    line.row = ptr;
    line.size = strlen(ptr);
    text[0] = line;

    ptr = "this is my song";
    line.row = ptr;
    line.size = strlen(ptr);
    text[1] = line;

    ptr = "tell me your song";
    line.row = ptr;
    line.size = strlen(ptr);
    text[3] = line;

    printf("text[3].row = %s\n",text[3].row);

    old = text;

    int j;

    for (j = 0; j < 10; j++) {old[j] = text[j];}
    printf("old[1].row = %s\n",old[1].row);
    printf("old[3].row = %s\n",old[3].row);

    slot newline;
    ptr = "hello world";
    newline.row = ptr;
    newline.size = strlen(ptr);

    for (j = 0; j < 10; j++)
      {if (j != 3) {old[j] = text[j];}
       else        {old[j] = newline;}
      }
    printf("\n");
    printf("old[3].row = %s\n",old[3].row);
    printf("old[1].row = %s\n",old[1].row);

    return 0;
}

Add replacement functionality following initialization segment


/******************************************************************************
**
** Copyright (C) 2009-2011 Kyle Lutz <kyle.r.lutz@gmail.com>
**
** This file is part of chemkit. For more information see
** <http://www.chemkit.org>.
**
** chemkit is free software: you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** chemkit is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public License
** along with chemkit. If not, see <http://www.gnu.org/licenses/>.
**
******************************************************************************/

#ifndef CHEMKIT_POINT3_H
#define CHEMKIT_POINT3_H

#include "chemkit.h"

#include "genericpoint.h"

namespace chemkit {

/// A three-dimensional point.
typedef GenericPoint<Float> Point3;

typedef GenericPoint<float> Point3f;
typedef GenericPoint<double> Point3d;

} // end chemkit namespace

#endif // CHEMKIT_POINT3_H

/******************************************************************************
**
** Copyright (C) 2009-2011 Kyle Lutz <kyle.r.lutz@gmail.com>
**
** This file is part of chemkit. For more information see
** <http://www.chemkit.org>.
**
** chemkit is free software: you can redistribute it and/or modify
** it under the terms of the GNU Lesser General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** chemkit is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU Lesser General Public License for more details.
**
** You should have received a copy of the GNU Lesser General Public License
** along with chemkit. If not, see <http://www.gnu.org/licenses/>.
**
******************************************************************************/

#ifndef CHEMKIT_POINT3_H
#define CHEMKIT_POINT3_H

#include "chemkit.h"

#include "genericpoint.h"

namespace chemkit {

/// A three-dimensional point.
typedef GenericPoint<Float> Point3;

/// A three-dimensional point containing \c float values.
typedef GenericPoint<float> Point3f;

/// A three-dimensional point containing \c double values.
typedef GenericPoint<double> Point3d;

} // end chemkit namespace

#endif // CHEMKIT_POINT3_H

Add documentation to Point3 typedefs

Add documentation to Point3 typedefs

This adds documentation for the Point3f and Point3d
typedefs.


/* Copyright (C) 2012 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

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

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

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; see the file COPYING.LIB.  If
   not, see <http://www.gnu.org/licenses/>.  */

/* Value passed to 'clone' for initialization of the thread register.  */
#define TLS_VALUE (pd + 1)

/* Get the real implementation.  */
#include <sysdeps/pthread/createthread.c>

/* Copyright (C) 2012 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

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

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

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; see the file COPYING.LIB.  If
   not, see <http://www.gnu.org/licenses/>.  */

/* Value passed to 'clone' for initialization of the thread register.  */
#define TLS_VALUE ((void *) (pd) \
		   + TLS_PRE_TCB_SIZE + TLS_INIT_TCB_SIZE)

/* Get the real implementation.  */
#include <sysdeps/pthread/createthread.c>

Fix tls value passed during clone

or1k: Fix tls value passed during clone

From or1k-glibc from blueCmd, his commit "Fix TLS, removed too much in
rebase".

Signed-off-by: Stafford Horne <799c89d5f62c643afb21c1a3622a07adef444e16@gmail.com>


#include <pebble.h>

static void init(){
}

static void deinit(){
}

int main(void){
  init();
  app_event_loop();
  deinit();
}

#include <pebble.h>

static Window *main_window;

static void main_window_load(){
}

static void main_window_unload(){
}

static void init(){
  main_window = window_create();

  window_set_window_handlers(main_window, (WindowHandlers) {
      .load   = main_window_load,
      .unload = main_window_unload
  });

  window_stack_push(main_window, true);
}

static void deinit(){
  window_destroy(main_window);
}

int main(void){
  init();
  app_event_loop();
  deinit();
}

Create an initial blank window

Create an initial blank window


/**
 * \file   os_rmdir.c
 * \brief  Remove a subdirectory.
 * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project
 */

#include <stdlib.h>
#include "premake.h"

int os_rmdir(lua_State* L)
{
	int z;
	const char* path = luaL_checkstring(L, 1);

#if PLATFORM_WINDOWS
	z = RemoveDirectory(path);
#else
	z = rmdir(path);
#endif

	if (!z)
	{
		lua_pushnil(L);
		lua_pushfstring(L, "unable to remove directory '%s'", path);
		return 2;
	}
	else
	{
		lua_pushboolean(L, 1);
		return 1;
	}
}

/**
 * \file   os_rmdir.c
 * \brief  Remove a subdirectory.
 * \author Copyright (c) 2002-2013 Jason Perkins and the Premake project
 */

#include <stdlib.h>
#include "premake.h"

int os_rmdir(lua_State* L)
{
	int z;
	const char* path = luaL_checkstring(L, 1);

#if PLATFORM_WINDOWS
	z = RemoveDirectory(path);
#else
	z = (0 == rmdir(path));
#endif

	if (!z)
	{
		lua_pushnil(L);
		lua_pushfstring(L, "unable to remove directory '%s'", path);
		return 2;
	}
	else
	{
		lua_pushboolean(L, 1);
		return 1;
	}
}

Fix error result handling in os.rmdir()

Fix error result handling in os.rmdir()


/*
 * Copyright 2016 Adam Chyła, adam@chyla.org
 * All rights reserved. Distributed under the terms of the MIT License.
 */

#ifndef SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H
#define SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H

namespace apache
{

namespace analyzer
{

namespace detail
{

constexpr int SESSION_LENGTH = 3 * 60;

}

}

}

#endif /* SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H */

/*
 * Copyright 2016 Adam Chyła, adam@chyla.org
 * All rights reserved. Distributed under the terms of the MIT License.
 */

#ifndef SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H
#define SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H

namespace apache
{

namespace analyzer
{

namespace detail
{

constexpr int SESSION_LENGTH = 60;

}

}

}

#endif /* SRC_APACHE_ANALYZER_DETAIL_SESSION_LENGTH_H */

Change session length to 60s

Change session length to 60s


#include <stdio.h>
#include <ncurses.h>

int main() {
    // inicializa o ncurses
    initscr();

    // printa para o buffer do ncurses, note que nao foi "renderizado" ainda;
    printw("Hello World!");

    // manda para o console, "print real"
    refresh();

    // espera pelo input to usuario
    getch();

    // para o ncurses
    endwin();

    return 0;
}

Add hello world ncurses to augusto/c/trabalhos


#ifndef QUAZIP_TEST_QUAZIP_H
#define QUAZIP_TEST_QUAZIP_H

#include <QObject>

class TestQuaZip: public QObject {
    Q_OBJECT
private slots:
    void getFileList_data();
    void getFileList();
    void getZip();
};

#endif // QUAZIP_TEST_QUAZIP_H

#ifndef QUAZIP_TEST_QUAZIP_H
#define QUAZIP_TEST_QUAZIP_H

#include <QObject>

class TestQuaZip: public QObject {
    Q_OBJECT
private slots:
    void getFileList_data();
    void getFileList();
};

#endif // QUAZIP_TEST_QUAZIP_H

Remove getZip() which got there by mistake

git-svn-id: edbdc1cf2cca1c18f0f99391097ecab15c7e2ce6@113 099aeb50-083e-4d2c-9476-aff1b66fa4c7


#ifndef BASICUI_H_
#define BASICUI_H_

#include <QMainWindow>

class MainWidget;
class Workspace;

class BasicUi: public QMainWindow {

    Q_OBJECT

    public:
        BasicUi(QWidget *parent = 0);
        void setWorkspace(Workspace *);

    private:
        MainWidget *mainWidget;
        // QGridLayout  *layout;
        // QPushButton  *editModeButton;
        // EditWidget  *editWidget;
        // PlayWidget  *playWidget;
        // bool editMode;
        // Workspace *wsp;
        // Controller *controller;
};

#endif

#ifndef BASICUI_H_
#define BASICUI_H_

#include <QMainWindow>

class MainWidget;
class Workspace;

class BasicUi: public QMainWindow {

    Q_OBJECT

    public:
        BasicUi(QWidget *parent = 0);
        void setWorkspace(Workspace *);
        ~BasicUi(){
            if(NULL != mainWidget)
                delete mainWidget;
        }

    private:
        MainWidget *mainWidget;
        // QGridLayout  *layout;
        // QPushButton  *editModeButton;
        // EditWidget  *editWidget;
        // PlayWidget  *playWidget;
        // bool editMode;
        // Workspace *wsp;
        // Controller *controller;
};

#endif

Delete main widget in BasicUi

Delete main widget in BasicUi


// RUN: clang-driver -ccc-echo -o %t %s &> %t.log &&

// Make sure we used clang.
// RUN: grep 'clang" .*hello.c' %t.log &&

// RUN: %t > %t.out &&
// RUN: grep "I'm a little driver, short and stout." %t.out

#include <stdio.h>

int main() {
  printf("I'm a little driver, short and stout.");
  return 0;
}

Add simple test case to make sure driver can generate executables.
 - Hopefully Chris can pardon one executable test.

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


#include <complex>
#ifndef __hpux
using namespace std;
#endif

#pragma create TClass std::complex<int>+;
#pragma create TClass std::complex<long>+;
#pragma create TClass std::complex<float>+;
#pragma create TClass std::complex<double>+;

#ifdef G__NATIVELONGLONG
#pragma create TClass std::complex<long long>+;
// #pragma create TClass std::complex<long double>+;
#endif

Add missing new files for revision 32092

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


#include "pipe.h"

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

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

    /* Command argument vectors. */
    char *more_argv[]     = { "more", NULL };
    char *less_argv[]     = { "less", NULL };
    char *pager_argv[]    = { getenv("PAGER"), NULL };
    char *sort_argv[]     = { "sort", NULL };
    char *printenv_argv[] = { "printenv", NULL };
    char **grep_argv      = argv;
    grep_argv[0]          = "grep";

    /* Construct pipeline. */

    /*                     file             argv           err  next    fallback */
    command_t more     = { "more",          more_argv,     0,   NULL,   NULL};
    command_t less     = { "less",          less_argv,     0,   NULL,   &more };
    command_t pager    = { getenv("PAGER"), pager_argv,    0,   NULL,   &less };
    command_t sort     = { "sort",          sort_argv,     0,   &pager, NULL };
    command_t grep     = { "grep",          grep_argv,     0,   &sort,  NULL };
    command_t printenv = { "printenv",      printenv_argv, 0,   &sort,  NULL };

    if (argc > 1) {
        /* Arguments given: Run grep as well. */
        printenv.next = &grep;
    }

    /* Run pipeline. */
    run_pipeline(&printenv, STDIN_FILENO);

    return 0;
}

#include "pipe.h"

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

int main(int argc, char *argv[]) {
    char *pager_env = getenv("PAGER");

    /* Construct pipeline. */

    /*                    file        argv                        err  next    fallback */
    command_t more     = {"more",     (char *[]){"more", NULL},     0, NULL,   NULL};
    command_t less     = {"less",     (char *[]){"less", NULL},     0, NULL,   &more};
    command_t pager    = {pager_env,  (char *[]){pager_env, NULL},  0, NULL,   &less};
    command_t sort     = {"sort",     (char *[]){"sort", NULL},     0, &pager, NULL};
    command_t grep     = {"grep",     argv,                         0, &sort,  NULL};
    command_t printenv = {"printenv", (char *[]){"printenv", NULL}, 0, &sort,  NULL};

    if (argc > 1) {
        /* Arguments given: Run grep as well. */
        printenv.next = &grep;
        argv[0] = "grep";
    }

    /* Run pipeline. */
    run_pipeline(&printenv, STDIN_FILENO);

    return 0;
}

Initialize argv vectors using compound literals.


/* Make sure assert is not disabled */
#ifdef NDEBUG
#undef NDEBUG
#endif

#include <stdio.h>
#include <assert.h>
#include "see.h"
#include "fen.h"

void test_see()
{
    chess_state_t s;
    int result;
    int pos_from = D3;
    int pos_to = E5;
    int type = KNIGHT;
    int capture_type = PAWN;
    int special = MOVE_CAPTURE;
    move_t move =
        pos_from << MOVE_POS_FROM_SHIFT |
        pos_to << MOVE_POS_TO_SHIFT |
        type << MOVE_TYPE_SHIFT |
        capture_type << MOVE_CAPTURE_TYPE_SHIFT |
        special << MOVE_SPECIAL_FLAGS_SHIFT;
    assert(FEN_read(&s, "1k1r3q/1ppn3p/p4b2/4p3/8/P2N2P1/1PP1R1BP/2K1Q3 w - -"));
    result = see(&s, move);
    assert(result == -225/5);
}

int main()
{
    BITBOARD_init();

    test_see();

    return 0;
}

/* Make sure assert is not disabled */
#ifdef NDEBUG
#undef NDEBUG
#endif

#include <stdio.h>
#include <assert.h>
#include "see.h"
#include "fen.h"

void test_see(const char *fen, short expected_result)
{
    chess_state_t s;
    int result;
    int pos_from = D3;
    int pos_to = E5;
    int type = KNIGHT;
    int capture_type = PAWN;
    int special = MOVE_CAPTURE;
    move_t move =
        pos_from << MOVE_POS_FROM_SHIFT |
        pos_to << MOVE_POS_TO_SHIFT |
        type << MOVE_TYPE_SHIFT |
        capture_type << MOVE_CAPTURE_TYPE_SHIFT |
        special << MOVE_SPECIAL_FLAGS_SHIFT;
    assert(FEN_read(&s, fen));
    result = see(&s, move);
    printf("%s\n", fen);
    printf("\tresult %d (%d centipawns)\n", result, result*5);
    assert(result == expected_result);
}

int main()
{
    BITBOARD_init();

    test_see("1k1r3q/1ppn3p/p4b2/4p3/8/P2N2P1/1PP1R1BP/2K1Q3 w - -", -225/5);

    return 0;
}

Prepare for more SEE tests

Prepare for more SEE tests


#include <inttypes.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
#include "tock.h"

#pragma GCC diagnostic ignored "-Wunused-parameter"

void yield_for(bool *cond) {
  while(!*cond) {
    yield();
  }
}

void yield() {
  asm volatile("push {lr}\nsvc 0\npop {pc}" ::: "memory", "r0");
}

int subscribe(uint32_t driver, uint32_t subscribe,
              subscribe_cb cb, void* userdata) {
  asm volatile("svc 1\nbx lr" ::: "memory", "r0");
}

int command(uint32_t driver, uint32_t command, int data) {
  asm volatile("svc 2\nbx lr" ::: "memory", "r0");
}

int allow(uint32_t driver, uint32_t allow, void* ptr, size_t size) {
  asm volatile("svc 3\nbx lr" ::: "memory", "r0");
}

int memop(uint32_t op_type, int arg1) {
  asm volatile("svc 4\nbx lr" ::: "memory", "r0");
}

bool driver_exists(uint32_t driver) {
  int ret = command(driver, 0, 0);
  return ret >= 0;
}

#include <inttypes.h>
#include <stdlib.h>
#include <unistd.h>
#include <stdbool.h>
#include "tock.h"

#pragma GCC diagnostic ignored "-Wunused-parameter"

void yield_for(bool *cond) {
  while(!*cond) {
    yield();
  }
}

void yield() {
  asm volatile("push {lr}\nsvc 0\npop {pc}" ::: "memory", "r0");
}

int subscribe(uint32_t driver, uint32_t subscribe,
              subscribe_cb cb, void* userdata) {
  register int ret __asm__ ("r0");
  asm volatile("svc 1" ::: "memory", "r0");
  return ret;
}

int command(uint32_t driver, uint32_t command, int data) {
  register int ret __asm__ ("r0");
  asm volatile("svc 2\nbx lr" ::: "memory", "r0");
  return ret;
}

int allow(uint32_t driver, uint32_t allow, void* ptr, size_t size) {
  register int ret __asm__ ("r0");
  asm volatile("svc 3\nbx lr" ::: "memory", "r0");
  return ret;
}

int memop(uint32_t op_type, int arg1) {
  register int ret __asm__ ("r0");
  asm volatile("svc 4\nbx lr" ::: "memory", "r0");
  return ret;
}

bool driver_exists(uint32_t driver) {
  int ret = command(driver, 0, 0);
  return ret >= 0;
}

Resolve 'control reaches end of non-void function'

Following http://stackoverflow.com/questions/15927583/


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

#ifndef CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_

#include "content/public/browser/browser_message_filter.h"

namespace blink {
struct WebCircularGeofencingRegion;
}

namespace content {

class GeofencingDispatcherHost : public BrowserMessageFilter {
 public:
  GeofencingDispatcherHost();

 private:
  virtual ~GeofencingDispatcherHost();

  // BrowserMessageFilter implementation.
  virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;

  void OnRegisterRegion(int thread_id,
                        int request_id,
                        const std::string& region_id,
                        const blink::WebCircularGeofencingRegion& region);
  void OnUnregisterRegion(int thread_id,
                          int request_id,
                          const std::string& region_id);
  void OnGetRegisteredRegions(int thread_id, int request_id);

  DISALLOW_COPY_AND_ASSIGN(GeofencingDispatcherHost);
};

}  // namespace content

#endif  // CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_

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

#ifndef CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_

#include "content/public/browser/browser_message_filter.h"

namespace blink {
struct WebCircularGeofencingRegion;
}

namespace content {

class GeofencingDispatcherHost : public BrowserMessageFilter {
 public:
  GeofencingDispatcherHost();

 private:
  virtual ~GeofencingDispatcherHost();

  // BrowserMessageFilter implementation.
  virtual bool OnMessageReceived(const IPC::Message& message) override;

  void OnRegisterRegion(int thread_id,
                        int request_id,
                        const std::string& region_id,
                        const blink::WebCircularGeofencingRegion& region);
  void OnUnregisterRegion(int thread_id,
                          int request_id,
                          const std::string& region_id);
  void OnGetRegisteredRegions(int thread_id, int request_id);

  DISALLOW_COPY_AND_ASSIGN(GeofencingDispatcherHost);
};

}  // namespace content

#endif  // CONTENT_BROWSER_GEOFENCING_GEOFENCING_DISPATCHER_HOST_H_

Replace OVERRIDE and FINAL with override and final in content/browser/geofencing/[a-s]*

BUG=417463

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

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


#include "mbb/test.h"
#include "mbb/hsm.h"
#include "mbb/debug.h"

MHSM_DEFINE_STATE(state_a, NULL);
MHSM_DEFINE_STATE(state_a1, &state_a);
MHSM_DEFINE_STATE(state_a11, &state_a1);

mhsm_state_t *state_a_fun(mhsm_hsm_t *hsm, mhsm_event_t event)
{
	switch (event.id) {
		case MHSM_EVENT_INITIAL:
			return &state_a1;
	}

	return &state_a;
}

mhsm_state_t *state_a1_fun(mhsm_hsm_t *hsm, mhsm_event_t event)
{
	switch (event.id) {
		case MHSM_EVENT_INITIAL:
			return &state_a11;
	}

	return &state_a1;
}

mhsm_state_t *state_a11_fun(mhsm_hsm_t *hsm, mhsm_event_t event)
{
	switch (event.id) {
		case MHSM_EVENT_ENTRY:
			MDBG_PRINT_LN("a11 entry");
			break;
	}

	return &state_a11;
}

char *test_initial_transition()
{
	mhsm_hsm_t hsm;

	mhsm_initialise(&hsm, NULL, &state_a);
	mhsm_dispatch_event(&hsm, MHSM_EVENT_INITIAL);

	MUNT_ASSERT(mhsm_current_state(&hsm) == &state_a11);

	return 0;
}

Add first stub for HSM unit test

Add first stub for HSM unit test