#pragma once

#include <uk/mman.h>

BEGIN_DECLS

void *mmap(void *addr, size_t length, int prot, int flags,
           int fd, off_t offset);
int munmap(void *addr, size_t length);
int mprotect(void *addr, size_t length, int prot);
int madvise(void *addr, size_t length, int advice);

END_DECLS

#pragma once

#include <sys/types.h>
#include <uk/mman.h>

BEGIN_DECLS

void *mmap(void *addr, size_t length, int prot, int flags,
           int fd, off_t offset);
int munmap(void *addr, size_t length);
int mprotect(void *addr, size_t length, int prot);
int madvise(void *addr, size_t length, int advice);

END_DECLS

Fix missing dependency on sys/types.h

stdinc: Fix missing dependency on sys/types.h


//
// Created by wan on 1/2/16.
//
#include <stdio.h>

int main(void) {
    printf("Input:");
    int a;
    scanf("%d", &a);
    if (2016 % a != 0) {
        printf("No way. Exit.\n");
        return 0;
    }
    int s = 2016;
    printf("2016 = ");
    int flag = 0, b;
    for (b = 1111; b >= 1; b /= 10) {
        int t = a * b;
        for (;;) {
            if (s >= t) {
                if (flag == 0)
                    flag = 1;
                else
                    printf(" + ");
                printf("%d", t);
                s -= t;
            }
            else
                break;
        }
    }
    printf("\n");
    return 0;
}

//
// Created by Hexapetalous on 1/1/16.
//
#include <stdio.h>

int main(void) {
    printf("Input[1]:");
    int a;
    scanf("%d", &a);
    printf("Input[2]:");
    int z;
    scanf("%d", &z);
    if (z % a != 0) {
        printf("No way. Exit.\n");
        return 0;
    }
    int s = z;
    printf("%d = ", z);
    int flag = 0, b;
    for (b = 1; b < s; b = b * 10 + 1)
        ;
    for (b /= 10; b >= 1; b /= 10) {
        int t = a * b;
        for (; s >= t;) {
            if (flag == 0)
                flag = 1;
            else
                printf(" + ");
            printf("%d", t);
            s -= t;
        }
    }
    printf("\n");
    return 0;
}

Support to division every number.

Support to division every number.


#include "scheme.h"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

#ifndef DEFAULT_BOOTFILE_PATH
#  define DEFAULT_BOOTFILE_PATH "./shen.boot"
#endif

static void custom_init(void) {}

int main(int argc, char *argv[]) {
  int status;
  char *bfpath = getenv("SHEN_BOOTFILE_PATH");

  if (bfpath == NULL) {
    bfpath = DEFAULT_BOOTFILE_PATH;
  }

  if (access(bfpath, F_OK) == -1) {
    fprintf(stderr, "ERROR: boot file '%s' doesn't exist or is not readable.\n",
            bfpath);
    exit(1);
  }

  Sscheme_init(NULL);
  Sregister_boot_file(bfpath);
  Sbuild_heap(NULL, custom_init);
  status = Sscheme_start(argc + 1, (const char**)argv - 1);
  Sscheme_deinit();

  exit(status);
}

#include "scheme.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <limits.h>

#ifndef DEFAULT_BOOTFILE_PATH
#  define DEFAULT_BOOTFILE_PATH NULL
#endif

static void custom_init(void) {}

int main(int argc, char *argv[]) {
  int status;
  char *bfpath = getenv("SHEN_BOOTFILE_PATH");

  if (bfpath == NULL) {
    if (DEFAULT_BOOTFILE_PATH != NULL) {
      bfpath = DEFAULT_BOOTFILE_PATH;
    } else {
      char buf[PATH_MAX];
      char *last_slash;

      realpath(argv[0], buf);
      last_slash = strrchr(buf, '/') + 1;
      strlcpy(last_slash, "shen.boot", last_slash - buf);
      bfpath = buf;
    }
  }

  if (access(bfpath, F_OK) == -1) {
    fprintf(stderr, "ERROR: boot file '%s' doesn't exist or is not readable.\n",
            bfpath);
    exit(1);
  }

  Sscheme_init(NULL);
  Sregister_boot_file(bfpath);
  Sbuild_heap(NULL, custom_init);
  status = Sscheme_start(argc + 1, (const char**)argv - 1);
  Sscheme_deinit();

  exit(status);
}

Make it so that if no path for the shen boot file is specified, it is looked at the same directory of the shen-scheme executable


#ifndef EXTRACTOR_VERSION_H_
#define EXTRACTOR_VERSION_H_

#define FREESOUND_EXTRACTOR_VERSION "freesound 2.0"

#endif /* EXTRACTOR_VERSION_H_ */

#ifndef EXTRACTOR_VERSION_H_
#define EXTRACTOR_VERSION_H_

#define FREESOUND_EXTRACTOR_VERSION "freesound 0.5"

#endif /* EXTRACTOR_VERSION_H_ */

Change FreesoundExtractor version to 0.5

After discussion (#582) we decided to keep incrementing 0.4


//  Created by Arkadiusz on 01-04-14.

#import <UIKit/UIKit.h>

/// A UINavigationController subclass allowing the interactive pop gesture when the navigation bar is hidden or a custom back button is used.
@interface AHKNavigationController : UINavigationController

@end

//  Created by Arkadiusz on 01-04-14.

#import <UIKit/UIKit.h>

/// A UINavigationController subclass allowing the interactive pop gesture when the navigation bar is hidden or a custom back button is used.
@interface AHKNavigationController : UINavigationController

- (void)pushViewController:(UIViewController *)viewController
                  animated:(BOOL)animated __attribute__((objc_requires_super));

@end

Add warning when a subclass doesn’t call super on pushViewController:animated:

This method is used for keeping an internal state, so calling super is mandatory.


_CLC_DEF _CLC_OVERLOAD float __clc_ldexp(float, int);

#ifdef cl_khr_fp64
  #pragma OPENCL EXTENSION cl_khr_fp64 : enable
  _CLC_DEF _CLC_OVERLOAD float __clc_ldexp(double, int);
#endif

_CLC_DEF _CLC_OVERLOAD float __clc_ldexp(float, int);

#ifdef cl_khr_fp64
  #pragma OPENCL EXTENSION cl_khr_fp64 : enable
  _CLC_DEF _CLC_OVERLOAD double __clc_ldexp(double, int);
#endif

ldexp: Fix double precision function return type

Fixes ~1200 external calls from nvtpx library.

Reviewer: Jeroen Ketema
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

git-svn-id: e7f1ab7c2a259259587475a3e7520e757882f167@315170 91177308-0d34-0410-b5e6-96231b3b80d8


// Test UndefinedBehaviorSanitizer ld flags.

// RUN: %clang -fcatch-undefined-behavior %s -### -o %t.o 2>&1 \
// RUN:     -target i386-unknown-linux \
// RUN:     --sysroot=%S/Inputs/basic_linux_tree \
// RUN:   | FileCheck --check-prefix=CHECK-LINUX %s
// CHECK-LINUX: "{{.*}}ld{{(.exe)?}}"
// CHECK-LINUX-NOT: "-lc"
// CHECK-LINUX: libclang_rt.ubsan-i386.a"
// CHECK-LINUX: "-lpthread"

Add test for link flags added by -fcatch-undefined-behavior.

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


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

#include "../utf8/utf8.h"

/*
 * Convert UTF-8 string to std::vector<uint32_t>
 */
void utf8to32(const std::string &s, std::vector<uint32_t> &vec) {
	vec.assign(utf8::distance(s.cbegin(), s.cend()), 0);
	utf8::utf8to32(s.cbegin(), s.cend(), vec.data());
}

/*
 * Convert UTF-8 C-string to std::vector<uint32_t>
 */
void utf8to32(char* const s, std::vector<uint32_t> &vec) {
	const size_t len(strlen(s));
	vec.assign(utf8::distance(s, s+len), 0);
	utf8::utf8to32(s, s+len, vec.data());
}

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

#include "../utf8/utf8.h"

/*
 * Convert UTF-8 string to std::vector<uint32_t>
 */
void inline utf8to32(const std::string &s, std::vector<uint32_t> &vec) {
	vec.assign(utf8::distance(s.cbegin(), s.cend()), 0);
	utf8::utf8to32(s.cbegin(), s.cend(), vec.data());
}

/*
 * Convert UTF-8 C-string to std::vector<uint32_t>
 */
void inline utf8to32(char* const s, std::vector<uint32_t> &vec) {
	const size_t len(strlen(s));
	vec.assign(utf8::distance(s, s+len), 0);
	utf8::utf8to32(s, s+len, vec.data());
}

Use inline as a workaround so that the utf8 functions are not exported


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

#ifndef BITCOIN_POLICY_RBF_H
#define BITCOIN_POLICY_RBF_H

#include <txmempool.h>

enum class RBFTransactionState {
    UNKNOWN,
    REPLACEABLE_BIP125,
    FINAL
};

// Determine whether an in-mempool transaction is signaling opt-in to RBF
// according to BIP 125
// This involves checking sequence numbers of the transaction, as well
// as the sequence numbers of all in-mempool ancestors.
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
RBFTransactionState IsRBFOptInEmptyMempool(const CTransaction& tx);

#endif // BITCOIN_POLICY_RBF_H

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

#ifndef BITCOIN_POLICY_RBF_H
#define BITCOIN_POLICY_RBF_H

#include <txmempool.h>

/** The rbf state of unconfirmed transactions */
enum class RBFTransactionState {
    /** Unconfirmed tx that does not signal rbf and is not in the mempool */
    UNKNOWN,
    /** Either this tx or a mempool ancestor signals rbf */
    REPLACEABLE_BIP125,
    /** Neither this tx nor a mempool ancestor signals rbf */
    FINAL,
};

/**
 * Determine whether an unconfirmed transaction is signaling opt-in to RBF
 * according to BIP 125
 * This involves checking sequence numbers of the transaction, as well
 * as the sequence numbers of all in-mempool ancestors.
 *
 * @param tx   The unconfirmed transaction
 * @param pool The mempool, which may contain the tx
 *
 * @return     The rbf state
 */
RBFTransactionState IsRBFOptIn(const CTransaction& tx, const CTxMemPool& pool) EXCLUSIVE_LOCKS_REQUIRED(pool.cs);
RBFTransactionState IsRBFOptInEmptyMempool(const CTransaction& tx);

#endif // BITCOIN_POLICY_RBF_H

Add doxygen comment to IsRBFOptIn

doc: Add doxygen comment to IsRBFOptIn


//
// Toolkit header to include the main headers of the 'AFToolkit' library.
//

#import "AFDefines.h"
#import "AFLogHelper.h"
#import "AFFileHelper.h"
#import "AFPlatformHelper.h"
#import "AFKVO.h"
#import "AFArray.h"
#import "AFMutableArray.h"
#import "NSBundle+Universal.h"
#import "UITableViewCell+Universal.h"
#import "AFDBClient.h"
#import "AFView.h"
#import "AFViewController.h"

//
// Toolkit header to include the main headers of the 'AFToolkit' library.
//

#import "AFDefines.h"
#import "AFLogHelper.h"
#import "AFFileHelper.h"
#import "AFPlatformHelper.h"
#import "AFReachability.h"
#import "AFKVO.h"
#import "AFArray.h"
#import "AFMutableArray.h"
#import "NSBundle+Universal.h"
#import "UITableViewCell+Universal.h"
#import "AFDBClient.h"
#import "AFView.h"
#import "AFViewController.h"

Add Reachability to toolkit header.

Add Reachability to toolkit header.


//===--- RuntimeStubs.h -----------------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// Misc stubs for functions which should be defined in the core standard
// library, but are difficult or impossible to write in Swift at the
// moment.
//
//===----------------------------------------------------------------------===//

#ifndef SWIFT_STDLIB_SHIMS_RUNTIMESTUBS_H_
#define SWIFT_STDLIB_SHIMS_RUNTIMESTUBS_H_

#include "LibcShims.h"

#ifdef __cplusplus
namespace swift { extern "C" {
#endif

SWIFT_BEGIN_NULLABILITY_ANNOTATIONS

__swift_ssize_t
swift_stdlib_readLine_stdin(char * _Nullable * _Nonnull LinePtr);

SWIFT_END_NULLABILITY_ANNOTATIONS

#ifdef __cplusplus
}} // extern "C", namespace swift
#endif

#endif // SWIFT_STDLIB_SHIMS_RUNTIMESTUBS_H_

//===--- RuntimeStubs.h -----------------------------------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LICENSE.txt for license information
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
//
//===----------------------------------------------------------------------===//
//
// Misc stubs for functions which should be defined in the core standard
// library, but are difficult or impossible to write in Swift at the
// moment.
//
//===----------------------------------------------------------------------===//

#ifndef SWIFT_STDLIB_SHIMS_RUNTIMESTUBS_H_
#define SWIFT_STDLIB_SHIMS_RUNTIMESTUBS_H_

#include "LibcShims.h"

#ifdef __cplusplus
namespace swift { extern "C" {
#endif

SWIFT_BEGIN_NULLABILITY_ANNOTATIONS

SWIFT_RUNTIME_STDLIB_INTERFACE
__swift_ssize_t
swift_stdlib_readLine_stdin(char * _Nullable * _Nonnull LinePtr);

SWIFT_END_NULLABILITY_ANNOTATIONS

#ifdef __cplusplus
}} // extern "C", namespace swift
#endif

#endif // SWIFT_STDLIB_SHIMS_RUNTIMESTUBS_H_

Add export attribute to header declaration.


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

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

#include "ems_private.h"

static void
_end_grab_cb(void *data __UNUSED__, const char *filename __UNUSED__)
{
    DBG("End Grab");
    ecore_main_loop_quit();
}

/*============================================================================*
 *                                 Global                                     *
 *============================================================================*/

int main(int argc __UNUSED__, char **argv)
{
    Eina_Module *m;
    char tmp[PATH_MAX];

    void (*grab)(const char *filename, Ems_Media_Type type,
                 void (*Ems_Grabber_End_Cb)(void *data, const char *filename),
                 void *data
                 );

    ems_init(NULL);
    eina_init();
    ecore_init();
    ecore_con_init();
    ecore_con_url_init();

    DBG("%s init", argv[0]);

    if (!argv[1])
    {
        printf("USAGE : %s grabber_name", argv[0]);
        exit(0);
    }

    DBG("Try to load %s", argv[1]);
    DBG("Searh for modules in %s with arch %s", PACKAGE_LIB_DIR "/ems/grabbers", MODULE_ARCH);

    snprintf(tmp, sizeof(tmp), PACKAGE_LIB_DIR"/ems/grabbers/%s/%s/module.so", argv[1], MODULE_ARCH);
    DBG("Complete path module %s", tmp);
    m = eina_module_new(tmp);

    eina_module_load(m);

    grab = eina_module_symbol_get(m, "ems_grabber_grab");
    if (grab)
    {
        DBG("Grab file");
        grab(argv[2],
             1,
             _end_grab_cb, NULL);
    }

    ecore_main_loop_begin();

    eina_module_free(m);

    ems_shutdown();

    return EXIT_SUCCESS;
}

Add test program for easier grabber's tests


#include <stdlib.h>
#include "chip8.h"

chip8_t *
chip8_new(void) {
  chip8_t * self = (chip8_t *) malloc(sizeof(chip8_t));

  /* The first 512 bytes are used by the interpreter. */
  self->program_counter = 0x200;
  self->index_register  = 0;
  self->stack_pointer   = 0;
  self->opcode          = 0;

  return self;
}

void
chip8_free(chip8_t * self) {
  free(self);
}

Define the functions on one line

Define the functions on one line


#ifndef StringUtils_h
#define StringUtils_h

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

namespace CCMessageWindow {
    class Utils {
    public:
        static std::string substringUTF8(const char* str, int from, int length);
        static std::vector<std::string> split(const std::string& input, char delimiter);
        static std::string replace(std::string base, std::string src, std::string dst);
    };
}

#endif /* StringUtils_hpp */

#ifndef StringUtils_h
#define StringUtils_h

#include "cocos2d.h"

namespace CCMessageWindow {
    class Utils {
    public:
        static std::string substringUTF8(const char* str, int from, int length);
        static std::vector<std::string> split(const std::string& input, char delimiter);
        static std::string replace(std::string base, std::string src, std::string dst);
    };
}

#endif /* StringUtils_hpp */

Fix build error on Android

Fix build error on Android


#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef enum {
    UILabelCountingMethodEaseInOut,
    UILabelCountingMethodEaseIn,
    UILabelCountingMethodEaseOut,
    UILabelCountingMethodLinear
} UILabelCountingMethod;

typedef NSString* (^UICountingLabelFormatBlock)(float value);
typedef NSAttributedString* (^UICountingLabelAttributedFormatBlock)(float value);

@interface UICountingLabel : UILabel

@property (nonatomic, strong) NSString *format;
@property (nonatomic, assign) UILabelCountingMethod method;
@property (nonatomic, assign) NSTimeInterval animationDuration;

@property (nonatomic, copy) UICountingLabelFormatBlock formatBlock;
@property (nonatomic, copy) UICountingLabelAttributedFormatBlock attributedFormatBlock;
@property (nonatomic, copy) void (^completionBlock)();

-(void)countFrom:(float)startValue to:(float)endValue;
-(void)countFrom:(float)startValue to:(float)endValue withDuration:(NSTimeInterval)duration;

-(void)countFromCurrentValueTo:(float)endValue;
-(void)countFromCurrentValueTo:(float)endValue withDuration:(NSTimeInterval)duration;

-(void)countFromZeroTo:(float)endValue;
-(void)countFromZeroTo:(float)endValue withDuration:(NSTimeInterval)duration;

- (CGFloat)currentValue;

@end

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, UILabelCountingMethod) {
    UILabelCountingMethodEaseInOut,
    UILabelCountingMethodEaseIn,
    UILabelCountingMethodEaseOut,
    UILabelCountingMethodLinear
};

typedef NSString* (^UICountingLabelFormatBlock)(float value);
typedef NSAttributedString* (^UICountingLabelAttributedFormatBlock)(float value);

@interface UICountingLabel : UILabel

@property (nonatomic, strong) NSString *format;
@property (nonatomic, assign) UILabelCountingMethod method;
@property (nonatomic, assign) NSTimeInterval animationDuration;

@property (nonatomic, copy) UICountingLabelFormatBlock formatBlock;
@property (nonatomic, copy) UICountingLabelAttributedFormatBlock attributedFormatBlock;
@property (nonatomic, copy) void (^completionBlock)();

-(void)countFrom:(float)startValue to:(float)endValue;
-(void)countFrom:(float)startValue to:(float)endValue withDuration:(NSTimeInterval)duration;

-(void)countFromCurrentValueTo:(float)endValue;
-(void)countFromCurrentValueTo:(float)endValue withDuration:(NSTimeInterval)duration;

-(void)countFromZeroTo:(float)endValue;
-(void)countFromZeroTo:(float)endValue withDuration:(NSTimeInterval)duration;

- (CGFloat)currentValue;

@end

Use NS_ENUM instead of enum makes more clear


/* * This file is part of meego-im-framework *
 *
 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * Contact: Nokia Corporation (directui@nokia.com)
 *
 * If you have questions regarding the use of this file, please contact
 * Nokia at directui@nokia.com.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 2.1 as published by the Free Software Foundation
 * and appearing in the file LICENSE.LGPL included in the packaging
 * of this file.
 */

#ifndef CORE_UTILS_H__
#define CORE_UTILS_H__

#include <QString>
#include <QObject>

namespace MaliitTestUtils {

    bool isTestingInSandbox();
    QString getTestPluginPath();
    QString getTestDataPath();
    void waitForSignal(const QObject* object, const char* signal, int timeout);
    void waitAndProcessEvents(int waitTime);
}

#endif // CORE_UTILS_H__

/* * This file is part of meego-im-framework *
 *
 * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * Contact: Nokia Corporation (directui@nokia.com)
 *
 * If you have questions regarding the use of this file, please contact
 * Nokia at directui@nokia.com.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License version 2.1 as published by the Free Software Foundation
 * and appearing in the file LICENSE.LGPL included in the packaging
 * of this file.
 */

#ifndef CORE_UTILS_H__
#define CORE_UTILS_H__

#include <QString>
#include <QObject>

#include "abstractsurfacegroup.h"
#include "abstractsurfacegroupfactory.h"

namespace MaliitTestUtils {

    bool isTestingInSandbox();
    QString getTestPluginPath();
    QString getTestDataPath();
    void waitForSignal(const QObject* object, const char* signal, int timeout);
    void waitAndProcessEvents(int waitTime);

    class TestSurfaceGroup : public Maliit::Server::AbstractSurfaceGroup {
    public:
        TestSurfaceGroup() {}

        Maliit::Plugins::AbstractSurfaceFactory *factory() { return 0; }

        void activate() {}
        void deactivate() {}

        void setRotation(Maliit::OrientationAngle) {}
    };

    class TestSurfaceGroupFactory : public Maliit::Server::AbstractSurfaceGroupFactory {
    public:
        TestSurfaceGroupFactory() {}

        QSharedPointer<Maliit::Server::AbstractSurfaceGroup> createSurfaceGroup()
        {
            return QSharedPointer<Maliit::Server::AbstractSurfaceGroup>(new TestSurfaceGroup);
        }
    };
}

#endif // CORE_UTILS_H__

Add surface server side implementation for tests

Add a TestSurfaceGroup and TestSurfaceGroupFactory class for tests.

RevBy: TrustMe.


/**
 * nlp_exception.h
 * Copyright (C) 2015 Tony Lim <atomictheorist@gmail.com>
 *
 * Distributed under terms of the MIT license.
 */

#ifndef NLP_EXCEPTION_H
#define NLP_EXCEPTION_H
#include <exception>

using namespace std;

namespace NLP
{
    class unimplemented_exc: public exception
    {
        virtual const char* what() const throw()
        {
            return "Unimplemented error.";
        }
    };
} /* NLP */

#endif /* !NLP_EXCEPTION_H */

Add global exception functions to CONFIG


/*********************************** LICENSE **********************************\
*                            Copyright 2017 Morphux                            *
*                                                                              *
*        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 M_TYPES_H
# define M_TYPES_H

/* Generic types */

typedef signed char			s8_t;
typedef signed short		s16_t;
typedef signed int			s32_t;
typedef signed long long	s64_t;

typedef unsigned char		u8_t;
typedef unsigned short		u16_t;
typedef unsigned int		u32_t;
typedef unsigned long long	u64_t;

#endif /* M_TYPES_H */

Fix comment style in mtypes

Fix(Comment): Fix comment style in mtypes


/*
 * Copyright © 2017 AperLambda <aper.entertainment@gmail.com>
 *
 * This file is part of λcommon.
 *
 * Licensed under the MIT license. For more information,
 * see the LICENSE file.
 */

#ifndef LAMBDACOMMON_DOCUMENT_H
#define LAMBDACOMMON_DOCUMENT_H

#include "../lambdacommon.h"
#include <map>

namespace lambdacommon
{
    class LAMBDACOMMON_API Content
    {};

    class LAMBDACOMMON_API Document
    {};
}

#endif //LAMBDACOMMON_DOCUMENT_H

/*
 * Copyright © 2017 AperLambda <aper.entertainment@gmail.com>
 *
 * This file is part of λcommon.
 *
 * Licensed under the MIT license. For more information,
 * see the LICENSE file.
 */

#ifndef LAMBDACOMMON_DOCUMENT_H
#define LAMBDACOMMON_DOCUMENT_H

#include "../lambdacommon.h"
#include <map>

namespace lambdacommon
{
    class LAMBDACOMMON_API Element
    {};

    class LAMBDACOMMON_API Document
    {};
}

#endif //LAMBDACOMMON_DOCUMENT_H

:floppy_disk: Change the Content class to the Element class


/**
 * @file
 *
 * @brief
 *
 * @date 15.01.2013
 * @author Lapshin Alexander
 */
#include <stdio.h>
#include <errno.h>
#include <framework/example/self.h>
#include <kernel/thread/api.h>
#include <kernel/thread/event.h>

#include <util/macro.h>

/**
 * This macro is used to register this example at the system.
 */
EMBOX_EXAMPLE(run);

/** The thread handler function*/
static void *thread_run(void *arg) {
	struct event *event = (struct event *)arg;
	/**waiting until event receives  */
	printf("waiting for event's notifying...\n");
	event_wait(event, SCHED_TIMEOUT_INFINITE);
	printf("event has been received.\n");
	return 0;
}

static int run(int argc, char **argv) {
	struct event sync_event;
	struct thread *thread;

	event_init(&sync_event, "sync_event");
	thread_create(&thread, 0, thread_run, &sync_event);
	/**need some delay here
	 *  because thread should have time to sleep
	 *  within "event_wait" till invoking
	 *  "event_notify" function.
	 */
	sleep(1);
	event_notify(&sync_event);
	thread_join(thread, NULL);

	return ENOERR;
}

Add example for working threads and events


/*
 * Copyright (c) 2012-2016 Israel Jacquez
 * See LICENSE for details.
 *
 * Israel Jacquez <mrkotfw@gmail.com>
 */

#include <stdlib.h>

#include <vdp1.h>
#include <vdp2.h>
#include <vdp2/tvmd.h>
#include <vdp2/vram.h>

#include <cons.h>

void __noreturn
internal_exception_show(const char *buffer)
{
        /* Reset the VDP1 */
        vdp1_init();

        /* Reset the VDP2 */
        vdp2_init();
        vdp2_tvmd_display_res_set(TVMD_INTERLACE_NONE, TVMD_HORZ_NORMAL_A,
            TVMD_VERT_224);
        vdp2_scrn_back_screen_color_set(VRAM_ADDR_4MBIT(0, 0x01FFFE),
            COLOR_RGB555(0, 7, 0));
        vdp2_tvmd_display_set();

        cons_init(CONS_DRIVER_VDP2, 40, 28);
        cons_buffer(buffer);

        vdp2_tvmd_vblank_out_wait();
        vdp2_tvmd_vblank_in_wait();
        vdp2_commit();
        cons_flush();

        abort();
}

/*
 * Copyright (c) 2012-2016 Israel Jacquez
 * See LICENSE for details.
 *
 * Israel Jacquez <mrkotfw@gmail.com>
 */

#include <stdlib.h>

#include <vdp1.h>
#include <vdp2.h>
#include <vdp2/tvmd.h>
#include <vdp2/vram.h>

#include <cons.h>

void __noreturn
internal_exception_show(const char *buffer)
{
        /* Reset the VDP1 */
        vdp1_init();

        /* Reset the VDP2 */
        vdp2_init();
        vdp2_tvmd_display_res_set(TVMD_INTERLACE_NONE, TVMD_HORZ_NORMAL_A,
            TVMD_VERT_224);
        vdp2_scrn_back_screen_color_set(VRAM_ADDR_4MBIT(0, 0x01FFFE),
            COLOR_RGB555(0, 7, 0));

        /* Set sprite to type 0 and set its priority to 0 (invisible) */
        vdp2_sprite_type_set(0);
        vdp2_sprite_priority_set(0, 0);

        vdp2_tvmd_display_set();

        cons_init(CONS_DRIVER_VDP2, 40, 28);
        cons_buffer(buffer);

        vdp2_tvmd_vblank_out_wait();
        vdp2_tvmd_vblank_in_wait();
        vdp2_commit();
        cons_flush();

        abort();
}

Hide VDP1 even if FB hasn't been erased and changed


/* Provide Declarations */

#ifndef NULL
#define NULL 0
#endif

#ifndef __cplusplus
typedef unsigned char bool;
#endif

/* Support for floating point constants */
typedef unsigned long long ConstantDoubleTy;
typedef unsigned int        ConstantFloatTy;

/* Global Declarations */

/* External Global Variable Declarations */

/* Function Declarations */
void __main();
int printf(signed char *, ...);
void testfunc(short l5_s, float l11_X, signed char l3_C, signed long long l9_LL, int l7_I, double l12_D);
void main();

/* Malloc to make sun happy */
extern void * malloc(size_t);

/* Global Variable Declerations */
extern signed char l27_d_LC0[26];

/* Global Variable Definitions and Initialization */
static signed char l27_d_LC0[26] = "%d, %f, %d, %lld, %d, %f\n";

/* Function Bodies */
void testfunc(short l5_s, float l11_X, signed char l3_C, signed long long l9_LL, int l7_I, double l12_D) {
  int l7_reg226;

  l7_reg226 = printf((&(l27_d_LC0[0ll])), ((unsigned )l5_s), ((double )l11_X), ((unsigned )l3_C), l9_LL, l7_I, l12_D);
  return;
}

void main() {

  const ConstantFloatTy FloatConstant0 = 0x3f9f5c29;    /* 1.245 */
  const ConstantDoubleTy FloatConstant1 = 0x432ff973cafa8000;    /* 4.5e+15 */

  __main();
  testfunc(12, (*(float*)&FloatConstant0), 120, 123456677890ll, -10, (*(double*)&FloatConstant1));
  return;
}

Check in an old testcase

Check in an old testcase

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


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

struct list {
    int ctx;
    struct list_head loc;
};

int main(int argc, char *argv[])
{
    struct list l[3];

    for(int i = 0; i < 3; i++)
    {
        l[i].ctx = i * 10;
        //l[i].loc = (struct list_head *) malloc(sizeof(struct list_head));
    }

    LIST_HEAD(start);

    //INIT_LIST_HEAD(l[0].loc);
    //INIT_LIST_HEAD(l[1].loc);
    //INIT_LIST_HEAD(l[2].loc);

    //struct list_head *start = l[0].loc;

    //list_add(start, l[1].loc);
    //list_add(start, l[2].loc);
    list_add_tail(&l[0].loc, &start);
    list_add_tail(&l[1].loc, &start);
    list_add_tail(&l[2].loc, &start);

    //struct list_head *tmp = start;
    struct list_head *tmp;
    list_for_each(tmp, &start)
    {
        printf("%d\n", list_entry(tmp, struct list, loc)->ctx);
    }
}

Test "list" embeding to arbitary struct It is not confortable for me to use too much "address of".


#ifndef _TOKU_DIRENT_H
#define _TOKU_DIRENT_H

#if defined(__cplusplus)
extern "C" {
#endif

//The DIR functions do not exist in windows, but the Linux API ends up
//just using a wrapper.  We might convert these into an toku_os_* type api.

enum {
    DT_UNKNOWN = 0,
    DT_DIR     = 4,
    DT_REG     = 8
};

struct dirent {
    char          d_name[_MAX_PATH];
    unsigned char d_type;
};

struct __toku_windir;
typedef struct __toku_windir DIR;

DIR *opendir(const char *name);

struct dirent *readdir(DIR *dir);

int closedir(DIR *dir);

#ifndef NAME_MAX
#define NAME_MAX 255
#endif

#if defined(__cplusplus)
};
#endif

#endif

#ifndef _TOKU_DIRENT_H
#define _TOKU_DIRENT_H

#include "toku_os_types.h"
#if defined(__cplusplus)
extern "C" {
#endif

//The DIR functions do not exist in windows, but the Linux API ends up
//just using a wrapper.  We might convert these into an toku_os_* type api.

enum {
    DT_UNKNOWN = 0,
    DT_DIR     = 4,
    DT_REG     = 8
};

struct dirent {
    char          d_name[_MAX_PATH];
    unsigned char d_type;
};

struct __toku_windir;
typedef struct __toku_windir DIR;

DIR *opendir(const char *name);

struct dirent *readdir(DIR *dir);

int closedir(DIR *dir);

#ifndef NAME_MAX
#define NAME_MAX 255
#endif

#if defined(__cplusplus)
};
#endif

#endif

[t:2499] Fix broken windows build due to r19902 (merge of 2499d branch)

git-svn-id: b5c078ec0b4d3a50497e9dd3081db18a5b4f16e5@19935 c7de825b-a66e-492c-adef-691d508d4ae1


/*
 * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <debug.h>

/* mbed TLS headers */
#include <mbedtls/memory_buffer_alloc.h>
#include <mbedtls/platform.h>

/*
 * mbed TLS heap
 */
#if (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_ECDSA)
#define MBEDTLS_HEAP_SIZE		(14*1024)
#elif (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_RSA)
#define MBEDTLS_HEAP_SIZE		(8*1024)
#endif
static unsigned char heap[MBEDTLS_HEAP_SIZE];

/*
 * mbed TLS initialization function
 */
void mbedtls_init(void)
{
	static int ready;

	if (!ready) {
		/* Initialize the mbed TLS heap */
		mbedtls_memory_buffer_alloc_init(heap, MBEDTLS_HEAP_SIZE);

		/* Use reduced version of snprintf to save space. */
		mbedtls_platform_set_snprintf(tf_snprintf);

		ready = 1;
	}
}

/*
 * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <debug.h>

/* mbed TLS headers */
#include <mbedtls/memory_buffer_alloc.h>
#include <mbedtls/platform.h>

/*
 * mbed TLS heap
 */
#if (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_ECDSA)
#define MBEDTLS_HEAP_SIZE		(14*1024)
#elif (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_RSA)
#define MBEDTLS_HEAP_SIZE		(6*1024)
#endif
static unsigned char heap[MBEDTLS_HEAP_SIZE];

/*
 * mbed TLS initialization function
 */
void mbedtls_init(void)
{
	static int ready;

	if (!ready) {
		/* Initialize the mbed TLS heap */
		mbedtls_memory_buffer_alloc_init(heap, MBEDTLS_HEAP_SIZE);

		/* Use reduced version of snprintf to save space. */
		mbedtls_platform_set_snprintf(tf_snprintf);

		ready = 1;
	}
}

Define optimized mbed TLS heap size

mbedtls: Define optimized mbed TLS heap size

mbed TLS provides the debug API `mbedtls_memory_buffer_alloc_status()`
to analyse the RAM usage of the library.

When RSA is selected as algorithm, the maximum heap usage in FVP and
Juno has been determined empirically to be approximately 5.5 KiB.
However, The default heap size used when RSA is selected is 8 KiB.

This patch reduces the buffer from 8 KiB to 6 KiB so that the BSS
sections of both BL1 and BL2 are 2 KiB smaller when the firmware is
compiled with TBB support.

Change-Id: I43878a4e7af50c97be9c8d027c728c8483f24fbf
Signed-off-by: Antonio Nino Diaz <5c24ff39be768bf31f4deee44042a11772cfd02a@arm.com>


#ifndef LZ4MT_COMPAT_H
#define LZ4MT_COMPAT_H

namespace Lz4Mt {

unsigned getHardwareConcurrency();

struct launch {
#if defined(_MSC_VER)
	typedef std::launch::launch Type;
#else
	typedef std::launch Type;
#endif
	static const Type deferred;
	static const Type async;
};

}

#endif

#ifndef LZ4MT_COMPAT_H
#define LZ4MT_COMPAT_H

namespace Lz4Mt {

unsigned getHardwareConcurrency();

struct launch {
#if defined(_MSC_VER) && (_MSC_VER <= 1700)
	typedef std::launch::launch Type;
#else
	typedef std::launch Type;
#endif
	static const Type deferred;
	static const Type async;
};

}

#endif

Fix compile error with VC++2013 preview

Fix compile error with VC++2013 preview


#ifndef HALIDE_RUNTIME_MUTEX_H
#define HALIDE_RUNTIME_MUTEX_H

#include "HalideRuntime.h"

// Avoid ODR violations
namespace {

// An RAII mutex
struct ScopedMutexLock {
    halide_mutex *mutex;

    ScopedMutexLock(halide_mutex *mutex) : mutex(mutex) {
        halide_mutex_lock(mutex);
    }

    ~ScopedMutexLock() {
        halide_mutex_unlock(mutex);
    }
};

}

#endif

Add an OS mutex to Halide runtime.

Add an OS mutex to Halide runtime.

Document an issue with the POSIX thread pool.

Ensure memoization cache is cleaned up when a JITted module is
shutdown. (Also provides a way to clear the cache from AOT code.)


//
//  OctoKit.h
//  OctoKit
//
//  Created by Piet Brauer on 25/08/15.
//  Copyright (c) 2015 nerdish by nature. All rights reserved.
//

#import <UIKit/UIKit.h>

//! Project version number for OctoKit.
FOUNDATION_EXPORT double OctoKitVersionNumber;

//! Project version string for OctoKit.
FOUNDATION_EXPORT const unsigned char OctoKitVersionString[];

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

//
//  OctoKit.h
//  OctoKit
//
//  Created by Piet Brauer on 25/08/15.
//  Copyright (c) 2015 nerdish by nature. All rights reserved.
//

#import <Foundation/Foundation.h>

//! Project version number for OctoKit.
FOUNDATION_EXPORT double OctoKitVersionNumber;

//! Project version string for OctoKit.
FOUNDATION_EXPORT const unsigned char OctoKitVersionString[];

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

Use Foundation instead of UIKit

Use Foundation instead of UIKit


#ifndef APIMOCK_H
#define APIMOCK_H

#include "core/server.h"

#endif

#ifndef APIMOCK_H
#define APIMOCK_H

#include "core/server.h"
#include "core/exceptions.h"

#endif

Include exceptions in main header

Include exceptions in main header


/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 */
#include "e.h"
#include <execinfo.h>

/* a tricky little devil, requires e and it's libs to be built
 * with the -rdynamic flag to GCC for any sort of decent output.
 */
void e_sigseg_act(int x, siginfo_t *info, void *data){

  void *array[255];
  size_t size;
  write(2, "**** SEGMENTATION FAULT ****\n", 29);
  write(2, "**** Printing Backtrace... *****\n\n", 34);
  size = backtrace(array, 255);
  backtrace_symbols_fd(array, size, 2);
  exit(-11);
}

/*
 * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
 * NOTE TO FreeBSD users. Install libexecinfo from
 * ports/devel/libexecinfo and add -lexecinfo to LDFLAGS
 * to add backtrace support.
 */
#include "e.h"
#include <execinfo.h>

/* a tricky little devil, requires e and it's libs to be built
 * with the -rdynamic flag to GCC for any sort of decent output.
 */
void e_sigseg_act(int x, siginfo_t *info, void *data){

  void *array[255];
  size_t size;
  write(2, "**** SEGMENTATION FAULT ****\n", 29);
  write(2, "**** Printing Backtrace... *****\n\n", 34);
  size = backtrace(array, 255);
  backtrace_symbols_fd(array, size, 2);
  exit(-11);
}

Add note to help FreeBSD users.

Add note to help FreeBSD users.


//===-- ipcreg_internal.h -------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Internal types and data for IPC registration logic
//
//===----------------------------------------------------------------------===//

#ifndef _IPCREG_INTERNAL_H_
#define _IPCREG_INTERNAL_H_

#include "ipcd.h"

#include <assert.h>

typedef enum {
  STATE_UNOPT = 0,
  STATE_ID_EXCHANGE,
  STATE_OPTIMIZED,
  STATE_LOCALFD
} EndpointState;

typedef struct {
  size_t bytes_trans;
  int localfd;
  endpoint ep;
  EndpointState state;
  bool valid;
} ipc_info;

// For now, just index directly into pre-allocate table with fd.
// We will also need a way to go from nonce to fd!
const unsigned TABLE_SIZE = 1 << 10;
extern ipc_info IpcDescTable[TABLE_SIZE];

static inline char inbounds_fd(int fd) { return (unsigned)fd <= TABLE_SIZE; }

static inline ipc_info *getFDDesc(int fd) {
  assert(inbounds_fd(fd));
  return &IpcDescTable[fd];
}

#endif // _IPCREG_INTERNAL_H_

//===-- ipcreg_internal.h -------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Internal types and data for IPC registration logic
//
//===----------------------------------------------------------------------===//

#ifndef _IPCREG_INTERNAL_H_
#define _IPCREG_INTERNAL_H_

#include "ipcd.h"

#include <assert.h>

typedef enum {
  STATE_UNOPT = 0,
  STATE_ID_EXCHANGE,
  STATE_OPTIMIZED,
  STATE_LOCALFD
} EndpointState;

typedef struct {
  size_t bytes_trans;
  int localfd;
  endpoint ep;
  EndpointState state;
  bool valid;
} ipc_info;

// For now, just index directly into pre-allocate table with fd.
// We will also need a way to go from nonce to fd!
const unsigned TABLE_SIZE = 1 << 10;
extern ipc_info IpcDescTable[TABLE_SIZE];

static inline char inbounds_fd(int fd) { return (unsigned)fd <= TABLE_SIZE; }

static inline ipc_info *getFDDesc(int fd) {
  if (!inbounds_fd(fd)) {
    ipclog("Attempt to access out-of-bounds fd: %d (TABLE_SIZE=%u)\n", fd,
           TABLE_SIZE);
  }
  assert(inbounds_fd(fd));
  return &IpcDescTable[fd];
}

#endif // _IPCREG_INTERNAL_H_

Extend assert in getFDDesc to print invalid fd.

Helps debug issues like one fixed by previous commit.


#ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
#  define E_SMART_MONITOR_H

# endif
#endif

#ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
#  define E_SMART_MONITOR_H

Evas_Object *e_smart_monitor_add(Evas *evas);

# endif
#endif

Add header function for creating new monitors.

Signed-off-by: Christopher Michael <cp.michael@samsung.com>

SVN revision: 84123


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

#ifndef SRC_TRACE_PROCESSOR_TYPES_VERSION_NUMBER_H_
#define SRC_TRACE_PROCESSOR_TYPES_VERSION_NUMBER_H_

#include <tuple>

namespace perfetto {
namespace trace_processor {

struct VersionNumber {
  uint32_t major;
  uint32_t minor;

  bool operator==(const VersionNumber& other) {
    return std::tie(major, minor) == std::tie(other.major, other.minor);
  }
  bool operator<(const VersionNumber& other) {
    return std::tie(major, minor) < std::tie(other.major, other.minor);
  }
  bool operator>=(const VersionNumber& other) {
    return std::tie(major, minor) >= std::tie(other.major, other.minor);
  }
};

}  // namespace trace_processor
}  // namespace perfetto

#endif  // SRC_TRACE_PROCESSOR_TYPES_VERSION_NUMBER_H_

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

#ifndef SRC_TRACE_PROCESSOR_TYPES_VERSION_NUMBER_H_
#define SRC_TRACE_PROCESSOR_TYPES_VERSION_NUMBER_H_

#include <tuple>

namespace perfetto {
namespace trace_processor {

struct VersionNumber {
  uint32_t major;
  uint32_t minor;

  bool operator==(const VersionNumber& other) const {
    return std::tie(major, minor) == std::tie(other.major, other.minor);
  }
  bool operator<(const VersionNumber& other) const {
    return std::tie(major, minor) < std::tie(other.major, other.minor);
  }
  bool operator>=(const VersionNumber& other) const {
    return std::tie(major, minor) >= std::tie(other.major, other.minor);
  }
};

}  // namespace trace_processor
}  // namespace perfetto

#endif  // SRC_TRACE_PROCESSOR_TYPES_VERSION_NUMBER_H_

Fix VersionNumber comparison operator constness

Currently Perfetto builds are broken in Chromium.

Change-Id: I09b2e29682667e6dfecc36ea072327dd51f5e071


//
//  APIRouter.h
//  APIClient
//
//  Created by Klaas Pieter Annema on 14-09-13.
//  Copyright (c) 2013 Klaas Pieter Annema. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "APIInflector.h"

@protocol APIRouter <NSObject>
@property (nonatomic, readonly, strong) id<APIInflector> inflector;

- (NSString *)pathForAction:(NSString *)action onResource:(Class)resource;
@end

@interface APIRouter : NSObject <APIRouter>
- (id)initWithInflector:(id<APIInflector>)inflector;
- (NSString *)pathForAction:(NSString *)action onResource:(Class)resource;
@end

//
//  APIRouter.h
//  APIClient
//
//  Created by Klaas Pieter Annema on 14-09-13.
//  Copyright (c) 2013 Klaas Pieter Annema. All rights reserved.
//

#import <Foundation/Foundation.h>

#import "APIInflector.h"

@protocol APIRouter <NSObject>
- (NSString *)pathForAction:(NSString *)action onResource:(Class)resource;
@end

@interface APIRouter : NSObject <APIRouter>
@property (nonatomic, readonly, strong) id<APIInflector> inflector;

- (id)initWithInflector:(id<APIInflector>)inflector;
- (NSString *)pathForAction:(NSString *)action onResource:(Class)resource;
@end

Remove the inflector from the router protocol


#pragma once

#if defined(_MSC_VER)
#define DLL_API __declspec(dllexport)
#define STDCALL __stdcall
#define CDECL __cdecl
#else
#define DLL_API __attribute__ ((visibility ("default")))
#define STDCALL __attribute__((stdcall))
#define CDECL __attribute__((cdecl))
#endif

#define CS_OUT

#pragma once

#if defined(_MSC_VER)
#define DLL_API __declspec(dllexport)

#ifndef STDCALL
#define STDCALL __stdcall
#endif

#ifndef CDECL
#define CDECL __cdecl
#endif
#else
#define DLL_API __attribute__ ((visibility ("default")))

#ifndef STDCALL
#define STDCALL __attribute__((stdcall))
#endif

#ifndef CDECL
#define CDECL __attribute__((cdecl))
#endif
#endif

#define CS_OUT

Check for defines before defining to get rid of some warnings.


//
//  CLURecordableModule.h
//  Clue
//
//  Created by Ahmed Sulaiman on 5/18/16.
//  Copyright © 2016 Ahmed Sulaiman. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol CLURecordableModule <NSObject>

@required
- (void)startRecording;
- (void)stopRecording;
- (BOOL)addNewFrameWithTimestamp:(CFTimeInterval)timestamp;

@end

Add basic interface for recordable modules


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

#define Client_id       @"kHOugsx4dmcXwvVbmLkd"
#define Client_secret   @"PuuFCrF94MloSbSkxpwS"
#define UMENG_APPKEY    @"Set up UMEng App Key"
#define UMENG_QQ_ID     @"Set up qq id"
#define UMENG_QQ_APPKEY @"Set up qq appkey"
#define WX_APP_ID       @"Set up weixin app id"
#define WX_APP_SECRET   @"Set up weixin app secret"
#define TRACKING_ID     @"Set up google anlytics tracking id"

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

#if DEBUG
#define Client_id       @"kHOugsx4dmcXwvVbmLkd"
#define Client_secret   @"PuuFCrF94MloSbSkxpwS"
#else
#define Client_id       @"Set up a client id for production env"
#define Client_secret   @"Set up a client secret for production env"
#endif

#define UMENG_APPKEY    @"Set up UMEng App Key"
#define UMENG_QQ_ID     @"Set up qq id"
#define UMENG_QQ_APPKEY @"Set up qq appkey"
#define WX_APP_ID       @"Set up weixin app id"
#define WX_APP_SECRET   @"Set up weixin app secret"
#define TRACKING_ID     @"Set up google anlytics tracking id"

Set up a client id and a client secret for production environment


//
// Prefix header for all source files of the 'Pester' target in the 'Pester' project
//

#import "NJROperatingSystemVersion.h"

//
// Prefix header for all source files of the 'Pester' target in the 'Pester' project
//

#ifdef __OBJC__
    #import <Cocoa/Cocoa.h>
    #import "NJROperatingSystemVersion.h"
#endif

Fix Pester prefix header to import Cocoa again.


#include <stdio.h>
#include "lib/proc.h"

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

  char* gitbuff;
  int out = run_proc(&gitbuff, "git", "branch", "--list", 0);
  //int out = run_proc(&gitbuff, "ls", "-l", "-h", 0);
  if (out != 0)
  {
    fprintf(stderr, "Error running subprocess:%d\n", out);
    exit(1);
  }
  //printf("run_proc exit code = %d\nresponse= '''%s'''\n", out, gitbuff);

  char *br;

  br = gitbuff;
  putchar('(');

  while(*br++ != '*') {}
  // skip the '*' and the space after it
  br++;
  while(*br != '\n')
  {
    putchar(*br++);
  }

  putchar(')');
  putchar('\n');
}

#include <stdio.h>
#include <string.h>
#include "lib/proc.h"

int
main(int argc, char **argv)
{
  char* gitbuff;
  int out = run_proc(&gitbuff, "git", "branch", "--list", 0);
  if (out != 0)
  {
    exit(1);
  }

  char *token;
  char *sep=" \r\n";
  int next = 0;
  while((token = strsep(&gitbuff, sep)) != NULL)
  {
    if (token[0] == '*')  {
      token = strsep(&gitbuff, sep);
      printf("(%s)", token);
      break;
    }
   }
  return 0;
}

Use strsep to split output

Use strsep to split output


//
//  PKTClient.h
//  PodioKit
//
//  Created by Sebastian Rehnby on 16/01/14.
//  Copyright (c) 2014 Citrix Systems, Inc. All rights reserved.
//

#import "PKTRequest.h"
#import "PKTResponse.h"
#import "PKTRequestSerializer.h"
#import "PKTResponseSerializer.h"

typedef void(^PKTRequestCompletionBlock)(PKTResponse *response, NSError *error);

@interface PKTHTTPClient : NSObject

@property (nonatomic, copy, readonly) NSURL *baseURL;
@property (nonatomic, strong, readonly) PKTRequestSerializer *requestSerializer;
@property (nonatomic, strong, readonly) PKTResponseSerializer *responseSerializer;

/**
 *  Controls whether or not to pin the server public key to that of any .cer certificate included in the app bundle.
 */
@property (nonatomic) BOOL useSSLPinning;

- (NSURLSessionTask *)taskForRequest:(PKTRequest *)request completion:(PKTRequestCompletionBlock)completion;

@end

//
//  PKTClient.h
//  PodioKit
//
//  Created by Sebastian Rehnby on 16/01/14.
//  Copyright (c) 2014 Citrix Systems, Inc. All rights reserved.
//

#import "PKTRequest.h"
#import "PKTResponse.h"
#import "PKTRequestSerializer.h"
#import "PKTResponseSerializer.h"

typedef void(^PKTRequestCompletionBlock)(PKTResponse *response, NSError *error);

@interface PKTHTTPClient : NSObject

@property (nonatomic, copy) NSURL *baseURL;
@property (nonatomic, strong, readonly) PKTRequestSerializer *requestSerializer;
@property (nonatomic, strong, readonly) PKTResponseSerializer *responseSerializer;

/**
 *  Controls whether or not to pin the server public key to that of any .cer certificate included in the app bundle.
 */
@property (nonatomic) BOOL useSSLPinning;

- (NSURLSessionTask *)taskForRequest:(PKTRequest *)request completion:(PKTRequestCompletionBlock)completion;

@end

Add ability to set base URL

Add ability to set base URL


//---------------------------------------------------------- -*- Mode: C++ -*-
// $Id$
//
// Created 2012/10/25
// Author: Mike Ovsiannikov
//
// Copyright 2012 Quantcast Corp.
//
// This file is part of Kosmos File System (KFS).
//
// 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.
//
// \file nofilelimit.h
// \brief function to set process max number of open files.
//
//----------------------------------------------------------------------------

#ifndef KFS_NOFILELIMIT_H
#define KFS_NOFILELIMIT_H

namespace KFS {

int SetMaxNoFileLimit();

}

#endif /* KFS_NOFILELIMIT_H */

Fix previous commit: by committing new include file.


// PARAM: --enable ana.sv-comp.functions
// manually minimized from sv-benchmarks/c/seq-mthreaded/pals_lcr.3.ufo.UNBOUNDED.pals.c
// used to not reach fixpoint due to def_exc range
_Bool __VERIFIER_nondet_bool(void) ;

_Bool mode1  ;
void node1(void)
{
  if (mode1)
    mode1 = 0;
  else
    mode1 = 1;
}

int main(void)
{
  mode1 = __VERIFIER_nondet_bool();
  while (1)
    node1();
  return 0;
}

Add test for def_exc bool fixpoint error


#include "../rts/PosixSource.h"
#include "Rts.h"

#include "HsFFI.h"

int main (int argc, char *argv[])
{
    RtsConfig conf = defaultRtsConfig;

    // We never know what symbols GHC will look up in the future, so
    // we must retain CAFs for running interpreted code.
    conf.keep_cafs = 1;

    extern StgClosure ZCMain_main_closure;
    hs_main(argc, argv, &ZCMain_main_closure, conf);
}

#include "../rts/PosixSource.h"
#include "Rts.h"

#include "HsFFI.h"

int main (int argc, char *argv[])
{
    RtsConfig conf = defaultRtsConfig;

    // We never know what symbols GHC will look up in the future, so
    // we must retain CAFs for running interpreted code.
    conf.keep_cafs = 1;

    conf.rts_opts_enabled = RtsOptsAll;
    extern StgClosure ZCMain_main_closure;
    hs_main(argc, argv, &ZCMain_main_closure, conf);
}

Allow all RTS options to iserv

Allow all RTS options to iserv

(cherry picked from commit db121b2ec4596b99fed9781ec2d055f29e0d5b20)


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

int f(int x) {
  return x + 1;
}

int main(void) {
  int y = 42;

  y = f(42);
  // combine should forget caller's y before unifying with y == 43 to avoid bottom

  assert(y);
  return 0;
}

Add test for octApron combine forgetting return assign locally


/*
 * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include <stdint.h>

#include <lib/utils.h>

#include "rpi3_private.h"

/* Get 128 bits of entropy and fuse the values together to form the canary. */
#define TRNG_NBYTES	16U

u_register_t plat_get_stack_protector_canary(void)
{
	size_t i;
	u_register_t buf[TRNG_NBYTES / sizeof(u_register_t)];
	u_register_t ret = 0U;

	rpi3_rng_read(buf, sizeof(buf));

	for (i = 0U; i < ARRAY_SIZE(buf); i++)
		ret ^= buf[i];

	return ret;
}

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

#include <stdint.h>

#include <lib/utils.h>
#include <lib/utils_def.h>

#include "rpi3_private.h"

/* Get 128 bits of entropy and fuse the values together to form the canary. */
#define TRNG_NBYTES	16U

u_register_t plat_get_stack_protector_canary(void)
{
	size_t i;
	u_register_t buf[TRNG_NBYTES / sizeof(u_register_t)];
	u_register_t ret = 0U;

	rpi3_rng_read(buf, sizeof(buf));

	for (i = 0U; i < ARRAY_SIZE(buf); i++)
		ret ^= buf[i];

	return ret;
}

rpi3: Fix compilation error when stack protector is enabled

Include necessary header file to use ARRAY_SIZE() macro

Change-Id: I5b7caccd02c14c598b7944cf4f347606c1e7a8e7
Signed-off-by: Madhukar Pappireddy <c854e377c0ff08e0fa4357b6357bedff114c98a6@arm.com>


#pragma once

#include <jni.h>

/**
 * Support for using JNI in a multi-threaded environment.
 */
class JniSupport {
public:
    JniSupport(JavaVM* jvm);
    JniSupport(JNIEnv* env);

protected:
    jclass findClass(const char* className);
    JNIEnv* getThreadEnv();

protected:
    JavaVM* jvm;
};

/**
 * Attach a native thread to JNI.
 */
class JniThreadAttacher : public JniSupport {
public:
    JniThreadAttacher(JavaVM* jvm, const char* name, bool daemon);
    ~JniThreadAttacher();
};

#pragma once

#include <jni.h>
#include <stdexcept>

/**
 * Support for using JNI in a multi-threaded environment.
 */
class JniSupport {
public:
    JniSupport(JavaVM* jvm);
    JniSupport(JNIEnv* env);

protected:
    jclass findClass(const char* className);
    JNIEnv* getThreadEnv();

protected:
    JavaVM* jvm;
};

/**
 * Attach a native thread to JNI.
 */
class JniThreadAttacher : public JniSupport {
public:
    JniThreadAttacher(JavaVM* jvm, const char* name, bool daemon);
    ~JniThreadAttacher();
};

Add include necessary on Linux

Add include necessary on Linux


#ifndef DIRECTORY_H
#define DIRECTORY_H

#if defined (ULTRIX42) || defined(ULTRIX43)	/* _POSIX_SOURCE should have taken care of this, */
#define __POSIX			/* but for some reason the ULTRIX version of dirent.h */
#endif					/* is not POSIX conforming without it... */
#include <dirent.h>

class Directory
{
public:
	Directory( const char *name );
	~Directory();
	void Rewind();
	char *Next();
private:
	DIR *dirp;
};

#endif

#ifndef DIRECTORY_H
#define DIRECTORY_H

#if defined (ULTRIX42) || defined(ULTRIX43)
	/* _POSIX_SOURCE should have taken care of this,
		but for some reason the ULTRIX version of dirent.h
		is not POSIX conforming without it...
	*/
#	define __POSIX
#endif

#include <dirent.h>

#if defined(SUNOS41)
	/* Note that function seekdir() is not required by POSIX, but the sun
	   implementation of rewinddir() (which is required by POSIX) is
	   a macro utilizing seekdir().  Thus we need the prototype.
	*/
	extern "C" void seekdir( DIR *dirp, int loc );
#endif

class Directory
{
public:
	Directory( const char *name );
	~Directory();
	void Rewind();
	char *Next();
private:
	DIR *dirp;
};

#endif

Add prototype for seekdir() for Suns.

Add prototype for seekdir() for Suns.


/*
name: TEST023
description: Basic test for long constants
comments: This test is done for z80 data types
output:
F1
G1	F1	main
{
-
A2	W	i
A3	Z	u
	A2	#W1	:W
	A2	#WFFFFFFFF	:W
	A2	#WFFFFFFFF	:W
	A2	#WFFFFFFFF	:W
	A2	#WFFFFFFFF	:W
	A2	#W3	:W
	A2	#W1	:W
	A2	#W0	:W
	A3	#Z1	:Z
	A3	#ZFFFFFFFF	:Z
	A3	#ZFFFFFFFF	:Z
	A3	#ZFFFFFFFF	:Z
	A3	#ZFFFFFFFF	:Z
	A3	#Z3	:Z
	A3	#Z1	:Z
	A3	#Z0	:Z
	y	#I0
}
*/

int
main(void)
{
	long i;
	unsigned long u;

	i = 1;
	i = -1;
	i = -1l;
	i = -1u;
	i = -1ll;
	i = (1ll << 32) - 1 & 3;
	i = (long) ((1ll << 32) - 1) < 0;
	i = -1u < 0;

	u = 1;
	u = -1;
	u = -1l;
	u = -1u;
	u = -1ll;
	u = (1ll << 32) - 1 & 3;
	u = (long) ((1ll << 32) - 1) < 0;
	u = -1u < 0;
	return 0;
}

Add basic test for long constants

Add basic test for long constants


#ifndef __MACROS_H__
#define __MACROS_H__

/**
 * @file macros.h
 *
 * This file contains simple helper macros
 */

/**
 * @addtogroup internal_util_helper_macros "(internal) helper macros"
 *
 * This group contains helper macros for internal use only.
 *
 * @{
 */

/**
 * Computes the maximum value of the two passed values
 *
 * @note Provides compile-time type checking by using temp variables before
 * doing the comparison.
 *
 * @note Opens own scope, so the temp variables do not show up outside of the
 * macro.
 */
#define MAX(x,y)                                    \
        ((__typeof__(x)) x > (__typeof__(x)) y ?    \
         (__typeof__(x)) x : (__typeof__(x)) y)

/**
 * Computes the minimum value of the two passed values
 *
 * @note Provides compile-time type checking by using temp variables before
 * doing the comparison.
 *
 * @note Opens own scope, so the temp variables do not show up outside of the
 * macro.
 */
#define MIN(x,y)                    \
       ({ __typeof__ (x) _x = (x);  \
          __typeof__ (y) _y = (y);  \
          _x < _y ? _x : _y; })

/** @} */

#endif //__MACROS_H__

#ifndef __MACROS_H__
#define __MACROS_H__

/**
 * @file macros.h
 *
 * This file contains simple helper macros
 */

/**
 * @addtogroup internal_util_helper_macros "(internal) helper macros"
 *
 * This group contains helper macros for internal use only.
 *
 * @{
 */

/**
 * Computes the maximum value of the two passed values
 *
 * @note Provides compile-time type checking by using temp variables before
 * doing the comparison.
 *
 * @note Opens own scope, so the temp variables do not show up outside of the
 * macro.
 */
#define MAX(x,y)                                    \
        ((__typeof__(x)) x > (__typeof__(x)) y ?    \
         (__typeof__(x)) x : (__typeof__(x)) y)

/**
 * Computes the minimum value of the two passed values
 *
 * @note Provides compile-time type checking by using temp variables before
 * doing the comparison.
 *
 * @note Opens own scope, so the temp variables do not show up outside of the
 * macro.
 */
#define MIN(x,y)                                    \
        ((__typeof__(x)) x > (__typeof__(x)) y ?    \
         (__typeof__(x)) y : (__typeof__(x)) x)

/** @} */

#endif //__MACROS_H__

Modify MIN(x,y) to not contain a scope

Modify MIN(x,y) to not contain a scope


/*
 * File: test_hashtable.c
 *
 * Testing suite for hashtables.
 *
 * Author: Jack Romo <sharrackor@gmail.com>
 */

#include "../cnoodle.h"
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>

typedef struct {
    hashtable table;
} hfixture;

void table_setup(hfixture *hf, gconstpointer test_data) {
    hf->table = make_hashtable();
    t_entity *ent1 = make_entity(NULL, 0, 0, NULL);
    ent1->id = 0;
    hashtable_add(*(hf->table), (void *) ent1, ENTITY);
    t_entity *ent2 = make_entity(NULL, 1, 1, (void *) ent1);
    ent2->id = 1;
    hashtable_add(*(hf->table), (void *) ent2, ENTITY);
}

void table_teardown(hfixture *hf, gconstpointer test_data) {
    hashtable_free(hf->table);
}

// TODO: tests here

int main() {
    // TODO: run tests here
}

Add setup and teardown for hashtable tests


/*
    kngrouppropdlg.h

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

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

#ifndef KNGROUPPROPDLG_H
#define KNGROUPPROPDLG_H

#include <kdialogbase.h>

class QCheckBox;

class KLineEdit;

class KNGroup;

namespace KNConfig {
class IdentityWidget;
};

class KNGroupPropDlg : public KDialogBase  {

  public:
    KNGroupPropDlg(KNGroup *group, QWidget *parent=0, const char *name=0);
    ~KNGroupPropDlg();

    bool nickHasChanged() { return n_ickChanged; }

  protected:
    KNGroup *g_rp;
    bool n_ickChanged;
    KNConfig::IdentityWidget* i_dWidget;
    KLineEdit *n_ick;
    QCheckBox *u_seCharset;
    QComboBox *c_harset;

  protected slots:
    void slotOk();

};

#endif

/*
    kngrouppropdlg.h

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

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

#ifndef KNGROUPPROPDLG_H
#define KNGROUPPROPDLG_H

#include <kdialogbase.h>

class QCheckBox;
class QComboBox;

class KLineEdit;

class KNGroup;

namespace KNConfig {
class IdentityWidget;
};

class KNGroupPropDlg : public KDialogBase  {

  public:
    KNGroupPropDlg(KNGroup *group, QWidget *parent=0, const char *name=0);
    ~KNGroupPropDlg();

    bool nickHasChanged() { return n_ickChanged; }

  protected:
    KNGroup *g_rp;
    bool n_ickChanged;
    KNConfig::IdentityWidget* i_dWidget;
    KLineEdit *n_ick;
    QCheckBox *u_seCharset;
    QComboBox *c_harset;

  protected slots:
    void slotOk();

};

#endif

Add forward declaration for QComboBox

Add forward declaration for QComboBox

svn path=/trunk/kdenetwork/knode/; revision=144112


//
//  Paystack.h
//  Paystack
//
//  Created by Ibrahim Lawal on 02/02/16.
//  Copyright (c) 2016 Paystack. All rights reserved.
//
// The code in this workspace was adapted from https://github.com/stripe/stripe-ios.
// Stripe was replaced with Paystack - and STP with PSTCK - to avoid collisions within
// apps that are using both Paystack and Stripe.

#import <Paystack/PSTCKAPIClient.h>
#import <Paystack/PaystackError.h>
#import <Paystack/PSTCKCardBrand.h>
#import <Paystack/PSTCKCardParams.h>
#import <Paystack/PSTCKTransactionParams.h>
#import <Paystack/PSTCKCard.h>
#import <Paystack/PSTCKCardValidationState.h>
#import <Paystack/PSTCKCardValidator.h>
#import <Paystack/PSTCKToken.h>
#import <Paystack/PSTCKRSA.h>

#if TARGET_OS_IPHONE
#import <Paystack/PSTCKPaymentCardTextField.h>
#endif

//
//  Paystack.h
//  Paystack
//
//  Created by Ibrahim Lawal on 02/02/16.
//  Copyright (c) 2016 Paystack. All rights reserved.
//
// The code in this workspace was adapted from https://github.com/stripe/stripe-ios.
// Stripe was replaced with Paystack - and STP with PSTCK - to avoid collisions within
// apps that are using both Paystack and Stripe.

#import "PSTCKAPIClient.h"
#import "PaystackError.h"
#import "PSTCKCardBrand.h"
#import "PSTCKCardParams.h"
#import "PSTCKTransactionParams.h"
#import "PSTCKCard.h"
#import "PSTCKCardValidationState.h"
#import "PSTCKCardValidator.h"
#import "PSTCKToken.h"
#import "PSTCKRSA.h"

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

Update umbrella header file declaration

Update umbrella header file declaration


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

#define PFIX_CLI "[MTd]"
#define MAX_BUF_SIZE 200

int mtd_server_cmd_run_HOSTNAME(char *msg_cmd, char *message);

/* Get hostname */
int mtd_server_cmd_run_HOSTNAME(char *msg_cmd, char *message)
{
	FILE *fd;
	char str_cmd[MAX_BUF_SIZE], str_buf[MAX_BUF_SIZE];
	memset (str_cmd, 0, MAX_BUF_SIZE);

	/* Create a command */
	sprintf(str_cmd, "hostname");

	/* Run a command */
	fd = popen(str_cmd, "r");
	if (!fd) {
		sprintf(message, "%s_%s ERR%% Error reading hostname.", PFIX_CLI, msg_cmd);
		return 1;
	}

    /* Get command stdout */
    while (fgets (str_buf, sizeof (str_buf), fd) <= 0);

    pclose (fd);

	sprintf(message, "%s_%s  OK# Hostname is: %s", PFIX_CLI, msg_cmd, str_buf);
	return 0;

}

Create file to implement commands

Create file to implement commands


//
//  SDLMacros.h
//  SmartDeviceLink-iOS
//
//  Created by Muller, Alexander (A.) on 10/17/16.
//  Copyright © 2016 smartdevicelink. All rights reserved.
//

#ifndef SDLMacros_h
#define SDLMacros_h

// Resolves issue of pre-xcode 8 versions due to NS_STRING_ENUM unavailability.
#ifndef SDL_SWIFT_ENUM
    #if __has_attribute(NS_STRING_ENUM)
        #define SDL_SWIFT_ENUM NS_STRING_ENUM
    #else
        #define SDL_SWIFT_ENUM
    #endif
#endif

#endif /* SDLMacros_h */

//
//  SDLMacros.h
//  SmartDeviceLink-iOS
//
//  Created by Muller, Alexander (A.) on 10/17/16.
//  Copyright © 2016 smartdevicelink. All rights reserved.
//

#ifndef SDLMacros_h
#define SDLMacros_h

// Resolves issue of pre-xcode 8 versions due to NS_STRING_ENUM unavailability.
#ifndef SDL_SWIFT_ENUM
    #if __has_attribute(swift_wrapper)
        #define SDL_SWIFT_ENUM NS_STRING_ENUM
    #else
        #define SDL_SWIFT_ENUM
    #endif
#endif

#endif /* SDLMacros_h */

Revert "Changed macro to look specifically for NS_STRING_ENUM"

This reverts commit de01a9f7b3ed63f683604d3595568bacf5f54a5e.


#define CHAR_BIT 8
#define INT_MAX 2147483647
#define INT_MIN -2147483648
#define LONG_MAX  0x7fffffffffffffffL
#define LONG_MIN -0x8000000000000000L
#define SCHAR_MAX 127
#define SCHAR_MIN -128
#define CHAR_MAX 127
#define CHAR_MIN -128
#define SHRT_MAX 32767
#define SHRT_MIN -32768
#define UCHAR_MAX 255
#define USHRT_MAX 65535
#define UINT_MAX 0xffffffff
#define ULONG_MAX 0xffffffffffffffffUL

#define CHAR_BIT 8
#define INT_MAX 2147483647
#define INT_MIN ((int)(-2147483647 - 1))
#define LONG_MAX  0x7fffffffffffffffL
#define LONG_MIN (-0x7fffffffffffffffL - 1)
#define CHAR_MAX SCHAR_MAX
#define CHAR_MIN SCHAR_MIN
#define SCHAR_MAX 127
#define SCHAR_MIN ((char)(-127 - 1))
#define SHRT_MAX 32767
#define SHRT_MIN ((short)(-32767 - 1))
#define UCHAR_MAX 255
#define USHRT_MAX 65535
#define UINT_MAX 0xffffffff
#define ULONG_MAX 0xffffffffffffffffUL

integer: Update integer limits to comply with spec

The values for the char/short/integer/long minimums were declared with
their actual values, not the definitions from the CL spec (v1.1).  As
a result, (-2147483648) was actually being treated as a long by the
compiler, not an int, which caused issues when trying to add/subtract
that value from a vector.

Update the definitions to use the values declared by the spec, and also
add explicit casts for the char/short/int minimums so that the compiler
actually treats them as shorts/chars. Without those casts, they
actually end up stored as integers, and the compiler may end up storing
the INT_MIN as a long.

The compiler can sign extend the values if it needs to convert the
char->short, short->int, or int->long

v2: Add explicit cast for INT_MIN and fix some type-o's and wrapping
    in the commit message.

Reported-by: Moritz Pflanzer <moritz.pflanzer14@imperial.ac.uk>
CC: Moritz Pflanzer <moritz.pflanzer14@imperial.ac.uk>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Aaron Watry <awatry@gmail.com>

git-svn-id: e7f1ab7c2a259259587475a3e7520e757882f167@247661 91177308-0d34-0410-b5e6-96231b3b80d8


//
//  DataUtils.h
//  CFC_Tracker
//
//  Created by Kalyanaraman Shankari on 3/9/15.
//  Copyright (c) 2015 Kalyanaraman Shankari. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

@interface BEMServerSyncCommunicationHelper: NSObject
// Top level method
+ (void) backgroundSync:(void (^)(UIBackgroundFetchResult))completionHandler;

// Wrappers around the communication methods
+ (void) pushAndClearUserCache:(void (^)(BOOL))completionHandler;
+ (void) pullIntoUserCache:(void (^)(BOOL))completionHandler;
+ (void) pushAndClearStats:(void (^)(BOOL))completionHandler;

// Communication methods (copied from communication handler to make it generic)
+(void)phone_to_server:(NSArray*) entriesToPush
     completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;
+(void)server_to_phone:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;
+(void)setClientStats:(NSDictionary*)statsToSend completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;

+ (NSInteger)fetchedData:(NSData *)responseData;
@end

//
//  DataUtils.h
//  CFC_Tracker
//
//  Created by Kalyanaraman Shankari on 3/9/15.
//  Copyright (c) 2015 Kalyanaraman Shankari. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

typedef void (^SilentPushCompletionHandler)(UIBackgroundFetchResult);

@interface BEMServerSyncCommunicationHelper: NSObject
// Top level method
+ (void) backgroundSync:(SilentPushCompletionHandler)completionHandler;

// Wrappers around the communication methods
+ (void) pushAndClearUserCache:(void (^)(BOOL))completionHandler;
+ (void) pullIntoUserCache:(void (^)(BOOL))completionHandler;
+ (void) pushAndClearStats:(void (^)(BOOL))completionHandler;

// Communication methods (copied from communication handler to make it generic)
+(void)phone_to_server:(NSArray*) entriesToPush
     completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;
+(void)server_to_phone:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;
+(void)setClientStats:(NSDictionary*)statsToSend completionHandler:(void (^)(NSData *data, NSURLResponse *response, NSError *error))completionHandler;

+ (NSInteger)fetchedData:(NSData *)responseData;
@end

Move the SilentPushCompletionHandler typedef in here

Since it is likely to be used as part of background sync


#pragma once

#include <stdlib.h>
#include <stdint.h>

#define PHS_NCOLS 64

int lyra2(char *key, uint32_t keylen, const char *pwd, uint32_t pwdlen, const char *salt, uint32_t saltlen, uint32_t R, uint32_t C, uint32_t T);
int PHS(void *out, size_t outlen, const void *in, size_t inlen, const void *salt, size_t saltlen, unsigned int t_cost, unsigned int m_cost);

#pragma once

#include <stdlib.h>
#include <stdint.h>

#define PHS_NCOLS 256

int lyra2(char *key, uint32_t keylen, const char *pwd, uint32_t pwdlen, const char *salt, uint32_t saltlen, uint32_t R, uint32_t C, uint32_t T);
int PHS(void *out, size_t outlen, const void *in, size_t inlen, const void *salt, size_t saltlen, unsigned int t_cost, unsigned int m_cost);

Use 256 cols when in PHS mode.

Use 256 cols when in PHS mode.


/*
 * Copyright 2014, NICTA
 *
 * This software may be distributed and modified according to the terms of
 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
 * See "LICENSE_BSD2.txt" for details.
 *
 * @TAG(NICTA_BSD)
 */

#ifndef __LIBSEL4_ARCH_MAPPING
#define __LIBSEL4_ARCH_MAPPING

#define SEL4_MAPPING_LOOKUP_LEVEL 2
#define SEL4_MAPPING_LOOKUP_NO_PT 22

static inline seL4_Word seL4_MappingFailedLookupLevel()
{
    return seL4_GetMR(SEL4_MAPPING_LOOKUP_LEVEL);
}

#endif

/*
 * Copyright 2014, NICTA
 *
 * This software may be distributed and modified according to the terms of
 * the BSD 2-Clause license. Note that NO WARRANTY is provided.
 * See "LICENSE_BSD2.txt" for details.
 *
 * @TAG(NICTA_BSD)
 */

#ifndef __LIBSEL4_ARCH_MAPPING
#define __LIBSEL4_ARCH_MAPPING

#include <autoconf.h>

#define SEL4_MAPPING_LOOKUP_LEVEL 2
#ifdef CONFIG_PAE_PAGING
#define SEL4_MAPPING_LOOKUP_NO_PT 21
#define SEL4_MAPPING_LOOKUP_NO_PD 30
#else
#define SEL4_MAPPING_LOOKUP_NO_PT 22
#endif

static inline seL4_Word seL4_MappingFailedLookupLevel()
{
    return seL4_GetMR(SEL4_MAPPING_LOOKUP_LEVEL);
}

#endif

Define different lookup levels for PAE

libsel4: Define different lookup levels for PAE


/*
 * Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
 *
 * 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     tests
 * @{
 *
 * @file
 * @brief       ssp test application
 *
 * This test should crash badly when *not* using the ssp module, and panic if
 * using it.
 *
 * @author      Kaspar Schleiser <kaspar@schleiser.de>
 *
 * @}
 */

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

void test_func(void)
{
    char buf[16];

    /* cppcheck-suppress bufferAccessOutOfBounds
     * (reason: deliberately overflowing stack) */
    memset(buf, 0, 32);
}

int main(void)
{
    puts("calling stack corruption function");

    test_func();

    puts("back to main");

    return 0;
}

/*
 * Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de>
 *
 * 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     tests
 * @{
 *
 * @file
 * @brief       ssp test application
 *
 * This test should crash badly when *not* using the ssp module, and panic if
 * using it.
 *
 * @author      Kaspar Schleiser <kaspar@schleiser.de>
 *
 * @}
 */

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

void test_func(void)
{
    char buf[16];

    /* clang will detect the buffer overflow
     * and throw an error if we use `buf` directly */
    void *buffer_to_confuse_compiler = buf;

    /* cppcheck-suppress bufferAccessOutOfBounds
     * (reason: deliberately overflowing stack) */
    memset(buffer_to_confuse_compiler, 0, 32);
}

int main(void)
{
    puts("calling stack corruption function");

    test_func();

    puts("back to main");

    return 0;
}

Fix on macOS while compiling w/ clang

tests/ssp: Fix on macOS while compiling w/ clang

On macOS using Apple LLVM version 9.0.0 this test would
not compile due to clang detecting the buffer overflow.
Since this test is all about having a buffer overflow, I
tricked clang into not detecting this anymore.

This loosely relates to #6473.


/*
 * Author: NagaChaitanya Vellanki
 *
 * TRY/THROW/CATCH/FINALLY - example
 * Reference: http://www.di.unipi.it/~nids/docs/longjump_try_trow_catch.html
 *
 */

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

#define FOO_EXCEPTION (1)
#define BAR_EXCEPTION (2)
#define GOO_EXCEPTION (3)

#define TRY do{ jmp_buf env; switch(setjmp(env)) { case 0: while(1) {
#define CATCH(exception) break; case exception:
#define FINALLY break; } default:
#define END_TRY } }while(0)
#define THROW(exception) longjmp(env, exception)

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

  TRY {
    printf("In TRY statement\n");
    THROW(GOO_EXCEPTION);
    printf("not reachable\n");
  }
  CATCH(FOO_EXCEPTION) {
    printf("FOO exception caught\n");
  }
  CATCH(BAR_EXCEPTION) {
    printf("BAR exception caught\n");
  }
  CATCH(GOO_EXCEPTION) {
    printf("GOO exception caught\n");
  }
  FINALLY {
    printf("Finally \n");
  }
  END_TRY;

  exit(EXIT_SUCCESS);
}

/*
 * Author: NagaChaitanya Vellanki
 *
 * TRY/THROW/CATCH/FINALLY - example
 * Reference: http://www.di.unipi.it/~nids/docs/longjump_try_trow_catch.html
 *
 * use gcc -E -P exception_handling_3.c to see the result of the preprocessing
 * step
 */

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

#define FOO_EXCEPTION (1)
#define BAR_EXCEPTION (2)
#define GOO_EXCEPTION (3)

#define TRY do{ jmp_buf env; switch(setjmp(env)) { case 0: while(1) {
#define CATCH(exception) break; case exception:
#define FINALLY break; } default:
#define END_TRY } }while(0)
#define THROW(exception) longjmp(env, exception)

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

  TRY {
    printf("In TRY statement\n");
    THROW(GOO_EXCEPTION);
    printf("not reachable\n");
  }
  CATCH(FOO_EXCEPTION) {
    printf("FOO exception caught\n");
  }
  CATCH(BAR_EXCEPTION) {
    printf("BAR exception caught\n");
  }
  CATCH(GOO_EXCEPTION) {
    printf("GOO exception caught\n");
  }
  FINALLY {
    printf("Finally \n");
  }
  END_TRY;

  exit(EXIT_SUCCESS);
}

Add command to see output of preprocessor


#ifndef TIMER_H_
#define TIMER_H_ 1

/*
 * By default, the timer calls the function a few extra times that aren't
 * measured to get it into cache and ensure more consistent running times.
 * Specifying this option in flags will stop this.
 */
#define TIMER_NO_EXTRA 1

struct timer {
    unsigned long long ns;
    unsigned int reps;
};

/*
 * Measures function 'func'. Sets timer->ns to the number of nanoseconds it took,
 * and timer->reps to the number of repetitions. Uses the existing values of
 * timer->ns and timer->reps as maximums - it won't do any more repetitions or take
 * significantly more time than those specify. However, you can set one of them
 * to 0 to make it unlimited. 0 is returned on success, -1 on failure.
 */
int
timer_measure(void (*func)(void), struct timer *timer, int flags);

// These next functions are shortcuts that use timer_measure and use the
// default flags.

int
timer_measure_ms(void (*func)(void), unsigned long long ms,
                 struct timer *timer);

int
timer_measure_reps(void (*func)(void), unsigned int reps, struct timer *timer);

#endif

#ifndef TIMER_H_
#define TIMER_H_ 1

/*
 * By default, the timer calls the function a few extra times that aren't
 * measured to get it into cache and ensure more consistent running times.
 * Specifying this option in flags will stop this.
 */
#define TIMER_NO_EXTRA 1

/*
 * By default, each of these functions assumes that the function is single
 * threaded. Specify this option to make sure that timing is done properly with
 * multi-threaded functions.
 */
#define TIMER_MULTI_THREAD 2

/*
 * The timer might create new processes to isolate the code being timed.
 * Specifying this flag prevents any new processes from being created.
 */
#define TIMER_NOPROC 4

/*
 * The timer might create new threads to isolate the code being timed.
 * Specifying this flag prevents any new threads from being created.
 */
#define TIMER_NOTHREAD 8

struct timer {
    unsigned long long ns;
    unsigned int reps;
};

/*
 * Measures function 'func'. Sets timer->ns to the number of nanoseconds it took,
 * and timer->reps to the number of repetitions. Uses the existing values of
 * timer->ns and timer->reps as maximums - it won't do any more repetitions or take
 * significantly more time than those specify. However, you can set one of them
 * to 0 to make it unlimited. 0 is returned on success, -1 on failure.
 */
int
timer_measure(void (*func)(void), struct timer *timer, int flags);

// These next functions are shortcuts that use timer_measure and use the
// default flags. They just use 'timer' as an out argument.

int
timer_measure_ms(void (*func)(void), unsigned long long ms,
                 struct timer *timer);

int
timer_measure_reps(void (*func)(void), unsigned int reps, struct timer *timer);

#endif

Add more flags and documentation

Add more flags and documentation


// Copyright (c) 2012 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_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_
#pragma once

namespace extension_management_api_constants {

// Keys used for incoming arguments and outgoing JSON data.
extern const char kAppLaunchUrlKey[];
extern const char kDescriptionKey[];
extern const char kEnabledKey[];
extern const char kDisabledReasonKey[];
extern const char kHomepageUrlKey[];
extern const char kHostPermissionsKey[];
extern const char kIconsKey[];
extern const char kIdKey[];
extern const char kIsAppKey[];
extern const char kNameKey[];
extern const char kOfflineEnabledKey[];
extern const char kOptionsUrlKey[];
extern const char kPermissionsKey[];
extern const char kMayDisableKey[];
extern const char kSizeKey[];
extern const char kUpdateUrlKey[];
extern const char kUrlKey[];
extern const char kVersionKey[];

// Values for outgoing JSON data.
extern const char kDisabledReasonPermissionsIncrease[];
extern const char kDisabledReasonUnknown[];

// Error messages.
extern const char kExtensionCreateError[];
extern const char kGestureNeededForEscalationError[];
extern const char kManifestParseError[];
extern const char kNoExtensionError[];
extern const char kNotAnAppError[];
extern const char kUserCantDisableError[];
extern const char kUserDidNotReEnableError[];

}  // namespace extension_management_api_constants

#endif  // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_

// Copyright (c) 2012 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_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_
#define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_
#pragma once

namespace extension_management_api_constants {

// Keys used for incoming arguments and outgoing JSON data.
extern const char kAppLaunchUrlKey[];
extern const char kDisabledReasonKey[];
extern const char kHostPermissionsKey[];
extern const char kIconsKey[];
extern const char kIsAppKey[];
extern const char kPermissionsKey[];
extern const char kSizeKey[];
extern const char kUpdateUrlKey[];
extern const char kUrlKey[];

// Values for outgoing JSON data.
extern const char kDisabledReasonPermissionsIncrease[];
extern const char kDisabledReasonUnknown[];

// Error messages.
extern const char kExtensionCreateError[];
extern const char kGestureNeededForEscalationError[];
extern const char kManifestParseError[];
extern const char kNoExtensionError[];
extern const char kNotAnAppError[];
extern const char kUserCantDisableError[];
extern const char kUserDidNotReEnableError[];

}  // namespace extension_management_api_constants

#endif  // CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_

Remove leftover constant declarations accidentally left behind by a previous patch.

BUG=119692
TEST=compile succeeds
Review URL: https://chromiumcodereview.appspot.com/9903017

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


/*
 * Standard image size definitions
 *
 * Copyright (C) 2013, Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#ifndef _IMAGE_SIZES_H
#define _IMAGE_SIZES_H

#define CIF_WIDTH	352
#define CIF_HEIGHT	288

#define QCIF_WIDTH	176
#define QCIF_HEIGHT	144

#define QQCIF_WIDTH	88
#define QQCIF_HEIGHT	72

#define QQVGA_WIDTH	160
#define QQVGA_HEIGHT	120

#define QVGA_WIDTH	320
#define QVGA_HEIGHT	240

#define SXGA_WIDTH	1280
#define SXGA_HEIGHT	1024

#define VGA_WIDTH	640
#define VGA_HEIGHT	480

#endif /* _IMAGE_SIZES_H */

[media] V4L: Add header file defining standard image sizes

Add common header file defining standard image sizes, so we can
avoid redefining those in each driver.

Signed-off-by: Sylwester Nawrocki <3ec980a5bae855ae8ff893bb06e50918b93af134@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <ad86ba2154032c9f55743a190faa2459a9d61d42@redhat.com>


#ifndef CALLER_CONFIGURABLE_CLASS_WRAPPER_H
#define CALLER_CONFIGURABLE_CLASS_WRAPPER_H

#include <memory>
#include <nan.h>
#include <string>

#include "cleanup_handle.h"

namespace nodegit {
  class Context;

  template<typename Traits>
  class ConfigurableClassWrapper : public CleanupHandle {
  public:
    typedef typename Traits::cType cType;
    typedef typename Traits::configurableCppClass configurableCppClass;

    struct v8ConversionResult {
      v8ConversionResult(std::string _error)
        : error(std::move(_error)), result(nullptr)
      {}

      v8ConversionResult(std::shared_ptr<configurableCppClass> _result)
        : result(std::move(_result))
      {}

      std::string error;
      std::shared_ptr<configurableCppClass> result;
    };

    // We copy the entity
    ConfigurableClassWrapper(nodegit::Context *_nodeGitContext)
      : nodegitContext(_nodeGitContext), raw(nullptr) {}

    virtual ~ConfigurableClassWrapper() {
      if (raw != nullptr) {
        delete raw;
        raw = nullptr;
      }
    }

    const Context *nodegitContext = nullptr;
    cType *GetValue() {
      return raw;
    }

  protected:
    cType *raw;
    std::vector<std::shared_ptr<CleanupHandle>> childCleanupVector;
  };
}

#endif

#ifndef CALLER_CONFIGURABLE_CLASS_WRAPPER_H
#define CALLER_CONFIGURABLE_CLASS_WRAPPER_H

#include <memory>
#include <nan.h>
#include <string>

#include "cleanup_handle.h"

namespace nodegit {
  class Context;

  template<typename Traits>
  class ConfigurableClassWrapper : public CleanupHandle {
  public:
    typedef typename Traits::cType cType;
    typedef typename Traits::configurableCppClass configurableCppClass;

    struct v8ConversionResult {
      v8ConversionResult(std::string _error)
        : error(std::move(_error)), result(nullptr)
      {}

      v8ConversionResult(std::shared_ptr<configurableCppClass> _result)
        : result(std::move(_result))
      {}

      std::string error;
      std::shared_ptr<configurableCppClass> result;
    };

    // We copy the entity
    ConfigurableClassWrapper(nodegit::Context *_nodeGitContext)
      : nodegitContext(_nodeGitContext), raw(nullptr) {}

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

    virtual ~ConfigurableClassWrapper() {
      if (raw != nullptr) {
        delete raw;
        raw = nullptr;
      }
    }

    const Context *nodegitContext = nullptr;
    cType *GetValue() {
      return raw;
    }

  protected:
    cType *raw;
    std::vector<std::shared_ptr<CleanupHandle>> childCleanupVector;
  };
}

#endif

Delete copy and move constructors for ConfigurableClassWrapper


// REQUIRES: clang-driver
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target

//
// Verify that CUDA device commands do not get OpenMP flags.
//
// RUN: %clang -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp %s 2>&1 \
// RUN: | FileCheck %s --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE
//
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE:      clang{{.*}}" "-cc1" "-triple" "nvptx64-nvidia-cuda"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NOT:  -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ptxas" "-m64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: fatbinary" "--cuda" "-64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux-gnu"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE:      -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ld" "-z" "relro" "--hash-style=gnu" "--eh-frame-hdr" "-m" "elf64lppc"

// REQUIRES: clang-driver
// REQUIRES: powerpc-registered-target
// REQUIRES: nvptx-registered-target

//
// Verify that CUDA device commands do not get OpenMP flags.
//
// RUN: %clang -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp %s 2>&1 \
// RUN: | FileCheck %s --check-prefix NO-OPENMP-FLAGS-FOR-CUDA-DEVICE
//
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE:      clang{{.*}}" "-cc1" "-triple" "nvptx64-nvidia-cuda"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NOT:  -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ptxas" "-m64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: fatbinary" "--cuda" "-64"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: clang{{.*}}" "-cc1" "-triple" "powerpc64le--linux-gnu"
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE:      -fopenmp
// NO-OPENMP-FLAGS-FOR-CUDA-DEVICE-NEXT: ld" {{.*}}"-m" "elf64lppc"

[OpenMP] Fix link command pattern in offloading interoperability test.

It was causing a few bots to fail.

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


#ifndef _SERVER_H
#define _SERVER_H
#include <time.h>
#include <sys/epoll.h>
#include "list.h"
#include "threadpool.h"
int open_listenfd(int port);
void* check_connections(void* data);

struct http_socket {
    int fd;
    /*struct pollfd* poll_fd;*/
    struct epoll_event event;
    char* read_buffer;
    int read_buffer_size;
    time_t last_access;
    struct list_elem elem;
};

struct future_elem {
    struct future* future;
    struct list_elem elem;
};
#endif

#ifndef _SERVER_H
#define _SERVER_H
#include <time.h>
#include <sys/epoll.h>
#include "list.h"
#include "threadpool.h"
struct http_socket;

int open_listenfd(int port);
void* check_connections(void* data);
int watch_read(struct http_socket* http);
int watch_write(struct http_socket* http);
int destroy_socket(struct http_socket* http);

struct http_socket {
    int fd;
    /*struct pollfd* poll_fd;*/
    struct epoll_event event;
    char* read_buffer;
    int read_buffer_size;
    time_t last_access;
    struct list_elem elem;
};

struct future_elem {
    struct future* future;
    struct list_elem elem;
};
#endif

Define functions for polling of sockets.


//
//  PBMacros.h
//  pblib
//
//  Created by haxpor on 3/5/15.
//  Copyright (c) 2015 Maethee Chongchitnant. All rights reserved.
//

#ifndef pblib_PBMacros_h
#define pblib_PBMacros_h

#define PB_IS_NSNull(obj)   ((obj == (id)[NSNull null]) ? YES : NO)

#define PB_IS_NIL_OR_NSNull(obj)    ((obj == nil) || (obj == (id)[NSNull null]) ? YES : NO)
#endif

//
//  PBMacros.h
//  pblib
//
//  Created by haxpor on 3/5/15.
//  Copyright (c) 2015 Maethee Chongchitnant. All rights reserved.
//

#ifndef pblib_PBMacros_h
#define pblib_PBMacros_h

/**
 Check against NSNull.
 If input obj is NSNull then return YES, otherwise return NO.
 */
#define PB_IS_NSNull(obj)   ((obj == (id)[NSNull null]) ? YES : NO)

/**
 Check against nil or NSNull.
 If input obj is nil, or NSNull then return YES, otherwise return NO.
 */
#define PB_IS_NIL_OR_NSNull(obj)    ((obj == nil) || (obj == (id)[NSNull null]) ? YES : NO)

#endif

Add comment for added macros.

Add comment for added macros.


C $Header$
C $Name$

c Land Grid Horizontal Dimension (Number of Tiles)
c ------------------------------------------------
      integer nchp, maxtyp
      parameter (maxtyp = 10)
c     parameter (nchp = sNx*sNy*maxtyp)
      parameter (nchp = 2048)

C $Header$
C $Name$

c Land Grid Horizontal Dimension (Number of Tiles)
c ------------------------------------------------
      integer nchp, maxtyp
      parameter (maxtyp = 10)
      parameter (nchp = sNx*sNy*maxtyp)

Make sure nchp is big enough for real vegetation tiles


// PARAM: --enable ana.int.interval --disable exp.widen-context --disable ana.base.context.int
#include <assert.h>

int f(int x) {
  if (x)
    return f(x+1);
  else
    return x;
}

int main () {
  int a = f(1);
  assert(!a);
  return 0;
}

Add test for ana.base.context.int disabled


// 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 UI_AURA_AURA_SWITCHES_H_
#define UI_AURA_AURA_SWITCHES_H_
#pragma once

namespace switches {

extern const char kAuraHostWindowSize[];
extern const char kAuraWindows[];

}  // namespace switches

#endif  // UI_AURA_AURA_SWITCHES_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 UI_AURA_AURA_SWITCHES_H_
#define UI_AURA_AURA_SWITCHES_H_
#pragma once

#include "ui/aura/aura_export.h"

namespace switches {

AURA_EXPORT extern const char kAuraHostWindowSize[];
AURA_EXPORT extern const char kAuraWindows[];

}  // namespace switches

#endif  // UI_AURA_AURA_SWITCHES_H_

Fix shared library build for aura.

Fix shared library build for aura.

TBR=ben@chromium.org,derat@chromium.org
R=ben@chromium.org,derat@chromium.org
BUG=none
TEST=none

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

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


// RUN: %llvmgcc %s -S -fnested-functions -o - | grep {sret *%agg.result}

struct X { int m, n; };

struct X p(int n) {
  struct X c(int m) {
    struct X x;
    x.m = m;
    x.n = n;
    return x;
  }
  return c(n);
}

// RUN: %llvmgcc %s -S -fnested-functions -o - | grep {sret *%agg.result}

struct X { int m, n, o, p; };

struct X p(int n) {
  struct X c(int m) {
    struct X x;
    x.m = m;
    x.n = n;
    return x;
  }
  return c(n);
}

Make the struct bigger, in an attempt to get a "struct return" on more
platforms.

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


/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions or slots use
** Qt Designer which will update this file, preserving your code. Create an
** init() function in place of a constructor, and a destroy() function in
** place of a destructor.
*****************************************************************************/

void WebPresencePrefsUI::init()
{
    m_url->setMode( KFile::File );
    m_userStyleSheet->setFilter( "*.xsl" );
}

Support using KURLRequester with remote files

svn path=/trunk/kdenetwork/kopete/; revision=198696


//
//  OCTFileContent.h
//  OctoKit
//
//  Created by Aron Cedercrantz on 14-07-2013.
//  Copyright (c) 2013 GitHub. All rights reserved.
//

#import "OCTContent.h"

// A file in a git repository.
@interface OCTFileContent : OCTContent

// The encoding of the file content.
@property (nonatomic, copy, readonly) NSString *encoding;

// The raw, encoded, content of the file.
//
// See encoding for the encoding used.
@property (nonatomic, copy, readonly) NSString *content;

@end

//
//  OCTFileContent.h
//  OctoKit
//
//  Created by Aron Cedercrantz on 14-07-2013.
//  Copyright (c) 2013 GitHub. All rights reserved.
//

#import "OCTContent.h"

// A file in a git repository.
@interface OCTFileContent : OCTContent

// The encoding of the file content.
@property (nonatomic, copy, readonly) NSString *encoding;

// The raw, encoded, content of the file.
//
// See `encoding` for the encoding used.
@property (nonatomic, copy, readonly) NSString *content;

@end

Add backticks around the ref to encoding property.

Signed-off-by: Aron Cedercrantz <ce30127eefa07a02d568832e3de6952fb491981c@cedercrantz.se>


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

/* Run an program (in this case 'ls -la') and show it in stdout */

int main(void)
{
  FILE *fd;
  char str_cmd[1024], str_buf[1024];

  sprintf(str_cmd, "ls -la /tmp >/dev/null && echo testmt > /tmp/sysmt.log && cat /tmp/sysmt.log");
  //sprintf(str_cmd, "ls -la /tmp");

  fd = popen(str_cmd, "r");
  while (fgets(str_buf, 1024, fd) != NULL)
  printf("%s", str_buf);

  fclose(fd);

  exit(0);
}

Add example to run an command on linux using C language


#pragma once

#include <QtGui/QMouseEvent>
#include <QtGui/QPaintEvent>
#include <QtWidgets/QWidget>

#include "binaryninjaapi.h"
#include "dockhandler.h"
#include "uitypes.h"

class ContextMenuManager;
class DisassemblyContainer;
class Menu;
class ViewFrame;

class BINARYNINJAUIAPI ReflectionView: public QWidget, public DockContextHandler
{
	Q_OBJECT
	Q_INTERFACES(DockContextHandler)

	ViewFrame* m_frame;
	BinaryViewRef m_data;
	DisassemblyContainer* m_disassemblyContainer;

public:
	ReflectionView(ViewFrame* frame, BinaryViewRef data);
	~ReflectionView();

	virtual void notifyOffsetChanged(uint64_t offset) override;
	virtual void notifyViewChanged(ViewFrame* frame) override;
	virtual bool shouldBeVisible(ViewFrame* frame) override;

protected:
	virtual void contextMenuEvent(QContextMenuEvent* event) override;
};

#pragma once

#include <QtGui/QMouseEvent>
#include <QtGui/QPaintEvent>
#include <QtWidgets/QWidget>

#include "binaryninjaapi.h"
#include "dockhandler.h"
#include "uitypes.h"

class ContextMenuManager;
class DisassemblyContainer;
class Menu;
class ViewFrame;

class BINARYNINJAUIAPI ReflectionView: public QWidget, public DockContextHandler
{
	Q_OBJECT
	Q_INTERFACES(DockContextHandler)

	ViewFrame* m_frame;
	BinaryViewRef m_data;
	DisassemblyContainer* m_disassemblyContainer;

public:
	ReflectionView(ViewFrame* frame, BinaryViewRef data);
	~ReflectionView();

	virtual void notifyOffsetChanged(uint64_t offset) override;
	virtual void notifyViewChanged(ViewFrame* frame) override;
	virtual void notifyVisibilityChanged(bool visible) override;
	virtual bool shouldBeVisible(ViewFrame* frame) override;

protected:
	virtual void contextMenuEvent(QContextMenuEvent* event) override;
};

Update reflection view on transition to visible state.