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

#ifndef LLVM_DEBUGINFO_CODEVIEW_GUID_H
#define LLVM_DEBUGINFO_CODEVIEW_GUID_H

#include <cstdint>
#include <cstring>

namespace llvm {
class raw_ostream;

namespace codeview {

/// This represents the 'GUID' type from windows.h.
struct GUID {
  uint8_t Guid[16];
};

inline bool operator==(const GUID &LHS, const GUID &RHS) {
  return 0 == ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid));
}

raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid);

} // namespace codeview
} // namespace llvm

#endif

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

#ifndef LLVM_DEBUGINFO_CODEVIEW_GUID_H
#define LLVM_DEBUGINFO_CODEVIEW_GUID_H

#include <cstdint>
#include <cstring>

namespace llvm {
class raw_ostream;

namespace codeview {

/// This represents the 'GUID' type from windows.h.
struct GUID {
  uint8_t Guid[16];
};

inline bool operator==(const GUID &LHS, const GUID &RHS) {
  return 0 == ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid));
}

inline bool operator<(const GUID &LHS, const GUID &RHS) {
  return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) < 0;
}

inline bool operator<=(const GUID &LHS, const GUID &RHS) {
  return ::memcmp(LHS.Guid, RHS.Guid, sizeof(LHS.Guid)) <= 0;
}

inline bool operator>(const GUID &LHS, const GUID &RHS) {
  return !(LHS <= RHS);
}

inline bool operator>=(const GUID &LHS, const GUID &RHS) {
  return !(LHS < RHS);
}

inline bool operator!=(const GUID &LHS, const GUID &RHS) {
  return !(LHS == RHS);
}

raw_ostream &operator<<(raw_ostream &OS, const GUID &Guid);

} // namespace codeview
} // namespace llvm

#endif

[PDB] Merge in types and items from type servers (/Zi)

Summary:
Object files compiled with /Zi emit type information into a type server
PDB. The .debug$S section will contain a single TypeServer2Record with
the absolute path and GUID of the type server. LLD needs to load the
type server PDB and merge all types and items it finds in it into the
destination PDB.

Depends on D35495

Reviewers: ruiu, inglorion

Subscribers: zturner, llvm-commits

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

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


#ifndef RELFILENODE_H
#define RELFILENODE_H

/*
 * This is all what we need to know to find relation file.
 * tblNode is identificator of tablespace and because of
 * currently our tablespaces are equal to databases this is
 * database OID. relNode is currently relation OID on creation
 * but may be changed later if required. relNode is stored in
 * pg_class.relfilenode.
 */
typedef struct RelFileNode
{
	Oid					tblNode;		/* tablespace */
	Oid					relNode;		/* relation */
} RelFileNode;

#define	RelFileNodeEquals(node1, node2)	\
	((node1).relNode == (node2).relNode && \
	(node2).tblNode == (node2).tblNode)

#endif	/* RELFILENODE_H */

#ifndef RELFILENODE_H
#define RELFILENODE_H

/*
 * This is all what we need to know to find relation file.
 * tblNode is identificator of tablespace and because of
 * currently our tablespaces are equal to databases this is
 * database OID. relNode is currently relation OID on creation
 * but may be changed later if required. relNode is stored in
 * pg_class.relfilenode.
 */
typedef struct RelFileNode
{
	Oid					tblNode;		/* tablespace */
	Oid					relNode;		/* relation */
} RelFileNode;

#define	RelFileNodeEquals(node1, node2)	\
	((node1).relNode == (node2).relNode && \
	 (node1).tblNode == (node2).tblNode)

#endif	/* RELFILENODE_H */

Fix small but critical typo ...

Fix small but critical typo ...


/*===================================================================

The Medical Imaging Interaction Toolkit (MITK)

Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.

This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.

See LICENSE.txt or http://www.mitk.org for details.

===================================================================*/
#ifndef QMITK_CreateMultiLabelSegmentation_H
#define QMITK_CreateMultiLabelSegmentation_H

#include "mitkIContextMenuAction.h"

#include "org_mitk_gui_qt_multilabelsegmentation_Export.h"

#include "vector"
#include "mitkDataNode.h"

class MITK_QT_SEGMENTATION QmitkCreateMultiLabelSegmentationAction : public QObject, public mitk::IContextMenuAction
{
  Q_OBJECT
  Q_INTERFACES(mitk::IContextMenuAction)

public:

  QmitkCreateMultiLabelSegmentationAction();
  virtual ~QmitkCreateMultiLabelSegmentationAction();

  //interface methods
  virtual void Run( const QList<mitk::DataNode::Pointer>& selectedNodes );
  virtual void SetDataStorage(mitk::DataStorage* dataStorage);
  virtual void SetFunctionality(berry::QtViewPart* functionality);
  virtual void SetSmoothed(bool smoothed);
  virtual void SetDecimated(bool decimated);

private:

  typedef QList<mitk::DataNode::Pointer> NodeList;

  mitk::DataStorage::Pointer m_DataStorage;
};

#endif // QMITK_CreateMultiLabelSegmentation_H

/*===================================================================

The Medical Imaging Interaction Toolkit (MITK)

Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics.
All rights reserved.

This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.

See LICENSE.txt or http://www.mitk.org for details.

===================================================================*/
#ifndef QMITK_CreateMultiLabelSegmentation_H
#define QMITK_CreateMultiLabelSegmentation_H

#include "mitkIContextMenuAction.h"

#include "org_mitk_gui_qt_multilabelsegmentation_Export.h"

#include "vector"
#include "mitkDataNode.h"

class MITK_QT_SEGMENTATION QmitkCreateMultiLabelSegmentationAction : public QObject, public mitk::IContextMenuAction
{
  Q_OBJECT
  Q_INTERFACES(mitk::IContextMenuAction)

public:

  QmitkCreateMultiLabelSegmentationAction();
  virtual ~QmitkCreateMultiLabelSegmentationAction();

  //interface methods
  virtual void Run( const QList<mitk::DataNode::Pointer>& selectedNodes ) override;
  virtual void SetDataStorage(mitk::DataStorage* dataStorage) override;
  virtual void SetFunctionality(berry::QtViewPart* functionality) override;
  virtual void SetSmoothed(bool smoothed) override;
  virtual void SetDecimated(bool decimated) override;

private:

  typedef QList<mitk::DataNode::Pointer> NodeList;

  mitk::DataStorage::Pointer m_DataStorage;
};

#endif // QMITK_CreateMultiLabelSegmentation_H

Add override keyword to overridden methods.


//-----------------------------------------------------------------------------
// Element Access
//-----------------------------------------------------------------------------

template<class T>
T& matrix<T>::at( std::size_t row, std::size_t col ){
  // TODO throw if out of bounds
  return data_.at(row*cols_+col);
}

template<class T>
const T& matrix<T>::at( std::size_t row, std::size_t col ) const{
  // TODO throw if out of bounds
  return data_.at(row*cols_+col);
}

template<class T>
typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ){
  return 0;
}

template<class T>
const typename matrix<T>::matrix_row matrix<T>::operator[](
    std::size_t row ) const{
  return 0;
}

//-----------------------------------------------------------------------------
// Element Access
//-----------------------------------------------------------------------------

template<class T>
T& matrix<T>::at( std::size_t row, std::size_t col ){
  // TODO throw if out of bounds
  return data_.at(row*cols_+col);
}

template<class T>
const T& matrix<T>::at( std::size_t row, std::size_t col ) const{
  // TODO throw if out of bounds
  return data_.at(row*cols_+col);
}

template<class T>
typename matrix<T>::matrix_row matrix<T>::operator[]( std::size_t row ){
  return matrix_row(this,row);
}

template<class T>
const typename matrix<T>::matrix_row matrix<T>::operator[](
    std::size_t row ) const{
  return matrix_row(this,row);
}

//-----------------------------------------------------------------------------
// Row class element Access
//-----------------------------------------------------------------------------

template<class T>
T& matrix<T>::matrix_row::operator[](std::size_t col){
  return matrix_->data_[row_*matrix_->cols_+col];
}

template<class T>
const T& matrix<T>::matrix_row::operator[](std::size_t col) const{
  return matrix_->data_[row_*matrix_->cols_+col];
}

Add square bracket opertator access.

Add square bracket opertator access.


#ifndef SSPAPPLICATION_ENTITIES_STATICENTITY_H
#define SSPAPPLICATION_ENTITIES_STATICENTITY_H
#include "Entity.h"
class StaticEntity :
	public Entity
{
private:
	//Variables
public:
	StaticEntity();
	~StaticEntity();

	int Initialize(int entityID, PhysicsComponent* pComp, GraphicsComponent* gComp, AIComponent* aiComp);

	int Update(float dT, InputHandler* inputHandler);
	int React(int entityID, EVENT reactEvent);
private:
	//Functions
};
#endif

#ifndef SSPAPPLICATION_ENTITIES_STATICENTITY_H
#define SSPAPPLICATION_ENTITIES_STATICENTITY_H
#include "Entity.h"
class StaticEntity :
	public Entity
{
private:
	//Variables
public:
	StaticEntity();
	~StaticEntity();

	int Initialize(int entityID, PhysicsComponent* pComp, GraphicsComponent* gComp, AIComponent* aiComp = nullptr);

	int Update(float dT, InputHandler* inputHandler);
	int React(int entityID, EVENT reactEvent);
private:
	//Functions
};
#endif

FIX Interface parameter for Entities

FIX Interface parameter for Entities


#ifndef UTIL_H
#define UTIL_H

/*** Utility functions ***/

#define ALLOC(type) ((type*) xmalloc(sizeof(type)))
void *xmalloc(size_t);

#define STARTS_WITH(x, y) (strncmp((x), (y), sizeof(y) - 1) == 0)

#endif /* UTIL_H */

#ifndef UTIL_H
#define UTIL_H

/*** Utility functions ***/

#define ALLOC(type) ((type*) xmalloc(sizeof(type)))
void *xmalloc(size_t);

#define STARTS_WITH(x, y) (strncmp((x), (y), strlen(y)) == 0)

#endif /* UTIL_H */

Fix STARTS_WITH macro comparing 1 less character than needed


//
//  RocksDBComparator.h
//  ObjectiveRocks
//
//  Created by Iska on 22/11/14.
//  Copyright (c) 2014 BrainCookie. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(NSUInteger, RocksDBComparatorType)
{
	RocksDBComparatorBytewiseAscending,
	RocksDBComparatorBytewiseDescending,
	RocksDBComparatorStringCompareAscending,
	RocksDBComparatorStringCompareDescending,
	RocksDBComparatorNumberAscending,
	RocksDBComparatorNumberDescending
};

@interface RocksDBComparator : NSObject

+ (instancetype)comaparatorWithType:(RocksDBComparatorType)type;

- (instancetype)initWithName:(NSString *)name andBlock:(int (^)(id key1, id key2))block;

@end

//
//  RocksDBComparator.h
//  ObjectiveRocks
//
//  Created by Iska on 22/11/14.
//  Copyright (c) 2014 BrainCookie. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 An enum defining the built-in Comparators.
 */
typedef NS_ENUM(NSUInteger, RocksDBComparatorType)
{
	/** @brief Orders the keys lexicographically in ascending order. */
	RocksDBComparatorBytewiseAscending,

	/** @brief Orders the keys lexicographically in descending order. */
	RocksDBComparatorBytewiseDescending,

	/** @brief Orders NSString keys in ascending order via the compare selector. */
	RocksDBComparatorStringCompareAscending,

	/** @brief Orders NSString keys in descending order via the compare selector. */
	RocksDBComparatorStringCompareDescending,

	/** @brief Orders NSNumber keys in ascending order via the compare selector.*/
	RocksDBComparatorNumberAscending,

	/** @brief Orders NSNumber keys in descending order via the compare selector. */
	RocksDBComparatorNumberDescending
};

/**
 The keys are ordered within the key-value store according to a specified comparator function. The default ordering
 function for keys orders the bytes lexicographically.

 This behavior can be changed by supplying a custom Comparator when opening a database using the `RocksDBComparator`.
 */
@interface RocksDBComparator : NSObject

/**
 Intializes a new Comparator instance for the given built-in type.

 @param type The comparator type.
 @return a newly-initialized instance of a keys comparator.
 */
+ (instancetype)comaparatorWithType:(RocksDBComparatorType)type;

/**
 Intializes a new Comparator instance with the given name and comparison block.

 @param name The name of the comparator.
 @param block The comparator block to apply on the keys in order to specify their order.
 @return a newly-initialized instance of a keys comparator.
 */
- (instancetype)initWithName:(NSString *)name andBlock:(int (^)(id key1, id key2))block;

@end

Add source code documentation for the Comparator class


#ifndef SPELLUTIL_H
#define SPELLUTIL_H

typedef struct spell_list_node {
    struct spell_list_node *next;
    void *data;
} spell_list_node;

spell_list_node *spell_list_init(void *);
int spell_list_add(spell_list_node **, void *);
void spell_list_free(spell_list_node **, void (*) (void *));

#endif

#ifndef SPELLUTIL_H
#define SPELLUTIL_H

typedef struct spell_list_node {
    struct spell_list_node *next;
    void *data;
} spell_list_node;

typedef struct spell_hashtable {
    char *key;
    spell_list_node *val;
} spell_hashtable;

spell_list_node *spell_list_init(void *);
int spell_list_add(spell_list_node **, void *);
void spell_list_remove(spell_list_node **, spell_list_node *);
void spell_list_free(spell_list_node **, void (*) (void *));
spell_hashtable *spell_hashtable_init(size_t);
void spell_hashtable_add(spell_hashtable *, char *, void *);
void spell_hashtable_remove(spell_hashtable *, char *);
void spell_hashtable_get(spell_hashtable *, char *);
void spell_hashtable_free(spell_hashtable *, void (*) (void *));

#endif

Add interface for a hash table implementation required for the next stages of the spell checker implementation.


#include "flags.h"

#include <stdio.h>

#include "laco.h"
#include "util.h"

static const char* version_matches[] = {"-v", "--version", NULL};
static const char* help_matches[]    = {"-h", "-?", "--help", NULL};

/* Print off the current version of laco */
static void handle_version(LacoState* laco, const char** arguments) {
  const char* version = laco_get_laco_version(laco);

  printf("laco version %s\n", version);
  laco_kill(laco, 0, NULL);
}

/* Print off the help screen */
static void handle_help(LacoState* laco, const char** arguments) {
  puts("A better REPL for Lua.\n");
  puts("Usage: laco [options]\n");
  puts("-h | -? | --help   \tPrint this help screen");
  puts("-v | --version     \tPrint current version");

  laco_kill(laco, 0, NULL);
}

static const LacoCommand flag_commands[] = {
  { version_matches, handle_version },
  { help_matches,    handle_help },
  { NULL, NULL }
};

/* External API */

void laco_handle_flag(LacoState* laco) {
  const char* command = laco_get_laco_args(laco)[1];

  laco_dispatch(flag_commands, laco, command, NULL);
}

#include "flags.h"

#include <stdio.h>

#include "laco.h"
#include "util.h"

static const char* version_matches[] = {"-v", "--version", NULL};
static const char* help_matches[]    = {"-h", "--help", NULL};

/* Print off the current version of laco */
static void handle_version(LacoState* laco, const char** arguments) {
  const char* version = laco_get_laco_version(laco);

  printf("laco version %s\n", version);
  laco_kill(laco, 0, NULL);
}

/* Print off the help screen */
static void handle_help(LacoState* laco, const char** arguments) {
  puts("A better REPL for Lua.\n");
  puts("Usage: laco [options]\n");
  puts("-h | --help      \tPrint this help screen");
  puts("-v | --version   \tPrint current version");

  laco_kill(laco, 0, NULL);
}

static const LacoCommand flag_commands[] = {
  { version_matches, handle_version },
  { help_matches,    handle_help },
  { NULL, NULL }
};

/* External API */

void laco_handle_flag(LacoState* laco) {
  const char* command = laco_get_laco_args(laco)[1];

  laco_dispatch(flag_commands, laco, command, NULL);
}

Remove `-?` to display help

Remove `-?` to display help

It seems like `--help` and `-h` is good enough alternatives for getting the
help display.


#include <stdlib.h>

#include "ht.h"
#include "util/macros.h"

struct ht*
ht_init(
    struct ht* ht,
    size_t n
) {
    if (ht) {
        ht->buckets = calloc(n, sizeof(*ht->buckets));
        ht->nbuckets = n;
    }

    return ht;
}

void
ht_destroy(
    struct ht* ht
) {
    if (ht) {
        for (; ht->nbuckets > 0; ht->nbuckets--) {
            avl_destroy(&ht->buckets[ht->nbuckets - 1].avl);
        }
        free(ht->buckets);
        free(ht);
    }
}

struct ht_bucket*
ht_find(
    struct ht* ht,
    rs_hash hash
) {
    if (!ht) {
        return NULL;
    }

    return &ht->buckets[hash % (CONSTPOW_TWO(BITCOUNT(hash)) / ht->nbuckets)];
}

#include <stdlib.h>

#include "ht.h"
#include "util/macros.h"

struct ht*
ht_init(
    struct ht* ht,
    size_t n
) {
    if (ht) {
        ht->buckets = calloc(n, sizeof(*ht->buckets));
        ht->nbuckets = n;
    }

    return ht;
}

void
ht_destroy(
    struct ht* ht
) {
    if (ht) {
        for (; ht->nbuckets > 0; ht->nbuckets--) {
            avl_destroy(&ht->buckets[ht->nbuckets - 1].avl);
        }
        free(ht->buckets);
        free(ht);
    }
}

struct ht_bucket*
ht_find(
    struct ht* ht,
    rs_hash hash
) {
    if (!ht) {
        return NULL;
    }

    return &ht->buckets[hash / ((CONSTPOW_TWO(BITCOUNT(hash)) / ht->nbuckets))];
}

Use division here, not modulo

Fixup: Use division here, not modulo


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

#include <editline/readline.h>
#include <editline/history.h>

int main(int argc, char** argv) {
	puts("zuzeelik [version: v0.0.0-0.0.2]");
	puts("Press Ctrl+C to Exit \n");

	/* Starting REPL */

	while(1){
		/* output from the prompt*/
		char* input = readline("zuzeelik> ");

		/*Add input to history */
		add_history(input);

		/* Echo the input back to the user */
		printf("Got Input: %s \n", input);

		free(input);
	}

	return 0;
}

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

/* if compiling in windows, compiling with this functions */

#ifdef _WIN32
#include <string.h>

	static char buffer[2048];
	/* fake readline functions */
	char* readline(char* prompt) {
		fputs(prompt, stdout);
		fputs(buffer, 2048, stdin);
		fgets(buffer, 2048, stdin);
		char* copy = malloc(strlen(buffer)+1);
		strcpy(copy, buffer);
		copy[strlen(copy) - 1] = '\0';
		return copy;
	}
	/* fake add_history function */
	void add_history(char* not_used) {}
/* or include thesse editline header */
#else

	#include <editline/readline.h>
	#include <editline/history.h>

#endif

int main(int argc, char** argv) {
	puts("zuzeelik [version: v0.0.0-0.0.3]");
	puts("Press Ctrl+C to Exit \n");

	/* Starting REPL */

	while(1){
		/* output from the prompt*/
		char* input = readline("zuzeelik> ");

		/*Add input to history */
		add_history(input);

		/* Echo the input back to the user */
		printf("Got Input: %s \n", input);

		/*free retrieved input */
		free(input);
	}

	return 0;
}

Add portability for windows OS

Add portability for windows OS

Added protibility for windows OS,using preprocessor directives and
made fake functions for windows.


C $Header$
C $Name$

c Ocean Exports
c -------------------
      common /ocean_exports/ sst, sice, ksst, kice
      _RL sst(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy)
      _RL sice(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy)
      integer ksst, kice

C $Header$
C $Name$

c Ocean Parameters
c -------------------
      common /ocean_params/sstclim,sstfreq,siceclim,sicefreq,ksst,kice
      logical sstclim,sstfreq,siceclim,sicefreq
      integer ksst, kice

c Ocean Exports
c -------------------
      common /ocean_exports/ sst, sice
      _RL sst(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy)
      _RL sice(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nsx,Nsy)

Add options for yearly sst data, move some other stuff around a bit


//
// sigen.h: global header file for user includes
// -----------------------------------

#pragma once

#include <sigen/types.h>
#include <sigen/dvb_defs.h>
#include <sigen/version.h>

#include <sigen/tstream.h>
#include <sigen/packetizer.h>
#include <sigen/utc.h>
#include <sigen/util.h>
#include <sigen/dump.h>

#include <sigen/table.h>
#include <sigen/nit.h>
#include <sigen/bat.h>
#include <sigen/sdt.h>
#include <sigen/pat.h>
#include <sigen/pmt.h>
#include <sigen/cat.h>
#include <sigen/eit.h>
#include <sigen/tdt.h>
#include <sigen/tot.h>
#include <sigen/other_tables.h>

#include <sigen/descriptor.h>
#include <sigen/dvb_desc.h>
#include <sigen/stream_desc.h>
#include <sigen/nit_desc.h>
#include <sigen/linkage_desc.h>
#include <sigen/sdt_desc.h>
#include <sigen/pmt_desc.h>
#include <sigen/ssu_desc.h>
#include <sigen/eit_desc.h>

//
// sigen.h: global header file for user includes
// -----------------------------------

#pragma once

#include "types.h"
#include "dvb_defs.h"
#include "version.h"

#include "tstream.h"
#include "packetizer.h"
#include "utc.h"
#include "util.h"
#include "dump.h"

#include "table.h"
#include "nit.h"
#include "bat.h"
#include "sdt.h"
#include "pat.h"
#include "pmt.h"
#include "cat.h"
#include "eit.h"
#include "tdt.h"
#include "tot.h"
#include "other_tables.h"

#include "descriptor.h"
#include "dvb_desc.h"
#include "stream_desc.h"
#include "nit_desc.h"
#include "linkage_desc.h"
#include "sdt_desc.h"
#include "pmt_desc.h"
#include "ssu_desc.h"
#include "eit_desc.h"

Fix header includes to use local paths.

Fix header includes to use local paths.


#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdint.h>

int
wait_a_while (useconds_t interval)
{
  int num_times = 0;
  int return_value = 1;

  struct timeval start_time;
  gettimeofday(&start_time, NULL);
  uint64_t target = start_time.tv_sec * 1000000 + start_time.tv_usec + interval;

  while (1)
    {
      num_times++;
      return_value = usleep (interval);
      if (return_value != 0)
        {
          struct timeval now;
          gettimeofday(&now, NULL);
          interval = target - now.tv_sec * 1000000 + now.tv_usec;
        }
      else
        break;
    }
  return num_times;
}

int
main (int argc, char **argv)
{
  printf ("stop here in main.\n");
  int num_times = wait_a_while (argc * 1000);
  printf ("Done, took %d times.\n", num_times);

  return 0;

}

#include <stdio.h>
#include <unistd.h>
#include <sys/time.h>
#include <stdint.h>

int
wait_a_while (useconds_t interval)
{
  int num_times = 0;
  int return_value = 1;

  struct timeval start_time;
  gettimeofday(&start_time, NULL);
  uint64_t target = start_time.tv_sec * 1000000 + start_time.tv_usec + interval;

  while (1)
    {
      num_times++;
      return_value = usleep (interval);
      if (return_value != 0)
        {
          struct timeval now;
          gettimeofday(&now, NULL);
          interval = target - (now.tv_sec * 1000000 + now.tv_usec);
        }
      else
        break;
    }
  return num_times;
}

int
main (int argc, char **argv)
{
  printf ("stop here in main.\n");
  int num_times = wait_a_while (argc * 1000);
  printf ("Done, took %d times.\n", num_times);

  return 0;

}

Fix interval recalculation in the event that usleep is interrupted

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


// gcc -mpreferred-stack-boundary=2 -ggdb shellcode_1.c -o shellcode_1
// run the syscalls from syscall_native.c from a static buffer
#include <stdio.h>

// WORKING
// * exit is called, and the process exits with the right code

// TODO
// * write doesn't write anything - check %ebp-4 is the right address

// Get hex representation of syscall_inline.c from gdb
// `disas f` to find the inline asm, then print each address:
// (gdb) x/bx f+13
// (gdb) x/bx f+14
// etc...

// This shellcode has lots of null bytes which is a problem
// for overflowing string buffers. It's OK here because there is no
// overflow - we just point main's return pointer at the start of the
// static shellcode. Static memory is executable.
const char shellcode[] =
  // print %ebp-4
  // "\xb8\x04\x00\x00\x00\xbb\x01\x00\x00\x00\x8b"
  //"\x4d\xfc\xba\x03\x00\x00\x00\xcd\x80"

  // exit 255
  // (code is the first byte on the second line)
  "\xb8\x01\x00\x00\x00\xbb"
  "\xff\x00\x00\x00\xcd\x80";

void f() {
  // char s[] = "hello";
  int *ret;
  ret = (int*)&ret + 2;
  (*ret) = (int)shellcode;
}

void main() {
  f();
  printf("not called because exit\n");
}

Make exit syscall from shellcode in static memory

* write syscall not working yet


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

struct step_count {
    long start;
    long max;
    size_t steps;
};

static
long r(long n, struct step_count* cnt)
{
    printf("%ld\n", n);
    //do not count last step, we're counting the initial call
    //causing 63,728,127 to count 950 steps instead of expected 949
    if (n <= 1)
        return n;
    ++cnt->steps;
    if (cnt->max < n) {
        cnt->max = n;
    }
    if (n%2)
        return r(n*3+1, cnt);
    return r(n/2, cnt);
}

int main (int argc, char **argv)
{
    long n = 15;
    if (argc > 1)
        n = strtol(argv[1], NULL, 10);
    struct step_count cnt = {n, n, 0};
    puts("Basic collatz fun - recursive C function");
    r(n, &cnt);
    printf(
            "Started with %ld. Reached end after %zu steps\nHighest value was %ld\n",
            cnt.start,
            cnt.steps,
            cnt.max
    );
    return 0;
}

Add collatz C snippet that keeps track of highest value + total steps taken


#include "debugger.h"

#include <stdio.h>
#include <lua.h>

#include "laco.h"

void laco_print_debug_info(struct LacoState* laco,
                           const char* function_name) {
  lua_State* L = laco_get_laco_lua_state(laco);
  lua_Debug debug_info = {0};

  lua_getfield(L, LUA_GLOBALSINDEX, function_name);

  lua_getinfo(L, ">Sl", &debug_info);

  printf(
    "What:            \t%s\n"
    "Source file:     \t%s\n"
    "Line defined on: \t%d\n"
    "Current line:    \t%d\n",
    debug_info.what, debug_info.source,
    debug_info.linedefined, debug_info.currentline);
}

#include "debugger.h"

#include <lua.h>

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

#include "laco.h"
#include "util.h"

void laco_print_debug_info(struct LacoState* laco,
                           const char* function_name) {
  int i;
  char* namespace;
  lua_State* L         = laco_get_laco_lua_state(laco);
  size_t index         = LUA_GLOBALSINDEX;
  lua_Debug debug_info = {0};

  char* name        = strdup(function_name);
  char** namespaces = laco_split_by(".", name, 0);

  /* Walk down the namespace if there is something to go down */
  for(i = 0; (namespace = namespaces[i]); i++) {
    lua_getfield(L, index, namespace);
    index = lua_gettop(L);
  }

  lua_getinfo(L, ">Sl", &debug_info);

  printf(
    "What:            \t%s\n"
    "Source file:     \t%s\n"
    "Line defined on: \t%d\n"
    "Current line:    \t%d\n",
    debug_info.what, debug_info.source,
    debug_info.linedefined, debug_info.currentline);

  /* Pop off the extra fields from the top of the stack */
  if(i > 1) {
    lua_pop(L, i - 1);
  }

  free(name);
  free(namespaces);
}

Add ablity to look through named tables

Add ablity to look through named tables


// Copyright 2020 Google LLC
//
// 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 MUTATOR_H_
#define MUTATOR_H_

#include <vector>

namespace fido2_tests {

// Mutates the given data by applying combined basic mutation operations.
class Mutator {
 public:
  enum MutationOperation {
    kEraseByte,
    kInsertByte,
    kShuffleBytes,
  };
  Mutator(int max_mutation_degree = 10, int seed = time(NULL));
  bool EraseByte(std::vector<uint8_t> &data, size_t max_size);
  bool InsertByte(std::vector<uint8_t> &data, size_t max_size);
  bool ShuffleBytes(std::vector<uint8_t> &data, size_t max_size);

  bool Mutate(std::vector<uint8_t> &data, size_t max_size);

 private:
  int max_mutation_degree_;
};

}  // namespace fido2_tests

#endif  // MUTATOR_H_

// Copyright 2020 Google LLC
//
// 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 MUTATOR_H_
#define MUTATOR_H_

#include <stdint.h>

#include <ctime>
#include <vector>

namespace fido2_tests {

// Mutates the given data by applying combined basic mutation operations.
class Mutator {
 public:
  enum MutationOperation {
    kEraseByte,
    kInsertByte,
    kShuffleBytes,
  };
  Mutator(int max_mutation_degree = 10, int seed = time(NULL));
  bool EraseByte(std::vector<uint8_t> &data, size_t max_size);
  bool InsertByte(std::vector<uint8_t> &data, size_t max_size);
  bool ShuffleBytes(std::vector<uint8_t> &data, size_t max_size);

  bool Mutate(std::vector<uint8_t> &data, size_t max_size);

 private:
  int max_mutation_degree_;
};

}  // namespace fido2_tests

#endif  // MUTATOR_H_

Add library for github workflow

Add library for github workflow


/*
 * This file is part of GreatFET
 */

#include "usb_api_dac.h"
#include "usb.h"
#include "usb_queue.h"
#include "usb_endpoint.h"

#include <stddef.h>
#include <greatfet_core.h>
#include <dac.h>
#include <pins.h>

usb_request_status_t usb_vendor_request_dac_set(
		usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) {
	usb_endpoint_init(&usb0_endpoint_bulk_in);
	if (stage == USB_TRANSFER_STAGE_SETUP) {

		// set J2_P5 up as a DAC pin
		scu_pinmux(SCU_PINMUX_GPIO2_3, SCU_GPIO_FAST | SCU_GPIO_PUP | SCU_CONF_FUNCTION0);
		static struct gpio_t dac_pin = GPIO(2, 3);
		gpio_input(&dac_pin);

		DAC_CR = DAC_CR_VALUE(endpoint->setup.value) && DAC_CR_VALUE_MASK;
		DAC_CTRL = DAC_CTRL_DMA_ENA;

		usb_transfer_schedule_ack(endpoint->in);
	}
	return USB_REQUEST_STATUS_OK;
}

/*
 * This file is part of GreatFET
 */

#include "usb_api_dac.h"
#include "usb.h"
#include "usb_queue.h"
#include "usb_endpoint.h"

#include <stddef.h>
#include <greatfet_core.h>
#include <dac.h>
#include <pins.h>

usb_request_status_t usb_vendor_request_dac_set(
		usb_endpoint_t* const endpoint, const usb_transfer_stage_t stage) {
	usb_endpoint_init(&usb0_endpoint_bulk_in);
	if (stage == USB_TRANSFER_STAGE_SETUP) {

		// set J2_P5 up as a DAC pin
		scu_pinmux(SCU_PINMUX_GPIO2_3, SCU_GPIO_FAST | SCU_GPIO_PUP | SCU_CONF_FUNCTION0);
		static struct gpio_t dac_pin = GPIO(2, 3);
		gpio_input(&dac_pin);

		DAC_CR = DAC_CR_VALUE(endpoint->setup.value) & DAC_CR_VALUE_MASK;
		DAC_CTRL = DAC_CTRL_DMA_ENA;

		usb_transfer_schedule_ack(endpoint->in);
	}
	return USB_REQUEST_STATUS_OK;
}

Fix typo which used a mask for a logical-and

The DAC conversion register value mask was logical-and'ed instead of
bitwise-and'ed when setting the DAC value via USB vendor request.


#ifndef CONSTANTS_H
#define CONSTANTS_H

#if !defined(__STDC__) && !defined(__cplusplus)
#define const
#endif

/*
	Set up a boolean variable type.  Since this definition could conflict
	with other reasonable definition of BOOLEAN, i.e. using an enumeration,
	it is conditional.
*/
#ifndef BOOLEAN_TYPE_DEFINED
typedef int BOOLEAN;
typedef int BOOL_T;
#endif

#if defined(TRUE)
#	undef TRUE
#	undef FALSE
#endif

static const int	TRUE = 1;
static const int	FALSE = 0;

/*
	Useful constants for turning seconds into larger units of time.  Since
	these constants may have already been defined elsewhere, they are
	conditional.
*/
#ifndef TIME_CONSTANTS_DEFINED
static const int	MINUTE = 60;
static const int	HOUR = 60 * 60;
static const int	DAY = 24 * 60 * 60;
#endif

/*
  This is for use with strcmp() and related functions which will return
  0 upon a match.
*/
#ifndef MATCH
static const int	MATCH = 0;
#endif

/*
  These are the well known file descriptors used for remote system call and
  logging functions.
*/
#ifndef CLIENT_LOG
static const int CLIENT_LOG = 18;
static const int RSC_SOCK = 17;
#endif
static const int REQ_SOCK = 16;
static const int RPL_SOCK = 17;

#endif

#ifndef CONSTANTS_H
#define CONSTANTS_H

#if !defined(__STDC__) && !defined(__cplusplus)
#define const
#endif

/*
	Set up a boolean variable type.  Since this definition could conflict
	with other reasonable definition of BOOLEAN, i.e. using an enumeration,
	it is conditional.
*/
#ifndef BOOLEAN_TYPE_DEFINED
typedef int BOOLEAN;
typedef int BOOL_T;
#define BOOLAN_TYPE_DEFINED
#endif

#if defined(TRUE)
#	undef TRUE
#	undef FALSE
#endif

static const int	TRUE = 1;
static const int	FALSE = 0;

/*
	Useful constants for turning seconds into larger units of time.  Since
	these constants may have already been defined elsewhere, they are
	conditional.
*/
#ifndef TIME_CONSTANTS_DEFINED
static const int	MINUTE = 60;
static const int	HOUR = 60 * 60;
static const int	DAY = 24 * 60 * 60;
#endif

/*
  This is for use with strcmp() and related functions which will return
  0 upon a match.
*/
#ifndef MATCH
static const int	MATCH = 0;
#endif

/*
  These are the well known file descriptors used for remote system call and
  logging functions.
*/
#ifndef CLIENT_LOG
static const int CLIENT_LOG = 18;
static const int RSC_SOCK = 17;
#endif
static const int REQ_SOCK = 16;
static const int RPL_SOCK = 17;

#endif

Define CPP macro BOOLAN_TYPE_DEFINED when we define types BOOLEAN and BOOL_T, to avoid doing it twice.


#ifndef XMMSC_SOCKETS_H
#define XMMSC_SOCKETS_H

#include <xmmsc/xmmsc_stdbool.h>

/* Windows */

#ifdef _MSC_VER
#include <Winsock2.h>
#include <Ws2tcpip.h>
typedef SOCKET xmms_socket_t;
typedef int socklen_t;
#define XMMS_EINTR WSAEINTR
#define XMMS_EAGAIN WSAEWOULDBLOCK

/* UNIX */
#else
#define SOCKET_ERROR (-1)
#define XMMS_EINTR EINTR
#define XMMS_EAGAIN EWOULDBLOCK
#include <sys/socket.h>
#include <sys/select.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
typedef int xmms_socket_t;
#endif

int xmms_sockets_initialize();
int xmms_socket_set_nonblock(xmms_socket_t socket);
int xmms_socket_valid(xmms_socket_t socket);
void xmms_socket_close(xmms_socket_t socket);
int xmms_socket_errno();
bool xmms_socket_error_recoverable();

#endif

#ifndef XMMSC_SOCKETS_H
#define XMMSC_SOCKETS_H

#include <xmmsc/xmmsc_stdbool.h>

/* Windows */

#ifdef _MSC_VER
#include <Winsock2.h>
#include <Ws2tcpip.h>
typedef SOCKET xmms_socket_t;
typedef int socklen_t;
#define XMMS_EINTR WSAEINTR
#define XMMS_EAGAIN WSAEWOULDBLOCK

/* UNIX */
#else
#define SOCKET_ERROR (-1)
#define XMMS_EINTR EINTR
#define XMMS_EAGAIN EWOULDBLOCK
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
typedef int xmms_socket_t;
#endif

int xmms_sockets_initialize();
int xmms_socket_set_nonblock(xmms_socket_t socket);
int xmms_socket_valid(xmms_socket_t socket);
void xmms_socket_close(xmms_socket_t socket);
int xmms_socket_errno();
bool xmms_socket_error_recoverable();

#endif

BUG(501): Fix compilation on OpenBSD (from Bernhard Leiner)


enum FlagEnum
{
  A = 1 << 0,
  B = 1 << 1,
  C = 1 << 2,
  D = 1 << 3,
};

enum FlagEnum2
{
  A = 1 << 0,
  B = 1 << 1,
  C = 1 << 2,
  D = 1 << 4,
};

class C { };
void DoSomethingC(C*, int);

struct TestRename
{
  int lowerCaseMethod();
  int lowerCaseField;
};

#define TEST_ENUM_ITEM_NAME_0 0
#define TEST_ENUM_ITEM_NAME_1 1
#define TEST_ENUM_ITEM_NAME_2 2

enum FlagEnum
{
  A = 1 << 0,
  B = 1 << 1,
  C = 1 << 2,
  D = 1 << 3,
};

enum FlagEnum2
{
  A1 = 1 << 0,
  B1 = 3,
  C1 = 1 << 2,
  D1 = 1 << 4,
};

class Foo { };
void FooStart(Foo*, int);

struct TestRename
{
  int lowerCaseMethod();
  int lowerCaseField;
};

#define TEST_ENUM_ITEM_NAME_0 0
#define TEST_ENUM_ITEM_NAME_1 1
#define TEST_ENUM_ITEM_NAME_2 2

// TestStructInheritance
struct S1 { int F1, F2; };
struct S2 : S1 { int F3; };

Update the passes test source file.

Update the passes test source file.


/* Copyright (c) 2008 Sun Microsystems, Inc.
   Use is subject to license terms.

   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; version 2 of the License.

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

#ifndef PROBES_MYSQL_H

#define PROBES_MYSQL_H

#include <my_global.h>

#if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE)
#include "probes_mysql_dtrace.h"
#else
#include "probes_mysql_nodtrace.h"
#endif

#endif /* PROBES_MYSQL_H */

/* Copyright (c) 2008 Sun Microsystems, Inc.
   Use is subject to license terms.

   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; version 2 of the License.

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

#ifndef PROBES_MYSQL_H

#define PROBES_MYSQL_H

#if defined(HAVE_DTRACE) && !defined(DISABLE_DTRACE)

#ifdef __linux__
/*
  On Linux, generated probes header may include C++ header
  <limits> which conflicts with min and max macros from my_global.h .
  To fix, temporarily undefine the macros.
*/
#pragma push_macro("min")
#pragma push_macro("max")
#undef min
#undef max
#endif

#include "probes_mysql_dtrace.h"

#ifdef __linux__
#pragma pop_macro("min")
#pragma pop_macro("max")
#endif

#else  /* no dtrace */
#include "probes_mysql_nodtrace.h"
#endif
#endif /* PROBES_MYSQL_H */

Fix build error on  Ubuntu 11.10, if systemtap is installed.

The error is due to conflict between min/max macros in my_global.h
and system header < limits>, indirectly included via generated
probes_mysql_dtrace.h

Temporarily undefined min/max for the inclusion of the probes_mysq_dtrace.h


/******************************************************************************
 *
 * Copyright 2017 Xaptum, Inc.
 *
 *    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 XAPTUM_ECDAA_XAPTUM_ECDAA_H
#define XAPTUM_ECDAA_XAPTUM_ECDAA_H
#pragma once

#include "xaptum-ecdaa/sign.h"
#include "xaptum-ecdaa/join_member.h"
#include "xaptum-ecdaa/context.h"

#endif

/******************************************************************************
 *
 * Copyright 2017 Xaptum, Inc.
 *
 *    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 XAPTUM_ECDAA_XAPTUM_ECDAA_H
#define XAPTUM_ECDAA_XAPTUM_ECDAA_H
#pragma once

#include "xaptum-ecdaa/sign.h"
#include "xaptum-ecdaa/join_member.h"
#include "xaptum-ecdaa/context.h"
#include "xaptum-ecdaa/verify.h"

#endif

FIX: Add verify.h to top-level include-all header.


#ifndef __GNOME_POPT_H__
#define __GNOME_POPT_H__ 1

#include "gnome-defs.h"

BEGIN_GNOME_DECLS

/* This is here because it does not have its own #ifdef __cplusplus */
#include <popt-gnome.h>

void gnomelib_register_popt_table(const struct poptOption *options,
				  const char *description);

poptContext gnomelib_parse_args(int argc, char *argv[],
				int popt_flags);

/* Some systems, like Red Hat 4.0, define these but don't declare
   them.  Hopefully it is safe to always declare them here.  */
extern char *program_invocation_short_name;
extern char *program_invocation_name;
END_GNOME_DECLS

#endif /* __GNOME_HELP_H__ */

#ifndef __GNOME_POPT_H__
#define __GNOME_POPT_H__ 1

#include "gnome-defs.h"

BEGIN_GNOME_DECLS

/* This is here because it does not have its own #ifdef __cplusplus */
#include <popt.h>

void gnomelib_register_popt_table(const struct poptOption *options,
				  const char *description);

poptContext gnomelib_parse_args(int argc, char *argv[],
				int popt_flags);

/* Some systems, like Red Hat 4.0, define these but don't declare
   them.  Hopefully it is safe to always declare them here.  */
extern char *program_invocation_short_name;
extern char *program_invocation_name;
END_GNOME_DECLS

#endif /* __GNOME_HELP_H__ */

Check for newer popt, and include it in the needed libs. Give correct

* configure.in: Check for newer popt, and include it in the needed libs.
* gnome-compat-1.0.h: Give correct paths to compat headers.
* gnome-config.in: Fixes to make help output correct.
* gnome.m4: Reorg so it doesn't do any path searching itself, just uses gnome-config.
* libgnome/gnome-popt.h: Include popt.h not popt-gnome.h
* support/Makefile.am: No popt built-in.


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

#ifndef NET_PROXY_PROXY_RESOLVER_MAC_H_
#define NET_PROXY_PROXY_RESOLVER_MAC_H_
#pragma once

#include <string>

#include "googleurl/src/gurl.h"
#include "net/base/net_errors.h"
#include "net/proxy/proxy_resolver.h"

namespace net {

// Implementation of ProxyResolver that uses the Mac CFProxySupport to implement
// proxies.
class ProxyResolverMac : public ProxyResolver {
 public:
  ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {}

  // ProxyResolver methods:
  virtual int GetProxyForURL(const GURL& url,
                             ProxyInfo* results,
                             CompletionCallback* callback,
                             RequestHandle* request,
                             const BoundNetLog& net_log);

  virtual void CancelRequest(RequestHandle request) {
    NOTREACHED();
  }

  virtual int SetPacScript(
      const scoped_refptr<ProxyResolverScriptData>& script_data,
      CompletionCallback* /*callback*/) {
    script_data_ = script_data_;
    return OK;
  }

 private:
  scoped_refptr<ProxyResolverScriptData> script_data_;
};

}  // namespace net

#endif  // NET_PROXY_PROXY_RESOLVER_MAC_H_

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

#ifndef NET_PROXY_PROXY_RESOLVER_MAC_H_
#define NET_PROXY_PROXY_RESOLVER_MAC_H_
#pragma once

#include <string>

#include "googleurl/src/gurl.h"
#include "net/base/net_errors.h"
#include "net/proxy/proxy_resolver.h"

namespace net {

// Implementation of ProxyResolver that uses the Mac CFProxySupport to implement
// proxies.
class ProxyResolverMac : public ProxyResolver {
 public:
  ProxyResolverMac() : ProxyResolver(false /*expects_pac_bytes*/) {}

  // ProxyResolver methods:
  virtual int GetProxyForURL(const GURL& url,
                             ProxyInfo* results,
                             CompletionCallback* callback,
                             RequestHandle* request,
                             const BoundNetLog& net_log);

  virtual void CancelRequest(RequestHandle request) {
    NOTREACHED();
  }

  virtual int SetPacScript(
      const scoped_refptr<ProxyResolverScriptData>& script_data,
      CompletionCallback* /*callback*/) {
    script_data_ = script_data;
    return OK;
  }

 private:
  scoped_refptr<ProxyResolverScriptData> script_data_;
};

}  // namespace net

#endif  // NET_PROXY_PROXY_RESOLVER_MAC_H_

Fix a typo, that could cause a crash on mac.

BUG=50717
TBR=rvargas
TEST=Set system proxy settings to use a custom PAC script, then launch TestShell.app -- should not crash.
Review URL: http://codereview.chromium.org/3023030

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

Former-commit-id: 1f1e880a7ff7fc1dcb3dbba5910ff6e5a65603c6


#include "clar_libgit2.h"

#include "git2/clone.h"

static git_repository *g_repo;

#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)

void test_online_badssl__expired(void)
{
	cl_git_fail_with(GIT_ECERTIFICATE,
			 git_clone(&g_repo, "https://expired.badssl.com/fake.git", "./fake", NULL));
}

void test_online_badssl__wrong_host(void)
{
	cl_git_fail_with(GIT_ECERTIFICATE,
			 git_clone(&g_repo, "https://wrong.host.badssl.com/fake.git", "./fake", NULL));
}

void test_online_badssl__self_signed(void)
{
	cl_git_fail_with(GIT_ECERTIFICATE,
			 git_clone(&g_repo, "https://self-signed.badssl.com/fake.git", "./fake", NULL));
}

#endif

#include "clar_libgit2.h"

#include "git2/clone.h"

static git_repository *g_repo;

#if defined(GIT_OPENSSL) || defined(GIT_WINHTTP) || defined(GIT_SECURE_TRANSPORT)
static bool g_has_ssl = true;
#else
static bool g_has_ssl = false;
#endif

void test_online_badssl__expired(void)
{
	if (!g_has_ssl)
		cl_skip();

	cl_git_fail_with(GIT_ECERTIFICATE,
			 git_clone(&g_repo, "https://expired.badssl.com/fake.git", "./fake", NULL));
}

void test_online_badssl__wrong_host(void)
{
	if (!g_has_ssl)
		cl_skip();

	cl_git_fail_with(GIT_ECERTIFICATE,
			 git_clone(&g_repo, "https://wrong.host.badssl.com/fake.git", "./fake", NULL));
}

void test_online_badssl__self_signed(void)
{
	if (!g_has_ssl)
		cl_skip();

	cl_git_fail_with(GIT_ECERTIFICATE,
			 git_clone(&g_repo, "https://self-signed.badssl.com/fake.git", "./fake", NULL));
}

Fix build for unit test

Fix build for unit test

If none of GIT_OPENSSL, GIT_WINHTTP or GIT_SECURE_TRANSPORT
is defined we should also be able to build the unit test.


//
// ogles_gpgpu project - GPGPU for mobile devices and embedded systems using OpenGL ES 2.0
//
// Author: Markus Konrad <post@mkonrad.net>, Winter 2014/2015
// http://www.mkonrad.net
//
// See LICENSE file in project repository root for the license.
//

#ifndef OGLES_GPGPU_COMMON_MACROS
#define OGLES_GPGPU_COMMON_MACROS

#define OG_TO_STR_(x) #x
#define OG_TO_STR(x) OG_TO_STR_(x)

#ifdef DEBUG
#define OG_LOGINF(class, args...) fprintf(stdout, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stdout, args); fprintf(stdout, "\n")
#else
#define OG_LOGINF(class, args...)
#endif

#define OG_LOGERR(class, args...) fprintf(stderr, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stderr, args); fprintf(stderr, "\n")

#endif

//
// ogles_gpgpu project - GPGPU for mobile devices and embedded systems using OpenGL ES 2.0
//
// Author: Markus Konrad <post@mkonrad.net>, Winter 2014/2015
// http://www.mkonrad.net
//
// See LICENSE file in project repository root for the license.
//

#ifndef OGLES_GPGPU_COMMON_MACROS
#define OGLES_GPGPU_COMMON_MACROS

#define OG_TO_STR_(x) #x
#define OG_TO_STR(x) OG_TO_STR_(x)

#if !defined(NDEBUG)
#define OG_LOGINF(class, args...) fprintf(stdout, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stdout, args); fprintf(stdout, "\n")
#else
#define OG_LOGINF(class, args...)
#endif

#define OG_LOGERR(class, args...) fprintf(stderr, "ogles_gpgpu::%s - %s - ", class, __FUNCTION__); fprintf(stderr, args); fprintf(stderr, "\n")

#endif

Use !NDEBUG to detect Debug variant of build


#ifndef INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_
#define INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_
#include "DLLDefines.h"
#include <vector>
#include <stddef.h>

/*
This algorithm "Quick Union With Path Compression" solves the dynamic connectivity problem.
Starting from an empty data structure, any sequence of M union-find ops on N objects makes ≤ c ( N + M lg* N ) array accesses.
In reality log * function can be considered to be at the most 5.
Thus in theory, this algorithm is not quite linear but in practice it is.
*/

namespace algorithms {
  class QuickUnionWithPathCompression {
    public:
      MYLIB_EXPORT QuickUnionWithPathCompression(size_t no_of_elements);
      MYLIB_EXPORT ~QuickUnionWithPathCompression() = default;

      MYLIB_EXPORT void Union(size_t elementA, size_t elementB);
      MYLIB_EXPORT bool Connected(size_t elementA, size_t elementB);

    private:
      size_t GetRoot(size_t element);

      inline bool IsIdInBounds(size_t element) {
        return element >= 0 && element < id_.size();
      }

    private:
      std::vector<size_t> id_;
      std::vector<size_t> size_;
  };
}

#endif //INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_

#ifndef INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_
#define INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_
#include "DLLDefines.h"
#include <vector>
#include <stddef.h>

/*
This algorithm "Quick Union With Path Compression" solves the dynamic connectivity problem.
Starting from an empty data structure, any sequence of M union-find ops on N objects makes ≤ c ( N + M lg* N ) array accesses.
In reality log * function can be considered to be at the most 5.
Thus in theory, this algorithm is not quite linear but in practice it is.
*/

namespace algorithms {
  class QuickUnionWithPathCompression {
    public:
      MYLIB_EXPORT QuickUnionWithPathCompression(size_t no_of_elements);
      MYLIB_EXPORT ~QuickUnionWithPathCompression() = default;

      MYLIB_EXPORT void Union(size_t elementA, size_t elementB);
      MYLIB_EXPORT bool Connected(size_t elementA, size_t elementB);

    private:
      size_t GetRoot(size_t element);

      inline bool IsIdInBounds(size_t element) {
        return element < id_.size();
      }

    private:
      std::vector<size_t> id_;
      std::vector<size_t> size_;
  };
}

#endif //INCLUDE_ALGORITHMS_QUICK_UNION_WITH_PATH_COMPRESSION_H_

Remove unnecessary checking of size_t >= 0


/* @(#)root/eg:$Name$:$Id$ */

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_HepEvt
#define ROOT_HepEvt

extern "C" {

#ifndef __CFORTRAN_LOADED
#include "cfortran.h"
#endif

typedef struct {
	Int_t	 nevhep;
        Int_t    nhep;
        Int_t    isthep[2000];
        Int_t    idhep[2000];
        Int_t    jmohep[2000][2];
        Int_t    jdahep[2000][2];
        Double_t phep[2000][5];
        Double_t vhep[2000][4];
} HEPEVT_DEF;

#define HEPEVT COMMON_BLOCK(HEPEVT,hepevt)

COMMON_BLOCK_DEF(HEPEVT_DEF,HEPEVT);

HEPEVT_DEF HEPEVT;

}

#endif

/* @(#)root/eg:$Name:  $:$Id: Hepevt.h,v 1.1.1.1 2000/05/16 17:00:47 rdm Exp $ */

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#ifndef ROOT_HepEvt
#define ROOT_HepEvt

extern "C" {

#ifndef __CFORTRAN_LOADED
#include "cfortran.h"
#endif

typedef struct {
	Int_t	 nevhep;
        Int_t    nhep;
        Int_t    isthep[4000];
        Int_t    idhep[4000];
        Int_t    jmohep[4000][2];
        Int_t    jdahep[4000][2];
        Double_t phep[4000][5];
        Double_t vhep[4000][4];
} HEPEVT_DEF;

#define HEPEVT COMMON_BLOCK(HEPEVT,hepevt)

COMMON_BLOCK_DEF(HEPEVT_DEF,HEPEVT);

HEPEVT_DEF HEPEVT;

}

#endif

Change maximum dimension of hepevt from 2000 to 4000 to be consistent
between Pythia5 and 6. Note that this change implies a recompilation
of jetset.f

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


#include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;

List* List_Create(void);
void List_Destroy(List* l);
ListNode* ListNode_Create(void *);
void ListNode_Destroy(ListNode* n);
ListNode* List_Search(List* l, void* k, int (f)(void*, void*));

#endif

#include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;

List* List_Create(void);
void List_Destroy(List* l);
ListNode* ListNode_Create(void *);
void ListNode_Destroy(ListNode* n);
ListNode* List_Search(List* l, void* k, int (f)(void*, void*));
void List_Insert(List* l, ListNode* n);

#endif

Add List Insert function declaration

Add List Insert function declaration


#ifndef FMRCXX_FMRCXX_H_
#define FMRCXX_FMRCXX_H_

#include <fmrcxx/Iterator.h>
#include <fmrcxx/Range.h>
#include <fmrcxx/internal/StdMapIterator.h>
#include <fmrcxx/internal/StdContainerIterator.h>

namespace fmrcxx {

template <typename T, template <typename...> class Container, typename... TTs>
StdContainerIterator<T, typename Container<T, TTs...>::iterator> iterateOver(Container<T, TTs...>& container);

template <typename T, template <typename... Others> class Container, typename... TTs>
StdContainerIterator<T, typename Container<T>::iterator> reverseIterateOver(Container<T>& container);

template <typename Key, typename Value, template <typename...> class MapContainer, typename... TTs>
StdMapIterator<Key, Value, typename MapContainer<Key, Value, TTs...>::iterator> iterateOverMap(MapContainer<Key, Value, TTs...>& container);

template <typename Key, typename Value, template <typename...> class MapContainer, typename... TTs>
StdMapIterator<Key, Value, typename MapContainer<Key, Value, TTs...>::iterator> reverseIterateOverMap(MapContainer<Key, Value, TTs...>& container);

}

#include <fmrcxx/impl/fmrcxx.hpp>

#endif

#ifndef FMRCXX_FMRCXX_H_
#define FMRCXX_FMRCXX_H_

#include <fmrcxx/Iterator.h>
#include <fmrcxx/Range.h>
#include <fmrcxx/Random.h>
#include <fmrcxx/internal/StdMapIterator.h>
#include <fmrcxx/internal/StdContainerIterator.h>

namespace fmrcxx {

template <typename T, template <typename...> class Container, typename... TTs>
StdContainerIterator<T, typename Container<T, TTs...>::iterator> iterateOver(Container<T, TTs...>& container);

template <typename T, template <typename... Others> class Container, typename... TTs>
StdContainerIterator<T, typename Container<T>::iterator> reverseIterateOver(Container<T>& container);

template <typename Key, typename Value, template <typename...> class MapContainer, typename... TTs>
StdMapIterator<Key, Value, typename MapContainer<Key, Value, TTs...>::iterator> iterateOverMap(MapContainer<Key, Value, TTs...>& container);

template <typename Key, typename Value, template <typename...> class MapContainer, typename... TTs>
StdMapIterator<Key, Value, typename MapContainer<Key, Value, TTs...>::iterator> reverseIterateOverMap(MapContainer<Key, Value, TTs...>& container);

}

#include <fmrcxx/impl/fmrcxx.hpp>

#endif

Add Random to general header

Add Random to general header


#include "_condor_fix_types.h"
#include "condor_fix_stdio.h"
#include <stdlib.h>
#include "condor_fix_unistd.h"
#include "condor_fix_limits.h"
#include <string.h>
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>

#include "_condor_fix_types.h"
#include "condor_fix_stdio.h"
#include <stdlib.h>
#include "condor_fix_unistd.h"
#include "condor_fix_limits.h"
#include "condor_fix_string.h"
#include <ctype.h>
#include <fcntl.h>
#include <errno.h>

Include condor_fix_string.h rather than just string.h


/*
 * 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 106
#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 107
#endif

Update Skia milestone to 107

Update Skia milestone to 107

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


#ifndef __extendFunctor_
#define __extendFunctor_

template<class Functor, typename CSig, typename ESig>
struct ExtendedFunctor : public Functor
{
public:
  typedef typename CSig::type ControlSignature;
  typedef typename ESig::type ExecutionSignature;
};

#endif

Add new functor that inherits from base and has custom sigs.


#ifndef ROBOBO_H
#define ROBOBO_H
#include "main.h"

#include <string.h> // C strings to handle args
#include <sstream>
#endif

#ifndef ROBOBO_H
#define ROBOBO_H
#include "main.h"
#include "base.h"

#include <string.h> // C strings to handle args
#include <sstream>
#endif

Include unincluded necessary header file.


//
//  APIConstant.h
//  PHPHub
//
//  Created by Aufree on 9/30/15.
//  Copyright (c) 2015 ESTGroup. All rights reserved.
//

#define APIAccessTokenURL [NSString stringWithFormat:@"%@%@", APIBaseURL, @"/oauth/access_token"]
#define QiniuUploadTokenIdentifier @"QiniuUploadTokenIdentifier"

#if DEBUG
#define APIBaseURL      @"https://staging_api.phphub.org/v1"
#else
#define APIBaseURL      @"https://api.phphub.org/v1"
#endif

#define PHPHubHost        @"phphub.org"
#define PHPHubUrl         @"https://phphub.org/"
#define GitHubURL         @"https://github.com/"
#define TwitterURL        @"https://twitter.com/"
#define ProjectURL        @"https://github.com/aufree/phphub-ios"
#define AboutPageURL      @"https://phphub.org/about"
#define ESTGroupURL       @"http://est-group.org"
#define AboutTheAuthorURL @"weibo.com/jinfali"
#define PHPHubGuide       @"http://7xnqwn.com1.z0.glb.clouddn.com/index.html"
#define PHPHubTopicURL    @"https://phphub.org/topics/"
#define SinaRedirectURL   @"http://sns.whalecloud.com/sina2/callback"

#define UpdateNoticeCount @"UpdateNoticeCount"

//
//  APIConstant.h
//  PHPHub
//
//  Created by Aufree on 9/30/15.
//  Copyright (c) 2015 ESTGroup. All rights reserved.
//

#define APIAccessTokenURL [NSString stringWithFormat:@"%@%@", APIBaseURL, @"/oauth/access_token"]
#define QiniuUploadTokenIdentifier @"QiniuUploadTokenIdentifier"

#if DEBUG
#define APIBaseURL      @"https://staging_api.phphub.org/v1"
#else
#define APIBaseURL      @"https://api.phphub.org/v1"
#endif

#define PHPHubHost        @"phphub.org"
#define PHPHubUrl         @"https://phphub.org/"
#define GitHubURL         @"https://github.com/"
#define TwitterURL        @"https://twitter.com/"
#define ProjectURL        @"https://github.com/aufree/phphub-ios"
#define AboutPageURL      @"https://phphub.org/about"
#define ESTGroupURL       @"http://est-group.org"
#define AboutTheAuthorURL @"https://github.com/aufree"
#define PHPHubGuide       @"http://7xnqwn.com1.z0.glb.clouddn.com/index.html"
#define PHPHubTopicURL    @"https://phphub.org/topics/"
#define SinaRedirectURL   @"http://sns.whalecloud.com/sina2/callback"

#define UpdateNoticeCount @"UpdateNoticeCount"

Change about the author url

Change about the author url


Add another test for pretty printing if-then-else

Ignore-this: c0cab673ec9d716deb4154ae5599ed74

darcs-hash:512056f55df6186193f854d96821b4a589d19d04


#import "CLPBaseObject.h"

@interface CLPUIObject : CLPBaseObject

@property (nonatomic, readwrite) IBOutlet UIView *view;

- (instancetype)remove;

@end

#import "CLPBaseObject.h"

@interface CLPUIObject : CLPBaseObject

@property (nonatomic, strong, readwrite) IBOutlet UIView *view;

- (instancetype)remove;

@end

Set view property to strong for UIObjects.


/* This file is part of Zanshin

   Copyright 2014 Kevin Ottens <ervin@kde.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) version 3 or any later version
   accepted by the membership of KDE e.V. (or its successor approved
   by the membership of KDE e.V.), which shall act as a proxy
   defined in Section 14 of version 3 of the license.

   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 Street, Fifth Floor, Boston, MA 02110-1301,
   USA.
*/

#ifndef DOMAIN_NOTEREPOSITORY_H
#define DOMAIN_NOTEREPOSITORY_H

#include "note.h"

class KJob;

namespace Domain {

class NoteRepository
{
public:
    NoteRepository();
    virtual ~NoteRepository();

    virtual KJob *save(Note::Ptr note) = 0;
    virtual KJob *remove(Note::Ptr note) = 0;
};

}

#endif // DOMAIN_NOTEREPOSITORY_H

/* This file is part of Zanshin

   Copyright 2014 Kevin Ottens <ervin@kde.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) version 3 or any later version
   accepted by the membership of KDE e.V. (or its successor approved
   by the membership of KDE e.V.), which shall act as a proxy
   defined in Section 14 of version 3 of the license.

   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 Street, Fifth Floor, Boston, MA 02110-1301,
   USA.
*/

#ifndef DOMAIN_NOTEREPOSITORY_H
#define DOMAIN_NOTEREPOSITORY_H

#include "datasource.h"
#include "note.h"

class KJob;

namespace Domain {

class NoteRepository
{
public:
    NoteRepository();
    virtual ~NoteRepository();

    virtual bool isDefaultSource(DataSource::Ptr source) const = 0;
    virtual void setDefaultSource(DataSource::Ptr source) = 0;

    virtual KJob *save(Note::Ptr note) = 0;
    virtual KJob *remove(Note::Ptr note) = 0;
};

}

#endif // DOMAIN_NOTEREPOSITORY_H

Add the default source concept to NoteRepository


/*
 *  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) 2016-2020 The Karbowanec developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef UPDATE_H
#define UPDATE_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QUrl>

const static QString KARBO_UPDATE_URL   = "https://api.github.com/repos/Karbovanets/karbowanecwallet/tags";
const static QString KARBO_DOWNLOAD_URL = "https://github.com/Karbovanets/karbowanecwallet/releases/";

class Updater : public QObject
{
    Q_OBJECT
public:
    explicit Updater(QObject *parent = 0);

    ~Updater() {
        delete manager;
    }

    void checkForUpdate();

signals:

public slots:
    void replyFinished (QNetworkReply *reply);

private:
   QNetworkAccessManager *manager;

};

#endif // UPDATE_H

// Copyright (c) 2016-2020 The Karbowanec developers
// Distributed under the MIT/X11 software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef UPDATE_H
#define UPDATE_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QUrl>

const static QString KARBO_UPDATE_URL   = "https://api.github.com/repos/seredat/karbowanecwallet/tags";
const static QString KARBO_DOWNLOAD_URL = "https://github.com/seredat/karbowanecwallet/releases/";

class Updater : public QObject
{
    Q_OBJECT
public:
    explicit Updater(QObject *parent = 0);

    ~Updater() {
        delete manager;
    }

    void checkForUpdate();

signals:

public slots:
    void replyFinished (QNetworkReply *reply);

private:
   QNetworkAccessManager *manager;

};

#endif // UPDATE_H

Change repository urls to proper for this version


#define BASE_SPEED_FULL   127

void base_set(int fr, int br, int bl, int fl);
void base_set(int power);

void dump_set(int x);

void lift_set(int x);

#define LCD_BUTTON_LEFT   1
#define LCD_BUTTON_CENTER 2
#define LCD_BUTTON_RIGHT  4
#define LCD_BUTTON_NONE   0
#define LCD_LINE_TOP      0
#define LCD_LINE_BOTTOM   1

void lcd_voltage(void);
void lcd_clear(void);

// Get rid of annoying "unreferenced function" warnings
static void DO_NOT_CALL_THIS_FUNCTION(void) {

    DO_NOT_CALL_THIS_FUNCTION();
    UserControlCodePlaceholderForTesting();
    AutonomousCodePlaceholderForTesting();

}

Remove annoying "unreferenced function" warnings


#define ATTR_POS   0
#define ATTR_UV    1
#define ATTR_COLOR 2

#define TEXUNIT_TEMP 0
#define TEXUNIT_COLOR 1
#define TEXUNIT_AREATEX 2
#define TEXUNIT_SEARCHTEX 3
#define TEXUNIT_EDGES 4
#define TEXUNIT_BLEND 5

#ifdef __cplusplus

struct Globals

#else  // __cplusplus

layout(binding = 0, std140) uniform Globals

#endif  // __cplusplus
{
	vec4 screenSize;
	mat4 viewProj;
	mat4 guiOrtho;
};

struct Cube {
	vec4 rotation;
	vec3 position;
	unsigned int color;
};

#define ATTR_POS   0
#define ATTR_UV    1
#define ATTR_COLOR 2

#define TEXUNIT_TEMP 0
#define TEXUNIT_COLOR 1
#define TEXUNIT_AREATEX 2
#define TEXUNIT_SEARCHTEX 3
#define TEXUNIT_EDGES 4
#define TEXUNIT_BLEND 5

#ifdef __cplusplus

struct Globals

#else  // __cplusplus

layout(binding = 0, std140) uniform Globals

#endif  // __cplusplus
{
	vec4 screenSize;
	mat4 viewProj;
	mat4 guiOrtho;
};

struct Cube {
	vec4 rotation;
	vec3 position;
	uint color;
};

Change "unsigned int" -> "uint" for better GLSL compatibility


/*************************************************
* RandomNumberGenerator Header File              *
* (C) 1999-2008 Jack Lloyd                       *
*************************************************/

#ifndef BOTAN_RANDOM_NUMBER_GENERATOR__
#define BOTAN_RANDOM_NUMBER_GENERATOR__

#include <botan/exceptn.h>

namespace Botan {

/*************************************************
* Entropy Source                                 *
*************************************************/
class BOTAN_DLL EntropySource
   {
   public:
      virtual u32bit slow_poll(byte[], u32bit) = 0;
      virtual u32bit fast_poll(byte[], u32bit);
      virtual ~EntropySource() {}
   };

/*************************************************
* Random Number Generator                        *
*************************************************/
class BOTAN_DLL RandomNumberGenerator
   {
   public:
      virtual void randomize(byte[], u32bit) throw(PRNG_Unseeded) = 0;
      virtual bool is_seeded() const = 0;
      virtual void clear() throw() {};

      byte next_byte();

      void add_entropy(const byte[], u32bit);
      u32bit add_entropy(EntropySource&, bool = true);

      virtual ~RandomNumberGenerator() {}
   private:
      virtual void add_randomness(const byte[], u32bit) = 0;
   };

}

#endif

/*************************************************
* RandomNumberGenerator Header File              *
* (C) 1999-2008 Jack Lloyd                       *
*************************************************/

#ifndef BOTAN_RANDOM_NUMBER_GENERATOR__
#define BOTAN_RANDOM_NUMBER_GENERATOR__

#include <botan/exceptn.h>

namespace Botan {

/*************************************************
* Entropy Source                                 *
*************************************************/
class BOTAN_DLL EntropySource
   {
   public:
      virtual u32bit slow_poll(byte[], u32bit) = 0;
      virtual u32bit fast_poll(byte[], u32bit);
      virtual ~EntropySource() {}
   };

/*************************************************
* Random Number Generator                        *
*************************************************/
class BOTAN_DLL RandomNumberGenerator
   {
   public:
      virtual void randomize(byte[], u32bit) = 0;
      virtual bool is_seeded() const = 0;
      virtual void clear() throw() {};

      byte next_byte();

      void add_entropy(const byte[], u32bit);
      u32bit add_entropy(EntropySource&, bool = true);

      virtual ~RandomNumberGenerator() {}
   private:
      virtual void add_randomness(const byte[], u32bit) = 0;
   };

}

#endif

Remove exception specifier from RandomNumberGenerator::randomize


#include "pg_query.h"
#include "pg_query_internal.h"

const char* progname = "pg_query";

void pg_query_init(void)
{
	MemoryContextInit();
}

#include "pg_query.h"
#include "pg_query_internal.h"
#include <mb/pg_wchar.h>

const char* progname = "pg_query";

void pg_query_init(void)
{
	MemoryContextInit();
	SetDatabaseEncoding(PG_UTF8);
}

Set database encoding to UTF8.

Set database encoding to UTF8.

Fixes error when parsing this statement:

SELECT U&'\0441\043B\043E\043D'

The error is:

Unicode escape values cannot be used for code point values above
007F when the server encoding is not UTF8.

Perhapes there could be an API to set the encoding used by the
parser. But I think it makes sense to use UTF8 by default.


/*
name: TEST032
description: test special characters @ and $ in macro definitions
output:
F3	I
G4	F3	main
{
\
A6	P	p
	A6	"54686973206973206120737472696E672024206F722023206F72202323616E64206974206973206F6B2021	'P	:P
	r	A6	#P0	!I
}
*/

#define M1(x) "This is a string $ or # or ##" ## #x

int
main(void)
{
	char *p = M1(and it is ok!);

	return p != 0;
}

Add test for special characters in macro definition

@ and $ only can appear in strings or in characters,
and cc1 use them for special purposes in macro
definitions. Test that it is ok is they are in
a macro (character test should be done to).


#ifndef LLIST_H
#define LLIST_H

/* Doubly linked list */
#define DLLIST_PREPEND(list, item) STMT_START { \
	(item)->prev = NULL; \
	(item)->next = *(list); \
	if (*(list) != NULL) (*(list))->prev = (item); \
	*(list) = (item); \
	} STMT_END

#define DLLIST_REMOVE(list, item) STMT_START { \
	if ((item)->prev == NULL) \
		*(list) = (item)->next; \
	else \
		(item)->prev->next = (item)->next; \
	if ((item)->next != NULL) \
		(item)->next->prev = (item)->prev; \
	} STMT_END

#endif

#ifndef LLIST_H
#define LLIST_H

/* Doubly linked list */
#define DLLIST_PREPEND(list, item) STMT_START { \
	(item)->prev = NULL; \
	(item)->next = *(list); \
	if (*(list) != NULL) (*(list))->prev = (item); \
	*(list) = (item); \
	} STMT_END

#define DLLIST_REMOVE(list, item) STMT_START { \
	if ((item)->prev == NULL) \
		*(list) = (item)->next; \
	else \
		(item)->prev->next = (item)->next; \
	if ((item)->next != NULL) { \
		(item)->next->prev = (item)->prev; \
		(item)->next = NULL; \
	} \
	(item)->prev = NULL; \
	} STMT_END

#endif

DLLIST_REMOVE(): Set removed item's prev/next pointers to NULL.


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

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

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

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

#ifndef TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_
#define TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_

#define EIGEN_USE_THREADS

#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"

namespace tensorflow {
namespace thread {

class ThreadPoolInterface : public Eigen::ThreadPoolInterface {};

}  // namespace thread
}  // namespace tensorflow

#endif  // TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_

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

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

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

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

#ifndef TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_
#define TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_

#ifndef EIGEN_USE_THREADS
#define EIGEN_USE_THREADS
#endif

#include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor"

namespace tensorflow {
namespace thread {

class ThreadPoolInterface : public Eigen::ThreadPoolInterface {};

}  // namespace thread
}  // namespace tensorflow

#endif  // TENSORFLOW_CORE_LIB_CORE_THREADPOOL_INTERFACE_H_

Define EIGEN_USE_THREADS only if it is not defined yet

PiperOrigin-RevId: 253269616


//
//	Sudoku 9by9 Solver and Analyzer
//

#include "Sudoku9by9Board.h"

class Sudoku9by9SolverAnalyzer
{
private:
	Sudoku9by9Board *board_ptr;
	int number_of_solutions;
public:
	Sudoku9by9SolverAnalyzer();
	Sudoku9by9SolverAnalyzer(Sudoku9by9Board *board_ptr);
	bool NextTryOrBackTrack(int i, int j, bool backtrack);
	void Solve(void);
	bool Check_Conflicts(int p, int i, int j);
	int get_number_of_solutions(void);
	~Sudoku9by9SolverAnalyzer();
};

Create separate Solver Analyzer class

Create separate Solver Analyzer class


#ifndef CONTROL_MODE_ENUM_H
#define CONTROL_MODE_ENUM_H

namespace ControlModes
{
enum ControlMode
{
  OPEN_LOOP = 0,
  SIXDOF    = 1,
  RPY_DEPTH = 2
};
}
typedef ControlModes::ControlMode ControlMode;

#endif

#ifndef CONTROL_MODE_ENUM_H
#define CONTROL_MODE_ENUM_H

namespace ControlModes
{
enum ControlMode
{
  OPEN_LOOP  = 0,
  SIXDOF     = 1,
  RPY_DEPTH  = 2,
  DEPTH_HOLD = 3
};
}
typedef ControlModes::ControlMode ControlMode;

#endif

Add depth hold mode to enum

Add depth hold mode to enum


#include <type_traits>

namespace WSTM
{
   //!{
   /**
    * Finds the given type in the given pack of arguments. This is useful for having variadic
    * argument lists for functions. To have variadic arguments in a function just make the function
    * a template and take a parameter pack of arguments. Then use findArg to find any given type in
    * the parameter pack (each argument you want to be able to find needs to have a unique type,
    * which is easy to arrange by using the FIND_ARG__MAKE_ARG_TYPE macro). findArg will return the
    * argument of the given type or a default constructed object of the given type if there was no
    * object of the given type in the argument pack.
    */
   template <typename Wanted_t, typename A_t, typename ... As_t>
   std::enable_if_t<std::is_same<Wanted_t, A_t>::value, Wanted_t> findArg (const A_t& a, const As_t&...)
   {
      return a;
   }

   template <typename Wanted_t, typename A_t, typename ... As_t>
   std::enable_if_t<!std::is_same<Wanted_t, A_t>::value, Wanted_t> findArg (const A_t&, const As_t&... as)
   {
      return findArg<Wanted_t> (as...);
   }

   template <typename Wanted_t, typename A_t>
   std::enable_if_t<std::is_same<Wanted_t, A_t>::value, Wanted_t> findArg (const A_t& a)
   {
      return a;
   }

   template <typename Wanted_t, typename A_t>
   std::enable_if_t<!std::is_same<Wanted_t, A_t>::value, Wanted_t> findArg (const A_t&)
   {
      return Wanted_t ();
   }

   template <typename Wanted_t>
   typename Wanted_t findArg ()
   {
      return Wanted_t ();
   }
   //!}

   /**
    * Creates a type for use with findArg. The created type will have a "m_value" member that
    * contains the actual value for the argument.
    *
    * @param type The type for m_value.
    * @param name The name that shoudl be given to the create type.
    * @param def The default value for m_value.
    */
#define MAKE_ARG_TYPE(type, name, def)             \
   struct name                                     \
   {                                               \
      type m_value;                                \
      name () : m_value (def) {}                   \
      name (const type value) : m_value (value) {} \
   };//

}

Create fidnArgs to replace CombinatorArgs


/* Configuration for the mruby-bignum gem */

#ifndef MRB_BIGNUM_CONF_H
#define MRB_BIGNUM_CONF_H

/* Size of a Bignum digit:  16, 32 or 64 */
/* If not defined, this is the same size as a Fixnum */
/* To use MRB_BIGNUM_BIT == 64, the compiler must support unsigned __int128 */
#define MRB_BIGNUM_BIT 64

/* Define to enable recursive algorithms for multiplication, division,
   squaring, and conversion to and from strings */
#define MRB_BIGNUM_ENABLE_RECURSION

/* Cutoffs for recursive multiplication, squaring and division */
#define MRB_BIGNUM_MUL_RECURSION_CUTOFF 32
#define MRB_BIGNUM_SQR_RECURSION_CUTOFF 64
#define MRB_BIGNUM_DIV_RECURSION_CUTOFF 32

#endif

/* Configuration for the mruby-bignum gem */

#ifndef MRB_BIGNUM_CONF_H
#define MRB_BIGNUM_CONF_H

/* Size of a Bignum digit:  16, 32 or 64 */
/* If not defined, this is the same size as a Fixnum */
/* To use MRB_BIGNUM_BIT == 64, the compiler must support unsigned __int128 */
#define MRB_BIGNUM_BIT 32

/* Define to enable recursive algorithms for multiplication, division,
   squaring, and conversion to and from strings */
#define MRB_BIGNUM_ENABLE_RECURSION

/* Cutoffs for recursive multiplication, squaring and division */
#define MRB_BIGNUM_MUL_RECURSION_CUTOFF 32
#define MRB_BIGNUM_SQR_RECURSION_CUTOFF 64
#define MRB_BIGNUM_DIV_RECURSION_CUTOFF 32

#endif

Set the default bit width to 32.

Set the default bit width to 32.

32 bit Bignums don't need any non-C99 features.


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

#include <orc/orc.h>

#include <stdio.h>

int main (int argc, char *argv[])
{
  int offset;
  int expected_offset;
  int error = 0;

  offset = ((int) ((unsigned char *) &((OrcProgram*) 0)->code_exec));

  if (sizeof(void *) == 4) {
    expected_offset = 8360;
  } else {
    expected_offset = 9688;
  }

  if (offset != expected_offset) {
    printf("ABI bug: OrcProgram->code_exec should be at offset %d instead of %d\n",
        offset, expected_offset);
    error = 1;
  }

  return error;
}

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

#include <orc/orc.h>

#include <stdio.h>

int main (int argc, char *argv[])
{
  long offset;
  int expected_offset;
  int error = 0;

  offset = ((long) ((unsigned char *) &((OrcProgram*) 0)->code_exec));

  if (sizeof(void *) == 4) {
    expected_offset = 8360;
  } else {
    expected_offset = 9688;
  }

  if (offset != expected_offset) {
    printf("ABI bug: OrcProgram->code_exec should be at offset %ld instead of %d\n",
        offset, expected_offset);
    error = 1;
  }

  return error;
}

tests: Fix compilation of the ABI test on 64 bit architectures

Casting a pointer to a plain int will cause a compiler error, use long instead.


#ifndef _ARDUINO_COMPAT_H
#define _ARDUINO_COMPAT_H

#include <stdio.h>
#include <stdlib.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h>

#include <ctype.h>

#include <string.h>

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef bool boolean;
//#define uint8_t unsigned char

#define FILE_READ O_RDONLY
#define FILE_WRITE (O_RDWR | O_CREAT)

#endif

#ifndef _ARDUINO_COMPAT_H
#define _ARDUINO_COMPAT_H

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h>

#include <ctype.h>

#include <string.h>

typedef bool boolean;
//#define uint8_t unsigned char

#define FILE_READ O_RDONLY
#define FILE_WRITE (O_RDWR | O_CREAT)

#endif

Use stdint.h for unsigned integer typedefs

Fixes problem compiling regression tests on 64 bit OS.


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

#ifndef SOAD_H_
#define SOAD_H_

#include "TcpIp.h"

typedef struct {
    uint8 dummy;
} SoAd_SocketConnection;

typedef struct {
    uint32 headerid;

} SoAd_SocketRoute;

typedef struct {
    uint8 dummy;
} SoAd_ConfigType;

void SoAd_Init(const SoAd_ConfigType* config);
void SoAd_MainFunction(void);

#endif

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

#ifndef SOAD_H_
#define SOAD_H_

#include "TcpIp.h"

#define SOAD_MODULEID   56u
#define SOAD_INSTANCEID 0u

typedef struct {
    uint8 dummy;
} SoAd_SocketConnection;

typedef struct {
    uint32 headerid;

} SoAd_SocketRoute;

typedef struct {
    uint8 dummy;
} SoAd_ConfigType;

void SoAd_Init(const SoAd_ConfigType* config);
void SoAd_MainFunction(void);

#endif

Add moduleid and instance id

Add moduleid and instance id


// RUN: %clang_analyze_cc1 %s -verify \
// RUN:   -analyzer-checker=security.insecureAPI

void builtin_function_call_crash_fixes(char *c) {
  __builtin_strncpy(c, "", 6); // expected-warning{{Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
  __builtin_memset(c, '\0', (0)); // expected-warning{{Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard.}}
  __builtin_memcpy(c, c, 0); // expected-warning{{Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
}

// RUN: %clang_analyze_cc1 %s -verify \
// RUN:   -analyzer-checker=security.insecureAPI
// RUN: %clang_analyze_cc1 %s -verify -std=gnu11 \
// RUN:   -analyzer-checker=security.insecureAPI
// RUN: %clang_analyze_cc1 %s -verify -std=gnu99 \
// RUN:   -analyzer-checker=security.insecureAPI

void builtin_function_call_crash_fixes(char *c) {
  __builtin_strncpy(c, "", 6);
  __builtin_memset(c, '\0', (0));
  __builtin_memcpy(c, c, 0);

#if __STDC_VERSION__ > 199901
  // expected-warning@-5{{Call to function 'strncpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
  // expected-warning@-5{{Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard.}}
  // expected-warning@-5{{Call to function 'memcpy' is insecure as it does not provide security checks introduced in the C11 standard.}}
#else
  // expected-no-diagnostics
#endif
}

Fix test on PS4 which defaults to gnu99 which does not emit the expected warnings.

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


#include <stdlib.h>
#include <check.h>

Suite* eas_daemon_suite (void);
Suite* eas_autodiscover_suite (void);
Suite* eas_libeasmail_suite (void);
Suite* eas_libeascal_suite (void);
Suite* eas_libeassync_suite (void);
Suite* eas_libeascon_suite (void);
Suite* eas_folderhierarchy_suite (void);

int main (void)
{
    int number_failed;

    SRunner* sr = srunner_create (eas_daemon_suite());

// Only to be used manually, updating the sync key to see manual
// changes on the server reflected to the client
//   srunner_add_suite (sr, eas_folderhierarchy_suite());

    srunner_add_suite (sr, eas_autodiscover_suite());
    srunner_add_suite (sr, eas_libeasmail_suite());
    srunner_add_suite (sr, eas_libeascal_suite());
//    srunner_add_suite (sr, eas_libeassync_suite());
    srunner_add_suite (sr, eas_libeascon_suite());
	srunner_set_xml (sr, "eas-daemon_test.xml");
    srunner_set_log (sr, "eas-daemon_test.log");
    srunner_run_all (sr, CK_NORMAL);
    number_failed = srunner_ntests_failed (sr);
    srunner_free (sr);
    return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}

#include <stdlib.h>
#include <check.h>

Suite* eas_daemon_suite (void);
Suite* eas_autodiscover_suite (void);
Suite* eas_libeasmail_suite (void);
Suite* eas_libeascal_suite (void);
Suite* eas_libeassync_suite (void);
Suite* eas_libeascon_suite (void);
Suite* eas_folderhierarchy_suite (void);

int main (void)
{
    int number_failed;

    SRunner* sr = srunner_create (eas_daemon_suite());

    /** Only to be used manually, updating the sync key to see manual
     *  changes on the server reflected to the client
     */
//    srunner_add_suite (sr, eas_folderhierarchy_suite());

    srunner_add_suite (sr, eas_autodiscover_suite());
    srunner_add_suite (sr, eas_libeasmail_suite());
    srunner_add_suite (sr, eas_libeascal_suite());
    srunner_add_suite (sr, eas_libeassync_suite());
    srunner_add_suite (sr, eas_libeascon_suite());

    srunner_set_xml (sr, "eas-daemon_test.xml");
    srunner_set_log (sr, "eas-daemon_test.log");
    srunner_run_all (sr, CK_NORMAL);
    number_failed = srunner_ntests_failed (sr);
    srunner_free (sr);
    return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
}

Enable all test suites except the manual folder hierarchy one


#ifndef _SELECTIVE_H
#define _SELECTIVE_H

#include "psyco.h"
#include "codemanager.h"

#define FUN_BOUND -1
#define MAX_RECURSION 1

EXTERNVAR PyObject* funcs;
EXTERNVAR int ticks;
EXTERNFN int do_selective(void *, PyFrameObject *, int, PyObject *);

#endif

#ifndef _SELECTIVE_H
#define _SELECTIVE_H

#include "psyco.h"
#include "codemanager.h"

#define FUN_BOUND -1
#define MAX_RECURSION 99

EXTERNVAR PyObject* funcs;
EXTERNVAR int ticks;
EXTERNFN int do_selective(void *, PyFrameObject *, int, PyObject *);

#endif

Set the MAX_RECURSION macro to 99 instead of 1


/**
 * Energy reading for an ODROID with INA231 power sensors, using ioctl on
 * device files instead of sysfs.
 *
 * @author Connor Imes
 * @date 2015-10-14
 */
#ifndef _ENERGYMON_ODROID_IOCTL_H_
#define _ENERGYMON_ODROID_IOCTL_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <stddef.h>
#include "energymon.h"

int energymon_init_odroid_ioctl(energymon* em);

uint64_t energymon_read_total_odroid_ioctl(const energymon* em);

int energymon_finish_odroid_ioctl(energymon* em);

char* energymon_get_source_odroid_ioctl(char* buffer, size_t n);

uint64_t energymon_get_interval_odroid_ioctl(const energymon* em);

uint64_t energymon_get_precision_odroid_ioctl(const energymon* em);

int energymon_is_exclusive_odroid_ioctl();

int energymon_get_odroid_ioctl(energymon* em);

#ifdef __cplusplus
}
#endif

#endif

/**
 * Energy reading for an ODROID with INA231 power sensors, using ioctl on
 * device files instead of sysfs.
 *
 * @author Connor Imes
 * @date 2015-10-14
 */
#ifndef _ENERGYMON_ODROID_IOCTL_H_
#define _ENERGYMON_ODROID_IOCTL_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <inttypes.h>
#include <stddef.h>
#include "energymon.h"

int energymon_init_odroid_ioctl(energymon* em);

uint64_t energymon_read_total_odroid_ioctl(const energymon* em);

int energymon_finish_odroid_ioctl(energymon* em);

char* energymon_get_source_odroid_ioctl(char* buffer, size_t n);

uint64_t energymon_get_interval_odroid_ioctl(const energymon* em);

uint64_t energymon_get_precision_odroid_ioctl(const energymon* em);

int energymon_is_exclusive_odroid_ioctl();

int energymon_get_odroid_ioctl(energymon* em);

#ifdef __cplusplus
}
#endif

#endif

Add missing include (mostly for good practice as it's currently included transitively anyway)


#include <gtk/gtk.h>

GtkWidget *
gh_about_dialog_create ()
{
  GtkWidget *dialog;

  dialog = gtk_about_dialog_new ();

  return dialog;
}

#include <gtk/gtk.h>

GtkWidget *
gh_about_dialog_create ()
{
  GtkWidget *dialog;

  dialog = gtk_about_dialog_new ();

  static gchar const *title = "About ghighlighter";

  gtk_window_set_title (GTK_WINDOW (dialog), title);

  return dialog;
}

Set about dialog title through static const variable


/**
 * @file
 * @brief 2nd level boot on Xen
 *
 * @date    04.11.2016
 * @author  Andrey Golikov
 * @author  Anton Kozlov
 */

#include <hal/arch.h>
#include <hal/ipl.h>
#include <drivers/diag.h>
#include <embox/runlevel.h>
#include <kernel/printk.h>

#include <xen/features.h>
#include <stdint.h>
#include <xen/xen.h>
#include <hypercall-x86_32.h>
#include <xen/event_channel.h>
#include <xen/io/console.h>
#include "event.h"

void kernel_start(void);

uint8_t xen_features[XENFEAT_NR_SUBMAPS * 32];

extern shared_info_t shared_info;
extern void handle_input(evtchn_port_t port, struct pt_regs * regs);

shared_info_t *HYPERVISOR_shared_info;
start_info_t * start_info_global;

void kernel_start_xen(start_info_t * start_info) {
	HYPERVISOR_update_va_mapping((unsigned long) &shared_info,
			__pte(start_info->shared_info | 7),
			UVMF_INVLPG);

	start_info_global = start_info;
	HYPERVISOR_shared_info = &shared_info;

	init_events();

	kernel_start();
}

Move xen kernel init from global files

Move xen kernel init from global files


typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;

#define __EMBEDDED_PROFILE__ 1
#undef cles_khr_int64
#define cl_khr_fp16
#undef cl_khr_fp64

typedef uint size_t;
typedef int ptrdiff_t;
typedef int intptr_t;
typedef uint uintptr_t;

Add removed TCE type definitions back.

Add removed TCE type definitions back.


//
// Copyright 2011-2014 NimbusKit
//
// 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.
//

@interface NIOperation()
@property (strong) NSError* lastError;
@end

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

@interface NIOperation()
@property (strong) NSError* lastError;
@end

Add proper import for NIOperations

Add proper import for  NIOperations


#include <logging.h>
#include <cedille/pmm.h>
#include <cedille/heap.h>
extern uint32_t _kernel_start,_kernel_end;

void vmm_init();
void kprocess_init();
void timing_system_engine_reportstatustoconsole();
void kernel_doperiodic(int force, int tick);

int kernel_idle_process() {
	int i = 0;
	for(;;) {
		// Attempt to reschedule other processes unless things need to be done
		// So, check if theres anything that needs to be done (like kernel state verification)
		// Execute that, make sure everything is preemptable
		// Then, attempt to reschedule processes if there isn't anything.
		// Otherwise cpu time is wasted.
		if(i != 500) {
			printf("test%d\n",i++);
		}
	}
	return 0;
}

int kmain() {
	low_printname();

	init_early_malloc(&_kernel_end);
	init_pmm();
	vmm_init();
	heap_init();

	timing_system_engine_reportstatustoconsole();

	kernel_doperiodic(1,0); // Force stuff to happen once at the end of initialisation

	kernel_idle_process();
	return 0;
}

#include <logging.h>
#include <cedille/pmm.h>
#include <cedille/heap.h>
extern uint32_t _kernel_start,_kernel_end;

void vmm_init();
void kprocess_init();
void timing_system_engine_reportstatustoconsole();
void kernel_doperiodic(int force, int tick);

int kernel_idle_process() {
	for(;;) {
		// Attempt to reschedule other processes unless things need to be done
		// So, check if theres anything that needs to be done (like kernel state verification)
		// Execute that, make sure everything is preemptable
		// Then, attempt to reschedule processes if there isn't anything.
		// Otherwise cpu time is wasted.
	}
	return 0;
}

int kmain() {
	low_printname();

	init_early_malloc(&_kernel_end);
	init_pmm();
	vmm_init();
	heap_init();

	timing_system_engine_reportstatustoconsole();

	kernel_doperiodic(1,0); // Force stuff to happen once at the end of initialisation

	kernel_idle_process();
	return 0;
}

Remove test scrolling code from idle_process