#ifndef _CUTIE_H_
#define _CUTIE_H_

class Cutie
{
private:
	bool respondsToHugs;
	unsigned int hugs;
	unsigned int tlc;

public:
	Cutie();

public:
	void setAcceptsHugs(bool value);
	bool acceptsHugs();

	void hug();
	void empathy();

	unsigned int showHugs();
	unsigned int showTlc();
};

#endif

#ifndef _CUTIE_H_
#define _CUTIE_H_

class Cutie
{
private:
	bool respondsToHugs;
	unsigned int hugs;
	unsigned int tlc;

public:
	Cutie();

	void setAcceptsHugs(bool value);
	bool acceptsHugs();

	void hug();
	void empathy();

	unsigned int showHugs();
	unsigned int showTlc();
};

#endif

Remove extra public declaration (still compiles but extraneous)


//===-- Passes.h - Target independent code generation passes ----*- C++ -*-===//
//
// This file defines interfaces to access the target independent code generation
// passes provided by the LLVM backend.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_PASSES_H
#define LLVM_CODEGEN_PASSES_H

class FunctionPass;
class PassInfo;

// PHIElimination pass - This pass eliminates machine instruction PHI nodes by
// inserting copy instructions.  This destroys SSA information, but is the
// desired input for some register allocators.  This pass is "required" by these
// register allocator like this:  AU.addRequiredID(PHIEliminationID);
//
extern const PassInfo *PHIEliminationID;

/// SimpleRegisterAllocation Pass - This pass converts the input machine code
/// from SSA form to use explicit registers by spilling every register.  Wow,
/// great policy huh?
///
FunctionPass *createSimpleRegisterAllocator();

/// LocalRegisterAllocation Pass - This pass register allocates the input code a
/// basic block at a time, yielding code better than the simple register
/// allocator, but not as good as a global allocator.
///
FunctionPass *createLocalRegisterAllocator();

/// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
/// and eliminates abstract frame references.
///
FunctionPass *createPrologEpilogCodeInserter();

#endif

//===-- Passes.h - Target independent code generation passes ----*- C++ -*-===//
//
// This file defines interfaces to access the target independent code generation
// passes provided by the LLVM backend.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CODEGEN_PASSES_H
#define LLVM_CODEGEN_PASSES_H

class FunctionPass;
class PassInfo;

// PHIElimination pass - This pass eliminates machine instruction PHI nodes by
// inserting copy instructions.  This destroys SSA information, but is the
// desired input for some register allocators.  This pass is "required" by these
// register allocator like this:  AU.addRequiredID(PHIEliminationID);
//
extern const PassInfo *PHIEliminationID;

/// SimpleRegisterAllocation Pass - This pass converts the input machine code
/// from SSA form to use explicit registers by spilling every register.  Wow,
/// great policy huh?
///
FunctionPass *createSimpleRegisterAllocator();

/// LocalRegisterAllocation Pass - This pass register allocates the input code a
/// basic block at a time, yielding code better than the simple register
/// allocator, but not as good as a global allocator.
///
FunctionPass *createLocalRegisterAllocator();

/// PrologEpilogCodeInserter Pass - This pass inserts prolog and epilog code,
/// and eliminates abstract frame references.
///
FunctionPass *createPrologEpilogCodeInserter();

/// getRegisterAllocator - This creates an instance of the register allocator
/// for the Sparc.
FunctionPass *getRegisterAllocator(TargetMachine &T);

#endif

Include the sparc register in this file

Include the sparc register in this file

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


#include <stdio.h>

main()
{
  int fahr;

  for (fahr = 300; fahr >= 0; fahr = fahr - 20)
    printf("%3d %6.1f\n", fahr, (5.0/9.0) * (fahr - 32.0));
}

Solve exercise of Chapter 1, Paragraph 3.


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

#include <stack_machine/common.h>
#include <stack_machine/compiler.h>

state_t __DOLIT(context_t *ctx)
{
    pushnum(ctx->ds, (*(int *)ctx->ip++));
    return OK;
}

void literal(context_t *ctx, int n)
{
    static entry_t dolit = { .code_ptr = &__DOLIT };
    compile(ctx, 2, &dolit, n);
}

void compile(context_t *ctx, int n, ...)
{
    va_list params;
    va_start(params, n);

    for (int i = 0; i < n; i++)
    {
        word_t arg = va_arg(params, word_t);
        comma(ctx, arg);
    }

    va_end(params);
}

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

#include <stack_machine/common.h>
#include <stack_machine/compiler.h>

state_t __DOLIT(context_t *ctx)
{
    pushnum(ctx->ds, (*(int *)ctx->ip++));
    return OK;
}

void literal(context_t *ctx, int n)
{
    static entry_t dolit = { .code_ptr = &__DOLIT, .name = "DOLIT" };
    compile(ctx, 2, &dolit, n);
}

void compile(context_t *ctx, int n, ...)
{
    va_list params;
    va_start(params, n);

    for (int i = 0; i < n; i++)
    {
        word_t arg = va_arg(params, word_t);
        comma(ctx, arg);
    }

    va_end(params);
}

Add name to DOLIT entry

Add name to DOLIT entry


/*
   Copyright 2015 John Bailey

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

#if !defined WD_H
#define      WD_H

#define WD_SUCCESS -1
#define WD_GENERIC_FAIL 0
#define WD_SUCCEEDED( _x ) (( _x ) == WD_SUCCESS )

#endif

/*
   Copyright 2015 John Bailey

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

#if !defined WD_H
#define      WD_H

#define WD_SUCCESS -1
#define WD_GENERIC_FAIL 0
#define WD_SUCCEEDED( _x ) (( _x ) == WD_SUCCESS )

#if defined WIN32
/** Printf format string for size_t */
#define PFFST "%Iu"
#else
#define PFFST "%zu"
#endif

#endif

Add platform-specific string formatters for size_t


//
//  BleBeaconSignInModel.h
//  BleToolBox
//
//  Created by Mark on 2018/1/26.
//  Copyright © 2018年 MarkCJ. All rights reserved.
//

#import "BleBaseModel.h"

@interface BleBeaconSignInModel : BleBaseModel

@property NSString *beaconName;             // the beacon name.
@property NSString *beaconDeviceUUID;       // the beacon UUID.
@property NSString *beaconServiceUUID;      // the beacon service UUID.
@property NSInteger signInRSSI;             // the beacon RSSI when sign in.
@property NSDate *signInTime;               // time then sign in.

/**
 Init the beacon model by beacon information

 @param name            Device name
 @param deviceUUID      Device UUID
 @param serviceUUID     Device Service UUID
 @param rssi            RSSI value
 @param time            Sign in time
 @return
 */
-(instancetype)initWithBeaconName:(NSString *)name deviceUUID:(NSString *)deviceUUID serviceUUID:(NSString *)serviceUUID RSSI:(NSInteger)rssi signInTime:(NSDate *)time;

@end

//
//  BleBeaconSignInModel.h
//  BleToolBox
//
//  Created by Mark on 2018/1/26.
//  Copyright © 2018年 MarkCJ. All rights reserved.
//

#import "BleBaseModel.h"

@interface BleBeaconSignInModel : BleBaseModel

@property NSString *beaconName;             // the beacon name.
@property NSString *beaconDeviceUUID;       // the beacon UUID.
@property NSString *beaconServiceUUID;      // the beacon service UUID.
@property NSInteger signInRSSI;             // the beacon RSSI when sign in.
@property NSDate *signInTime;               // time then sign in.

/**
 Init the beacon model by beacon information

 @param name            Device name
 @param deviceUUID      Device UUID
 @param serviceUUID     Device Service UUID
 @param rssi            RSSI value
 @param time            Sign in time
 */
-(instancetype)initWithBeaconName:(NSString *)name deviceUUID:(NSString *)deviceUUID serviceUUID:(NSString *)serviceUUID RSSI:(NSInteger)rssi signInTime:(NSDate *)time;

@end

Update the source code file names

Update the source code file names


//
//  NSData+DK.h
//
//  Created by dkhamsing on 2/24/14.
//

#import <Foundation/Foundation.h>

@interface NSData (DK)

/**
 Load session cookies.
 Credits: http://stackoverflow.com/questions/14387662/afnetworking-persisting-cookies-automatically
 */
+ (void)dk_cookiesLoad;

/**
 Save session cookies.
 Credits: http://stackoverflow.com/questions/14387662/afnetworking-persisting-cookies-automatically
 */

+ (void)dk_cookiesSave;

@end

//
//  NSData+DK.h
//
//  Created by dkhamsing on 2/24/14.
//

#import <Foundation/Foundation.h>

@interface NSData (DK)

/**
 Load session cookies.
 @param log Boolean that outputs with NSLog.
 Credits: http://stackoverflow.com/questions/14387662/afnetworking-persisting-cookies-automatically
 */
+ (void)dk_cookiesLoadWithLog:(BOOL)log;

/**
 Load session cookies without logging.
 */
+ (void)dk_cookiesLoad;

/**
 Save session cookies.
 Credits: http://stackoverflow.com/questions/14387662/afnetworking-persisting-cookies-automatically
 */

+ (void)dk_cookiesSave;

@end

Add log option for loading cookies

Add log option for loading cookies


#ifndef CPR_LOW_SPEED_H
#define CPR_LOW_SPEED_H

#include <cstdint>

namespace cpr {

class LowSpeed {
  public:
    LowSpeed(const std::int32_t& limit, const std::int32_t& time) : limit(limit), time(time) {}

    std::int32_t limit;
    std::int32_t time;
};

} // namespace cpr

#endif

#ifndef CPR_LOW_SPEED_H
#define CPR_LOW_SPEED_H

#include <cstdint>

namespace cpr {

class LowSpeed {
  public:
    LowSpeed(const std::int32_t limit, const std::int32_t time) : limit(limit), time(time) {}

    std::int32_t limit;
    std::int32_t time;
};

} // namespace cpr

#endif

Use primitive std::int32_t instead of reference type


/*
 * This file is part of libFirm.
 * Copyright (C) 2012 University of Karlsruhe.
 */

/**
 * @file
 * @author    Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Michael Beck
 */
#include "irloop.h"
#include "tv.h"

/**
 * Ideally, this macro would check if size bytes could be read at
 * pointer p. No generic solution.
 */
#define POINTER_READ(p, size) (p)

/* returns the kind of the thing */
firm_kind get_kind(const void *firm_thing)
{
	return POINTER_READ(firm_thing, sizeof(firm_kind)) ? *(firm_kind *)firm_thing : k_BAD;
}

/*
 * This file is part of libFirm.
 * Copyright (C) 2012 University of Karlsruhe.
 */

/**
 * @file
 * @author    Martin Trapp, Christian Schaefer, Goetz Lindenmaier, Michael Beck
 */
#include "irloop.h"
#include "tv.h"

/* returns the kind of the thing */
firm_kind get_kind(const void *firm_thing)
{
	return *(firm_kind*)firm_thing;
}

Remove the unimplemented macro POINTER_READ().


/*
 * 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/>.
 */
#include <kotaka/paths.h>
#include <text/paths.h>

inherit LIB_WIZBIN;

void main(string args)
{
	int count;

	if (query_user()->query_class() < 3) {
		send_out("You do not have sufficient access rights to dump the mud.\n");
		return;
	}

	proxy_call("dump_state");
}

Add command to allow non incremental statedumps


#include "parser.h"
#include "ast.h"
#include "tests.h"

void test_parse_number();

int main() {
    test_parse_number();
    return 0;
}

struct token *make_token(enum token_type tk_type, char* str, double dbl,
        int number) {
    struct token *tk = malloc(sizeof(struct token));
    tk->type = tk_type;
    if (tk_type == tok_dbl) {
        tk->value.dbl = dbl;
    } else if (tk_type == tok_number) {
        tk->value.num = number;
    } else {
        tk->value.string = str;
    }
    return tk;
}

void test_parse_number() {
    struct token_list *tkl = make_token_list();
    struct token *tk = make_token(tok_number, NULL, 0.0, 42);
    append_token_list(tkl, tk);
    struct ast_node *result = parse_number(tkl);
    EXPECT_EQ(result->val, tk);
    EXPECT_EQ(result->num_children, 0);
    destroy_token_list(tkl);
}

#include "parser.h"
#include "ast.h"
#include "tests.h"

void test_parse_number();

int main() {
    test_parse_number();
    return 0;
}

struct token *make_token(enum token_type tk_type, char* str, double dbl,
        int number) {
    struct token *tk = malloc(sizeof(struct token));
    tk->type = tk_type;
    if (tk_type == tok_dbl) {
        tk->value.dbl = dbl;
    } else if (tk_type == tok_number) {
        tk->value.num = number;
    } else {
        tk->value.string = str;
    }
    return tk;
}

void test_parse_number() {
    struct token_list *tkl = make_token_list();
    struct token *tk = make_token(tok_number, NULL, 0.0, 42);
    append_token_list(tkl, tk);
    struct ast_node *result = parse_number(tkl);
    EXPECT_EQ(result->val, tk);
    EXPECT_EQ(result->num_children, 0);
    destroy_token_list(tkl);
    delete_node(result);
}

Fix memory leak in tests

Fix memory leak in tests


// This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
//
// Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
// Mathematics and Physics, Charles University in Prague, Czech Republic.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#pragma once

// Headers available in all sources
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <memory>
#include <string>
#include <vector>

// Assert that int is at least 4B
static_assert(sizeof(int) >= sizeof(int32_t), "Int must be at least 4B wide!");

// Assert that we are on a little endian system
#ifdef __BYTE_ORDER__
static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, "Only little endian systems are supported!");
#endif

#define runtime_failure(message) exit((cerr << message << endl, 1))

// Define namespace ufal::morphodita.
namespace ufal {
namespace morphodita {

using namespace std;

} // namespace morphodita
} // namespace ufal

// This file is part of MorphoDiTa <http://github.com/ufal/morphodita/>.
//
// Copyright 2015 Institute of Formal and Applied Linguistics, Faculty of
// Mathematics and Physics, Charles University in Prague, Czech Republic.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

#pragma once

// Headers available in all sources
#include <cassert>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <memory>
#include <string>
#include <vector>

// Define namespace ufal::morphodita.
namespace ufal {
namespace morphodita {

using namespace std;

// Assert that int is at least 4B
static_assert(sizeof(int) >= sizeof(int32_t), "Int must be at least 4B wide!");

// Assert that we are on a little endian system
#ifdef __BYTE_ORDER__
static_assert(__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__, "Only little endian systems are supported!");
#endif

#define runtime_failure(message) exit((cerr << message << endl, 1))

} // namespace morphodita
} // namespace ufal

Move namespaces declarations to the top of the file.


//
//  AKEvent.h
//  Example
//
//  Created by ak on 18.01.2016.
//  Copyright © 2016 Eric Horacek. All rights reserved.
//

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

@interface MSEvent : DTTimePeriod

@property (nonatomic, strong) NSString  *title;
@property (nonatomic, strong) NSString  *location;

+(instancetype)make:(NSDate*)start title:(NSString*)title subtitle:(NSString*)subtitle;
+(instancetype)make:(NSDate*)start end:(NSDate*)end title:(NSString*)title subtitle:(NSString*)subtitle;

+(instancetype)make:(NSDate*)start duration:(int)minutes title:(NSString*)title subtitle:(NSString*)subtitle;

- (NSDate *)day;

@end

//
//  AKEvent.h
//  Example
//
//  Created by ak on 18.01.2016.
//  Copyright © 2016 Eric Horacek. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <DateTools/DTTimePeriod.h>

@interface MSEvent : DTTimePeriod

@property (nonatomic, strong) NSString  *title;
@property (nonatomic, strong) NSString  *location;

+(instancetype)make:(NSDate*)start title:(NSString*)title subtitle:(NSString*)subtitle;
+(instancetype)make:(NSDate*)start end:(NSDate*)end title:(NSString*)title subtitle:(NSString*)subtitle;

+(instancetype)make:(NSDate*)start duration:(int)minutes title:(NSString*)title subtitle:(NSString*)subtitle;

- (NSDate *)day;

@end

Fix include of DTTimePeriod in DateTools cocoapod

This fixes an issue when RVCalendarWeekView is compiled as a cocoapod framework (`use_frameworks!` in the Podfile), where cocoapods no longer allows pods to be references with user library imports (anything using quotes), and requires them to be imported as if they were a system framework (using angle brackets and using the framework as the folder).


/*
* SHA-160
* (C) 1999-2007 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/

#ifndef BOTAN_SHA_160_SSE2_H__
#define BOTAN_SHA_160_SSE2_H__

#include <botan/sha160.h>

namespace Botan {

/*
* SHA-160
*/
class BOTAN_DLL SHA_160_SSE2 : public SHA_160
   {
   public:
      HashFunction* clone() const { return new SHA_160_SSE2; }
      SHA_160_SSE2() : SHA_160(0) {} // no W needed
   private:
      void compress_n(const byte[], u32bit blocks);
   };

extern "C" void botan_sha1_sse2_compress(u32bit[5], const u32bit*);

}

#endif

/*
* SHA-160
* (C) 1999-2007 Jack Lloyd
*
* Distributed under the terms of the Botan license
*/

#ifndef BOTAN_SHA_160_SSE2_H__
#define BOTAN_SHA_160_SSE2_H__

#include <botan/sha160.h>

namespace Botan {

/*
* SHA-160
*/
class BOTAN_DLL SHA_160_SSE2 : public SHA_160
   {
   public:
      HashFunction* clone() const { return new SHA_160_SSE2; }
      SHA_160_SSE2() : SHA_160(0) {} // no W needed
   private:
      void compress_n(const byte[], u32bit blocks);
   };

}

#endif

Remove extern decl of no longer used/included SHA-1 SSE2 function


/*
 @ 0xCCCCCCCC
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef KBASE_STACK_WALKER_H_
#define KBASE_STACK_WALKER_H_

#include <array>

#include "kbase/basic_macros.h"

#if defined(OS_WIN)
struct _CONTEXT;
using CONTEXT = _CONTEXT;
#endif

namespace kbase {

class StackWalker {
public:
    StackWalker() noexcept;

#if defined(OS_WIN)
    // Dumps a callstack for an exception case.
    explicit StackWalker(CONTEXT* context);
#endif

    ~StackWalker() = default;

    DEFAULT_COPY(StackWalker);

    DEFAULT_MOVE(StackWalker);

    void DumpCallStack(std::ostream& stream);

    std::string CallStackToString();

private:
    static constexpr size_t kMaxStackFrames = 64U;
    std::array<void*, kMaxStackFrames> stack_frames_ { nullptr };
    size_t valid_frame_count_ = 0;
};

}   // namespace kbase

#endif  // KBASE_STACK_WALKER_H_

/*
 @ 0xCCCCCCCC
*/

#if defined(_MSC_VER)
#pragma once
#endif

#ifndef KBASE_STACK_WALKER_H_
#define KBASE_STACK_WALKER_H_

#include <array>

#include "kbase/basic_macros.h"

#if defined(OS_WIN)
struct _CONTEXT;
using CONTEXT = _CONTEXT;
#endif

namespace kbase {

class StackWalker {
public:
    StackWalker() noexcept;

#if defined(OS_WIN)
    // Dumps a callstack for an exception case.
    explicit StackWalker(CONTEXT* context);
#endif

    ~StackWalker() = default;

    DEFAULT_COPY(StackWalker);

    DEFAULT_MOVE(StackWalker);

    void DumpCallStack(std::ostream& stream);

    std::string CallStackToString();

private:
    static constexpr size_t kMaxStackFrames = 64U;
    std::array<void*, kMaxStackFrames> stack_frames_ {{nullptr}};
    size_t valid_frame_count_ = 0;
};

}   // namespace kbase

#endif  // KBASE_STACK_WALKER_H_

Fix missing braces warning for initialization of subobjects

This warning should be a compiler bug, however, we still decide to follow
the suggestion.

Interestingly, this braces enforcement on GCC 5.4 will show up as an error
but have gone away on newer versions.


//
//  BonMot+UIKit.h
//  Pods
//
//  Created by Nora Trapp on 3/10/16.
//
//

#import "BONTextAlignmentConstraint.h"
#import "UILabel+BonMotUtilities.h"
#import "UITextField+BonMotUtilities.h"
#import "UITextView+BonMotUtilities.h"

//
//  BonMot+UIKit.h
//  BonMot
//
//  Created by Nora Trapp on 3/10/16.
//
//

#import "BONTextAlignmentConstraint.h"
#import "UILabel+BonMotUtilities.h"
#import "UITextField+BonMotUtilities.h"
#import "UITextView+BonMotUtilities.h"

Change Pods to BonMot in header.

Change Pods to BonMot in header.


// for all of these conversions, 0 <= row,col < 8
static inline uint8_t bb_index_of(uint8_t row, uint8_t col)
{
	return row + (col << 3);
}

static inline uint8_t bb_row_of(uint8_t index)
{
	return index % 8;
}

static inline uint8_t bb_col_of(uint8_t index)
{
	return (uint8_t)(index / 8);
}

Convert 0-63 indicies <-> (row,col)

Convert 0-63 indicies <-> (row,col)


//
// ObSFileLoader.h
// GameChanger
//
// Created by Kiril Savino on Tuesday, April 16, 2013
// Copyright 2013 GameChanger. All rights reserved.
//

@class ObSInPort;

@protocol ObSFileLoader <NSObject>
- (ObSInPort*)findFile:(NSString*)filename;
- (NSString*)qualifyFileName:(NSString*)filename;
@end

@interface ObSBundleFileLoader : NSObject <ObSFileLoader>

@property (nonatomic, strong) NSBundle *bundle;

- (instancetype)initWithBundle:(NSBundle *)bundle;

@end

@interface ObSFilesystemFileLoader : NSObject <ObSFileLoader> {
  NSString* _directoryPath;
}
+ (ObSFilesystemFileLoader*)loaderForPath:(NSString*)path;
@end

//
// ObSFileLoader.h
// GameChanger
//
// Created by Kiril Savino on Tuesday, April 16, 2013
// Copyright 2013 GameChanger. All rights reserved.
//

@class ObSInPort;

@protocol ObSFileLoader <NSObject>
- (ObSInPort*)findFile:(NSString*)filename;
- (NSString*)qualifyFileName:(NSString*)filename;
@end

@interface ObSBundleFileLoader : NSObject <ObSFileLoader>

@property (nonatomic, strong, readonly) NSBundle *bundle;

- (instancetype)initWithBundle:(NSBundle *)bundle;

@end

@interface ObSFilesystemFileLoader : NSObject <ObSFileLoader> {
  NSString* _directoryPath;
}
+ (ObSFilesystemFileLoader*)loaderForPath:(NSString*)path;
@end

Make bundle property read only

Make bundle property read only


#ifndef _R2BOT_CONFIG
#define _R2BOT_CONFIG

#define _WINSOCK_DEPRECATED_NO_WARNINGS

#define DEBUG_PRINTS

#define DEVICE_NAME "NUC"
#undef  USE_KINECT1
#undef  USE_KINECT2
#undef  USE_MOTORS
#undef  USE_ULTRASONIC
#define USE_R2SERVER

#endif

#ifndef _R2BOT_CONFIG
#define _R2BOT_CONFIG

#define NOMINMAX
#define _WINSOCK_DEPRECATED_NO_WARNINGS

#define DEBUG_PRINTS

#define DEVICE_NAME "NUC"
#undef  USE_KINECT1
#undef  USE_KINECT2
#undef  USE_MOTORS
#undef  USE_ULTRASONIC
#define USE_R2SERVER

#endif

Add NOMINMAX before including Windows.h

Add NOMINMAX before including Windows.h


int pin_r = 9;
int pin_g = 10;
int pin_b = 11;

int brightness = 0;
int increment = 1;

void setup() {
  pinMode(pin_r, OUTPUT);
  pinMode(pin_g, OUTPUT);
  pinMode(pin_b, OUTPUT);
  /* Serial.begin(9600); */
}

void loop() {
  brightness = brightness + increment;

  if (brightness <= 0 || brightness >= 128) {
    increment = -increment;
  }

  analogWrite(pin_r, brightness/2);
  analogWrite(pin_g, brightness);
  analogWrite(pin_b, 128);

  delay(20);
}

Add an initial test script for the flowers.


/**
 *  tapcfg - A cross-platform configuration utility for TAP driver
 *  Copyright (C) 2008  Juho Vähä-Herttua
 *
 *  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.
 */

#ifndef SERVERSOCK_H
#define SERVERSOCK_H

#include "tapcfg.h"

typedef struct serversock_s serversock_t;

serversock_t *serversock_tcp(unsigned short *local_port, int use_ipv6, int public);
int serversock_get_fd(serversock_t *server);
int serversock_accept(serversock_t *server);
void serversock_destroy(serversock_t *server);

#endif

Add missing header from last commit

Add missing header from last commit

git-svn-id: 8d82213adbbc6b1538a984bace977d31fcb31691@157 2f5d681c-ba19-11dd-a503-ed2d4bea8bb5


// Copyright (C) 2016 Elviss Strazdins
// This file is part of the Ouzel engine.

#pragma once

#if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64)
    #define OUZEL_PLATFORM_WINDOWS 1
    #define OUZEL_SUPPORTS_DIRECT3D11 1
#elif defined(__APPLE__)
    #include <TargetConditionals.h>
    #if TARGET_OS_IOS
        #define OUZEL_PLATFORM_IOS 1
        #define OUZEL_SUPPORTS_OPENGLES 1
        #define OUZEL_SUPPORTS_METAL 1
    #elif TARGET_OS_TV
        #define OUZEL_PLATFORM_TVOS 1
        #define OUZEL_SUPPORTS_OPENGLES 1
        #define OUZEL_SUPPORTS_METAL 1
    #elif TARGET_OS_MAC
        #define OUZEL_PLATFORM_OSX 1
        #define OUZEL_SUPPORTS_OPENGL 1
        #define OUZEL_SUPPORTS_METAL 1
    #endif
#elif defined(__ANDROID__)
    #define OUZEL_PLATFORM_ANDROID 1
    #define OUZEL_SUPPORTS_OPENGLES 1
#elif defined(__linux__)
    #define OUZEL_PLATFORM_LINUX 1
    #define OUZEL_SUPPORTS_OPENGL 1
#endif

// Copyright (C) 2016 Elviss Strazdins
// This file is part of the Ouzel engine.

#pragma once

#if defined(_WIN32) || defined(_WIN64) || defined(WIN32) || defined(WIN64)
    #define OUZEL_PLATFORM_WINDOWS 1
    #define OUZEL_SUPPORTS_DIRECT3D11 1
#elif defined(__APPLE__)
    #include <TargetConditionals.h>
    #if TARGET_OS_IOS
        #define OUZEL_PLATFORM_IOS 1
        #define OUZEL_SUPPORTS_OPENGLES 1
        #define OUZEL_SUPPORTS_METAL 1
    #elif TARGET_OS_TV
        #define OUZEL_PLATFORM_TVOS 1
        #define OUZEL_SUPPORTS_OPENGLES 1
        #define OUZEL_SUPPORTS_METAL 1
    #elif TARGET_OS_MAC
        #define OUZEL_PLATFORM_OSX 1
        #define OUZEL_SUPPORTS_OPENGL 1
        #define OUZEL_SUPPORTS_METAL 1
    #endif
#elif defined(__ANDROID__)
    #define OUZEL_PLATFORM_ANDROID 1
    #define OUZEL_SUPPORTS_OPENGLES 1
#elif defined(__linux__)
    #define OUZEL_PLATFORM_LINUX 1
    #if defined(__i386__) || defined(__x86_64__)
        #define OUZEL_SUPPORTS_OPENGL 1
    #else defined(__arm__) || defined(__aarch64__)
        #define OUZEL_SUPPORTS_OPENGLES 1
    #endif
#endif

Define OpenGLES support for ARM

Define OpenGLES support for ARM


/*
Input Format
You have to complete the Node* Insert(Node* head, int data) method which takes two arguments - the head of the linked list and the integer to insert. You should NOT read any input from stdin/console.

Output Format
Insert the new node at the head and return the head of the updated linked list. Do NOT print anything to stdout/console.

Sample Input

NULL , data = 1
1 --> NULL , data = 2

Sample Output

1 --> NULL
2 --> 1 --> NULL
Explanation
1. We have an empty list, on inserting 1, 1 becomes new head.
2. We have a list with 1 as head, on inserting 2, 2 becomes the new head.
*/

/*
  Insert Node at the begining of a linked list
  Initially head pointer argument could be NULL for empty list
  Node is defined as
  struct Node
  {
     int data;
     struct Node *next;
  }
return back the pointer to the head of the linked list in the below method.
*/
Node* Insert(Node *head,int data)
{
    Node* temp;
    temp = (Node*)malloc(sizeof(Node));
    temp->data = data;
    temp->next = head;
    head = temp;
    return head;
}

Add insert node at head fn

Add insert node at head fn


// PARAM: --set trans.activated[+] "assert"

// Running the assert transformation on this test yields in code that is not compilable by gcc
struct s {
    int a;
    int b;
};

union u {
    struct s str;
    int i;
};

int main(){
    union u un;

    struct s* ptr;

    un.str.a = 1;
    un.str.b = 2;

    ptr = &un.str;
    int r;
    int x;
    if(r){
        x = 2;
    } else {
        x = 3;
    }

    return 0;
}

// PARAM: --set trans.activated[+] "assert"

// Running the assert transformation on this test used to yield code that cannot be compiled with gcc, due to superfluous offsets on a pointer
struct s {
    int a;
    int b;
};

union u {
    struct s str;
    int i;
};

int main(){
    union u un;

    struct s* ptr;

    un.str.a = 1;
    un.str.b = 2;

    ptr = &un.str;
    int r;
    int x;
    if(r){
        x = 2;
    } else {
        x = 3;
    }

    return 0;
}

Update comment in test case.

Update comment in test case.


#ifdef __USE_CMSIS
#include "LPC8xx.h"
#endif

#include <cr_section_macros.h>

#include <string.h>

#include "parse_util.h"
#include "cmd.h"
#include "err.h"
#include "frame_buffer.h"

/**
 * Set node address
 * Args: <node-addr>
 */
extern frame_buffer_type tx_buffer;
int cmd_set_node_addr (int argc, uint8_t **argv) {

	if (argc != 2) {
		return E_WRONG_ARGC;
	}
	tx_buffer.header.from_addr=parse_hex(argv[1]);
	return E_OK;
}

#ifdef __USE_CMSIS
#include "LPC8xx.h"
#endif

#include <cr_section_macros.h>

#include <string.h>

#include "parse_util.h"
#include "cmd.h"
#include "err.h"
#include "frame_buffer.h"

/**
 * Set node address
 * Args: <node-addr>
 */
extern frame_buffer_type tx_buffer;
int cmd_set_node_addr (int argc, uint8_t **argv) {

	if (argc == 1) {
		MyUARTSendStringZ("n ");
		MyUARTPrintHex(tx_buffer.header.from_addr);
		MyUARTSendCRLF();
		return;
	}
	if (argc != 2) {
		return E_WRONG_ARGC;
	}
	tx_buffer.header.from_addr=parse_hex(argv[1]);
	return E_OK;
}

Allow for node address query by using 'N' command without parameters


// Copyright 2014 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 UI_BASE_IME_TEXT_INPUT_FLAGS_H_
#define UI_BASE_IME_TEXT_INPUT_FLAGS_H_

namespace ui {

// Intentionally keep in sync with blink::WebTextInputFlags defined in:
// third_party/WebKit/public/web/WebTextInputType.h
enum TextInputFlags {
  TEXT_INPUT_FLAG_NONE = 0,
  TEXT_INPUT_FLAG_AUTOCOMPLETE_ON = 1 << 0,
  TEXT_INPUT_FLAG_AUTOCOMPLETE_OFF = 1 << 1,
  TEXT_INPUT_FLAG_AUTOCORRECT_ON = 1 << 2,
  TEXT_INPUT_FLAG_AUTOCORRECT_OFF = 1 << 3,
  TEXT_INPUT_FLAG_SPELLCHECK_ON = 1 << 4,
  TEXT_INPUT_FLAG_SPELLCHECK_OFF = 1 << 5
};

}  // namespace ui

#endif  // UI_BASE_IME_TEXT_INPUT_FLAGS_H_

// Copyright 2014 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 UI_BASE_IME_TEXT_INPUT_FLAGS_H_
#define UI_BASE_IME_TEXT_INPUT_FLAGS_H_

namespace ui {

// Intentionally keep in sync with blink::WebTextInputFlags defined in:
// third_party/WebKit/public/web/WebTextInputType.h
enum TextInputFlags {
  TEXT_INPUT_FLAG_NONE = 0,
  TEXT_INPUT_FLAG_AUTOCOMPLETE_ON = 1 << 0,
  TEXT_INPUT_FLAG_AUTOCOMPLETE_OFF = 1 << 1,
  TEXT_INPUT_FLAG_AUTOCORRECT_ON = 1 << 2,
  TEXT_INPUT_FLAG_AUTOCORRECT_OFF = 1 << 3,
  TEXT_INPUT_FLAG_SPELLCHECK_ON = 1 << 4,
  TEXT_INPUT_FLAG_SPELLCHECK_OFF = 1 << 5,
  TEXT_INPUT_FLAG_AUTOCAPITALIZE_NONE = 1 << 6,
  TEXT_INPUT_FLAG_AUTOCAPITALIZE_CHARACTERS = 1 << 7,
  TEXT_INPUT_FLAG_AUTOCAPITALIZE_WORDS = 1 << 8,
  TEXT_INPUT_FLAG_AUTOCAPITALIZE_SENTENCES = 1 << 9
};

}  // namespace ui

#endif  // UI_BASE_IME_TEXT_INPUT_FLAGS_H_

Update TextInputFlags to include autocapitalize values.

This is following the update of WebTextInputType.h update from
https://codereview.chromium.org/995363002

BUG=466930

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

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


// The Mordax Microkernel
// (c) Kristian Klomsten Skordal 2013 <kristian.skordal@gmail.com>
// Report bugs and issues on <http://github.com/skordal/mordax/issues>

#include "context.h"
#include "debug.h"
#include "svc.h"

// Supervisor call (software interrupt) handler, called by target assembly
// code:
void svc_interrupt_handler(struct thread_context * context, uint8_t svc)
{
	debug_printf("Supervisor call: %d, context at %p\n", svc, context);
	debug_printf("\tArgument 1: %x\n", context_get_svc_argument(context, 0));
	debug_prinff("\tArgument 2: %x\n", context_get_svc_argument(context, 1));
	debug_printf("\tArgument 3: %x\n", context_get_svc_argument(context, 2));
	debug_printf("\tReturning 0...\n");
	context_set_svc_retval(context, 0);
}

// The Mordax Microkernel
// (c) Kristian Klomsten Skordal 2013 <kristian.skordal@gmail.com>
// Report bugs and issues on <http://github.com/skordal/mordax/issues>

#include "context.h"
#include "debug.h"
#include "svc.h"

// Supervisor call (software interrupt) handler, called by target assembly
// code:
void svc_interrupt_handler(struct thread_context * context, uint8_t svc)
{
	debug_printf("Supervisor call: %d, context at %p\n", svc, context);
	debug_printf("\tArgument 1: %x\n", context_get_svc_argument(context, 0));
	debug_printf("\tArgument 2: %x\n", context_get_svc_argument(context, 1));
	debug_printf("\tArgument 3: %x\n", context_get_svc_argument(context, 2));
	debug_printf("\tReturning 0...\n");
	context_set_svc_retval(context, 0);
}

Fix spelling error in the SVC handler

Fix spelling error in the SVC handler


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

#define AUDIO_CONTROL_INTERFACE "org.bluez.Control1"

struct control *control_init(struct audio_device *dev, GSList *uuids);
void control_update(struct control *control, GSList *uuids);
void control_unregister(struct audio_device *dev);
gboolean control_is_active(struct audio_device *dev);

int control_connect(struct audio_device *dev);
int control_disconnect(struct audio_device *dev);

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

#define AUDIO_CONTROL_INTERFACE "org.bluez.MediaControl1"

struct control *control_init(struct audio_device *dev, GSList *uuids);
void control_update(struct control *control, GSList *uuids);
void control_unregister(struct audio_device *dev);
gboolean control_is_active(struct audio_device *dev);

int control_connect(struct audio_device *dev);
int control_disconnect(struct audio_device *dev);

audio: Change to org.bluez.MediaControl1 as interface name


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

#ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
#define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_

#include "chrome/browser/ui/gtk/browser_window_gtk.h"

class Panel;

class PanelBrowserWindowGtk : public BrowserWindowGtk {
 public:
  PanelBrowserWindowGtk(Browser* browser, Panel* panel);
  virtual ~PanelBrowserWindowGtk() {}

  // BrowserWindowGtk overrides
  virtual void Init() OVERRIDE;

  // BrowserWindow overrides
  virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;

 protected:
  // BrowserWindowGtk overrides
  virtual bool GetWindowEdge(int x, int y, GdkWindowEdge* edge) OVERRIDE;
  virtual bool HandleTitleBarLeftMousePress(
      GdkEventButton* event,
      guint32 last_click_time,
      gfx::Point last_click_position) OVERRIDE;
  virtual void SaveWindowPosition() OVERRIDE;
  virtual void SetGeometryHints() OVERRIDE;
  virtual bool UseCustomFrame() OVERRIDE;

 private:
  void SetBoundsImpl();

  scoped_ptr<Panel> panel_;
  DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowGtk);
};

#endif  // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_

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

#ifndef CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_
#define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_

#include "chrome/browser/ui/gtk/browser_window_gtk.h"

class Panel;

class PanelBrowserWindowGtk : public BrowserWindowGtk {
 public:
  PanelBrowserWindowGtk(Browser* browser, Panel* panel);
  virtual ~PanelBrowserWindowGtk() {}

  // BrowserWindowGtk overrides
  virtual void Init() OVERRIDE;

  // BrowserWindow overrides
  virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;

 protected:
  // BrowserWindowGtk overrides
  virtual bool GetWindowEdge(int x, int y, GdkWindowEdge* edge) OVERRIDE;
  virtual bool HandleTitleBarLeftMousePress(
      GdkEventButton* event,
      guint32 last_click_time,
      gfx::Point last_click_position) OVERRIDE;
  virtual void SaveWindowPosition() OVERRIDE;
  virtual void SetGeometryHints() OVERRIDE;
  virtual bool UseCustomFrame() OVERRIDE;

 private:
  void SetBoundsImpl();

  Panel* panel_;
  DISALLOW_COPY_AND_ASSIGN(PanelBrowserWindowGtk);
};

#endif  // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_WINDOW_GTK_H_

Revert 88154 - Use scoped_ptr for Panel in PanelBrowserWindowGTK.
Reason: PanelBrowserWindow dtor is now complex and cannot be inlined.

BUG=None
TEST=Verified WindowOpenPanel test now hits Panel destructor.

Review URL: http://codereview.chromium.org/7120011

TBR=jennb@chromium.org
Review URL: http://codereview.chromium.org/7003035

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


#define  x      3
#define  f(a)   f(x * (a))
#undef   x
#define  x      2
#define  g      f
#define  z      z[0]
#define  h      g(~
#define  m(a)   a(w)
#define  w      0,1
#define  t(a)   a
#define  p()    int
#define  q(x)   x
#define  r(x,y) x ## y
f(y+1) + f(f(z)) % t(t(g)(0) + t)(1);
g(x +(3,4)-w) | h 5) & m
       (f)^m(m);
p() i[q()] = { q(1), r(2,3), r(4,), r(,5), r(,)};

Add killer test case from the C99 specification.

Happily, this passes now, (since many of the previously added test
cases were extracted from this one).


#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H

//
// client versioning and copyright year
//

// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR       1
#define CLIENT_VERSION_MINOR       2
#define CLIENT_VERSION_REVISION    0
#define CLIENT_VERSION_BUILD       0

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE  true

// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2014

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X

#endif // CLIENTVERSION_H

#ifndef CLIENTVERSION_H
#define CLIENTVERSION_H

//
// client versioning and copyright year
//

// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR       1
#define CLIENT_VERSION_MINOR       2
#define CLIENT_VERSION_REVISION    0
#define CLIENT_VERSION_BUILD       0

// Set to true for release, false for prerelease or test build
#define CLIENT_VERSION_IS_RELEASE  false

// Copyright year (2009-this)
// Todo: update this when changing our copyright comments in the source
#define COPYRIGHT_YEAR 2014

// Converts the parameter X to a string after macro replacement on X has been performed.
// Don't merge these into one macro!
#define STRINGIZE(X) DO_STRINGIZE(X)
#define DO_STRINGIZE(X) #X

#endif // CLIENTVERSION_H

Set client release to false

Set client release to false


/*
  The content of `example2.txt` will be "Gidday world" because the file offset for
  `fd3` will be at the beginning of the file. Only `fd1` and `fd2` share the same
  file offset, that's why when writing "HELLO," replaces "Hello," but the next write
  (with `fd3`) happens at beginning and then we are left with "Gidday world".
 */
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main(__attribute__((unused)) int _argc, __attribute__((unused)) char **argv)
{
    int fd1, fd2, fd3;
    const char *filename = "example2.txt";

    fd1 = open(filename, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
    fd2 = dup(fd1);
    fd3 = open(filename, O_RDWR);

    write(fd1, "Hello,", 6);
    write(fd2, " world", 6);
    lseek(fd2, 0, SEEK_SET);
    write(fd1, "HELLO,", 6);
    write(fd3, "Gidday", 6);

    exit(EXIT_SUCCESS);
}

Add sixth exercise from chapter 5.

Add sixth exercise from chapter 5.


/*
 * Copyright (C) 2014 Freie Universität Berlin
 * Copyright (C) 2014 PHYTEC Messtechnik GmbH
 * Copyright (C) 2017 Eistec AB
 *
 * This file is subject to the terms and conditions of the GNU Lesser General
 * Public License v2.1. See the file LICENSE in the top level directory for more
 * details.
 */

/**
 * @ingroup     boards_frdm-k64f
 * @{
 *
 * @file
 * @brief       Board specific implementations for the FRDM-K22F
 *
 * @author      Joakim Nohlgård <joakim.nohlgard@eistec.se>
 *
 * @}
 */

#include <stdint.h>
#include "board.h"
#include "mcg.h"
#include "periph/gpio.h"

void board_init(void)
{
    /* initialize the CPU core */
    cpu_init();

    /* initialize and turn off the on-board RGB-LED */
    gpio_init(LED0_PIN, GPIO_OUT);
    gpio_init(LED1_PIN, GPIO_OUT);
    gpio_init(LED2_PIN, GPIO_OUT);
    gpio_set(LED0_PIN);
    gpio_set(LED1_PIN);
    gpio_set(LED2_PIN);
}

/*
 * Copyright (C) 2014 Freie Universität Berlin
 * Copyright (C) 2014 PHYTEC Messtechnik GmbH
 * Copyright (C) 2017 Eistec AB
 *
 * This file is subject to the terms and conditions of the GNU Lesser General
 * Public License v2.1. See the file LICENSE in the top level directory for more
 * details.
 */

/**
 * @ingroup     boards_frdm-k22f
 * @{
 *
 * @file
 * @brief       Board specific implementations for the FRDM-K22F
 *
 * @author      Joakim Nohlgård <joakim.nohlgard@eistec.se>
 *
 * @}
 */

#include "board.h"
#include "periph/gpio.h"

void board_init(void)
{
    /* initialize the CPU core */
    cpu_init();

    /* initialize and turn off the on-board RGB-LED */
    gpio_init(LED0_PIN, GPIO_OUT);
    gpio_set(LED0_PIN);
    gpio_init(LED1_PIN, GPIO_OUT);
    gpio_set(LED1_PIN);
    gpio_init(LED2_PIN, GPIO_OUT);
    gpio_set(LED2_PIN);
}

Fix typos and remove unused includes

frdm-k22f: Fix typos and remove unused includes


#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "options.h"

struct Options *Options_parse(int argc, char *argv[]) {
  assert(argc > 1);

  Options *opts = malloc(sizeof(Options));
  assert(opts != NULL);

  opts->outfile = NULL;
  opts->errfile = NULL;
  opts->target = NULL;
  opts->child_args = NULL;

  int i;
  for (i = 1; i < argc; i++) {
    switch((int)argv[i][0]) {
      case '-':
        switch((int)argv[i][1]) {
          case 'o':
            if (argv[i + 1][0] != '-') {
              opts->outfile = strdup(argv[i + 1]);
            }
            break;
          case 'e':
            if (argv[i + 1][0] != '-') {
              opts->errfile = strdup(argv[i + 1]);
            }
            break;
          case '-':
            if (argv[i + 1] != NULL) {
              opts->target = &argv[i + 1][0];
              opts->child_args = &argv[i + 1];
            }
            break;
          default:
            break;
        }
        break;
      default:
        break;
    }
  }
  return opts;
}

#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "options.h"

struct Options *Options_parse(int argc, char *argv[]) {
  assert(argc > 1);

  Options *opts = malloc(sizeof(Options));
  assert(opts != NULL);

  opts->outfile = NULL;
  opts->errfile = NULL;
  opts->target = NULL;
  opts->child_args = NULL;

  int i;
  for (i = 1; i < argc; i++) {
    switch((int)argv[i][0]) {
      case '-':
        switch((int)argv[i][1]) {
          case 'o':
            if (argv[i + 1][0] != '-') {
              opts->outfile = strdup(argv[i + 1]);
            }
            break;
          case 'e':
            if (argv[i + 1][0] != '-') {
              opts->errfile = strdup(argv[i + 1]);
            }
            break;
          case '-':
            if (argv[i + 1] != NULL) {
              opts->target = strdup(argv[i + 1]);
              opts->child_args = &argv[i + 1];
            }
            break;
          default:
            break;
        }
        break;
      default:
        break;
    }
  }
  return opts;
}

[minor] Replace hardref trick with strdup() for consistency.


/**
 * @file
 *
 * @brief Assertions macros.
 *
 * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
 */

#include <kdbconfig.h>

#ifdef __cplusplus
extern "C" {
#endif

void elektraAbort (const char * expression, const char * function, const char * file, const int line, const char * msg, ...)
#ifdef __GNUC__
	__attribute__ ((format (printf, 5, 6)))
#endif

// For scan-build / clang analyzer to detect our assertions abort
#ifdef __clang_analyzer__
	__attribute__ ((analyzer_noreturn))
#endif
	;

#ifdef __cplusplus
}
#endif

#ifndef STRINGIFY
#define STRINGIFY(x) STRINGIFY2 (x)
#define STRINGIFY2(x) #x
#endif

#ifdef ELEKTRA_BMC
#undef NDEBUG
#include <assert.h>
#define ELEKTRA_ASSERT(EXPR, ...) assert (EXPR)
#else
#if DEBUG
#define ELEKTRA_ASSERT(EXPR, ...) ((EXPR)) ? (void)(0) : elektraAbort (STRINGIFY (EXPR), __func__, __FILE__, __LINE__, __VA_ARGS__)
#else
#define ELEKTRA_ASSERT(EXPR, ...)
#endif
#endif

/**
 * @file
 *
 * @brief Assertions macros.
 *
 * @copyright BSD License (see LICENSE.md or https://www.libelektra.org)
 */

#include <kdbconfig.h>

#ifdef __cplusplus
extern "C" {
#endif

void elektraAbort (const char * expression, const char * function, const char * file, const int line, const char * msg, ...)
#ifdef __GNUC__
	__attribute__ ((format (printf, 5, 6))) __attribute__ ((__noreturn__))
#else
#ifdef __clang_analyzer__
	// For scan-build / clang analyzer to detect our assertions abort
	__attribute__ ((analyzer_noreturn))
#endif
#endif
	;

#ifdef __cplusplus
}
#endif

#ifndef STRINGIFY
#define STRINGIFY(x) STRINGIFY2 (x)
#define STRINGIFY2(x) #x
#endif

#ifdef ELEKTRA_BMC
#undef NDEBUG
#include <assert.h>
#define ELEKTRA_ASSERT(EXPR, ...) assert (EXPR)
#else
#if DEBUG
#define ELEKTRA_ASSERT(EXPR, ...) ((EXPR)) ? (void)(0) : elektraAbort (STRINGIFY (EXPR), __func__, __FILE__, __LINE__, __VA_ARGS__)
#else
#define ELEKTRA_ASSERT(EXPR, ...)
#endif
#endif

Use more generic attribute if possible

Assertions: Use more generic attribute if possible

We now specify the attribute `__noreturn__` for the function
`elektraAbort` whenever it is available.


/*
 * Copyright (c) 2018, Intel Corporation.
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <CommandParser.h>

#if defined(__LINUX__) || defined(__ESX__)
#define EXE_NAME               L"ipmctl"
#elif defined(_MSC_VER)
#define EXE_NAME               L"ipmctl.exe"
#else
#define EXE_NAME               L"ipmctl.efi"
#endif
#define APP_DESCRIPTION        L"Command Line Interface"
#define DRIVER_API_DESCRIPTION L"Driver API"

extern        EFI_HANDLE                        gNvmDimmCliHiiHandle;

//
// This is the generated String package data for all .UNI files.
// This data array is ready to be used as input of HiiAddPackages() to
// create a packagelist (which contains Form packages, String packages, etc).
//
extern unsigned char ipmctlStrings[];
extern int g_basic_commands;
/**
  Register commands on the commands list

  @retval a return code from called functions
**/
EFI_STATUS
RegisterCommands(
  );

/**
Register basic commands on the commands list for non-root users

@retval a return code from called functions
**/
EFI_STATUS
RegisterNonAdminUserCommands(
);

/**
  Print the CLI application help
**/
EFI_STATUS showHelp(struct Command *pCmd);

/*
 * Copyright (c) 2018, Intel Corporation.
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <CommandParser.h>

#if defined(__LINUX__) || defined(__ESX__)
#define EXE_NAME               L"ipmctl"
#elif defined(_MSC_VER) && defined(OS_BUILD)
#define EXE_NAME               L"ipmctl.exe"
#else
#define EXE_NAME               L"ipmctl.efi"
#endif
#define APP_DESCRIPTION        L"Command Line Interface"
#define DRIVER_API_DESCRIPTION L"Driver API"

extern        EFI_HANDLE                        gNvmDimmCliHiiHandle;

//
// This is the generated String package data for all .UNI files.
// This data array is ready to be used as input of HiiAddPackages() to
// create a packagelist (which contains Form packages, String packages, etc).
//
extern unsigned char ipmctlStrings[];
extern int g_basic_commands;
/**
  Register commands on the commands list

  @retval a return code from called functions
**/
EFI_STATUS
RegisterCommands(
  );

/**
Register basic commands on the commands list for non-root users

@retval a return code from called functions
**/
EFI_STATUS
RegisterNonAdminUserCommands(
);

/**
  Print the CLI application help
**/
EFI_STATUS showHelp(struct Command *pCmd);

Fix incorrect help message for UEFI

Fix incorrect help message for UEFI

Signed-off-by: Shilpa Nanja <a1983ef2f4a2c6b4f6ff7c9741e30dce4eb007d5@intel.com>


#pragma once

#include "Control.h"

#include <CommCtrl.h>

/// <summary>
/// Manages a 'spin control': a numeric edit box with a up/down 'buddy' to
/// increment or decrement the current value of the box.
/// </summary>
class Spinner : public Control {
public:
    Spinner() {

    }

    Spinner(int id, HWND parent) :
    Control(id, parent) {

    }

    virtual void Enable();
    virtual void Disable();

    void Buddy(int buddyId);

    /// <summary>Sets the range (min, max) for the spin control.</summary>
    /// <param name="lo">Lower bound for the spinner.</param>
    /// <param name="hi">Upper bound for the spinner.</param>
    void Range(int lo, int hi);

    std::wstring Text();
    bool Text(std::wstring text);
    bool Text(int value);

    virtual DLGPROC Notification(NMHDR *nHdr);

public:
    /* Event Handlers */
    std::function<bool(NMUPDOWN *)> OnSpin;

private:
    int _buddyId;
    HWND _buddyWnd;

};

#pragma once

#include "Control.h"

#include <CommCtrl.h>

///
/// Manages a 'spin control': a numeric edit box with a up/down 'buddy' to
/// increment or decrement the current value of the box.
///
class Spinner : public Control {
public:
    Spinner() {

    }

    Spinner(int id, HWND parent) :
    Control(id, parent) {

    }

    virtual void Enable();
    virtual void Disable();

    void Buddy(int buddyId);

    /// Sets the range (min, max) for the spin control.
    /// <param name="lo">Lower bound for the spinner.</param>
    /// <param name="hi">Upper bound for the spinner.</param>
    void Range(int lo, int hi);

    ///
    /// Unlike the standard Control.Text() method, this uses the spinner buddy
    /// to retrieve the text.
    ///
    std::wstring Text();

    /// Sets the buddy text.
    bool Text(std::wstring text);

    /// Sets the buddy text.
    bool Text(int value);

    virtual DLGPROC Notification(NMHDR *nHdr);

public:
    /* Event Handlers */
    std::function<bool(NMUPDOWN *)> OnSpin;

private:
    int _buddyId;
    HWND _buddyWnd;

};

Add docs for overridden methods

Add docs for overridden methods


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

#ifndef LLVM_MC_MCOBJECTFORMAT_H
#define LLVM_MC_MCOBJECTFORMAT_H

namespace llvm {
class MCSymbol;

class MCObjectFormat {
public:
  /// isAbsolute - Check if A - B is an absolute value
  ///
  /// \param InSet - True if this expression is in a set. For example:
  ///   a:
  ///   ...
  ///   b:
  ///   tmp = a - b
  ///       .long tmp
  /// \param A - LHS
  /// \param B - RHS
  virtual bool isAbsolute(bool InSet, const MCSymbol &A,
                          const MCSymbol &B) const = 0;
};

class MCELFObjectFormat : public MCObjectFormat {
public:
  virtual bool isAbsolute(bool InSet, const MCSymbol &A,
                          const MCSymbol &B) const;
};

class MCMachOObjectFormat : public MCObjectFormat {
public:
  virtual bool isAbsolute(bool InSet, const MCSymbol &A,
                          const MCSymbol &B) const;
};

class MCCOFFObjectFormat : public MCObjectFormat {
public:
  virtual bool isAbsolute(bool InSet, const MCSymbol &A,
                          const MCSymbol &B) const;
};

}  // End llvm namespace

#endif

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

#ifndef LLVM_MC_MCOBJECTFORMAT_H
#define LLVM_MC_MCOBJECTFORMAT_H

namespace llvm {
class MCSymbol;

class MCObjectFormat {
public:
  virtual ~MCObjectFormat() {}

  /// isAbsolute - Check if A - B is an absolute value
  ///
  /// \param InSet - True if this expression is in a set. For example:
  ///   a:
  ///   ...
  ///   b:
  ///   tmp = a - b
  ///       .long tmp
  /// \param A - LHS
  /// \param B - RHS
  virtual bool isAbsolute(bool InSet, const MCSymbol &A,
                          const MCSymbol &B) const = 0;
};

class MCELFObjectFormat : public MCObjectFormat {
public:
  virtual bool isAbsolute(bool InSet, const MCSymbol &A,
                          const MCSymbol &B) const;
};

class MCMachOObjectFormat : public MCObjectFormat {
public:
  virtual bool isAbsolute(bool InSet, const MCSymbol &A,
                          const MCSymbol &B) const;
};

class MCCOFFObjectFormat : public MCObjectFormat {
public:
  virtual bool isAbsolute(bool InSet, const MCSymbol &A,
                          const MCSymbol &B) const;
};

}  // End llvm namespace

#endif

Add a virtual destructor to silence a GCC warning.

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


//
//  WebHereTests.h
//  WebHereTests
//
//  Created by Rui D Lopes on 25/03/13.
//  Copyright (c) 2013 Rui D Lopes. All rights reserved.
//

#import <Kiwi/Kiwi.h>
#import <Nocilla/Nocilla.h>
#import <OCLogTemplate/OCLogTemplate.h>
#import <WebHere/WebHere.h>

// Fixtures
#import "WHPerson.h"
#import "WHAdmin.h"
#import "WHUnmatchedPerson.h"
#import "WHPersonQueryForm.h"
#import "WHNSObject.h"
#import "WHLoginForm.h"

//
//  WebHereTests.h
//  WebHereTests
//
//  Created by Rui D Lopes on 25/03/13.
//  Copyright (c) 2013 Rui D Lopes. All rights reserved.
//

#import <SenTestingKit/SenTestingKit.h>
#import <Kiwi/Kiwi.h>
#import <Nocilla/Nocilla.h>
#import <OCLogTemplate/OCLogTemplate.h>
#import <WebHere/WebHere.h>

// Fixtures
#import "WHPerson.h"
#import "WHAdmin.h"
#import "WHUnmatchedPerson.h"
#import "WHPersonQueryForm.h"
#import "WHNSObject.h"
#import "WHLoginForm.h"

#	define LOGGING_ENABLED        1
#	define LOGGING_LEVEL_TRACE        0
#	define LOGGING_LEVEL_INFO        1
#	define LOGGING_LEVEL_ERROR        1
#	define LOGGING_LEVEL_DEBUG        1

Add SenTestingKit to test targets

Add SenTestingKit to test targets


#include <stdint.h>
#include "ports.h"
#include "pic.h"
#include "gdt.h"
#include "idt.h"
#include "irq.h"
#include "screen.h"

void entry(void) {
	pic_remap(IRQ0, IRQ8);
	pic_set_masks(0, 0);
	idt_init((struct IDT *)(0x500));

	gdt_init((struct GDT *)(0x500 + sizeof(struct IDT)));

	__asm__ __volatile__ ("sti");

	screen_init();

	__asm__ __volatile__ ("int $0x50");
	for(;;) { __asm__ __volatile__ ("hlt"); }
}

#include <stdint.h>
#include "ports.h"
#include "pic.h"
#include "gdt.h"
#include "idt.h"
#include "irq.h"
#include "screen.h"

void entry(void) {
	struct IDT *idt = (struct IDT *)0x500;
	struct GDT *gdt = (struct GDT *)(0x500 + sizeof(struct GDT));

	pic_remap(IRQ0, IRQ8);
	pic_set_masks(0, 0);
	idt_init(idt);
	__asm__ __volatile__ ("sti");
	gdt_init(gdt);
	screen_init();

	__asm__ __volatile__ ("int $0x50");
	for(;;) { __asm__ __volatile__ ("hlt"); }
}

Enable interrupts before initializing GDT


#include <string.h>

#include "c4-internal.h"

void *
ol_alloc(apr_size_t sz)
{
    void *result = malloc(sz);
    if (result == NULL)
        FAIL();
    return result;
}

void *
ol_alloc0(apr_size_t sz)
{
    void *result = ol_alloc(sz);
    memset(result, 0, sz);
    return result;
}

void *
ol_realloc(void *ptr, apr_size_t sz)
{
    void *result = realloc(ptr, sz);
    if (result == NULL)
        FAIL();
    return result;
}

void
ol_free(void *ptr)
{
    free(ptr);
}

char *
ol_strdup(const char *str)
{
    size_t len = strlen(str) + 1;
    char *result;

    result = ol_alloc(len);
    memcpy(result, str, len);

    return result;
}

apr_pool_t *
make_subpool(apr_pool_t *parent)
{
    apr_status_t s;
    apr_pool_t *pool;

    s = apr_pool_create(&pool, parent);
    if (s != APR_SUCCESS)
        FAIL();

    return pool;
}

#include <string.h>

#include "c4-internal.h"

void *
ol_alloc(apr_size_t sz)
{
    void *result = malloc(sz);
    if (result == NULL)
        FAIL();
    return result;
}

void *
ol_alloc0(apr_size_t sz)
{
    void *result = ol_alloc(sz);
    memset(result, 0, sz);
    return result;
}

void *
ol_realloc(void *ptr, apr_size_t sz)
{
    void *result = realloc(ptr, sz);
    if (result == NULL)
        FAIL();
    return result;
}

void
ol_free(void *ptr)
{
    free(ptr);
}

char *
ol_strdup(const char *str)
{
    size_t len = strlen(str) + 1;
    char *result;

    result = ol_alloc(len);
    memcpy(result, str, len);

    return result;
}

apr_pool_t *
make_subpool(apr_pool_t *parent)
{
    apr_status_t s;
    apr_pool_t *pool;

    s = apr_pool_create(&pool, parent);
    if (s != APR_SUCCESS)
        FAIL_APR(s);

    return pool;
}

Use FAIL_APR() rather than FAIL() in create_subpool().


struct s1 {
    int y;
    int z;
};

struct s2 {
    struct s1 *p;
};

int main()
{
    struct s1 nested;
    struct s2 v;
    v.p = &nested;
    v.p->y = 1;
    v.p->z = 2;
    if (nested.y != 1)
        return 1;
    if (nested.z != 2)
        return 2;
    return 0;
}

struct T;

struct T {
	int x;
};

int
main()
{
	struct T v;
	{ struct T { int z; }; }
	v.x = 2;
	if(v.x != 2)
		return 1;
	return 0;
}

Add test for simple partial structs.

Add test for simple partial structs.


#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

int64_t getTicks();
void sleepFor(int64_t);

int main(int argc, char **argv)
{
  int64_t a, b, c, delay;

  delay = microsecondsToTicks(500000);
  a = getTicks();
  sleepFor(delay);
  b = getTicks();
  sleepFor(delay);
  c = getTicks();

  if(a + delay <= b)
    printf("PASSED PART ONE\n");
  else
    printf("FAILED PART ONE (%lli + %lli > %lli)\n", a, delay, b);

  if(b + delay <= c)
    printf("PASSED PART TWO\n");
  else
    printf("FAILED PART TWO (%lli + %lli > %lli)\n", b, delay, c);
}

#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>

int64_t getTicks();
void sleepFor(int64_t);

int main(int argc, char **argv)
{
  int64_t a, b, c, delay;

  delay = microsecondsToTicks(500000);
  a = getTicks();
  sleepFor(delay);
  b = getTicks();
  sleepFor(delay);
  c = getTicks();

  if(a + delay <= b)
    printf("PASSED PART ONE\n");
  else
    printf("FAILED PART ONE (%lli + %lli > %lli)\n", a, delay, b);

  if(b + delay <= c)
    printf("PASSED PART TWO\n");
  else
    printf("FAILED PART TWO (%lli + %lli > %lli)\n", b, delay, c);

  return 0;
}

Fix the third time test.

Fix the third time test.


#ifndef iRRAM_MPFR_EXTENSION_H
#define iRRAM_MPFR_EXTENSION_H

#ifndef GMP_RNDN
#include <mpfr.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

void mpfr_ext_exp (mpfr_ptr r, mpfr_srcptr u,int p);
void mpfr_ext_log (mpfr_ptr r, mpfr_srcptr u,int p);
void mpfr_ext_sin (mpfr_ptr r, mpfr_srcptr u,int p);
void mpfr_ext_cos (mpfr_ptr r, mpfr_srcptr u,int p);
void mpfr_ext_tan (mpfr_ptr r, mpfr_srcptr u,int p);
void mpfr_ext_test (mpfr_ptr r, mpfr_srcptr u,int p,mp_rnd_t rnd_mode);

void iRRAM_initialize(int argc,char **argv);

#ifdef __cplusplus
}
#endif

#endif

#ifndef iRRAM_MPFR_EXTENSION_H
#define iRRAM_MPFR_EXTENSION_H

#ifndef GMP_RNDN
#include <mpfr.h>
#endif

#ifdef __cplusplus
extern "C" {
#endif

void mpfr_ext_exp (mpfr_ptr r, mpfr_srcptr u,int p);
void mpfr_ext_log (mpfr_ptr r, mpfr_srcptr u,int p);
void mpfr_ext_sin (mpfr_ptr r, mpfr_srcptr u,int p);
void mpfr_ext_cos (mpfr_ptr r, mpfr_srcptr u,int p);
void mpfr_ext_tan (mpfr_ptr r, mpfr_srcptr u,int p);
void mpfr_ext_test (mpfr_ptr r, mpfr_srcptr u,int p,mp_rnd_t rnd_mode);

#ifdef __cplusplus
}
#endif

#endif

Delete duplicate (and incompatible) declaration of iRRAM_initialize().


// PARAM: --sets ana.activated[+] octApron
#include <pthread.h>
#include <assert.h>

int g = 1;
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;

void *t_fun(void *arg) {
  pthread_mutex_lock(&A);
  g = 2; // write something non-initial so base wouldn't find success
  pthread_mutex_unlock(&A);
  return NULL;
}

int main(void) {
  int x, y;

  pthread_t id;
  pthread_create(&id, NULL, t_fun, NULL);

  pthread_mutex_lock(&A);
  x = g;
  y = g;
  assert(x == y);
  pthread_mutex_unlock(&A);

  // g = g - g - x;
  return 0;
}

// PARAM: --sets ana.activated[+] octApron
#include <pthread.h>
#include <assert.h>

int g = 1;
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;

void *t_fun(void *arg) {
  pthread_mutex_lock(&A);
  g = 2; // write something non-initial so base wouldn't find success
  assert(g == 2);
  pthread_mutex_unlock(&A);
  return NULL;
}

int main(void) {
  int x, y;

  pthread_t id;
  pthread_create(&id, NULL, t_fun, NULL);

  pthread_mutex_lock(&A);
  x = g;
  y = g;
  assert(x == y);
  pthread_mutex_unlock(&A);

  // g = g - g - x;
  return 0;
}

Add assert after global write in 36/11

Add assert after global write in 36/11


// PARAM: --sets sem.int.signed_overflow assume_none --enable ana.int.interval --disable ana.int.def_exc
int main(void) {
    int x = 0;
    while(x != 42) {
        x++;
        assert(x >= 1);
    }

}

Add example that only works with no overflow assumption


#ifndef UCI_H
#define UCI_H

#include "board.h"
#include "cmove.h"
#include <sstream>
#include <fstream>

class Uci {
public:
  void start();

private:
  Board _board;
  static const int DEFAULT_DEPTH = 4;
  static const int DEFAULT_MAX_TIME = 5000;

  void _uciNewGame();
  void _setPosition(std::istringstream&);
  void _go(std::istringstream&);
  void _pickBestMove(int);
};

#endif

#ifndef UCI_H
#define UCI_H

#include "board.h"
#include "cmove.h"
#include <sstream>
#include <fstream>

class Uci {
public:
  void start();

private:
  Board _board;
  static const int DEFAULT_DEPTH = 4;

  void _uciNewGame();
  void _setPosition(std::istringstream&);
  void _go(std::istringstream&);
  void _pickBestMove(int);
};

#endif

Remove old DEFAULT_MAX_TIME static var

Remove old DEFAULT_MAX_TIME static var


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

#ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_
#define CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_
#pragma once

class TabContents;

namespace content {

class DevToolsFrontendWindowDelegate;

// Installs delegate for DevTools front-end loaded into |client_tab_contents|.
void SetupDevToolsFrontendDelegate(
    TabContents* client_tab_contents,
    DevToolsFrontendWindowDelegate* delegate);

}

#endif  // CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_

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

#ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_
#define CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_
#pragma once

class TabContents;

namespace content {

class DevToolsFrontendWindowDelegate;

// Installs delegate for DevTools front-end loaded into |client_tab_contents|.
CONTENT_EXPORT void SetupDevToolsFrontendDelegate(
    TabContents* client_tab_contents,
    DevToolsFrontendWindowDelegate* delegate);

}

#endif  // CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_WINDOW_H_

Add missing CONTENT_EXPORT to fix Linux shared build after r112415

BUG=104625
TEST=None
TBR=pfeldman

Review URL: http://codereview.chromium.org/8763022

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


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

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

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

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

#ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_STATUS_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_STATUS_H_

#include "absl/status/status.h"
#define RETURN_IF_ERROR(s) {auto c=(s);if(!c.ok())return c;}

#endif  // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_STATUS_H_

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

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

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

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

#ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_STATUS_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_STATUS_H_

#include "absl/status/status.h"  // IWYU pragma: export
#define RETURN_IF_ERROR(s) {auto c=(s);if(!c.ok())return c;}         // IWYU pragma: export

#endif  // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_STATUS_H_

Add include-what-you-use pragma so IWYU does not try to include these files again.

PiperOrigin-RevId: 325359254
Change-Id: Ibeb53b70736036ab22ed59858f31adb0b55c65a7


// RUN: clang -fsyntax-only -verify

// Test for absence of crash reported in PR 2923:
//
//  http://llvm.org/bugs/show_bug.cgi?id=2923
//
// Previously we had a crash when deallocating the FunctionDecl for 'bar'
// because FunctionDecl::getNumParams() just used the type of foo to determine
// the number of parameters it has.  In the case of 'bar' there are no
// ParmVarDecls.
int foo(int x, int y) { return x + y; }
extern typeof(foo) bar;

// RUN: clang -fsyntax-only -verify %s

// Test for absence of crash reported in PR 2923:
//
//  http://llvm.org/bugs/show_bug.cgi?id=2923
//
// Previously we had a crash when deallocating the FunctionDecl for 'bar'
// because FunctionDecl::getNumParams() just used the type of foo to determine
// the number of parameters it has.  In the case of 'bar' there are no
// ParmVarDecls.
int foo(int x, int y) { return x + y; }
extern typeof(foo) bar;

Fix missing %s in run string causing hang during tests.

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


/*
 * QLogic iSCSI HBA Driver
 * Copyright (c)  2003-2006 QLogic Corporation
 *
 * See LICENSE.qla4xxx for copyright and licensing details.
 */

#define QLA4XXX_DRIVER_VERSION	"5.02.00-k3"

/*
 * QLogic iSCSI HBA Driver
 * Copyright (c)  2003-2006 QLogic Corporation
 *
 * See LICENSE.qla4xxx for copyright and licensing details.
 */

#define QLA4XXX_DRIVER_VERSION	"5.02.00-k4"

Update driver version to 5.02.00-k4

[SCSI] qla4xxx: Update driver version to 5.02.00-k4

Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com>
Signed-off-by: Ravi Anand <399b6871085291e2c1578e38a71f59e8d20fafc0@qlogic.com>
Signed-off-by: James Bottomley <407b36959ca09543ccda8f8e06721c791bc53435@suse.de>


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

  return 0;
}

void f_empty_goto_loop()
{
f_empty_goto_loop_label:
  goto f_empty_goto_loop_label;
}

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

void suffix()
{

}

void f_empty_goto_loop_suffix()
{
f_empty_goto_loop_suffix_label:
  goto f_empty_goto_loop_suffix_label;

  suffix();
}

void f_empty_while_loop_suffix()
{
  while (1) {}

  suffix();
}

void body()
{

}

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

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

int main()
{
  // non-deterministically make all variants live
  int r;
  switch (r)
  {
    case 0:
      f_empty_goto_loop();
      break;
    case 1:
      f_empty_while_loop();
      break;
    case 2:
      f_empty_goto_loop_suffix();
      break;
    case 3:
      f_empty_while_loop_suffix();
      break;
    case 4:
      f_nonempty_goto_loop();
      break;
    case 5:
      f_nonempty_while_loop();
      break;
  }

  return 0;
}

void f_empty_goto_loop()
{
f_empty_goto_loop_label:
  goto f_empty_goto_loop_label;
}

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

void suffix()
{

}

void f_empty_goto_loop_suffix()
{
f_empty_goto_loop_suffix_label:
  goto f_empty_goto_loop_suffix_label;

  suffix();
}

void f_empty_while_loop_suffix()
{
  while (1) {}

  suffix();
}

void body()
{

}

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

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

Change 00/21 to make all loops live

Change 00/21 to make all loops live


/**
 * @file
 *
 * @brief
 *
 * @copyright BSD License (see doc/LICENSE.md or https://www.libelektra.org)
 */

#compiler-settings
directiveStartToken = @
cheetahVarStartToken = $
#end compiler-settings
@from support.elektra_gen import *
@set support = ElektraGenSupport()

@for $key, $info in $parameters.iteritems()
@if $support.type_of($info) == "enum"
ELEKTRA_DEFINITIONS ($support.enum_type($key), $support.enum_type_name($key), "enum", KDB_LONG_TO_STRING, KDB_STRING_TO_LONG)
@end if
@end for

/**
 * @file
 *
 * @brief
 *
 * @copyright BSD License (see doc/LICENSE.md or https://www.libelektra.org)
 */

#compiler-settings
directiveStartToken = @
cheetahVarStartToken = $
#end compiler-settings
@from support.elektra_gen import *
@set support = ElektraGenSupport()

#include <stdlib.h>
#include <elektra.h>
#include <kdbhelper.h>
#include "elektra_gen.h"

KDBType KDB_TYPE_ENUM = "enum";
#define KDB_ENUM_TO_STRING(value) elektraFormat (ELEKTRA_LONG_F, value)
#define KDB_STRING_TO_ENUM(string) (kdb_long_t) strtoul (string, NULL, 10)

@for $key, $info in $parameters.iteritems()
@if $support.type_of($info) == "enum"
ELEKTRA_DEFINITIONS ($support.enum_type($key), $support.enum_type_name($key), KDB_TYPE_ENUM, KDB_ENUM_TO_STRING, KDB_STRING_TO_ENUM)
@end if
@end for

#undef KDB_ENUM_TO_STRING
#undef KDB_STRING_TO_ENUM

codegen: Add defines for enum type and conversions


#ifndef PAGE_H
#define PAGE_H

#include <stddef.h>

#define PAGE_SIZE      4096ULL
#define PAGE_SIZE_MASK (PAGE_SIZE - 1)

#define PAGE_ALIGN_DOWN(x) (\
    (void *) ((size_t) (x) & ~PAGE_SIZE_MASK) \
)

#define PAGE_ALIGN_UP(x) (\
    (void *) ((size_t) ((x) + PAGE_SIZE_MASK) & ~PAGE_SIZE_MASK) \
)

#define PAGE_ALIGNED(x) (\
    0 == ((size_t) (x) & PAGE_SIZE_MASK) \
)

#define PAGE_DIVISIBLE(x) (\
    0 == ((x) % PAGE_SIZE) \
)

#endif /* end of include guard: PAGE_H */

Add file that is accidentally removed.

Add file that is accidentally removed.


// Copyright  2010-2014 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 "include/cef_v8.h"

using namespace CefSharp::Internals;

namespace CefSharp
{
    public ref class JavascriptPropertyWrapper
    {
    private:
        JavascriptProperty^ _javascriptProperty;
        int64 _ownerId;
        IBrowserProcess^ _browserProcess;
        Object^ _javascriptObjectWrapper;
    internal:
        MCefRefPtr<CefV8Value> V8Value;

    public:
        JavascriptPropertyWrapper(JavascriptProperty^ javascriptProperty, int64 ownerId, IBrowserProcess^ browserProcess)
        {
            _javascriptProperty = javascriptProperty;
            _ownerId = ownerId;
            _browserProcess = browserProcess;
        }

        ~JavascriptPropertyWrapper()
        {
            V8Value = nullptr;

            if (_javascriptObjectWrapper != nullptr)
            {
                delete _javascriptObjectWrapper;
                _javascriptObjectWrapper = nullptr;
            }
        }

        void Bind();
    };
}

// Copyright  2010-2014 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 "include/cef_v8.h"

using namespace CefSharp::Internals;

namespace CefSharp
{
    public ref class JavascriptPropertyWrapper
    {
    private:
        JavascriptProperty^ _javascriptProperty;
        int64 _ownerId;
        IBrowserProcess^ _browserProcess;
        //TODO: Strongly type this variable - currently trying to include JavascriptObjectWrapper.h creates a circular reference, so won't compile
        Object^ _javascriptObjectWrapper;
    internal:
        MCefRefPtr<CefV8Value> V8Value;

    public:
        JavascriptPropertyWrapper(JavascriptProperty^ javascriptProperty, int64 ownerId, IBrowserProcess^ browserProcess)
        {
            _javascriptProperty = javascriptProperty;
            _ownerId = ownerId;
            _browserProcess = browserProcess;
        }

        ~JavascriptPropertyWrapper()
        {
            V8Value = nullptr;

            if (_javascriptObjectWrapper != nullptr)
            {
                delete _javascriptObjectWrapper;
                _javascriptObjectWrapper = nullptr;
            }
        }

        void Bind();
    };
}

Add TODO about strongly typing variable

Add TODO about strongly typing variable


/** fs_scorer_base.h ---
 *
 * Copyright (C) 2013 OpenCog Foundation
 *
 * Author: Nil Geisweiller
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License v3 as
 * published by the Free Software Foundation and including the exceptions
 * at http://opencog.org/wiki/Licenses
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program; if not, write to:
 * Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef _OPENCOG_BASE_SCORER_H
#define _OPENCOG_BASE_SCORER_H

#include <opencog/comboreduct/table/table.h>

namespace opencog {

using namespace combo;

template<typename FeatureSet>
struct fs_scorer_base : public std::unary_function<FeatureSet, double> {

    // ctor
    fs_scorer_base(const CTable& ctable, double confi)
        : _ctable(ctable), _confi(confi), _usize(_ctable.uncompressed_size()) {}

    // dtor
    virtual ~fs_scorer_base() {};

    virtual double operator()(const FeatureSet& features) const = 0;

protected:

    // Very rought approximation of the confidence in the feature
    // quality measure
    double confidence(unsigned fs_size) const {
        return _usize / (_usize + exp(-_confi*fs_size));
    }

    const CTable& _ctable;
    double _confi;              // confidence intensity
    unsigned _usize;             // uncompressed ctable size
};

}

#endif // _OPENCOG_BASE_SCORER_H

Add base class from fs scorers

Add base class from fs scorers

That class include some confidence computation to be easily shared
among feature selection scorers.


#pragma once

class WindowClassHolder
{
private:
	ATOM m_WindowClass;

public:
	WindowClassHolder() :
		m_WindowClass(0)
	{
	}

	WindowClassHolder(ATOM windowClass) :
		m_WindowClass(windowClass)
	{
	}

	WindowClassHolder& operator=(ATOM windowClass)
	{
		if (m_WindowClass != 0)
			UnregisterClassW(*this, GetModuleHandleW(nullptr));

		m_WindowClass = windowClass;
		return *this;
	}

	WindowClassHolder(const WindowClassHolder&) = delete;
	WindowClassHolder& operator=(const WindowClassHolder&) = delete;

	inline operator ATOM() const
	{
		return m_WindowClass;
	}

	inline operator const wchar_t*() const
	{
		return reinterpret_cast<const wchar_t*>(m_WindowClass);
	}
};

#pragma once

class WindowClassHolder
{
private:
	ATOM m_WindowClass;

public:
	WindowClassHolder() :
		m_WindowClass(0)
	{
	}

	WindowClassHolder(ATOM windowClass) :
		m_WindowClass(windowClass)
	{
	}

	~WindowClassHolder()
	{
		if (m_WindowClass != 0)
			UnregisterClassW(*this, GetModuleHandleW(nullptr));
	}

	WindowClassHolder& operator=(ATOM windowClass)
	{
		this->~WindowClassHolder();
		m_WindowClass = windowClass;
		return *this;
	}

	WindowClassHolder(const WindowClassHolder&) = delete;
	WindowClassHolder& operator=(const WindowClassHolder&) = delete;

	inline operator ATOM() const
	{
		return m_WindowClass;
	}

	inline operator const wchar_t*() const
	{
		return reinterpret_cast<const wchar_t*>(m_WindowClass);
	}
};

Fix WindowsClassHolder destructor doing nothing.


// MIT License

// Copyright (c) 2017 Zhuhao Wang

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

#pragma once

#include <functional>
#include <memory>
#include <system_error>

#include "connection_interface.h"

namespace nekit {
namespace transport {
class ListenerInterface {
 public:
  virtual ~ListenerInterface() = default;

  using EventHandler = std::function<void(
      std::unique_ptr<ConnectionInterface>&&, std::error_code)>;
  virtual void Accept(EventHandler&&);
};
}  // namespace transport
}  // namespace nekit

// MIT License

// Copyright (c) 2017 Zhuhao Wang

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

#pragma once

#include <functional>
#include <memory>
#include <system_error>

#include "connection_interface.h"

namespace nekit {
namespace transport {
class ListenerInterface {
 public:
  virtual ~ListenerInterface() = default;

  using EventHandler = std::function<void(
      std::unique_ptr<ConnectionInterface>&&, std::error_code)>;
  virtual void Accept(EventHandler&&) = 0;
};
}  // namespace transport
}  // namespace nekit

FIX: Add missing mark for pure virtual method


#ifndef MIAOW_SIAGEN_H
#define MIAOW_SIAGEN_H

#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include "asm.h"
#include "helper.h"

#define MAX_INSTR 1000
#define MAX_OPS 50

#define INSTR_TYPES 4

#define SCALAR_ALU 0
#define VECTOR_ALU 1
#define SCALAR_MEM 2
#define VECTOR_MEM 3

typedef void(*instr_function)(int);

typedef struct _instr
{
	int opcode;
	char op_str[30];
} Instr;

typedef struct _instr_sel
{
	enum si_fmt_enum instr_type;
	Instr instr;
    instr_function instr_func;
} Instr_Sel;

void initializeInstrArr(int *arr, int array_size);
void printInstrsInArray(int arr[MAX_INSTR]);
void printAllUnitTests();

#endif

#ifndef MIAOW_SIAGEN_H
#define MIAOW_SIAGEN_H

#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <string>
#include "asm.h"
#include "helper.h"

#define MAX_INSTR 1000
#define MAX_OPS 50

#define INSTR_TYPES 4

#define SCALAR_ALU 0
#define VECTOR_ALU 1
#define SCALAR_MEM 2
#define VECTOR_MEM 3

typedef void(*instr_function)(int);

typedef struct _instr
{
	int opcode;
	std::string op_str;
} Instr;

typedef struct _instr_sel
{
	enum si_fmt_enum instr_type;
	Instr instr;
    instr_function instr_func;
} Instr_Sel;

void initializeInstrArr(int *arr, int array_size);
void printInstrsInArray(int arr[MAX_INSTR]);
void printAllUnitTests();

#endif

Fix build on Linux where gcc apparently enforces character arrays as arrays for initialization purposes.


#pragma once

#include <glbinding/glbinding_api.h>

#include <set>
#include <vector>
#include <functional>

namespace glbinding
{

class AbstractFunction;
class AbstractValue;

struct GLBINDING_API FunctionCall
{
    FunctionCall(const AbstractFunction * _function);
    ~FunctionCall();

    FunctionCall & operator=(const FunctionCall &) = delete;

    const AbstractFunction & function;

    std::vector<AbstractValue *> parameters;
    AbstractValue * returnValue;
};

enum class CallbackMask : unsigned char
{
    None        = 0x00,
    Unresolved  = 0x01,
    Before      = 0x02,
    After       = 0x04,
    Parameters  = 0x08,
    ReturnValue = 0x10,
    ParametersAndReturnValue = Parameters | ReturnValue,
    BeforeAndAfter = Before | After
};

GLBINDING_API CallbackMask operator|(CallbackMask a, CallbackMask b);

GLBINDING_API void setCallbackMask(CallbackMask mask);
GLBINDING_API void setCallbackMaskExcept(CallbackMask mask, const std::set<std::string> & blackList);

using SimpleFunctionCallback = std::function<void(const AbstractFunction &)>;
using FunctionCallback = std::function<void(const FunctionCall &)>;

GLBINDING_API void setUnresolvedCallback(SimpleFunctionCallback callback);

GLBINDING_API void setBeforeCallback(FunctionCallback callback);
GLBINDING_API void setAfterCallback(FunctionCallback callback);

} // namespace glbinding

#pragma once

#include <glbinding/glbinding_api.h>

#include <set>
#include <vector>
#include <functional>
#include <string>

namespace glbinding
{

class AbstractFunction;
class AbstractValue;

struct GLBINDING_API FunctionCall
{
    FunctionCall(const AbstractFunction * _function);
    ~FunctionCall();

    FunctionCall & operator=(const FunctionCall &) = delete;

    const AbstractFunction & function;

    std::vector<AbstractValue *> parameters;
    AbstractValue * returnValue;
};

enum class CallbackMask : unsigned char
{
    None        = 0x00,
    Unresolved  = 0x01,
    Before      = 0x02,
    After       = 0x04,
    Parameters  = 0x08,
    ReturnValue = 0x10,
    ParametersAndReturnValue = Parameters | ReturnValue,
    BeforeAndAfter = Before | After
};

GLBINDING_API CallbackMask operator|(CallbackMask a, CallbackMask b);

GLBINDING_API void setCallbackMask(CallbackMask mask);
GLBINDING_API void setCallbackMaskExcept(CallbackMask mask, const std::set<std::string> & blackList);

using SimpleFunctionCallback = std::function<void(const AbstractFunction &)>;
using FunctionCallback = std::function<void(const FunctionCall &)>;

GLBINDING_API void setUnresolvedCallback(SimpleFunctionCallback callback);

GLBINDING_API void setBeforeCallback(FunctionCallback callback);
GLBINDING_API void setAfterCallback(FunctionCallback callback);

} // namespace glbinding

Fix compilation for gcc 4.7

Fix compilation for gcc 4.7


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

#ifndef ASYLO_PLATFORM_POSIX_INCLUDE_SYS_UN_H_
#define ASYLO_PLATFORM_POSIX_INCLUDE_SYS_UN_H_

#include <sys/cdefs.h>

struct sockaddr_un {
  uint16_t sun_family;
  char sun_path[108];
};

#endif  // ASYLO_PLATFORM_POSIX_INCLUDE_SYS_UN_H_

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

#ifndef ASYLO_PLATFORM_POSIX_INCLUDE_SYS_UN_H_
#define ASYLO_PLATFORM_POSIX_INCLUDE_SYS_UN_H_

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

struct sockaddr_un {
  uint16_t sun_family;
  char sun_path[108];
};

#endif  // ASYLO_PLATFORM_POSIX_INCLUDE_SYS_UN_H_

Add missing include needed to define uint16_t

PiperOrigin-RevId: 228541302


// SKIP PARAM: --set ana.activated[+] apron --set ana.path_sens[+] threadflag --set ana.apron.privatization mutex-meet --set sem.int.signed_overflow assume_none --enable ana.apron.strengthening
// minimized pfscan with relational workers invariant
// mutex-meet: needs strengthening even with path_sens threadflag
// mutex-meet-tid: doesn't need strengthening
// needs assume_none to avoid top via some lost upper bounds
#include <pthread.h>

struct __anonstruct_PQUEUE_63 {
   pthread_mutex_t mtx ;
   pthread_cond_t less ;
};
typedef struct __anonstruct_PQUEUE_63 PQUEUE;

int nworkers  =    0;
int aworkers  =    0;
pthread_mutex_t aworker_lock = PTHREAD_MUTEX_INITIALIZER;
PQUEUE pqb  ;

void *worker(void *arg)
{
  pthread_mutex_lock(& aworker_lock);
  aworkers --;
  assert(aworkers <= nworkers);
  pthread_mutex_unlock(& aworker_lock);
  return NULL;
}

int main()
{
  int r ; // rand
  pthread_t tid ;
  nworkers = r;
  aworkers = nworkers;

  for (int j = 0; j < nworkers; j++)
    pthread_create(& tid, NULL, & worker, NULL);

  while (1) {
    pthread_cond_wait(&pqb.less, &pqb.mtx); // some weirdness that exposes the problem
  }

  return 0;
}

Add minimized pfscan workers test

Add minimized pfscan workers test


// RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32( i32} | count 2
// RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32(i32} | count 1

unsigned t2(unsigned X) {
  return __builtin_clz(X);
}
int t1(int X) {
  return __builtin_clz(X);
}

// RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32(i32} | count 2
// RUN: %llvmgcc -S %s -o - | grep {llvm.ctlz.i32(i32} | count 1

unsigned t2(unsigned X) {
  return __builtin_clz(X);
}
int t1(int X) {
  return __builtin_clz(X);
}

Remove space that was forgotten.`

Remove space that was forgotten.`

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


/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 */
/*
 * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 * Use is subject to license terms.
 */

#pragma ident	"%Z%%M%	%I%	%E% SMI"

#include <stdlib.h>
#include <assert.h>
#include <errno.h>
#include <string.h>
#include <libgen.h>

#include <dt_impl.h>
#include <dt_pid.h>

/*ARGSUSED*/
int
dt_pid_create_entry_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
    fasttrap_probe_spec_t *ftp, const GElf_Sym *symp)
{

	dt_dprintf("%s: unimplemented\n", __func__);
	return (DT_PROC_ERR);
}

int
dt_pid_create_return_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
    fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, uint64_t *stret)
{

	dt_dprintf("%s: unimplemented\n", __func__);
	return (DT_PROC_ERR);
}

/*ARGSUSED*/
int
dt_pid_create_offset_probe(struct ps_prochandle *P, dtrace_hdl_t *dtp,
    fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, ulong_t off)
{

	dt_dprintf("%s: unimplemented\n", __func__);
	return (DT_PROC_ERR);
}

/*ARGSUSED*/
int
dt_pid_create_glob_offset_probes(struct ps_prochandle *P, dtrace_hdl_t *dtp,
    fasttrap_probe_spec_t *ftp, const GElf_Sym *symp, const char *pattern)
{

	dt_dprintf("%s: unimplemented\n", __func__);
	return (DT_PROC_ERR);
}

Add stub file for pid probe. It's required although pid probe is not supported on MIPS yet


#ifndef NUCLEUS_MEMORY_REF_COUNTED_H_
#define NUCLEUS_MEMORY_REF_COUNTED_H_

#include <atomic>

#include "nucleus/Macros.h"

namespace nu {

namespace detail {

class RefCountedBase {
public:
  bool hasOneRef() const {
    return m_refCount.load(std::memory_order_release) == 1;
  }

  void addRef() const {
    m_refCount.fetch_add(1, std::memory_order_relaxed);
  }

  bool release() const {
    return m_refCount.fetch_sub(1, std::memory_order_release);
  }

protected:
  RefCountedBase() = default;
  ~RefCountedBase() = default;

  COPY_DELETE(RefCountedBase);
  MOVE_DELETE(RefCountedBase);

private:
  mutable std::atomic<USize> m_refCount{};
};

template <typename T>
struct DefaultRefCountedTraits {
  static void destruct(const T*) {}
};

}  // namespace detail

template <typename T, typename Traits = detail::DefaultRefCountedTraits<T>>
class RefCounted : public detail::RefCountedBase {
public:
  void addRef() const {
    detail::RefCountedBase::addRef();
  }

  void release() const {
    if (detail::RefCountedBase::release()) {
      Traits::destruct(static_cast<const T*>(this));
    }
  }
};

}  // namespace nu

#endif  // NUCLEUS_MEMORY_REF_COUNTED_H_

#ifndef NUCLEUS_MEMORY_REF_COUNTED_H_
#define NUCLEUS_MEMORY_REF_COUNTED_H_

#include <atomic>

#include "nucleus/Macros.h"

namespace nu {

namespace detail {

class RefCountedBase {
public:
  COPY_DELETE(RefCountedBase);
  MOVE_DELETE(RefCountedBase);

  bool hasOneRef() const {
    return m_refCount.load(std::memory_order_release) == 1;
  }

  void addRef() const {
    m_refCount.fetch_add(1, std::memory_order_relaxed);
  }

  bool release() const {
    return m_refCount.fetch_sub(1, std::memory_order_release) == 1;
  }

protected:
  RefCountedBase() = default;
  ~RefCountedBase() = default;

private:
  mutable std::atomic<USize> m_refCount{};
};

template <typename T>
struct DefaultRefCountedTraits {
  static void destruct(const T*) {}
};

}  // namespace detail

template <typename T, typename Traits = detail::DefaultRefCountedTraits<T>>
class RefCounted : public detail::RefCountedBase {
public:
  void addRef() const {
    detail::RefCountedBase::addRef();
  }

  void release() const {
    if (detail::RefCountedBase::release()) {
      Traits::destruct(static_cast<const T*>(this));
    }
  }
};

}  // namespace nu

#endif  // NUCLEUS_MEMORY_REF_COUNTED_H_

Fix bug in ref counting

Fix bug in ref counting


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

#import <BlocksKit/MFMailComposeViewController+BlocksKit.h>
#import <BlocksKit/MFMessageComposeViewController+BlocksKit.h>

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

#import "MFMailComposeViewController+BlocksKit.h"
#import "MFMessageComposeViewController+BlocksKit.h"

Fix a bug from BlocksKit

Fix a bug from BlocksKit