/* Test program to make a single openslide_read_region() call and write the
   result as a PPM. */

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <assert.h>
#include <openslide.h>

int main(int argc, char **argv) {
  if (argc != 7) {
    printf("Arguments: slide out.ppm x y w h\n");
    return 1;
  }

  char *slide = argv[1];
  char *out = argv[2];
  int64_t x = atoi(argv[3]);
  int64_t y = atoi(argv[4]);
  int64_t w = atoi(argv[5]);
  int64_t h = atoi(argv[6]);

  uint32_t *buf = malloc(w * h * 4);
  openslide_t *osr = openslide_open(slide);
  assert(osr != NULL);
  openslide_read_region(osr, buf, x, y, 0, w, h);
  assert(openslide_get_error(osr) == NULL);
  openslide_close(osr);

  FILE *fp;
  fp = fopen(out, "w");
  assert(fp != NULL);
  fprintf(fp, "P6\n# Extraneous comment\n%"PRIu64" %"PRIu64" 255\n", w, h);
  for (y = 0; y < h; y++) {
    for (x = 0; x < w; x++) {
      uint32_t sample = buf[y * h + x];
      // undo premultiplication, more or less
      double alpha = ((sample >> 24) ?: 1) / 255.0;
      uint8_t pixel[3] = {
        ((sample >> 16) & 0xff) / alpha,
        ((sample >> 8) & 0xff) / alpha,
        (sample & 0xff) / alpha,
      };
      fwrite(pixel, 1, sizeof(pixel), fp);
    }
  }
  fclose(fp);
  free(buf);
}

Add program for testing large openslide_read_region() calls

Use nip2 to read the output.


#ifndef ALI_DECAYER__H
#define ALI_DECAYER__H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/* $Id$ */

#include "RVersion.h"
#include "TVirtualMCDecayer.h"

typedef TVirtualMCDecayer AliDecayer;

#if ROOT_VERSION_CODE >= 197633  //Corresponds to Root v3-04-01
typedef enum
{
    kSemiElectronic, kDiElectron, kSemiMuonic, kDiMuon,
    kBJpsiDiMuon, kBJpsiDiElectron,
    kBPsiPrimeDiMuon, kBPsiPrimeDiElectron, kPiToMu, kKaToMu,
    kNoDecay, kHadronicD, kOmega, kPhiKK,
    kAll, kNoDecayHeavy, kHardMuons, kBJpsi,
    kWToMuon,kWToCharm, kWToCharmToMuon
} Decay_t;
#endif

#endif //ALI_DECAYER__H

#ifndef ALI_DECAYER__H
#define ALI_DECAYER__H
/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

/* $Id$ */

#include "RVersion.h"
#include "TVirtualMCDecayer.h"

typedef TVirtualMCDecayer AliDecayer;

#if ROOT_VERSION_CODE >= 197633  //Corresponds to Root v3-04-01
typedef enum
{
    kSemiElectronic, kDiElectron, kSemiMuonic, kDiMuon,
    kBJpsiDiMuon, kBJpsiDiElectron,
    kBPsiPrimeDiMuon, kBPsiPrimeDiElectron, kPiToMu, kKaToMu,
    kNoDecay, kHadronicD, kOmega, kPhiKK,
    kAll, kNoDecayHeavy, kHardMuons, kBJpsi,
    kWToMuon,kWToCharm, kWToCharmToMuon, kNewTest
} Decay_t;
#endif

#endif //ALI_DECAYER__H

Test case for B0 -> mu

Test case for B0 -> mu


/**
 * @file arch/alpha/oprofile/op_impl.h
 *
 * @remark Copyright 2002 OProfile authors
 * @remark Read the file COPYING
 *
 * @author Richard Henderson <rth@twiddle.net>
 */

#ifndef OP_IMPL_H
#define OP_IMPL_H 1

struct pt_regs;

extern int null_perf_irq(void);
extern int (*perf_irq)(void);

/* Per-counter configuration as set via oprofilefs.  */
struct op_counter_config {
	unsigned long enabled;
	unsigned long event;
	unsigned long count;
	/* Dummies because I am too lazy to hack the userspace tools.  */
	unsigned long kernel;
	unsigned long user;
	unsigned long exl;
	unsigned long unit_mask;
};

/* Per-architecture configury and hooks.  */
struct op_mips_model {
	void (*reg_setup) (struct op_counter_config *);
	void (*cpu_setup) (void * dummy);
	int (*init)(void);
	void (*exit)(void);
	void (*cpu_start)(void *args);
	void (*cpu_stop)(void *args);
	char *cpu_type;
	unsigned char num_counters;
};

#endif

/**
 * @file arch/alpha/oprofile/op_impl.h
 *
 * @remark Copyright 2002 OProfile authors
 * @remark Read the file COPYING
 *
 * @author Richard Henderson <rth@twiddle.net>
 */

#ifndef OP_IMPL_H
#define OP_IMPL_H 1

extern int null_perf_irq(void);
extern int (*perf_irq)(void);

/* Per-counter configuration as set via oprofilefs.  */
struct op_counter_config {
	unsigned long enabled;
	unsigned long event;
	unsigned long count;
	/* Dummies because I am too lazy to hack the userspace tools.  */
	unsigned long kernel;
	unsigned long user;
	unsigned long exl;
	unsigned long unit_mask;
};

/* Per-architecture configury and hooks.  */
struct op_mips_model {
	void (*reg_setup) (struct op_counter_config *);
	void (*cpu_setup) (void * dummy);
	int (*init)(void);
	void (*exit)(void);
	void (*cpu_start)(void *args);
	void (*cpu_stop)(void *args);
	char *cpu_type;
	unsigned char num_counters;
};

#endif

[MIPS] Delete unneeded pt_regs forward declaration.

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


// Test coverage flag.
//
// RUN: %clang_cl -### -coverage %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CLANG-CL-COVERAGE %s
// CLANG-CL-COVERAGE-NOT: error:
// CLANG-CL-COVERAGE-NOT: warning:
// CLANG-CL-COVERAGE-NOT: argument unused
// CLANG-CL-COVERAGE-NOT: unknown argument

// Test coverage flag.
// REQUIRES: system-windows
//
// RUN: %clang_cl -### -coverage %s -o foo/bar.o 2>&1 | FileCheck -check-prefix=CLANG-CL-COVERAGE %s
// CLANG-CL-COVERAGE-NOT: error:
// CLANG-CL-COVERAGE-NOT: warning:
// CLANG-CL-COVERAGE-NOT: argument unused
// CLANG-CL-COVERAGE-NOT: unknown argument

Add a missing "REQUIRES: system-windows" to a Windows-only test.

This un-breaks builds on other platforms. Otherwise, they fail due to warnings like:

warning: unable to find a Visual Studio installation; try running Clang from a developer command prompt [-Wmsvc-not-found]

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


//Basic master parser
extern uint8_t MODBUSParseResponseBasic( union MODBUSParser * );

//Basic master parser
extern uint8_t MODBUSParseResponseBasic( union MODBUSParser *, union MODBUSParser * );

Add passing of request frame to parsing functions


#include "../small1/testharness.h"

// NUMERRORS 1

struct foo {
  int a[8];
  int *b;
} gfoo;

struct bar {
  int a[8];
  int *b;
};

int main() {
  int * __INDEX p = & gfoo.a[2]; // Force gfoo.a to have a length

  // This should be Ok, but pbar->b is gfoo.a[7]
  struct bar *pbar = (struct bar*)&gfoo;

  gfoo.a[7] = 5;
  pbar->b = 0;

  printf("Pointer is %lx\n", (unsigned long)pbar->b);
  *(pbar->b) = 0; //ERROR(1): Null
  SUCCESS;
}

#include "../small1/testharness.h"
#include "../small1/testkinds.h"

// NUMERRORS 3

struct foo {
  int a[8];
  int *b;
} gfoo;

struct bar {
  int a[8];
  int *b;
};

#if ERROR == 2
struct s1 {
  int a[8];
  int *b;
} * s1;
struct s2 {
  int *c;
  int d[8];
} * s2;
#endif

#if ERROR == 3
struct s_with_index {
  int __INDEX arr[8] __INDEX;
} * s1;

struct s_with_non_array {
  int a,b,c,d,e,f,g,h;
} * s2;
#endif

int main() {
  int * __INDEX p = & gfoo.a[2]; // Force gfoo.a to have a length

  // This should be Ok, but pbar->b is gfoo.a[7]
  struct bar *pbar = (struct bar*)&gfoo;

  pbar->b = 0;
  gfoo.a[7] = 5;

  printf("Pointer is %lx\n", (unsigned long)pbar->b);
  *(pbar->b) = 0; //ERROR(1): Null

  s1 = s2; if (HAS_KIND(s1, WILD_KIND)) E(2); // ERROR(2):Error

#if ERROR == 3
  s1 = s2; // ERROR(3): compared with a non-array
#endif

  SUCCESS;
}

Change the solver handling of arrays. Previously we were calling compat on
the pointers underneath matching arrays. However, this led to problems:
  union {
    char a[8];
    int  b[2];
  }
This is in fact fine, but we'd end up with compat edges between a node
pointing to char and a node pointing to int and they wouldn't be congruent
so they would end up being WILD. However, if one of them is INDEX, the
other should be as well. So we remember whenever an array is compared
against another array and we make sure that they have the same flags.
However:
  union {
    char a[4] __INDEX;
    int b;
  }
Should fail. So we remember whenever an array is compared with a non-array.
Later, if any such array ends up being INDEX we die with an error in the
solver.

This commit also beefs up the test-bad/index1 testcase.


#include <stdio.h>

void abertura(int m) {
  printf("Tabuada do %d\n", m);
}

int main() {

  int multiplicador = 2;

  abertura(multiplicador);

  for(int i = 1; i <= 10; i++) {
    printf("%d x %d = %d\n", multiplicador, i, multiplicador * i);
  }

}

Update files, Alura, Introdução a C - Parte 2, Aula 4.3


// RUN: %check -e %s

f(int a, int b, int dir)
{
	struct
	{
		int x, y;
	} c = { };

	a & b ? c.x += dir : c.y += dir; // CHECK: error: assignment to int/if - not an lvalue
}

Test for parsing assignment in a ?:'s rhs


/* libvisio
 * Copyright (C) 2011 Fridrich Strba <fridrich.strba@bluewin.ch>
 * Copyright (C) 2011 Eilidh McAdam <tibbylickle@gmail.com>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA  02111-1301 USA
 */

#ifndef VSDXDOCUMENTSTRUCTURE_H
#define VSDXDOCUMENTSTRUCTURE_H

#endif /* VSDXDOCUMENTSTRUCTURE_H */

Add an empty header that will contain defines concerning the document structure


#pragma once

#include <boost/container/vector.hpp>
#include "System.h"

class Renderer : public System {
protected:
	uint16_t width = 1280;
	uint16_t height = 720;
	Decimal fovPlus = glm::radians(10.0f);
	Decimal zNear = 0.05f;
	Decimal zFar = 48.0f;
	Decimal pixelDistanceFromScreen = 1000.0f;
public:
	bool showFPS = false;
	uint32_t time = 0;

	static bool IsSupported() { return false; }
	Renderer(Polar *engine) : System(engine) {}

	virtual void MakePipeline(const boost::container::vector<std::string> &) = 0;
	virtual void SetClearColor(const Point4 &) = 0;
	virtual Decimal GetUniformDecimal(const std::string &, const Decimal = 0) = 0;
	virtual Point3 GetUniformPoint3(const std::string &, const Point3 = Point3(0)) = 0;
	virtual void SetUniform(const std::string &, glm::uint32) = 0;
	virtual void SetUniform(const std::string &, Decimal) = 0;
	virtual void SetUniform(const std::string &, Point3) = 0;
};

#pragma once

#include <boost/container/vector.hpp>
#include "System.h"

class Renderer : public System {
protected:
	uint16_t width = 1280;
	uint16_t height = 720;
	Decimal fovPlus = glm::radians(10.0f);
	Decimal zNear = 0.05f;
	Decimal zFar = 48.0f;
	Decimal pixelDistanceFromScreen = 1000.0f;
public:
	bool showFPS = false;
	uint32_t time = 0;

	static bool IsSupported() { return false; }
	Renderer(Polar *engine) : System(engine) {}

	inline uint16_t GetWidth() { return width; }
	inline uint16_t GetHeight() { return height; }

	virtual void MakePipeline(const boost::container::vector<std::string> &) = 0;
	virtual void SetClearColor(const Point4 &) = 0;
	virtual Decimal GetUniformDecimal(const std::string &, const Decimal = 0) = 0;
	virtual Point3 GetUniformPoint3(const std::string &, const Point3 = Point3(0)) = 0;
	virtual void SetUniform(const std::string &, glm::uint32) = 0;
	virtual void SetUniform(const std::string &, Decimal) = 0;
	virtual void SetUniform(const std::string &, Point3) = 0;
};

Add getters for width/height of renderer


// library.h
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
// -----------------------------------------------------------------------------

// From swift's include/swift/Runtime/Debug.h file.
struct RuntimeErrorDetails {
  uintptr_t version;
  const char *errorType;
  const char *currentStackDescription;
  uintptr_t framesToSkip;
  void *memoryAddress;

  struct Thread {
    const char *description;
    uint64_t threadID;
    uintptr_t numFrames;
    void **frames;
  };

  uintptr_t numExtraThreads;
  Thread *threads;

  struct FixIt {
    const char *filename;
    uintptr_t startLine;
    uintptr_t startColumn;
    uintptr_t endLine;
    uintptr_t endColumn;
    const char *replacementText;
  };

  struct Note {
    const char *description;
    uintptr_t numFixIts;
    FixIt *fixIts;
  };

  uintptr_t numFixIts;
  FixIt *fixIts;

  uintptr_t numNotes;
  Note *notes;
};

enum: uintptr_t {
  RuntimeErrorFlagNone = 0,
  RuntimeErrorFlagFatal = 1 << 0
};

extern "C"
void _swift_runtime_on_report(uintptr_t flags, const char *message, RuntimeErrorDetails *details);

// library.h
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
// -----------------------------------------------------------------------------

#include <stdint.h>

// From swift's include/swift/Runtime/Debug.h file.
struct RuntimeErrorDetails {
  uintptr_t version;
  const char *errorType;
  const char *currentStackDescription;
  uintptr_t framesToSkip;
  void *memoryAddress;

  struct Thread {
    const char *description;
    uint64_t threadID;
    uintptr_t numFrames;
    void **frames;
  };

  uintptr_t numExtraThreads;
  Thread *threads;

  struct FixIt {
    const char *filename;
    uintptr_t startLine;
    uintptr_t startColumn;
    uintptr_t endLine;
    uintptr_t endColumn;
    const char *replacementText;
  };

  struct Note {
    const char *description;
    uintptr_t numFixIts;
    FixIt *fixIts;
  };

  uintptr_t numFixIts;
  FixIt *fixIts;

  uintptr_t numNotes;
  Note *notes;
};

enum: uintptr_t {
  RuntimeErrorFlagNone = 0,
  RuntimeErrorFlagFatal = 1 << 0
};

extern "C"
void _swift_runtime_on_report(uintptr_t flags, const char *message, RuntimeErrorDetails *details);

[testsuite] Include the necessary headers to make the swift-runtime-reporting test work.


void abort();

int add(int a, int b) { return a + b; }
int sub(int a, int b) { return a - b; }
int mul(int a, int b) { return a * b; }
int div(int a, int b) { return a / b; }

int rem(int a, int b) { return a % b; }

long *arr[5] = {(long *)&add, (long *)&sub, (long *)&mul, (long *)&div, (long *)&rem };

int main() {
  int i;
  int sum = 0;
  for (i = 0; i < 10000; i++) {
    int (*p)(int x, int y) = (int (*)(int x, int y))arr[i % 5];
    sum += p(i, 2);
  }
  if (sum != 44991000) {
    abort();
  }
}

Add test case for casting addresses to function pointers


/** @file
    @brief Header

    @date 2014

    @author
    Ryan Pavlik
    <ryan@sensics.com>
    <http://sensics.com>
*/

// Copyright 2014 Sensics, Inc.
//
// All rights reserved.
//
// (Final version intended to be licensed under
// the Apache License, Version 2.0)

#ifndef INCLUDED_ServerPtr_h_GUID_ED06F093_FC19_49B1_8905_16E7CE12D207
#define INCLUDED_ServerPtr_h_GUID_ED06F093_FC19_49B1_8905_16E7CE12D207

// Internal Includes
#include <osvr/Util/SharedPtr.h>

// Library/third-party includes
// - none

// Standard includes
// - none

namespace osvr {
namespace server {
    class Server;
    /// @brief How one should hold a Server.
    typedef shared_ptr<Server> ServerPtr;
} // namespace server
} // namespace osvr

#endif // INCLUDED_ServerPtr_h_GUID_ED06F093_FC19_49B1_8905_16E7CE12D207

/** @file
    @brief Header

    @date 2014

    @author
    Ryan Pavlik
    <ryan@sensics.com>
    <http://sensics.com>
*/

// Copyright 2014 Sensics, Inc.
//
// All rights reserved.
//
// (Final version intended to be licensed under
// the Apache License, Version 2.0)

#ifndef INCLUDED_ServerPtr_h_GUID_ED06F093_FC19_49B1_8905_16E7CE12D207
#define INCLUDED_ServerPtr_h_GUID_ED06F093_FC19_49B1_8905_16E7CE12D207

// Internal Includes
#include <osvr/Util/SharedPtr.h>

// Library/third-party includes
// - none

// Standard includes
// - none

namespace osvr {
namespace server {
    class Server;
    /// @brief How one should hold a Server.
    typedef shared_ptr<Server> ServerPtr;
    /// @brief How one might observe a Server without owning it.
    typedef weak_ptr<Server> ServerWeakPtr;
} // namespace server
} // namespace osvr

#endif // INCLUDED_ServerPtr_h_GUID_ED06F093_FC19_49B1_8905_16E7CE12D207

Add a weak pointer type for the server.

Add a weak pointer type for the server.


//
//  UIView+Sizing.h
//  aaah
//
//  Created by Stanislaw Pankevich on 5/10/13.
//  Copyright (c) 2013 IProjecting. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface UIView (Sizing)

@property CGPoint origin;
@property CGSize size;

@property CGFloat x;
@property CGFloat y;
@property CGFloat height;
@property CGFloat width;

@property CGFloat centerX;
@property CGFloat centerY;

@end

// Inspired by FrameAccessor
// https://github.com/AlexDenisov/FrameAccessor/

#import <UIKit/UIKit.h>

@interface UIView (Sizing)

@property CGPoint origin;
@property CGSize size;

@property CGFloat x;
@property CGFloat y;
@property CGFloat height;
@property CGFloat width;

@property CGFloat centerX;
@property CGFloat centerY;

@end

Add a note about FrameAccessor

Add a note about FrameAccessor


//
// os/winapi/alloc.h: Low-level WinAPI-based allocators.
//
// CEN64: Cycle-Accurate Nintendo 64 Simulator.
// Copyright (C) 2014, Tyler J. Stachecki.
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//

#include "common.h"
#include "os/common/alloc.h"
#include <stddef.h>
#include <windows.h>

// Allocates a block of (R/W/X) memory.
void *cen64_alloc(struct cen64_mem *m, size_t size, bool exec) {
  int access = exec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE;

  if ((m->ptr = VirtualAlloc(NULL, size,
    MEM_COMMIT | MEM_RESERVE, access)) == NULL)
    return NULL;

  m->size = size;
  return m->ptr;
}

// Releases resources acquired by cen64_alloc_init.
void cen64_alloc_cleanup(void) {
}

// Initializes CEN64's low-level allocator.
int cen64_alloc_init(void) {
  return 0;
}

// Releases resources acquired by cen64_alloc.
void cen64_free(struct cen64_mem *m) {
  VirtualFree(m->ptr, m->size, MEM_RELEASE);
}

//
// os/winapi/alloc.h: Low-level WinAPI-based allocators.
//
// CEN64: Cycle-Accurate Nintendo 64 Simulator.
// Copyright (C) 2014, Tyler J. Stachecki.
//
// This file is subject to the terms and conditions defined in
// 'LICENSE', which is part of this source code package.
//

#include "common.h"
#include "os/common/alloc.h"
#include <stddef.h>
#include <windows.h>

// Allocates a block of (R/W/X) memory.
void *cen64_alloc(struct cen64_mem *m, size_t size, bool exec) {
  int access = exec ? PAGE_EXECUTE_READWRITE : PAGE_READWRITE;

  if ((m->ptr = VirtualAlloc(NULL, size,
    MEM_COMMIT | MEM_RESERVE, access)) == NULL)
    return NULL;

  m->size = size;
  return m->ptr;
}

// Releases resources acquired by cen64_alloc_init.
void cen64_alloc_cleanup(void) {
}

// Initializes CEN64's low-level allocator.
int cen64_alloc_init(void) {
  return 0;
}

// Releases resources acquired by cen64_alloc.
void cen64_free(struct cen64_mem *m) {
  VirtualFree(m->ptr, 0, MEM_RELEASE);
}

Fix a WinAPI VirtualFree bug.

Fix a WinAPI VirtualFree bug.

Thanks go out to izy for this commit.


// ESPasyncJson.h
/*
  Async Response to use with arduinoJson and asyncwebserver
  Written by Andrew Melvin (SticilFace) with help from me-no-dev and BBlanchon.

  example of callback in use

   server.on("/json", HTTP_ANY, [](AsyncWebServerRequest * request) {

    AsyncJsonResponse * response = new AsyncJsonResponse();
    JsonObject& root = response->getRoot();
    root["key1"] = "key number one";
    JsonObject& nested = root.createNestedObject("nested");
    nested["key1"] = "key number one";

    response->setLength();
    request->send(response);
  });

*/

#pragma once
#include <ArduinoJson.h>

/*
 * Json Response
 * */

class ChunkPrint : public Print{
  private:
    uint8_t* _destination;
    size_t _to_skip;
    size_t _to_write;
    size_t _pos;
  public:
    ChunkPrint(uint8_t* destination, size_t from, size_t len)
      : _destination(destination), _to_skip(from), _to_write(len), _pos{0} {}
    size_t write(uint8_t c){
      if (_to_skip > 0) {
        _to_skip--;
        return 0;
      } else if (_to_write > 0) {
        _to_write--;
        _destination[_pos++] = c;
        return 1;
      }
      return 0;
    }
};

class AsyncJsonResponse: public AsyncAbstractResponse {
  private:
    DynamicJsonBuffer _jsonBuffer;
    JsonVariant _root;
    bool _isValid;
  public:
    AsyncJsonResponse(): _isValid{false} {
      _code = 200;
      _contentType = "text/json";
      _root = _jsonBuffer.createObject();
    }
    ~AsyncJsonResponse() {}
    JsonVariant & getRoot() { return _root; }
    bool _sourceValid() { return _isValid; }
    bool setLength() {

      _contentLength = _root.measureLength();
      if (_contentLength) { _isValid = true; }
    }

    size_t _fillBuffer(uint8_t *data, size_t len){
      ChunkPrint dest(data, _sentLength, len);
      _root.printTo( dest ) ;
      return len;
    }
};

Add header to extend server for arduinojson


#pragma once
#include <unistd.h>

#include <algorithm>
#include <exception>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>

const std::string BotVersion ("3.0.0-devel");
const unsigned int BotVersionNum = 2800;

#pragma once
#include <unistd.h>

#include <algorithm>
#include <cstdarg>
#include <exception>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <thread>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>

const std::string BotVersion ("3.0.0-devel");
const unsigned int BotVersionNum = 2800;

Update includes with stuff I'll need

Update includes with stuff I'll need


/*
 * Game.h
 *
 *  Created on: 30.12.2016
 *      Author: Stefan
 */

#include "Deck.h"
#include "Dealer.h"
#include <memory>
#include "GlobalDeclarations.h"
#include "PlayerStrategy.h"

#ifndef GAME_H_
#define GAME_H_

// Class game is the glue code which binds all other classes together.
// It guides the game.
class Game {
	using pPlayer = std::unique_ptr<Player>;

public:
	Game () : _deck(), _dealer(_deck), _players() {}
	// Not allowed to copy or assign game
	Game(Game const &) = delete ;
	void operator=(Game const&) = delete;

	void AddDecks();
	void PlayRound();
	void GetStartCards();
	void PlayCards();
	void Evaluate();
	void PutCardsBack();
	void RemoveBrokePlayers();
	void PrintNumPlayers () const;

	virtual void SetWagers() = 0;
	virtual bool PlayAnotherRound () const = 0;

protected:
	virtual ~Game(){}; // Not allowed to polymorphic delete derivatives

	Deck _deck;
	Dealer _dealer;
	// Players are pointers to avoid issues with card pointers
	std::vector<pPlayer> _players;
};

#endif /* GAME_H_ */

/*
 * Game.h
 *
 *  Created on: 30.12.2016
 *      Author: Stefan
 */

#include "Deck.h"
#include "Dealer.h"
#include <memory>
#include "GlobalDeclarations.h"
#include "PlayerStrategy.h"

#ifndef GAME_H_
#define GAME_H_

// Class game is the glue code which binds all other classes together.
// It guides the game.
class Game {
	using pPlayer = std::unique_ptr<Player>;

public:
	Game () : _deck(), _dealer(_deck), _players() {}
	// Not allowed to copy or assign game
	Game(Game const &) = delete ;
	void operator=(Game const&) = delete;

	void AddDecks();
	void PlayRound();
	virtual bool PlayAnotherRound () const = 0;

	void PrintNumPlayers () const;

protected:
	virtual ~Game(){}; // Not allowed to polymorphic delete derivatives

	virtual void SetWagers() = 0;

	Deck _deck;
	Dealer _dealer;
	// Players are pointers to avoid issues with card pointers
	std::vector<pPlayer> _players;
private:
	void GetStartCards();
	void PlayCards();
	void Evaluate();
	void PutCardsBack();
	void RemoveBrokePlayers();

};

#endif /* GAME_H_ */

Move functions in correct sectors in game class.


#include <libmesh/libmesh.h>

/**
 * This class uses RAII to control redirecting the libMesh::err stream
 * to NULL and restoring it around some operation where we do not want
 * to see output to the screen.
 */
class StreamRedirector
{
public:

  /**
   * Constructor; saves the original libMesh::err streambuf.
   */
  StreamRedirector()
    : _errbuf(libMesh::err.rdbuf())
  {
    libMesh::err.rdbuf(libmesh_nullptr);
  }

  /**
   * Destructor: restores the stream.
   */
  ~StreamRedirector()
  {
    libMesh::err.rdbuf(_errbuf);
  }

private:
  std::streambuf * _errbuf;
};

Add StreamRedirector class to handle stream resetting with RAII.


#include <stdio.h>

#include "aes.h"

int
main(int argc, char **argv)
{
	aes_init();

	return 0;
}

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

#include "aes.h"

int
main(int argc, char **argv)
{
	long blocks;
	char *nptr;

	aes_init();

	blocks = 10;
	if (argc > 1)
	{
		long b = strtol(argv[1], &nptr, 10);
		if (argv[1] != nptr)
		{
			blocks = b;
		}
	}

	return 0;
}

Allow specifying number of blocks to test


/*
 * Copyright 2010 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkTextFormatParams_DEFINES
#define SkTextFormatParams_DEFINES

#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"

// Fraction of the text size to lower a strike through line below the baseline.
#define kStdStrikeThru_Offset       (-SK_Scalar1 * 6 / 21)
// Fraction of the text size to lower a underline below the baseline.
#define kStdUnderline_Offset        (SK_Scalar1 / 9)
// Fraction of the text size to use for a strike through or under-line.
#define kStdUnderline_Thickness     (SK_Scalar1 / 18)

// The fraction of text size to embolden fake bold text scales with text size.
// At 9 points or below, the stroke width is increased by text size / 24.
// At 36 points and above, it is increased by text size / 32.  In between,
// it is interpolated between those values.
static const SkScalar kStdFakeBoldInterpKeys[] = {
    SK_Scalar1*9,
    SK_Scalar1*36,
};
static const SkScalar kStdFakeBoldInterpValues[] = {
    SK_Scalar1/24,
    SK_Scalar1/32,
};
static_assert(SK_ARRAY_COUNT(kStdFakeBoldInterpKeys) == SK_ARRAY_COUNT(kStdFakeBoldInterpValues),
              "mismatched_array_size");
static const int kStdFakeBoldInterpLength = SK_ARRAY_COUNT(kStdFakeBoldInterpKeys);

#endif  //SkTextFormatParams_DEFINES

/*
 * Copyright 2010 The Android Open Source Project
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef SkTextFormatParams_DEFINES
#define SkTextFormatParams_DEFINES

#include "include/core/SkScalar.h"
#include "include/core/SkTypes.h"

// The fraction of text size to embolden fake bold text scales with text size.
// At 9 points or below, the stroke width is increased by text size / 24.
// At 36 points and above, it is increased by text size / 32.  In between,
// it is interpolated between those values.
static const SkScalar kStdFakeBoldInterpKeys[] = {
    SK_Scalar1*9,
    SK_Scalar1*36,
};
static const SkScalar kStdFakeBoldInterpValues[] = {
    SK_Scalar1/24,
    SK_Scalar1/32,
};
static_assert(SK_ARRAY_COUNT(kStdFakeBoldInterpKeys) == SK_ARRAY_COUNT(kStdFakeBoldInterpValues),
              "mismatched_array_size");
static const int kStdFakeBoldInterpLength = SK_ARRAY_COUNT(kStdFakeBoldInterpKeys);

#endif  //SkTextFormatParams_DEFINES

Remove unused text format constants.

Remove unused text format constants.

A long time ago Skia used handle strike-thru and underlines as part of
the glyph masks. When it did so there were some overridable constants
for where they should go. Since this function has long since been
removed, remove these no longer used constants.

Change-Id: I8bc7dbe03e82a5d244438aaaeaf024d8c95280d8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/477160
Commit-Queue: Ben Wagner <53965154ffeecc4a10886eab9259e95965f2979a@google.com>
Commit-Queue: Herb Derby <9e12a3d2bbf73546e47cc9958f6ba8f3215b7eaf@google.com>
Auto-Submit: Ben Wagner <53965154ffeecc4a10886eab9259e95965f2979a@google.com>
Reviewed-by: Herb Derby <9e12a3d2bbf73546e47cc9958f6ba8f3215b7eaf@google.com>


// @(#)root/sqlite:$Id$
// Author: o.freyermuth <o.f@cern.ch>, 01/06/2013

/*************************************************************************
 * Copyright (C) 1995-2013, 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_TPgSQLRow
#define ROOT_TPgSQLRow

#ifndef ROOT_TSQLRow
#include "TSQLRow.h"
#endif

#if !defined(__CINT__)
#include <sqlite3.h>
#else
struct sqlite3_stmt;
#endif

class TSQLiteRow : public TSQLRow {

private:
   sqlite3_stmt *fResult;       // current result set
   Bool_t        IsValid(Int_t field);

public:
   TSQLiteRow(void *result, ULong_t rowHandle);
   ~TSQLiteRow();

   void        Close(Option_t *opt="");
   ULong_t     GetFieldLength(Int_t field);
   const char *GetField(Int_t field);

   ClassDef(TSQLiteRow,0)  // One row of SQLite query result
};

#endif

// @(#)root/sqlite:
// Author: o.freyermuth <o.f@cern.ch>, 01/06/2013

/*************************************************************************
 * Copyright (C) 1995-2013, 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_TSQLiteRow
#define ROOT_TSQLiteRow

#ifndef ROOT_TSQLRow
#include "TSQLRow.h"
#endif

#if !defined(__CINT__)
#include <sqlite3.h>
#else
struct sqlite3_stmt;
#endif

class TSQLiteRow : public TSQLRow {

private:
   sqlite3_stmt *fResult;       // current result set
   Bool_t        IsValid(Int_t field);

public:
   TSQLiteRow(void *result, ULong_t rowHandle);
   ~TSQLiteRow();

   void        Close(Option_t *opt="");
   ULong_t     GetFieldLength(Int_t field);
   const char *GetField(Int_t field);

   ClassDef(TSQLiteRow,0)  // One row of SQLite query result
};

#endif

Fix fatal typo in code guard

Fix fatal typo in code guard


// REQUIRES: nozlib

// RUN: %clang -### -fintegrated-as -gz -c %s 2>&1 | FileCheck %s -check-prefix CHECK-WARN
// RUN: %clang -### -fintegrated-as -gz=none -c %s 2>&1 | FileCheck -allow-empty -check-prefix CHECK-NOWARN %s

// CHECK-WARN: warning: cannot compress debug sections (zlib not installed)
// CHECK-NOWARN-NOT: warning: cannot compress debug sections (zlib not installed)

// REQUIRES: !zlib

// RUN: %clang -### -fintegrated-as -gz -c %s 2>&1 | FileCheck %s -check-prefix CHECK-WARN
// RUN: %clang -### -fintegrated-as -gz=none -c %s 2>&1 | FileCheck -allow-empty -check-prefix CHECK-NOWARN %s

// CHECK-WARN: warning: cannot compress debug sections (zlib not installed)
// CHECK-NOWARN-NOT: warning: cannot compress debug sections (zlib not installed)

Replace 'REQUIRES: nozlib' with '!zlib' because we don't need two ways
to say the same thing.

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


//
// The MIT License (MIT)
//
// Copyright (c) 2015 Stefano Falda (stefano.falda@gmail.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#import <Foundation/Foundation.h>
#import <UIKit/UIDevice.h>
#import "RCTBridgeModule.h"
#import "RCTLog.h"
@interface ReactLocalization : NSObject<RCTBridgeModule>

@end

//
// The MIT License (MIT)
//
// Copyright (c) 2015 Stefano Falda (stefano.falda@gmail.com)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#import <Foundation/Foundation.h>
#import <UIKit/UIDevice.h>
#if __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#import "RCTLog.h"
#else
#import <React/RCTBridgeModule.h>
#import <React/RCTLog.h>
#endif
@interface ReactLocalization : NSObject<RCTBridgeModule>

@end

Change headers for react-native 0.40 compatibility


#include <stdio.h>

#include "bincookie.h"

int main(int argc, char *argv[]) {
    if (argc != 2) {
        printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]);
        printf("Example: %s Cookies.binarycookies\n", argv[0]);
        return 1;
    }

    binarycookies_t *bc = binarycookies_init(argv[1]);
    unsigned int i, j;

    // Output in Netscape cookies.txt format
    for (i = 0; i < bc->num_pages; i++) {
        for (j = 0; j < bc->pages[i]->number_of_cookies; j++) {
            // domain, flag, path, secure, expiration, name, value
            printf("%s\t%s\t%s\t%s\t%.f\t%s\t%s\n",
                   bc->pages[i]->cookies[j]->domain,
                   bc->pages[i]->cookies[j]->domain[0] == '.' ? "TRUE" : "FALSE",
                   bc->pages[i]->cookies[j]->path,
                   binarycookies_is_secure(bc->pages[i]->cookies[j]) ? "TRUE" : "FALSE",
                   bc->pages[i]->cookies[j]->expiration_date,
                   bc->pages[i]->cookies[j]->name,
                   bc->pages[i]->cookies[j]->value);
        }
    }

    binarycookies_free(bc);

    return 0;
}

#include <stdio.h>

#include "bincookie.h"

int main(int argc, char *argv[]) {
    if (argc != 2) {
        printf("Usage: %s [Full path to Cookies.binarycookies file]\n", argv[0]);
        printf("Example: %s Cookies.binarycookies\n", argv[0]);
        return 1;
    }

    binarycookies_t *bc = binarycookies_init(argv[1]);
    unsigned int i, j;

    // Output in Netscape cookies.txt format
    for (i = 0; i < bc->num_pages; i++) {
        for (j = 0; j < bc->pages[i]->number_of_cookies; j++) {
            // domain, flag, path, secure, expiration, name, value
            printf("%s\t%s\t%s\t%s\t%.f\t%s\t%s\n",
                   bc->pages[i]->cookies[j]->domain,
                   binarycookies_domain_access_full(bc->pages[i]->cookies[j]) ? "TRUE" : "FALSE",
                   bc->pages[i]->cookies[j]->path,
                   binarycookies_is_secure(bc->pages[i]->cookies[j]) ? "TRUE" : "FALSE",
                   bc->pages[i]->cookies[j]->expiration_date,
                   bc->pages[i]->cookies[j]->name,
                   bc->pages[i]->cookies[j]->value);
        }
    }

    binarycookies_free(bc);

    return 0;
}

Use macro in example code

Use macro in example code


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

#ifdef WIN32
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT extern
#endif

DLLEXPORT void * ReturnSomePointer()
{
    char *x = "Got passed back the pointer I returned";
    return x;
}

DLLEXPORT int CompareSomePointer(void *ptr)
{
    int x = strcmp("Got passed back the pointer I returned", ptr) == 0;
    return x;
}

DLLEXPORT void * ReturnNullPointer()
{
    return NULL;
}

DLLEXPORT void * TakeTwoPointersToInt(int *ptr1, int *ptr2)
{
    return NULL;
}

DLLEXPORT void * TakeCArrayToInt8(int array[]) {
    return NULL;
}

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

#ifdef WIN32
#define DLLEXPORT __declspec(dllexport)
#else
#define DLLEXPORT extern
#endif

DLLEXPORT void * ReturnSomePointer()
{
    return strdup("Got passed back the pointer I returned");
}

DLLEXPORT int CompareSomePointer(void *ptr)
{
    int x = strcmp("Got passed back the pointer I returned", ptr) == 0;
    free(ptr);
    return x;
}

DLLEXPORT void * ReturnNullPointer()
{
    return NULL;
}

DLLEXPORT void * TakeTwoPointersToInt(int *ptr1, int *ptr2)
{
    return NULL;
}

DLLEXPORT void * TakeCArrayToInt8(int array[]) {
    return NULL;
}

Fix C issue in NativeCall tests.

Fix C issue in NativeCall tests.

One of the pointer tests returned a pointer to astack allocated string outside
of the function, which is not very safe. Replace it with a strdup()ed string
that's freed on verification.


/*
Copyright libCellML Contributors

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

#pragma once

#include <libcellml>

#include "test_exportdefinitions.h"

std::string TEST_EXPORT resourcePath(const std::string &resourceRelativePath = "");

std::string TEST_EXPORT fileContents(const std::string &fileName);

void TEST_EXPORT printErrors(const libcellml::Validator &v);
void TEST_EXPORT printErrors(const libcellml::Parser &p);
void TEST_EXPORT expectEqualErrors(const std::vector<std::string> &errors, const libcellml::Logger &logger);

libcellml::ModelPtr TEST_EXPORT createModel(const std::string &name = "");
libcellml::ModelPtr TEST_EXPORT createModelWithComponent(const std::string &name = "");

#define EXPECT_EQ_ERRORS(errors, logger) SCOPED_TRACE("Error occured here");expectEqualErrors(errors, logger)

/*
Copyright libCellML Contributors

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

#pragma once

#include <libcellml>

#include "test_exportdefinitions.h"

std::string TEST_EXPORT resourcePath(const std::string &resourceRelativePath = "");

std::string TEST_EXPORT fileContents(const std::string &fileName);

void TEST_EXPORT printErrors(const libcellml::Validator &v);
void TEST_EXPORT printErrors(const libcellml::Parser &p);
void TEST_EXPORT expectEqualErrors(const std::vector<std::string> &errors, const libcellml::Logger &logger);

libcellml::ModelPtr TEST_EXPORT createModel(const std::string &name = "");
libcellml::ModelPtr TEST_EXPORT createModelWithComponent(const std::string &name = "");

#define EXPECT_EQ_ERRORS(errors, logger) SCOPED_TRACE("Error occured here.");expectEqualErrors(errors, logger)

Add fullstop for the pc crowd (punctually correct).


/*******************************************************************************

  Intel 10 Gigabit PCI Express Linux driver
  Copyright(c) 1999 - 2009 Intel Corporation.

  This program is free software; you can redistribute it and/or modify it
  under the terms and conditions of the GNU General Public License,
  version 2, as published by the Free Software Foundation.

  This program is distributed in the hope 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.

  The full GNU General Public License is included in this distribution in
  the file called "COPYING".

  Contact Information:
  e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497

*******************************************************************************/

#ifndef _IXGBE_FCOE_H
#define _IXGBE_FCOE_H

#include <scsi/fc/fc_fcoe.h>

/* shift bits within STAT fo FCSTAT */
#define IXGBE_RXDADV_FCSTAT_SHIFT	4

/* ddp user buffer */
#define IXGBE_BUFFCNT_MAX	256	/* 8 bits bufcnt */
#define IXGBE_FCPTR_ALIGN	16
#define IXGBE_FCPTR_MAX	(IXGBE_BUFFCNT_MAX * sizeof(dma_addr_t))
#define IXGBE_FCBUFF_4KB	0x0
#define IXGBE_FCBUFF_8KB	0x1
#define IXGBE_FCBUFF_16KB	0x2
#define IXGBE_FCBUFF_64KB	0x3
#define IXGBE_FCBUFF_MAX	65536	/* 64KB max */
#define IXGBE_FCBUFF_MIN	4096	/* 4KB min */
#define IXGBE_FCOE_DDP_MAX	512	/* 9 bits xid */

/* fcerr */
#define IXGBE_FCERR_BADCRC       0x00100000

struct ixgbe_fcoe_ddp {
	int len;
	u32 err;
	unsigned int sgc;
	struct scatterlist *sgl;
	dma_addr_t udp;
	unsigned long *udl;
};

struct ixgbe_fcoe {
	spinlock_t lock;
	struct pci_pool *pool;
	struct ixgbe_fcoe_ddp ddp[IXGBE_FCOE_DDP_MAX];
};

#endif /* _IXGBE_FCOE_H */

Add FCoE feature header to 82599

ixgbe: Add FCoE feature header to 82599

This adds the FCoE feature header ixgbe_fcoe.h to 82599. This header includes
the defines and structures required by the ixgbe driver to support various
offload features in 82599 for Fiber Channel over Ethernet (FCoE).  These offloads
features include Fiber Channel CRC calculation, FCoE SOF/EOF auto insertion,
FCoE Sequence Offload (FSO) for large send, and Direct Data Placement (DDP)
for large receive.

Signed-off-by: Yi Zou <5b3a821cf7a153d601945bbe257e1150110342e4@intel.com>
Signed-off-by: Jeff Kirsher <87e35f5be20bb3e67f4ba6b86f5f6be3085b1b3a@intel.com>
Signed-off-by: David S. Miller <fe08d3c717adf2ae63592e4c9aec6e3e404d8e3e@davemloft.net>


//
//  NSTimeZone+Offset.h
//  CocoaGit
//
//  Created by Geoffrey Garside on 28/07/2008.
//  Copyright 2008 ManicPanda.com. All rights reserved.
//

#import <Foundation/NSTimeZone.h>

@interface NSTimeZone (Offset)

+ (id)timeZoneWithStringOffset:(NSString*)offset;
- (NSString*)offsetString;
@end

//
//  NSTimeZone+Offset.h
//  CocoaGit
//
//  Created by Geoffrey Garside on 28/07/2008.
//  Copyright 2008 ManicPanda.com. All rights reserved.
//

#import <Foundation/NSTimeZone.h>

@interface NSTimeZone (Offset)

/*! Creates and returns a time zone with the specified offset.
 * The string is broken down into the hour and minute components
 * which are then used to work out the number of seconds from GMT.
 * \param offset The timezone offset as a string such as "+0100"
 * \return A time zone with the specified offset
 * \see +timeZoneForSecondsFromGMT:
 */
+ (id)timeZoneWithStringOffset:(NSString*)offset;

/*! Returns the receivers offset as an HHMM formatted string.
 * \return The receivers offset as a string in HHMM format.
 */
- (NSString*)offsetString;
@end

Add documentation of the category methods on NSTimeZone


// Filename: audio.h
// Created by:  frang (06Jul00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University.  All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license.  You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////

#ifndef __AUDIO_H__
#define __AUDIO_H__

#include "filterProperties.h"
#include "audioSound.h"
#include "audioManager.h"

#endif /* __AUDIO_H__ */

// Filename: audio.h
// Created by:  frang (06Jul00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University.  All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license.  You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////

#ifndef __AUDIO_H__
#define __AUDIO_H__

#include "filterProperties.h"
#include "audioLoadRequest.h"
#include "audioSound.h"
#include "audioManager.h"

#endif /* __AUDIO_H__ */

Apply patch by Josh Enes

Apply patch by Josh Enes


// The MIT License (MIT)
//
// Copyright (c) 2014-present James Ide
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

void objc_synchronized(id object, __attribute__((noescape)) void (^closure)());

// The MIT License (MIT)
//
// Copyright (c) 2014-present James Ide
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

@import Foundation;

NS_ASSUME_NONNULL_BEGIN

void objc_synchronized(id object, __attribute__((noescape)) void (^closure)());

NS_ASSUME_NONNULL_END

Use NS_ASSUME_NONNULL_BEGIN/END macros in Obj-C header

The mutex object and block shouldn't be null. We could change the API to accept null but I don't think that's natural to do (and the Swift API forbids it anyway right now).


#define _XOPEN_SOURCE 500 /* mkstemp */
#include <stdlib.h>
#include <unistd.h>

#include "tmpfile.h"
#include "alloc.h"

int tmpfile_prefix_out(const char *prefix, char **const fname)
{
	char *tmppath;
	int fd;
	char *tmpdir = getenv("TMPDIR");

#ifdef P_tmpdir
	if(!tmpdir)
		tmpdir = P_tmpdir;
#endif
	if(!tmpdir)
		tmpdir = "/tmp";

	tmppath = ustrprintf("%s/%sXXXXXX", tmpdir, prefix);
	fd = mkstemp(tmppath);

	if(fd < 0){
		free(tmppath);
		tmppath = NULL;
	}

	if(fname)
		*fname = tmppath;
	else
		free(tmppath);

	return fd;
}

#define _XOPEN_SOURCE 500 /* mkstemp */
#include <stdlib.h>
#include <unistd.h>

#include "tmpfile.h"
#include "alloc.h"

int tmpfile_prefix_out(const char *prefix, char **const fname)
{
	char *tmppath;
	int fd;
	char *tmpdir = getenv("TMPDIR");

#ifdef P_tmpdir
	if(!tmpdir)
		tmpdir = P_tmpdir;
#endif
	if(!tmpdir)
		tmpdir = "/tmp";

	tmppath = ustrprintf("%s/%sXXXXXX", tmpdir, prefix);
	fd = mkstemp(tmppath);

	if(fname)
		*fname = tmppath;
	else
		free(tmppath);

	return fd;
}

Revert "Free tmppath on mkstemp() failure" (moved to master)

This reverts commit 85598a0ccbea2d82303c5cb2daa9a29ec01eb3d2.


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

#ifndef WidgetTimeInput_h
#define WidgetTimeInput_h

#include <Blynk/BlynkApi.h>
#include <utility/BlynkDateTime.h>

class TimeInputParam
{
public:

	TimeInputParam(const BlynkParam& param)
		: mStart (param[0].asLong())
		, mStop  (param[1].asLong())
	{
		mTZ = param[2].asLong();
	}

	BlynkDateTime& getStart() { return mStart; }
	BlynkDateTime& getStop()  { return mStop;  }
    long getTZ()  const { return mTZ; }

private:
    BlynkDateTime mStart;
    BlynkDateTime mStop;
    long mTZ;
};

#endif

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

#ifndef WidgetTimeInput_h
#define WidgetTimeInput_h

#include <Blynk/BlynkApi.h>
#include <utility/BlynkDateTime.h>

class TimeInputParam
{
public:

	TimeInputParam(const BlynkParam& param)
	{
		if (strlen(param[0].asStr())) {
			mStart = param[0].asLong();
		}
		if (strlen(param[1].asStr())) {
			mStop = param[1].asLong();
		}
		mTZ = param[2].asLong();
	}

	BlynkTime& getStart() { return mStart; }
	BlynkTime& getStop()  { return mStop;  }
    long getTZ()  const { return mTZ; }

private:
    BlynkTime mStart;
    BlynkTime mStop;
    long mTZ;
};

#endif

Switch to Time instead of DateTime

Switch to Time instead of DateTime


int foo(int a, int b, int c) {
  int arr[5] = { 1, 2, 3, 4, 5 };
  int d = 4;
  int *p = &d;
  return a + b + c + arr[4] + arr[0] + *p;
}

int main() {
  int a, b, c;
  a = 2;
  b = 1;
  c = 3;
  int d = 4;
  int *p = &d;
  int i;
  for (i = 0; i < 1234567; i++) {
    *p = foo(a, b, c);
  }
  return *p;
}

int foo(int a, int b, int c) {
  int arr[5] = { 1, 2, 3, 4, 5 };
  int d = 4;
  int *p = &d;
  return a + b + c + arr[4] + arr[0] + *p;
}

int main() {
  int a, b, c;
  a = 2;
  b = 1;
  c = 3;
  int d = 4;
  int *p = &d;
  int i;
  for (i = 0; i < 12345; i++) {
    *p = foo(a, b, c);
  }
  return *p;
}

Reduce the loop iteration count in test case to reduce the execution time


//
//  LVTFolder.h
//  LayerVaultAPIClient
//
//  Created by Matt Thomas on 12/4/13.
//  Copyright (c) 2013 codecaffeine. All rights reserved.
//

#import <Mantle/Mantle.h>
#import "LVTColor.h"

@interface LVTFolder : MTLModel <MTLJSONSerializing>

@property (readonly, nonatomic, copy) NSString *name;
@property (nonatomic) LVTColorLabel colorLabel;
@property (readonly, nonatomic, copy) NSString *path;
@property (readonly, nonatomic, copy) NSURL *fileURL;
@property (readonly, nonatomic) NSDate *dateUpdated;
@property (readonly, nonatomic) NSDate *dateDeleted;
@property (readonly, nonatomic, copy) NSString *md5;
@property (readonly, nonatomic, copy) NSURL *url;
@property (readonly, nonatomic, copy) NSURL *shortURL;
@property (readonly, nonatomic, copy) NSString *organizationPermalink;
@property (readonly, nonatomic, copy) NSArray *folders;
@property (readonly, nonatomic, copy) NSArray *files;

@end

//
//  LVTFolder.h
//  LayerVaultAPIClient
//
//  Created by Matt Thomas on 12/4/13.
//  Copyright (c) 2013 codecaffeine. All rights reserved.
//

#import <Mantle/Mantle.h>
#import "LVTColor.h"

@interface LVTFolder : MTLModel <MTLJSONSerializing>

@property (readonly, nonatomic, copy) NSString *name;
@property (nonatomic) LVTColorLabel colorLabel;
@property (readonly, nonatomic, copy) NSString *path;
@property (readonly, nonatomic, copy) NSURL *fileURL;
@property (nonatomic) NSDate *dateUpdated;
@property (readonly, nonatomic) NSDate *dateDeleted;
@property (readonly, nonatomic, copy) NSString *md5;
@property (readonly, nonatomic, copy) NSURL *url;
@property (readonly, nonatomic, copy) NSURL *shortURL;
@property (readonly, nonatomic, copy) NSString *organizationPermalink;
@property (readonly, nonatomic, copy) NSArray *folders;
@property (readonly, nonatomic, copy) NSArray *files;

@end

Allow us to edit this

Allow us to edit this


/*
 * qiprog - Reference implementation of the QiProg protocol
 *
 * Copyright (C) 2013 Alexandru Gagniuc <mr.nuke.me@gmail.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

#ifndef __QIPROG_USB_H
#define __QIPROG_USB_H

#include <qiprog.h>

/**
 * @brief QiProg USB control request types for Control transfers
 *
 * @note
 * Note that all values transferred over the bus, including those in wValue,
 * wIndex and wLength fields, are LE coded! (The host side API likely translates
 * wLength automatically if necessary, but maybe not wValue and wIndex, and
 * certainly not the data. Check that your bytes are not swapped.)
 */
enum qiprog_usb_ctrl_req_type {
	QIPROG_GET_CAPABILITIES = 0x00,
	QIPROG_SET_BUS = 0x01,
	QIPROG_SET_CLOCK = 0x02,
	QIPROG_READ_DEVICE_ID = 0x03,
	QIPROG_SET_ADDRESS = 0x04,
	QIPROG_SET_ERASE_SIZE = 0x05,
	QIPROG_SET_ERASE_COMMAND = 0x06,
	QIPROG_SET_WRITE_COMMAND = 0x07,
	QIPROG_SET_SPI_TIMING = 0x20,
	QIPROG_READ8 = 0x30,
	QIPROG_READ16 = 0x31,
	QIPROG_READ32 = 0x32,
	QIPROG_WRITE8 = 0x33,
	QIPROG_WRITE16 = 0x34,
	QIPROG_WRITE32 = 0x35,
	QIPROG_SET_VDD = 0xf0,
};

#endif				/* __QIPROG_USB_H */

Add USB control request definitions

Add USB control request definitions

Add definitions for the bRequest values in QiProg USB control transactions.

Signed-off-by: Alexandru Gagniuc <cf8ce030f4bdd6ce49a1b687c7c3ccfa8b34ced2@gmail.com>


// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

#include "sw/device/lib/dif/dif_pinmux.h"

#include "sw/device/lib/dif/dif_base.h"

#include "pinmux_regs.h"  // Generated.

// This just exists to check that the header compiles for now. The actual
// implementation is work in progress.

// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

#include "sw/device/lib/dif/dif_pinmux.h"

#include "sw/device/lib/base/bitfield.h"
#include "sw/device/lib/dif/dif_base.h"

#include "pinmux_regs.h"  // Generated.

// This just exists to check that the header compiles for now. The actual
// implementation is work in progress.

OT_WARN_UNUSED_RESULT
dif_result_t dif_pinmux_input_select(const dif_pinmux_t *pinmux,
                                     dif_pinmux_index_t peripheral_input,
                                     dif_pinmux_index_t insel) {
  if (pinmux == NULL || peripheral_input >= PINMUX_PARAM_N_MIO_PERIPH_IN ||
      insel >= (2 + PINMUX_PARAM_N_MIO_PADS)) {
    return kDifBadArg;
  }
  uint32_t reg_offset =
      PINMUX_MIO_PERIPH_INSEL_0_REG_OFFSET + (peripheral_input << 2);
  uint32_t reg_value =
      bitfield_field32_write(0, PINMUX_MIO_PERIPH_INSEL_0_IN_0_FIELD, insel);
  mmio_region_write32(pinmux->base_addr, reg_offset, reg_value);
  return kDifOk;
}

Add DIF to set pinmux insel

[sw/pinmux] Add DIF to set pinmux insel

Signed-off-by: Alexander Williams <d0fb8a15e7b6f5e62278a4cf44515038c232186c@google.com>


// RUN: %llvmgcc -S %s -o - -O | grep ashr
// RUN: %llvmgcc -S %s -o - -O | not grep sdiv

int test(int *A, int *B) {
  return A-B;
}

// RUN: %llvmgcc -S %s -o - -O | grep ashr
// RUN: %llvmgcc -S %s -o - -O | not grep sdiv

long long test(int *A, int *B) {
  return A-B;
}

Fix for PR1567, which involves a weird bug on non-32bit architectures and silly C type sizes.

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


/*
name: TEST011
description: Basic test for goto
output:
F1
G1	F1	main
{
-
L2
	j	L3
	yI	#I1
L4
	yI	#I0
L3
L5
	j	L4
	yI	#I1
}
*/

#line 1

int
main() {
	start:
		goto next;
		return 1;
	success:
		return 0;
	next:
	foo:
		goto success;
		return 1;
}

Add baisc test for goto

Add baisc test for goto


@import Foundation;

#import <VENCore/VENCreateTransactionRequest.h>
#import <VENCore/VENHTTP.h>
#import <VENCore/VENHTTPResponse.h>
#import <VENCore/VENTransaction.h>
#import <VENCore/VENTransactionTarget.h>
#import <VENCore/VENUser.h>

extern NSString *const VENErrorDomainCore;

typedef NS_ENUM(NSInteger, VENCoreErrorCode) {
    VENCoreErrorCodeNoDefaultCore,
    VENCoreErrorCodeNoAccessToken
};

@interface VENCore : NSObject

@property (strong, nonatomic) VENHTTP *httpClient;
@property (strong, nonatomic) NSString *accessToken;

/**
 * Sets the shared core object.
 * @param core The core object to share.
 */
+ (void)setDefaultCore:(VENCore *)core;

/**
 * Returns the shared core object.
 * @return A VENCore object.
 */
+ (instancetype)defaultCore;

/**
 * Sets the core object's access token.
 */
- (void)setAccessToken:(NSString *)accessToken;

@end

@import Foundation;

#import <VENCore/VENCreateTransactionRequest.h>
#import <VENCore/VENHTTP.h>
#import <VENCore/VENHTTPResponse.h>
#import <VENCore/VENTransaction.h>
#import <VENCore/VENTransactionTarget.h>
#import <VENCore/VENUser.h>
#import <VENCore/NSArray+VENCore.h>
#import <VENCore/NSDictionary+VENCore.h>
#import <VENCore/NSError+VENCore.h>
#import <VENCore/NSString+VENCore.h>
#import <VENCore/UIDevice+VENCore.h>

extern NSString *const VENErrorDomainCore;

typedef NS_ENUM(NSInteger, VENCoreErrorCode) {
    VENCoreErrorCodeNoDefaultCore,
    VENCoreErrorCodeNoAccessToken
};

@interface VENCore : NSObject

@property (strong, nonatomic) VENHTTP *httpClient;
@property (strong, nonatomic) NSString *accessToken;

/**
 * Sets the shared core object.
 * @param core The core object to share.
 */
+ (void)setDefaultCore:(VENCore *)core;

/**
 * Returns the shared core object.
 * @return A VENCore object.
 */
+ (instancetype)defaultCore;

/**
 * Sets the core object's access token.
 */
- (void)setAccessToken:(NSString *)accessToken;

@end

Add formerly private headers to the umbrella header


#include "euler_util.h"

#include <string.h>

#define MAX 7

int main(int argc, char *argv[])
{
    float start = timeit();
    char product[MAX] = { '\0' };
    int high = 0;

    for (int x=100; x < 1000; x++) {
        for (int y=x; y < 1000; y++) {

            int canidate = x * y;
            size_t int_len = snprintf(product, MAX, "%d", canidate);
            int head = 0, tail = int_len - 1;
            for (;head < tail && product[head] == product[tail]; head++, tail--)
                ;
            if (head > tail && canidate > high)
                high = canidate;
        }
    }

    float stop = timeit();

    printf("Answer: %d\n", high);
    printf("Time: %.8f\n", stop - start);

    return 0;
}

#include "euler_util.h"

#include <string.h>

#define MAX 7

int main(int argc, char *argv[])
{
    float start = timeit();
    char product[MAX] = { '\0' };
    int high = 0;

    for (int x=100; x < 1000; x++) {
        for (int y=x; y < 1000; y++) {

            int canidate = x * y;
            if (canidate < high)
                continue;

            size_t int_len = snprintf(product, MAX, "%d", canidate);
            int head = 0, tail = int_len - 1;
            for (;head < tail && product[head] == product[tail]; head++, tail--)
                ;
            if (head > tail)
                high = canidate;
        }
    }

    float stop = timeit();

    printf("Answer: %d\n", high);
    printf("Time: %.8f\n", stop - start);

    return 0;
}

Test against high before palindrome check down to ~0.01


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

#pragma once

#define COLOR_WINDOW_BACKGROUND GColorWhite
#define COLOR_WINDOW_FOREGROUND GColorBlack

#define COLOR_WINDOW_PROGRESS_BACKGROUND PBL_IF_COLOR_ELSE(GColorLightGray,GColorWhite)
#define COLOR_LAYER_PROGRESS_BACKGROUND PBL_IF_COLOR_ELSE(GColorBlack,GColorWhite)
#define COLOR_LAYER_PROGRESS_FOREGROUND PBL_IF_COLOR_ELSE(GColorWhite,GColorBlack)

#define COLOR_WINDOW_ERROR_BACKGROUND PBL_IF_COLOR_ELSE(GColorCobaltBlue,GColorBlack)
#define COLOR_WINDOW_ERROR_FOREGROUND GColorWhite

#define COLOR_MENU_NORMAL_BACKGROUND GColorWhite
#define COLOR_MENU_NORMAL_FOREGROUND GColorBlack

#define COLOR_MENU_HIGHLIGHT_BACKGROUND PBL_IF_COLOR_ELSE(GColorDarkGray,GColorBlack)
#define COLOR_MENU_HIGHLIGHT_FOREGROUND PBL_IF_COLOR_ELSE(GColorWhite,GColorWhite)

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

#pragma once

#define COLOR_WINDOW_BACKGROUND GColorWhite
#define COLOR_WINDOW_FOREGROUND GColorBlack

#define COLOR_WINDOW_PROGRESS_BACKGROUND PBL_IF_COLOR_ELSE(GColorLightGray,GColorWhite)
#define COLOR_LAYER_PROGRESS_BACKGROUND PBL_IF_COLOR_ELSE(GColorBlack,GColorWhite)
#define COLOR_LAYER_PROGRESS_FOREGROUND PBL_IF_COLOR_ELSE(GColorWhite,GColorBlack)

#define COLOR_WINDOW_ERROR_BACKGROUND PBL_IF_COLOR_ELSE(GColorCobaltBlue,GColorBlack)
#define COLOR_WINDOW_ERROR_FOREGROUND GColorWhite

#define COLOR_MENU_NORMAL_BACKGROUND GColorWhite
#define COLOR_MENU_NORMAL_FOREGROUND GColorBlack

#define COLOR_MENU_HIGHLIGHT_BACKGROUND PBL_IF_COLOR_ELSE(GColorCobaltBlue,GColorBlack)
#define COLOR_MENU_HIGHLIGHT_FOREGROUND PBL_IF_COLOR_ELSE(GColorWhite,GColorWhite)

Change color of list selection to dark blue


/*
 * rmgrdesc.c
 *
 * pg_xlogdump resource managers definition
 *
 * contrib/pg_xlogdump/rmgrdesc.c
 */
#define FRONTEND 1
#include "postgres.h"

#include "access/clog.h"
#include "access/gin.h"
#include "access/gist_private.h"
#include "access/hash.h"
#include "access/heapam_xlog.h"
#include "access/multixact.h"
#include "access/nbtree.h"
#include "access/rmgr.h"
#include "access/spgist.h"
#include "access/xact.h"
#include "access/xlog_internal.h"
#include "catalog/storage_xlog.h"
#include "commands/dbcommands.h"
#include "commands/sequence.h"
#include "commands/tablespace.h"
#include "rmgrdesc.h"
#include "storage/standby.h"
#include "utils/relmapper.h"

#define PG_RMGR(symname,name,redo,desc,startup,cleanup,restartpoint) \
	{ name, desc, },

const RmgrDescData RmgrDescTable[RM_MAX_ID + 1] = {
#include "access/rmgrlist.h"
};

/*
 * rmgrdesc.c
 *
 * pg_xlogdump resource managers definition
 *
 * contrib/pg_xlogdump/rmgrdesc.c
 */
#define FRONTEND 1
#include "postgres.h"

#include "access/clog.h"
#include "access/gin.h"
#include "access/gist_private.h"
#include "access/hash.h"
#include "access/heapam_xlog.h"
#include "access/multixact.h"
#include "access/nbtree.h"
#include "access/rmgr.h"
#include "access/spgist.h"
#include "access/xact.h"
#include "access/xlog_internal.h"
#include "catalog/storage_xlog.h"
#include "commands/dbcommands.h"
#include "commands/sequence.h"
#include "commands/tablespace.h"
#include "rmgrdesc.h"
#include "storage/standby.h"
#include "utils/relmapper.h"

#define PG_RMGR(symname,name,redo,desc,startup,cleanup) \
	{ name, desc, },

const RmgrDescData RmgrDescTable[RM_MAX_ID + 1] = {
#include "access/rmgrlist.h"
};

Fix compilation of pg_xlogdump, now that rm_safe_restartpoint is no more.

Oops. Pointed out by Andres Freund.


#define _XOPEN_SOURCE 4
#define _XOPEN_SOURCE_EXTENDED 1 /* 1 needed for AIX */
#define _XOPEN_VERSION 4
#define _XPG4_2
#include <unistd.h>

#include "mycrypt.h"

char *mycrypt(const char *key, const char *salt)
{
	return crypt(key, salt);
}

#define _XOPEN_SOURCE 4
#define _XOPEN_SOURCE_EXTENDED 1 /* 1 needed for AIX */
#define _XOPEN_VERSION 4
#define _XPG4_2
#ifdef CRYPT_USE_XPG6
#  define _XPG6 /* Some Solaris versions require this, some break with this */
#endif
#include <unistd.h>

#include "mycrypt.h"

char *mycrypt(const char *key, const char *salt)
{
	return crypt(key, salt);
}

Add _XPG6 macro if needed..

Add _XPG6 macro if needed..


/*
 * Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/**
 * @file
 * @brief Full C support initialization
 *
 * Initialization of full C support: zero the .bss and call z_cstart().
 *
 * Stack is available in this module, but not the global data/bss until their
 * initialization is performed.
 */

#include <kernel_internal.h>

extern FUNC_NORETURN void z_cstart(void);
/**
 *
 * @brief Prepare to and run C code
 *
 * This routine prepares for the execution of and runs C code.
 *
 * @return N/A
 */
void z_arm64_prep_c(void)
{
	z_bss_zero();
	z_arm64_interrupt_init();
	z_cstart();

	CODE_UNREACHABLE;
}

/*
 * Copyright (c) 2019 Carlo Caione <ccaione@baylibre.com>
 *
 * SPDX-License-Identifier: Apache-2.0
 */

/**
 * @file
 * @brief Full C support initialization
 *
 * Initialization of full C support: zero the .bss and call z_cstart().
 *
 * Stack is available in this module, but not the global data/bss until their
 * initialization is performed.
 */

#include <kernel_internal.h>
#include <linker/linker-defs.h>

extern FUNC_NORETURN void z_cstart(void);

static inline void z_arm64_bss_zero(void)
{
	uint64_t *p = (uint64_t *)__bss_start;
	uint64_t *end = (uint64_t *)__bss_end;

	while (p < end) {
		*p++ = 0;
	}
}

/**
 *
 * @brief Prepare to and run C code
 *
 * This routine prepares for the execution of and runs C code.
 *
 * @return N/A
 */
void z_arm64_prep_c(void)
{
	z_arm64_bss_zero();
	z_arm64_interrupt_init();
	z_cstart();

	CODE_UNREACHABLE;
}

Fix alignment fault on z_bss_zero()

aarch64: Fix alignment fault on z_bss_zero()

Using newlibc with AArch64 is causing an alignement fault in
z_bss_zero() when the code is run on real hardware (on QEMU the problem
is not reproducible).

The main cause is that the memset() function exported by newlibc is
using 'DC ZVA' to zero out memory.

While this is often a nice optimization, this is causing the issue on
AArch64 because memset() is being used before the MMU is enabled, and
when the MMU is disabled all data accesses will be treated as
Device_nGnRnE.

This is a problem because quoting from the ARM reference manual: "If the
memory region being zeroed is any type of Device memory, then DC ZVA
generates an Alignment fault which is prioritized in the same way as
other alignment faults that are determined by the memory type".

newlibc tries to be a bit smart about this reading the DCZID_EL0
register before deciding whether using 'DC ZVA' or not. While this is a
good idea for code running in EL0, currently the Zephyr kernel is
running in EL1. This means that the value of the DCZID_EL0 register is
actually retrieved from the HCR_EL2.TDZ bit, that is always 0 because
EL2 is not currently supported / enabled. So the 'DC ZVA' instruction is
unconditionally used in the newlibc memset() implementation.

The "standard" solution for this case is usually to use a different
memset routine to be specifically used for two cases: (1) against IO
memory or (2) against normal memory but with MMU disabled (which means
all memory is considered device memory for data accesses).

To fix this issue in Zephyr we avoid calling memset() when clearing the
bss, and instead we use a simple loop to zero the memory region.

Signed-off-by: Carlo Caione <ca4506c8c654a4ccf75802e86b5d162c1e96f065@baylibre.com>


#ifndef SRC_EIGEN_QDEBUG_H_

#define SRC_EIGEN_QDEBUG_H_

#include <Eigen/Core>
#include <QDebug>
#include <iostream>

QDebug operator<<(QDebug dbg, const Eigen::Vector2f &vector)
{
  dbg << "[" << vector.x() << "|" << vector.y() << "]";

  return dbg.maybeSpace();
}

QDebug operator<<(QDebug dbg, const Eigen::Vector3f &vector)
{
  dbg << "[" << vector.x() << "|" << vector.y() << "|" << vector.z() << "]";

  return dbg.maybeSpace();
}

QDebug operator<<(QDebug dbg, const Eigen::Matrix4f &vector)
{
  const Eigen::IOFormat cleanFormat(4, 0, ", ", "\n", "[", "]");
  std::stringstream stream;
  stream << vector.format(cleanFormat);
  dbg << stream.str().c_str();

  return dbg.maybeSpace();
}

#endif  // SRC_EIGEN_QDEBUG_H_

#ifndef SRC_EIGEN_QDEBUG_H_

#define SRC_EIGEN_QDEBUG_H_

#include <Eigen/Core>
#include <QDebug>
#include <iostream>

QDebug operator<<(QDebug dbg, const Eigen::Vector2f &vector)
{
  dbg << "[" << vector.x() << "|" << vector.y() << "]";

  return dbg.maybeSpace();
}

QDebug operator<<(QDebug dbg, const Eigen::Vector3f &vector)
{
  dbg << "[" << vector.x() << "|" << vector.y() << "|" << vector.z() << "]";

  return dbg.maybeSpace();
}

QDebug operator<<(QDebug dbg, const Eigen::Vector4f &vector)
{
  dbg << "[" << vector.x() << "|" << vector.y() << "|" << vector.z() << "|"
      << vector.w() << "]";

  return dbg.maybeSpace();
}

QDebug operator<<(QDebug dbg, const Eigen::Matrix4f &vector)
{
  const Eigen::IOFormat cleanFormat(4, 0, ", ", "\n", "[", "]");
  std::stringstream stream;
  stream << vector.format(cleanFormat);
  dbg << stream.str().c_str();

  return dbg.maybeSpace();
}

#endif  // SRC_EIGEN_QDEBUG_H_

Add overload for qDebug << and Eigen::Vector4f.


/*
 *	This file is a part of Hierarchical Allocator library.
 *	Copyright (c) 2004-2011 Alex Pankratov. All rights reserved.
 *
 *	http://swapped.cc/halloc
 */

/*
 *	The program is distributed under terms of BSD license.
 *	You can obtain the copy of the license by visiting:
 *
 *	http://www.opensource.org/licenses/bsd-license.php
 */

#ifndef _LIBP_MACROS_H_
#define _LIBP_MACROS_H_

#include <stddef.h>  /* offsetof */

/*
 	restore pointer to the structure by a pointer to its field
 */
#define structof(p,t,f) ((t*)(- offsetof(t,f) + (void*)(p)))

#endif

/*
 *	This file is a part of Hierarchical Allocator library.
 *	Copyright (c) 2004-2011 Alex Pankratov. All rights reserved.
 *
 *	http://swapped.cc/halloc
 */

/*
 *	The program is distributed under terms of BSD license.
 *	You can obtain the copy of the license by visiting:
 *
 *	http://www.opensource.org/licenses/bsd-license.php
 */

#ifndef _LIBP_MACROS_H_
#define _LIBP_MACROS_H_

#include <stddef.h>  /* offsetof */
#include <stdint.h>  /* intptr_t */

/*
 	restore pointer to the structure by a pointer to its field
 */
#define structof(p,t,f) ((t*)(- offsetof(t,f) + (intptr_t)(p)))

#endif

Fix pointer cast into integer type.

Fix pointer cast into integer type.


#ifndef PyMPI_CONFIG_MPICH2_H
#define PyMPI_CONFIG_MPICH2_H

#ifdef MS_WINDOWS
#define PyMPI_MISSING_MPI_TYPE_CREATE_F90_INTEGER 1
#define PyMPI_MISSING_MPI_TYPE_CREATE_F90_REAL 1
#define PyMPI_MISSING_MPI_TYPE_CREATE_F90_COMPLEX 1
#endif

#ifndef ROMIO_VERSION
#include "mpich2io.h"
#endif /* !ROMIO_VERSION */

#endif /* !PyMPI_CONFIG_MPICH2_H */

#ifndef PyMPI_CONFIG_MPICH2_H
#define PyMPI_CONFIG_MPICH2_H

#ifdef MS_WINDOWS
#if !defined(MPICH2_NUMVERSION) || (MPICH2_NUMVERSION < 10100000)
#define PyMPI_MISSING_MPI_TYPE_CREATE_F90_INTEGER 1
#define PyMPI_MISSING_MPI_TYPE_CREATE_F90_REAL 1
#define PyMPI_MISSING_MPI_TYPE_CREATE_F90_COMPLEX 1
#endif /* MPICH2 < 1.1.0 */
#endif /* MS_WINDOWS */

#ifndef ROMIO_VERSION
#include "mpich2io.h"
#endif /* !ROMIO_VERSION */

#endif /* !PyMPI_CONFIG_MPICH2_H */

Update for MPICH2 1.1 on Windows

Update for MPICH2 1.1 on Windows


#ifndef EXPR_TOK_H
#define EXPR_TOK_H

extern expr_n tok_cur_num;

extern enum tok
{
	tok_ident = -1,
	tok_num   = -2,
	tok_eof   =  0,

	tok_lparen = '(',
	tok_rparen = ')',

	/* operators returned as char-value,
	 * except for double-char ops
	 */

	/* binary */
	tok_multiply = '*',
	tok_divide   = '/',
	tok_modulus  = '%',
	tok_plus     = '+',
	tok_minus    = '-',
	tok_xor      = '^',
	tok_or       = '|',
	tok_and      = '&',
	tok_orsc     = -1,
	tok_andsc    = -2,
	tok_shiftl   = -3,
	tok_shiftr   = -4,

	/* unary - TODO */
	tok_not      = '!',
	tok_bnot     = '~',

	/* comparison */
	tok_eq       = -5,
	tok_ne       = -6,
	tok_le       = -7,
	tok_lt       = '<',
	tok_ge       = -8,
	tok_gt       = '>',

	/* ternary */
	tok_question = '?',
	tok_colon    = ':',

#define MIN_OP -8
} tok_cur;

void tok_next(void);
void tok_begin(char *);
const char *tok_last(void);

#endif

#ifndef EXPR_TOK_H
#define EXPR_TOK_H

extern expr_n tok_cur_num;

extern enum tok
{
	tok_ident = -1,
	tok_num   = -2,
	tok_eof   =  0,

	tok_lparen = '(',
	tok_rparen = ')',

	/* operators returned as char-value,
	 * except for double-char ops
	 */

	/* binary */
	tok_multiply = '*',
	tok_divide   = '/',
	tok_modulus  = '%',
	tok_plus     = '+',
	tok_minus    = '-',
	tok_xor      = '^',
	tok_or       = '|',
	tok_and      = '&',
	tok_orsc     = -3,
	tok_andsc    = -4,
	tok_shiftl   = -5,
	tok_shiftr   = -6,

	/* unary - TODO */
	tok_not      = '!',
	tok_bnot     = '~',

	/* comparison */
	tok_eq       = -7,
	tok_ne       = -8,
	tok_le       = -9,
	tok_lt       = '<',
	tok_ge       = -10,
	tok_gt       = '>',

	/* ternary */
	tok_question = '?',
	tok_colon    = ':',

#define MIN_OP -10
} tok_cur;

void tok_next(void);
void tok_begin(char *);
const char *tok_last(void);

#endif

Fix clash in cpp tokens

Fix clash in cpp tokens


//===-- llvm/Assembly/CWriter.h - C Printer for LLVM programs ---*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This functionality is implemented by the lib/CWriter library.  This library
// is used to print C language files to an iostream.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_ASSEMBLY_CWRITER_H
#define LLVM_ASSEMBLY_CWRITER_H

#include <iosfwd>

namespace llvm {

class Pass;
Pass *createWriteToCPass(std::ostream &o);

} // End llvm namespace

#endif

//===-- llvm/Assembly/CWriter.h - C Printer for LLVM programs ---*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This functionality is implemented by the lib/CWriter library.  This library
// is used to print C language files to an iostream.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_ASSEMBLY_CWRITER_H
#define LLVM_ASSEMBLY_CWRITER_H

#include <iosfwd>

namespace llvm {

class PassManager;
void AddPassesToWriteC(PassManager &PM, std::ostream &o);

} // End llvm namespace

#endif

Change access to the cwriter

Change access to the cwriter

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


#ifndef GNOME_PROPERTIES_H
#define GNOME_PROPERTIES_H
#include <libgnome/gnome-defs.h>

BEGIN_GNOME_DECLS

typedef struct {
	GtkWidget *notebook;

	GList *props;
} GnomePropertyConfigurator;

/* This is the first parameter to the callback function */
typedef enum {
	GNOME_PROPERTY_READ,
	GNOME_PROPERTY_WRITE,
	GNOME_PROPERTY_APPLY,
	GNOME_PROPERTY_SETUP
} GnomePropertyRequest;

GnomePropertyConfigurator
     *gnome_property_configurator_new (void);

void gnome_property_configurator_destroy (GnomePropertyConfigurator *);
void gnome_property_configurator_register (GnomePropertyConfigurator *,
					   int (*callback)(GnomePropertyRequest));
void gnome_property_configurator_setup (GnomePropertyConfigurator *);
gint gnome_property_configurator_request (GnomePropertyConfigurator *,
					  GnomePropertyRequest);
void gnome_property_configurator_request_foreach (GnomePropertyConfigurator *th,
						  GnomePropertyRequest r);

END_GNOME_DECLS

#endif

#ifndef GNOME_PROPERTIES_H
#define GNOME_PROPERTIES_H
#include <libgnome/gnome-defs.h>

BEGIN_GNOME_DECLS

typedef struct {
	GtkWidget *notebook;
        GtkWidget *property_box;
	GList *props;
} GnomePropertyConfigurator;

/* This is the first parameter to the callback function */
typedef enum {
	GNOME_PROPERTY_READ,
	GNOME_PROPERTY_WRITE,
	GNOME_PROPERTY_APPLY,
	GNOME_PROPERTY_SETUP
} GnomePropertyRequest;

GnomePropertyConfigurator
     *gnome_property_configurator_new (void);

void gnome_property_configurator_destroy (GnomePropertyConfigurator *);
void gnome_property_configurator_register (GnomePropertyConfigurator *,
					   int (*callback)(GnomePropertyRequest));
void gnome_property_configurator_setup (GnomePropertyConfigurator *);
gint gnome_property_configurator_request (GnomePropertyConfigurator *,
					  GnomePropertyRequest);
void gnome_property_configurator_request_foreach (GnomePropertyConfigurator *th,
						  GnomePropertyRequest r);

END_GNOME_DECLS

#endif

Add a property box field so this stuff compiles


// RUN: %ocheck 3 %s

__attribute((always_inline))
inline f(int x)
{
	int i = x;
	&x;
	i++;
	return i;
}

main()
{
	int added = 5;

	added = f(2);

	return added;
}

Test for lvalue-argument function inlinling


#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include <sys/types.h>

static int UUID_SIZE = 16;
char toHexChar(int b) {
    char c;
    if(b < 10)
        c = '0' + b;
    else
        c = 'A' + b - 10;
    return c;
}
int main(int argc, char **argv) {
    int b = (0xa4 & 0xf0) >> 4;
    printf("c0=%c, %d\n", toHexChar(b), b);
    b = (0xa4 & 0x0f);
    printf("c1=%c, %d\n", toHexChar(b), b);
    // The raw data from the manufacturer's data packate
    uint8_t data[] = {0x4c,0x0,
            0x2,0x15,
            0xa4,0x95,0xde,0xad,0xc5,0xb1,0x4b,0x44,0xb5,
            0x12,0x13,0x70,0xf0,0x2d,0x74,0xde,0x30,0x39,0xff,0xff,
            0xc5};
    // Get the manufacturer code from the first two octets
    int index = 0;
    int manufacturer = 256 * data[index++] + data[index++];

    // Get the first octet of the beacon code
    int code = 256 * data[index++] + data[index++];

    // Get the proximity uuid
    char uuid[UUID_SIZE+1];
    int n;
    for(n = 0; n < UUID_SIZE; n += 2, index ++) {
        int b0 = (data[index] & 0xf0) >> 4;
        int b1 = data[index] & 0x0f;
        char c0 = toHexChar(b0);
        char c1 = toHexChar(b1);
        uuid[n] = c0;
        uuid[n+1] = c1;
    }
    uuid[UUID_SIZE] = '\0';

    // Get the beacon major id
    int major = 256 * data[index++] + data[index++];
    // Get the beacon minor id
    int minor = 256 * data[index++] + data[index++];

    // Get the transmitted power, which is encoded as the 2's complement of the calibrated Tx Power
    int power = data[index] - 256;

    printf("uuid=%s, manufacturer=%d, code=%d, major=%d, minor=%d, power=%d\n", uuid, manufacturer, code, major, minor, power);
}

Test the parse of the raw binary data seen in the hcidump integration for a manufacturer AD structure.


#include <string.h>

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

#ifdef __cplusplus
extern "C" {
#endif

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

}

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

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

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

#ifdef __cplusplus
}
#endif

#include <string.h>

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

#ifdef __cplusplus
extern "C" {
#endif

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

}

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

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

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

#ifdef __cplusplus
}
#endif

Revert "Fix typo in the commit a5312c77."

This reverts commit 401825d6045ab8e3bd1514404e7c326a045a92ae.

See the following revert for an explanation.


//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once

#define CHAKRA_CORE_MAJOR_VERSION 1
#define CHAKRA_CORE_MINOR_VERSION 3
#define CHAKRA_CORE_VERSION_RELEASE 0
#define CHAKRA_CORE_VERSION_PRERELEASE 0
#define CHAKRA_CORE_VERSION_RELEASE_QFE 0

#define CHAKRA_VERSION_RELEASE 0

// NOTE: need to update the GUID in ByteCodeCacheReleaseFileVersion.h as well

//-------------------------------------------------------------------------------------------------------
// Copyright (C) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
//-------------------------------------------------------------------------------------------------------
#pragma once

#define CHAKRA_CORE_MAJOR_VERSION 1
#define CHAKRA_CORE_MINOR_VERSION 4
#define CHAKRA_CORE_VERSION_RELEASE 0
#define CHAKRA_CORE_VERSION_PRERELEASE 0
#define CHAKRA_CORE_VERSION_RELEASE_QFE 0

#define CHAKRA_VERSION_RELEASE 0

// NOTE: need to update the GUID in ByteCodeCacheReleaseFileVersion.h as well

Update master branch version to 1.4

Update master branch version to 1.4


//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------

#ifndef T_GL_H
#define T_GL_H
#include "GL/glew.h"

// Slower but reliably detects extensions
#define gglHasExtension(EXTENSION) glewGetExtension("GL_" # EXTENSION)

#endif

//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------

#ifndef T_GL_H
#define T_GL_H
#include "GL/glew.h"

#if defined (TORQUE_OS_WIN)
// This doesn't work on Mesa drivers.
#define gglHasExtension(EXTENSION) GLEW_##EXTENSION
#else
// Slower but reliably detects extensions on Mesa.
#define gglHasExtension(EXTENSION) glewGetExtension("GL_" # EXTENSION)
#endif

#endif

Add @Azaezel's exception for Win32

Add @Azaezel's exception for Win32

"This chunk causes issues on the win8.1/non-SDL side."


#ifndef MOLCORE_GRAPH_H
#define MOLCORE_GRAPH_H

#include "molcore.h"

#include <vector>

namespace MolCore {

class MOLCORE_EXPORT Graph
{
public:
  // construction and destruction
  Graph();
  Graph(size_t size);
  ~Graph();

  // properties
  void setSize(size_t size);
  size_t size() const;
  bool isEmpty() const;
  void clear();

  // structure
  size_t addVertex();
  void removeVertex(size_t index);
  size_t vertexCount() const;
  void addEdge(size_t a, size_t b);
  void removeEdge(size_t a, size_t b);
  void removeEdges();
  void removeEdges(size_t index);
  size_t edgeCount() const;
  const std::vector<size_t>& neighbors(size_t index) const;
  size_t degree(size_t index) const;
  bool containsEdge(size_t a, size_t b) const;

private:
  std::vector<std::vector<size_t> > m_adjacencyList;
};

} // end MolCore namespace

#endif // MOLCORE_GRAPH_H

#ifndef MOLCORE_GRAPH_H
#define MOLCORE_GRAPH_H

#include "molcore.h"

#include <vector>
#include <cstddef>

namespace MolCore {

class MOLCORE_EXPORT Graph
{
public:
  // construction and destruction
  Graph();
  Graph(size_t size);
  ~Graph();

  // properties
  void setSize(size_t size);
  size_t size() const;
  bool isEmpty() const;
  void clear();

  // structure
  size_t addVertex();
  void removeVertex(size_t index);
  size_t vertexCount() const;
  void addEdge(size_t a, size_t b);
  void removeEdge(size_t a, size_t b);
  void removeEdges();
  void removeEdges(size_t index);
  size_t edgeCount() const;
  const std::vector<size_t>& neighbors(size_t index) const;
  size_t degree(size_t index) const;
  bool containsEdge(size_t a, size_t b) const;

private:
  std::vector<std::vector<size_t> > m_adjacencyList;
};

} // end MolCore namespace

#endif // MOLCORE_GRAPH_H

Include cstddef for size_t in newer GCC.


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

#ifndef __MD5_H__
#define __MD5_H__

#include "psqlodbc.h"

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

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

/* From c.h */
#ifndef __BEOS__

#ifndef __cplusplus

#ifndef bool
typedef char bool;
#endif

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

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

/* #if SIZEOF_UINT8 == 0  Can't get this from configure */
typedef unsigned char uint8;	/* == 8 bits */
typedef unsigned short uint16;	/* == 16 bits */
typedef unsigned int uint32;	/* == 32 bits */
/* #endif */

extern bool EncryptMD5(const char *passwd, const char *salt,
		   size_t salt_len, char *buf);

#endif

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

#ifndef __MD5_H__
#define __MD5_H__

#include "psqlodbc.h"

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

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

/* From c.h */
#ifndef __BEOS__

#ifndef __cplusplus

#ifndef bool
typedef char bool;
#endif

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

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

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

extern bool EncryptMD5(const char *passwd, const char *salt,
		   size_t salt_len, char *buf);

#endif

Add configure result checks on odbc, per Peter E.


// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null
// XFAIL: *
// See PR2452

struct {
  int *name;
} syms = { L"NUL" };

// RUN: %llvmgcc -S %s -o - | llvm-as -f -o /dev/null

#include <wchar.h>

struct {
  wchar_t *name;
} syms = { L"NUL" };

Fix a warning, closing PR2452

Fix a warning, closing PR2452

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


//
//  NSTimeZone+Offset.h
//  CocoaGit
//
//  Created by Geoffrey Garside on 28/07/2008.
//  Copyright 2008 ManicPanda.com. All rights reserved.
//

#import <Cocoa/Cocoa.h>

@interface NSTimeZone (Offset)

+ (id)timeZoneWithStringOffset:(NSString*)offset;
- (NSString*)offsetString;
@end

//
//  NSTimeZone+Offset.h
//  CocoaGit
//
//  Created by Geoffrey Garside on 28/07/2008.
//  Copyright 2008 ManicPanda.com. All rights reserved.
//

#import <Foundation/NSTimeZone.h>

@interface NSTimeZone (Offset)

+ (id)timeZoneWithStringOffset:(NSString*)offset;
- (NSString*)offsetString;
@end

Change NSTimeZone category to only import NSTimeZone parent class instead of Cocoa


#ifndef SCANNER_H_
#define SCANNER_H_

// I want to remove this dependecy, equivalent to yy.tab.h ?
#include "parse/GENERATED/parser.hxx"

#undef yyFlexLexer // ugly hack, because <FlexLexer> is wonky
#include <FlexLexer.h>

#include <iostream>

// Tell flex how to define lexing fn
#undef YY_DECL
#define YY_DECL                                                                \
  int GENERATED::Scanner::lex(GENERATED::Parser::semantic_type *yylval,        \
                              GENERATED::Parser::location_type *yylloc)

namespace GENERATED {
class Scanner : public yyFlexLexer {
public:
  explicit Scanner(std::istream *in = nullptr,
                   std::ostream *out = nullptr);

  int lex(GENERATED::Parser::semantic_type *yylval,
          GENERATED::Parser::location_type *yylloc);
};
}

#endif // include-guard

#ifndef SCANNER_H_
#define SCANNER_H_

// I want to remove this dependecy, equivalent to yy.tab.h ?
#include "parse/GENERATED/parser.hxx"

#undef yyFlexLexer // ugly hack, because <FlexLexer> is wonky
#include <FlexLexer.h>

#include <iostream>

// Tell flex how to define lexing fn
#undef YY_DECL
#define YY_DECL                                                                \
  int GENERATED::Scanner::lex(GENERATED::Parser::semantic_type *yylval,        \
                              GENERATED::Parser::location_type *yylloc)
// #define YY_DECL GENERATED::Parser::symbol_type GENERATED::Scanner::lex()

namespace GENERATED {
class Scanner : public yyFlexLexer {
public:
  explicit Scanner(std::istream *in = nullptr, std::ostream *out = nullptr);
  int lex(GENERATED::Parser::semantic_type *yylval,
          GENERATED::Parser::location_type *yylloc);
  // Parser::symbol_type lex();
};
}

#endif // include-guard

Prepare for new lex interface

Prepare for new lex interface


/* $Id$ */

/* Please see the LICENSE file for copyright and distribution information */

#ifndef __RUBY_XML_NODE__
#define __RUBY_XML_NODE__

extern VALUE cXMLNode;
extern VALUE eXMLNodeSetNamespace;
extern VALUE eXMLNodeFailedModify;
extern VALUE eXMLNodeUnknownType;

VALUE
ruby_xml_node2_wrap(VALUE class, xmlNodePtr xnode);

void ruby_xml_node_free(xmlNodePtr xnode);
void ruby_xml_node_mark_common(xmlNodePtr xnode);
void ruby_init_xml_node(void);

VALUE check_string_or_symbol(VALUE val);

VALUE ruby_xml_node_child_set(VALUE self, VALUE obj);
VALUE ruby_xml_node_name_get(VALUE self);
VALUE ruby_xml_node_property_get(VALUE self, VALUE key);
VALUE ruby_xml_node_property_set(VALUE self, VALUE key, VALUE val);
#endif

/* $Id$ */

/* Please see the LICENSE file for copyright and distribution information */

#ifndef __RUBY_XML_NODE__
#define __RUBY_XML_NODE__

extern VALUE cXMLNode;
extern VALUE eXMLNodeSetNamespace;
extern VALUE eXMLNodeFailedModify;
extern VALUE eXMLNodeUnknownType;

VALUE ruby_xml_node2_wrap(VALUE class, xmlNodePtr xnode);
VALUE check_string_or_symbol(VALUE val);
#endif

Clean out needless declarations in the node.h header file.


// RUN: %clang_cc1 -emit-llvm -g %s -o - | FileCheck %s
typedef int v4si __attribute__((__vector_size__(16)));

v4si a;

// Test that we get an array type that's also a vector out of debug.
// CHECK: [ DW_TAG_array_type ] [line 0, size 128, align 128, offset 0] [vector] [from int]

Add a test to make sure that vector output happens for debug info.

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


#include <config.h>

#define LIB_BULK		(USR_DIR + "/Game/lib/bulk")
#define LIB_TIME		(USR_DIR + "/Game/lib/time")
#define GAME_LIB_OBJECT		(USR_DIR + "/Game/lib/object")

#define BULKD			(USR_DIR + "/Game/sys/bulkd")
#define SNOOPD			(USR_DIR + "/Game/sys/snoopd")
#define TIMED			(USR_DIR + "/Game/sys/timed")
#define GAME_INITD		(USR_DIR + "/Game/initd")
#define GAME_HELPD		(USR_DIR + "/Game/sys/helpd")
#define GAME_DRIVER		(USR_DIR + "/Game/sys/driver")
#define GAME_ROOT		(USR_DIR + "/Game/sys/root")
#define GAME_SUBD		(USR_DIR + "/Game/sys/subd")
#define GAME_TESTD		(USR_DIR + "/Game/sys/testd")

#include <config.h>

#define LIB_ACTION		(USR_DIR + "/Game/lib/action")
#define LIB_BULK		(USR_DIR + "/Game/lib/bulk")
#define GAME_LIB_OBJECT		(USR_DIR + "/Game/lib/object")

#define BULKD			(USR_DIR + "/Game/sys/bulkd")
#define SNOOPD			(USR_DIR + "/Game/sys/snoopd")
#define TIMED			(USR_DIR + "/Game/sys/timed")
#define GAME_INITD		(USR_DIR + "/Game/initd")
#define GAME_HELPD		(USR_DIR + "/Game/sys/helpd")
#define GAME_DRIVER		(USR_DIR + "/Game/sys/driver")
#define GAME_ROOT		(USR_DIR + "/Game/sys/root")
#define GAME_SUBD		(USR_DIR + "/Game/sys/subd")
#define GAME_TESTD		(USR_DIR + "/Game/sys/testd")

Remove unwritten time library, add action library


/*
 * 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 73
#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 74
#endif

Update Skia milestone to 74

Update Skia milestone to 74

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