#include "stdio.h"

#define MAX_SIZE 10000001
#define MAX_FACTORS 10000

int primes(int n)
{
    int i, d;
    int factors[MAX_FACTORS];

    for(i=0;i < MAX_FACTORS; i++)
        factors[i] = 0;

    i = 0;
    d = 2;

    while(d*d <= n){
        if(n%d == 0){
            while(n%d == 0){
                n /= d;
                factors[i] = d;
            }
            i++;
        }
        d++;
    }

    if(n > 1)
        factors[i++] = d;

    return i;
}

int count(int a, int b, int k){
    int ans = 0;
    for(int i = a; i < (b+1); i++){
        if (primes(i)==k)
            ans++;
    }

    return ans;
}

int main(void)
{
    int t,n,a,b,k;
    a = 2;
    b = 10000000;
    k = 2;
    printf(" Number of integers between %d and %d, each having exactly %d prime divisors : %d" ,a,b,k,count(a,b,k));
    return 1;
}

#include "stdio.h"

#define MAX_SIZE 10000001
#define MAX_FACTORS 10000

int primes(int n)
{
    int i, d;
    int factors[MAX_FACTORS];

    for(i=0;i < MAX_FACTORS; i++)
        factors[i] = 0;

    i = 0;
    d = 2;

    while(d*d <= n){
        if(n%d == 0){
            while(n%d == 0){
                n /= d;
                factors[i] = d;
            }
            i++;
        }
        d++;
    }

    if(n > 1)
        factors[i++] = d;

    return i;
}

int count(int a, int b, int k){
    int ans = 0;
    for(int i = a; i < (b+1); i++){
        if (primes(i)==k)
            ans++;
    }

    return ans;
}

int main(void)
{
    int t,n,a,b,k;
    a = 2;
    b = 10000000;
    k = 2;
    printf(" Number of integers between %d and %d, each having exactly %d prime divisors : %d" ,a,b,k,count(a,b,k));
    return 0;
}

Fix return value of C program

Fix return value of C program


#ifndef TIMER_H
#define TIMER_H

struct timespec t0, t1; /* Start/end time for timer */

/* Timer macros */
#define TIMER_START() clock_gettime(CLOCK_MONOTONIC_RAW, &t0)
#define TIMER_STOP() clock_gettime(CLOCK_MONOTONIC_RAW, &t1)
#define TIMER_ELAPSED_NS() \
    (t1.tv_sec * 1000000000 + t1.tv_nsec) - \
    (t0.tv_sec * 1000000000 + t0.tv_nsec)
#define TIMER_ELAPSED_US() \
    (t1.tv_sec * 1000000 + (double)t1.tv_nsec / 1000) - \
    (t0.tv_sec * 1000000 + (double)t0.tv_nsec / 1000)

#endif /* TIMER_H */

#ifndef TIMER_H
#define TIMER_H

struct timespec t0, t1; /* Start/end time for timer */

/* Timer macros */
#define TIMER_START() clock_gettime(CLOCK_MONOTONIC, &t0)
#define TIMER_STOP() clock_gettime(CLOCK_MONOTONIC, &t1)
#define TIMER_ELAPSED_NS() \
    (t1.tv_sec * 1000000000 + t1.tv_nsec) - \
    (t0.tv_sec * 1000000000 + t0.tv_nsec)
#define TIMER_ELAPSED_US() \
    (t1.tv_sec * 1000000 + (double)t1.tv_nsec / 1000) - \
    (t0.tv_sec * 1000000 + (double)t0.tv_nsec / 1000)

#endif /* TIMER_H */

Use CLOCK_MONOTONIC instead of CLOCK_MONOTONIC_RAW.

shell.it.kth.se doesn't have _RAW.


#ifndef ANIMATION_H
#define ANIMATION_H

#include <vector>

#include "Blittable.h"
#include "Logger.h"

namespace hm
{
	class Animation
	{
		public:
			Animation();
			~Animation();

			void add(Blittable& b);
			void remove(Blittable& b);
			void removeAll();

			int getUnits();
			void setUnits(const int units);
			unsigned int getFrames();
			void setFrames(const unsigned int frames);

			void setAnimationSpeed(const int units, const unsigned int frames = 1);

			virtual void animate() = 0;

		protected:
			int units;
			unsigned int frames;

			std::vector<Blittable*> targets;
	};
}

#endif

#ifndef ANIMATION_H
#define ANIMATION_H

#include <vector>

#include "Blittable.h"
#include "Logger.h"

namespace hm
{
	class Animation
	{
		public:
			Animation();
			~Animation();

			void add(Blittable& b);
			void remove(Blittable& b);
			void removeAll();

			int getUnits();
			void setUnits(const int units);
			unsigned int getFrames();
			void setFrames(const unsigned int frames);

			void setAnimationSpeed(const int units, const unsigned int frames = 1);

			virtual void animate() = 0;
			virtual bool isComplete() = 0;

		protected:
			int units;
			unsigned int frames;

			std::vector<Blittable*> targets;
	};
}

#endif

Add pure virtual isComplete() function.

Add pure virtual isComplete() function.

This function can be used to determine whether an animation has
finished it's task or not.


#ifndef __BOMALLOC_SYSTEM
#define __BOMALLOC_SYSTEM
#include <stdbool.h>
#include <stdlib.h>
#include <unistd.h>

bool speculating(void);
void record_allocation(void * p, size_t t);
int getuniqueid(void);

#endif

[core] Add header file with prototypes that bomalloc needs from the surrounding enviroment


#include "stm8s003_reg.h"

typedef enum {
    PORT_A = PA_ODR,
    PORT_B = PB_ODR,
    PORT_C = PB_,
    PORT_D,
    PORT_E,
    PORT_F
} port_t;

void toggle_port_a_pin(uint8_t pin);
void set_high_port_a_pin(uint8_t pin);
void set_low_port_a_pin(uint8_t pin);
void set

#include "stm8s003_reg.h"

#include <stdint.h>

struct input_pin_config
{
    bool pull_up_enable;
    bool interrupt_enable;
};

struct output_pin_config
{
    bool open_drain_enable;
    bool fast_mode_enable;
};

inline void set_port_a(uint8_t value)
{
    PA_ODR = value;
}

inline void toggle_port_a_pin(uint8_t pin)
{
    set_port_a((*(uart16_t *) PA_ODR) ^ ~(1 << pin));
}

inline void set_high_port_a_pin(uint8_t pin)
{
    set_port_a((*(uint16_t *) PA_ODR) | (1 << pin));
}

inline void set_low_port_a_pin(uint8_t pin)
{
    set_port_a((*(uart16_t *) PA_ODR) & ~(1 << pin));
}

inline void read_port_a(uint8_t * value)
{
    &value = (uint16_t *) PA_IDR;
}

inline bool read_port_a_pin(uint8_t pin)
{
    uint8_t value;
    read_port_a_pin(value);
    return value >> pin;
}

inline void configure_port_a_input_pin(struct input_pin_config * config);
inline void configure_port_a_output_pin(struct output_pin_config * config);

Add some inline functions for configuring gpio.


/*
 * $FreeBSD$
 *
 * Smoke test for `ls` utility
 */

#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include "functional_test.h"

int
main(int argc, char *argv[])
{
  while ((opt = getopt_long(argc, argv, short_options,
                  long_options, &option_index)) != -1) {
    switch(opt) {
      case 0:     /* valid long option */
        /* generate the valid command for execution */
        snprintf(command, sizeof(command),
                "/bin/ls --%s > /dev/null", long_options[option_index].name);
        ret = system(command);

        if (ret == -1) {
          fprintf(stderr, "Failed to create child process\n");
          exit(EXIT_FAILURE);
        }

        if (!WIFEXITED(ret)) {
          fprintf(stderr, "Child process failed to terminate normally\n");
          exit(EXIT_FAILURE);
        }

        if (WEXITSTATUS(ret))
          fprintf(stderr, "\nValid option '--%s' failed to execute\n",
                  long_options[option_index].name);
        else
          printf("Successful: '--%s'\n", long_options[option_index].name);

        break;

      case '?':   /* invalid long option */
        break;

      default:
        printf("getopt_long returned character code %o\n", opt);
    }
  }

  exit(EXIT_SUCCESS);
}

/*
 * $FreeBSD$
 *
 * Smoke test for `ls` utility
 */

#include <getopt.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/wait.h>
#include "functional_test.h"

int
main(int argc, char *argv[])
{
  while ((opt = getopt_long(argc, argv, short_options,
                  long_options, &option_index)) != -1) {
    switch(opt) {
      case 0:     /* valid long option */
        /* generate the valid command for execution */
        snprintf(command, sizeof(command),
                "/bin/ls --%s > /dev/null", long_options[option_index].name);
        ret = system(command);

        if (ret == -1) {
          fprintf(stderr, "Failed to create child process\n");
          exit(EXIT_FAILURE);
        }

        if (!WIFEXITED(ret)) {
          fprintf(stderr, "Child process failed to terminate normally\n");
          exit(EXIT_FAILURE);
        }

        if (WEXITSTATUS(ret))
          fprintf(stderr, "\nValid option '--%s' failed to execute\n",
                  long_options[option_index].name);
        else
          printf("Successful: '--%s'\n", long_options[option_index].name);

        break;

      case '?':   /* invalid long option */
        break;

      default:
        printf("getopt_long returned character code %o\n", opt);
    }
  }

  exit(EXIT_SUCCESS);
}

Fix compilation error on FreeBSD

Fix compilation error on FreeBSD

Error log -
  ```
  undefined reference to `WIFEXITED'
  undefined reference to `WEXITSTATUS'
  ```

Apparently the header file <sys/wait.h> has to be included in FreeBSD
unlike on Linux (Ubuntu 16.10) since it is included by <stdlib.h>.


#ifndef __SETTINGS_H_
#define __SETTINGS_H_
#include <Arduino.h>
#include "Device.h"

// This section is for devices and their configuration
//Kit:
#define HAS_STD_LIGHTS (1)
#define LIGHTS_PIN 5
#define HAS_STD_CAPE (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_PILOT (1)
#define HAS_STD_CAMERAMOUNT (1)
#define CAMERAMOUNT_PIN 3
#define CAPE_VOLTAGE_PIN 0
#define CAPE_CURRENT_PIN 3

//After Market:
#define HAS_STD_CALIBRATIONLASERS (0)
#define CALIBRATIONLASERS_PIN 6
#define HAS_POLOLU_MINIMUV (1)
#define HAS_MS5803_14BA (0)
#define MS5803_14BA_I2C_ADDRESS 0x76

#define MIDPOINT 1500
#define LOGGING (1)

class Settings : public Device {
  public:
    static int smoothingIncriment; //How aggressive the throttle changes
    static int deadZone_min;
    static int deadZone_max;
    static int capability_bitarray;

    Settings():Device(){};
    void device_setup();
    void device_loop(Command cmd);
};

#endif

#ifndef __SETTINGS_H_
#define __SETTINGS_H_
#include <Arduino.h>
#include "Device.h"

// This section is for devices and their configuration
//Kit:
#define HAS_STD_LIGHTS (1)
#define LIGHTS_PIN 5
#define HAS_STD_CAPE (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_PILOT (1)
#define HAS_STD_CAMERAMOUNT (1)
#define CAMERAMOUNT_PIN 3
#define CAPE_VOLTAGE_PIN 0
#define CAPE_CURRENT_PIN 3

//After Market:
#define HAS_STD_CALIBRATIONLASERS (0)
#define CALIBRATIONLASERS_PIN 6
#define HAS_POLOLU_MINIMUV (0)
#define HAS_MS5803_14BA (0)
#define MS5803_14BA_I2C_ADDRESS 0x76

#define MIDPOINT 1500
#define LOGGING (1)

class Settings : public Device {
  public:
    static int smoothingIncriment; //How aggressive the throttle changes
    static int deadZone_min;
    static int deadZone_max;
    static int capability_bitarray;

    Settings():Device(){};
    void device_setup();
    void device_loop(Command cmd);
};

#endif

Reset default settings to stock kit configuration


/* GTK+ Integration with platform-specific application-wide features
 * such as the OS X menubar and application delegate concepts.
 *
 * Copyright (C) 2009 Paul Davis
 * Copyright © 2010 John Ralls
 *
 * 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; version 2.1
 * of the License.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#import <Cocoa/Cocoa.h>

@interface GtkApplicationDelegate : NSObject <NSApplicationDelegate> {}
@end

/* GTK+ Integration with platform-specific application-wide features
 * such as the OS X menubar and application delegate concepts.
 *
 * Copyright (C) 2009 Paul Davis
 * Copyright © 2010 John Ralls
 *
 * 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; version 2.1
 * of the License.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#import <Cocoa/Cocoa.h>
#include <AvailabilityMacros.h>

#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
@interface GtkApplicationDelegate : NSObject <NSApplicationDelegate> {}
#else
@interface GtkApplicationDelegate : NSObject {}
#endif
@end

Fix compile error on Leopard & Tiger.

Fix compile error on Leopard & Tiger.


/* Copyright 2015 Stanford University
 *
 * 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 __LEGION_TERRA_UTIL_H__
#define __LEGION_TERRA_UTIL_H__

#include "legion_c_util.h"

template<typename T, typename W = LegionRuntime::HighLevel::CObjectWrapper>
void lua_push_opaque_object(lua_State* L, T obj)
{
  void* ptr = W::unwrap(obj);

  lua_newtable(L);
  lua_pushstring(L, "impl");
  lua_pushlightuserdata(L, ptr);
  lua_settable(L, -3);
}

template<typename T>
void lua_push_opaque_object_array(lua_State* L, T* objs, unsigned num_objs)
{
  lua_newtable(L);
  for(unsigned i = 0; i < num_objs; ++i)
  {
    lua_push_opaque_object(L, objs[i]);
    lua_pushinteger(L, i + 1);
    lua_insert(L, -2);
    lua_settable(L, -3);
  }
}

#define CHECK_LUA(EXP)                              \
  if ((EXP) != 0)                                   \
  {                                                 \
    fprintf(stderr,                                 \
        "error calling lua function : %s (%s:%d)\n", \
        lua_tostring(L, -1),                        \
        __FILE__, __LINE__);                        \
    exit(-1);                                       \
  }                                                 \

struct ObjectWrapper
{
  typedef LegionRuntime::HighLevel::Mapper::DomainSplit DomainSplit;

  static vector_legion_domain_split_t
  wrap(std::vector<DomainSplit>* slices)
  {
    vector_legion_domain_split_t slices_;
    slices_.impl = slices;
    return slices_;
  }

  static std::vector<DomainSplit>*
  unwrap(vector_legion_domain_split_t slices_)
  {
    return reinterpret_cast<std::vector<DomainSplit>*>(slices_.impl);
  }
};

#endif // __LEGION_TERRA_UTIL_H__

Add a missing file for Terra bindings.

Add a missing file for Terra bindings.


#include <dlfcn.h>

int main(int argc, char* argv[])
{
    dlopen("1//libcoreclr.so", RTLD_NOW | RTLD_GLOBAL);
    dlopen("2//libcoreclrtraceptprovider.so", RTLD_LAZY);
    dlopen("2//libcoreclr.so", RTLD_NOW | RTLD_GLOBAL);

    return 0;
}

//#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdio.h>
#include <string.h>

void *dlopen(const char *filename, int flag)
{
    static void* (*dlopenImpl)(const char *filename, int flag) = 0;
    if(!dlopenImpl)
    {
        dlopenImpl = dlsym(RTLD_NEXT, "dlopen");
    }

    if(strcmp(filename, "2//libcoreclrtraceptprovider.so") == 0)
    {
        printf("Skip loading 2//libcoreclrtraceptprovider.so.\n");
        return 0;
    }

    printf("Calling dlopen(%s).\n", filename);
    return dlopenImpl(filename, flag);
}

int main(int argc, char* argv[])
{
    dlopen("1//libcoreclr.so", RTLD_NOW | RTLD_GLOBAL);
    dlopen("2//libcoreclr.so", RTLD_NOW | RTLD_GLOBAL);

    return 0;
}

Update implementation to hook calls to dlopen.


/// \file
/// \brief Singleton design pattern
///
/// \author Peter 'png' Hille <peter@das-system-networks.de>
#ifndef SINGLETON_HH
#define SINGLETON_HH 1

#include <dsnutil/compiler_features.h>

namespace dsn {
/// \brief Template for singleton classes
///
/// This template can be used to implement the "singleton" design pattern
/// on any class.
template <class Derived> class Singleton {
public:
    /// \brief Access singleton instance
    ///
    /// \return Reference to the instance of this singleton.
    static dsnutil_cpp_DEPRECATED Derived& getInstance() { return instanceRef(); }

    /// \brief Access singleton instance (by reference)
    ///
    /// \return Reference to the initialized singleton instance
    static Derived& instanceRef()
    {
        static Derived instance;
        return instance;
    }

    /// \brief Access singleton instance (by pointer)
    ///
    /// \return Pointer to the initialized singleton instance
    static Derived* instancePtr() { return &instanceRef(); }

protected:
    /// \brief Default constructor
    ///
    /// \note This ctor is protected so that derived classes can implement
    /// their own logics for object initialization while still maintaining
    /// the impossibility of direct ctor calls!
    Singleton() {}

private:
    /// \brief Copy constructor
    ///
    /// \note This ctor is private to prevent multiple instances of the same
    /// singleton from being created through object assignments!
    Singleton(const Singleton&) {}
};
}

#endif // !SINGLETON_HH

/// \file
/// \brief Singleton design pattern
///
/// \author Peter 'png' Hille <peter@das-system-networks.de>
#ifndef SINGLETON_HH
#define SINGLETON_HH 1

namespace dsn {
/// \brief Template for singleton classes
///
/// This template can be used to implement the "singleton" design pattern
/// on any class.
template <class Derived> class Singleton {
public:
    /// \brief Access singleton instance (by reference)
    ///
    /// \return Reference to the initialized singleton instance
    static Derived& instanceRef()
    {
        static Derived instance;
        return instance;
    }

    /// \brief Access singleton instance (by pointer)
    ///
    /// \return Pointer to the initialized singleton instance
    static Derived* instancePtr() { return &instanceRef(); }

protected:
    /// \brief Default constructor
    ///
    /// \note This ctor is protected so that derived classes can implement
    /// their own logics for object initialization while still maintaining
    /// the impossibility of direct ctor calls!
    Singleton() {}

private:
    /// \brief Copy constructor
    ///
    /// \note This ctor is private to prevent multiple instances of the same
    /// singleton from being created through object assignments!
    Singleton(const Singleton&) {}
};
}

#endif // !SINGLETON_HH

Remove deprecated instance() method from Singleton


/*
 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
 *
 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 */
#ifndef _BITS_UCLIBC_ERRNO_H
#define _BITS_UCLIBC_ERRNO_H 1

#ifdef IS_IN_rtld
# undef errno
# define errno _dl_errno
extern int _dl_errno; // attribute_hidden;
#elif defined __UCLIBC_HAS_THREADS__
# include <tls.h>
# if defined USE___THREAD && USE___THREAD
#  undef errno
#  ifndef NOT_IN_libc
#   define errno __libc_errno
#  else
#   define errno errno
#  endif
extern __thread int errno __attribute_tls_model_ie;
# endif /* USE___THREAD */
#endif /* IS_IN_rtld */

#define __set_errno(val) (errno = (val))

#ifndef __ASSEMBLER__
extern int *__errno_location (void) __THROW __attribute__ ((__const__))
# ifdef IS_IN_rtld
	attribute_hidden
# endif
;
# if defined __UCLIBC_HAS_THREADS__
#  include <tls.h>
#  if defined USE___THREAD && USE___THREAD
libc_hidden_proto(__errno_location)
#  endif
# endif

#endif /* !__ASSEMBLER__ */

#endif

/*
 * Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
 *
 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
 */
#ifndef _BITS_UCLIBC_ERRNO_H
#define _BITS_UCLIBC_ERRNO_H 1

#ifdef IS_IN_rtld
# undef errno
# define errno _dl_errno
extern int _dl_errno; // attribute_hidden;
#elif defined __UCLIBC_HAS_THREADS__
# include <tls.h>
# if defined USE___THREAD && USE___THREAD
#  undef errno
#  ifndef NOT_IN_libc
#   define errno __libc_errno
#  else
#   define errno errno
#  endif
extern __thread int errno attribute_tls_model_ie;
# endif /* USE___THREAD */
#endif /* IS_IN_rtld */

#define __set_errno(val) (errno = (val))

#ifndef __ASSEMBLER__
extern int *__errno_location (void) __THROW __attribute__ ((__const__))
# ifdef IS_IN_rtld
	attribute_hidden
# endif
;
# if defined __UCLIBC_HAS_THREADS__
#  include <tls.h>
#  if defined USE___THREAD && USE___THREAD
libc_hidden_proto(__errno_location)
#  endif
# endif

#endif /* !__ASSEMBLER__ */

#endif

Fix typo in macro for tls access model

Fix typo in macro for tls access model


#include "C_func_file.h"

void multiply_by_10_in_C(double arr[], unsigned int n)
{
    for (int i = 0; i < n; i++) {
        arr[i] *= 10;
    }
}

#include "C_func_file.h"

void multiply_by_10_in_C(double arr[], unsigned int n)
{
    unsigned int i;
    for (i = 0; i < n; i++) {
        arr[i] *= 10;
    }
}

Fix warning about "comparison between signed and unsigned" in example and make it fully C89 compatible.


// PARAM: --enable ana.int.interval
#include <pthread.h>
#include <assert.h>

int g = 0;

void *worker(void *arg )
{
  return NULL;
}

int main(int argc , char **argv )
{
  pthread_t tid;
  pthread_create(& tid, NULL, & worker, NULL);

  while (g >= 10) {

  }
  assert(1); // reachable
  g++;
  assert(1); // reachable
  return 0;
}

Add regression test for TD3 wpoint restart soundness


//
//  FirestackDatabase.h
//  Firestack
//
//  Created by Ari Lerner on 8/23/16.
//  Copyright © 2016 Facebook. All rights reserved.
//

#ifndef FirestackDatabase_h
#define FirestackDatabase_h

#import "Firebase.h"
#import "RCTEventEmitter.h"
#import "RCTBridgeModule.h"

@interface FirestackDatabase : RCTEventEmitter <RCTBridgeModule> {

}

@property (nonatomic) NSDictionary *_DBHandles;
@property (nonatomic, weak) FIRDatabaseReference *ref;

@end

#endif

//
//  FirestackDatabase.h
//  Firestack
//
//  Created by Ari Lerner on 8/23/16.
//  Copyright © 2016 Facebook. All rights reserved.
//

#ifndef FirestackDatabase_h
#define FirestackDatabase_h

#import "Firebase.h"
#import "RCTEventEmitter.h"
#import "RCTBridgeModule.h"

@interface FirestackDatabase : RCTEventEmitter <RCTBridgeModule> {

}

@property NSMutableDictionary *dbReferences;
@property FIRDatabase *database;

@end

#endif

Update missing iOS header changes

Update missing iOS header changes


// RUN: %clang_cc1 -mrtd -triple i386-unknown-freebsd9.0 -emit-llvm -o - %s | FileCheck %s

void baz(int arg);

// CHECK: define x86_stdcallcc void @foo(i32 %arg) nounwind
void foo(int arg) {
// CHECK: call x86_stdcallcc i32 (...)* @bar(i32 %tmp)
  bar(arg);
// CHECK: call x86_stdcallcc void @baz(i32 %tmp1)
  baz(arg);
}

// CHECK: declare x86_stdcallcc i32 @bar(...)

// CHECK: declare x86_stdcallcc void @baz(i32)

// RUN: %clang_cc1 -mrtd -triple i386-unknown-freebsd9.0 -emit-llvm -o - %s | FileCheck %s

void baz(int arg);

// CHECK: define x86_stdcallcc void @foo(i32 %arg) nounwind
void foo(int arg) {
// CHECK: call x86_stdcallcc i32 (...)* @bar(i32
  bar(arg);
// CHECK: call x86_stdcallcc void @baz(i32
  baz(arg);
}

// CHECK: declare x86_stdcallcc i32 @bar(...)

// CHECK: declare x86_stdcallcc void @baz(i32)

Kill off more names to fix this test

Kill off more names to fix this test

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


#ifndef BS_CONFIG_PARSER_H
#define BS_CONFIG_PARSER_H

#include "bs_common.h"

#include <map>
#include <string>
#include <vector>

namespace blue_sky {
	struct wcfg;

	class BS_API bs_cfg_p {
	public:
		friend struct wcfg;

		typedef std::vector<std::string>     vstr_t;
		typedef std::map<std::string,vstr_t> map_t;

		void parse_strings (const std::string &str, bool append = false);
		void read_file (const char *filename);
		void clear_env_map ();
		const map_t &env() const;
		vstr_t getenv(const char *e);

	private:
		bs_cfg_p ();

		map_t env_mp;
	};

	typedef singleton< bs_cfg_p > cfg;

}

#endif // BS_CONFIG_PARSER_H

#ifndef BS_CONFIG_PARSER_H
#define BS_CONFIG_PARSER_H

#include "bs_common.h"

#include <map>
#include <string>
#include <vector>

namespace blue_sky {
	struct wcfg;

	class BS_API bs_cfg_p {
	public:
		friend struct wcfg;

		typedef std::vector<std::string>     vstr_t;
		typedef std::map<std::string,vstr_t> map_t;

		void parse_strings (const std::string &str, bool append = false);
		void read_file (const char *filename);
		void clear_env_map ();
		const map_t &env() const;
		vstr_t getenv(const char *e);

    vstr_t operator[] (const char *e)
    {
      return getenv (e);
    }

	private:
		bs_cfg_p ();

		map_t env_mp;
	};

	typedef singleton< bs_cfg_p > cfg;

  struct bs_config
  {
    bs_cfg_p::vstr_t
    operator [] (const char *e)
    {
      return cfg::Instance ()[e];
    }
  };
}

#endif // BS_CONFIG_PARSER_H

Add bs_config for hide bs_cfg_p::Instance () usage

And add operator[] to getenv


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

#ifndef CHROME_GPU_GPU_CONFIG_H_
#define CHROME_GPU_GPU_CONFIG_H_

// This file declares common preprocessor configuration for the GPU process.

#include "build/build_config.h"

#if defined(OS_LINUX) && !defined(ARCH_CPU_X86)

// Only define GLX support for Intel CPUs for now until we can get the
// proper dependencies and build setup for ARM.
#define GPU_USE_GLX

#endif

#endif  // CHROME_GPU_GPU_CONFIG_H_

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

#ifndef CHROME_GPU_GPU_CONFIG_H_
#define CHROME_GPU_GPU_CONFIG_H_

// This file declares common preprocessor configuration for the GPU process.

#include "build/build_config.h"

#if defined(OS_LINUX) && defined(ARCH_CPU_X86)

// Only define GLX support for Intel CPUs for now until we can get the
// proper dependencies and build setup for ARM.
#define GPU_USE_GLX

#endif

#endif  // CHROME_GPU_GPU_CONFIG_H_

Fix stupid error for Linux build.

Fix stupid error for Linux build.

TEST=none
BUG=none
Review URL: http://codereview.chromium.org/555096

git-svn-id: http://src.chromium.org/svn/trunk/src@37093 4ff67af0-8c30-449e-8e8b-ad334ec8d88c

Former-commit-id: 3c2fc5241d63758ffd4e4c072df9742c8dda3595


/* test for the spiller */
int incs[14];

int bla(int b);

void simpleSort ( int lo, int hi, int d )
{
   int i, j, h, bigN, hp;
   int v;

   for (; hp >= 0; hp--) {
      h = incs[hp];
      if (hp >= 5)
         bla(lo);

      i = lo + h;
      while (1) {
         if (i > hi) break;
         j = i;
         while (bla(d)) {
            j = j - h;
         }
       }
   }
}

int main(void) {
    return 0;
}

Add a main to let it compile.

Add a main to let it compile.

[r16318]


/*
 * Copyright (C) 2014 FU Berlin
 *
 * This file is subject to the terms and conditions of the GNU Lesser
 * General Public License v2.1. See the file LICENSE in the top level
 * directory for more details.
 */

/**
 * @addtogroup  driver_periph
 * @{
 *
 * @file
 * @brief       Low-level CPUID driver implementation
 *
 * @author      Thomas Eichinger <thomas.eichinger@fu-berlin.de>
 */

#include <string.h>

#include "periph/cpuid.h"

extern volatile uint32_t _cpuid_address;

void cpuid_get(void *id)
{
    memcpy(id, (void *)(_cpuid_address), CPUID_ID_LEN);
}

/** @} */

/*
 * Copyright (C) 2014 FU Berlin
 *
 * This file is subject to the terms and conditions of the GNU Lesser
 * General Public License v2.1. See the file LICENSE in the top level
 * directory for more details.
 */

/**
 * @addtogroup  driver_periph
 * @{
 *
 * @file
 * @brief       Low-level CPUID driver implementation
 *
 * @author      Thomas Eichinger <thomas.eichinger@fu-berlin.de>
 */

#include <string.h>

#include "periph/cpuid.h"

extern volatile uint32_t _cpuid_address;

void cpuid_get(void *id)
{
    memcpy(id, (void *)(&_cpuid_address), CPUID_ID_LEN);
}

/** @} */

Use the address of the variable instead of the value itself for the CPUID


/*
* proxy.c
* lexer proxy for Lua parser -- implements __FILE__ and __LINE__
* Luiz Henrique de Figueiredo
* This code is hereby placed in the public domain.
* Add <<#include "proxy.c">> just before the definition of luaX_next in llex.c
*/

#include <string.h>

static int nexttoken(LexState *ls, SemInfo *seminfo)
{
  int t=llex(ls,seminfo);
  if (t==TK_NAME) {
    if (strcmp(getstr(seminfo->ts),"__FILE__")==0) {
      t=TK_STRING;
      seminfo->ts = ls->source;
    }
    else if (strcmp(getstr(seminfo->ts),"__LINE__")==0) {
      t=TK_NUMBER;
      seminfo->r = ls->linenumber;
    }
  }
  return t;
}

#define llex nexttoken

/*
* proxy.c
* lexer proxy for Lua parser -- implements __FILE__ and __LINE__
* Luiz Henrique de Figueiredo
* This code is hereby placed in the public domain.
* Add <<#include "proxy.c">> just before the definition of luaX_next in llex.c
*/

/*
 * Luiz's code changed, per his suggestion, to include some polishing
 * the name for __FILE__, taken from luaU_undump.
 * -- Jeffrey Kegler
 */

#include <string.h>

static int nexttoken(LexState *ls, SemInfo *seminfo)
{
  int t = llex (ls, seminfo);
  if (t == TK_NAME)
    {
      if (strcmp (getstr (seminfo->ts), "__FILE__") == 0)
	{
	  const char *name = ls->source;
	  t = TK_STRING;
	  if (*name == '@' || *name == '=')
	    name = name + 1;
	  else if (*name == LUA_SIGNATURE[0])
	    name = "binary string";
	  seminfo->ts = name;
	}
      else if (strcmp (getstr (seminfo->ts), "__LINE__") == 0)
	{
	  t = TK_NUMBER;
	  seminfo->r = ls->linenumber;
	}
    }
  return t;
}

#define llex nexttoken

Add __FILE__, __LINE__ to Lua

Add __FILE__, __LINE__ to Lua


#ifndef	APIMOCK_INCOMING_REQUEST
#define APIMOCK_INCOMING_REQUEST

#include <string>

namespace ApiMock {
	class IncomingRequest {
	public:
		virtual ~IncomingRequest() {}
		virtual std::string getRequestAsString() = 0;
		virtual void sendResponse(const std::string& responseAsString) = 0;
	};
}

#endif

Add an incoming request object

Add an incoming request object


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

#ifndef __MBEDTLS_DEVICE__
#define __MBEDTLS_DEVICE__

#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT
#define MBEDTLS_AES_ALT
#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
#define MBEDTLS_SHA1_ALT
#define MBEDTLS_SHA256_ALT
#define MBEDTLS_CCM_ALT
#define MBEDTLS_ECDSA_VERIFY_ALT
#define MBEDTLS_ECDSA_SIGN_ALT
#define MBEDTLS_ECDSA_GENKEY_ALT
#define MBEDTLS_ECDH_GEN_PUBLIC_ALT
#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT

#endif //__MBEDTLS_DEVICE__

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

#ifndef __MBEDTLS_DEVICE__
#define __MBEDTLS_DEVICE__

#define MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT
//#define MBEDTLS_AES_ALT
#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
#define MBEDTLS_SHA1_ALT
#define MBEDTLS_SHA256_ALT
#define MBEDTLS_CCM_ALT
#define MBEDTLS_ECDSA_VERIFY_ALT
#define MBEDTLS_ECDSA_SIGN_ALT
#define MBEDTLS_ECDSA_GENKEY_ALT
#define MBEDTLS_ECDH_GEN_PUBLIC_ALT
#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT

#endif //__MBEDTLS_DEVICE__

Make the alternative aes optional

Make the alternative aes optional

Have the alternative aes undefined by default,
in order not to break backwards compatability.
`MBEDTLS_CTR_DRBG_USE_128_BIT_KEY` remains defined for better usability.


/*
    Copyright (C) 2021 William Hart

    This file is part of FLINT.

    FLINT is free software: you can redistribute it and/or modify it under
    the terms of the GNU Lesser General Public License (LGPL) as published
    by the Free Software Foundation; either version 2.1 of the License, or
    (at your option) any later version.  See <https://www.gnu.org/licenses/>.
*/

#include "fq_default_poly.h"

#include <stdlib.h>
#include <stdio.h>
#include <gmp.h>
#include "flint.h"
#include "nmod_poly.h"
#include "ulong_extras.h"

int
main(void)
{
    int i;
    FLINT_TEST_INIT(state);

    flint_printf("init/clear....");
    fflush(stdout);

    for (i = 0; i < 100 * flint_test_multiplier(); i++)
    {
        fq_default_ctx_t ctx;
        fq_default_poly_t fq_poly;
        fmpz_t p;

        fmpz_init(p);

        fmpz_set_ui(p, 5);

        fq_default_ctx_init(ctx, p, 5, "x");

        fq_default_poly_init(fq_poly, ctx);

        fq_default_poly_clear(fq_poly, ctx);

        fq_default_ctx_clear(ctx);

        fq_default_ctx_init(ctx, p, 16, "x");

        fq_default_poly_init(fq_poly, ctx);

        fq_default_poly_clear(fq_poly, ctx);

        fq_default_ctx_clear(ctx);

        fmpz_set_str(p, "73786976294838206473", 10);

        fq_default_ctx_init(ctx, p, 1, "x");

        fq_default_poly_init(fq_poly, ctx);

        fq_default_poly_clear(fq_poly, ctx);

        fq_default_ctx_clear(ctx);

        fmpz_clear(p);

    }

    FLINT_TEST_CLEANUP(state);

    flint_printf("PASS\n");
        return 0;
}

Add rudimentary test for fq_default_poly.


/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#pragma once

#include <gmock/gmock.h>

#include <react/renderer/scheduler/SurfaceHandler.h>

namespace facebook {
namespace react {

class MockSurfaceHandler : public SurfaceHandler {
 public:
  MockSurfaceHandler() : SurfaceHandler("moduleName", 0){};

  MOCK_METHOD(void, setDisplayMode, (DisplayMode), (const, noexcept));
  MOCK_METHOD(SurfaceId, getSurfaceId, (), (const, noexcept));
};

} // namespace react
} // namespace facebook

/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

#pragma once

#include <gmock/gmock.h>

#include <react/renderer/scheduler/SurfaceHandler.h>

namespace facebook {
namespace react {

class MockSurfaceHandler : public SurfaceHandler {
 public:
  MockSurfaceHandler() : SurfaceHandler("moduleName", 0){};

  MOCK_QUALIFIED_METHOD1(setDisplayMode, const noexcept, void(DisplayMode));
  MOCK_QUALIFIED_METHOD0(getSurfaceId, const noexcept, SurfaceId());
};

} // namespace react
} // namespace facebook

Revert D34351084: Migrate from googletest 1.8 to googletest 1.10

Differential Revision:
D34351084 (https://github.com/facebook/react-native/commit/94891ab5f883efa55146dc42e1cd9705506794f3)

Original commit changeset: 939b3985ab63

Original Phabricator Diff: D34351084 (https://github.com/facebook/react-native/commit/94891ab5f883efa55146dc42e1cd9705506794f3)

fbshipit-source-id: 2fd17e0ccd9d1f1d643f4a372d84cb95f5add1f8


// Keyglove controller source code - Special hardware setup file
// 7/17/2011 by Jeff Rowberg <jeff@rowberg.net>

/* ============================================
Controller code is placed under the MIT license
Copyright (c) 2011 Jeff Rowberg

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

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

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

#ifndef _SETUP_BOARD_ATMEGA1280_H_
#define _SETUP_BOARD_ATMEGA1280_H_

void setup_board() {
}

#endif // _SETUP_BOARD_ATMEGA1280_H_

Add board support for preliminary testing with Arduino Mega again


/*
 * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
 *
 * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
 */

#include <../../../../../../../libc/sysdeps/linux/arc/sigaction.c>

/*
 * Copyright (C) 2013 Synopsys, Inc. (www.synopsys.com)
 *
 * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB in this tarball.
 */

/*
 * ARC syscall ABI only has __NR_rt_sigaction, thus vanilla sigaction does
 * some SA_RESTORER tricks before calling __syscall_rt_sigaction.
 * However including that file here causes a redefinition of __libc_sigaction
 * in static links involving pthreads
 */
//#include <../../../../../../../libc/sysdeps/linux/arc/sigaction.c>

ARC/NPTL: Fix __libc_sigaction redefinition with static links

Signed-off-by: Vineet Gupta <af669d95a4c0de051445d4cafdbb2c5c4a2838be@synopsys.com>
Signed-off-by: Bernhard Reutner-Fischer <ce1ac9e9ad16abccd7821f371ad381197b4768ac@gmail.com>


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

#ifndef CRATE_DEMO_GRAPHICS_MANAGER_H
#define CRATE_DEMO_GRAPHICS_MANAGER_H

#include "common/graphics_manager_base.h"

#include <d3d11.h>
#include "DirectXMath.h"

namespace CrateDemo {

class GameStateManager;

struct Vertex {
	DirectX::XMFLOAT3 pos;
	DirectX::XMFLOAT4 color;
};

class GraphicsManager : public Common::GraphicsManagerBase {
public:
	GraphicsManager(GameStateManager *gameStateManager);

private:
	GameStateManager *m_gameStateManager;

	ID3D11RenderTargetView *m_renderTargetView;

public:
	bool Initialize(int clientWidth, int clientHeight, HWND hwnd);
	void Shutdown();
	void DrawFrame();
	void OnResize(int newClientWidth, int newClientHeight);
	void GamePaused();
	void GameUnpaused();
};

} // End of namespace CrateDemo

#endif

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

#ifndef CRATE_DEMO_GRAPHICS_MANAGER_H
#define CRATE_DEMO_GRAPHICS_MANAGER_H

#include "common/graphics_manager_base.h"

#include <d3d11.h>
#include "DirectXMath.h"

namespace CrateDemo {

class GameStateManager;

struct Vertex {
	DirectX::XMFLOAT3 pos;
	DirectX::XMFLOAT4 color;
};

struct MatrixBufferType {
	DirectX::XMMATRIX world;
	DirectX::XMMATRIX view;
	DirectX::XMMATRIX projection;
};

class GraphicsManager : public Common::GraphicsManagerBase {
public:
	GraphicsManager(GameStateManager *gameStateManager);

private:
	GameStateManager *m_gameStateManager;

	ID3D11RenderTargetView *m_renderTargetView;

public:
	bool Initialize(int clientWidth, int clientHeight, HWND hwnd);
	void Shutdown();
	void DrawFrame();
	void OnResize(int newClientWidth, int newClientHeight);
	void GamePaused();
	void GameUnpaused();
};

} // End of namespace CrateDemo

#endif

CRATE_DEMO: Create MatrixBufferType struct to hold current world, view, and projection matricies


//
//  SVPullToRefresh.h
//  SVPullToRefreshDemo
//
// Created by Sam Vermette on 23.04.12.
// Copyright (c) 2012 samvermette.com. All rights reserved.
//
// https://github.com/samvermette/SVPullToRefresh
//

// this header file is provided for backwards compatibility and will be removed in the future
// here's how you should import SVPullToRefresh now:

#import "UIScrollView+SVPullToRefresh.h"
#import "UIScrollView+SVInfiniteScrolling.h"
#import "SVPullToRefreshLoadingView.h"
#import "SVInfiniteScrollingLoadingView.h"

Add loading view to SVPUllToRefresh header


/* vim: set filetype=cpp: */

/** Header file for canonpy.
 *
 * Currently it merely contains the definition of the object structure of the
 * classes defined in canonpy.  They are put here in case a C API is intended
 * to be added for canonpy.
 */

#ifndef DRUDGE_CANONPY_H
#define DRUDGE_CANONPY_H

#include <Python.h>

#include <libcanon/perm.h>

using libcanon::Simple_perm;

//
// Permutation type
// ----------------
//

/** Object type for canonpy Perm objects.
 */

// clang-format off
typedef struct {
    PyObject_HEAD
    Simple_perm perm;
} Perm_object;
// clang-format on

#endif

/* vim: set filetype=cpp: */

/** Header file for canonpy.
 *
 * Currently it merely contains the definition of the object structure of the
 * classes defined in canonpy.  They are put here in case a C API is intended
 * to be added for canonpy.
 */

#ifndef DRUDGE_CANONPY_H
#define DRUDGE_CANONPY_H

#include <Python.h>

#include <memory>

#include <libcanon/perm.h>
#include <libcanon/sims.h>

using libcanon::Simple_perm;
using libcanon::Sims_transv;

//
// Permutation type
// ----------------
//

/** Object type for canonpy Perm objects.
 */

// clang-format off
typedef struct {
    PyObject_HEAD
    Simple_perm perm;
} Perm_object;
// clang-format on

//
// Permutation group type
// ----------------------
//

// clang-format off
typedef struct {
    PyObject_HEAD
    std::unique_ptr<Sims_transv<Simple_perm>> transv;
} Group_object;
// clang-format on

#endif

Add object type for permutation groups

Add object type for permutation groups

Inside a permutation group, the Sims transversal system is going to be
stored.


//
//  Lottie.h
//  Pods
//
//  Created by brandon_withrow on 1/27/17.
//
//

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif

#ifndef Lottie_h
#define Lottie_h

//! Project version number for Lottie.
FOUNDATION_EXPORT double LottieVersionNumber;

//! Project version string for Lottie.
FOUNDATION_EXPORT const unsigned char LottieVersionString[];

#import "LOTAnimationTransitionController.h"
#import "LOTAnimationView.h"

#endif /* Lottie_h */

//
//  Lottie.h
//  Pods
//
//  Created by brandon_withrow on 1/27/17.
//
//

#if __has_feature(modules)
@import Foundation;
#else
#import <Foundation/Foundation.h>
#endif

#ifndef Lottie_h
#define Lottie_h

//! Project version number for Lottie.
FOUNDATION_EXPORT double LottieVersionNumber;

//! Project version string for Lottie.
FOUNDATION_EXPORT const unsigned char LottieVersionString[];

#include <TargetConditionals.h>

#if TARGET_OS_IPHONE
#import "LOTAnimationTransitionController.h"
#endif

#import "LOTAnimationView.h"

#endif /* Lottie_h */

Fix public header for macOS

Fix public header for macOS


#include <stdio.h>

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

    if(argc != 2){
        printf("You must supply one argument!\n");
        //this is how you abort a program.
        return 1;
    }

    return 0;
}

#include <stdio.h>

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

    if(argc != 2){
        printf("You must supply one argument!\n");
        //this is how you abort a program.
        return 1;
    }

    int i = 0;

    for(i = 0; argv[1][i] != '\0'; i++){
        char letter = argv[1][i];

        switch(letter){
            case 'a':
            case 'A':
                printf("%d: 'A'\n",i);
                break;
            case 'e':
            case 'E':
                printf("%d: 'E'\n",i);
                break;
            case 'i':
            case 'I':
                printf("%d: 'I'\n",i);
                break;
            case 'o':
            case 'O':
                printf("%d: 'O'\n",i);
                break;
            case 'u':
            case 'U':
                printf("%d: 'U'\n",i);
                break;
            default:
                printf("%d:%c is not a vowel.\n",i,letter);
        }
    }

    return 0;
}

Switch on vowels in argument

Switch on vowels in argument


#define MICROPY_HW_BOARD_NAME "iMX RT 1060 EVK"
#define MICROPY_HW_MCU_NAME "IMXRT1062DVJ6A"

// If you change this, then make sure to update the linker scripts as well to
// make sure you don't overwrite code
#define CIRCUITPY_INTERNAL_NVM_SIZE 0

#define BOARD_FLASH_SIZE (8 * 1024 * 1024)

#define MICROPY_HW_LED_STATUS (&pin_GPIO_AD_B0_09)

#define DEFAULT_I2C_BUS_SCL (&pin_GPIO_AD_B1_00)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO_AD_B1_01)

#define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B1_07)
#define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B1_06)

#define CIRCUITPY_DEBUG_UART_TX (&pin_GPIO_AD_B0_12)
#define CIRCUITPY_DEBUG_UART_RX (&pin_GPIO_AD_B0_13)

// Put host on the first USB so that right angle OTG adapters can fit. This is
// the right port when looking at the board.
#define CIRCUITPY_USB_DEVICE_INSTANCE 1
#define CIRCUITPY_USB_HOST_INSTANCE 0

#define MICROPY_HW_BOARD_NAME "iMX RT 1060 EVK"
#define MICROPY_HW_MCU_NAME "IMXRT1062DVJ6A"

// If you change this, then make sure to update the linker scripts as well to
// make sure you don't overwrite code
#define CIRCUITPY_INTERNAL_NVM_SIZE 0

#define BOARD_FLASH_SIZE (8 * 1024 * 1024)

#define MICROPY_HW_LED_STATUS (&pin_GPIO_AD_B0_09)
#define MICROPY_HW_LED_STATUS_INVERTED (1)

#define DEFAULT_I2C_BUS_SCL (&pin_GPIO_AD_B1_00)
#define DEFAULT_I2C_BUS_SDA (&pin_GPIO_AD_B1_01)

#define DEFAULT_UART_BUS_RX (&pin_GPIO_AD_B1_07)
#define DEFAULT_UART_BUS_TX (&pin_GPIO_AD_B1_06)

#define CIRCUITPY_DEBUG_UART_TX (&pin_GPIO_AD_B0_12)
#define CIRCUITPY_DEBUG_UART_RX (&pin_GPIO_AD_B0_13)

// Put host on the first USB so that right angle OTG adapters can fit. This is
// the right port when looking at the board.
#define CIRCUITPY_USB_DEVICE_INSTANCE 1
#define CIRCUITPY_USB_HOST_INSTANCE 0

Fix EVK status led to be inverted

Fix EVK status led to be inverted


/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
#ifndef SK_MILESTONE
#define SK_MILESTONE 78
#endif

/*
 * Copyright 2016 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
#ifndef SK_MILESTONE
#define SK_MILESTONE 79
#endif

Update Skia milestone to 79

Update Skia milestone to 79

Change-Id: I248831c58b3c01d356942cd0de61447292720ccb
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/239446
Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
Commit-Queue: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
Auto-Submit: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>


/* Definitions for use with Linux AF_PACKET sockets.
   Copyright (C) 1998, 1999 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

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

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

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

#ifndef __NETPACKET_PACKET_H
#define __NETPACKET_PACKET_H	1

struct sockaddr_ll
  {
    unsigned short int sll_family;
    unsigned short int sll_protocol;
    int sll_ifindex;
    unsigned short int sll_hatype;
    unsigned char sll_pkttype;
    unsigned char sll_halen;
    unsigned char sll_addr[8];
  };

/* Packet types.  */

#define PACKET_HOST		0		/* To us.  */
#define PACKET_BROADCAST	1		/* To all.  */
#define PACKET_MULTICAST	2		/* To group.  */
#define PACKET_OTHERHOST	3		/* To someone else.  */
#define PACKET_OUTGOING		4		/* Originated by us . */
#define PACKET_LOOPBACK		5
#define PACKET_FASTROUTE	6

/* Packet socket options.  */

#define PACKET_ADD_MEMBERSHIP		1
#define PACKET_DROP_MEMBERSHIP		2
#define	PACKET_RECV_OUTPUT		3
#define	PACKET_RX_RING			5
#define	PACKET_STATISTICS		6

struct packet_mreq
  {
    int mr_ifindex;
    unsigned short int mr_type;
    unsigned short int mr_alen;
    unsigned char mr_address[8];
  };

#define PACKET_MR_MULTICAST	0
#define PACKET_MR_PROMISC	1
#define PACKET_MR_ALLMULTI	2

#endif	/* netpacket/packet.h */

Make pump happy. Add in this header. -Erik


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

#ifndef WEBRTC_EXPERIMENTS_H_
#define WEBRTC_EXPERIMENTS_H_

#include "webrtc/typedefs.h"

namespace webrtc {
struct RemoteBitrateEstimatorMinRate {
  RemoteBitrateEstimatorMinRate() : min_rate(30000) {}
  RemoteBitrateEstimatorMinRate(uint32_t min_rate) : min_rate(min_rate) {}

  uint32_t min_rate;
};

struct SkipEncodingUnusedStreams {
  SkipEncodingUnusedStreams() : enabled(false) {}
  explicit SkipEncodingUnusedStreams(bool set_enabled)
    : enabled(set_enabled) {}
  virtual ~SkipEncodingUnusedStreams() {}

  const bool enabled;
};

struct AimdRemoteRateControl {
  AimdRemoteRateControl() : enabled(false) {}
  explicit AimdRemoteRateControl(bool set_enabled)
    : enabled(set_enabled) {}
  virtual ~AimdRemoteRateControl() {}

  const bool enabled;
};
}  // namespace webrtc
#endif  // WEBRTC_EXPERIMENTS_H_

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

#ifndef WEBRTC_EXPERIMENTS_H_
#define WEBRTC_EXPERIMENTS_H_

#include "webrtc/typedefs.h"

namespace webrtc {
struct RemoteBitrateEstimatorMinRate {
  RemoteBitrateEstimatorMinRate() : min_rate(30000) {}
  RemoteBitrateEstimatorMinRate(uint32_t min_rate) : min_rate(min_rate) {}

  uint32_t min_rate;
};

struct AimdRemoteRateControl {
  AimdRemoteRateControl() : enabled(false) {}
  explicit AimdRemoteRateControl(bool set_enabled)
    : enabled(set_enabled) {}
  virtual ~AimdRemoteRateControl() {}

  const bool enabled;
};
}  // namespace webrtc
#endif  // WEBRTC_EXPERIMENTS_H_

Remove no longer used SkipEncodingUnusedStreams.

R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/18829004

git-svn-id: 03ae4fbe531b1eefc9d815f31e49022782c42458@6753 4adac7df-926f-26a2-2b94-8c16560cd09d


/*
 * Copyright (c) 2019, Arm Limited. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <cdefs.h>
#include <stdint.h>

/*
 * Instruction pointer authentication key A. The low 64-bit are at [0], and the
 * high bits at [1]. They are run-time constants so they are placed in the
 * rodata section. They are written before MMU is turned on and the permissions
 * are effective.
 */
uint64_t plat_apiakey[2] __section("rodata.apiakey");

/*
 * This is only a toy implementation to generate a seemingly random 128-bit key
 * from sp and x30 values. A production system must re-implement this function
 * to generate keys from a reliable randomness source.
 */
uint64_t *plat_init_apiakey(void)
{
	uintptr_t return_addr = (uintptr_t)__builtin_return_address(0U);
	uintptr_t frame_addr = (uintptr_t)__builtin_frame_address(0U);

	plat_apiakey[0] = (return_addr << 13) ^ frame_addr;
	plat_apiakey[1] = (frame_addr << 15) ^ return_addr;

	return plat_apiakey;
}

/*
 * Copyright (c) 2019, Arm Limited. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <cdefs.h>
#include <stdint.h>

/*
 * Instruction pointer authentication key A. The low 64-bit are at [0], and the
 * high bits at [1].
 */
uint64_t plat_apiakey[2];

/*
 * This is only a toy implementation to generate a seemingly random 128-bit key
 * from sp and x30 values. A production system must re-implement this function
 * to generate keys from a reliable randomness source.
 */
uint64_t *plat_init_apiakey(void)
{
	uintptr_t return_addr = (uintptr_t)__builtin_return_address(0U);
	uintptr_t frame_addr = (uintptr_t)__builtin_frame_address(0U);

	plat_apiakey[0] = (return_addr << 13) ^ frame_addr;
	plat_apiakey[1] = (frame_addr << 15) ^ return_addr;

	return plat_apiakey;
}

Put Pointer Authentication key value in BSS section

The dummy implementation of the plat_init_apiakey() platform API uses
an internal 128-bit buffer to store the initial key value used for
Pointer Authentication support.

The intent - as stated in the file comments - was for this buffer to
be write-protected by the MMU. Initialization of the buffer would be
performed before enabling the MMU, thus bypassing write protection
checks.

However, the key buffer ended up into its own read-write section by
mistake due to a typo on the section name ('rodata.apiakey' instead of
'.rodata.apiakey', note the leading dot). As a result, the linker
script was not pulling it into the .rodata output section.

One way to address this issue could have been to fix the section
name. However, this approach does not work well for BL1. Being the
first image in the boot flow, it typically is sitting in real ROM
so we don't have the capacity to update the key buffer at any time.

The dummy implementation of plat_init_apiakey() provided at the moment
is just there to demonstrate the Pointer Authentication feature in
action. Proper key management and key generation would have to be a
lot more careful on a production system.

Therefore, the approach chosen here to leave the key buffer in
writable memory but move it to the BSS section. This does mean that
the key buffer could be maliciously updated for intalling unintended
keys on the warm boot path but at the feature is only at an
experimental stage right now, this is deemed acceptable.

Change-Id: I121ccf35fe7bc86c73275a4586b32d4bc14698d6
Signed-off-by: Sandrine Bailleux <4b69fcfca8da45b0c11ecda5434c5da526575d9d@arm.com>


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

#include <haka/stat.h>
#include <haka/types.h>

bool stat_printf(FILE *out, const char *format, ...)
{
	va_list args;
	va_start(args, format);
	vfprintf(out, format, args);
	va_end(args);
	return true;
}

size_t format_bytes(size_t v, char *c)
{
	if (v > (1 << 30)) {
		*c = 'g';
		return (v / (1 << 30));
	}
	else if (v > (1 << 20)) {
		*c = 'm';
		return (v / (1 << 20));
	}
	else if (v > (1 << 10)) {
		*c = 'k';
		return (v / (1 << 10));
	}
	else {
		*c = ' ';
		return v;
	}
}

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

#include <haka/stat.h>
#include <haka/types.h>

bool stat_printf(FILE *out, const char *format, ...)
{
	va_list args;
	va_start(args, format);
	vfprintf(out, format, args);
	va_end(args);
	return true;
}

size_t format_bytes(size_t v, char *c)
{
	if (v > (1 << 30)) {
		*c = 'G';
		return (v / (1 << 30));
	}
	else if (v > (1 << 20)) {
		*c = 'M';
		return (v / (1 << 20));
	}
	else if (v > (1 << 10)) {
		*c = 'k';
		return (v / (1 << 10));
	}
	else {
		*c = ' ';
		return v;
	}
}

Use standard notations for mega (M) and giga (G)


// RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple \
// RUN:   %s -emit-llvm -o - | FileCheck %s

// RUN: cp %s %t.c
// RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple \
// RUN:   %t.c -emit-llvm -o - | FileCheck %s --check-prefix=INTREE
void foo() {}

// Since %s is an absolute path, directory should be a nonempty
// prefix, but the CodeGen part should be part of the filename.

// CHECK: DIFile(filename: "{{.*}}CodeGen{{.*}}debug-info-abspath.c"
// CHECK-SAME:   directory: "{{.+}}")

// INTREE: DIFile({{.*}}directory: "{{.+}}CodeGen{{.*}}")

// RUN: mkdir -p %t/UNIQUEISH_SENTINEL
// RUN: cp %s %t/UNIQUEISH_SENTINEL/debug-info-abspath.c

// RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple \
// RUN:   %t/UNIQUEISH_SENTINEL/debug-info-abspath.c -emit-llvm -o - \
// RUN:   | FileCheck %s

// RUN: cp %s %t.c
// RUN: %clang_cc1 -debug-info-kind=limited -triple %itanium_abi_triple \
// RUN:   %t.c -emit-llvm -o - | FileCheck %s --check-prefix=INTREE
void foo() {}

// Since %s is an absolute path, directory should be the common
// prefix, but the directory part should be part of the filename.

// CHECK: DIFile(filename: "{{.*}}UNIQUEISH_SENTINEL{{.*}}debug-info-abspath.c"
// CHECK-NOT:    directory: "{{.*}}UNIQUEISH_SENTINEL

// INTREE: DIFile({{.*}}directory: "{{.+}}CodeGen{{.*}}")

Make testcase more robust for completely-out-of-tree builds.

Thats to Dave Zarzycki for reprorting this!

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


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

/**
 * @ingroup   tests
 * @{
 *
 * @file
 * @brief     execute libfixmath's unittests in RIOT
 *
 * @author    René Kijewski <rene.kijewski@fu-berlin.de>
 *
 * @}
 */

int main(void)
{
#include "fix16_unittests.inc"

    return 0;
}

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

/**
 * @ingroup   tests
 * @{
 *
 * @file
 * @brief     execute libfixmath's unittests in RIOT
 *
 * @author    René Kijewski <rene.kijewski@fu-berlin.de>
 *
 * @}
 */

#include <stdio.h>

int main(void)
{
#include "fix16_unittests.inc"

    puts("All tests executed.");
    return 0;
}

Add message when tests are finished.

tests/libfixmath_unittests: Add message when tests are finished.


/** @file
  PEI Services Table Pointer Library services

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

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

**/

#ifndef __PEI_SERVICES_TABLE_POINTER_LIB_H__
#define __PEI_SERVICES_TABLE_POINTER_LIB_H__

/**
  The function returns the pointer to PEI services.

  The function returns the pointer to PEI services.
  It will ASSERT() if the pointer to PEI services is NULL.

  @retval  The pointer to PeiServices.

**/
EFI_PEI_SERVICES **
EFIAPI
GetPeiServicesTablePointer (
  VOID
  );

/**
  The function set the pointer of PEI services immediately preceding the IDT table
  according to PI specification.

  @param    PeiServicesTablePointer   The address of PeiServices pointer.
**/
VOID
EFIAPI
SetPeiServicesTablePointer (
  EFI_PEI_SERVICES ** PeiServicesTablePointer
  );

/**
  After memory initialization in PEI phase, the IDT table in temporary memory should
  be migrated to memory, and the address of PeiServicesPointer also need to be updated
  immediately preceding the new IDT table.

  @param    PeiServices   The address of PeiServices pointer.
**/
VOID
EFIAPI
MigrateIdtTable (
  IN EFI_PEI_SERVICES  **PeiServices
  );

#endif

/** @file
  PEI Services Table Pointer Library services

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

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

**/

#ifndef __PEI_SERVICES_TABLE_POINTER_LIB_H__
#define __PEI_SERVICES_TABLE_POINTER_LIB_H__

/**
  The function returns the pointer to PEI services.

  The function returns the pointer to PEI services.
  It will ASSERT() if the pointer to PEI services is NULL.

  @retval  The pointer to PeiServices.

**/
EFI_PEI_SERVICES **
EFIAPI
GetPeiServicesTablePointer (
  VOID
  );

/**
  The function set the pointer of PEI services immediately preceding the IDT table
  according to PI specification.

  @param    PeiServicesTablePointer   The address of PeiServices pointer.
**/
VOID
EFIAPI
SetPeiServicesTablePointer (
  EFI_PEI_SERVICES ** PeiServicesTablePointer
  );

#endif

Remove MigrateIDT interface from PeiServiceTableLib library class.

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


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

#include <cstdint>

/**
 * Interface for a callback object that renders audio into a buffer.
 * This can be passed to an AudioSinkBase or its subclasses.
 */
class IAudioSinkCallback {
public:
    IAudioSinkCallback() { }

    virtual ~IAudioSinkCallback() = default;

    typedef enum {
        CALLBACK_ERROR = -1,
        CALLBACK_CONTINUE = 0,
        CALLBACK_FINISHED = 1,   // stop calling the callback
    } audio_sink_callback_result_t;

    virtual audio_sink_callback_result_t renderAudio(float *buffer, int32_t numFrames) = 0;
};
#endif //ANDROID_AUDIOSINKCALLBACK_H

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

#include <cstdint>

/**
 * Interface for a callback object that renders audio into a buffer.
 * This can be passed to an AudioSinkBase or its subclasses.
 */
class IAudioSinkCallback {
public:
    IAudioSinkCallback() { }

    virtual ~IAudioSinkCallback() = default;

    typedef enum {
        CALLBACK_ERROR = -1,
        CALLBACK_CONTINUE = 0,
        CALLBACK_FINISHED = 1,   // stop calling the callback
    } audio_sink_callback_result_t;

    virtual audio_sink_callback_result_t renderAudio(float *buffer, int32_t numFrames) = 0;
};

#endif //ANDROID_IAUDIOSINKCALLBACK_H

Change protector macro to match the filename

Test: builds OK
Change-Id: I9d2ac3ee871a3380b32aecda6380b1b2da1dbed0


Solve Age in Days in c

Solve Age in Days in c


/* command_line.c */
/* to  return command line arguments */
#include "../H/ugens.h"
#include "../Minc/defs.h"
#include "../Minc/ext.h"
extern int aargc;
extern char *aargv[];          /* to pass commandline args to subroutines */

double f_arg(float *p, short n_args)
{
	double atof();
	return (((int)p[0]) < aargc - 1) ? (atof(aargv[(int)p[0]])) : 0.0;
}

double i_arg(float *p, short n_args)
{
	int atoi();
	return (((int)p[0]) < aargc - 1) ? (atoi(aargv[(int)p[0]])) : 0;
}

double s_arg(float *p,short n_args,double *pp)
{
	char *name;
	int i1 = 0;
	if(((int)pp[0]) < aargc - 1) {
		name = aargv[(int)pp[0]];
		i1 = (int) strsave(name);
	}
	return(i1);
}

double n_arg(float *p, short n_args)
{
	return(aargc);
}

/* command_line.c */
/* to  return command line arguments */
#include <stdlib.h>
#include <math.h>
#include <ugens.h>
#include "../Minc/ext.h"

double f_arg(float *p, short n_args)
{
	return (((int)p[0]) < aargc - 1) ? (atof(aargv[(int)p[0]])) : 0.0;
}

double i_arg(float *p, short n_args)
{
	return (((int)p[0]) < aargc - 1) ? (atoi(aargv[(int)p[0]])) : 0;
}

double s_arg(float *p,short n_args,double *pp)
{
	char *name;
	int i1 = 0;
	if(((int)pp[0]) < aargc - 1) {
		name = aargv[(int)pp[0]];
		i1 = (int) strsave(name);
	}
	return(i1);
}

double n_arg(float *p, short n_args)
{
	return(aargc);
}

Delete some extern vars that were in ugens.h. Other minor cleanups.


#ifdef __CINT__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class CustomStruct+;
#pragma link C++ class DerivedA+;
#pragma link C++ class DerivedA2+;
#pragma link C++ class DerivedB+;
#pragma link C++ class DerivedC+;

#pragma link C++ class IAuxSetOption+;
#pragma link C++ class PackedParameters+;
#pragma link C++ class PackedContainer+;

#endif

#ifdef __CINT__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class CustomStruct+;
#pragma link C++ class DerivedA+;
#pragma link C++ class DerivedA2+;
#pragma link C++ class DerivedB+;
#pragma link C++ class DerivedC+;

#pragma link C++ class IAuxSetOption+;
#pragma link C++ class PackedParameters+;
#pragma link C++ class PackedContainer<int>+;

#endif

[ntuple] Remove warning `Warning: Unused class rule: PackedContainer`


// RUN: %clang_cc1 -flto=thin -emit-llvm-bc < %s | llvm-bcanalyzer -dump | FileCheck %s
// CHECK: <FUNCTION_SUMMARY_BLOCK
// CHECK-NEXT: <PERMODULE_ENTRY
// CHECK-NEXT: <PERMODULE_ENTRY
// CHECK-NEXT: </FUNCTION_SUMMARY_BLOCK

__attribute__((noinline)) void foo() {}

int main() { foo(); }

// RUN: %clang_cc1 -flto=thin -emit-llvm-bc < %s | llvm-bcanalyzer -dump | FileCheck %s
// CHECK: <GLOBALVAL_SUMMARY_BLOCK
// CHECK-NEXT: <PERMODULE
// CHECK-NEXT: <PERMODULE
// CHECK-NEXT: </GLOBALVAL_SUMMARY_BLOCK

__attribute__((noinline)) void foo() {}

int main() { foo(); }

Update test case for llvm summary format changes in D17592.

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


#pragma once

#include <memory>

#include "Opcode.h"

class Symbol {

public:
	Symbol(Opcode opcode) : opcode(opcode) {};
	Symbol(Opcode opcode, unsigned int target) : opcode(opcode), target(target) {};

	void execute();

private:
	Opcode opcode;
	unsigned int target;
};

#pragma once

#include <memory>

#include "Opcode.h"

class Symbol {

public:
	Symbol(Opcode opcode) : opcode(opcode) {};
	Symbol(Opcode opcode, unsigned int target) : opcode(opcode), target(target) {};
    Symbol(Opcode opcode, unsigned int target, unsigned int secondary) : opcode(opcode), target(target), secondary(secondary) {};

    void execute();

private:
	Opcode opcode;
	unsigned int target = 0;
    unsigned int secondary = 0;
};

Add optional secondary target argument

Add optional secondary target argument


/*
    resource.h

    KNode, the KDE newsreader
    Copyright (c) 1999-2005 the KNode authors.
    See file AUTHORS for details

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
*/

#ifndef RESSOURCE_H
#define RESSOURCE_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

//========= KNode Version Information ============

#define KNODE_VERSION "0.9.50"

//================= StatusBar ====================

#define SB_MAIN     4000005
#define SB_GROUP      4000010
#define SB_FILTER   4000030

//================== Folders =====================

#define FOLD_DRAFTS 200010
#define FOLD_SENT   200020
#define FOLD_OUTB   200030

#endif // RESOURCE_H

/*
    resource.h

    KNode, the KDE newsreader
    Copyright (c) 1999-2005 the KNode authors.
    See file AUTHORS for details

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software Foundation,
    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, US
*/

#ifndef RESSOURCE_H
#define RESSOURCE_H

#ifdef HAVE_CONFIG_H
#include <config.h>
#endif

//========= KNode Version Information ============

#define KNODE_VERSION "0.9.90"

//================= StatusBar ====================

#define SB_MAIN     4000005
#define SB_GROUP      4000010
#define SB_FILTER   4000030

//================== Folders =====================

#define FOLD_DRAFTS 200010
#define FOLD_SENT   200020
#define FOLD_OUTB   200030

#endif // RESOURCE_H

Increment version number for the upcoming alpha release.

svn path=/branches/KDE/3.5/kdepim/; revision=442706


/*
 *
 *  OBEX Server
 *
 *  Copyright (C) 2007-2009  Marcel Holtmann <marcel@holtmann.org>
 *
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

struct obex_plugin_desc {
	const char *name;
	int (*init) (void);
	void (*exit) (void);
};

#define OBEX_PLUGIN_DEFINE(name,init,exit) \
		struct obex_plugin_desc obex_plugin_desc = { \
			name, init, exit \
		};

/*
 *
 *  OBEX Server
 *
 *  Copyright (C) 2007-2009  Marcel Holtmann <marcel@holtmann.org>
 *
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 */

struct obex_plugin_desc {
	const char *name;
	int (*init) (void);
	void (*exit) (void);
};

#define OBEX_PLUGIN_DEFINE(name,init,exit) \
		extern struct obex_plugin_desc obex_plugin_desc \
				__attribute__ ((visibility("default"))); \
		struct obex_plugin_desc obex_plugin_desc = { \
			name, init, exit \
		};

obexd: Use GCC visibility for exporting symbols


#define _XOPEN_SOURCE
#include <time.h>
#include <locale.h>

void set_c_locale() {
    setlocale(LC_TIME, "C");
}

time_t c_parse_http_time(char* s) {
    struct tm dest;
    strptime(s, "%a, %d %b %Y %H:%M:%S GMT", &dest);
    return mktime(&dest);
}

void c_format_http_time(time_t src, char* dest) {
    struct tm t;
    gmtime_r(&src, &t);
    strftime(dest, 40, "%a, %d %b %Y %H:%M:%S GMT", &t);
}

#define _XOPEN_SOURCE
#include <time.h>
#include <locale.h>

void set_c_locale() {
    setlocale(LC_TIME, "C");
}

time_t c_parse_http_time(char* s) {
    struct tm dest;
    strptime(s, "%a, %d %b %Y %H:%M:%S GMT", &dest);
    return timegm(&dest);
}

void c_format_http_time(time_t src, char* dest) {
    struct tm t;
    gmtime_r(&src, &t);
    strftime(dest, 40, "%a, %d %b %Y %H:%M:%S GMT", &t);
}

Fix timezone issue -- call the correct C function


#ifndef TIN_BUSSIGNALDEF_H
#define TIN_BUSSIGNALDEF_H

#include <cstdint>
#include <string>

namespace tin
{

enum class Byte_order : std::uint8_t { Intel, Moto };
enum class Value_sign : std::uint8_t { Signed, Unsigned };

struct Bus_signal_def
{
  bool multiplex_switch;
  Byte_order order;
  Value_sign sign;
  std::int32_t multiplex_value;
  std::uint32_t pos;
  std::uint32_t len;
  double factor;
  double offset;
  double minimum;
  double maximum;
  std::string unit;
  std::string name;
};

}  // namespace tin

#endif  // TIN_BUSSIGNALDEF_H

#ifndef TIN_BUSSIGNALDEF_H
#define TIN_BUSSIGNALDEF_H

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

namespace tin
{

enum class Byte_order : std::uint8_t { Intel, Moto };
enum class Value_sign : std::uint8_t { Signed, Unsigned };

struct Bus_signal_meta_data
{
  std::int8_t factor_precision = 7;
  std::int8_t offset_precision = 7;
  std::int8_t minimum_precision = 7;
  std::int8_t maximum_precision = 7;
};

struct Bus_signal_def
{
  bool multiplex_switch;
  Byte_order order;
  Value_sign sign;
  std::int32_t multiplex_value;
  std::uint32_t pos;
  std::uint32_t len;
  double factor;
  double offset;
  double minimum;
  double maximum;
  std::string unit;
  std::string name;
  std::vector<std::string> receiver;
  Bus_signal_meta_data meta_data;
};

}  // namespace tin

#endif  // TIN_BUSSIGNALDEF_H

Add receiver and meta data

Add receiver and meta data


#ifndef stdbool_h
#define stdbool_h

#include <wtypes.h>

/* MSVC doesn't define _Bool or bool in C, but does have BOOL */
/* Note this doesn't pass autoconf's test because (bool) 0.5 != true */
typedef BOOL _Bool;

#define bool _Bool
#define true 1
#define false 0

#define __bool_true_false_are_defined 1

#endif /* stdbool_h */

#ifndef stdbool_h
#define stdbool_h

#include <wtypes.h>

/* MSVC doesn't define _Bool or bool in C, but does have BOOL */
/* Note this doesn't pass autoconf's test because (bool) 0.5 != true */
/* Clang-cl uses MSVC headers, so needs msvc_compat, but has _Bool as
 * a built-in type. */
#ifndef __clang__
typedef BOOL _Bool;
#endif

#define bool _Bool
#define true 1
#define false 0

#define __bool_true_false_are_defined 1

#endif /* stdbool_h */

Allow to build with clang-cl

Allow to build with clang-cl


// RUN: %clang -target aarch64-none-none-eabi -march=armv8a+rdm -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RDM %s
// RUN: %clang -target aarch64-none-none-eabi -mcpu=generic+rdm -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RDM %s
// RUN: %clang -target aarch64-none-none-eabi -mcpu=falkor -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RDM %s
// RUN: %clang -target aarch64-none-none-eabi -mcpu=thunderx2t99 -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-RDM %s
// CHECK-RDM: "-target-feature" "+rdm"

// RUN: %clang -target aarch64-none-none-eabi -march=armv8a+nordm -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-NORDM %s
// RUN: %clang -target aarch64-none-none-eabi -mcpu=generic+nordm -### -c %s 2>&1 | FileCheck --check-prefix=CHECK-NORDM %s
// CHECK-NORDM: "-target-feature" "-rdm"

Add tests for RDM feature.

[Driver][AArch64] Add tests for RDM feature.

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

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


#pragma once
//------------------------------------------------------------------------------
/**
    @file core/posix/precompiled.h

    Standard includes for POSIX platforms.
    NOTE: keep as many headers out of here as possible, at least
    on compilers which don't have pre-compiled-headers turned on.
*/
#ifdef __STRICT_ANSI__
#undef __STRICT_ANSI__
#endif

#include <cstddef>

#pragma once
//------------------------------------------------------------------------------
/**
    @file core/posix/precompiled.h

    Standard includes for POSIX platforms.
    NOTE: keep as many headers out of here as possible, at least
    on compilers which don't have pre-compiled-headers turned on.
*/

// this is a workaround when using clang with the GNU std lib,
// this fails without __STRICT_ANSI__ because clang doesn't
// know the __float128 type
#if __clang__ && ORYOL_LINUX && !defined __STRICT_ANSI__
#define __STRICT_ANSI__
#endif
#include <cstddef>

Fix for compile error on Linux when using clang with GNU std c++ lib (__STRICT_ANSI__ is required)


//
//  TJDropboxAuthenticator.h
//  Close-up
//
//  Created by Tim Johnsen on 3/14/20.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

API_AVAILABLE(ios(10.0)) @interface TJDropboxAuthenticator : NSObject

+ (void)authenticateWithClientIdentifier:(NSString *const)clientIdentifier
                     bypassingNativeAuth:(const BOOL)bypassNativeAuth
                              completion:(void (^)(NSString *))completion;

+ (BOOL)tryHandleAuthenticationCallbackWithURL:(NSURL *const)url;

@end

NS_ASSUME_NONNULL_END

//
//  TJDropboxAuthenticator.h
//  Close-up
//
//  Created by Tim Johnsen on 3/14/20.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

API_AVAILABLE(ios(10.0)) @interface TJDropboxAuthenticator : NSObject

/**
 * Invoke this to initiate auth
 * @param clientIdentifier Your registered Dropbox client identifier.
 * @param bypassNativeAuth Pass @c YES to skip authentication via the Dropbox app and force auth to occur via the web.
 * @param completion Block invoked when auth is complete. @c accessToken will be @c nil if auth wasn't completed.
 */
+ (void)authenticateWithClientIdentifier:(NSString *const)clientIdentifier
                     bypassingNativeAuth:(const BOOL)bypassNativeAuth
                              completion:(void (^)(NSString *_Nullable accessToken))completion;

/// Invoke this from your app delegate's implementation of -application:openURL:options:, returns whether or not the URL was a completion callback to Dropbox auth.
+ (BOOL)tryHandleAuthenticationCallbackWithURL:(NSURL *const)url;

@end

NS_ASSUME_NONNULL_END

Add docs to authenticator header.

Add docs to authenticator header.


// =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of the distribution and at
// http://projectchrono.org/license-chrono.txt.
//
// =============================================================================
// Authors: Radu Serban
// =============================================================================
//
// Generic rack-pinion steering model.
//
// =============================================================================

#ifndef GENERIC_RACKPINION_H
#define GENERIC_RACKPINION_H

#include "subsys/steering/ChRackPinion.h"

class Generic_RackPinion : public chrono::ChRackPinion
{
public:

  Generic_RackPinion(const std::string& name) : ChRackPinion(name) {}
  ~Generic_RackPinion() {}

  virtual double GetSteeringLinkMass() const                       { return 9.0; }
  virtual const chrono::ChVector<>& GetSteeringLinkInertia() const { return chrono::ChVector<>(1, 1, 1); }
  virtual double GetSteeringLinkCOM() const                        { return 0.0; }
  virtual double GetSteeringLinkRadius() const                     { return 0.03; }
  virtual double GetSteeringLinkLength() const                     { return 0.896; }

  virtual double GetPinionRadius() const                           { return 0.1; }

  virtual double GetMaxAngle() const                               { return 0.87; }
};

#endif

Add a generic rack-pinion steering subsystem.


#include <string.h>
#include <stdlib.h>
#include "proxrcmds.h"
#include "sim-hab.h"

void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value)
{
    double data;
    double content;
    char number[3];
    char *res_name = NULL;
    long int id;
    bionet_node_t *node;

    bionet_value_get_double(value, &data);
    if(data < 0 || data > 255)
	return;

    node = bionet_resource_get_node(resource);
    bionet_split_resource_name(bionet_resource_get_name(resource), NULL, NULL, NULL, &res_name);

    // extract pot number from resource name
    number[0] = res_name[4];
    number[1] = res_name[5];
    number[2] = '\0';
    id = strtol(number, NULL, 10);

    // command proxr to adjust to new value
    set_potentiometer(id, (int)data);
    // set resources datapoint to new value and report
    content = data*POT_CONVERSION;
    bionet_resource_set_double(resource, content, NULL);
    hab_report_datapoints(node);
}

#include <string.h>
#include <stdlib.h>
#include "proxrcmds.h"
#include "sim-hab.h"

void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value)
{
    double data;
    double content;
    char number[3];
    char *res_name = NULL;
    long int id;
    bionet_node_t *node;

    bionet_value_get_double(value, &data);
    if(data < 0)
        data = 0;
    if(data > 5)
        data = 5;

    node = bionet_resource_get_node(resource);
    bionet_split_resource_name(bionet_resource_get_name(resource), NULL, NULL, NULL, &res_name);

    // extract pot number from resource name
    number[0] = res_name[4];
    number[1] = res_name[5];
    number[2] = '\0';
    id = strtol(number, NULL, 10);

    // proxr hardware works with 8 bit resolution 0-255 steps
    data = data/POT_CONVERSION;
    // command proxr to adjust to new value
    set_potentiometer(id, (int)data);
    // set resources datapoint to new value and report
    content = data*POT_CONVERSION;
    bionet_resource_set_double(resource, content, NULL);
    hab_report_datapoints(node);
}

Change how proxr resources are set. Previously it was given a value 0-255 which the proxr hardware uses to set the voltage. now just give it a voltage and do the conversion in the hab. also if a voltage supplied is out of range it snaps to nearest in range.


#ifndef COMPILER_UTIL_RESULT_H_
#define COMPILER_UTIL_RESULT_H_

#include <string>

namespace tree_sitter {
namespace util {

template <typename Value>
struct Result {
  Value value;
  std::string error;

  inline Result() : error("Empty") {}
  inline Result(Value &&v) : value(v) {}
  inline Result(const std::string &message) : error(message) {}
  inline Result(const char *message) : error(message) {}
  inline bool ok() const { return error.empty(); }
};

}  // namespace util
}  // namespace tree_sitter

#endif  // COMPILER_UTIL_RESULT_H_

#ifndef COMPILER_UTIL_RESULT_H_
#define COMPILER_UTIL_RESULT_H_

#include <string>

namespace tree_sitter {
namespace util {

template <typename Value>
struct Result {
  Value value;
  std::string error;

  inline Result() : error("Empty") {}
  inline Result(const Value &v) : value(v) {}
  inline Result(Value &&v) : value(std::move(v)) {}
  inline Result(const std::string &message) : error(message) {}
  inline Result(const char *message) : error(message) {}
  inline bool ok() const { return error.empty(); }
};

}  // namespace util
}  // namespace tree_sitter

#endif  // COMPILER_UTIL_RESULT_H_

Allow Result to be constructed with an l-value

This fixes compile errors on old C++ compilers


//
//  m3_api_defs.h
//
//  Created by Volodymyr Shymanskyy on 12/20/19.
//  Copyright © 2019 Volodymyr Shymanskyy. All rights reserved.
//

#ifndef m3_api_defs_h
#define m3_api_defs_h

#include "m3_core.h"

#define m3ApiReturnType(TYPE)      TYPE* raw_return = ((TYPE*) (_sp));
#define m3ApiGetArg(TYPE, NAME)    TYPE NAME = * ((TYPE *) (_sp++));
#define m3ApiGetArgMem(TYPE, NAME) TYPE NAME = (TYPE) (_mem + * (u32 *) _sp++);

#define m3ApiRawFunction(NAME)     void NAME (IM3Runtime runtime, u64 * _sp, u8 * _mem)
#define m3ApiReturn(VALUE)         { *raw_return = (VALUE); return; }

#endif /* m3_api_defs_h */

//
//  m3_api_defs.h
//
//  Created by Volodymyr Shymanskyy on 12/20/19.
//  Copyright © 2019 Volodymyr Shymanskyy. All rights reserved.
//

#ifndef m3_api_defs_h
#define m3_api_defs_h

#include "m3_core.h"

#define m3ApiReturnType(TYPE)      TYPE* raw_return = ((TYPE*) (_sp));
#define m3ApiGetArg(TYPE, NAME)    TYPE NAME = * ((TYPE *) (_sp++));
#define m3ApiGetArgMem(TYPE, NAME) TYPE NAME = (TYPE) (_mem + * (u32 *) _sp++);

#define m3ApiRawFunction(NAME)     m3ret_t NAME (IM3Runtime runtime, u64 * _sp, u8 * _mem)
#define m3ApiReturn(VALUE)         { *raw_return = (VALUE); return NULL; }

#endif /* m3_api_defs_h */

Fix type missmatch (crucial for wasienv)


#ifndef CPR_PAYLOAD_H
#define CPR_PAYLOAD_H

#include <memory>
#include <string>
#include <initializer_list>

namespace cpr {

struct Pair {
    Pair(const std::string& key, const std::string& value) : key{key}, value{value} {}
    Pair(const std::string& key, const int& value) : key{key}, value{std::to_string(value)} {}

    std::string key;
    std::string value;
};

class Payload {
  public:
    Payload(const std::initializer_list<Pair>& pairs);
    Payload(const std::string& content) : content{content} {}
    Payload(std::string&& content) : content{std::move(content)} {}

    std::string content;
};

} // namespace cpr

#endif

#ifndef CPR_PAYLOAD_H
#define CPR_PAYLOAD_H

#include <memory>
#include <string>
#include <initializer_list>

namespace cpr {

struct Pair {
    Pair(const std::string& key, const std::string& value) : key{key}, value{value} {}
    Pair(const std::string& key, const int& value) : key{key}, value{std::to_string(value)} {}

    std::string key;
    std::string value;
};

class Payload {
  public:
    Payload(const std::initializer_list<Pair>& pairs);

    std::string content;
};

} // namespace cpr

#endif

Remove unused and untested Payload constructor


static unsigned long next = 1;

/* RAND_MAX assumed to be 32767 */
int sys_rand(void) {
    next = next * 1103515245 + 12345;
    return((unsigned)(next/65536) % 32768);
}

void sys_srand(unsigned seed) {
    next = seed;
}

__attribute__((weak)) int rand(void) { return sys_rand(); }
__attribute__((weak)) void srand(unsigned seed) { srand(seed); }

Add alias to sys_rand and sys_srand

Add alias to sys_rand and sys_srand


//
//  CwlSignal.h
//  CwlSignal
//
//  Created by Matt Gallagher on 11/6/16.
//  Copyright © 2016 Matt Gallagher ( http://cocoawithlove.com ). All rights reserved.
//

#import <Cocoa/Cocoa.h>

//! Project version number for CwlSignal.
FOUNDATION_EXPORT double CwlSignalVersionNumber;

//! Project version string for CwlSignal.
FOUNDATION_EXPORT const unsigned char CwlSignalVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <CwlSignal/PublicHeader.h>

#import "CwlFrameAddress.h"

//
//  CwlSignal.h
//  CwlSignal
//
//  Created by Matt Gallagher on 11/6/16.
//  Copyright © 2016 Matt Gallagher ( http://cocoawithlove.com ). All rights reserved.
//

#import <Foundation/Foundation.h>

//! Project version number for CwlSignal.
FOUNDATION_EXPORT double CwlSignalVersionNumber;

//! Project version string for CwlSignal.
FOUNDATION_EXPORT const unsigned char CwlSignalVersionString[];

// In this header, you should import all the public headers of your framework using statements like #import <CwlSignal/PublicHeader.h>

#import "CwlFrameAddress.h"

Remove needless include of Cocoa.

Remove needless include of Cocoa.


Fix a comment that wasn't commente'd out

Pointed out by: Erik Bertelsen <erik@sockdev.uni-c.dk>


#ifndef PPARSEFP_H
#define PPARSEFP_H

/*
 * Parses a float or double number and returns the length parsed if
 * successful. The length argument is of limited value due to dependency
 * on `strtod` - buf[len] must be accessible and must not be part of
 * a valid number, including hex float numbers..
 *
 * Unlike strtod, whitespace is not parsed.
 *
 * May return:
 * - null on error,
 * - buffer start if first character does start a number,
 * - or end of parse on success.
 *
 * Grisu3 is not part of the portable lib per se, it must be in the
 * include path. Grisu3 provides much faster printing and parsing in the
 * typical case with fallback to sprintf for printing and strod for
 * parsing.
 *
 * Either define PORTABLE_USE_GRISU3, or include the grisu3 header first.
 */
#include <math.h> /* for HUGE_VAL */

#if PORTABLE_USE_GRISU3
#include "grisu3/grisu3_parse.h"
#endif

#ifdef grisu3_parse_double_is_defined
static inline const char *parse_double(const char *buf, int len, double *result)
{
    return grisu3_parse_double(buf, len, result);
}
#else
#include <stdio.h>
static inline const char *parse_double(const char *buf, int len, double *result)
{
    char *end;

    (void)len;
    *result = strtod(buf, &end);
    return end;
}
#endif

static inline const char *parse_float(const char *buf, int len, float *result)
{
    const char *end;
    double v;

    end = parse_double(buf, len, &v);
    *result = (float)v;
    return end;
}

#endif /* PPARSEFP_H */

Add portable floating point parsing with optional grisu3 support


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

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

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

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

#include <string.h>

libc_hidden_proto(bzero)

/* Clear memory.  Can't alias to bzero because it's not defined in the
   same translation unit.  */
void
__aeabi_memclr (void *dest, size_t n)
{
  bzero (dest, n);
}

/* Versions of the above which may assume memory alignment.  */
strong_alias (__aeabi_memclr, __aeabi_memclr4)
strong_alias (__aeabi_memclr, __aeabi_memclr8)

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

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

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

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

#include <string.h>

libc_hidden_proto(memset)

/* Clear memory.  Can't alias to bzero because it's not defined in the
   same translation unit.  */
void
__aeabi_memclr (void *dest, size_t n)
{
  memset (dest, 0, n);
}

/* Versions of the above which may assume memory alignment.  */
strong_alias (__aeabi_memclr, __aeabi_memclr4)
strong_alias (__aeabi_memclr, __aeabi_memclr8)

Use memset instead of bzero

Use memset instead of bzero


/* Copyright (C) 2003 Timo Sirainen */

#include "lib.h"
#include "ioloop-internal.h"

#ifdef IOLOOP_NOTIFY_NONE

struct io *io_loop_notify_add(struct ioloop *ioloop __attr_unused__,
			      const char *path __attr_unused__,
			      io_callback_t *callback __attr_unused__,
			      void *context __attr_unused__)
{
	return NULL;
}

void io_loop_notify_remove(struct ioloop *ioloop __attr_unused__,
			   struct io *io __attr_unused__)
{
}

void io_loop_notify_handler_init(struct ioloop *ioloop __attr_unused__)
{
}

void io_loop_notify_handler_deinit(struct ioloop *ioloop __attr_unused__)
{
}

#endif

/* Copyright (C) 2003 Timo Sirainen */

#include "lib.h"
#include "ioloop-internal.h"

#ifdef IOLOOP_NOTIFY_NONE

#undef io_add_notify
struct io *io_add_notify(const char *path __attr_unused__,
			 io_callback_t *callback __attr_unused__,
			 void *context __attr_unused__)
{
	return NULL;
}

void io_loop_notify_remove(struct ioloop *ioloop __attr_unused__,
			   struct io *io __attr_unused__)
{
}

void io_loop_notify_handler_deinit(struct ioloop *ioloop __attr_unused__)
{
}

#endif

Fix for building without notify

Fix for building without notify


#ifndef FHASH_H
#define FHASH_H

/* Box the filename pointer in a struct, for added typechecking. */
typedef struct fname {
    char *name;
} fname;

set *fname_new_set(int sz_factor);
fname *fname_new(char *n, size_t len);
fname *fname_add(set *wt, fname *f);
void fname_free(void *w);

#endif

#ifndef FNAME_H
#define FNAME_H

/* Box the filename pointer in a struct, for added typechecking. */
typedef struct fname {
    char *name;
} fname;

set *fname_new_set(int sz_factor);
fname *fname_new(char *n, size_t len);
fname *fname_add(set *wt, fname *f);
void fname_free(void *w);

#endif

Fix guards for renamed header files.

Fix guards for renamed header files.


//===- InlinerPass.h - Code common to all inliners --------------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines a simple policy-based bottom-up inliner.  This file
// implements all of the boring mechanics of the bottom-up inlining, while the
// subclass determines WHAT to inline, which is the much more interesting
// component.
//
//===----------------------------------------------------------------------===//

#ifndef INLINER_H
#define INLINER_H

#include "llvm/CallGraphSCCPass.h"

namespace llvm {
  class CallSite;

/// Inliner - This class contains all of the helper code which is used to
/// perform the inlining operations that does not depend on the policy.
///
struct Inliner : public CallGraphSCCPass {
  Inliner(const void *ID);

  /// getAnalysisUsage - For this class, we declare that we require and preserve
  /// the call graph.  If the derived class implements this method, it should
  /// always explicitly call the implementation here.
  virtual void getAnalysisUsage(AnalysisUsage &Info) const;

  // Main run interface method, this implements the interface required by the
  // Pass class.
  virtual bool runOnSCC(const std::vector<CallGraphNode *> &SCC);

  // doFinalization - Remove now-dead linkonce functions at the end of
  // processing to avoid breaking the SCC traversal.
  virtual bool doFinalization(CallGraph &CG);

  /// This method returns the value specified by the -inline-threshold value,
  /// specified on the command line.  This is typically not directly needed.
  ///
  unsigned getInlineThreshold() const { return InlineThreshold; }

  /// getInlineCost - This method must be implemented by the subclass to
  /// determine the cost of inlining the specified call site.  If the cost
  /// returned is greater than the current inline threshold, the call site is
  /// not inlined.
  ///
  virtual int getInlineCost(CallSite CS) = 0;

private:
  // InlineThreshold - Cache the value here for easy access.
  unsigned InlineThreshold;
};

} // End llvm namespace

#endif

Move inliner pass header file.

Move inliner pass header file.

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