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

/**
 * Base class for decoders.
 */

#ifndef DECODER_H_
#define DECODER_H_

#include <memory>
#include <stdint.h>
#include <vector>

#include "dsp.h"

using namespace std;

namespace radioreceiver {

/**
 * Base class for decoders.
 */
class Decoder {
 public:
  /**
   * Demodulates a block of floating-point samples, producing a block of
   * stereo audio.
   * @param samples The samples to decode.
   * @param inStereo Whether to try decoding a stereo signal.
   * @return The generated stereo audio block.
   */
  virtual StereoAudio decode(const Samples& samples, bool inStereo) = 0;
};

}  // namespace radioreceiver

#endif  // DECODER_BASE_H_

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

/**
 * Base class for decoders.
 */

#ifndef DECODER_H_
#define DECODER_H_

#include <memory>
#include <stdint.h>
#include <vector>

#include "dsp.h"

using namespace std;

namespace radioreceiver {

/**
 * Base class for decoders.
 */
class Decoder {
 public:
  virtual ~Decoder() {}

  /**
   * Demodulates a block of floating-point samples, producing a block of
   * stereo audio.
   * @param samples The samples to decode.
   * @param inStereo Whether to try decoding a stereo signal.
   * @return The generated stereo audio block.
   */
  virtual StereoAudio decode(const Samples& samples, bool inStereo) = 0;
};

}  // namespace radioreceiver

#endif  // DECODER_BASE_H_

Add virtual destructor to base class.

Add virtual destructor to base class.


#ifndef __smoab_ExtractShell_h
#define __smoab_ExtractShell_h

#include "SimpleMoab.h"
#include "detail/LoadGeometry.h"
#include "detail/ReadMaterialTag.h"

#include <vtkUnstructuredGrid.h>
#include <vtkPolyData.h>

#include <algorithm>

namespace smoab{

//we presume that we are extract the shell of a 3d volume, where the 2d
//surface elements that constructed the 3d volume are contained
//in the input parents
class ExtractShell
{
  const smoab::Interface& Interface;
  const smoab::Range& Parents;
  std::string MaterialName;
  smoab::Range SCells;

public:
  ExtractShell(const smoab::Interface& interface, const smoab::Range& parents):
    Interface(interface),
    Parents(parents),
    MaterialName("Material")
    {
    const smoab::GeomTag geom2Tag(2);
    //append all the entities cells together into a single range
    typedef smoab::Range::const_iterator iterator;
    for(iterator i=this->Parents.begin(); i!= this->Parents.end(); ++i)
      {
      //find all 2d cells
      smoab::Range entitiesCells =
          this->Interface.findEntitiesWithDimension(*i,geom2Tag);
      this->SCells.insert(entitiesCells.begin(),entitiesCells.end());
      }

    std::cout << "SCells size" << this->SCells.size() << std::endl;
    }

  //----------------------------------------------------------------------------
  template<typename T>
  bool fill(T* grid)
  {
  //we have all the volume cells, what we need is to compare these
  //volume cells to a collection of surface cells
  const smoab::GeomTag geom2Tag(2);

  //save the results into the grid
  detail::LoadGeometry loadGeom(this->SCells,this->Interface);
  loadGeom.fill(grid);

  vtkNew<vtkIntArray> materials;
  materials->SetName(this->MaterialName.c_str());
  detail::ReadMaterialTag materialReader(this->MaterialName,
                                         this->Parents,
                                         this->SCells,
                                         this->Interface);

  //fill the material array using geom2tag to determine how cells
  //maps back to the parents.
  materialReader.fill(materials.GetPointer(),&geom2Tag);
  grid->GetCellData()->AddArray(materials.GetPointer());

  //to properly label the model face / side information we need to query
  //for all the volume elements and find the 2d adjacencies of the 2d element
  //and 3 elements

  return true;
  }

  void materialIdName(const std::string& name) { this->MaterialName = name; }
};
}

#endif // EXTRACTSHELL_H

Introduce the explicit Shell reader which makes polydata from moab.

This is very similar to creating a dataSetConverter that is giving
3d parents and asked to extract the 2d cells only. The big difference is that
we will try to relate the 2d cells back to any 3d cells in the 3d parents.


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

void SystemPause() {
	puts("\nPress Enter to continue...");
	while (getchar() != '\n') {}
}

void SystemClear() {
	system("clear");
}

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

void SystemPause() {
	puts("\nPress Enter to continue...");
	while (getchar() != '\n') {}
}

void SystemClear() {
	fputs("\033[2J\033[H", stdout);
}

Use escape sequence to clear screen

Use escape sequence to clear screen


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

#ifdef __cplusplus
extern "C" {
#endif

#import <Realm/RLMSchema.h>
#import <Realm/RLMDefines.h>

RLM_ASSUME_NONNULL_BEGIN

@class RLMRealm;

//
// RLMSchema private interface
//
@class RLMRealm;
@interface RLMSchema ()
@property (nonatomic, readwrite, copy) NSArray *objectSchema;

// schema based on runtime objects
+ (instancetype)sharedSchema;

// schema based on tables in a Realm
+ (instancetype)dynamicSchemaFromRealm:(RLMRealm *)realm;

// class for string
+ (nullable Class)classForString:(NSString *)className;

// shallow copy for reusing schema properties accross the same Realm on multiple threads
- (instancetype)shallowCopy;

@end

RLM_ASSUME_NONNULL_END

#ifdef __cplusplus
}
#endif

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

#ifdef __cplusplus
extern "C" {
#endif

#import <Realm/RLMSchema.h>
#import <Realm/RLMDefines.h>

RLM_ASSUME_NONNULL_BEGIN

@class RLMRealm;

//
// RLMSchema private interface
//
@class RLMRealm;
@interface RLMSchema ()
@property (nonatomic, readwrite, copy) NSArray *objectSchema;

// schema based on runtime objects
+ (nullable instancetype)sharedSchema;

// schema based on tables in a Realm
+ (instancetype)dynamicSchemaFromRealm:(RLMRealm *)realm;

// class for string
+ (nullable Class)classForString:(NSString *)className;

// shallow copy for reusing schema properties accross the same Realm on multiple threads
- (instancetype)shallowCopy;

@end

RLM_ASSUME_NONNULL_END

#ifdef __cplusplus
}
#endif

Mark +[RLMSchema sharedSchema] as nullable.


#ifndef STRESS1_MERGE_NO_REEXPORT_H
#define STRESS1_MERGE_NO_REEXPORT_H

#include "m00.h"
#include "m01.h"
#include "m02.h"
#include "m03.h"

#endif

Add file missed from r244409.

Add file missed from r244409.

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


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

#ifndef NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_
#define NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_

#include <string>
#include <utility>
#include <vector>

#include "net/http/http_status_code.h"

namespace net {

class HttpServerResponseInfo {
 public:
  // Creates a 200 OK HttpServerResponseInfo.
  HttpServerResponseInfo();
  explicit HttpServerResponseInfo(HttpStatusCode status_code);
  ~HttpServerResponseInfo();

  static HttpServerResponseInfo CreateFor404();
  static HttpServerResponseInfo CreateFor500(const std::string& body);

  void AddHeader(const std::string& name, const std::string& value);

  // This also adds an appropriate Content-Length header.
  void SetBody(const std::string& body, const std::string& content_type);
  // Sets content-length and content-type. Body should be sent separately.
  void SetContentHeaders(size_t content_length,
                         const std::string& content_type);

  std::string Serialize() const;

  HttpStatusCode status_code() const;
  const std::string& body() const;

 private:
  typedef std::vector<std::pair<std::string, std::string> > Headers;

  HttpStatusCode status_code_;
  Headers headers_;
  std::string body_;
};

}  // namespace net

#endif  // NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_

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

#ifndef NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_
#define NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_

#include <string>
#include <utility>

#include "base/strings/string_split.h"
#include "net/http/http_status_code.h"

namespace net {

class HttpServerResponseInfo {
 public:
  // Creates a 200 OK HttpServerResponseInfo.
  HttpServerResponseInfo();
  explicit HttpServerResponseInfo(HttpStatusCode status_code);
  ~HttpServerResponseInfo();

  static HttpServerResponseInfo CreateFor404();
  static HttpServerResponseInfo CreateFor500(const std::string& body);

  void AddHeader(const std::string& name, const std::string& value);

  // This also adds an appropriate Content-Length header.
  void SetBody(const std::string& body, const std::string& content_type);
  // Sets content-length and content-type. Body should be sent separately.
  void SetContentHeaders(size_t content_length,
                         const std::string& content_type);

  std::string Serialize() const;

  HttpStatusCode status_code() const;
  const std::string& body() const;

 private:
  using Headers = base::StringPairs;

  HttpStatusCode status_code_;
  Headers headers_;
  std::string body_;
};

}  // namespace net

#endif  // NET_SERVER_HTTP_SERVER_RESPONSE_INFO_H_

Use of base::StringPairs appropriately in server

Bescause base/strings/string_split.h defines:
typedef std::vector<std::pair<std::string, std::string> > StringPairs;

BUG=412250

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

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


#import <Foundation/Foundation.h>

@class MITCollectionViewNewsGridLayout;

@interface MITCollectionViewGridLayoutSection : NSObject
@property (nonatomic,readonly,weak) MITCollectionViewNewsGridLayout *layout;
@property (nonatomic,readonly) NSInteger section;

@property (nonatomic) CGPoint origin;
@property (nonatomic) UIEdgeInsets contentInsets;

@property (nonatomic, readonly) CGSize bounds;
@property (nonatomic,readonly) CGRect frame;

@property (nonatomic,readonly,strong) UICollectionViewLayoutAttributes *headerLayoutAttributes;
@property (nonatomic,readonly,strong) UICollectionViewLayout *featuredItemLayoutAttributes;
@property (nonatomic,readonly,strong) NSArray *itemLayoutAttributes;

+ (instancetype)sectionWithLayout:(MITCollectionViewNewsGridLayout*)layout section:(NSInteger)section;
- (NSArray*)layoutAttributesInRect:(CGRect)rect;
- (UICollectionViewLayoutAttributes*)layoutAttributesForItemAtIndexPath:(NSIndexPath*)indexPath;

@end

#import <Foundation/Foundation.h>

@class MITCollectionViewNewsGridLayout;

@interface MITCollectionViewGridLayoutSection : NSObject
@property (nonatomic,readonly,weak) MITCollectionViewNewsGridLayout *layout;
@property (nonatomic,readonly) NSInteger section;

@property (nonatomic) CGPoint origin;
@property (nonatomic) UIEdgeInsets contentInsets;

@property (nonatomic,readonly) CGRect bounds;
@property (nonatomic,readonly) CGRect frame;

@property (nonatomic,readonly,strong) UICollectionViewLayoutAttributes *headerLayoutAttributes;
@property (nonatomic,readonly,strong) UICollectionViewLayoutAttributes *featuredItemLayoutAttributes;
@property (nonatomic,readonly,strong) NSArray *itemLayoutAttributes;

+ (instancetype)sectionWithLayout:(MITCollectionViewNewsGridLayout*)layout forSection:(NSInteger)section numberOfColumns:(NSInteger)numberOfColumns;
- (NSArray*)layoutAttributesInRect:(CGRect)rect;
- (UICollectionViewLayoutAttributes*)layoutAttributesForItemAtIndexPath:(NSIndexPath*)indexPath;

@end

Clean up some inconsistencies in the section helper header


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

#pragma once

#include "Stdafx.h"
#include "IRequestResponse.h"

using namespace System;
using namespace System::Net;

namespace CefSharp
{
    public enum class NavigationType
    {
        LinkClicked = NAVIGATION_LINK_CLICKED,
        FormSubmitted = NAVIGATION_FORM_SUBMITTED,
        BackForward = NAVIGATION_BACK_FORWARD,
        Reload = NAVIGATION_RELOAD,
        FormResubmitted = NAVIGATION_FORM_RESUBMITTED,
        Other = NAVIGATION_OTHER
    };

    public interface class IRequestHandler
    {
    public:
        bool OnBeforeBrowse(IWebBrowser^ browser, IRequest^ request, NavigationType navigationType, bool isRedirect);
        bool OnBeforeResourceLoad(IWebBrowser^ browser, IRequestResponse^ requestResponse);
        void OnResourceResponse(IWebBrowser^ browser, String^ url, int status, String^ statusText, String^ mimeType, WebHeaderCollection^ headers);
        bool GetDownloadHandler(IWebBrowser^ browser, String^ mimeType, String^ fileName, Int64 contentLength, IDownloadHandler ^% handler);
        bool GetAuthCredentials(IWebBrowser^ browser, bool isProxy, String^ host ,int port, String^ realm, String^ scheme, String^% username, String^% password);
   };
}

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

#pragma once

#include "Stdafx.h"
#include "IRequestResponse.h"

using namespace System;
using namespace System::Net;
using namespace System::Runtime::InteropServices;

namespace CefSharp
{
    public enum class NavigationType
    {
        LinkClicked = NAVIGATION_LINK_CLICKED,
        FormSubmitted = NAVIGATION_FORM_SUBMITTED,
        BackForward = NAVIGATION_BACK_FORWARD,
        Reload = NAVIGATION_RELOAD,
        FormResubmitted = NAVIGATION_FORM_RESUBMITTED,
        Other = NAVIGATION_OTHER
    };

    public interface class IRequestHandler
    {
        bool OnBeforeBrowse(IWebBrowser^ browser, IRequest^ request, NavigationType navigationType, bool isRedirect);
        bool OnBeforeResourceLoad(IWebBrowser^ browser, IRequestResponse^ requestResponse);
        void OnResourceResponse(IWebBrowser^ browser, String^ url, int status, String^ statusText, String^ mimeType, WebHeaderCollection^ headers);
        bool GetDownloadHandler(IWebBrowser^ browser, [Out] IDownloadHandler ^% handler);
        bool GetAuthCredentials(IWebBrowser^ browser, bool isProxy, String^ host ,int port, String^ realm, String^ scheme, String^% username, String^% password);
   };
}

Use a proper Out parameter.

Use a proper Out parameter.


#ifndef _MY_EDATA
#define _MY_EDATA

#ifdef __cplusplus
#define EXTERNC extern "C"
#else
#define EXTERNC
#endif

/** @brief struct that carries all information about experimental data */
typedef struct edata {
    /** observed data */
    double *am_my;
    /** standard deviation of observed data */
    double *am_ysigma;

    /** observed events */
    double *am_mz;
    /** standard deviation of observed events */
    double *am_zsigma;

    /** boolean indicating whether experimental data was provided */
    bool am_bexpdata;

	} ExpData;

EXTERNC void freeExpData(ExpData *edata);

#endif /* _MY_EDATA */

#ifndef _MY_EDATA
#define _MY_EDATA

#ifdef __cplusplus
#define EXTERNC extern "C"
#else
#define EXTERNC
#include <stdbool.h>
#endif

/** @brief struct that carries all information about experimental data */
typedef struct edata {
    /** observed data */
    double *am_my;
    /** standard deviation of observed data */
    double *am_ysigma;

    /** observed events */
    double *am_mz;
    /** standard deviation of observed events */
    double *am_zsigma;

    /** boolean indicating whether experimental data was provided */
    bool am_bexpdata;

} ExpData;

EXTERNC void freeExpData(ExpData *edata);

#endif /* _MY_EDATA */

Fix type bool for C

Fix type bool for C


#ifndef CPR_ERROR_H
#define CPR_ERROR_H

#include <string>

#include "cprtypes.h"
#include "defines.h"

namespace cpr {

enum class ErrorCode {
    OK = 0,
    CONNECTION_FAILURE,
    EMPTY_RESPONSE,
    HOST_RESOLUTION_FAILURE,
    INTERNAL_ERROR,
    INVALID_URL_FORMAT,
    NETWORK_RECEIVE_ERROR,
    NETWORK_SEND_FAILURE,
    OPERATION_TIMEDOUT,
    PROXY_RESOLUTION_FAILURE,
    SSL_CONNECT_ERROR,
    SSL_LOCAL_CERTIFICATE_ERROR,
    SSL_REMOTE_CERTIFICATE_ERROR,
    SSL_CACERT_ERROR,
    GENERIC_SSL_ERROR,
    UNSUPPORTED_PROTOCOL,
    UNKNOWN_ERROR = 1000,
};

ErrorCode getErrorCodeForCurlError(int curl_code);

class Error {
  public:
    Error() : code{ErrorCode::OK}, message{""} {}

    template <typename TextType>
    Error(const ErrorCode& p_error_code, TextType&& p_error_message)
            : code{p_error_code}, message{CPR_FWD(p_error_message)} {}

    explicit operator bool() const {
        return code != ErrorCode::OK;
    }

    ErrorCode code;
    std::string message;
};

} // namespace cpr

#endif

#ifndef CPR_ERROR_H
#define CPR_ERROR_H

#include <string>

#include "cprtypes.h"
#include "defines.h"

namespace cpr {

enum class ErrorCode {
    OK = 0,
    CONNECTION_FAILURE,
    EMPTY_RESPONSE,
    HOST_RESOLUTION_FAILURE,
    INTERNAL_ERROR,
    INVALID_URL_FORMAT,
    NETWORK_RECEIVE_ERROR,
    NETWORK_SEND_FAILURE,
    OPERATION_TIMEDOUT,
    PROXY_RESOLUTION_FAILURE,
    SSL_CONNECT_ERROR,
    SSL_LOCAL_CERTIFICATE_ERROR,
    SSL_REMOTE_CERTIFICATE_ERROR,
    SSL_CACERT_ERROR,
    GENERIC_SSL_ERROR,
    UNSUPPORTED_PROTOCOL,
    UNKNOWN_ERROR = 1000,
};

ErrorCode getErrorCodeForCurlError(int curl_code);

class Error {
  public:
    Error() : code{ErrorCode::OK} {}

    template <typename TextType>
    Error(const ErrorCode& p_error_code, TextType&& p_error_message)
            : code{p_error_code}, message{CPR_FWD(p_error_message)} {}

    explicit operator bool() const {
        return code != ErrorCode::OK;
    }

    ErrorCode code;
    std::string message;
};

} // namespace cpr

#endif

Remove explicit instantiation of empty message


#include <linux/init.h>
#include <linux/linkage.h>

#include <asm/i8259.h>
#include <asm/mipsregs.h>
#include <asm/qemu.h>
#include <asm/system.h>
#include <asm/time.h>

extern asmlinkage void qemu_handle_int(void);

asmlinkage void plat_irq_dispatch(void)
{
	unsigned int pending = read_c0_status() & read_c0_cause();

	if (pending & 0x8000) {
		ll_timer_interrupt(Q_COUNT_COMPARE_IRQ);
		return;
	}
	if (pending & 0x0400) {
		int irq = i8259_irq();

		if (likely(irq >= 0))
			do_IRQ(irq);

		return;
	}
}

void __init arch_init_irq(void)
{
	mips_hpt_frequency = QEMU_C0_COUNTER_CLOCK;		/* 100MHz */

	init_i8259_irqs();
	set_c0_status(0x8400);
}

#include <linux/init.h>
#include <linux/linkage.h>

#include <asm/i8259.h>
#include <asm/mipsregs.h>
#include <asm/qemu.h>
#include <asm/system.h>
#include <asm/time.h>

asmlinkage void plat_irq_dispatch(void)
{
	unsigned int pending = read_c0_status() & read_c0_cause();

	if (pending & 0x8000) {
		ll_timer_interrupt(Q_COUNT_COMPARE_IRQ);
		return;
	}
	if (pending & 0x0400) {
		int irq = i8259_irq();

		if (likely(irq >= 0))
			do_IRQ(irq);

		return;
	}
}

void __init arch_init_irq(void)
{
	mips_hpt_frequency = QEMU_C0_COUNTER_CLOCK;		/* 100MHz */

	init_i8259_irqs();
	set_c0_status(0x8400);
}

[MIPS] Remove prototype for deleted function qemu_handle_int

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


// RUN: %clang -### -S -fwrapv -fno-wrapv -fwrapv %s 2>&1 | FileCheck -check-prefix=CHECK1 %s
// CHECK1: -fwrapv
//
// RUN: %clang -### -S -fstrict-overflow -fno-strict-overflow %s 2>&1 | FileCheck -check-prefix=CHECK2 %s
// CHECK2: -fwrapv
//
// RUN: %clang -### -S -fwrapv -fstrict-overflow %s 2>&1 | FileCheck -check-prefix=CHECK3 %s
// CHECK3: -fwrapv
//
// RUN: %clang -### -S -fno-wrapv -fno-strict-overflow %s 2>&1 | FileCheck -check-prefix=CHECK4 %s
// CHECK4-NOT: -fwrapv

Add my test case for r128353. I think this is the last test case to fail
to be added... Sorry for the noise.

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


// RUN: %clang_profgen -o %t -O3 %s
// RUN: env LLVM_PROFILE_FILE="/" LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s

int main(int argc, const char *argv[]) {
  if (argc < 2)
    return 1;
  return 0;
}
// CHECK: LLVM Profile: Failed to write file

// RUN: %clang_profgen -o %t -O3 %s
// RUN: env LLVM_PROFILE_FILE="%t/" LLVM_PROFILE_VERBOSE_ERRORS=1 %run %t 1 2>&1 | FileCheck %s

int main(int argc, const char *argv[]) {
  if (argc < 2)
    return 1;
  return 0;
}
// CHECK: LLVM Profile: Failed to write file

[profile] Test error reporting by writing to a temp directory

This test case is meant to check whether verbose error logging works. It
does this by _failing_ to write a profile to a path corresponding to a
directory. Make this clearer by writing to a temporary directory.

Patch suggested by Sean Silva!

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


#include <stdio.h>
#include <inttypes.h>
#include <capstone/capstone.h>

#define X86_CODE \
    "\x55\x48\x8b\x05\xb8\x13\x00\x00\xe9\x14\x9e\x08\x00\x45\x31\xe4"

int main(int argc, char* argv[])
{
	csh handle;
	cs_insn *insn;
	size_t count;
	int rc = 0;

	if (cs_open(CS_ARCH_X86, CS_MODE_64, &handle) != CS_ERR_OK) {
		return 1;
	}

	cs_option(handle, CS_OPT_DETAIL, CS_OPT_ON);

	count = cs_disasm(handle, (const uint8_t*) X86_CODE, sizeof(X86_CODE) - 1, 0x1000, 0, &insn);

	if (count > 0) {
		printf("count = %zu\n", count);
		for (size_t i = 0; i < count; i++) {
			printf("0x%"PRIx64": % - 6s %s\n", insn[i].address, insn[i].mnemonic, insn[i].op_str);
		}
		cs_free(insn, count);
	} else {
		puts("ERROR: Failed to dissasemble given code!\n");
		rc = 1;
	}

	cs_close(&handle);

	return rc;
}

Add capstone dissasembly C example.

Add capstone dissasembly C example.

compile with: gcc capstone_dissasembly.c -o capstone -lcapstone


#include <string>
#include <vector>
#ifndef __hpux
using namespace std;
#endif

#pragma create TClass vector<bool>;
#pragma create TClass vector<char>;
#pragma create TClass vector<short>;
#pragma create TClass vector<long>;
#pragma create TClass vector<unsigned char>;
#pragma create TClass vector<unsigned short>;
#pragma create TClass vector<unsigned int>;
#pragma create TClass vector<unsigned long>;
#pragma create TClass vector<float>;
#pragma create TClass vector<double>;
#pragma create TClass vector<char*>;
#pragma create TClass vector<const char*>;
#pragma create TClass vector<string>;

#if (!(G__GNUC==3 && G__GNUC_MINOR==1)) && !defined(G__KCC) && (!defined(G__VISUAL) || G__MSC_VER<1300)
// gcc3.1,3.2 has a problem with iterator<void*,...,void&>
#pragma create TClass vector<void*>;
#endif

#include <string>
#include <vector>
#ifndef __hpux
using namespace std;
#endif

#pragma create TClass vector<bool>;
#pragma create TClass vector<char>;
#pragma create TClass vector<short>;
#pragma create TClass vector<long>;
#pragma create TClass vector<unsigned char>;
#pragma create TClass vector<unsigned short>;
#pragma create TClass vector<unsigned int>;
#pragma create TClass vector<unsigned long>;
#pragma create TClass vector<float>;
#pragma create TClass vector<double>;
#pragma create TClass vector<char*>;
#pragma create TClass vector<const char*>;
#pragma create TClass vector<string>;
#pragma create TClass vector<Long64_t>;
#pragma create TClass vector<ULong64_t>;

#if (!(G__GNUC==3 && G__GNUC_MINOR==1)) && !defined(G__KCC) && (!defined(G__VISUAL) || G__MSC_VER<1300)
// gcc3.1,3.2 has a problem with iterator<void*,...,void&>
#pragma create TClass vector<void*>;
#endif

Add missing TClass creation for vector<Long64_t> and vector<ULong64_t>

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


// RUN: $llvmgcc -m64 -fomit-frame-pointer -O2 %s -S -o - > %t
// RUN: not grep subq %t
// RUN: not grep addq %t
// RUN: grep {\\-4(%%rsp)} %t | count 2
// RUN: $llvmgcc -m64 -fomit-frame-pointer -O2 %s -S -o - -mno-red-zone > %t
// RUN: grep subq %t | count 1
// RUN: grep addq %t | count 1
// This is a test for x86-64, add your target below if it FAILs.
// XFAIL: alpha|ia64|arm|powerpc|sparc|x86

long double f0(float f) { return f; }

// RUN: $llvmgcc -m64 -fomit-frame-pointer -O2 %s -S -o - > %t
// RUN: not grep subq %t
// RUN: not grep addq %t
// RUN: grep {\\-4(%%rsp)} %t | count 2
// RUN: $llvmgcc -m64 -fomit-frame-pointer -O2 %s -S -o - -mno-red-zone > %t
// RUN: grep subq %t | count 1
// RUN: grep addq %t | count 1
// This is a test for x86-64, add your target below if it FAILs.
// XFAIL: alpha|ia64|arm|powerpc|sparc|i.86

long double f0(float f) { return f; }

Make the XFAIL line actually match x86-32 targets.

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


/*
 * This file is part of Kotaka, a mud library for DGD
 * http://github.com/shentino/kotaka
 *
 * Copyright (C) 2012  Raymond Jennings
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation, either version 3 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

Add subroutine daemon for Game

Add subroutine daemon for Game


/*
 @ 0xCCCCCCCC
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef KBASE_BASIC_MACROS_H_
#define KBASE_BASIC_MACROS_H_

#define DISALLOW_COPY(CLASSNAME)                        \
    CLASSNAME(const CLASSNAME&) = delete;               \
    CLASSNAME& operator=(const CLASSNAME&) = delete

#define DISALLOW_MOVE(CLASSNAME)                        \
    CLASSNAME(CLASSNAME&&) = delete;                    \
    CLASSNAME& operator=(CLASSNAME&&) = delete

#endif  // KBASE_BASIC_MACROS_H_

/*
 @ 0xCCCCCCCC
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef KBASE_BASIC_MACROS_H_
#define KBASE_BASIC_MACROS_H_

#define DISALLOW_COPY(CLASSNAME)                        \
    CLASSNAME(const CLASSNAME&) = delete;               \
    CLASSNAME& operator=(const CLASSNAME&) = delete

#define DISALLOW_MOVE(CLASSNAME)                        \
    CLASSNAME(CLASSNAME&&) = delete;                    \
    CLASSNAME& operator=(CLASSNAME&&) = delete

#define UNREFED_VAR(x) \
    ::kbase::internal::SilenceUnusedVariableWarning(x)

// Put complicated implementation below.

namespace kbase {

namespace internal {

template<typename T>
void SilenceUnusedVariableWarning(T&&)
{}

}   // namespace internal

}   // namespace kbase

#endif  // KBASE_BASIC_MACROS_H_

Add a macro UNREFED_VAR to silence unused variables warning.


#import <Foundation/Foundation.h>

@protocol TGSessionTokenNotifier <NSObject>

+(void)sessionTokenSet:(NSString*)token;

@end

#import <Foundation/Foundation.h>

@protocol TGSessionTokenNotifier <NSObject>

-(void)sessionTokenSet:(NSString*)token;

@end

Make token notifier method instance method


#ifndef LINESRC_HPP
#define LINESRC_HPP

#include <stdint.h>

#include <string>

class haxpp_linesource {
private:
    linecount_t         lineno_start = 0;
    linecount_t         lineno = 0;
    std::string         sourcepath;
    FILE*               fp = nullptr;
    char*               line = nullptr;
    size_t              line_alloc = 0;
    bool                fp_owner = false;
public:
    static constexpr size_t    line_alloc_minimum = 32u;
    static constexpr size_t    line_alloc_default = 1200u;
    static constexpr size_t    line_alloc_maximum = 65536u;
public:
    inline const std::string& getsourcename() const {
        return sourcepath;
    }
    inline size_t linesize() const { /* total buffer size including room for NUL terminator */
        return line_alloc;
    }
    inline linecount_t currentline() const {
        return lineno;
    }
public:
    haxpp_linesource();
    ~haxpp_linesource();
public:
    void setsource();
    void setsource(FILE *_fp);
    void setsource(const std::string &path);
    bool lineresize(const size_t newsz);
    void close();
    bool is_open() const;
    bool eof() const;
    bool error() const;
    bool open();
    char *readline();
};

#endif /*LINESRC_HPP*/

#ifndef LINESRC_HPP
#define LINESRC_HPP

#include <stdint.h>

#include <string>

class haxpp_linesource {
private:
    linecount_t         lineno_start = 0;
    linecount_t         lineno = 0;
    std::string         sourcepath;
    FILE*               fp = nullptr;
    char*               line = nullptr;
    size_t              line_alloc = 0;
    bool                fp_owner = false;
public:
    static constexpr size_t    line_alloc_minimum = 32u;
    static constexpr size_t    line_alloc_default = 1200u;
    static constexpr size_t    line_alloc_maximum = 65536u;
public:
    inline const std::string& getsourcename() const {
        return sourcepath;
    }
    inline size_t linesize() const { /* total buffer size including room for NUL terminator */
        return line_alloc;
    }
    inline linecount_t currentline() const {
        return lineno_start;
    }
public:
    haxpp_linesource();
    ~haxpp_linesource();
public:
    void setsource();
    void setsource(FILE *_fp);
    void setsource(const std::string &path);
    bool lineresize(const size_t newsz);
    void close();
    bool is_open() const;
    bool eof() const;
    bool error() const;
    bool open();
    char *readline();
};

#endif /*LINESRC_HPP*/

Fix line number off by 1 error

Fix line number off by 1 error


/*
 * SearchCubePruning.h
 *
 *  Created on: 16 Nov 2015
 *      Author: hieu
 */

#pragma once
#include <vector>
#include <boost/unordered_map.hpp>
#include "Search.h"

class Bitmap;

class SearchCubePruning : public Search
{
public:
	SearchCubePruning(Manager &mgr, Stacks &stacks);
	virtual ~SearchCubePruning();

	void Decode(size_t stackInd);

	const Hypothesis *GetBestHypothesis() const;

protected:
	boost::unordered_map<Bitmap*, std::vector<const Hypothesis*> > m_hyposPerBM;
};

/*
 * SearchCubePruning.h
 *
 *  Created on: 16 Nov 2015
 *      Author: hieu
 */

#ifndef SEARCH_SEARCHCUBEPRUNING_H_
#define SEARCH_SEARCHCUBEPRUNING_H_

#include "Search.h"

class SearchCubePruning : public Search
{
public:
	SearchCubePruning(Manager &mgr, Stacks &stacks);
	virtual ~SearchCubePruning();

	void Decode(size_t stackInd);

	const Hypothesis *GetBestHypothesis() const;

};

#endif /* SEARCH_SEARCHCUBEPRUNING_H_ */

Revert "for each input path.2"

Revert "for each input path.2"

This reverts commit 69e4cb0531ec93868ccc06ec54d52a4f88d62295.


#ifndef PERL_MONGO
#define PERL_MONGO

#include <mongo/client/dbclient.h>

extern "C" {

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#define PERL_MONGO_CALL_BOOT(name)  perl_mongo_call_xs (aTHX_ name, cv, mark)

void perl_mongo_call_xs (pTHX_ void (*subaddr) (pTHX_ CV *cv), CV *cv, SV **mark);
SV *perl_mongo_call_reader (SV *self, const char *reader);
void perl_mongo_attach_ptr_to_instance (SV *self, void *ptr);
void *perl_mongo_get_ptr_from_instance (SV *self);
SV *perl_mongo_construct_instance (const char *klass, ...);
SV *perl_mongo_construct_instance_va (const char *klass, va_list ap);
SV *perl_mongo_construct_instance_with_magic (const char *klass, void *ptr, ...);
SV *perl_mongo_bson_to_sv (const char *oid_class, mongo::BSONObj obj);
mongo::BSONObj perl_mongo_sv_to_bson (SV *sv, const char *oid_class);

}

#endif

#ifndef PERL_MONGO
#define PERL_MONGO

#include <mongo/client/dbclient.h>

extern "C" {

#define PERL_GCC_BRACE_GROUPS_FORBIDDEN

#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#define PERL_MONGO_CALL_BOOT(name)  perl_mongo_call_xs (aTHX_ name, cv, mark)

void perl_mongo_call_xs (pTHX_ void (*subaddr) (pTHX_ CV *cv), CV *cv, SV **mark);
SV *perl_mongo_call_reader (SV *self, const char *reader);
void perl_mongo_attach_ptr_to_instance (SV *self, void *ptr);
void *perl_mongo_get_ptr_from_instance (SV *self);
SV *perl_mongo_construct_instance (const char *klass, ...);
SV *perl_mongo_construct_instance_va (const char *klass, va_list ap);
SV *perl_mongo_construct_instance_with_magic (const char *klass, void *ptr, ...);
SV *perl_mongo_bson_to_sv (const char *oid_class, mongo::BSONObj obj);
mongo::BSONObj perl_mongo_sv_to_bson (SV *sv, const char *oid_class);

}

#endif

Stop the headers of debugging perls to generate gcc brace groups.

Those don't work with g++ easily.


// Derived from blog post at http://www.ermicro.com/blog/?p=1239

#ifndef __I2C_UTILS_H__
#define __I2C_UTILS_H__

#define I2C_MAX_TRIES 50     // Connection attempts (0 < tries < 255)
#define I2C_START 0
#define I2C_DATA 1
#define I2C_DATA_ACK 2
#define I2C_STOP 3

void i2c_init(void);
unsigned char i2c_transmit(unsigned char type);
char i2c_start(unsigned int dev_id, unsigned int dev_addr, unsigned char rw_type);
void i2c_stop(void);
char i2c_write(char data);
char i2c_read(char *data, char ack_type);

#endif  /*__I2C_UTILS_H__*/

// Derived from blog post at http://www.ermicro.com/blog/?p=1239

#ifndef __I2C_UTILS_H__
#define __I2C_UTILS_H__

#include <compat/twi.h>

#define I2C_MAX_TRIES 50     // Connection attempts (0 < tries < 255)
#define I2C_START 0
#define I2C_DATA 1
#define I2C_DATA_ACK 2
#define I2C_STOP 3
#define I2C_SCL 100000L      // Set I2C clock to 100 kHz

void i2c_init(void);
uint8_t i2c_transmit(uint8_t type);
char i2c_start(uint8_t dev_addr, uint8_t rw_type);
void i2c_stop(void);
char i2c_write(char data);
char i2c_read(char *data, char ack_type);

// Higher-level convenience functions composed from functions above.
void    i2c_write_byte(uint8_t dev_addr, char data);
void    i2c_write_byte_to_register(uint8_t dev_addr, uint8_t reg, char data);
uint8_t i2c_read_byte_from_register(uint8_t dev_addr, uint8_t reg_addr);

#endif  /*__I2C_UTILS_H__*/

Add high-level write and read functions

Add high-level write and read functions


#define DUMMY			0
#define FUNC			1
#define PARAM			2
#define XFER_FUNC		3
#define ALLOC_FUNC		4
#define ACTION_PARAM	5
#define NOSUPP_FUNC		6

struct token {
	int		tok_type;
	char	*val;
};

struct node {
	int		node_type;
	char	*type_name;
	char	*id;
	int		is_ptr;
	int		is_const;
	int		is_const_ptr;
	int		is_mapped;
	int		is_array;
	int		is_ref;
	int		in_param;
	int		out_param;
	int		extract;
	struct node	*next;
	struct node *prev;
	struct node *param_list;
	struct node *action_func_list;
};

#define XDR_FUNC id

struct p_mode {
	int		in;
	int		out;
};

union yystype {
	struct	token tok;
	struct	node *node;
	struct	p_mode param_mode;
	int		bool;
};
#define YYSTYPE union yystype

#define DUMMY			0
#define FUNC			1
#define PARAM			2
#define XFER_FUNC		3
#define ALLOC_FUNC		4
#define ACTION_PARAM	5
#define NOSUPP_FUNC		6

struct token {
	int		tok_type;
	char	*val;
};

struct node {
	int		node_type;
	char	*type_name;
	char	*id;
	int		is_ptr;
	int		is_const;
	int		is_const_ptr;
	int		is_mapped;
	int		is_array;
	int		is_ref;
	int		in_param;
	int		out_param;
	int		extract;
	int		pseudo;
	struct node	*next;
	struct node *prev;
	struct node *param_list;
	struct node *action_func_list;
};

#define XDR_FUNC id

struct p_mode {
	int		in;
	int		out;
};

union yystype {
	struct	token tok;
	struct	node *node;
	struct	p_mode param_mode;
	int		bool;
};
#define YYSTYPE union yystype

Add boolean node attirbute "pseudo" to describe whether a given system call is a "normal" one, or a "pseudo" call. This needs to be know by the receivers where normal syscalls can be invoked directly by their name, but pseudo calls must have hand written code to handle their functionality.


// RUN: %ocheck 1 '-DNULL=(void *)0'
// RUN: %ocheck 0 '-DNULL=0'

int null_is_ptr_type()
{
	char s[1][1+(int)NULL];
	int i = 0;
	sizeof s[i++];
	return i;
}

main()
{
	return null_is_ptr_type();
}

// RUN: %ocheck 1 %s '-DNULL=(void *)0'
// RUN: %ocheck 0 %s '-DNULL=0'

int null_is_ptr_type()
{
	char s[1][1+(int)NULL];
	int i = 0;
	sizeof s[i++];
	return i;
}

main()
{
	return null_is_ptr_type();
}

Fix standard-nonconst vla test commands

Fix standard-nonconst vla test commands


//
//  Messages.h
//  Pods
//
//  Created by Tyler Clemens on 6/2/16.
//
//

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

@protocol MessagesDelegate <NSObject>

@optional

- (void)MessagesResults:(NSArray *_Nullable)arrayMessages;
- (void)UnreadMessageResults:(NSNumber *_Nullable)count;

@end

@interface Messages : NSObject <STMHTTPResponseHandlerDelegate>

+ (void)initAll;
+ (void)freeAll;

+ (Messages *_Nonnull)controller;

- (void)requestForMessagesWithDelegate:(id<MessagesDelegate> _Nullable)delegate;
- (void)requestForUnreadMessageCountWithDelegate:(id<MessagesDelegate> _Nullable)delegate;
- (void)requestForMessage:(NSString * _Nonnull)messageId completionHandler:(void (^_Nullable)(NSError *_Nullable, id _Nullable))completionHandler;
- (void)cancelAllRequests;

@end

//
//  Messages.h
//  Pods
//
//  Created by Tyler Clemens on 6/2/16.
//
//

#import <Foundation/Foundation.h>
#import "STMMessage.h"
#import "STMNetworking.h"

@protocol MessagesDelegate <NSObject>

@optional

- (void)MessagesResults:(NSArray *_Nullable)arrayMessages;
- (void)UnreadMessageResults:(NSNumber *_Nullable)count;

@end

@interface Messages : NSObject <STMHTTPResponseHandlerDelegate>

+ (void)initAll;
+ (void)freeAll;

+ (Messages *_Nonnull)controller;

- (void)requestForMessagesWithDelegate:(id<MessagesDelegate> _Nullable)delegate;
- (void)requestForUnreadMessageCountWithDelegate:(id<MessagesDelegate> _Nullable)delegate;
- (void)requestForMessage:(NSString * _Nonnull)messageId completionHandler:(void (^_Nullable)(NSError *_Nullable, id _Nullable))completionHandler;
- (void)cancelAllRequests;

@end

Fix a linking issue found by lint

Fix a linking issue found by lint


#include <Sub/Types.h>
// This comment ensures that this file is not identical to
// HasSubModules.framework/Frameworks/Sub.framework/Headers/Sub.h

Change this comment to helpfully explain why it's there.

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


#ifndef ONEDMASSFLUX_H
#define ONEDMASSFLUX_H

#include "Kernel.h"

class OneDMassFlux;

template<>
InputParameters validParams<OneDMassFlux>();

/**
 * Mass flux
 */
class OneDMassFlux : public Kernel
{
public:
  OneDMassFlux(const InputParameters & parameters);
  virtual ~OneDMassFlux();

protected:
  virtual Real computeQpResidual();
  virtual Real computeQpJacobian();
  virtual Real computeQpOffDiagJacobian(unsigned int jvar);

  VariableValue & _rhouA;
  unsigned int _rhouA_var_number;
};

#endif /* ONEDMASSFLUX_H */

#ifndef ONEDMASSFLUX_H
#define ONEDMASSFLUX_H

#include "Kernel.h"

class OneDMassFlux;

template<>
InputParameters validParams<OneDMassFlux>();

/**
 * Mass flux
 */
class OneDMassFlux : public Kernel
{
public:
  OneDMassFlux(const InputParameters & parameters);
  virtual ~OneDMassFlux();

protected:
  virtual Real computeQpResidual();
  virtual Real computeQpJacobian();
  virtual Real computeQpOffDiagJacobian(unsigned int jvar);

  const VariableValue & _rhouA;
  unsigned int _rhouA_var_number;
};

#endif /* ONEDMASSFLUX_H */

Prepare RELAP-7 for MooseVariable::sln() const update.

This set of changes prepares RELAP-7 to work with an upcoming version of
MOOSE in which MooseVariable::sln() returns a const reference.

Refs idaholab/moose#6327.


#include <string>

using namespace std;

/* Obtained from http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html */
void tokenizeString(const string& str,
				vector<string>& tokens,
				const string& delimiters)
{
	// Skip delimiters at beginning.
	string::size_type lastPos = str.find_first_not_of(delimiters, 0);
	// Find first "non-delimiter".
	string::size_type pos     = str.find_first_of(delimiters, lastPos);

	while (string::npos != pos || string::npos != lastPos)
	{
		// Found a token, add it to the vector.
		tokens.push_back(str.substr(lastPos, pos - lastPos));
		// Skip delimiters.  Note the "not_of"
		lastPos = str.find_first_not_of(delimiters, pos);
		// Find next "non-delimiter"
		pos = str.find_first_of(delimiters, lastPos);
	}
}

#include <string>

/* Obtained from http://oopweb.com/CPP/Documents/CPPHOWTO/Volume/C++Programming-HOWTO-7.html */
void tokenizeString(const std::string& str,
				std::vector<std::string>& tokens,
				const std::string& delimiters)
{
	// Skip delimiters at beginning.
	std::string::size_type lastPos = str.find_first_not_of(delimiters, 0);
	// Find first "non-delimiter".
	std::string::size_type pos     = str.find_first_of(delimiters, lastPos);

	while (std::string::npos != pos || std::string::npos != lastPos)
	{
		// Found a token, add it to the vector.
		tokens.push_back(str.substr(lastPos, pos - lastPos));
		// Skip delimiters.  Note the "not_of"
		lastPos = str.find_first_not_of(delimiters, pos);
		// Find next "non-delimiter"
		pos = str.find_first_of(delimiters, lastPos);
	}
}

Remove use of using-directive for std

Common: Remove use of using-directive for std


//PARAM: --enable ana.int.interval --disable exp.lower-constants
#include <assert.h>

int main(){
    int a = 0;

    // maximum value for ulonglong
    unsigned long long x = 18446744073709551615ull;
    if(x > 18446744073709551612ull){
        a = 1;
    }
    assert(a);

    unsigned long long y = x + 4;
    // Unsigned overflow -- The following assertion should succeed
    assert(y == 3);

    // maximum value for long long
    signed long long s = 9223372036854775807;
    assert(s > 9223372036854775806);

    signed long long t = s + 2;
    // Signed overflow -- The following assertion must be UNKNOWN!
    assert(t == 1); // UNKNOWN!

    return 0;
}

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

int main(){
    int a = 0;

    // maximum value for ulonglong
    unsigned long long x = 18446744073709551615ull;
    if(x > 18446744073709551612ull){
        a = 1;
    }
    assert(a);

    unsigned long long y = x + 4;
    // Unsigned overflow -- The following assertion should succeed
    assert(y == 3);

    // maximum value for long long
    signed long long s = 9223372036854775807;
    assert(s > 9223372036854775806);

    signed long long t = s + 2;
    // Signed overflow -- The following assertion must be UNKNOWN!
    assert(t == 1); // UNKNOWN!

    return 0;
}

Test defexc with large integers

Test defexc with large integers


#define BUF_SIZE 4096

#define MAXINTERFACES 10
#define MAXNEIGHBOURS 20

#define MESSAGE_PAD1 0
#define MESSAGE_PADN 1
#define MESSAGE_ACK_REQ 2
#define MESSAGE_ACK 3
#define MESSAGE_HELLO 4
#define MESSAGE_IHU 5
#define MESSAGE_ROUTER_ID 6
#define MESSAGE_NH 7
#define MESSAGE_UPDATE 8

#define MESSAGE_REQUEST 9
#define MESSAGE_MH_REQUEST 10

#define AE_WILDCARD 0
#define AE_IPV4 1
#define AE_IPV6 2
#define AE_LL 3

#define INFINITY 0xFFFF

#define BUF_SIZE 4096

#define MAXINTERFACES 5
#define MAXNEIGHBOURS 10

#define MESSAGE_PAD1 0
#define MESSAGE_PADN 1
#define MESSAGE_ACK_REQ 2
#define MESSAGE_ACK 3
#define MESSAGE_HELLO 4
#define MESSAGE_IHU 5
#define MESSAGE_ROUTER_ID 6
#define MESSAGE_NH 7
#define MESSAGE_UPDATE 8

#define MESSAGE_REQUEST 9
#define MESSAGE_MH_REQUEST 10

#define AE_WILDCARD 0
#define AE_IPV4 1
#define AE_IPV6 2
#define AE_LL 3

#define INFINITY 0xFFFF

Reduce size of neighbour and interface table.

Now that we're able to expire neighbours, we can get away with a smaller table.


//
// Copyright (C) 2007 SIPez LLC.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// Copyright (C) 2007 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// $$
///////////////////////////////////////////////////////////////////////////////

// Author: Sergey Kostanbaev <Sergey DOT Kostanbaev AT sipez DOT com>

#ifndef _plgg726_h_
#define _plgg726_h_

#include <mp/codecs/PlgDefsV1.h>

#include <spandsp/bitstream.h>
#include <spandsp/g726.h>

int internal_decode_g726(void* handle, const void* pCodedData,
                         unsigned cbCodedPacketSize, void* pAudioBuffer,
                         unsigned cbBufferSize, unsigned *pcbCodedSize,
                         const struct RtpHeader* pRtpHeader);

int internal_encode_g726(void* handle, const void* pAudioBuffer,
                         unsigned cbAudioSamples, int* rSamplesConsumed,
                         void* pCodedData, unsigned cbMaxCodedData,
                         int* pcbCodedSize, unsigned* pbSendNow);

#endif

//
// Copyright (C) 2007 SIPez LLC.
// Licensed to SIPfoundry under a Contributor Agreement.
//
// Copyright (C) 2007 SIPfoundry Inc.
// Licensed by SIPfoundry under the LGPL license.
//
// $$
///////////////////////////////////////////////////////////////////////////////

// Author: Sergey Kostanbaev <Sergey DOT Kostanbaev AT sipez DOT com>

#ifndef _plgg726_h_
#define _plgg726_h_

#include <mp/codecs/PlgDefsV1.h>

#include <spandsp/bitstream.h>
#include <spandsp/g726.h>

#ifndef G726_PACKING_NONE
#define G726_PACKING_NONE 0
#endif

#ifndef G726_ENCODING_LINEAR
#define G726_ENCODING_LINEAR	0
#endif

int internal_decode_g726(void* handle, const void* pCodedData,
                         unsigned cbCodedPacketSize, void* pAudioBuffer,
                         unsigned cbBufferSize, unsigned *pcbCodedSize,
                         const struct RtpHeader* pRtpHeader);

int internal_encode_g726(void* handle, const void* pAudioBuffer,
                         unsigned cbAudioSamples, int* rSamplesConsumed,
                         void* pCodedData, unsigned cbMaxCodedData,
                         int* pcbCodedSize, unsigned* pbSendNow);

#endif

FIx build of G.726 codec wrapper with older versions of SpanDSP.

git-svn-id: 5274dacc98e2a95d0b0452670772bfdffe61ca90@10190 a612230a-c5fa-0310-af8b-88eea846685b


////////////////////////////////////////////////////////////////////////////////
//
//  TYPHOON FRAMEWORK
//  Copyright 2013, Typhoon Framework Contributors
//  All Rights Reserved.
//
//  NOTICE: The authors permit you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

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

@class TyphoonAssembly;

@interface TyphoonAssemblyAdviser : NSObject

+ (BOOL)assemblyClassIsAdvised:(Class)class;

- (id)initWithAssembly:(TyphoonAssembly *)assembly;

- (void)adviseAssembly;

- (NSSet *)definitionSelectors;

- (NSDictionary *)assemblyClassPerDefinitionKey;

@property(readonly, weak) TyphoonAssembly *assembly;
@property(nonatomic, strong) id <TyphoonMethodSwizzler> swizzler;

@end

////////////////////////////////////////////////////////////////////////////////
//
//  TYPHOON FRAMEWORK
//  Copyright 2013, Typhoon Framework Contributors
//  All Rights Reserved.
//
//  NOTICE: The authors permit you to use, modify, and distribute this file
//  in accordance with the terms of the license agreement accompanying it.
//
////////////////////////////////////////////////////////////////////////////////

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

@class TyphoonAssembly;

@interface TyphoonAssemblyAdviser : NSObject

+ (BOOL)assemblyClassIsAdvised:(Class)klass;

- (id)initWithAssembly:(TyphoonAssembly *)assembly;

- (void)adviseAssembly;

- (NSSet *)definitionSelectors;

- (NSDictionary *)assemblyClassPerDefinitionKey;

@property(readonly, weak) TyphoonAssembly *assembly;
@property(nonatomic, strong) id <TyphoonMethodSwizzler> swizzler;

@end

Remove use of reserved keyboard in public header


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

int is_multiple_of_three(int n) {
	int odd_bits_cnt = 0;
	int even_bits_cnt = 0;

	if (n < 0) n = -n;
	if (n == 0) return 1;
	if (n == 1) return 0;

	while (n) {
		if (n & 0x1) {
			odd_bits_cnt++;
		}

		n >>= 1;

		if (n & 0x1) {
			even_bits_cnt++;
		}

		n >>= 1;
	}

	return is_multiple_of_three(abs(odd_bits_cnt - even_bits_cnt));
}

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

	printf("Enter a number to test is it multiple of 3: ");
	int n = 0;
	scanf("%d", &n);
	printf(is_multiple_of_three(n) ? "true\n" : "false\n");

	return 0;
}

Add function that checks if a given number is multiple of three.


/*
  Ruby/SDL   Ruby extension library for SDL

  Copyright (C) 2001-2007 Ohbayashi Ippei

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

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

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

static VALUE sdl_getTicks(VALUE mod)
{
  return UINT2NUM(SDL_GetTicks());
}

static VALUE delay(void* t)
{
  SDL_Delay(*((Uint32*)t));
  return Qnil;
}

static VALUE sdl_delay(VALUE mod,VALUE ms)
{
  Uint32 t = NUM2UINT(ms);
#ifdef HAVE_RB_THREAD_BLOCKING_REGION
  rb_thread_blocking_region(delay, &t, RUBY_UBF_IO, NULL);
#else
  SDL_Delay(t);
#endif
  return Qnil;
}

void rubysdl_init_time(VALUE mSDL)
{
  rb_define_module_function(mSDL,"getTicks",sdl_getTicks,0);
  rb_define_module_function(mSDL,"delay",sdl_delay,1);
}

/*
  Ruby/SDL   Ruby extension library for SDL

  Copyright (C) 2001-2007 Ohbayashi Ippei

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

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

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

static VALUE sdl_getTicks(VALUE mod)
{
  return UINT2NUM(SDL_GetTicks());
}

static VALUE sdl_delay(VALUE mod,VALUE ms)
{
  Uint32 t = NUM2UINT(ms);
  SDL_Delay(t);
  return Qnil;
}

void rubysdl_init_time(VALUE mSDL)
{
  rb_define_module_function(mSDL,"getTicks",sdl_getTicks,0);
  rb_define_module_function(mSDL,"delay",sdl_delay,1);
}

Remove rb_thread_blocking_region when SDL_Delay is called.

This means that SDL.delay stops all of Ruby threads now.


// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s
// rdar://10033986

typedef void (^BLOCK)(void);
int main ()
{
    _Complex double c;
    BLOCK b =  ^() {
      _Complex double z;
      z = z + c;
    };
    b();
}

// CHECK: define internal void @__main_block_invoke_0
// CHECK:  [[C1:%.*]] = alloca { double, double }, align 8
// CHECK:  [[C1]].realp = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 0
// CHECK-NEXT:  [[C1]].real = load double* [[C1]].realp
// CHECK-NEXT:  [[C1]].imagp = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 1
// CHECK-NEXT:  [[C1]].imag = load double* [[C1]].imagp

// RUN: %clang_cc1 %s -emit-llvm -o - -fblocks -triple x86_64-apple-darwin10 | FileCheck %s
// rdar://10033986

typedef void (^BLOCK)(void);
int main ()
{
    _Complex double c;
    BLOCK b =  ^() {
      _Complex double z;
      z = z + c;
    };
    b();
}

// CHECK: define internal void @__main_block_invoke_0
// CHECK:  [[C1:%.*]] = alloca { double, double }, align 8
// CHECK:  [[RP:%.*]] = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 0
// CHECK-NEXT:  [[R:%.*]] = load double* [[RP]]
// CHECK-NEXT:  [[IP:%.*]] = getelementptr inbounds { double, double }* [[C1]], i32 0, i32 1
// CHECK-NEXT:  [[I:%.*]] = load double* [[IP]]

Revise test and see if it passes with a release-built clang.

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


/*
 * 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 53
#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 54
#endif

Update skia milestone to next

Update skia milestone to next

No API changes, just moving version fwd.

TBR=reed@google.com

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2115573002

Review-Url: https://codereview.chromium.org/2115573002


// Written by Arthur O'Dwyer

#pragma once

template <class Lambda>
class AtScopeExit {
  Lambda& m_lambda;

 public:
  AtScopeExit(Lambda& action) : m_lambda(action) {}
  ~AtScopeExit() { m_lambda(); }
};

#define Auto_INTERNAL2(lname, aname, ...) \
  auto lname = [&]() { __VA_ARGS__; };    \
  AtScopeExit<decltype(lname)> aname(lname);

#define Auto_TOKENPASTE(x, y) Auto_##x##y

#define Auto_INTERNAL1(ctr, ...)                                               \
  Auto_INTERNAL2(Auto_TOKENPASTE(func_, ctr), Auto_TOKENPASTE(instance_, ctr), \
                 __VA_ARGS__)

#define Auto(...) Auto_INTERNAL1(__COUNTER__, __VA_ARGS__)

FEAT: Add a very simple finalizer implementation


/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

#import <UIKit/UIKit.h>

#import "../../ReactKit/Base/RCTBridgeModule.h"

@interface RCTPushNotificationManager : NSObject <RCTBridgeModule>

- (instancetype)initWithInitialNotification:(NSDictionary *)initialNotification NS_DESIGNATED_INITIALIZER;

+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings;
+ (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification;
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;

@end

/**
 * Copyright (c) 2015-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 */

#import <UIKit/UIKit.h>

#import "RCTBridgeModule.h"

@interface RCTPushNotificationManager : NSObject <RCTBridgeModule>

- (instancetype)initWithInitialNotification:(NSDictionary *)initialNotification NS_DESIGNATED_INITIALIZER;

+ (void)application:(UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings;
+ (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)notification;
+ (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation;

@end

Fix build - remove relative import path

Fix build - remove relative import path


#ifndef LINUX_POWERPC_PERF_HV_COMMON_H_
#define LINUX_POWERPC_PERF_HV_COMMON_H_

#include <linux/types.h>

struct hv_perf_caps {
	u16 version;
	u16 collect_privileged:1,
	    ga:1,
	    expanded:1,
	    lab:1,
	    unused:12;
};

unsigned long hv_perf_caps_get(struct hv_perf_caps *caps);

#endif

#ifndef LINUX_POWERPC_PERF_HV_COMMON_H_
#define LINUX_POWERPC_PERF_HV_COMMON_H_

#include <linux/perf_event.h>
#include <linux/types.h>

struct hv_perf_caps {
	u16 version;
	u16 collect_privileged:1,
	    ga:1,
	    expanded:1,
	    lab:1,
	    unused:12;
};

unsigned long hv_perf_caps_get(struct hv_perf_caps *caps);

#define EVENT_DEFINE_RANGE_FORMAT(name, attr_var, bit_start, bit_end)	\
PMU_FORMAT_ATTR(name, #attr_var ":" #bit_start "-" #bit_end);		\
EVENT_DEFINE_RANGE(name, attr_var, bit_start, bit_end)

#define EVENT_DEFINE_RANGE(name, attr_var, bit_start, bit_end)	\
static u64 event_get_##name##_max(void)					\
{									\
	BUILD_BUG_ON((bit_start > bit_end)				\
		    || (bit_end >= (sizeof(1ull) * 8)));		\
	return (((1ull << (bit_end - bit_start)) - 1) << 1) + 1;	\
}									\
static u64 event_get_##name(struct perf_event *event)			\
{									\
	return (event->attr.attr_var >> (bit_start)) &			\
		event_get_##name##_max();				\
}

#endif

powerpc/perf: Add macros for defining event fields & formats

Add two macros which generate functions to extract the relevent bits
from event->attr.config{,1,2}.

EVENT_DEFINE_RANGE() defines an accessor for a range of bits in the
event, as well as a "max" function that gives the maximum value of the
field based on the bit width.

EVENT_DEFINE_RANGE_FORMAT() defines the accessor & max routine and also
a format attribute for use in the PMU's attr_groups.

Signed-off-by: Cody P Schafer <c4fe2b1d90ef8f2548c8aeabfa633434316f0305@linux.vnet.ibm.com>
[mpe: move to powerpc, ugly but descriptive macro names]
Signed-off-by: Michael Ellerman <864f124608374e06e4da1fa5d2e47ed839b95411@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <a7089bb6e7e92505d88aaff006cbdd60cc9120b6@kernel.crashing.org>


#include <polygon.h>

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

	Polygon lol;

	lol=createPolygon();
	lol=addPoint(lol, createPoint(12.6,-5.3));
	lol=addPoint(lol, createPoint(-4.1,456.123));

	printf("\n\nx premier point : %f", lol->value.x);
	printf("\ny premier point : %f\n\n", lol->value.y);

	printf("\n\nx 2eme point : %f", lol->next->value.x);
	printf("\ny 2eme point : %f\n\n", lol->next->value.y);

	printf("\n\nx 3eme point : %f", lol->next->next->value.x);
	printf("\ny 3eme point : %f\n\n", lol->next->next->value.y);

	return EXIT_SUCCESS;

}

#include <polygon.h>

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

	Polygon lol;

	lol=createPolygon();
	lol=addPoint(lol, createPoint(12.6,-5.3));
	lol=addPoint(lol, createPoint(-4.1,456.123));

	printf("\n\ntaille : %d", lol.size);

	printf("\n\nx premier point : %f", lol.head->value.x);
	printf("\ny premier point : %f\n\n", lol.head->value.y);

	printf("\n\nx 2eme point : %f", lol.head->next->value.x);
	printf("\ny 2eme point : %f\n\n", lol.head->next->value.y);

	printf("\n\nx 3eme point : %f", lol.head->next->next->value.x);
	printf("\ny 3eme point : %f\n\n", lol.head->next->next->value.y);

	return EXIT_SUCCESS;

}

Print the size of the polygon

Print the size of the polygon


#import <Foundation/Foundation.h>

#ifndef CMHErrors_h
#define CMHErrors_h

static NSString *const CMHErrorDomain = @"CMHErrorDomain";

typedef NS_ENUM(NSUInteger, CMHError) {
    CMHErrorUserMissingConsent      = 700,
    CMHErrorUserMissingSignature    = 701,
    CMHErrorUserDidNotConsent       = 702,
    CMHErrorUserDidNotProvideName   = 703,
    CMHErrorUserDidNotSign          = 704
};

#endif

#import <Foundation/Foundation.h>

#ifndef CMHErrors_h
#define CMHErrors_h

static NSString *const CMHErrorDomain = @"me.cloudmine.CMHealth.ErrorDomain";

typedef NS_ENUM(NSUInteger, CMHError) {
    CMHErrorUserMissingConsent      = 700,
    CMHErrorUserMissingSignature    = 701,
    CMHErrorUserDidNotConsent       = 702,
    CMHErrorUserDidNotProvideName   = 703,
    CMHErrorUserDidNotSign          = 704
};

#endif

Use Apple recommended format for error domain string


// Filename: Python.h
// Created by:  drose (12May00)
//
////////////////////////////////////////////////////////////////////
//
// 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."
//
////////////////////////////////////////////////////////////////////

// This file, and all the other files in this directory, aren't
// intended to be compiled--they're just parsed by CPPParser (and
// interrogate) in lieu of the actual system headers, to generate the
// interrogate database.

#ifndef PYTHON_H
#define PYTHON_H

class PyObject;
class PyThreadState;
typedef int Py_ssize_t;
struct Py_buffer;

#endif  // PYTHON_H

// Filename: Python.h
// Created by:  drose (12May00)
//
////////////////////////////////////////////////////////////////////
//
// 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."
//
////////////////////////////////////////////////////////////////////

// This file, and all the other files in this directory, aren't
// intended to be compiled--they're just parsed by CPPParser (and
// interrogate) in lieu of the actual system headers, to generate the
// interrogate database.

#ifndef PYTHON_H
#define PYTHON_H

class PyObject;
class PyThreadState;
typedef int Py_ssize_t;
struct Py_buffer;

// This file defines PY_VERSION_HEX, which is used in some places.
#include "patchlevel.h"

#endif  // PYTHON_H

Fix interrogate understanding of PY_VERSION_HEX


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

#include <stm32f4xx_hal.h>

#include <board_driver/usb/usb.h>
#include <board_driver/iwdg.h>

int main(void) {
	usb_init();
    HAL_Delay(1000);
    setup_IWDG();
    init_IWDG();
    char start[] = "Starting\r\n";
    usb_transmit(start, sizeof(start)/sizeof(start[0]));

    while (1) {
		char str[] = "Hello usb\r\n";
		usb_transmit(str, sizeof(str)/sizeof(str[0]));
    HAL_Delay(500);
	}
}

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

#include <stm32f4xx_hal.h>

#include <board_driver/usb/usb.h>
#include <board_driver/iwdg.h>

int main(void) {
	usb_init();
    HAL_Delay(1000);
    setup_IWDG();
    init_IWDG();
    printf("Starting\r\n");

    while (1) {
		printf("Hello usb\r\n");
        HAL_Delay(500);
	}
}

Change example_iwdg to use printf instead of usb_transmit


//===- llvm/System/Signals.h - Signal Handling support ----------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines some helpful functions for dealing with the possibility of
// unix signals occuring while your program is running.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_SYSTEM_SIGNALS_H
#define LLVM_SYSTEM_SIGNALS_H

#include <string>

namespace llvm {

  /// RemoveFileOnSignal - This function registers signal handlers to ensure
  /// that if a signal gets delivered that the named file is removed.
  ///
  void RemoveFileOnSignal(const std::string &Filename);

  /// PrintStackTraceOnErrorSignal - When an error signal (such as SIBABRT or
  /// SIGSEGV) is delivered to the process, print a stack trace and then exit.
  void PrintStackTraceOnErrorSignal();
} // End llvm namespace

#endif

//===- llvm/System/Signals.h - Signal Handling support ----------*- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file defines some helpful functions for dealing with the possibility of
// unix signals occuring while your program is running.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_SYSTEM_SIGNALS_H
#define LLVM_SYSTEM_SIGNALS_H

#include "llvm/System/Path.h"

namespace llvm {

  /// This function registers signal handlers to ensure that if a signal gets
  /// delivered that the named file is removed.
  /// @brief Remove a file if a fatal signal occurs.
  void RemoveFileOnSignal(const std::string &Filename);

  /// This function registers a signal handler to ensure that if a fatal signal
  /// gets delivered to the process that the named directory and all its
  /// contents are removed.
  /// @brief Remove a directory if a fatal signal occurs.
  void RemoveDirectoryOnSignal(const llvm::sys::Path& path);

  /// When an error signal (such as SIBABRT or SIGSEGV) is delivered to the
  /// process, print a stack trace and then exit.
  /// @brief Print a stack trace if a fatal signal occurs.
  void PrintStackTraceOnErrorSignal();

} // End llvm namespace

#endif

Add a function to remove whole directorys on fatal signal.
Doxygenify function comments.

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


//
// Created by gravypod on 9/20/17.
//

#ifndef ENGINE_STYLE_H
#define ENGINE_STYLE_H

#include <duktape.h>

void make_style(const char const *name,
                float width, float height,
                const char const *vertex_name, const char const *fragment_name);
void draw_style(const char const *name, float x, float y);

__attribute__((unused)) static duk_ret_t native_make_style(duk_context *ctx)
{
    const char const          *name = duk_require_string(ctx, 0);
    const float               width = (float) duk_require_number(ctx, 1);
    const float              height = (float) duk_require_number(ctx, 2);
    const char const   *vertex_name = duk_require_string(ctx, 3);
    const char const *fragment_name = duk_require_string(ctx, 4);
    make_style(name, width, height, vertex_name, fragment_name);
    return 0;
}

__attribute__((unused)) static duk_ret_t native_draw_style(duk_context *ctx)
{
    const char const          *name = duk_require_string(ctx, 0);
    const float                   x = (float) duk_require_number(ctx, 1);
    const float                   y = (float) duk_require_number(ctx, 2);
    draw_style(name, x, y);
    return 0;
}

#endif //ENGINE_STYLE_H

//
// Created by gravypod on 9/20/17.
//

#ifndef ENGINE_STYLE_H
#define ENGINE_STYLE_H

#include "lib/duktape/duktape.h"

void make_style(const char const *name,
                float width, float height,
                const char const *vertex_name, const char const *fragment_name);
void draw_style(const char const *name, float x, float y);

__attribute__((unused)) static duk_ret_t native_make_style(duk_context *ctx)
{
    const char const          *name = duk_require_string(ctx, 0);
    const float               width = (float) duk_require_number(ctx, 1);
    const float              height = (float) duk_require_number(ctx, 2);
    const char const   *vertex_name = duk_require_string(ctx, 3);
    const char const *fragment_name = duk_require_string(ctx, 4);
    make_style(name, width, height, vertex_name, fragment_name);
    return 0;
}

__attribute__((unused)) static duk_ret_t native_draw_style(duk_context *ctx)
{
    const char const          *name = duk_require_string(ctx, 0);
    const float                   x = (float) duk_require_number(ctx, 1);
    const float                   y = (float) duk_require_number(ctx, 2);
    draw_style(name, x, y);
    return 0;
}

#endif //ENGINE_STYLE_H

Use local copy of duktape header.

Use local copy of duktape header.


//
//  RNBackgroundGeolocation.h
//  RNBackgroundGeolocation
//
//  Created by Christopher Scott on 2015-04-19.
//  Copyright (c) 2015 Transistor Software. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import <UIKit/UIKit.h>
#import "RCTLog.h"
#import <AudioToolbox/AudioToolbox.h>
#import <TSLocationManager/TSLocationManager.h>

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

@interface RNBackgroundGeolocation : NSObject <RCTBridgeModule>

@property (nonatomic, strong) TSLocationManager* locationManager;
@property (nonatomic, strong) NSDictionary* syncCallback;

@end

//
//  RNBackgroundGeolocation.h
//  RNBackgroundGeolocation
//
//  Created by Christopher Scott on 2015-04-19.
//  Copyright (c) 2015 Transistor Software. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import <UIKit/UIKit.h>
#import "RCTLog.h"
#import <AudioToolbox/AudioToolbox.h>
#import <TSLocationManager/TSLocationManager.h>

#import "RCTBridgeModule.h"

@interface RNBackgroundGeolocation : NSObject <RCTBridgeModule>

@property (nonatomic, strong) TSLocationManager* locationManager;
@property (nonatomic, strong) NSDictionary* syncCallback;

@end

Remove unused import RCTEventEmitter; I want to use this in the future but it causes problems with older version of RN currently


/*
  Copyright 2012-2020 David Robillard <d@drobilla.net>

  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted, provided that the above
  copyright notice and this permission notice appear in all copies.

  THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

/**
   @file pugl_cairo.h
   @brief Declaration of Cairo backend accessor.
*/

#ifndef PUGL_PUGL_CAIRO_H
#define PUGL_PUGL_CAIRO_H

#include "pugl/pugl.h"

PUGL_BEGIN_DECLS

/**
   @defgroup cairo Cairo
   Cairo graphics support.
   @ingroup pugl_c
   @{
*/

/**
   Cairo graphics backend accessor.

   Pass the return value to puglInitBackend() to draw to a view with Cairo.
*/
PUGL_API PUGL_CONST_FUNC const PuglBackend*
puglCairoBackend(void);

/**
   @}
*/

PUGL_END_DECLS

#endif // PUGL_PUGL_CAIRO_H

/*
  Copyright 2012-2020 David Robillard <d@drobilla.net>

  Permission to use, copy, modify, and/or distribute this software for any
  purpose with or without fee is hereby granted, provided that the above
  copyright notice and this permission notice appear in all copies.

  THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
  ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

/**
   @file pugl_cairo.h
   @brief Declaration of Cairo backend accessor.
*/

#ifndef PUGL_PUGL_CAIRO_H
#define PUGL_PUGL_CAIRO_H

#include "pugl/pugl.h"

PUGL_BEGIN_DECLS

/**
   @defgroup cairo Cairo
   Cairo graphics support.
   @ingroup pugl_c
   @{
*/

/**
   Cairo graphics backend accessor.

   Pass the return value to puglSetBackend() to draw to a view with Cairo.
*/
PUGL_API PUGL_CONST_FUNC const PuglBackend*
puglCairoBackend(void);

/**
   @}
*/

PUGL_END_DECLS

#endif // PUGL_PUGL_CAIRO_H

Fix outdated function reference in Cairo documentation


#ifndef __AUDIO_JACK_EVENTS_H
#define __AUDIO_JACK_EVENTS_H

#define JACK_HEADPHONE		1
#define JACK_MICROPHONE		2
#define JACK_LINEOUT		3
#define JACK_LINEIN		4

#endif /* __AUDIO_JACK_EVENTS_H */

Add jack types to dt-bindings

ASoC: Add jack types to dt-bindings

Adding the jack type to the dt-bindings directory will allow for device
tree files to specify the type of audio jacks that are present for a
board.

Signed-off-by: Dylan Reid <c791bfe44996c1eed9c7149a0c5f12a86d58eb85@chromium.org>
Signed-off-by: Mark Brown <b51b9a92386687a9ac927cebfa0f978adeb8cea5@kernel.org>


#pragma once

#include <Windows.h>

class FakeKeyboard {
public:
    static void SimulateKeypress(unsigned short vk) {
        INPUT input = { 0 };
        input.type = INPUT_KEYBOARD;
        input.ki.wVk = vk;
        input.ki.wScan = 0;
        input.ki.dwFlags = 0;
        input.ki.time = 0;
        input.ki.dwExtraInfo = GetMessageExtraInfo();

        /* key down: */
        SendInput(1, &input, sizeof(INPUT));

        /* key up: */
        input.ki.dwFlags = KEYEVENTF_KEYUP;
        SendInput(1, &input, sizeof(INPUT));
    }
};

#pragma once

#include <Windows.h>

class FakeKeyboard {
public:
    static void SimulateKeypress(unsigned short vk) {
        unsigned int scan = MapVirtualKey(vk, MAPVK_VK_TO_VSC);

        INPUT input[2];

        input[0] = { 0 };
        input[0].type = INPUT_KEYBOARD;
        input[0].ki.wVk = vk;
        input[0].ki.wScan = scan;
        input[0].ki.dwFlags = KEYEVENTF_SCANCODE;
        input[0].ki.time = 0;
        input[0].ki.dwExtraInfo = GetMessageExtraInfo();

        input[1] = { 0 };
        input[1].type = INPUT_KEYBOARD;
        input[1].ki.wVk = vk;
        input[1].ki.wScan = scan;
        input[1].ki.dwFlags = KEYEVENTF_SCANCODE | KEYEVENTF_KEYUP;
        input[1].ki.time = 0;
        input[1].ki.dwExtraInfo = GetMessageExtraInfo();

        UINT result = SendInput(2, input, sizeof(INPUT));
    }
};

Send simulated keystrokes as a single atomic event


/**
 * @file
 *
 * @date Jul 18, 2013
 * @author: Anton Bondarev
 */

#include <kernel/task.h>
#include <kernel/thread.h>
#include <kernel/thread/thread_alloc.h>
#include <hal/arch.h> /*only for arch_idle */

#include <hal/cpu.h>
#include <kernel/cpu/cpu.h>

/*
 * Function, which does nothing. For idle_thread.
 */
static void *idle_run(void *arg) {
	while (true) {
		arch_idle();
	}
	return NULL;
}

struct thread *idle_thread_create(void) {
	struct thread *t;
	sched_priority_t prior;

	if (!(t = thread_alloc())) {
		return NULL;
	}

	thread_init(t, THREAD_FLAG_NOTASK | THREAD_FLAG_SUSPENDED, idle_run, NULL);
	t->task = task_kernel_task();
	t->task->main_thread = t;

	prior = sched_priority_full(t->task->priority, THREAD_PRIORITY_MIN);

	thread_priority_set(t, prior);

	cpu_init(cpu_get_id(), t);

	return t;
}

/**
 * @file
 *
 * @date Jul 18, 2013
 * @author: Anton Bondarev
 */

#include <kernel/task.h>
#include <kernel/thread.h>
#include <err.h>
#include <kernel/thread/thread_alloc.h>
#include <hal/arch.h> /*only for arch_idle */

#include <hal/cpu.h>
#include <kernel/cpu/cpu.h>

/*
 * Function, which does nothing. For idle_thread.
 */
static void *idle_run(void *arg) {
	while (true) {
		arch_idle();
	}
	return NULL;
}

struct thread *idle_thread_create(void) {
	struct thread *t;

	t = thread_create(THREAD_FLAG_NOTASK | THREAD_FLAG_SUSPENDED, idle_run,
			NULL);

	if(err(t)) {
		return NULL;
	}

	t->task = task_kernel_task();
	t->task->main_thread = t;

	thread_priority_init(t, SCHED_PRIORITY_MIN);

	cpu_init(cpu_get_id(), t);

	return t;
}

Rework idle thread a little

thread: Rework idle thread a little


#include "ArduinoHeader.h"
#include <EEPROMex.h>
#include <Logging.h>

// Configuration version to determine data integrity.
#define CONFIG_VERSION "000"

// Size of the configuration block memory pool.
#define CONFIG_MEMORY_SIZE 32

// EEPROM size. Bad things will happen if this isn't set correctly.
#define CONFIG_EEPROM_SIZE EEPROMSizeATmega328

class ConfigurationManager {
    private:
        // Config memory address, used to determine where to read and write data.
        int configuration_address = 0;

        struct Configuration {
            char version[4];
            bool debug;
            uint8_t loop_delay;

            struct {
                uint8_t input_buffer_size;
                uint16_t baud_rate;
            } serial;
        } DEFAULT_CONFIGURATION = {
            CONFIG_VERSION,
            true,
            50,
            {
                50,
                9600
            }
        };

    public:
        Configuration data = DEFAULT_CONFIGURATION;

        ConfigurationManager();
        void load(char* = 0);
        void save(char* = 0);
};

#include "ArduinoHeader.h"
#include <EEPROMex.h>
#include <Logging.h>

// Configuration version to determine data integrity.
#define CONFIG_VERSION "001"

// Size of the configuration block memory pool.
#define CONFIG_MEMORY_SIZE 32

// EEPROM size. Bad things will happen if this isn't set correctly.
#define CONFIG_EEPROM_SIZE EEPROMSizeATmega328

class ConfigurationManager {
    private:
        // Config memory address, used to determine where to read and write data.
        int configuration_address = 0;

        struct Configuration {
            char version[4];
            bool debug;
            uint16_t loop_delay;

            struct {
                uint8_t input_buffer_size;
                uint32_t baud_rate;
            } serial;
        } DEFAULT_CONFIGURATION = {
            CONFIG_VERSION,
            true,
            50,
            {
                50,
                9600
            }
        };

    public:
        Configuration data = DEFAULT_CONFIGURATION;

        ConfigurationManager();
        void load(char* = 0);
        void save(char* = 0);
};

Allow for loop delays up to 2^4 ms.
Allow for baud rates up to 2^32.

Signed-off-by: Kalman Olah <aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d@kalmanolah.net>


#include <string.h>

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

#ifdef __cplusplus
extern "C" {
#endif

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

}

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

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

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

#ifdef __cplusplus
}
#endif

#include <string.h>

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

#ifdef __cplusplus
extern "C" {
#endif

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

}

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

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

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

#ifdef __cplusplus
}
#endif

Fix typo in the commit a5312c77.

Fix typo in the commit a5312c77.


/*-
 * Copyright 1998 Juniper Networks, Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	$FreeBSD$
 */

#ifndef PAM_MOD_MISC_H
#define PAM_MOD_MISC_H

#include <sys/cdefs.h>

/* Options */
#define PAM_OPT_DEBUG			0x01
#define PAM_OPT_NO_WARN			0x02
#define PAM_OPT_USE_FIRST_PASS		0x04
#define	PAM_OPT_TRY_FIRST_PASS		0x08
#define PAM_OPT_USE_MAPPED_PASS		0x10
#define PAM_OPT_ECHO_PASS		0x20

__BEGIN_DECLS
int	 pam_get_pass(pam_handle_t *, const char **, const char *, int);
int	 pam_prompt(pam_handle_t *, int, const char *, char **);
int	 pam_std_option(int *, const char *);
__END_DECLS

#endif

Build structure for contribified Linux-PAM, plus some home-grown
modules for FreeBSD's standard authentication methods.  Although
the Linux-PAM modules are present in the contrib tree, we don't
use any of them.

The main library "libpam" is composed of sources taken from three
places.  First are the standard Linux-PAM libpam sources from the
contrib tree.  Second are the Linux-PAM "libpam_misc" sources, also
from the contrib tree.  In Linux these form a separate library.
But as Mike Smith pointed out to me, that seems pointless, so I
have combined them into the libpam library.  Third are some additional
sources from the "src/lib/libpam" tree with some common functions
that make it easier to write modules.  Those I wrote myself.

This work has been donated to FreeBSD by Juniper Networks, Inc.


#ifndef CONFIG_H_INCLUDED
#define CONFIG_H_INCLUDED

#define DBVERSION	"0.0.5"
#define IDXVERSION	"0.0.5"

#endif // CONFIG_H_INCLUDED

#ifndef CONFIG_H_INCLUDED
#define CONFIG_H_INCLUDED

#define DBVERSION	"0.0.5"
#define IDXVERSION	"0.0.5"

#define INITDB		"i1"

#endif // CONFIG_H_INCLUDED

Set default database to i1

Set default database to i1


static inline uint32_t hash_func_string(const char* key)
{
	uint32_t hash = 0;
	int c;
	while ((c = *key++) != 0)
		hash = c + (hash << 6) + (hash << 16) - hash;
	return hash;
}

static inline uint32_t hash_func_string(const char* key)
{
	uint32_t hash = 0;
	uint32_t c;
	while ((c = (uint32_t)*key++) != 0)
		hash = c + (hash << 6u) + (hash << 16u) - hash;
	return hash;
}

Correct signedness to prevent some warnings.


#ifndef BITCOINADDRESSVALIDATOR_H
#define BITCOINADDRESSVALIDATOR_H

#include <QValidator>

/** Base48 entry widget validator.
   Corrects near-miss characters and refuses characters that are no part of base48.
 */
class BitcoinAddressValidator : public QValidator
{
    Q_OBJECT

public:
    explicit BitcoinAddressValidator(QObject *parent = 0);

    State validate(QString &input, int &pos) const;

    static const int MaxAddressLength = 35;
};

#endif // BITCOINADDRESSVALIDATOR_H

#ifndef BITCOINADDRESSVALIDATOR_H
#define BITCOINADDRESSVALIDATOR_H

#include <QValidator>

/** Base58 entry widget validator.
   Corrects near-miss characters and refuses characters that are not part of base58.
 */
class BitcoinAddressValidator : public QValidator
{
    Q_OBJECT

public:
    explicit BitcoinAddressValidator(QObject *parent = 0);

    State validate(QString &input, int &pos) const;

    static const int MaxAddressLength = 35;
};

#endif // BITCOINADDRESSVALIDATOR_H

Fix typo in a comment: it's base58, not base48.


#ifndef QGC_CONFIGURATION_H
#define QGC_CONFIGURATION_H

#include <QString>

/** @brief Polling interval in ms */
#define SERIAL_POLL_INTERVAL 4

/** @brief Heartbeat emission rate, in Hertz (times per second) */
#define MAVLINK_HEARTBEAT_DEFAULT_RATE 1
#define WITH_TEXT_TO_SPEECH 1

// If you need to make an incompatible changes to stored settings, bump this version number
// up by 1. This will caused store settings to be cleared on next boot.
#define QGC_SETTINGS_VERSION 2

#define QGC_APPLICATION_NAME "QGroundControl"
#define QGC_ORG_NAME "QGroundControl.org"
#define QGC_ORG_DOMAIN "org.qgroundcontrol"

#define QGC_APPLICATION_VERSION_MAJOR 2
#define QGC_APPLICATION_VERSION_MINOR 1

// The following #definess can be overriden from the command line so that automated build systems can
// add additional build identification.

// Only comes from command line
//#define QGC_APPLICATION_VERSION_COMMIT "..."

#ifndef QGC_APPLICATION_VERSION_BUILDNUMBER
#define QGC_APPLICATION_VERSION_BUILDNUMBER 0
#endif

#ifndef QGC_APPLICATION_VERSION_BUILDTYPE
#define QGC_APPLICATION_VERSION_BUILDTYPE "(Developer Build)"
#endif

#endif // QGC_CONFIGURATION_H

#ifndef QGC_CONFIGURATION_H
#define QGC_CONFIGURATION_H

#include <QString>

/** @brief Polling interval in ms */
#define SERIAL_POLL_INTERVAL 4

/** @brief Heartbeat emission rate, in Hertz (times per second) */
#define MAVLINK_HEARTBEAT_DEFAULT_RATE 1
#define WITH_TEXT_TO_SPEECH 1

// If you need to make an incompatible changes to stored settings, bump this version number
// up by 1. This will caused store settings to be cleared on next boot.
#define QGC_SETTINGS_VERSION 2

#define QGC_APPLICATION_NAME "QGroundControl"
#define QGC_ORG_NAME "QGroundControl.org"
#define QGC_ORG_DOMAIN "org.qgroundcontrol"

#define QGC_APPLICATION_VERSION_MAJOR 2
#define QGC_APPLICATION_VERSION_MINOR 2

// The following #definess can be overriden from the command line so that automated build systems can
// add additional build identification.

// Only comes from command line
//#define QGC_APPLICATION_VERSION_COMMIT "..."

#ifndef QGC_APPLICATION_VERSION_BUILDNUMBER
#define QGC_APPLICATION_VERSION_BUILDNUMBER 0
#endif

#ifndef QGC_APPLICATION_VERSION_BUILDTYPE
#define QGC_APPLICATION_VERSION_BUILDTYPE "(Developer Build)"
#endif

#endif // QGC_CONFIGURATION_H

Bump minor version to 2

Bump minor version to 2

Prepping for stable 2.2 release


/*
 * Copyright (c) 2015 Nathan Osman
 *
 * 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 QHTTPENGINE_QHTTPBASICAUTHPRIVATE_H
#define QHTTPENGINE_QHTTPBASICAUTHPRIVATE_H

#include <QMap>
#include <QObject>

class QHttpBasicAuthPrivate : public QObject
{
    Q_OBJECT

public:

    explicit QHttpBasicAuthPrivate(QObject *parent, const QString &realm);

    const QString &realm;
    QMap<QString, QString> map;
};

#endif // QHTTPENGINE_QHTTPBASICAUTHPRIVATE_H

/*
 * Copyright (c) 2015 Nathan Osman
 *
 * 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 QHTTPENGINE_QHTTPBASICAUTHPRIVATE_H
#define QHTTPENGINE_QHTTPBASICAUTHPRIVATE_H

#include <QMap>
#include <QObject>

class QHttpBasicAuthPrivate : public QObject
{
    Q_OBJECT

public:

    explicit QHttpBasicAuthPrivate(QObject *parent, const QString &realm);

    const QString realm;
    QMap<QString, QString> map;
};

#endif // QHTTPENGINE_QHTTPBASICAUTHPRIVATE_H

Fix runtime bug caused by typo.

Fix runtime bug caused by typo.


/**
 * ---------------------------------------------------------------------------
 * @file   core.h
 * @brief  The package header.
 *
 */
#pragma once

#include "./types.h"
#include "./error.h"
#include "./fault.h"
#include "./trace.h"
#include "./results.h"
#include "./cast.h"
#include "./memory.h"

Add memory module to package header

Add memory module to package header


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

    This file is part of FLINT.

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

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

    You should have received a copy of the GNU General Public License
    along with FLINT; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA

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

    Copyright (C) 2015 Tommy Hofmann

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

#define FMPZ_MOD_POLY_FACTOR_INLINES_C

#define ulong ulongxx /* interferes with system includes */
#include <stdlib.h>
#include <stdio.h>
#undef ulong
#include <gmp.h>
#include "flint.h"
#include "ulong_extras.h"
#include "nmod_poly.h"

void fmpz_mod_poly_factor_get_fmpz_mod_poly(fmpz_mod_poly_t z, fmpz_mod_poly_factor_t fac, slong i)
{
    fmpz_mod_poly_set(z, fac->p + i);
}

Add missing inline for accessing factors in fmpz_mod_poly.


#ifndef INCLUDE_GUARD_CUPY_CUDA_THRUST_H
#define INCLUDE_GUARD_CUPY_CUDA_THRUST_H

#ifndef CUPY_NO_CUDA
#include <thrust/version.h>  // for THRUST_VERSION

namespace cupy {

namespace thrust {

void thrust_sort(int, void *, size_t *, const std::vector<ptrdiff_t>&, intptr_t, void *);
void thrust_lexsort(int, size_t *, void *, size_t, size_t, intptr_t, void *);
void thrust_argsort(int, size_t *, void *, void *, const std::vector<ptrdiff_t>&, intptr_t, void *);

} // namespace thrust

} // namespace cupy

#else // CUPY_NO_CUDA

#define THRUST_VERSION 0

namespace cupy {

namespace thrust {

void thrust_sort(int, void *, size_t *, const std::vector<ptrdiff_t>&, intptr_t, void *) {
}

void thrust_lexsort(int, size_t *, void *, size_t, size_t, intptr_t, void *) {
}

void thrust_argsort(int, size_t *, void *, void *, const std::vector<ptrdiff_t>&, intptr_t, void *) {
}

} // namespace thrust

} // namespace cupy

#endif // #ifndef CUPY_NO_CUDA

#endif // INCLUDE_GUARD_CUPY_CUDA_THRUST_H

#ifndef INCLUDE_GUARD_CUPY_CUDA_THRUST_H
#define INCLUDE_GUARD_CUPY_CUDA_THRUST_H

#ifndef CUPY_NO_CUDA
#include <thrust/version.h>  // for THRUST_VERSION

namespace cupy {

namespace thrust {

void thrust_sort(int, void *, size_t *, const std::vector<ptrdiff_t>&, intptr_t, void *);
void thrust_lexsort(int, size_t *, void *, size_t, size_t, intptr_t, void *);
void thrust_argsort(int, size_t *, void *, void *, const std::vector<ptrdiff_t>&, intptr_t, void *);

} // namespace thrust

} // namespace cupy

#else // CUPY_NO_CUDA

#define THRUST_VERSION 0

namespace cupy {

namespace thrust {

void thrust_sort(...) {
}

void thrust_lexsort(...) {
}

void thrust_argsort(...) {
}

} // namespace thrust

} // namespace cupy

#endif // #ifndef CUPY_NO_CUDA

#endif // INCLUDE_GUARD_CUPY_CUDA_THRUST_H

Apply suggestions from code review

Apply suggestions from code review

Co-authored-by: Masayuki Takagi <bf9e8c96657b7b242831c2b7b7c309e563359b6b@gmail.com>


#include <stdlib.h>
#ifndef __BST_H__
#define __BST_H__
struct BSTNode;
struct BST;
typedef struct BSTNode BSTNode;
typedef struct BST BST;

BST* BST_Create(void);
BSTNode* BSTNode_Create(void* k);
void BST_Inorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Preorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Postorder_Tree_Walk(BST* T, void (f)(void*));
BSTNode* BST_Tree_Search(BST* T, void* k, int (f)(void*, void*));
BSTNode* BST_Iterative_Tree_Search(BST* T, void* k, int (f)(void*, void*));

#endif

#include <stdlib.h>
#ifndef __BST_H__
#define __BST_H__
struct BSTNode;
struct BST;
typedef struct BSTNode BSTNode;
typedef struct BST BST;

BST* BST_Create(void);
BSTNode* BSTNode_Create(void* k);
void BST_Inorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Preorder_Tree_Walk(BST* T, void (f)(void*));
void BST_Postorder_Tree_Walk(BST* T, void (f)(void*));
BSTNode* BST_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*));
BSTNode* BST_Iterative_Tree_Search(BST* T, void* k, int (f)(void*, void*), int (g)(void*, void*));

#endif

Add missing key comparison function parameter

Separate key comparison functions required
    Equality
    Order


#include "list.h"

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

struct List
{
	ListNode* head;
};

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

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

Add List Node creation function implementation


// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
// Radar 8026855

int test (void *src) {
  register int w0 asm ("0");
  // CHECK: call i32 asm "ldr $0, [$1]", "={ax},r,~{dirflag},~{fpsr},~{flags}"(i8* %tmp)
  asm ("ldr %0, [%1]": "=r" (w0): "r" (src));
  return w0;
}

// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
// Radar 8026855

int test (void *src) {
  register int w0 asm ("0");
  // CHECK: call i32 asm "ldr $0, [$1]", "={ax},r,~{dirflag},~{fpsr},~{flags}"(i8*
  asm ("ldr %0, [%1]": "=r" (w0): "r" (src));
  return w0;
}

Rewrite match line to be friendlier to misc buildbots.

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


#ifndef CODETREE_H
#define	CODETREE_H

#include "constants.h"

typedef struct operation{
    char *sign;
    bool isCommunitative;
    bool isAssociative;
    int precedence;
} Operation;

typedef struct node{
    char *name;
    Operation *op;
    struct node *left;
    struct node *right;
    bool isRoot;
    int rank;
    bool isConstant;
} Node;

typedef struct list_item {
    struct list_item *left;
    struct list_item *right;
    Node *data;
} ListItem;

/* functions for tree nodes*/
Operation *newOp(char *sign, int com, int ass, int precedence);
Node *newNode(char *data);
Node *newNodeWithChildren(char *data, Operation *op, Node *left, Node *right);

/* functions for lists */
ListItem * new_list();
ListItem * insert_right(struct list_item *list, Node* data);
ListItem * delete(struct list_item *list);

Node *nodeByName(ListItem* forest, char * name);

#endif	/* CODETREE_H */

Test for new system clock

Test for new system clock