#pragma once

#include <HgTypes.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct HgCamera {
	point position;
	quaternion rotation;
} HgCamera;

vector3 ray_from_camera(HgCamera* c);

#ifdef __cplusplus
}
#endif

#pragma once

#include <HgTypes.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct HgCamera {
	point position;
	quaternion rotation;

	vector3 direction;
	float speedMsec;
} HgCamera;

vector3 ray_from_camera(HgCamera* c);

#ifdef __cplusplus
}
#endif

Add current direction and speed variable. Should probably be moved somewhere else.


// PARAM: --disable ana.int.def_exc --enable ana.int.interval --enable ana.int.congruence
#include <assert.h>

int main(){
    int r = -103;
    for (int i = 0; i < 40; i++) {
        r = r + 5;
    }
    // At this point r in the congr. dom should be 2 + 5Z
    int k = r;
    if (k >= 3) {
        // After refinement with congruences, the lower bound should be 7 as the numbers 3 - 6 are not in the congr. class
        assert (k < 7); // FAIL
    }

    if (r >= -11 && r <= -4) {
        assert (r == -8);
    }
    return 0;
}

// PARAM: --disable ana.int.def_exc --enable ana.int.interval --enable ana.int.congruence --enable ana.int.congruence_no_overflow --enable ana.int.refinement
#include <assert.h>

int main(){
    int r = -103;
    for (int i = 0; i < 40; i++) {
        r = r + 5;
    }

    // At this point r in the congr. dom should be 2 + 5Z
    int k = r;
    if (k >= 3) {
        // After refinement with congruences, the lower bound should be 7 as the numbers 3 - 6 are not in the congr. class
        assert (k < 7); // FAIL
    }

    if (r >= -11 && r <= -4) {
        assert (r == -8);
    }
    return 0;
}

Add updated params to interval-congruence ref. reg test


/**
 *  @copyright Copyright 2018 The J-PET Framework Authors. All rights reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may find a copy of the License in the LICENCE file.
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *  @file JPetEventType.h
 */

#ifndef JPETEVENTTYPE_H
#define JPETEVENTTYPE_H

enum JPetEventType {
  kUnknown = 1,
  k2Gamma = 2,
  k3Gamma = 4,
  kPrompt = 8,
  kScattered = 16,
  kCosmic = 32
};
#endif /* !JPETEVENTTYPE_H */

/**
 *  @copyright Copyright 2021 The J-PET Framework Authors. All rights reserved.
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may find a copy of the License in the LICENCE file.
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 *  @file JPetEventType.h
 */

#ifndef JPETEVENTTYPE_H
#define JPETEVENTTYPE_H

enum class JPetEventType
{
  kUnknown = 1,
  k2Gamma = 2,
  k3Gamma = 4,
  kPrompt = 8,
  kScattered = 16,
  kCosmic = 32
};
#endif /* !JPETEVENTTYPE_H */

Change enum to scoped enum

Change enum to scoped enum

The change is due to the fact that in ROOT 6.20 there is a enum
with the kUnknown value defined, which creates the conflict with
our code.


/****************************************************************/
/*               DO NOT MODIFY THIS HEADER                      */
/* MOOSE - Multiphysics Object Oriented Simulation Environment  */
/*                                                              */
/*           (c) 2010 Battelle Energy Alliance, LLC             */
/*                   ALL RIGHTS RESERVED                        */
/*                                                              */
/*          Prepared by Battelle Energy Alliance, LLC           */
/*            Under Contract No. DE-AC07-05ID14517              */
/*            With the U. S. Department of Energy               */
/*                                                              */
/*            See COPYRIGHT for full restrictions               */
/****************************************************************/

#include "Material.h"

#ifndef EXAMPLEMATERIAL_H
#define EXAMPLEMATERIAL_H

//Forward Declarations
class ExampleMaterial;

template<>
InputParameters validParams<ExampleMaterial>();

/**
 * Example material class that defines a few properties.
 */
class ExampleMaterial : public Material
{
public:
  ExampleMaterial(const std::string & name,
                  InputParameters parameters);

protected:
  virtual void computeQpProperties();

private:
  /**
   * Holds a value from the input file.
   */
  Real _diffusivity_baseline;

  /**
   * Holds the values of a coupled variable.
   */
  VariableValue & _some_variable;

  /**
   * This is the member reference that will hold the
   * computed values from this material class.
   */
  MaterialProperty<Real> & _diffusivity;
};

#endif //EXAMPLEMATERIAL_H

/****************************************************************/
/*               DO NOT MODIFY THIS HEADER                      */
/* MOOSE - Multiphysics Object Oriented Simulation Environment  */
/*                                                              */
/*           (c) 2010 Battelle Energy Alliance, LLC             */
/*                   ALL RIGHTS RESERVED                        */
/*                                                              */
/*          Prepared by Battelle Energy Alliance, LLC           */
/*            Under Contract No. DE-AC07-05ID14517              */
/*            With the U. S. Department of Energy               */
/*                                                              */
/*            See COPYRIGHT for full restrictions               */
/****************************************************************/

#ifndef EXAMPLEMATERIAL_H
#define EXAMPLEMATERIAL_H

#include "Material.h"

//Forward Declarations
class ExampleMaterial;

template<>
InputParameters validParams<ExampleMaterial>();

/**
 * Example material class that defines a few properties.
 */
class ExampleMaterial : public Material
{
public:
  ExampleMaterial(const std::string & name,
                  InputParameters parameters);

protected:
  virtual void computeQpProperties();

private:
  /**
   * Holds a value from the input file.
   */
  Real _diffusivity_baseline;

  /**
   * Holds the values of a coupled variable.
   */
  VariableValue & _some_variable;

  /**
   * This is the member reference that will hold the
   * computed values from this material class.
   */
  MaterialProperty<Real> & _diffusivity;
};

#endif //EXAMPLEMATERIAL_H

Move include statement inside include guards.

r4098


//
//  SDCAlertViewCoordinator.h
//  SDCAlertView
//
//  Created by Scott Berrevoets on 1/25/14.
//  Copyright (c) 2014 Scotty Doesn't Code. All rights reserved.
//

#import <Foundation/Foundation.h>

@class SDCAlertView;

@interface SDCAlertViewCoordinator : NSObject

@property (nonatomic, readonly) SDCAlertView *visibleAlert;

+ (instancetype)sharedCoordinator;

- (void)presentAlert:(SDCAlertView *)alert;
- (void)dismissAlert:(SDCAlertView *)alert withButtonIndex:(NSInteger)buttonIndex;

@end

//
//  SDCAlertViewCoordinator.h
//  SDCAlertView
//
//  Created by Scott Berrevoets on 1/25/14.
//  Copyright (c) 2014 Scotty Doesn't Code. All rights reserved.
//

#import <Foundation/Foundation.h>

@class SDCAlertView;

@interface SDCAlertViewCoordinator : NSObject

@property (nonatomic, weak, readonly) SDCAlertView *visibleAlert;

+ (instancetype)sharedCoordinator;

- (void)presentAlert:(SDCAlertView *)alert;
- (void)dismissAlert:(SDCAlertView *)alert withButtonIndex:(NSInteger)buttonIndex;

@end

Change property reference to weak to match private reference


#include<stdlib.h>

void test(int i){
  printf("in test(%d)\n",i);

}

void test(){
  printf("in test()\n");

}

int main(){

  test();
  test(1);

  return 0;
}

Test whether two function name is same but num_para not is legal


/**
 * @file main.c
 * @brief Main.
 *
 */

#include "stm32f4xx_conf.h"
#include "FreeRTOS.h"

int main(void)
{
    // TODO

    while(1);

    return 0;
}

/**
 * @file main.c
 * @brief Main.
 *
 */

#include "stm32f4xx_conf.h"
#include "stm32f4xx_gpio.h"
#include "stm32f4xx_rcc.h"

#include "FreeRTOS.h"
#include "task.h"

void hw_init(void)
{
    GPIO_InitTypeDef gpio_led;

    GPIO_StructInit(&gpio_led);
    gpio_led.GPIO_Mode = GPIO_Mode_OUT;
    gpio_led.GPIO_Pin = GPIO_Pin_12;
    gpio_led.GPIO_PuPd = GPIO_PuPd_NOPULL;
    gpio_led.GPIO_Speed = GPIO_Speed_100MHz;
    gpio_led.GPIO_OType = GPIO_OType_PP;

    RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
    GPIO_Init(GPIOD, &gpio_led);
}

void led_task(void *params)
{
    while(1)
    {
        GPIO_ToggleBits(GPIOD, GPIO_Pin_12);

        vTaskDelay(500 / portTICK_RATE_MS);
    }
}

int main(void)
{
    hw_init();

    (void) SysTick_Config(SystemCoreClock / 1000);

    (void) xTaskCreate(
            led_task,
            "led_task",
            configMINIMAL_STACK_SIZE,
            NULL,
            tskIDLE_PRIORITY + 2UL,
            NULL);

    vTaskStartScheduler();

    while(1);

    return 0;
}

Add example LED blink task

Add example LED blink task


#include <stdio.h>

#define ORIGIN_BASE 10
#define TARGET_BASE 2

int bin(int dec){
	if (dec < TARGET_BASE) return dec;
	else return (ORIGIN_BASE * bin(dec/TARGET_BASE)) + (dec % TARGET_BASE);
}

int main(){
	printf("%d\n", bin(10));
	return 0;
}

Create q7: dec to bin

Create q7: dec to bin


/**
 * @file
 * @brief
 *
 * @author  Anton Kozlov
 * @date    29.04.2013
 */

#include <stddef.h>

#include <profiler/tracing/trace.h>

time64_t trace_block_diff(struct __trace_block *tb) {
	return -1;
}

time64_t trace_block_get_time(struct __trace_block *tb) {
	return -1;
}

int trace_point_get_value(struct __trace_point *tp) {
	return -1;
}

struct __trace_point *trace_point_get_by_name(const char *name) {
	return NULL;
}

void trace_block_func_enter(void *func) {
}

void trace_block_func_exit(void *func) {
}

Fix build after merge with embox-profiler


/*
    Title:  version.h

    Copyright (c) 2000-17
        Cambridge University Technical Services Limited

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.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 St, Fifth Floor, Boston, MA  02110-1301  USA

*/

#ifndef VERSION_H_INCLUDED
#define VERSION_H_INCLUDED

// Poly/ML system interface level
#define POLY_version_number    570
// POLY_version_number is written into all exported files and tested
// when we start up.  The idea is to ensure that if a file is exported
// from one version of the library it will run successfully if linked
// with a different version.
// This only supports version 5.7
#define FIRST_supported_version 570
#define LAST_supported_version  570

#define TextVersion             "5.6"

#endif

/*
    Title:  version.h

    Copyright (c) 2000-17
        Cambridge University Technical Services Limited

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.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 St, Fifth Floor, Boston, MA  02110-1301  USA

*/

#ifndef VERSION_H_INCLUDED
#define VERSION_H_INCLUDED

// Poly/ML system interface level
#define POLY_version_number    570
// POLY_version_number is written into all exported files and tested
// when we start up.  The idea is to ensure that if a file is exported
// from one version of the library it will run successfully if linked
// with a different version.
// This only supports version 5.7
#define FIRST_supported_version 570
#define LAST_supported_version  570

#define TextVersion             "5.7"

#endif

Fix TextVersion still being 5.6

Fix TextVersion still being 5.6


#ifndef PY_UTILS_H
#define PY_UTILS_H

#include <stdio.h>

extern FILE *stdin_writer;

void setupPython(const char* pythonProgramPath, const char* pythonLibs, const char* pythonHostLibs,
                 const char* pythonHome, const char* pythonTemp, const char* xdgBasePath);
void setupStdinEmulation(void);
void readFromStdin(char* inputBuffer, int bufferSize);
int runPythonInterpreter(int argc, char** argv);
void interruptPython(void);
void terminatePython(void);

#endif // PY_UTILS_H //

#ifndef PY_UTILS_H
#define PY_UTILS_H

#include <stdio.h>

extern FILE *stdin_writer;

void setupPython(const char* pythonProgramPath, const char* pythonLibs, const char* pythonHostLibs,
                 const char* pythonHome, const char* pythonTemp, const char* xdgBasePath,
                 const char* dataDir);
void setupStdinEmulation(void);
void readFromStdin(char* inputBuffer, int bufferSize);
int runPythonInterpreter(int argc, char** argv);
void interruptPython(void);
void terminatePython(void);

#endif // PY_UTILS_H //

Fix missing change in header

Fix missing change in header


//
// Copyright Renga Software LLC, 2017. All rights reserved.
//
// Renga Software LLC PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// Renga Software LLC  DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//

#pragma once

class BoolGuard
{
public:
  explicit BoolGuard(bool& variable);
  explicit BoolGuard(bool& variable, bool initialValue);

  BoolGuard(const BoolGuard& guard) = delete;
  BoolGuard& operator = (const BoolGuard& guard) = delete;

  ~BoolGuard();

private:
  bool& m_variable;
};

template <typename TFunc>
class CActionGuard
{
public:
  CActionGuard(const TFunc& func) : m_func(func) {}
  ~CActionGuard() { m_func(); }

private:
  TFunc m_func;
};

template <typename TFunc>
CActionGuard<TFunc> makeGuard(const TFunc& func)
{
  return CActionGuard<TFunc>(func);
}

//
// Copyright Renga Software LLC, 2017. All rights reserved.
//
// Renga Software LLC PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
// Renga Software LLC  DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
// UNINTERRUPTED OR ERROR FREE.
//

#pragma once

class BoolGuard
{
public:
  explicit BoolGuard(bool& variable);
  explicit BoolGuard(bool& variable, bool initialValue);

  BoolGuard(const BoolGuard& guard) = delete;
  BoolGuard& operator = (const BoolGuard& guard) = delete;

  ~BoolGuard();

private:
  bool& m_variable;
};

template <typename TFunc>
class CActionGuard
{
public:
  CActionGuard(TFunc&& func) : m_func(std::forward<TFunc>(func)) {}
  ~CActionGuard() { m_func(); }

private:
  TFunc m_func;
};

template <typename TFunc>
CActionGuard<TFunc> makeGuard(TFunc&& func)
{
  return CActionGuard<TFunc>(std::forward<TFunc>(func));
}

Fix after review: perfect forwarding used for callable object


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

#ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_
#define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_
#pragma once

#include <vector>

#include "base/basictypes.h"
#include "base/string16.h"
#include "content/common/content_export.h"

namespace content {

struct SpeechRecognitionHypothesis {
  string16 utterance;
  double confidence;

  SpeechRecognitionHypothesis() : confidence(0.0) {}

  SpeechRecognitionHypothesis(const string16 utterance_value,
                              double confidence_value)
      : utterance(utterance_value),
        confidence(confidence_value) {
  }
};

typedef std::vector<SpeechRecognitionHypothesis>
    SpeechRecognitionHypothesisArray;

struct CONTENT_EXPORT SpeechRecognitionResult {
  SpeechRecognitionHypothesisArray hypotheses;
  bool provisional;

  SpeechRecognitionResult();
  ~SpeechRecognitionResult();
};

}  // namespace content

#endif  // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_

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

#ifndef CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_
#define CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_
#pragma once

#include <vector>

#include "base/basictypes.h"
#include "base/string16.h"
#include "content/common/content_export.h"

namespace content {

struct SpeechRecognitionHypothesis {
  string16 utterance;
  double confidence;

  SpeechRecognitionHypothesis() : confidence(0.0) {}

  SpeechRecognitionHypothesis(const string16& utterance_value,
                              double confidence_value)
      : utterance(utterance_value),
        confidence(confidence_value) {
  }
};

typedef std::vector<SpeechRecognitionHypothesis>
    SpeechRecognitionHypothesisArray;

struct CONTENT_EXPORT SpeechRecognitionResult {
  SpeechRecognitionHypothesisArray hypotheses;
  bool provisional;

  SpeechRecognitionResult();
  ~SpeechRecognitionResult();
};

}  // namespace content

#endif  // CONTENT_PUBLIC_COMMON_SPEECH_RECOGNITION_RESULT_H_

Coverity: Fix pass by value error in SpeechRecognitionHypothesis constructor.

CID=103455
BUG=none
TEST=none

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

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


// PARAM: --set ana.activated[+] region
// Copy of 04/34 with a malloc'ed variable (works without region).
#include <pthread.h>
#include <stdlib.h>

pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER;

void *t_fun(void *arg) {
  int *p = (int *) arg;
  pthread_mutex_lock(&mutex1);
  (*p)++; // TODO RACE!
  pthread_mutex_unlock(&mutex1);
  return NULL;
}

int main(void) {
  pthread_t id;
  int *q = (int*) malloc(sizeof(int));
  pthread_create(&id, NULL, t_fun, (void *) q);
  pthread_mutex_lock(&mutex2);
  (*q)++; // TODO RACE!
  pthread_mutex_unlock(&mutex2);
  pthread_join (id, NULL);
  return 0;
}

Add testcase for the underlying region unsoundness in 38-pool.


#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    99
#define CLIENT_VERSION_BUILD       8

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

// 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    99
#define CLIENT_VERSION_BUILD       9

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

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

Build number for OpenSSL bug fix

Build number for OpenSSL bug fix


#ifndef E_MOD_MAIN_H
#define E_MOD_MAIN_H

typedef struct _Status       Status;
typedef struct _Config       Config;

struct _Status
{
   Evas_List     *frequencies;
   Evas_List     *governors;
   int            cur_frequency;
   int            can_set_frequency;
   char          *cur_governor;
   unsigned char  active;
};

struct _Config
{
   /* saved * loaded config values */
   double       poll_time;
   int          restore_governor;
   const char  *governor;
   /* just config state */
   E_Module    *module;
   Evas_List   *instances;
   E_Menu      *menu;
   E_Menu      *menu_poll;
   E_Menu      *menu_governor;
   E_Menu      *menu_frequency;
   Status      *status;
   char        *set_exe_path;
   Ecore_Timer *frequency_check_timer;
};

EAPI extern E_Module_Api e_modapi;

EAPI void *e_modapi_init     (E_Module *m);
EAPI int   e_modapi_shutdown (E_Module *m);
EAPI int   e_modapi_save     (E_Module *m);
EAPI int   e_modapi_about    (E_Module *m);

#endif

#ifndef E_MOD_MAIN_H
#define E_MOD_MAIN_H

typedef struct _Status       Status;
typedef struct _Config       Config;

struct _Status
{
   Evas_List     *frequencies;
   Evas_List     *governors;
   int            cur_frequency;
   int            can_set_frequency;
   char          *cur_governor;
   unsigned char  active;
};

struct _Config
{
   /* saved * loaded config values */
   double       poll_time;
   int          restore_governor;
   const char  *governor;
   /* just config state */
   E_Module    *module;
   Evas_List   *instances;
   E_Menu      *menu;
   E_Menu      *menu_poll;
   E_Menu      *menu_governor;
   E_Menu      *menu_frequency;
   Status      *status;
   char        *set_exe_path;
   Ecore_Timer *frequency_check_timer;
};

EAPI extern E_Module_Api e_modapi;

EAPI void *e_modapi_init     (E_Module *m);
EAPI int   e_modapi_shutdown (E_Module *m);
EAPI int   e_modapi_save     (E_Module *m);

#endif

Remove unused (and deprecated) declaration.

SVN revision: 32298


#ifndef _OFFLINE_STATES_H_
#define _OFFLINE_STATES_H_

/* Cpu offline states go here */
enum cpu_state_vals {
	CPU_STATE_OFFLINE,
	CPU_STATE_INACTIVE,
	CPU_STATE_ONLINE,
	CPU_MAX_OFFLINE_STATES
};

extern enum cpu_state_vals get_cpu_current_state(int cpu);
extern void set_cpu_current_state(int cpu, enum cpu_state_vals state);
extern enum cpu_state_vals get_preferred_offline_state(int cpu);
extern void set_preferred_offline_state(int cpu, enum cpu_state_vals state);
extern void set_default_offline_state(int cpu);
extern int start_secondary(void);
#endif

#ifndef _OFFLINE_STATES_H_
#define _OFFLINE_STATES_H_

/* Cpu offline states go here */
enum cpu_state_vals {
	CPU_STATE_OFFLINE,
	CPU_STATE_INACTIVE,
	CPU_STATE_ONLINE,
	CPU_MAX_OFFLINE_STATES
};

#ifdef CONFIG_HOTPLUG_CPU
extern enum cpu_state_vals get_cpu_current_state(int cpu);
extern void set_cpu_current_state(int cpu, enum cpu_state_vals state);
extern void set_preferred_offline_state(int cpu, enum cpu_state_vals state);
extern void set_default_offline_state(int cpu);
#else
static inline enum cpu_state_vals get_cpu_current_state(int cpu)
{
	return CPU_STATE_ONLINE;
}

static inline void set_cpu_current_state(int cpu, enum cpu_state_vals state)
{
}

static inline void set_preferred_offline_state(int cpu, enum cpu_state_vals state)
{
}

static inline void set_default_offline_state(int cpu)
{
}
#endif

extern enum cpu_state_vals get_preferred_offline_state(int cpu);
extern int start_secondary(void);
#endif

powerpc: Fix SMP build with disabled CPU hotplugging.

Compiling 2.6.33 with SMP enabled and HOTPLUG_CPU disabled gives me the
following link errors:

  LD      init/built-in.o
  LD      .tmp_vmlinux1
arch/powerpc/platforms/built-in.o: In function `.smp_xics_setup_cpu':
smp.c:(.devinit.text+0x88): undefined reference to `.set_cpu_current_state'
smp.c:(.devinit.text+0x94): undefined reference to `.set_default_offline_state'
arch/powerpc/platforms/built-in.o: In function `.smp_pSeries_kick_cpu':
smp.c:(.devinit.text+0x13c): undefined reference to `.set_preferred_offline_state'
smp.c:(.devinit.text+0x148): undefined reference to `.get_cpu_current_state'
smp.c:(.devinit.text+0x1a8): undefined reference to `.get_cpu_current_state'
make: *** [.tmp_vmlinux1] Error 1

The following change fixes that for me and seems to work as expected.

Signed-off-by: Adam Lackorzynski <0e18f44c1fec03ec4083422cb58ba6a09ac4fb2a@os.inf.tu-dresden.de>
Signed-off-by: Benjamin Herrenschmidt <a7089bb6e7e92505d88aaff006cbdd60cc9120b6@kernel.crashing.org>


/*
 * The Apache Software License, Version 1.1
 *
 * Copyright (c) 2001-2002 The Apache Software Foundation.  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.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by the
 *        Apache Software Foundation (http://www.apache.org/)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Xerces" and "Apache Software Foundation" must
 *    not be used to endorse or promote products derived from this
 *    software without prior written permission. For written
 *    permission, please contact apache\@apache.org.
 *
 * 5. Products derived from this software may not be called "Apache",
 *    nor may "Apache" appear in their name, without prior written
 *    permission of the Apache Software Foundation.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 APACHE SOFTWARE FOUNDATION OR
 * ITS 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.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of the Apache Software Foundation, and was
 * originally based on software copyright (c) 2001, International
 * Business Machines, Inc., http://www.ibm.com .  For more information
 * on the Apache Software Foundation, please see
 * <http://www.apache.org/>.
 */

/*
 * $Id$
 */

//	Objective C only
#if __OBJC__
#endif

//	C++ only
#if defined(__cplusplus)
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <cstdio>
#include <memory>
#endif

//	Standard C headers
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdlib.h>

//	Carbon Headers
#include <Carbon/Carbon.h>
#include <CoreFoundation/CoreFoundation.h>

Add prefix file for ProjectBuilder samples

git-svn-id: 3ec853389310512053d525963cab269c063bb453@174526 13f79535-47bb-0310-9956-ffa450edef68


//
//  RCTSpotlightSearch.h
//  RCTSpotlightSearch
//
//  Created by James (Home) on 21/06/2016.
//  Copyright © 2016 James Munro. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "RCTBridgeModule.h"

@interface RCTSpotlightSearch : NSObject <RCTBridgeModule>

+ (void)handleContinueUserActivity:(NSUserActivity *)userActivity;

@end

//
//  RCTSpotlightSearch.h
//  RCTSpotlightSearch
//
//  Created by James (Home) on 21/06/2016.
//  Copyright © 2016 James Munro. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>

@interface RCTSpotlightSearch : NSObject <RCTBridgeModule>

+ (void)handleContinueUserActivity:(NSUserActivity *)userActivity;

@end

Fix import React/RCTBridgeModule.h, needed by RN 0.50


// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/searchlib/util/bufferwriter.h>
#include <vector>

namespace search::test
{

class VectorBufferWriter : public BufferWriter {
private:
    char tmp[1024];
public:
    std::vector<char> output;
    VectorBufferWriter();
    ~VectorBufferWriter();
    void flush() override;
};

}

// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/searchlib/util/bufferwriter.h>
#include <vector>

namespace search::test
{

class VectorBufferWriter : public BufferWriter {
private:
    char tmp[1024];
public:
    std::vector<char> output;
    VectorBufferWriter();
    ~VectorBufferWriter() override;
    void flush() override;
};

}

Add override specifier for VectorBufferWriter destructor.


#include "list.h"

struct ListNode
{
	ListNode* prev;
	ListNode* next;
	void* k;
};

struct List
{
	ListNode* head;
};

List* List_Create(void)
{
	List* l = (List *)malloc(sizeof(List));
	l->head = NULL;
	return l;
}

ListNode* ListNode_Create(void* k)
{
	ListNode* n = (ListNode *)malloc(sizeof(ListNode));
	n->prev = NULL;
	n->next = NULL;
	n->k = k;
	return n;
}

ListNode* List_Search(List* l, void* k, int (f)(void*, void*))
{
	ListNode* n = l->head;
	while (n != NULL && !f(n->k, k))
	{
		n = n->next;
	}
	return n;
}

Add List Search function implementation

Add List Search function implementation


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

inherit SECOND_AUTO;

void extinguish(string path)
{
	ACCESS_CHECK(KADMIN());
	call_out("purge", 0, path, status(ST_OTABSIZE));
}

static void purge(string path, int quota)
{
	int limit;

	limit = 200;

	if (quota % limit != 0) {
		limit = quota % limit;
	}

	for (; quota > 0 && limit > 0; quota--, limit--) {
		object obj;

		if (obj = find_object(path + "#" + quota)) {
			destruct_object(obj);
		}
	}

	LOGD->post_message("test", LOG_INFO, quota + " objects to check.");

	if (quota > 0) {
		call_out("purge", 0, path, quota);
	}
}

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

inherit SECOND_AUTO;

void extinguish(string path)
{
	if (!KADMIN()) {
		string opath;

		opath = object_name(previous_object());

		ACCESS_CHECK(DRIVER->creator(opath));
		ACCESS_CHECK(DRIVER->creator(opath) == DRIVER->creator(path));
	}

	call_out("purge", 0, path, status(ST_OTABSIZE));
}

static void purge(string path, int quota)
{
	int limit;

	limit = 128;

	if (quota % limit != 0) {
		limit = quota % limit;
	}

	for (; quota > 0 && limit > 0; quota--, limit--) {
		object obj;

		if (obj = find_object(path + "#" + quota)) {
			destruct_object(obj);
		}
	}

	LOGD->post_message("test", LOG_INFO, quota + " objects to check.");

	if (quota > 0) {
		call_out("purge", 0, path, quota);
	}
}

Allow extinguishing of objects with the same creator as yourself.


#include "drmP.h"
#include "drm.h"
#include "nouveau_drv.h"
#include "nouveau_drm.h"

int
nv04_mc_init(struct drm_device *dev)
{
	/* Power up everything, resetting each individual unit will
	 * be done later if needed.
	 */

	nv_wr32(dev, NV03_PMC_ENABLE, 0xFFFFFFFF);
	return 0;
}

void
nv04_mc_takedown(struct drm_device *dev)
{
}

#include "drmP.h"
#include "drm.h"
#include "nouveau_drv.h"
#include "nouveau_drm.h"

int
nv04_mc_init(struct drm_device *dev)
{
	/* Power up everything, resetting each individual unit will
	 * be done later if needed.
	 */

	nv_wr32(dev, NV03_PMC_ENABLE, 0xFFFFFFFF);

	/* Disable PROM access. */
	nv_wr32(dev, NV_PBUS_PCI_NV_20, NV_PBUS_PCI_NV_20_ROM_SHADOW_ENABLED);

	return 0;
}

void
nv04_mc_takedown(struct drm_device *dev)
{
}

Disable PROM access on init.

drm/nouveau: Disable PROM access on init.

On older cards (<nv17) scanout gets blocked when the ROM is being
accessed. PROM access usually comes out enabled from suspend, switch
it off.

Signed-off-by: Francisco Jerez <5906ff32bdd9fd8db196f6ba5ad3afd6f9257ea5@riseup.net>
Signed-off-by: Ben Skeggs <d9f27fb07c1e9f131223ad827fa5179f3846c30b@redhat.com>


#include <stdio.h>

#include "m-array.h"
#include "m-string.h"

// Let's create an array of string_t and register it globaly
ARRAY_DEF(vector_string, string_t)
#define M_OPL_vector_string_t() ARRAY_OPLIST(vector_string, STRING_OPLIST)

int main(void)
{
    // Let's define a new string named str
    M_LET(str, string_t)
    // Let's define msg as a vector_array_t
    M_LET( (msg, STRING_CTE("Hello"), STRING_CTE("C"), STRING_CTE("World!"), STRING_CTE("Let's"), STRING_CTE("discover"), STRING_CTE("M*LIB!")), vector_string_t) {
        // Iterate over all words of the array msg
        for M_EACH(word, msg, vector_string_t) {
            // Cat the current word into the target string
            string_cat(str, *word);
            // Also add a space character
            string_push_back(str, ' ');
        }
        // Print the result
        printf("%s\n", string_get_cstr(str) );
    }
    return 0;
}

#include <stdio.h>

#include "m-array.h"
#include "m-string.h"

// Let's create an array of string_t and register it globaly
ARRAY_DEF(vector_string, string_t)
#define M_OPL_vector_string_t() ARRAY_OPLIST(vector_string, STRING_OPLIST)

int main(void)
{
    // Let's define a new string named str
    M_LET(str, string_t)
    // Let's define msg as a vector_array_t
    M_LET( (msg, STRING_CTE("Hello"), STRING_CTE("C"), STRING_CTE("World!"), STRING_CTE("Let's"), STRING_CTE("discover"), STRING_CTE("M*LIB!")), vector_string_t) {
        // Iterate over all words of the array msg
        for M_EACH(word, msg, vector_string_t) {
            // Cat the current word into the target string
            string_cat(str, *word);
            // Also add a space character
            string_push_back(str, ' ');
        }
        // Let's define another string and set it to a formatted value.
        M_LET( (count, "\nTo display this it uses \"vector\" of %zu strings!", vector_string_size(msg)), string_t) {
            string_cat(str, count);
        }
        // Print the result
        printf("%s\n", string_get_cstr(str) );
    }
    return 0;
}

Add example of formatted C string for string in M_LET


#include "e.h"
#include "e_mod_main.h"
#include "e_mod_config.h"
#include "e_kbd_int.h"

/* local variables */
static E_Kbd_Int *ki = NULL;

EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Keyboard" };

EAPI void *
e_modapi_init(E_Module *m)
{
   if (!il_kbd_config_init(m)) return NULL;

   ki = e_kbd_int_new(mod_dir, mod_dir, mod_dir);

   return m;
}

EAPI int
e_modapi_shutdown(E_Module *m)
{
   if (ki)
     {
        e_kbd_int_free(ki);
        ki = NULL;
     }
   il_kbd_config_shutdown();
   return 1;
}

EAPI int
e_modapi_save(E_Module *m)
{
   return il_kbd_config_save();
}

#include "e.h"
#include "e_mod_main.h"
#include "e_mod_config.h"
#include "e_kbd_int.h"

/* local variables */
static E_Kbd_Int *ki = NULL;

EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume Keyboard" };

EAPI void *
e_modapi_init(E_Module *m)
{
   if (!il_kbd_config_init(m)) return NULL;

   ki = e_kbd_int_new(il_kbd_cfg->mod_dir,
                      il_kbd_cfg->mod_dir, il_kbd_cfg->mod_dir);

   return m;
}

EAPI int
e_modapi_shutdown(E_Module *m)
{
   if (ki)
     {
        e_kbd_int_free(ki);
        ki = NULL;
     }
   il_kbd_config_shutdown();
   return 1;
}

EAPI int
e_modapi_save(E_Module *m)
{
   return il_kbd_config_save();
}

Use correct module directory when making keyboard.
Previous commit fixed compiler warnings also.

git-svn-id: 6ac5796aeae0cef97fb47bcc287d4ce899c6fa6e@43875 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33


#ifndef _DOORS_H_
#define _DOORS_H_

#ifndef NUMBER_OF_DOORS
#define NUMBER_OF_DOORS         3
#endif

typedef struct {
    unsigned int has_prize         :  1;
    unsigned int currently_selected:  1;
    unsigned int revealed          :  1;
} door;

/*
 * game status updates
 */
extern void set_doors(void);
extern void select_door(unsigned int number);
extern void show_doors(void);
extern void reveal_all_doors(void);

/*
 * game status queries
 */
extern unsigned int get_door_number(void);
extern unsigned int current_guess(void);
extern unsigned int winning_door(void);
extern unsigned int hint_door(void);

#endif

#ifndef _DOORS_H_
#define _DOORS_H_

#ifndef NUMBER_OF_DOORS
#define NUMBER_OF_DOORS         3
#endif

#include <limits.h>
#if (NUMBER_OF_DOORS > UINT_MAX)
#error (n) doors exceeds storage allocation limit for `unsigned int'.
#endif

typedef struct {
    unsigned int has_prize         :  1;
    unsigned int currently_selected:  1;
    unsigned int revealed          :  1;
} door;

/*
 * game status updates
 */
extern void set_doors(void);
extern void select_door(unsigned int number);
extern void show_doors(void);
extern void reveal_all_doors(void);

/*
 * game status queries
 */
extern unsigned int get_door_number(void);
extern unsigned int current_guess(void);
extern unsigned int winning_door(void);
extern unsigned int hint_door(void);

#endif

Throw a fatal pre-processor error if (n > UINT_MAX).


#import <CoreLocation/CLLocation.h>

#define DEGREES_PER_RADIAN 180.0 / M_PI
#define RADIANS_PER_DEGREE M_PI / 180.0

#define DEFAULT_MAP_CENTER CLLocationCoordinate2DMake(42.35913,-71.09325)
#define DEFAULT_MAP_SPAN MKCoordinateSpanMake(0.006, 0.006)

// these are 1 and 2 miles respectively
#define OUT_OF_BOUNDS_DISTANCE 1609
#define WAY_OUT_OF_BOUNDS_DISTANCE 3218

@interface CLLocation (MITAdditions)

- (CLLocationDistance)distanceFromCenterOfCampus;
- (BOOL)isOnCampus;
- (BOOL)isNearCampus;

@end

@interface NSValue (CL_MITAdditions)
+ (NSValue *)valueWithMKCoordinate:(CLLocationCoordinate2D)coordinate;
- (CLLocationCoordinate2D)MKCoordinateValue;

@end

#import <CoreLocation/CLLocation.h>
#import <CoreLocation/CoreLocation.h>

#define DEGREES_PER_RADIAN 180.0 / M_PI
#define RADIANS_PER_DEGREE M_PI / 180.0

#define DEFAULT_MAP_CENTER CLLocationCoordinate2DMake(42.35913,-71.09325)
#define DEFAULT_MAP_SPAN MKCoordinateSpanMake(0.006, 0.006)

// these are 1 and 2 miles respectively
#define OUT_OF_BOUNDS_DISTANCE 1609
#define WAY_OUT_OF_BOUNDS_DISTANCE 3218

FOUNDATION_STATIC_INLINE inline NSString* NSStringFromCLLocationCoordinate2D(CLLocationCoordinate2D coordinate) {
    return [NSString stringWithFormat:@"{ x: %lf, y: %lf }", coordinate.longitude, coordinate.latitude];
}

@interface CLLocation (MITAdditions)

- (CLLocationDistance)distanceFromCenterOfCampus;
- (BOOL)isOnCampus;
- (BOOL)isNearCampus;

@end

@interface NSValue (CL_MITAdditions)
+ (NSValue *)valueWithMKCoordinate:(CLLocationCoordinate2D)coordinate;
- (CLLocationCoordinate2D)MKCoordinateValue;

@end

Add a convenience function to get an NSString from a CLLocationCoordinate2D object


/*
 * Author: Jhonatan Casale (jhc)
 *
 * Contact : jhonatan@jhonatancasale.com
 *         : casale.jhon@gmail.com
 *         : https://github.com/jhonatancasale
 *         : https://twitter.com/jhonatancasale
 *         : http://jhonatancasale.github.io/
 *
 * Create date Sat 10 Dec 16:13:19 BRST 2016
 *
 */

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

int sumByReference (int *, int *);
int sumByValue (int, int);

int main (int argc, char **argv)
{
  int a = 10;
  int b = 37;

  printf ("a:%d, b%d\n", a, b);

  printf ("a:%d, b%d => sumByValue() = %d\n", a, b, sumByValue(a, b) );

  printf ("a:%d, b%d => sumByReference() = %d\n", a, b, sumByReference(&a, &b) );

  printf ("a:%d, b%d\n", a, b);

  return (EXIT_SUCCESS);
}

int sumByValue (int a, int b) {
  int aux = a;
  a = b;
  b = aux;
  return (a + b);
}

int sumByReference ( int * a, int * b) {
  int aux = *a;
  *a = *b;
  *b = aux;
  return (*a + *b);
}

Add parameter passing example in c

Add parameter passing example in c


#pragma once

namespace me {
	template<class T>
	class Optional {
		T *m_object;
	public:
		Optional() : m_object(0) {}

		Optional(const T& other) : m_object(new T(other)) {}

		Optional& operator=(const T& other) {
			if (m_object != 0) {
				delete m_object;
			}
			m_object = new T(other);
			return *this;
		}

		operator bool() const {
			return m_object != 0;
		}

		T& operator *() const {
			return *m_object;
		}

		T* operator ->() const {
			return m_object;
		}

		T* pointer() const {
			return m_object;
		}
	};

	// splitting.
	std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems);
	std::vector<std::string> split(const std::string &s, char delim);
}

#pragma once

namespace me {
	// basic optional implementation.
	template<class T>
	class Optional {
		T *m_object;

	public:
		Optional() : m_object(0) { }

		// copy constructor
		Optional(const Optional<T>& other) : m_object(new T(*other)) { }

		// move constructor
		Optional(Optional<T>&& other) : m_object(other.m_object) {
			other.m_object = 0;
		}

		Optional(const T& other) : m_object(new T(other)) { }

		// destructor
		~Optional() {
			delete m_object;  // delete 0 is a no-op, so we are fine here.
		}

		// copy assignment operator
		Optional& operator=(const Optional<T>& other) {
			delete m_object;  // delete 0 is a no-op
			m_object = new T(*other);
			return *this;
		}

		Optional& operator=(const T& other) {
			delete m_object;  // delete 0 is a no-op
			m_object = new T(other);
			return *this;
		}

		// move assignment operator
		Optional& operator=(Optional<T>&& other) {
			delete m_object;  // delete 0 is a no-op
			m_object = other.m_object;
			other.m_object = 0;
			return *this;
		}

		operator bool() const {
			return m_object != 0;
		}

		T& operator *() const {
			return *m_object;
		}

		T* operator ->() const {
			return m_object;
		}

		T* pointer() const {
			return m_object;
		}
	};

	// splitting.
	std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems);
	std::vector<std::string> split(const std::string &s, char delim);
}

Use move semantics in Optional implementation.


/*
 * Copyright (C) 2017 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 INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
#define INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_

#include <assert.h>
#include <stddef.h>
#include <stdint.h>

namespace protozero {

// Keep this struct trivially constructible (no ctors, no default initializers).
struct ContiguousMemoryRange {
  uint8_t* begin;
  uint8_t* end;  // STL style: one byte past the end of the buffer.

  inline bool is_valid() const { return begin != nullptr; }
  inline void reset() { begin = nullptr; }
  inline size_t size() { return static_cast<size_t>(end - begin); }
};

}  // namespace protozero

#endif  // INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_

/*
 * Copyright (C) 2017 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 INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_
#define INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_

#include <assert.h>
#include <stddef.h>
#include <stdint.h>

namespace protozero {

// Keep this struct trivially constructible (no ctors, no default initializers).
struct ContiguousMemoryRange {
  uint8_t* begin;
  uint8_t* end;  // STL style: one byte past the end of the buffer.

  inline bool is_valid() const { return begin != nullptr; }
  inline void reset() { begin = nullptr; }
  inline size_t size() const { return static_cast<size_t>(end - begin); }
};

}  // namespace protozero

#endif  // INCLUDE_PERFETTO_PROTOZERO_CONTIGUOUS_MEMORY_RANGE_H_

Mark ContiguousMemoryRange::size as const. am: f2c28cd765

Change-Id: I8f62e95dd64516e3a99b3123c48b16fd88264f7e


extern void __VERIFIER_error() __attribute__((__noreturn__));

int main()
{
  f_empty_goto_loop();
  f_empty_while_loop();
  f_empty_goto_loop_suffix();
  f_empty_while_loop_suffix();
  f_nonempty_goto_loop();
  f_nonempty_while_loop();

  return 0;
}

void f_empty_goto_loop()
{
f_empty_goto_loop_label:
  goto f_empty_goto_loop_label;
}

void f_empty_while_loop()
{
  while (1) {}
}

void f_empty_goto_loop_suffix()
{
f_empty_goto_loop_suffix_label:
  goto f_empty_goto_loop_suffix_label;

  __VERIFIER_error();
}

void f_empty_while_loop_suffix()
{
  while (1) {}

  __VERIFIER_error();
}

void f_nonempty_goto_loop()
{
f_nonempty_goto_loop_label:
  __VERIFIER_error();
  goto f_nonempty_goto_loop_label;
}

void f_nonempty_while_loop()
{
  while (1)
  {
    __VERIFIER_error();
  }
}

Add infinite goto loop examples as SV-COMP tests


// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "ModuleManager.h"

DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All);

class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface
{
public:

	bool PythonGILAcquire();
	void PythonGILRelease();

	virtual void StartupModule() override;
	virtual void ShutdownModule() override;

	void RunString(char *);
	void RunFile(char *);
	void RunFileSandboxed(char *);

private:
	void *ue_python_gil;
	// used by console
	void *main_dict;
	void *local_dict;
};

struct FScopePythonGIL {
	FScopePythonGIL()
	{
#if defined(UEPY_THREADING)
		UnrealEnginePythonModule = FModuleManager::LoadModuleChecked<FUnrealEnginePythonModule>("UnrealEnginePython");
		safeForRelease = UnrealEnginePythonModule.PythonGILAcquire();
#endif
	}

	~FScopePythonGIL()
	{
#if defined(UEPY_THREADING)
		if (safeForRelease) {
			UnrealEnginePythonModule.PythonGILRelease();
		}
#endif
	}

	FUnrealEnginePythonModule UnrealEnginePythonModule;
	bool safeForRelease;
};

// Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.

#pragma once

#include "ModuleManager.h"

DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All);

class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface
{
public:

	bool PythonGILAcquire();
	void PythonGILRelease();

	virtual void StartupModule() override;
	virtual void ShutdownModule() override;

	void RunString(char *);
	void RunFile(char *);
	void RunFileSandboxed(char *);

private:
	void *ue_python_gil;
	// used by console
	void *main_dict;
	void *local_dict;
	void *main_module;
};

struct FScopePythonGIL {
	FScopePythonGIL()
	{
#if defined(UEPY_THREADING)
		UnrealEnginePythonModule = FModuleManager::LoadModuleChecked<FUnrealEnginePythonModule>("UnrealEnginePython");
		safeForRelease = UnrealEnginePythonModule.PythonGILAcquire();
#endif
	}

	~FScopePythonGIL()
	{
#if defined(UEPY_THREADING)
		if (safeForRelease) {
			UnrealEnginePythonModule.PythonGILRelease();
		}
#endif
	}

	FUnrealEnginePythonModule UnrealEnginePythonModule;
	bool safeForRelease;
};

Add support for the Python Stdout Log

Add support for the Python Stdout Log

Support the print(' ') and help(' '),
Can be used as the transition period.


// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/storage/common/storage_chain_builder.h>

namespace feedbm {

class BmStorageLinkContext;

/*
 * Storage chain builder that inserts a BmStorageLink right below the
 * communication manager. This allows sending benchmark feed to chain.
 */
class BmStorageChainBuilder : public storage::StorageChainBuilder
{
    std::shared_ptr<BmStorageLinkContext> _context;
public:
    BmStorageChainBuilder();
    ~BmStorageChainBuilder() override;
    const std::shared_ptr<BmStorageLinkContext>& get_context() { return _context; }
    void add(std::unique_ptr<storage::StorageLink> link) override;
};

}

// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#pragma once

#include <vespa/storage/common/storage_chain_builder.h>

namespace feedbm {

struct BmStorageLinkContext;

/*
 * Storage chain builder that inserts a BmStorageLink right below the
 * communication manager. This allows sending benchmark feed to chain.
 */
class BmStorageChainBuilder : public storage::StorageChainBuilder
{
    std::shared_ptr<BmStorageLinkContext> _context;
public:
    BmStorageChainBuilder();
    ~BmStorageChainBuilder() override;
    const std::shared_ptr<BmStorageLinkContext>& get_context() { return _context; }
    void add(std::unique_ptr<storage::StorageLink> link) override;
};

}

Fix forward declaration of BmStorageLinkContext.


/******************************************************************************/
/**
@file
@author		Kris Wallperington
@brief		Behaviour tests for the skip list implementation.
@copyright	Copyright 2016
				The University of British Columbia,
				IonDB Project Contributors (see AUTHORS.md)
@par
			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
@par
			Unless required by applicable law or agreed to in writing,
			software distributed under the License is distributed on an
			"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
			either express or implied. See the License for the specific
			language governing permissions and limitations under the
			License.
*/
/******************************************************************************/

#include "../../../planckunit/src/planck_unit.h"
#include "../behaviour_dictionary.h"
#include "../../../../dictionary/skip_list/skip_list_handler.h"
#include "test_behaviour_skip_list.h"

void
runalltests_behaviour_skip_list(
	void
) {
	bhdct_run_tests(sldict_init, 7, BHDCT_ALL_TESTS);
}

/******************************************************************************/
/**
@file
@author		Kris Wallperington
@brief		Behaviour tests for the skip list implementation.
@copyright	Copyright 2016
				The University of British Columbia,
				IonDB Project Contributors (see AUTHORS.md)
@par
			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
@par
			Unless required by applicable law or agreed to in writing,
			software distributed under the License is distributed on an
			"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
			either express or implied. See the License for the specific
			language governing permissions and limitations under the
			License.
*/
/******************************************************************************/

#include "../../../planckunit/src/planck_unit.h"
#include "../behaviour_dictionary.h"
#include "../../../../dictionary/skip_list/skip_list_handler.h"
#include "test_behaviour_skip_list.h"

void
runalltests_behaviour_skip_list(
	void
) {
#if defined(ARDUINO)
	bhdct_run_tests(sldict_init, 7, BHDCT_ALL_TESTS & ~BHDCT_STRING_INT);
#else
	bhdct_run_tests(sldict_init, 7, BHDCT_ALL_TESTS);
#endif
}

Exclude skiplist string key tests from device


// RUN: %ocheck 0 %s

struct store_out
{
	int *local;
	int *ret;
};

void store_out(const struct store_out *const so)
{
	*so->ret = *so->local;
}

void f(int *p)
{
	int i = *p;
	struct store_out so __attribute((cleanup(store_out))) = {
		.local = &i,
		.ret = p
	};

	i = 5;
}

main()
{
	int i = 3;

	f(&i);

	if(i != 5)
		abort();

	return 0;
}

Test cleanup-attribute with const struct parameter


#if !defined(DUX_OPT_NO_TIMER) && defined(__linux__)

#include "../dux_internal.h"
#include <time.h>

DUK_INTERNAL duk_uint_t dux_timer_current(void)
{
	struct timespec tp;
	if (clock_gettime(CLOCK_MONOTONIC, &tp) != 0)
	{
		return 0;
	}
	return (duk_uint_t)(tp.tv_sec * 1000 + tp.tv_nsec / 1000000);
}

#endif  /* !DUX_OPT_NO_TIMER && __linux__ */

Add Linux porting (for testing)

Add Linux porting (for testing)


/*
 @ 0xCCCCCCCC
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef KLOG_BASIC_TYPES_H_
#define KLOG_BASIC_TYPES_H_

#include <string>

#include "klog/basic_macros.h"

namespace klog {

#if defined(OS_WIN)
using PathChar = wchar_t;
using PathString = std::wstring;
#else
using PathChar = char;
using PathString = std::string;
#endif

}   // namespace klog

#endif  // KLOG_BASIC_TYPES_H_

/*
 @ 0xCCCCCCCC
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef KLOG_BASIC_TYPES_H_
#define KLOG_BASIC_TYPES_H_

#include <string>

#include "klog/basic_macros.h"

namespace klog {

#if defined(OS_WIN)
using PathChar = wchar_t;
using PathString = std::wstring;
#define PATH_LITERAL(str) L##str
#else
using PathChar = char;
using PathString = std::string;
#define PATH_LITERAL(str) str
#endif

}   // namespace klog

#endif  // KLOG_BASIC_TYPES_H_

Introduce the macro `PATH_LITERAL` for helping construct `PathString`.


#ifndef __ASM_SH_SECTIONS_H
#define __ASM_SH_SECTIONS_H

#include <asm-generic/sections.h>

extern void __nosave_begin, __nosave_end;
extern long __machvec_start, __machvec_end;
extern char __uncached_start, __uncached_end;
extern char _ebss[];
extern char __start_eh_frame[], __stop_eh_frame[];

#endif /* __ASM_SH_SECTIONS_H */

#ifndef __ASM_SH_SECTIONS_H
#define __ASM_SH_SECTIONS_H

#include <asm-generic/sections.h>

extern long __nosave_begin, __nosave_end;
extern long __machvec_start, __machvec_end;
extern char __uncached_start, __uncached_end;
extern char _ebss[];
extern char __start_eh_frame[], __stop_eh_frame[];

#endif /* __ASM_SH_SECTIONS_H */

Change __nosave_XXX symbols to long

sh: Change __nosave_XXX symbols to long

This patch changes the:
 - __nosave_begin
 - __nosave_end
symbols from 'void' to 'long' as required by the latest
Gcc (4.5.2) which raises the compilation error:

cc1: warnings being treated as errors
arch/sh/kernel/swsusp.c: In function 'pfn_is_nosave':
arch/sh/kernel/swsusp.c:24:28: error: taking address of expression of type 'void'
arch/sh/kernel/swsusp.c:25:26: error: taking address of expression of type 'void'
arch/sh/kernel/swsusp.c:25:26: error: taking address of expression of type 'void'
arch/sh/kernel/swsusp.c:25:26: error: taking address of expression of type 'void'

Signed-off-by: Francesco Virlinzi <00d6e8a4362f3bfb0eaf689488e556cc379113b6@st.com>
Signed-off-by: Paul Mundt <38b52dbb5f0b63d149982b6c5de788ec93a89032@linux-sh.org>


#pragma once
#ifndef YOU_CONTROLLER_TESTS_EXCLUSIONS_H_
#define YOU_CONTROLLER_TESTS_EXCLUSIONS_H_

// A local define since there is no way to test whether a header file exists.
// If you have VS Premium, then add it to the project definition (user
// properties) file
#ifdef MS_CPP_CODECOVERAGE

/// \file Exclusions from code coverage analysis.
/// See http://msdn.microsoft.com/en-sg/library/dd537628.aspx

#include <CodeCoverage/CodeCoverage.h>
#pragma managed(push, off)

ExcludeFromCodeCoverage(boost, L"boost::*");
ExcludeFromCodeCoverage(You_QueryEngine, L"You::QueryEngine::*");

#pragma managed(pop)

#endif  // MS_CPP_CODECOVERAGE

#endif  // YOU_CONTROLLER_TESTS_EXCLUSIONS_H_

#pragma once
#ifndef YOU_CONTROLLER_TESTS_EXCLUSIONS_H_
#define YOU_CONTROLLER_TESTS_EXCLUSIONS_H_

// A local define since there is no way to test whether a header file exists.
// If you have VS Premium, then add it to the project definition (user
// properties) file
#ifdef MS_CPP_CODECOVERAGE

/// \file Exclusions from code coverage analysis.
/// See http://msdn.microsoft.com/en-sg/library/dd537628.aspx

#include <CodeCoverage/CodeCoverage.h>
#pragma managed(push, off)

ExcludeFromCodeCoverage(boost, L"boost::*");
ExcludeFromCodeCoverage(You_NLP, L"You::NLP::*");
ExcludeFromCodeCoverage(You_QueryEngine, L"You::QueryEngine::*");
ExcludeFromCodeCoverage(You_Utils, L"You::Utils::*");

#pragma managed(pop)

#endif  // MS_CPP_CODECOVERAGE

#endif  // YOU_CONTROLLER_TESTS_EXCLUSIONS_H_

Exclude 3rd party code from the controller tests code coverage.


// Copyright 2015 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.

#import <UIKit/UIKit.h>
#import "sky/shell/shell_view.h"

@interface SkySurface : UIView

-(instancetype) initWithShellView:(sky::shell::ShellView *) shellView;

@end

extern "C" {
void SaveFrameToSkPicture();
}

Remove deleted header declaration for SaveFrameToSkPicture


/* This module exposes to PHP the equivalent of:
 *   // Creates a chdb file containing the key-value pairs specified in the
 *   // array $data, or throws an exception in case of error.
 *   function chdb_create($pathname, $data);
 *
 *   // Represents a loaded chdb file.
 *   class chdb
 *   {
 *           // Loads a chdb file, or throws an exception in case of error.
 *           public function __construct($pathname);
 *
 *           // Returns the value of the given $key, or null if not found.
 *           public function get($key);
 *   }
 */

#ifndef PHP_CHDB_H
#define PHP_CHDB_H

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <php.h>

#define PHP_CHDB_VERSION "0.1"

extern zend_module_entry chdb_module_entry;
#define phpext_chdb_ptr &chdb_module_entry

#endif

/* This module exposes to PHP the equivalent of:
 *   // Creates a chdb file containing the key-value pairs specified in the
 *   // array $data, or throws an exception in case of error.
 *   function chdb_create($pathname, $data);
 *
 *   // Represents a loaded chdb file.
 *   class chdb
 *   {
 *           // Loads a chdb file, or throws an exception in case of error.
 *           public function __construct($pathname);
 *
 *           // Returns the value of the given $key, or null if not found.
 *           public function get($key);
 *   }
 */

#ifndef PHP_CHDB_H
#define PHP_CHDB_H

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <php.h>

#define PHP_CHDB_VERSION "0.1.0"

extern zend_module_entry chdb_module_entry;
#define phpext_chdb_ptr &chdb_module_entry

#endif

Change version to 0.1.0 to follow the PHP standard.


#ifndef GLOBAL__H
#define GLOBAL__H

namespace qflex::global {

// Default verbose level
inline int verbose = 0;

// Max allowed memory (default: 1GB)
inline std::size_t memory_limit = 1L << 30;

// Interval to track memory (default: 0)
inline std::size_t track_memory_seconds = 0;

}  // namespace qflex::global

#endif

#ifndef GLOBAL__H
#define GLOBAL__H

#include <cstddef>

namespace qflex::global {

// Default verbose level
inline int verbose = 0;

// Max allowed memory (default: 1GB)
inline std::size_t memory_limit = 1L << 30;

// Interval to track memory (default: 0)
inline std::size_t track_memory_seconds = 0;

}  // namespace qflex::global

#endif

Add <cstddef> to use std::size_t.

Add <cstddef> to use std::size_t.


//
//  RACDelegateProxy.h
//  ReactiveCocoa
//
//  Created by Cody Krieger on 5/19/12.
//  Copyright (c) 2012 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

// A delegate object suitable for using -rac_signalForSelector:fromProtocol:
// upon.
@interface RACDelegateProxy : NSObject

// The delegate to which messages should be forwarded if not handled by
// any -rac_signalForSelector:fromProtocol: applications.
@property (nonatomic, weak) id rac_proxiedDelegate;

// Creates a delegate proxy which will respond to selectors from `protocol`.
- (instancetype)initWithProtocol:(Protocol *)protocol;

@end

//
//  RACDelegateProxy.h
//  ReactiveCocoa
//
//  Created by Cody Krieger on 5/19/12.
//  Copyright (c) 2012 GitHub, Inc. All rights reserved.
//

#import <Foundation/Foundation.h>

// A delegate object suitable for using -rac_signalForSelector:fromProtocol:
// upon.
@interface RACDelegateProxy : NSObject

// The delegate to which messages should be forwarded if not handled by
// any -rac_signalForSelector:fromProtocol: applications.
@property (nonatomic, unsafe_unretained) id rac_proxiedDelegate;

// Creates a delegate proxy which will respond to selectors from `protocol`.
- (instancetype)initWithProtocol:(Protocol *)protocol;

@end

Use unsafe_unretained for delegates, to support OS X


/*
 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
 * Copyright (C) 2008-2009 PetaLogix
 * Copyright (C) 2006 Atmark Techno, Inc.
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License. See the file "COPYING" in the main directory of this archive
 * for more details.
 */

#ifndef _ASM_MICROBLAZE_SECTIONS_H
#define _ASM_MICROBLAZE_SECTIONS_H

#include <asm-generic/sections.h>

# ifndef __ASSEMBLY__
extern char _ssbss[], _esbss[];
extern unsigned long __ivt_start[], __ivt_end[];
extern char _etext[], _stext[];

extern u32 _fdt_start[], _fdt_end[];

# endif /* !__ASSEMBLY__ */
#endif /* _ASM_MICROBLAZE_SECTIONS_H */

/*
 * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
 * Copyright (C) 2008-2009 PetaLogix
 * Copyright (C) 2006 Atmark Techno, Inc.
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License. See the file "COPYING" in the main directory of this archive
 * for more details.
 */

#ifndef _ASM_MICROBLAZE_SECTIONS_H
#define _ASM_MICROBLAZE_SECTIONS_H

#include <asm-generic/sections.h>

# ifndef __ASSEMBLY__
extern char _ssbss[], _esbss[];
extern unsigned long __ivt_start[], __ivt_end[];

extern u32 _fdt_start[], _fdt_end[];

# endif /* !__ASSEMBLY__ */
#endif /* _ASM_MICROBLAZE_SECTIONS_H */

microblaze: Remove duplicate declarations of _stext[] and _etext[]

They're already provided by <asm/sections.h>.

Signed-off-by: Geert Uytterhoeven <0da414d9d963da4039c2a0525b1844228075aa58@linux-m68k.org>
Cc: Michal Simek <3a191dd2be46e826fee926d532b136ed65cb5318@monstr.eu>
Cc: 1969c2f5333fcd29c58e45a80778895ee5b1b5bd@itee.uq.edu.au
Signed-off-by: Michal Simek <b20e59da6aeb5cea6c82b021069d69f63616c55d@xilinx.com>


#pragma once
#include <aerial_autonomy/actions_guards/base_functors.h>
#include <aerial_autonomy/basic_events.h>
#include <aerial_autonomy/logic_states/base_state.h>
#include <aerial_autonomy/robot_systems/uav_system.h>
#include <parsernode/common.h>

/**
* @brief Internal action when hovering.
*
* @tparam LogicStateMachineT Logic state machine used to process events
*/
template <class LogicStateMachineT>
struct HoveringInternalActionFunctor_
    : EventAgnosticActionFunctor<UAVSystem, LogicStateMachineT> {
  /**
  * @brief Checks for enough battery voltage and land if battery critical
  *
  * @param robot_system robot system to get sensor data
  * @param logic_state_machine logic state machine to trigger events
  */
  void run(UAVSystem &robot_system, LogicStateMachineT &logic_state_machine) {
    parsernode::common::quaddata data = robot_system.getUAVData();
    // Transition to hovering state once reached high altitude
    // Can also use uav status here TODO (Gowtham)
    if (data.batterypercent < 40) {
      logic_state_machine.process_event(Land());
    }
  }
};

/**
* @brief Hovering state that uses internal action
*
* @tparam LogicStateMachineT Logic state machine used to process events
*/
template <class LogicStateMachineT>
using Hovering_ = BaseState<UAVSystem, LogicStateMachineT,
                            HoveringInternalActionFunctor_<LogicStateMachineT>>;

#pragma once
#include <aerial_autonomy/actions_guards/base_functors.h>
#include <aerial_autonomy/basic_events.h>
#include <aerial_autonomy/logic_states/base_state.h>
#include <aerial_autonomy/robot_systems/uav_system.h>
#include <parsernode/common.h>

using namespace basic_events;

/**
* @brief Internal action when hovering.
*
* @tparam LogicStateMachineT Logic state machine used to process events
*/
template <class LogicStateMachineT>
struct HoveringInternalActionFunctor_
    : EventAgnosticActionFunctor<UAVSystem, LogicStateMachineT> {
  /**
  * @brief Checks for enough battery voltage and land if battery critical
  *
  * @param robot_system robot system to get sensor data
  * @param logic_state_machine logic state machine to trigger events
  */
  void run(UAVSystem &robot_system, LogicStateMachineT &logic_state_machine) {
    parsernode::common::quaddata data = robot_system.getUAVData();
    // Transition to hovering state once reached high altitude
    // Can also use uav status here TODO (Gowtham)
    if (data.batterypercent < 40) {
      logic_state_machine.process_event(Land());
    }
  }
};

/**
* @brief Hovering state that uses internal action
*
* @tparam LogicStateMachineT Logic state machine used to process events
*/
template <class LogicStateMachineT>
using Hovering_ = BaseState<UAVSystem, LogicStateMachineT,
                            HoveringInternalActionFunctor_<LogicStateMachineT>>;

Fix bug to avoid compilation failure

Fix bug to avoid compilation failure

The namespace basic_events is missing hovering_functors file


#ifndef GrGLConfig_chrome_DEFINED
#define GrGLConfig_chrome_DEFINED

#define GR_SUPPORT_GLES2    1

// gl2ext.h will define these extensions macros but Chrome doesn't provide
// prototypes.
#define GL_OES_mapbuffer                      0

#define GR_GL_PLATFORM_HEADER       <GLES2/gl2.h>
#define GR_GL_PLATFORM_HEADER_EXT   <GLES2/gl2ext.h>

#define GR_GL_FUNCTION_TYPE

#define GR_GL_PROC_ADDRESS(X)       &X

// chrome always assumes BGRA
#define GR_GL_32BPP_COLOR_FORMAT    GR_BGRA

// glGetError() forces a sync with gpu process on chrome
#define GR_GL_CHECK_ERROR_START     0

#endif

#ifndef GrGLConfig_chrome_DEFINED
#define GrGLConfig_chrome_DEFINED

#define GR_SUPPORT_GLES2    1

// gl2ext.h will define these extensions macros but Chrome doesn't provide
// prototypes.
#define GL_OES_mapbuffer                      0

#define GR_GL_PLATFORM_HEADER       <GLES2/gl2.h>
#define GR_GL_PLATFORM_HEADER_EXT   <GLES2/gl2ext.h>

#define GR_GL_FUNCTION_TYPE

#define GR_GL_PROC_ADDRESS(X)       &X

// chrome always assumes BGRA
#define GR_GL_32BPP_COLOR_FORMAT    GR_GL_BGRA

// glGetError() forces a sync with gpu process on chrome
#define GR_GL_CHECK_ERROR_START     0

#endif

Fix macro in Chrome's GL config file

Fix macro in Chrome's GL config file

Review URL: http://codereview.appspot.com/4308041/

git-svn-id: e8541e15acce502a64c929015570ad1648e548cd@980 2bbb7eff-a529-9590-31e7-b0007b416f81


Add a tag (dummy) header file that will be updated whenever CINT's dictionaries need to be regenerated.

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


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

#ifndef lldb_VariableList_h_
#define lldb_VariableList_h_

#include "ClangForward.h"

namespace lldb_private
{
    void VerifyDecl (clang::Decl *decl);
}

#endif

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

#ifndef lldb_VariableList_h_
#define lldb_VariableList_h_

#include "lldb/Core/ClangForward.h"

namespace lldb_private
{
    void VerifyDecl (clang::Decl *decl);
}

#endif

Use full path to ClangForward.h

Use full path to ClangForward.h

Fixes Linux build.

git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@143038 91177308-0d34-0410-b5e6-96231b3b80d8


#include <string.h>

#include "ruby.h"
#include "rubyspec.h"

#ifdef __cplusplus
extern "C" {
#endif

#ifdef HAVE_RB_PROC_NEW
VALUE concat_func(VALUE args) {
  int i;
  char buffer[500] = {0};
  if (TYPE(val) != T_ARRAY) return Qnil;
  for(i = 0; i < RARRAY_LEN(args); ++i) {
    VALUE v = RARRAY_PTR(args)[i];
    strcat(buffer, StringValuePtr(v));
    strcat(buffer, "_");
  }
  buffer[strlen(buffer) - 1] = 0;
  return rb_str_new2(buffer);

}

VALUE sp_underline_concat_proc(VALUE self) {
  return rb_proc_new(concat_func, Qnil);
}
#endif

void Init_proc_spec() {
  VALUE cls;
  cls = rb_define_class("CApiProcSpecs", rb_cObject);

#ifdef HAVE_RB_PROC_NEW
  rb_define_method(cls, "underline_concat_proc", sp_underline_concat_proc, 0);
#endif
}

#ifdef __cplusplus
}
#endif

#include <string.h>

#include "ruby.h"
#include "rubyspec.h"

#ifdef __cplusplus
extern "C" {
#endif

#ifdef HAVE_RB_PROC_NEW
VALUE concat_func(VALUE args) {
  int i;
  char buffer[500] = {0};
  if (TYPE(args) != T_ARRAY) return Qnil;
  for(i = 0; i < RARRAY_LEN(args); ++i) {
    VALUE v = RARRAY_PTR(args)[i];
    strcat(buffer, StringValuePtr(v));
    strcat(buffer, "_");
  }
  buffer[strlen(buffer) - 1] = 0;
  return rb_str_new2(buffer);

}

VALUE sp_underline_concat_proc(VALUE self) {
  return rb_proc_new(concat_func, Qnil);
}
#endif

void Init_proc_spec() {
  VALUE cls;
  cls = rb_define_class("CApiProcSpecs", rb_cObject);

#ifdef HAVE_RB_PROC_NEW
  rb_define_method(cls, "underline_concat_proc", sp_underline_concat_proc, 0);
#endif
}

#ifdef __cplusplus
}
#endif

Fix typo in the commit a5312c77.

Fix typo in the commit a5312c77.


/**
 * @file       BlynkSimpleTinyGSM.h
 * @author     Volodymyr Shymanskyy
 * @license    This project is released under the MIT License (MIT)
 * @copyright  Copyright (c) 2015 Volodymyr Shymanskyy
 * @date       Nov 2016
 * @brief
 *
 */

#ifndef BlynkSimpleTinyGSM_h
#define BlynkSimpleTinyGSM_h

#ifndef BLYNK_INFO_CONNECTION
#define BLYNK_INFO_CONNECTION  "TinyGSM"
#endif

#include <Adapters/BlynkGsmClient.h>

static BlynkArduinoClient _blynkTransport;
BlynkSIM Blynk(_blynkTransport);

#include <BlynkWidgets.h>

#endif

/**
 * @file       BlynkSimpleTinyGSM.h
 * @author     Volodymyr Shymanskyy
 * @license    This project is released under the MIT License (MIT)
 * @copyright  Copyright (c) 2015 Volodymyr Shymanskyy
 * @date       Nov 2016
 * @brief
 *
 */

#ifndef BlynkSimpleTinyGSM_h
#define BlynkSimpleTinyGSM_h

#include <Adapters/BlynkGsmClient.h>

static BlynkArduinoClient _blynkTransport;
BlynkSIM Blynk(_blynkTransport);

#include <BlynkWidgets.h>

#endif

Move conn. type detection to Adataper

Move conn. type detection to Adataper


//PARAM: --disable ana.int.def_exc --enable ana.int.interval --sets solver slr3tp

int g = 0;

int main() {
  int x;

  for(x=0; x < 50; x++){
    g = 1;
  }
  // x = [50, 50] after narrow
  if(x>50){ // live after widen, but dead after narrow
    // node after Pos(x>50) is marked dead at the end
    // but the loop is not with x = [51,2147483647]
    for(int i=0; i<=0; i--){
      g = 57;
    }
  }
}

//PARAM: --disable ana.int.def_exc --enable ana.int.interval --sets solver slr3tp --enable dbg.debug
// dbg.debug manually enabled since update_suite only enables it when it sees normal assertion (without NOWARN)
#include <assert.h>

int g = 0;

int main() {
  int x;

  for(x=0; x < 50; x++){
    g = 1;
  }
  // x = [50, 50] after narrow
  if(x>50){ // live after widen, but dead after narrow
    // node after Pos(x>50) is marked dead at the end
    // but the loop is not with x = [51,2147483647]
    for(int i=0; i<=0; i--){
      g = 57;
    }
    assert(1); // NOWARN (unreachable)
  }
}

Add automatic check to sanity/strict-loop-enter


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

#include "verbose.h"
#include "utils.h"

unsigned utils_execute_command(const char *cmd)
{
    int result = system(cmd);

    if (result == 0) {
        verbose_log(0, LOG_WARNING, "%s: '%s' succeeded.",
                    __FUNCTION__, cmd);
        return 1;
    } else {
        if (result == -1) {
            verbose_log(0, LOG_WARNING,
                        "%s: Unable to invoke '%s'.", __FUNCTION__, cmd);
        } else if (result != 0) {
            verbose_log(0, LOG_WARNING,
                        "%s: '%s' failed.  Return code: %d.",
                        __FUNCTION__, cmd, result);
        }
        return 0;
    }
}

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

#include "verbose.h"
#include "utils.h"

unsigned utils_execute_command(const char *cmd)
{
    int result = system(cmd);

    if (result == 0) {
        verbose_log(7, LOG_WARNING, "%s: '%s' succeeded.",
                    __FUNCTION__, cmd);
        return 1;
    } else {
        if (result == -1) {
            verbose_log(0, LOG_WARNING,
                        "%s: Unable to invoke '%s'.", __FUNCTION__, cmd);
        } else if (result != 0) {
            verbose_log(0, LOG_WARNING,
                        "%s: '%s' failed.  Return code: %d.",
                        __FUNCTION__, cmd, result);
        }
        return 0;
    }
}

Reduce spew when using system().

ADHD: Reduce spew when using system().

Details

  Increase the verbosity which is required to output messages about
  the successful use of 'system()'.

  In short, we don't really care about success; if the command
  executed, it's not really necessary to see each command which is
  executed at verbosity 0.

  Failures are still reported at verbosity 0.

Testing

  Built ADHD on tegra2_aebl, x86-mario.
  Visual inspection.

BUG=chromium-os:19558
TEST=See above.

Change-Id: Ib1743385e7fc54cb29a098b7e0912ca55a292503
Signed-off-by: Taylor Hutt <39a9c928d8a3a00d7fd484a843cc4ccfc80af42c@chromium.org>


#ifndef WIDGETS_SLIDERDIRECTJUMP_H
#define WIDGETS_SLIDERDIRECTJUMP_H

#include <QSlider>

class QMouseEvent;

class SliderDirectJump : public QSlider {
  Q_OBJECT

 public:
  explicit SliderDirectJump(QWidget* parent = nullptr);
  explicit SliderDirectJump(Qt::Orientation orientation, QWidget* parent = nullptr);
  ~SliderDirectJump() override;

  bool isPressed();

 signals:
  void valueClicked(int value);

 private:
  void init();

 protected:
  void mousePressEvent(QMouseEvent* event) override;
  void mouseReleaseEvent(QMouseEvent* event) override;

  int computeHorizontalValue(int x);

 private:
  bool m_isPressed;
  int m_handleWidth{0};
};

#endif  // WIDGETS_SLIDERDIRECTJUMP_H

#ifndef WIDGETS_SLIDERDIRECTJUMP_H
#define WIDGETS_SLIDERDIRECTJUMP_H

#include <QSlider>

class QMouseEvent;

class SliderDirectJump : public QSlider {
  Q_OBJECT

 public:
  explicit SliderDirectJump(QWidget* parent = nullptr);
  explicit SliderDirectJump(Qt::Orientation orientation, QWidget* parent = nullptr);
  ~SliderDirectJump() override;

  bool isPressed();

 signals:
  void valueClicked(int value);

 private:
  void init();

 protected:
  void mousePressEvent(QMouseEvent* event) override;
  void mouseReleaseEvent(QMouseEvent* event) override;

  int computeHorizontalValue(int x);

 private:
  bool m_isPressed{false};
  int m_handleWidth{0};
};

#endif  // WIDGETS_SLIDERDIRECTJUMP_H

Fix playback slider initially acting as pressed


#ifndef RADIOMULT_H
#define RADIOMULT_H

#include "NdbMF.h"

/* ========= NdbRadioMult ============ */
class NdbRad  ioMult : public NdbMF
{
protected:

public:
   NdbRadioMult()
      : NdbMF(9, "Multiplicities for radioactive nuclide production") {}
   ~NdbRadioMult() {}

   ClassDef(NdbRadioMult,1)
}; // NdbRadioMult

#endif

#ifndef RADIOMULT_H
#define RADIOMULT_H

#include "NdbMF.h"

/* ========= NdbRadioMult ============ */
class NdbRadioMult : public NdbMF
{
protected:

public:
   NdbRadioMult()
      : NdbMF(9, "Multiplicities for radioactive nuclide production") {}
   ~NdbRadioMult() {}

   ClassDef(NdbRadioMult,1)
}; // NdbRadioMult

#endif

Fix typo in tab removal

Fix typo in tab removal


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

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

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

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

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

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


// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_CONSENSUS_CONSENSUS_H
#define BITCOIN_CONSENSUS_CONSENSUS_H

/** The maximum allowed size for a serialized block, in bytes (network rule) */
static const unsigned int MAX_BLOCK_SIZE = 2000000;
/** The maximum allowed number of signature check operations in a block (network rule) */
static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
static const int COINBASE_MATURITY = 100;

/** Flags for LockTime() */
enum {
    /* Use GetMedianTimePast() instead of nTime for end point timestamp. */
    LOCKTIME_MEDIAN_TIME_PAST = (1 << 1),
};

/** Used as the flags parameter to CheckFinalTx() in non-consensus code */
static const unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = LOCKTIME_MEDIAN_TIME_PAST;

#endif // BITCOIN_CONSENSUS_CONSENSUS_H

// Copyright (c) 2009-2010 Satoshi Nakamoto
// Copyright (c) 2009-2014 The Bitcoin Core developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef BITCOIN_CONSENSUS_CONSENSUS_H
#define BITCOIN_CONSENSUS_CONSENSUS_H

/** The maximum allowed size for a serialized block, in bytes (network rule) */
static const unsigned int MAX_BLOCK_SIZE = 2000000;
/** The maximum allowed number of signature check operations in a block (network rule) */
static const unsigned int MAX_BLOCK_SIGOPS = 20000;
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
static const int COINBASE_MATURITY = 100;

/** Flags for LockTime() */
enum {
    /* Use GetMedianTimePast() instead of nTime for end point timestamp. */
    LOCKTIME_MEDIAN_TIME_PAST = (1 << 1),
};

/** Used as the flags parameter to CheckFinalTx() in non-consensus code */
static const unsigned int STANDARD_LOCKTIME_VERIFY_FLAGS = LOCKTIME_MEDIAN_TIME_PAST;

#endif // BITCOIN_CONSENSUS_CONSENSUS_H

Make sigop limit `20000` just as in Bitcoin, ignoring our change to the blocksize limit.


/* We can't use the real errno in ldso, since it has not yet
 * been dynamicly linked in yet. */
#include "sys/syscall.h"
extern int _dl_errno;
#undef __set_errno
#define __set_errno(X) {(_dl_errno) = (X);}
#warning !!! __always_inline redefined waiting for the fixed gcc
#ifdef __always_inline
#undef __always_inline
#define __always_inline inline
#endif

/* We can't use the real errno in ldso, since it has not yet
 * been dynamicly linked in yet. */
#include "sys/syscall.h"
extern int _dl_errno;
#undef __set_errno
#define __set_errno(X) {(_dl_errno) = (X);}

#if __GNUC_PREREQ (4, 1)
#warning !!! gcc 4.1 and later have problems with __always_inline so redefined as inline
# ifdef __always_inline
# undef __always_inline
# define __always_inline inline
# endif
#endif

Make sh4 build works again adding a temporary work-around
iby redefining __always_inline to inline until gcc 4.x.x will get
fixed.

Signed-off-by: Carmelo Amoroso <532378793705a04edd56deb76ad8c0442834d55d@st.com>


//
//  EPSPlayerViewModel.h
//  ReactiveAudioPlayer
//
//  Created by Peter Stuart on 4/24/14.
//  Copyright (c) 2014 Electric Peel, LLC. All rights reserved.
//

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

@interface EPSPlayerViewModel : NSObject

@property (nonatomic) NSURL *audioURL;

@property (readonly) NSTimeInterval duration;

@property (readonly) NSTimeInterval currentTime;

@property (readonly) NSString *elapsedTimeString;

@property (readonly) NSString *remainingTimeString;

@property (readonly, getter = isPlaying) BOOL playing;

// Commands

@property (readonly) RACCommand *playCommand;

@property (readonly) RACCommand *pauseCommand;

@property (readonly) RACCommand *togglePlayPauseCommand;

@property (nonatomic, getter = isSeeking) BOOL seeking;

- (void)seekToTime:(NSTimeInterval)time;

@end

//
//  EPSPlayerViewModel.h
//  ReactiveAudioPlayer
//
//  Created by Peter Stuart on 4/24/14.
//  Copyright (c) 2014 Electric Peel, LLC. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <ReactiveCocoa/ReactiveCocoa.h>
#import <AVFoundation/AVFoundation.h>

@interface EPSPlayerViewModel : NSObject

@property (nonatomic) NSURL *audioURL;

@property (readonly) AVPlayer *player;

@property (readonly) NSTimeInterval duration;

@property (readonly) NSTimeInterval currentTime;

@property (readonly) NSString *elapsedTimeString;

@property (readonly) NSString *remainingTimeString;

@property (readonly, getter = isPlaying) BOOL playing;

// Commands

@property (readonly) RACCommand *playCommand;

@property (readonly) RACCommand *pauseCommand;

@property (readonly) RACCommand *togglePlayPauseCommand;

@property (nonatomic, getter = isSeeking) BOOL seeking;

- (void)seekToTime:(NSTimeInterval)time;

@end

Make the audio player a public property.


#define MINIAUDIO_IMPLEMENTATION
#define MA_ENABLE_ONLY_SPECIFIC_BACKENDS
#define MA_ENABLE_WASAPI
#define MA_ENABLE_PULSEAUDIO
#define MA_ENABLE_COREAUDIO
#define MA_ENABLE_AAUDIO
#define MA_ENABLE_WEBAUDIO
#define MA_NO_DECODING
#define MA_NO_ENCODING
#define MA_NO_GENERATION
#include "miniaudio.h"

#define MINIAUDIO_IMPLEMENTATION
#define MA_ENABLE_ONLY_SPECIFIC_BACKENDS
#define MA_ENABLE_WASAPI
#define MA_ENABLE_ALSA
#define MA_ENABLE_COREAUDIO
#define MA_ENABLE_AAUDIO
#define MA_ENABLE_WEBAUDIO
#define MA_NO_DECODING
#define MA_NO_ENCODING
#define MA_NO_GENERATION
#include "miniaudio.h"

Switch back to ALSA on Linux;

Switch back to ALSA on Linux;


/* Stuff you put in here is setup once in main() and gets passed around to
 * all test functions and fixture setup/teardown functions in the data
 * argument */
typedef struct _TestConformSharedState
{
  int	 *argc_addr;
  char ***argv_addr;
} TestConformSharedState;

/* This fixture structure is allocated by glib, and before running each test
 * the test_conform_simple_fixture_setup func (see below) is called to
 * initialise it, and test_conform_simple_fixture_teardown is called when
 * the test is finished. */
typedef struct _TestConformSimpleFixture
{
  /**/
} TestConformSimpleFixture;

void test_conform_simple_fixture_setup (TestConformSimpleFixture *fixture,
					gconstpointer data);
void test_conform_simple_fixture_teardown (TestConformSimpleFixture *fixture,
					   gconstpointer data);

/* Stuff you put in here is setup once in main() and gets passed around to
 * all test functions and fixture setup/teardown functions in the data
 * argument */
typedef struct _TestConformSharedState
{
  int	 *argc_addr;
  char ***argv_addr;
} TestConformSharedState;

/* This fixture structure is allocated by glib, and before running each test
 * the test_conform_simple_fixture_setup func (see below) is called to
 * initialise it, and test_conform_simple_fixture_teardown is called when
 * the test is finished. */
typedef struct _TestConformSimpleFixture
{
  /**/
  int dummy;
} TestConformSimpleFixture;

void test_conform_simple_fixture_setup (TestConformSimpleFixture *fixture,
					gconstpointer data);
void test_conform_simple_fixture_teardown (TestConformSimpleFixture *fixture,
					   gconstpointer data);

Add int dummy; to empty struct TestConformSimpleFixture definition.


#pragma once
#include <array>
#include <random>
#include "jkqtplotter/jkqtplotter.h"

#define NDATA 500

class SpeedTestPlot: public JKQtPlotter {
        Q_OBJECT
    protected:
        std::array<double, NDATA> X, Y, Y2;
        const double dx;
        double x0;
        std::chrono::system_clock::time_point t_lastplot;
    public:
        SpeedTestPlot();

        virtual ~SpeedTestPlot();
    public slots:
        void plotNewData();
};

#pragma once
#include <array>
#include <random>
#include <chrono>

#include "jkqtplotter/jkqtplotter.h"

#define NDATA 500

class SpeedTestPlot: public JKQtPlotter {
        Q_OBJECT
    protected:
        std::array<double, NDATA> X, Y, Y2;
        const double dx;
        double x0;
        std::chrono::system_clock::time_point t_lastplot;
    public:
        SpeedTestPlot();

        virtual ~SpeedTestPlot();
    public slots:
        void plotNewData();
};

MSVC: Include <chrono> needed for chrono::system_clock


/*
 * This is included by init/main.c to check for architecture-dependent bugs.
 *
 * Needs:
 *	void check_bugs(void);
 */
#ifndef _ASM_BUGS_H
#define _ASM_BUGS_H

#include <linux/config.h>
#include <asm/cpu.h>
#include <asm/cpu-info.h>

extern void check_bugs32(void);
extern void check_bugs64(void);

static inline void check_bugs(void)
{
	unsigned int cpu = smp_processor_id();

	cpu_data[cpu].udelay_val = loops_per_jiffy;
	check_bugs32();
#ifdef CONFIG_64BIT
	check_bugs64();
#endif
}

#endif /* _ASM_BUGS_H */

/*
 * This is included by init/main.c to check for architecture-dependent bugs.
 *
 * Needs:
 *	void check_bugs(void);
 */
#ifndef _ASM_BUGS_H
#define _ASM_BUGS_H

#include <linux/config.h>
#include <linux/delay.h>
#include <asm/cpu.h>
#include <asm/cpu-info.h>

extern void check_bugs32(void);
extern void check_bugs64(void);

static inline void check_bugs(void)
{
	unsigned int cpu = smp_processor_id();

	cpu_data[cpu].udelay_val = loops_per_jiffy;
	check_bugs32();
#ifdef CONFIG_64BIT
	check_bugs64();
#endif
}

#endif /* _ASM_BUGS_H */

Build fix for certain configurations.

Build fix for certain configurations.

Signed-off-by: Ralf Baechle <92f48d309cda194c8eda36aa8f9ae28c488fa208@linux-mips.org>


#pragma once

/*
 * Splay tree - a self-Adjusting binary search tree,
 * as first described by Daniel Dominic Sleator and Robert Endre Tarjan.
 *
 * https://www.cs.cmu.edu/~sleator/papers/self-adjusting.pdf
 */
templace<class T>
class SplayTree {
  private:
    struct Node {
      Node*  left;
      Node*  right;
      Node*  parent;
      T      data;

      void   rotateLeft()   {}
      void   rotateRight()  {}
      void   splay()        {}
    };

  public:
    void   insert(const T& data) {}
    void   remove(const T& data) {}
    Node*  find(const T& data)   {}
};

Add skeleton for the splay tree implementation


// -*- c-basic-offset: 2 -*-
/*
 *  This file is part of the KDE libraries
 *  Copyright (C) 2006 George Staikos <staikos@kde.org>
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 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
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public License
 *  along with this library; see the file COPYING.LIB.  If not, write to
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA 02110-1301, USA.
 *
 */

#ifndef KJS_UNICODE_H
#define KJS_UNICODE_H

#include <wtf/Platform.h>

#if USE(QT4_UNICODE)
#include "qt4/UnicodeQt4.h"
#elif USE(ICU_UNICODE)
#include <wtf/icu/UnicodeIcu.h>
#else
#error "Unknown Unicode implementation"
#endif

#endif
// vim: ts=2 sw=2 et

// -*- c-basic-offset: 2 -*-
/*
 *  This file is part of the KDE libraries
 *  Copyright (C) 2006 George Staikos <staikos@kde.org>
 *
 *  This library is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public
 *  License as published by the Free Software Foundation; either
 *  version 2 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
 *  Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public License
 *  along with this library; see the file COPYING.LIB.  If not, write to
 *  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 *  Boston, MA 02110-1301, USA.
 *
 */

#ifndef KJS_UNICODE_H
#define KJS_UNICODE_H

#include <wtf/Platform.h>

#if USE(QT4_UNICODE)
#include "qt4/UnicodeQt4.h"
#elif USE(ICU_UNICODE)
#include <wtf/unicode/icu/UnicodeIcu.h>
#else
#error "Unknown Unicode implementation"
#endif

#endif
// vim: ts=2 sw=2 et

Fix mac bustage (more still).

Fix mac bustage (more still).

git-svn-id: bf5cd6ccde378db821296732a091cfbcf5285fbd@18103 bbb929c8-8fbe-4397-9dbb-9b2b20218538


#include <cgreen/slurp.h>
#include <stdlib.h>
#include <stdio.h>

static char *read_all(FILE *file, int gulp);

char *slurp(const char *file_name, int gulp) {
    FILE *file = fopen(file_name, "r");
    if (file == NULL) {
        return NULL;
    }
    char *content = read_all(file, gulp);
    fclose(file);
    return content;
}

static char *read_all(FILE *file, int gulp) {
    char *content = (char *)malloc((gulp + 1) * sizeof(char));
    char *block = content;
    for ( ; ; ) {
        if (fgets(block, gulp + 1, file) == NULL) {
            break;
        }
        block += gulp;
        content = (char *)realloc(content, (block - content + 1) * sizeof(char));
    }
    return content;
}

#include <cgreen/slurp.h>
#include <stdlib.h>
#include <stdio.h>
#include <strings.h>

static char *read_all(FILE *file, int gulp);

char *slurp(const char *file_name, int gulp) {
    FILE *file = fopen(file_name, "r");
    if (file == NULL) {
        return NULL;
    }
    char *content = read_all(file, gulp);
    fclose(file);
    return content;
}

static char *read_all(FILE *file, int gulp) {
    char *content = (char *)malloc(0);
    int sblock = (gulp + 1) * sizeof(char);
    char *block = (char *)malloc(sblock);
    int len = 0;
    int add = 0;
    char *p;
    for ( ; ; ) {
        if (fgets(block, sblock, file) == NULL) {
            break;
        }

        len  = strlen(block);
	add += len;

        p = (char *)realloc(content, add + 1);
	if (p == NULL) {
		exit(1);
	}
        content = p;

	strncat(content, block, len);
    }
    content[add + 1] = '\0';
    free(block);
    return content;
}

Fix read_all and return content without segment fault


//
//  Copyright (c) 2013-2015 Cédric Luthi. All rights reserved.
//

#import <Availability.h>

#import <XCDYouTubeKit/XCDYouTubeClient.h>
#import <XCDYouTubeKit/XCDYouTubeError.h>
#import <XCDYouTubeKit/XCDYouTubeOperation.h>
#import <XCDYouTubeKit/XCDYouTubeVideo.h>
#import <XCDYouTubeKit/XCDYouTubeVideoOperation.h>

#if TARGET_OS_IPHONE
#import <XCDYouTubeKit/XCDYouTubeVideoPlayerViewController.h>
#endif

//
//  Copyright (c) 2013-2015 Cédric Luthi. All rights reserved.
//

#import <TargetConditionals.h>

#import <XCDYouTubeKit/XCDYouTubeClient.h>
#import <XCDYouTubeKit/XCDYouTubeError.h>
#import <XCDYouTubeKit/XCDYouTubeOperation.h>
#import <XCDYouTubeKit/XCDYouTubeVideo.h>
#import <XCDYouTubeKit/XCDYouTubeVideoOperation.h>

#if TARGET_OS_IOS || (!defined(TARGET_OS_IOS) && TARGET_OS_IPHONE)
#import <XCDYouTubeKit/XCDYouTubeVideoPlayerViewController.h>
#endif

Fix conditional import of XCDYouTubeVideoPlayerViewController.h

TARGET_OS_IPHONE used to mean iOS (iPhone or iPad) device or simulator. With recent SDKs it means iOS or watchOS or tvOS.


/**

 */
#import "SVGKSource.h"

@interface SVGKSourceLocalFile : SVGKSource

@property (nonatomic, retain) NSString* filePath;

+ (SVGKSource*)sourceFromFilename:(NSString*)p;

@end

/**

 */
#import "SVGKSource.h"

@interface SVGKSourceLocalFile : SVGKSource

@property (nonatomic, copy) NSString* filePath;

+ (SVGKSource*)sourceFromFilename:(NSString*)p;

@end

Copy the file path, just in case the string was mutable.


int
main()
{
	int x;
	int y;

	x = 1;
	y = 1;
	x = y = 0;
	if(x != 0)
		return 1;
	if(y != 0)
		return 1;
	return 0;
}

Add test for assign as rval

Add test for assign as rval


// for exit, strtol, EXIT_SUCCESS, EXIT_FAILURE
#include <stdlib.h>
// for fprintf, stderr
#include <stdio.h>
// for bool, true, false
#include <stdbool.h>

/**
 * Options from the command line.
 */
struct opts {
	/** The filename. */
	char * filename;

	/** The number of bytes to write. */
	int num_bytes;

	/** Whether O_APPEND should be used. */
	bool append;
};

/**
 * Prints usage.
 */
static void usage(void)
{
	fprintf(stderr, "Usage: atomic_append filename num-bytes [x]\n");
}

/**
 * Reads command line options.
 */
static bool read_opts(struct opts * options, int argc, char * argv[])
{
	char * end;

	if (argc < 3 || argc > 4) {
		// to few or many options supplied
		return false;
	}

	options->filename = argv[1];

	options->num_bytes = strtol(argv[2], &end, 10);
	if (*end != '\0') {
		// 2nd argument not a number
		return false;
	}

	// use 3rd argument to ommit O_APPEND
	options->append = argc != 4;

	// success
	return true;
}

int main(int argc, char * argv[])
{
	struct opts options;

	if (!read_opts(&options, argc, argv)) {
		usage();
		exit(EXIT_FAILURE);
	}

	printf("filename: %s\n", options.filename);
	printf("num-bytes: %i\n", options.num_bytes);
	printf("append: %s\n", options.append ? "yes" : "no");

	return 0;
}

Read and print command line options in 5-3


/*
 * This file contains various random system calls that
 * have a non-standard calling sequence on the Linux/i386
 * platform.
 */

#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/smp.h>
#include <linux/sem.h>
#include <linux/msg.h>
#include <linux/shm.h>
#include <linux/stat.h>
#include <linux/syscalls.h>
#include <linux/mman.h>
#include <linux/file.h>
#include <linux/utsname.h>
#include <linux/ipc.h>

#include <linux/uaccess.h>
#include <linux/unistd.h>

#include <asm/syscalls.h>

/*
 * Do a system call from kernel instead of calling sys_execve so we
 * end up with proper pt_regs.
 */
int kernel_execve(const char *filename,
		  const char *const argv[],
		  const char *const envp[])
{
	long __res;
	asm volatile ("push %%ebx ; movl %2,%%ebx ; int $0x80 ; pop %%ebx"
	: "=a" (__res)
	: "0" (__NR_execve), "ri" (filename), "c" (argv), "d" (envp) : "memory");
	return __res;
}

/*
 * This file contains various random system calls that
 * have a non-standard calling sequence on the Linux/i386
 * platform.
 */

#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/smp.h>
#include <linux/sem.h>
#include <linux/msg.h>
#include <linux/shm.h>
#include <linux/stat.h>
#include <linux/syscalls.h>
#include <linux/mman.h>
#include <linux/file.h>
#include <linux/utsname.h>
#include <linux/ipc.h>

#include <linux/uaccess.h>
#include <linux/unistd.h>

#include <asm/syscalls.h>

/*
 * Do a system call from kernel instead of calling sys_execve so we
 * end up with proper pt_regs.
 */
int kernel_execve(const char *filename,
		  const char *const argv[],
		  const char *const envp[])
{
	long __res;
	asm volatile ("int $0x80"
	: "=a" (__res)
	: "0" (__NR_execve), "b" (filename), "c" (argv), "d" (envp) : "memory");
	return __res;
}

i386: Make kernel_execve() suitable for stack unwinding

The explicit saving and restoring of %ebx was confusing stack
unwind data consumers, and it is plain unnecessary to do this
within the asm(), since that was only introduced for PIC user
mode consumers of the original _syscall3() macro this was
derived from.

Signed-off-by: Jan Beulich <01de09643e0ae62e116f8bd77de435799874b456@novell.com>
Cc: Arnd Bergmann <f2c659f01951776204a6c5b902787d9019fbeebd@arndb.de>
LKML-Reference: <e5dad6bcedd721dbd69f509e405e80212e41ba1e@vpn.id2.novell.com>
Signed-off-by: Ingo Molnar <9dbbbf0688fedc85ad4da37637f1a64b8c718ee2@elte.hu>