// SKIP PARAM: --set solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','apron','escape']" --set ana.base.privatization none --set ana.apron.privatization dummy
int rec(int i,int* ptr) {
    int top;
    int x = 17;

    if(i == 0) {
        rec(5,&x);
        // Recursive call may have modified x
        assert(x == 17); //UNKNOWN!

        // If we analyse this with int contexts, there is no other x that is reachable, so this
        // update is strong
        x = 17;
        assert(x == 17);
    } else {
        x = 31;

        // ptr points to the outer x, it is unaffected by this assignment
        // and should be 17
        assert(*ptr == 31); //UNKNOWN!

        if(top) {
            ptr = &x;
        }

        // ptr may now point to both the inner and the outer x
        *ptr = 12;
        assert(*ptr == 12); //UNKNOWN!
        assert(x == 12); //UNKNOWN!

        if(*ptr == 12) {
            assert(x == 12); //UNKNOWN!
        }

        // ptr may still point to the outer instance
        assert(ptr == &x); //UNKNOWN!

        // Another copy of x is reachable, so we are conservative and do a weak update
        x = 31;
        assert(x == 31); // UNKNOWN
    }
    return 0;
}

int main() {
    int t;
    rec(0,&t);
    return 0;
}

Add "escaping" via recursion example

Add "escaping" via recursion example


#include <assert.h>

int main() {
  int a = 1;
  int b = 0;

  if (a && b) { // TODO WARN
    assert(0); // NOWARN (unreachable)
  }

  return 0;
}

Add regression test for multiple dead branches


/*
 * Author: Jhonatan Casale (jhc)
 *
 * Contact : jhonatan@jhonatancasale.com
 *         : casale.jhon@gmail.com
 *         : https://github.com/jhonatancasale
 *         : https://twitter.com/jhonatancasale
 *         : http://jhonatancasale.github.io/
 *
 * Create date Sat 10 Dec 16:28:22 BRST 2016
 *
 */

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

int main (int argc, char **argv)
{
  int i;
  int array[ 100 ];
  int sum = 0;

  for ( i = 0; i < 100; i++ )
    array[ i ] = i + 1;

  for ( i = 0; i < 100; i++ )
    sum += array[ i ];

  printf ("Sum from 0 to 100: %d\n", sum);

  return (EXIT_SUCCESS);
}

Add arrays example in C

Add arrays example in C


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

#include <folly/Range.h>
#include <chrono>

namespace facebook {

class SpinLock {
};

class SpinLockHolder {
public:
  explicit SpinLockHolder(SpinLock*) {}
};

namespace stats {

enum ExportType {
  SUM,
  COUNT,
  AVG,
  RATE,
  PERCENT,
  NUM_TYPES,
};

struct ExportedStat {
  void addValue(std::chrono::seconds, int64_t) {}
};

class ExportedStatMap {
public:
  class LockAndStatItem {
  public:
    std::shared_ptr<SpinLock> first;
    std::shared_ptr<ExportedStat> second;
  };
  LockAndStatItem getLockAndStatItem(folly::StringPiece,
                                     const ExportType* = nullptr) {
    static LockAndStatItem it = {
      std::make_shared<SpinLock>(), std::make_shared<ExportedStat>()
    };
    return it;
  }
};

}}

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

#include <folly/Range.h>
#include <chrono>

namespace facebook {

class SpinLock {
};

class SpinLockHolder {
public:
  explicit SpinLockHolder(SpinLock*) {}
};

namespace stats {

enum ExportType {
  SUM,
  COUNT,
  AVG,
  RATE,
  PERCENT,
  NUM_TYPES,
};

struct ExportedStat {
  void addValue(std::chrono::seconds, int64_t) {}
};

class ExportedStatMap {
public:
  class LockAndStatItem {
  public:
    std::shared_ptr<SpinLock> first;
    std::shared_ptr<ExportedStat> second;
  };
  LockAndStatItem getLockAndStatItem(folly::StringPiece,
                                     const ExportType* = nullptr) {
    static LockAndStatItem it = {
      std::make_shared<SpinLock>(), std::make_shared<ExportedStat>()
    };
    return it;
  }

  std::shared_ptr<ExportedStat> getStatPtr(folly::StringPiece name) {
      return std::make_shared<ExportedStat>();
  }
};

}}

Fix some build issues in the open source code.

Summary:
Our code grew some implicit transitive dependencies on
the headers that internal headers included, but our stubs
did not. This fixes that, and updates our stubs to match
what our code expects.

Test Plan: Apply to open source repository and test.

Reviewed By: yfeldblum@fb.com

Subscribers: fbcode-common-diffs@, net-systems@, yfeldblum

FB internal diff: D1982664

Signature: t1:1982664:1428695964:3fd76243d013ca4969c0dcd91f97e3292cf13c1f

Signed-off-by: Ori Bernstein <f1fed15cf5b8387c8aee8bc535d6c2b48da91000@fb.com>


// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "GameFramework/Pawn.h"
#include "Tank.generated.h" // Put new includes above

class UTankBarrel; // Do a class forward declaration
class UTurret;
class UTankAimingComponent;
class AProjectile;

UCLASS()
class DEV_API ATank : public APawn
{
	GENERATED_BODY()

public:
    void AimAt(FVector hitLocation);

    // Make the following method be callable from blueprint
    UFUNCTION(BlueprintCallable, Category = Setup)
    void SetBarrelReference(UTankBarrel* barrelToSet);

    UFUNCTION(BlueprintCallable, Category = Setup)
    void SetTurretReference(UTurret* turretToSet);

    UFUNCTION(BlueprintCallable, Category = Setup)
    void FireCannon();

protected:
    UTankAimingComponent* tankAimingComponent = nullptr;

private:
    UPROPERTY(EditAnywhere, Category = Firing)
    float launchSpeed = 4000.0f; // 1000 metres per second. TODO: find a sensible default

	// Sets default values for this pawn's properties
	ATank();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

    UPROPERTY(EditAnywhere, Category = "Setup")
    TSubclassOf<AProjectile> projectileBlueprint;

    UTankBarrel* barrel = nullptr;
    float reloadTimeInSeconds = 3.0f; // sensible default
    double lastFireTime = 0;
};

// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "GameFramework/Pawn.h"
#include "Tank.generated.h" // Put new includes above

class UTankBarrel; // Do a class forward declaration
class UTurret;
class UTankAimingComponent;
class AProjectile;

UCLASS()
class DEV_API ATank : public APawn
{
	GENERATED_BODY()

public:
    void AimAt(FVector hitLocation);

    // Make the following method be callable from blueprint
    UFUNCTION(BlueprintCallable, Category = "Setup")
    void SetBarrelReference(UTankBarrel* barrelToSet);

    UFUNCTION(BlueprintCallable, Category = "Setup")
    void SetTurretReference(UTurret* turretToSet);

    UFUNCTION(BlueprintCallable, Category = "Setup")
    void FireCannon();

protected:
    UTankAimingComponent* tankAimingComponent = nullptr;

private:
    UPROPERTY(EditAnywhere, Category = Firing)
    float launchSpeed = 4000.0f; // 1000 metres per second. TODO: find a sensible default

	// Sets default values for this pawn's properties
	ATank();

	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

    UPROPERTY(EditDefaultsOnly, Category = "Setup")
    TSubclassOf<AProjectile> projectileBlueprint;

    UTankBarrel* barrel = nullptr;

    UPROPERTY(EditDefaultsOnly, Category = "Firing")
    float reloadTimeInSeconds = 3.0f; // sensible default
    double lastFireTime = 0;
};

Use EditDefaultsOnly insted of EditAnywhere


#include "qnd.h"

/* Global context for server */
qnd_context ctx;

int main(int argc, char **argv)
{
  struct ev_signal signal_watcher;
  struct ev_io w_accept;
  struct ev_loop *loop = ev_default_loop(0);

  qnd_context_init(&ctx);
  if (qnd_context_listen(&ctx, DEFAULT_PORT) == -1)
    exit(1);

  ev_signal_init(&signal_watcher, sigint_cb, SIGINT);
  ev_signal_start(loop, &signal_watcher);

  ev_io_init(&w_accept, accept_cb, ctx.sd, EV_READ);
  ev_io_start(loop, &w_accept);

  ev_loop(loop, 0);

  qnd_context_cleanup(&ctx);

  return 0;
}

#include "qnd.h"

/* Global context for server */
qnd_context ctx;

int main(int argc, char **argv)
{
  struct ev_signal signal_watcher;
  struct ev_io w_accept;
  struct ev_loop *loop = ev_default_loop(0);

  qnd_context_init(&ctx);
  if (qnd_context_listen(&ctx, DEFAULT_PORT) == -1)
    exit(1);

  ev_signal_init(&signal_watcher, sigint_cb, SIGINT);
  ev_signal_start(loop, &signal_watcher);

  ev_io_init(&w_accept, accept_cb, ctx.sd, EV_READ);
  ev_io_start(loop, &w_accept);

  ev_loop(loop, 0);

  ev_signal_stop(loop, &signal_watcher);
  ev_io_stop(loop, &w_accept);
  qnd_context_cleanup(&ctx);

  return 0;
}

Stop pending watchers during shutdown.

Stop pending watchers during shutdown.


// LAF OS Library
// Copyright (C) 2021  Igara Studio S.A.
// Copyright (C) 2012-2014  David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.

#ifndef OS_NATIVE_CURSOR_H_INCLUDED
#define OS_NATIVE_CURSOR_H_INCLUDED
#pragma once

#include "gfx/fwd.h"

namespace os {

  enum class NativeCursor {
    Hidden,
    Arrow,
    Crosshair,
    IBeam,
    Wait,
    Link,
    Help,
    Forbidden,
    Move,
    SizeNS,
    SizeWE,
    SizeN,
    SizeNE,
    SizeE,
    SizeSE,
    SizeS,
    SizeSW,
    SizeW,
    SizeNW,

    Cursors
  };

} // namespace os

#endif

// LAF OS Library
// Copyright (C) 2021-2022  Igara Studio S.A.
// Copyright (C) 2012-2014  David Capello
//
// This file is released under the terms of the MIT license.
// Read LICENSE.txt for more information.

#ifndef OS_NATIVE_CURSOR_H_INCLUDED
#define OS_NATIVE_CURSOR_H_INCLUDED
#pragma once

#include "gfx/fwd.h"

namespace os {

  enum class NativeCursor {
    Hidden,
    Arrow,
    Crosshair,
    IBeam,
    Wait,
    Link,
    Help,
    Forbidden,
    Move,
    SizeNS,
    SizeWE,
    SizeN,
    SizeNE,
    SizeE,
    SizeSE,
    SizeS,
    SizeSW,
    SizeW,
    SizeNW,

    Cursors [[maybe_unused]]
  };

} // namespace os

#endif

Mark NativeCursor::Cursors as not needed in switch/cases


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

#ifndef CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_

#include "base/basictypes.h"
#include "content/browser/browser_message_filter.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaType.h"

class GURL;

class QuotaDispatcherHost : public BrowserMessageFilter {
 public:
  ~QuotaDispatcherHost();
  bool OnMessageReceived(const IPC::Message& message, bool* message_was_ok);

 private:
  void OnQueryStorageUsageAndQuota(
      int request_id,
      const GURL& origin_url,
      WebKit::WebStorageQuotaType type);
  void OnRequestStorageQuota(
      int request_id,
      const GURL& origin_url,
      WebKit::WebStorageQuotaType type,
      int64 requested_size);
};

#endif  // CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_

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

#ifndef CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_
#define CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_

#include "base/basictypes.h"
#include "content/browser/browser_message_filter.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaType.h"

class GURL;

class QuotaDispatcherHost : public BrowserMessageFilter {
 public:
  ~QuotaDispatcherHost();
  virtual bool OnMessageReceived(const IPC::Message& message,
                                 bool* message_was_ok);

 private:
  void OnQueryStorageUsageAndQuota(
      int request_id,
      const GURL& origin_url,
      WebKit::WebStorageQuotaType type);
  void OnRequestStorageQuota(
      int request_id,
      const GURL& origin_url,
      WebKit::WebStorageQuotaType type,
      int64 requested_size);
};

#endif  // CONTENT_BROWSER_RENDERER_HOST_QUOTA_DISPATCHER_HOST_H_

Fix clang build that have been broken by 81364.

BUG=none
TEST=green tree
TBR=jam

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

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


/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */

#include "common.h"
#include "commands.h"
#include "imap-expunge.h"

bool cmd_close(struct client_command_context *cmd)
{
	struct client *client = cmd->client;
	struct mailbox *mailbox = client->mailbox;
	struct mail_storage *storage;

	if (!client_verify_open_mailbox(cmd))
		return TRUE;

	storage = mailbox_get_storage(mailbox);
	client->mailbox = NULL;

	if (!imap_expunge(mailbox, NULL))
		client_send_untagged_storage_error(client, storage);

	if (mailbox_close(&mailbox) < 0)
                client_send_untagged_storage_error(client, storage);
	client_update_mailbox_flags(client, NULL);

	client_send_tagline(cmd, "OK Close completed.");
	return TRUE;
}

/* Copyright (c) 2002-2008 Dovecot authors, see the included COPYING file */

#include "common.h"
#include "commands.h"
#include "imap-expunge.h"

bool cmd_close(struct client_command_context *cmd)
{
	struct client *client = cmd->client;
	struct mailbox *mailbox = client->mailbox;
	struct mail_storage *storage;

	if (!client_verify_open_mailbox(cmd))
		return TRUE;

	storage = mailbox_get_storage(mailbox);
	client->mailbox = NULL;

	if (!imap_expunge(mailbox, NULL))
		client_send_untagged_storage_error(client, storage);
	else if (mailbox_sync(mailbox, 0, 0, NULL) < 0)
		client_send_untagged_storage_error(client, storage);

	if (mailbox_close(&mailbox) < 0)
                client_send_untagged_storage_error(client, storage);
	client_update_mailbox_flags(client, NULL);

	client_send_tagline(cmd, "OK Close completed.");
	return TRUE;
}

CLOSE: Synchronize the mailbox after expunging messages to actually get them
expunged.


#pragma once

#include <cmath>
#include <vector>

#include <murmur3/MurmurHash3.h>
#include <libcount/hll.h>

#include "type/value.h"
#include "common/macros.h"
#include "common/logger.h"

namespace peloton {
namespace optimizer {

/*
 * A wrapper for libcount::HLL with murmurhash3
 */
class HLL {
 public:

  HLL(const int kPrecision = 8) {
    hll_ = libcount::HLL::Create(kPrecision);
  }

  void Update(type::Value& value) {
    hll_->Update(Hash(value));
  }

  uint64_t EstimateCardinality() {
    uint64_t cardinality = hll_->Estimate();
    LOG_INFO("Estimated cardinality with HLL: [%lu]", cardinality);
    return cardinality;
  }

  ~HLL() {
    delete hll_;
  }

 private:
  libcount::HLL* hll_;

  uint64_t Hash(type::Value& value) {
    uint64_t hash[2];
    const char* raw_value = value.ToString().c_str();
    MurmurHash3_x64_128(raw_value, (uint64_t)strlen(raw_value), 0, hash);
    return hash[0];
  }
};

} /* namespace optimizer */
} /* namespace peloton */

#pragma once

#include <cmath>
#include <vector>

#include <murmur3/MurmurHash3.h>
#include <libcount/hll.h>

#include "type/value.h"
#include "common/macros.h"
#include "common/logger.h"

namespace peloton {
namespace optimizer {

/*
 * A wrapper for libcount::HLL with murmurhash3
 */
class HLL {
 public:

  HLL(const int kPrecision = 8) {
    hll_ = libcount::HLL::Create(kPrecision);
  }

  void Update(type::Value& value) {
    hll_->Update(Hash(value));
  }

  uint64_t EstimateCardinality() {
    uint64_t cardinality = hll_->Estimate();
    LOG_INFO("Estimated cardinality with HLL: [%lu]", cardinality);
    return cardinality;
  }

  ~HLL() {
    delete hll_;
  }

 private:
  libcount::HLL* hll_;

  uint64_t Hash(type::Value& value) {
    uint64_t hash[2];
    std::string value_str = value.ToString();
    const char* raw_value = value_str.c_str();
    MurmurHash3_x64_128(raw_value, (uint64_t)strlen(raw_value), 0, hash);
    return hash[0];
  }
};

} /* namespace optimizer */
} /* namespace peloton */

Fix valgrind 'invalid read of size 1' bug.


/*
 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"

/* C version of WebRtcSpl_CrossCorrelation() for generic platforms. */
void WebRtcSpl_CrossCorrelationC(int32_t* cross_correlation,
                                 const int16_t* seq1,
                                 const int16_t* seq2,
                                 int16_t dim_seq,
                                 int16_t dim_cross_correlation,
                                 int right_shifts,
                                 int step_seq2) {
  int i = 0, j = 0;

  for (i = 0; i < dim_cross_correlation; i++) {
    int32_t corr = 0;
    /* Unrolling doesn't seem to improve performance. */
    for (j = 0; j < dim_seq; j++) {
      // It's not clear why casting |right_shifts| here helps performance.
      corr += (seq1[j] * seq2[j]) >> (int16_t)right_shifts;
    }
    seq2 += step_seq2;
    *cross_correlation++ = corr;
  }
}

/*
 *  Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license
 *  that can be found in the LICENSE file in the root of the source
 *  tree. An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

#include "webrtc/common_audio/signal_processing/include/signal_processing_library.h"

/* C version of WebRtcSpl_CrossCorrelation() for generic platforms. */
void WebRtcSpl_CrossCorrelationC(int32_t* cross_correlation,
                                 const int16_t* seq1,
                                 const int16_t* seq2,
                                 int16_t dim_seq,
                                 int16_t dim_cross_correlation,
                                 int right_shifts,
                                 int step_seq2) {
  int i = 0, j = 0;

  for (i = 0; i < dim_cross_correlation; i++) {
    int32_t corr = 0;
    /* Unrolling doesn't seem to improve performance. */
    for (j = 0; j < dim_seq; j++)
      corr += (seq1[j] * seq2[j]) >> right_shifts;
    seq2 += step_seq2;
    *cross_correlation++ = corr;
  }
}

Test whether removing a cast still hurts performance.

BUG=499241
TEST=none
TBR=andrew

Review URL: https://codereview.webrtc.org/1206653002

Cr-Original-Commit-Position: 972c6d2dc6dd5efdad1377c0d224e03eb8f276f7@{#9491}
Cr-Mirrored-From: https://chromium.googlesource.com/external/webrtc
Cr-Mirrored-Commit: 6bfc82aaf18e42fcc7328b81ffb3ec3cf360d732


/*++

Copyright (c) 2006, Intel Corporation. All rights reserved.
This software and associated documentation (if any) is furnished
under a license and may only be used or copied in accordance
with the terms of the license. Except as permitted by such
license, no part of this software or documentation may be
reproduced, stored in a retrieval system, or transmitted in any
form or by any means without the express written consent of
Intel Corporation.

Module Name:

  Ps2Policy.h

Abstract:

  Protocol used for PS/2 Policy definition.

--*/

#ifndef _PS2_POLICY_PROTOCOL_H_
#define _PS2_POLICY_PROTOCOL_H_

#define EFI_PS2_POLICY_PROTOCOL_GUID \
  { \
    0x4df19259, 0xdc71, 0x4d46, {0xbe, 0xf1, 0x35, 0x7b, 0xb5, 0x78, 0xc4, 0x18 } \
  }

#define EFI_KEYBOARD_CAPSLOCK   0x0004
#define EFI_KEYBOARD_NUMLOCK    0x0002
#define EFI_KEYBOARD_SCROLLLOCK 0x0001

typedef
EFI_STATUS
(EFIAPI *EFI_PS2_INIT_HARDWARE) (
  IN  EFI_HANDLE              Handle
  );

typedef struct {
  UINT8                 KeyboardLight;
  EFI_PS2_INIT_HARDWARE Ps2InitHardware;
} EFI_PS2_POLICY_PROTOCOL;

extern EFI_GUID gEfiPs2PolicyProtocolGuid;

#endif

Add in Ps2keyboard.inf and Ps2Mouse.inf to IntelFrameworkModuelPkg

git-svn-id: 5648d1bec6962b0a6d1d1b40eba8cf5cdb62da3d@3113 6f19259b-4bc3-4df7-8a09-765794883524


//
// SQLiteDatabaseHelper
// Include/SQLiteDatabaseHelper.h
//
#ifndef __SQLITEDATABASEHELPER_H__
#define __SQLITEDATABASEHELPER_H__

#include <stdio.h>

#include <sqlite3.h>

#endif

//
// SQLiteDatabaseHelper
// Include/SQLiteDatabaseHelper.h
//
#ifndef __SQLITEDATABASEHELPER_H__
#define __SQLITEDATABASEHELPER_H__

#include <SQLiteDatabaseHelper/Operations/Read/DatabaseReader.h>

#endif

Include database reader in main library header

Signed-off-by: Gigabyte-Giant <a7441177296edab3db25b9cdf804d04c1ff0afbf@hotmail.com>


#pragma once

// This file is part of 'Atoms' library - https://github.com/yaqwsx/atoms
// Author: Jan 'yaqwsx' Mrzek

#include <array>
#include <initializer_list>
#include <algorithm>

namespace atoms {

template <class T, size_t SIZE>
class RollingAverage {
public:
    RollingAverage() : sum(0), index(0)
    {
        std::fill(values.begin(), values.end(), T(0));
    };

    RollingAverage(const std::initializer_list<T>& l) : sum(0), index(0)
    {
        std::copy(l.begin(), l.end(), values.begin());
    }

    void push(const T& t) {
        sum += t - values[index];
        values[index] = t;
        index++;
        if (index == SIZE)
            index = 0;
    }

    T get_average() {
        return sum / T(SIZE);
    }

    T get_sum() {
        return sum;
    }
private:
    std::array<T, SIZE> values;
    T sum;
    size_t index;
};

}

#pragma once

// This file is part of 'Atoms' library - https://github.com/yaqwsx/atoms
// Author: Jan 'yaqwsx' Mrázek

#include <array>
#include <initializer_list>
#include <algorithm>

namespace atoms {

template <class T, size_t SIZE>
class RollingAverage {
public:
    RollingAverage() : sum(0), index(0)
    {
        std::fill(values.begin(), values.end(), T(0));
    };

    void push(const T& t) {
        sum += t - values[index];
        values[index] = t;
        index++;
        if (index == SIZE)
            index = 0;
    }

    T get_average() {
        return sum / T(SIZE);
    }

    T get_sum() {
        return sum;
    }

    void clear(T t = 0) {
        std::fill(values.begin(), values.end(), t);
        sum = t * SIZE;
    }

private:
    std::array<T, SIZE> values;
    T sum;
    size_t index;
};

}

RollingAverage: Add clear() and delete constructor with initializer_list


// PARAM: --disable ana.int.def_exc --enable ana.int.interval
// Ensures that the cast_to function handles casting for congruences correctly.
// TODO: Implement appropriate cast_to function, enable for congruences only and adjust test if necessary.
#include <assert.h>
#include <stdio.h>

int main(){
  int c = 128;
  for (int i = 0; i < 1; i++) {
      c = c - 150;
   }
  char k = (char) c;
  printf ("k: %d", k);
  assert (k == -22); //UNKNOWN

  k = k + 150;
  assert (k == 0); //UNKNOWN!

}

Add (deactivated) casting test for congruence domain


#define OUTSIDE_SPEEX
#define RANDOM_PREFIX cubeb
#define FLOATING_POINT
#include <speex/speex_resampler.h>

Revert "Force being outside speex."

Revert "Force being outside speex."

This reverts commit 356ee9e85ca2f5999cfa18f356b103dffe09fbbd.


/*
 * *****************************************************************************
 *   Copyright 2014 Spectra Logic Corporation. All Rights Reserved.
 *   Licensed under the Apache License, Version 2.0 (the "License"). You may not
 *   use this file except in compliance with the License. A copy of the License
 *   is located at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 *   or in the "license" file accompanying this file.
 *   This file 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 NUMBER_HELPER_H
#define NUMBER_HELPER_H

#include <QString>

class NumberHelper
{
public:
	static const uint64_t B;
	static const uint64_t KB;
	static const uint64_t MB;
	static const uint64_t GB;
	static const uint64_t TB;

	static QString ToHumanSize(uint64_t bytes);
};

#endif

/*
 * *****************************************************************************
 *   Copyright 2014 Spectra Logic Corporation. All Rights Reserved.
 *   Licensed under the Apache License, Version 2.0 (the "License"). You may not
 *   use this file except in compliance with the License. A copy of the License
 *   is located at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 *   or in the "license" file accompanying this file.
 *   This file 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 NUMBER_HELPER_H
#define NUMBER_HELPER_H

#include <stdint.h>
#include <QString>

class NumberHelper
{
public:
	static const uint64_t B;
	static const uint64_t KB;
	static const uint64_t MB;
	static const uint64_t GB;
	static const uint64_t TB;

	static QString ToHumanSize(uint64_t bytes);
};

#endif

Fix windows build by requiring stdint.h

Fix windows build by requiring stdint.h


// RUN: clang-cc -analyze -warn-uninit-values -verify %s

int f1() {
  int x;
  return x; // expected-warning {{use of uninitialized variable}}
}

int f2(int x) {
  int y;
  int z = x + y; // expected-warning {{use of uninitialized variable}}
  return z;
}

int f3(int x) {
  int y;
  return x ? 1 : y; // expected-warning {{use of uninitialized variable}}
}

int f4(int x) {
  int y;
  if (x) y = 1;
  return y; // expected-warning {{use of uninitialized variable}}
}

int f5() {
  int a;
  a = 30; // no-warning
}

void f6(int i) {
  int x;
  for (i = 0 ; i < 10; i++)
    printf("%d",x++); // expected-warning {{use of uninitialized variable}} \
  // expected-warning{{implicitly declaring C library function 'printf' with type 'int (char const *, ...)'}} \
  // expected-note{{please include the header <stdio.h> or explicitly provide a declaration for 'printf'}}
}

void f7(int i) {
  int x = i;
  int y;
  for (i = 0; i < 10; i++ ) {
    printf("%d",x++); // no-warning
    x += y; // expected-warning {{use of uninitialized variable}}
  }
}

int f8(int j) {
  int x = 1, y = x + 1;
  if (y) // no-warning
    return x;
  return y;
}

Add another uninitialized values test case illustrating that the CFG correctly
handles declarations with multiple variables.

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


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

#define QLA4XXX_DRIVER_VERSION	"5.02.00-k5"

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

#define QLA4XXX_DRIVER_VERSION	"5.02.00-k6"

Update driver version to 5.02.00-k6

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

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


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

#define QLA4XXX_DRIVER_VERSION	"5.02.00-k17"

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

#define QLA4XXX_DRIVER_VERSION	"5.02.00-k18"

Update driver version to 5.02.00-k18

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

Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com>
Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>


//
//  Tomighty - http://www.tomighty.org
//
//  This software is licensed under the Apache License Version 2.0:
//  http://www.apache.org/licenses/LICENSE-2.0.txt
//

#import <Foundation/Foundation.h>

@protocol TYAppUI <NSObject>

- (void)switchToIdleState;
- (void)switchToPomodoroState;
- (void)switchToShortBreakState;
- (void)switchToLongBreakState;
- (void)updateRemainingTime:(int)remainingSeconds;
- (void)updatePomodoroCount:(int)count;
- (void)handlePrerencesChange:(NSString*)which;

@end

//
//  Tomighty - http://www.tomighty.org
//
//  This software is licensed under the Apache License Version 2.0:
//  http://www.apache.org/licenses/LICENSE-2.0.txt
//

#import <Foundation/Foundation.h>

@protocol TYAppUI <NSObject>

- (void)switchToIdleState;
- (void)switchToPomodoroState;
- (void)switchToShortBreakState;
- (void)switchToLongBreakState;
- (void)updateRemainingTime:(int)remainingSeconds;
- (void)updatePomodoroCount:(int)count;

@end

Remove preference change handler declaration.


/**
 * @file
 * @brief
 *
 * @author  Anton Kozlov
 * @date    25.10.2012
 */

#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <assert.h>
#include <hal/context.h>

#include <asm/modes.h>
#include <arm/fpu.h>

/* In the RVCT v2.0 and above, all generated code and C library code
 * will maintain eight-byte stack alignment on external interfaces. */
#define ARM_SP_ALIGNMENT 8

void context_init(struct context *ctx, unsigned int flags,
		void (*routine_fn)(void), void *sp) {
	ctx->lr = (uint32_t) routine_fn;
	ctx->sp = (uint32_t) sp;

	assertf(((uint32_t) sp % ARM_SP_ALIGNMENT) == 0,
		"Stack pointer is not aligned to 8 bytes.\n"
		"Firstly please make sure the thread stack size is aligned to 8 bytes"
	);

	ctx->control = 0;

	if (!(flags & CONTEXT_PRIVELEGED)) {
		ctx->control |= CONTROL_NPRIV;
	}

	arm_fpu_context_init(&ctx->fpu_data);
}

/**
 * @file
 * @brief
 *
 * @author  Anton Kozlov
 * @date    25.10.2012
 */

#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include <assert.h>
#include <hal/context.h>

#include <asm/modes.h>
#include <arm/fpu.h>

/* In the RVCT v2.0 and above, all generated code and C library code
 * will maintain eight-byte stack alignment on external interfaces. */
#define ARM_SP_ALIGNMENT 8

void context_init(struct context *ctx, unsigned int flags,
		void (*routine_fn)(void), void *sp) {
	ctx->lr = (uint32_t) routine_fn;
	ctx->sp = (uint32_t) sp;

	assertf(((uint32_t) sp % ARM_SP_ALIGNMENT) == 0,
		"Stack pointer is not aligned to 8 bytes.\n"
		"Firstly please make sure the thread stack size is aligned to 8 bytes"
	);

	ctx->control = CONTROL_SPSEL_PSP;

	if (!(flags & CONTEXT_PRIVELEGED)) {
		ctx->control |= CONTROL_NPRIV;
	}

	arm_fpu_context_init(&ctx->fpu_data);
}

Use PSP for all threads

cortex-m: Use PSP for all threads


/* This file is part of Metallic, a runtime library for WebAssembly.
 *
 * Copyright (C) 2018 Chen-Pang He <chen.pang.he@jdh8.org>
 *
 * This Source Code Form is subject to the terms of the Mozilla
 * Public License v. 2.0. If a copy of the MPL was not distributed
 * with this file, You can obtain one at http://mozilla.org/MPL/2.0/
 */
#include "floatuntidf.h"

double __floatuntidf(unsigned __int128 a)
{
    return __floatuntidf(a);
}

/* This file is part of Metallic, a runtime library for WebAssembly.
 *
 * Copyright (C) 2018 Chen-Pang He <chen.pang.he@jdh8.org>
 *
 * This Source Code Form is subject to the terms of the Mozilla
 * Public License v. 2.0. If a copy of the MPL was not distributed
 * with this file, You can obtain one at http://mozilla.org/MPL/2.0/
 */
#include "floatuntidf.h"

double __floatuntidf(unsigned __int128 a)
{
    return _floatuntidf(a);
}

Fix a typo which causes infinite recursion


//
//  CWSCore.h
//  yafacwesConsole
//
//  Created by Matthias Lamoureux on 13/07/2015.
//  Copyright (c) 2015 pinguzaph. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface CWSCore : NSObject

@property (nonatomic, strong) NSString * name;

@end

//
//  CWSCore.h
//  yafacwesConsole
//
//  Created by Matthias Lamoureux on 13/07/2015.
//  Copyright (c) 2015 pinguzaph. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface CWSCore : NSObject

@property (nonatomic, copy) NSString * name;

@end

Set the NSString property to copy mode

Set the NSString property to copy mode


#ifndef LIB_TEMPLATE_CMAKE_H
#define LIB_TEMPLATE_CMAKE_H

namespace LibTemplateCMake {

/**
* \class LibTemplateCMake::aClass
* \headerfile template-lib.h <TemplateLib/templatelib.h>
*
* \brief A class from LibTemplateCMake namespace.
*
* This class that does a summation.
*/
class summationClass
{
public:
    /**
    * Constructor
    */
    summationClass();

    /**
    * Destructory
    */
    virtual ~summationClass();

    /**
    * A method that does a summation
    */
    virtual double doSomething(double op1, double op2);
};

/**
* \class LibTemplateCMake::anotherClass
* \headerfile template-lib.h <TemplateLib/templatelib.h>
*
* \brief A derived class from LibTemplateCMake namespace.
*
* This class performs a difference.
*/
class differenceClass : public summationClass
{
public:
    /**
    * Constructor
    */
    differenceClass();

    /**
    * Destructory
    */
    virtual ~differenceClass();

    /**
    * A method that does something
    */
    virtual double doSomething(double op1, double op2);
};

} // namespace LibTemplateCMake

#endif /* LIB_TEMPLATE_CMAKE_H */

#ifndef LIB_TEMPLATE_CMAKE_H
#define LIB_TEMPLATE_CMAKE_H

namespace LibTemplateCMake {

/**
 * \class LibTemplateCMake::aClass
 * \headerfile template-lib.h <TemplateLib/templatelib.h>
 *
 * \brief A class from LibTemplateCMake namespace.
 *
 * This class that does a summation.
 */
class summationClass
{
public:
    /**
     * Constructor
     */
    summationClass();

    /**
     * Destructor
     */
    virtual ~summationClass();

    /**
     * A method that does a summation
     */
    virtual double doSomething(double op1, double op2);
};

/**
 * \class LibTemplateCMake::anotherClass
 * \headerfile template-lib.h <TemplateLib/templatelib.h>
 *
 * \brief A derived class from LibTemplateCMake namespace.
 *
 * This class performs a difference.
 */
class differenceClass : public summationClass
{
public:
    /**
     * Constructor
     */
    differenceClass();

    /**
     * Destructor
     */
    virtual ~differenceClass();

    /**
     * A method that does something
     */
    virtual double doSomething(double op1, double op2);
};

} // namespace LibTemplateCMake

#endif /* LIB_TEMPLATE_CMAKE_H */

Clean up shared lib header code

Clean up shared lib header code


//PARAM: --disable sem.unknown_function.spawn
#include <pthread.h>
#include <assert.h>

int g;
pthread_once_t once = PTHREAD_ONCE_INIT;

void *t_fun(void *arg) {
  assert(1); // reachable!
  return NULL;
}

int main() {
  pthread_once(&once,t_fun);
  return 0;
}

//PARAM: --disable sem.unknown_function.spawn
#include <pthread.h>
#include <assert.h>

int g;
pthread_once_t once = PTHREAD_ONCE_INIT;

void t_fun() {
  assert(1); // reachable!
  return NULL;
}

int main() {
  pthread_once(&once,t_fun);
  return 0;
}

Correct type of `pthread_once` argument

02/71: Correct type of `pthread_once` argument

Co-authored-by: Simmo Saan <43bc63fd4e818c04906d6ad710460794fe32296e@gmail.com>


/* Exercise 1-19: Write a function "reverse(s)" that reverses the character
 * string "s". Use it to write a program that reverses its input a line at a
 * time. */

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

uint32_t reverse(char *s);

int main(int argc, char **argv)
{
  char *buffer = NULL;
  uint32_t buffer_length = 0;
  char character = 0;
  bool finished_inputting = false;
  /* You would normally have the end-of-file test in the loop condition
   * expression, however this introduces a subtle bug where the last line
   * isn't processed if the input doesn't end with a newline. See
   * <http://users.powernet.co.uk/eton/kandr2/krx113.html> for details. */
  while (finished_inputting == false) {
    character = getchar();
    if (character == '\n' || (character == EOF && buffer_length > 0)) {
      buffer = realloc(buffer, ++buffer_length * sizeof(char));
      buffer[buffer_length - 1] = '\0';
      reverse(buffer);
      printf("%s\n", buffer);
      free(buffer);
      buffer = NULL;
      buffer_length = 0;
    } else {
      buffer = realloc(buffer, ++buffer_length * sizeof(char));
      buffer[buffer_length - 1] = character;
    }
    finished_inputting = (character == EOF);
  }
  return EXIT_SUCCESS;
}

uint32_t reverse(char *s)
{
  uint32_t string_length = 0;
  while (s[string_length] != '\0') {
    string_length++;
  }
  int32_t i = 0, j = string_length - 1;
  char temp = 0;
  for (i = 0; i < j; i++, j--) {
    temp = s[i];
    s[i] = s[j];
    s[j] = temp;
  }
  return string_length;
}

Add solution to Exercise 1-19.

Add solution to Exercise 1-19.


#ifndef _CONFIG_H
#define _CONFIG_H

#define ENABLE_COUNTERMOVE_HISTORY 0
#define ENABLE_HISTORY_PRUNE_DEPTH 0
#define ENABLE_NNUE 0
#define ENABLE_NNUE_SIMD 0

#endif

#ifndef _CONFIG_H
#define _CONFIG_H

#define ENABLE_COUNTERMOVE_HISTORY 0
#define ENABLE_HISTORY_PRUNE_DEPTH 4
#define ENABLE_NNUE 0
#define ENABLE_NNUE_SIMD 0

#endif

Enable history pruning at depth 4

Enable history pruning at depth 4


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

SVN revision: 13781


//
// This file is part of the Marble Desktop Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2006-2008 Torsten Rahn <tackat@kde.org>"
//

#ifndef PLUGINMANAGER_H
#define PLUGINMANAGER_H

#include <QtCore/QObject>

class MarbleLayerInterface;

/**
 * @short The class that handles Marble's plugins.
 *
 */

class PluginManager : public QObject
{
    Q_OBJECT

 public:
    explicit PluginManager(QObject *parent = 0);
    ~PluginManager();

    QList<MarbleLayerInterface *> layerInterfaces() const;

 public Q_SLOTS:
    /**
     * @brief Browses the plugin directories and installs plugins.
     *
     * This method browses all plugin directories and installs all
     * plugins found in there.
     */
    void loadPlugins();

 private:
    Q_DISABLE_COPY( PluginManager )
    QList<MarbleLayerInterface *> m_layerInterfaces;
};

#endif // PLUGINMANAGER_H

//
// This file is part of the Marble Desktop Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2006-2008 Torsten Rahn <tackat@kde.org>"
//

#ifndef PLUGINMANAGER_H
#define PLUGINMANAGER_H

#include <QtCore/QObject>
#include "marble_export.h"
class MarbleLayerInterface;

/**
 * @short The class that handles Marble's plugins.
 *
 */

class MARBLE_EXPORT PluginManager : public QObject
{
    Q_OBJECT

 public:
    explicit PluginManager(QObject *parent = 0);
    ~PluginManager();

    QList<MarbleLayerInterface *> layerInterfaces() const;

 public Q_SLOTS:
    /**
     * @brief Browses the plugin directories and installs plugins.
     *
     * This method browses all plugin directories and installs all
     * plugins found in there.
     */
    void loadPlugins();

 private:
    Q_DISABLE_COPY( PluginManager )
    QList<MarbleLayerInterface *> m_layerInterfaces;
};

#endif // PLUGINMANAGER_H

Fix export (needs for test program)

Fix export (needs for test program)

svn path=/trunk/KDE/kdeedu/marble/; revision=818952


#ifndef DW_RANDOM_H
#define DW_RANDOM_H

int rand_rangei(int min, int max);
float rand_rangei(float min, float max);

#define rand_bool() rand_rangei(0, 2)

#endif

#ifndef DW_RANDOM_H
#define DW_RANDOM_H

int rand_rangei(int min, int max);
float rand_rangef(float min, float max);

#define rand_bool() rand_rangei(0, 2)

#endif

Fix naming of rand_rangef name

Fix naming of rand_rangef name


/*
 * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
 * Copyright 2016 Cryptography Research, Inc.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 *
 * Originally written by Mike Hamburg
 */

#ifndef __ARCH_ARCH_32_ARCH_INTRINSICS_H__
# define __ARCH_ARCH_32_ARCH_INTRINSICS_H__

# define ARCH_WORD_BITS 32

static ossl_inline uint32_t word_is_zero(uint32_t a)
{
    /* let's hope the compiler isn't clever enough to optimize this. */
    return (((uint64_t)a) - 1) >> 32;
}

static ossl_inline uint64_t widemul(uint32_t a, uint32_t b)
{
    return ((uint64_t)a) * b;
}

#endif                          /* __ARCH_ARM_32_ARCH_INTRINSICS_H__ */

/*
 * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
 * Copyright 2016 Cryptography Research, Inc.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 *
 * Originally written by Mike Hamburg
 */

#ifndef __ARCH_ARCH_32_ARCH_INTRINSICS_H__
# define __ARCH_ARCH_32_ARCH_INTRINSICS_H__

# define ARCH_WORD_BITS 32

static ossl_inline uint32_t word_is_zero(uint32_t a)
{
    /* let's hope the compiler isn't clever enough to optimize this. */
    return (((uint64_t)a) - 1) >> 32;
}

static ossl_inline uint64_t widemul(uint32_t a, uint32_t b)
{
    return ((uint64_t)a) * b;
}

#endif                          /* __ARCH_ARCH_32_ARCH_INTRINSICS_H__ */

Fix a typo in a comment

Fix a typo in a comment

Reviewed-by: Bernd Edlinger <ac6902843ae77cc0d49b9c8ddec4cbf141db1bb7@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/5105)


#ifdef _WIN32
#define DL_EXPORT __declspec( dllexport )
#else
#define DL_EXPORT
#endif

DL_EXPORT int TestDynamicLoaderData;

DL_EXPORT void TestDynamicLoaderFunction()
{
}

#ifdef _WIN32
#define DL_EXPORT __declspec( dllexport )
#else
#define DL_EXPORT
#endif

DL_EXPORT int TestDynamicLoaderData = 0;

DL_EXPORT void TestDynamicLoaderFunction()
{
}

COMP: Fix compilation on MacOSX (common symbols not allowed with MH_DYLIB output format)


/*-
 * Copyright (c) 2008,	Jeffrey Roberson <jeff@freebsd.org>
 * All rights reserved.
 *
 * Copyright (c) 2008 Nokia Corporation
 * 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 unmodified, this list of conditions, and the following
 *    disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * $FreeBSD$
 */

#ifndef _SYS__CPUSET_H_
#define	_SYS__CPUSET_H_

#include <sys/param.h>

#ifdef _KERNEL
#define	CPU_SETSIZE	MAXCPU
#endif

#define	CPU_MAXSIZE	(4 * MAXCPU)

#ifndef	CPU_SETSIZE
#define	CPU_SETSIZE	CPU_MAXSIZE
#endif

#define	_NCPUBITS	(sizeof(long) * NBBY)	/* bits per mask */
#define	_NCPUWORDS	howmany(CPU_SETSIZE, _NCPUBITS)

typedef	struct _cpuset {
	long	__bits[howmany(CPU_SETSIZE, _NCPUBITS)];
} cpuset_t;

#endif /* !_SYS__CPUSET_H_ */

Remove the previously added comment. Probabilly me is the only one who didn't know userland and kerneland sizes were mismatching.


// Regular C libs
#include <stdio.h>

// Elixir libs -- clang doesn't know where the hell this is
#include "erl_nif.h"

// Needs to figure out what ERL_NIF_TERM means
static ERL_NIF_TERM hello(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {

	// We need some variables
	char *s;
	int i, num;

	// Grab the arguments from Elixir
	enif_get_string(env, argv[0], s, 1024, ERL_NIF_LATIN1);
	enif_get_int(env, argv[1], &num);

	for (i = 0; i < num; i++) {
		printf("Hello, %s!\n", s);
	}

	// Fancy version of return 0
	return enif_make_int(env, 0);
}

static ErlNifFunc funcs[] = {
	{"hello", 2, hello}
};

ERL_NIF_INIT(Elixir.Hello, funcs, NULL, NULL, NULL, NULL)

// Regular C libs
#include <stdio.h>

// Elixir libs
#include "erl_nif.h"

#define MAXLEN 1024

// Needs to figure out what ERL_NIF_TERM means
static ERL_NIF_TERM hello(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) {

	// We need some variables
	char buf[MAXLEN];
	int i, num;

	// Grab the arguments from Elixir
	enif_get_string(env, argv[0], buf, MAXLEN, ERL_NIF_LATIN1);
	enif_get_int(env, argv[1], &num);

	for (i = 0; i < num; i++) {
		printf("Hello, %s!\n", buf);
	}

	// Fancy version of return 0
	return enif_make_int(env, 0);
}

// Map Elixir functions to C functions
static ErlNifFunc funcs[] = {

	// Function name in Elixir, number of arguments, C function
	{"hello", 2, hello}
};

ERL_NIF_INIT(Elixir.Hello, funcs, NULL, NULL, NULL, NULL)

Use buf as var name

Use buf as var name


// PARAM: --sets solver td3 --enable ana.int.congruence --disable ana.int.def_exc
int main(){
    // A refinement of a congruence class should only take place for the == and != operator.
    int i;
    if (i==0){
      assert(i==0);
    } else {
      assert(i!=0); //UNKNOWN!
    }

    int j;
    if (j != 0){
      assert (j != 0); //UNKNOWN!
    } else {
      assert (j == 0);
    }

    int k;
    if (k > 0) {
      assert (k == 0); //UNKNOWN!
    } else {
      assert (k != 0); //UNKNOWN!
    }

    return 0;
}

Add branching test for congruence domain


C $Header$
C $Name$

CBOP
C !ROUTINE: OPENAD_OPTIONS.h
C !INTERFACE:
C #include "OPENAD_OPTIONS.h"

C !DESCRIPTION:
C *==================================================================*
C | CPP options file for OpenAD (openad) package:
C | Control which optional features to compile in this package code.
C *==================================================================*
CEOP

#ifndef OPENAD_OPTIONS_H
#define OPENAD_OPTIONS_H
#include "PACKAGES_CONFIG.h"
#include "CPP_OPTIONS.h"

#ifdef ALLOW_OPENAD

#define ALLOW_OPENAD_ACTIVE_READ_XYZ
#undef ALLOW_OPENAD_ACTIVE_READ_XY
#undef ALLOW_OPENAD_ACTIVE_WRITE

#endif /* ALLOW_OPENAD */
#endif /* OPENAD_OPTIONS_H */

Change to 3D active read

Change to 3D active read


extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern int __VERIFIER_nondet_int();
void __VERIFIER_assert(int cond) {
    if (!(cond)) {
        ERROR: __VERIFIER_error();
    }
    return;
}

void foo(int x)
{
    __VERIFIER_assert(x - 1 < x);
}

int main()
{
    foo(1);
    foo(2);
    return 0;
}

Add basic example with multiple contexts


/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
   Copyright (C) 2010 Red Hat, Inc.

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

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

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SPICE_UTIL_PRIV_H
#define SPICE_UTIL_PRIV_H

#include <glib.h>

G_BEGIN_DECLS

#define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx"

gboolean spice_strv_contains(const GStrv strv, const gchar *str);
gchar* spice_uuid_to_string(const guint8 uuid[16]);

G_END_DECLS

#endif /* SPICE_UTIL_PRIV_H */

/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
   Copyright (C) 2010 Red Hat, Inc.

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

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

   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef SPICE_UTIL_PRIV_H
#define SPICE_UTIL_PRIV_H

#include <glib.h>

G_BEGIN_DECLS

#define UUID_FMT "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x"

gboolean spice_strv_contains(const GStrv strv, const gchar *str);
gchar* spice_uuid_to_string(const guint8 uuid[16]);

G_END_DECLS

#endif /* SPICE_UTIL_PRIV_H */

Replace %02hhx with %02x in UUID format

Replace %02hhx with %02x in UUID format

Use of 'hh' in the UUID format string is not required. Furthermore
it causes errors on Mingw32, where the 'hh' modifier is not supported


// RUN: %ocheck 0 %s

struct store_out
{
	int *local;
	int *ret;
};

void store_out(const struct store_out *const so)
{
	*so->ret = *so->local;
}

void f(int *p)
{
	int i = *p;
	struct store_out so __attribute((cleanup(store_out))) = {
		.local = &i,
		.ret = p
	};

	i = 5;
}

main()
{
	int i = 3;

	f(&i);

	if(i != 5)
		abort();

	return 0;
}

Test cleanup-attribute with const struct parameter


/*
 * cynapses libc functions
 *
 * Copyright (c) 2008      by Andreas Schneider <mail@cynapses.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * vim: ts=2 sw=2 et cindent
 */

#include "c_macro.h"
#include "c_alloc.h"
#include "c_dir.h"
#include "c_file.h"
#include "c_path.h"
#include "c_rbtree.h"
#include "c_string.h"
#include "c_time.h"

/*
 * cynapses libc functions
 *
 * Copyright (c) 2008      by Andreas Schneider <mail@cynapses.org>
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * vim: ts=2 sw=2 et cindent
 */

#include "c_macro.h"
#include "c_alloc.h"
#include "c_dir.h"
#include "c_file.h"
#include "c_list.h"
#include "c_path.h"
#include "c_rbtree.h"
#include "c_string.h"
#include "c_time.h"

Add c_list to standard lib header file.

Add c_list to standard lib header file.


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

int main(void)
{
    canopy_post_sample(
        CANOPY_CLOUD_SERVER, "dev02.canopy.link",
        CANOPY_DEVICE_UUID, "9dfe2a00-efe2-45f9-a84c-8afc69caf4e7",
        CANOPY_PROPERTY_NAME, "cpu",
        CANOPY_VALUE_FLOAT32, 0.22f
    );
    return 0;
}

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

int main(void)
{
    // Your code here for determining sensor value...
    float temperature = 24.0f;

    // Send sample to the cloud:
    canopy_post_sample(
        CANOPY_CLOUD_SERVER, "dev02.canopy.link",
        CANOPY_DEVICE_UUID, "9dfe2a00-efe2-45f9-a84c-8afc69caf4e7",
        CANOPY_PROPERTY_NAME, "temperature",
        CANOPY_VALUE_FLOAT32, temperature
    );
    return 0;
}

Make sample app a little more clear

Make sample app a little more clear


//
//  Encounter.h
//  ProeliaKit
//
//  Created by Paul Schifferer on 3/5/15.
//  Copyright (c) 2015 Pilgrimage Software. All rights reserved.
//

@import Foundation;
#import "EncounterConstants.h"
#import "GameSystem.h"
#import "AbstractEncounter.h"

@class EncounterMap;
@class EncounterParticipant;
@class EncounterRegion;
@class EncounterTimelineEntry;

/**
 * An instance of this class represents an encounter created from a template that is being run.
 */
@interface Encounter : AbstractEncounter

// -- Attributes --

/**
 *
 */
@property (nonatomic, assign) NSInteger currentRound;
/**
 *
 */
@property (nonatomic, assign) NSTimeInterval endDate;
/**
 *
 */
@property (nonatomic, assign) NSInteger numberOfRounds;
/**
 *
 */
@property (nonatomic, assign) NSInteger numberOfTurns;
/**
 *
 */
@property (nonatomic, copy) NSString *encounterTemplateName;
/**
 *
 */
@property (nonatomic, assign) NSTimeInterval startDate;
/**
 *
 */
@property (nonatomic, assign) EncounterState state;
/**
 *
 */
@property (nonatomic, copy) NSData *turnQueue;

// -- Relationships --

@end

//
//  Encounter.h
//  ProeliaKit
//
//  Created by Paul Schifferer on 3/5/15.
//  Copyright (c) 2015 Pilgrimage Software. All rights reserved.
//

@import Foundation;
#import "EncounterConstants.h"
#import "GameSystem.h"
#import "AbstractEncounter.h"

@class EncounterMap;
@class EncounterParticipant;
@class EncounterRegion;
@class EncounterTimelineEntry;

/**
 * An instance of this class represents an encounter created from a template that is being run.
 */
@interface Encounter : AbstractEncounter

// -- Attributes --

/**
 *
 */
@property (nonatomic, assign) NSInteger currentRound;
/**
 *
 */
@property (nonatomic, assign) NSTimeInterval endDate;
/**
 *
 */
@property (nonatomic, assign) NSInteger numberOfRounds;
/**
 *
 */
@property (nonatomic, assign) NSInteger numberOfTurns;
/**
 *
 */
@property (nonatomic, copy) NSString *encounterTemplateName;
/**
 *
 */
@property (nonatomic, assign) NSTimeInterval startDate;
/**
 *
 */
@property (nonatomic, assign) EncounterState state;
/**
 *
 */
@property (nonatomic, copy) NSData *turnQueue;

// -- Relationships --

/**
 */
@property (nonatomic, copy) NSString* templateId;

@end

Store ID for source template.

Store ID for source template.


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

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

Sample Input

NULL, data = 2
2 --> NULL, data = 3

Sample Output

2 -->NULL
2 --> 3 --> NULL
Explanation
1. We have an empty list and we insert 2.
2. We have 2 in the tail, when 3 is inserted 3 becomes the tail.
*/

/*
  Insert Node at the end of a linked list
  head pointer input could be NULL as well for empty list
  Node is defined as
  struct Node
  {
     int data;
     struct Node *next;
  }
*/
Node* Insert(Node *head,int data)
{
    Node* temp;
    temp =(Node*) malloc(sizeof(Node));
    temp->data = data;
    temp->next = NULL;

    Node* head_temp=head;

    if(head ==NULL){
       head = temp;
    }
    else {
        while(head_temp->next!=NULL){
            head_temp = head_temp->next;
        }
        head_temp->next = temp;
    }
    return head;
}

Add insert node at tail fn

Add insert node at tail fn


// Check that the ubsan and ubsan-minimal runtimes have the same symbols,
// making exceptions as necessary.
//
// REQUIRES: x86_64-darwin

// RUN: nm -jgU `%clangxx -fsanitize-minimal-runtime -fsanitize=undefined %s -o %t '-###' 2>&1 | grep "libclang_rt.ubsan_minimal_osx_dynamic.dylib" | sed -e 's/.*"\(.*libclang_rt.ubsan_minimal_osx_dynamic.dylib\)".*/\1/'` | grep "^___ubsan_handle" \
// RUN:  | sed 's/_minimal//g' \
// RUN:  > %t.minimal.symlist
//
// RUN: nm -jgU `%clangxx -fno-sanitize-minimal-runtime -fsanitize=undefined %s -o %t '-###' 2>&1 | grep "libclang_rt.ubsan_osx_dynamic.dylib" | sed -e 's/.*"\(.*libclang_rt.ubsan_osx_dynamic.dylib\)".*/\1/'` | grep "^___ubsan_handle" \
// RUN:  | grep -vE "^___ubsan_handle_dynamic_type_cache_miss" \
// RUN:  | grep -vE "^___ubsan_handle_cfi_bad_type" \
// RUN:  | sed 's/_v1//g' \
// RUN:  > %t.full.symlist
//
// RUN: diff %t.minimal.symlist %t.full.symlist

[ubsan-minimal] Test exported symbol set against RTUBsan

Check that the symbol sets exported by the minimal runtime and the full
runtime match (making exceptions for special cases as needed).

This test uses some possibly non-standard nm options, and needs to
inspect the symbols in runtime dylibs. I haven't found a portable way to
do this, so it's limited to x86-64/Darwin for now.

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


/*
 * arch/arm/mach-kirkwood/board-iomega_ix2_200.c
 *
 * Iomega StorCenter ix2-200
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2.  This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/mv643xx_eth.h>
#include <linux/ethtool.h>
#include "common.h"

static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
	.phy_addr       = MV643XX_ETH_PHY_NONE,
	.speed          = SPEED_1000,
	.duplex         = DUPLEX_FULL,
};

void __init iomega_ix2_200_init(void)
{
	/*
	 * Basic setup. Needs to be called early.
	 */
	kirkwood_ge01_init(&iomega_ix2_200_ge00_data);
}

/*
 * arch/arm/mach-kirkwood/board-iomega_ix2_200.c
 *
 * Iomega StorCenter ix2-200
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2.  This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */

#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/mv643xx_eth.h>
#include <linux/ethtool.h>
#include "common.h"

static struct mv643xx_eth_platform_data iomega_ix2_200_ge00_data = {
	.phy_addr       = MV643XX_ETH_PHY_NONE,
	.speed          = SPEED_1000,
	.duplex         = DUPLEX_FULL,
};

static struct mv643xx_eth_platform_data iomega_ix2_200_ge01_data = {
        .phy_addr       = MV643XX_ETH_PHY_ADDR(11),
};

void __init iomega_ix2_200_init(void)
{
	/*
	 * Basic setup. Needs to be called early.
	 */
	kirkwood_ge00_init(&iomega_ix2_200_ge00_data);
	kirkwood_ge01_init(&iomega_ix2_200_ge01_data);
}

Fix GE0/GE1 init on ix2-200 as GE0 has no PHY

Signed-off-by: Jason Cooper <68c46a606457643eab92053c1c05574abb26f861@lakedaemon.net>


//-------------------------------------------------------------------------
//    $Id$
//    Version: $Name$
//
//    Copyright (C) 2010 by the deal.II authors
//
//    This file is subject to QPL and may not be  distributed
//    without copyright and license information. Please refer
//    to the file deal.II/doc/license.html for the  text  and
//    further information on this license.
//
//-------------------------------------------------------------------------

/**
 * @defgroup constraints Constraints on degrees of freedom
 * @ingroup dofs
 *
 * This module deals with constraints on degrees of
 * freedom. Constraints typically come from several sources, for
 * example:
 * - If you have Dirichlet-type boundary conditions, one usually enforces
 *   them by requiring that that degrees of freedom on the boundary have
 *   particular values, for example $x_12=42$ if the boundary condition
 *   requires that the finite element solution at the location of degree
 *   of freedom 12 has the value 42.
 *
 * This class implements dealing with linear (possibly inhomogeneous)
 * constraints on degrees of freedom. In particular, it handles constraints of
 * the form $x_{i_1} = \sum_{j=2}^M a_{i_j} x_{i_j} + b_i$. In the context of
 * adaptive finite elements, such constraints appear most frequently as
 * "hanging nodes" and for implementing Dirichlet boundary conditions in
 * strong form. The class is meant to deal with a limited number of
 * constraints relative to the total number of degrees of freedom, for example
 * a few per cent up to maybe 30 per cent; and with a linear combination of
 * $M$ other degrees of freedom where $M$ is also relatively small (no larger
 * than at most around the average number of entries per row of a linear
 * system). It is not meant to describe full rank linear systems.
 */

Add provisional version, to be finished at home later today.

git-svn-id: 31d9d2f6432a47c86a3640814024c107794ea77c@22003 0785d39b-7218-0410-832d-ea1e28bc413d


//--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author:  Timur Pocheptsov <Timur.Pocheptsov@cern.ch>
//------------------------------------------------------------------------------

#ifndef CLING_DISPLAY_H
#define CLING_DISPLAY_H

#include <string>

namespace llvm {
  class raw_ostream;
}

namespace cling {

void DisplayClasses(llvm::raw_ostream &stream,
                    const class Interpreter *interpreter, bool verbose);
void DisplayClass(llvm::raw_ostream &stream,
                  const Interpreter *interpreter, const char *className,
                  bool verbose);

void DisplayGlobals(llvm::raw_ostream &stream, const Interpreter *interpreter);
void DisplayGlobal(llvm::raw_ostream &stream, const Interpreter *interpreter,
                   const std::string &name);

}

#endif

//--------------------------------------------------------------------*- C++ -*-
// CLING - the C++ LLVM-based InterpreterG :)
// version: $Id$
// author:  Timur Pocheptsov <Timur.Pocheptsov@cern.ch>
//------------------------------------------------------------------------------

#ifndef CLING_DISPLAY_H
#define CLING_DISPLAY_H

#include <string>

namespace llvm {
  class raw_ostream;
}

namespace cling {
class Interpreter;

void DisplayClasses(llvm::raw_ostream &stream,
                    const Interpreter *interpreter, bool verbose);
void DisplayClass(llvm::raw_ostream &stream,
                  const Interpreter *interpreter, const char *className,
                  bool verbose);

void DisplayGlobals(llvm::raw_ostream &stream, const Interpreter *interpreter);
void DisplayGlobal(llvm::raw_ostream &stream, const Interpreter *interpreter,
                   const std::string &name);

}

#endif

Fix fwd decl for windows.

Fix fwd decl for windows.

git-svn-id: ecbadac9c76e8cf640a0bca86f6bd796c98521e3@47814 27541ba8-7e3a-0410-8455-c3a389f83636


//===--- ClangSACheckers.h - Registration functions for Checkers *- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Declares the registation functions for the checkers defined in
// libclangStaticAnalyzerCheckers.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_SA_LIB_CHECKERS_CLANGSACHECKERS_H
#define LLVM_CLANG_SA_LIB_CHECKERS_CLANGSACHECKERS_H

namespace clang {

namespace ento {
class ExprEngine;

#define GET_CHECKERS
#define CHECKER(FULLNAME,CLASS,CXXFILE,HELPTEXT,HIDDEN)    \
  void register##CLASS(ExprEngine &Eng);
#include "Checkers.inc"
#undef CHECKER
#undef GET_CHECKERS

} // end ento namespace

} // end clang namespace

#endif

//===--- ClangSACheckers.h - Registration functions for Checkers *- C++ -*-===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// Declares the registation functions for the checkers defined in
// libclangStaticAnalyzerCheckers.
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_CLANG_SA_LIB_CHECKERS_CLANGSACHECKERS_H
#define LLVM_CLANG_SA_LIB_CHECKERS_CLANGSACHECKERS_H

namespace clang {

namespace ento {
class ExprEngine;

#define GET_CHECKERS
#define CHECKER(FULLNAME,CLASS,CXXFILE,HELPTEXT,HIDDEN)    \
  void register##CLASS(ExprEngine &Eng);
#include "../Checkers/Checkers.inc"
#undef CHECKER
#undef GET_CHECKERS

} // end ento namespace

} // end clang namespace

#endif

Revert r125642. This broke the build? It should be a no-op.

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


#pragma once

#include "BlockHandler.h"

class cBlockTNTHandler :
	public cBlockHandler
{
public:
	cBlockTNTHandler(BLOCKTYPE a_BlockType)
		: cBlockHandler(a_BlockType)
	{
	}

	virtual const char * GetStepSound(void) override
	{
		return "step.wood";
	}

	virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override
	{
		a_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, a_Player);
	}
};

#pragma once

#include "BlockHandler.h"

class cBlockTNTHandler :
	public cBlockHandler
{
public:
	cBlockTNTHandler(BLOCKTYPE a_BlockType)
		: cBlockHandler(a_BlockType)
	{
	}

	virtual const char * GetStepSound(void) override
	{
		return "step.grass";
	}

	virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override
	{
		a_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, a_Player);
	}
};

Set tnt step sound to step.grass

Set tnt step sound to step.grass


//----------------------------------------------------------------------------
//
// "Copyright Centre National d'Etudes Spatiales"
//
// License:  LGPL-2
//
// See LICENSE.txt file in the top level directory for more details.
//
//----------------------------------------------------------------------------
// $Id$

#ifndef ossimOperatorUtilities_h
#define ossimOperatorUtilities_h

namespace ossimplugins {
   // Uses Barton-Nackman trick to help implement operator on classes
   // Strongly inspired by boost.operators interface

   // See ossimTimeUtilities.h and ossimTimeUtilitiesTest.cpp for example of
   // use

#define DEFINE_OPERATORS(name, compound, op)                                       \
   template <typename T> struct name ## 1                                          \
   {                                                                               \
      friend T operator op(T lhs, T const& rhs) {                                  \
         lhs compound rhs;                                                         \
         return lhs;                                                               \
      }                                                                            \
   };                                                                              \
   template <typename T, typename U> struct name ## 2                              \
   {                                                                               \
      friend T operator op(T lhs, U const& rhs) {                                  \
         lhs compound rhs;                                                         \
         return lhs;                                                               \
      }                                                                            \
      friend T operator op(U const& lhs, T rhs) {                                  \
         rhs compound lhs;                                                         \
         return rhs;                                                               \
      }                                                                            \
   };                                                                              \
   template <typename T, typename U=void> struct name         : name ## 2<T,U> {}; \
   template <typename T>                  struct name<T,void> : name ## 1<T>   {};

   template <typename U, typename V> struct substractable_asym
   {
      friend U operator-(V const& lhs, V const& rhs) {
         return V::template diff<U,V>(lhs, rhs);
      }
   };

   DEFINE_OPERATORS(addable, +=, +);
   DEFINE_OPERATORS(substractable, -=, -);
   DEFINE_OPERATORS(multipliable, *=, *);
#undef DEFINE_OPERATORS

   template <typename T, typename R> struct dividable {
      typedef R scalar_type;
      friend T operator/(T lhs, scalar_type const& rhs) {
         lhs /= rhs;
         return lhs;
      }
      friend scalar_type operator/(T const& lhs, T const& rhs) {
         return ratio(lhs, rhs);
      }
   };

   template <typename T> struct streamable {
      friend std::ostream & operator<<(std::ostream & os, const T & v)
      { return v.display(os); }
   };

   template <typename T> struct less_than_comparable {
      friend bool operator>(T const& lhs, T const& rhs) {
         return rhs < lhs;
      }
      friend bool operator>=(T const& lhs, T const& rhs) {
         return !(lhs < rhs);
      }
      friend bool operator<=(T const& lhs, T const& rhs) {
         return !(rhs < lhs);
      }
   };

   template <typename T> struct equality_comparable {
      friend bool operator!=(T const& lhs, T const& rhs) {
         return !(rhs == lhs);
      }
   };

}// namespace ossimplugins

#endif // ossimOperatorUtilities_h

ENH: Add facilities to define classes with arithmetic semantics

Strongly inspired by boost.operators interface


// SKIP
#include <stdio.h>
#include <assert.h>

int main() {
  int written = 0;
  printf("foo%n\n", &written); // invalidates written by setting written = 3
  assert(written != 0); // TODO (fail means written == 0, which is unsound)

  printf("%d\n", written);
  return 0;
}

Add skipped test where printf with %n is unsound


// MIT License

// Copyright (c) 2017 Zhuhao Wang

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#pragma once

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

#include "connection_interface.h"

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

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

// MIT License

// Copyright (c) 2017 Zhuhao Wang

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#pragma once

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

#include "connection_interface.h"

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

  // Due to the limitation of boost handler, the handler type must be copy
  // constructible.
  using EventHandler = std::function<void(
      std::unique_ptr<ConnectionInterface>&&, std::error_code)>;
  virtual void Accept(EventHandler&&);
};
}  // namespace transport
}  // namespace nekit

DOC: Add comment for handler type requirement


/**
 * WarfaceBot, a blind XMPP client for Warface (FPS)
 * Copyright (C) 2015 Levak Borok <levak92@gmail.com>
 *
 * 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 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef WB_GAME_VERSION_H
# define WB_GAME_VERSION_H

# define GAME_VERSION "1.1.1.3570"

#endif /* !WB_GAME_VERSION_H */

/**
 * WarfaceBot, a blind XMPP client for Warface (FPS)
 * Copyright (C) 2015 Levak Borok <levak92@gmail.com>
 *
 * 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 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef WB_GAME_VERSION_H
# define WB_GAME_VERSION_H

# ifndef GAME_VERSION
#  define GAME_VERSION "1.1.1.3570"
# endif /* !GAME_VERSION */

#endif /* !WB_GAME_VERSION_H */

Add guards for GAME_VERSION for command line customization


Fix fwd decl for windows.

Fix fwd decl for windows.

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


#ifndef __GCC_COMPAT_H
#define __GCC_COMPAT_H

#ifdef __GNUC__
// gcc does not support the __cdecl, __stdcall or __fastcall notation
// except on Windows
#ifndef _WIN32
#define __cdecl __attribute__((cdecl))
#define __stdcall __attribute__((stdcall))
#define __fastcall __attribute__((fastcall))
#endif // ! _WIN32
#endif // __GNUC__

#endif // __GCC_COMPAT_H

#ifndef __GCC_COMPAT_H
#define __GCC_COMPAT_H

#ifdef __GNUC__
// gcc does not support the __cdecl, __stdcall or __fastcall notation
// except on Windows
#ifdef _WIN32
#define __cdecl __attribute__((cdecl))
#define __stdcall __attribute__((stdcall))
#define __fastcall __attribute__((fastcall))
#else
#define __cdecl
#define __stdcall
#define __fastcall
#endif // _WIN32
#endif // __GNUC__

#endif // __GCC_COMPAT_H

Fix the Vale build onx 64 Linux by definining empty calling convention keywords


/** @file
*
*  Copyright (c) 2012-2017, ARM Limited. All rights reserved.
*
*  This program and the accompanying materials
*  are licensed and made available under the terms and conditions of the BSD License
*  which accompanies this distribution.  The full text of the license may be found at
*  http://opensource.org/licenses/bsd-license.php
*
*  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
*  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
*
**/

#ifndef __ARM_MM_SVC_H__
#define __ARM_MM_SVC_H__

/*
 * SVC IDs to allow the MM secure partition to initialise itself, handle
 * delegated events and request the Secure partition manager to perform
 * privileged operations on its behalf.
 */
#define ARM_SVC_ID_SPM_VERSION_AARCH64             0xC4000060
#define ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64       0xC4000061
#define ARM_SVC_ID_SP_GET_MEM_ATTRIBUTES_AARCH64   0xC4000064
#define ARM_SVC_ID_SP_SET_MEM_ATTRIBUTES_AARCH64   0xC4000065

#define SET_MEM_ATTR_DATA_PERM_MASK       0x3
#define SET_MEM_ATTR_DATA_PERM_SHIFT        0
#define SET_MEM_ATTR_DATA_PERM_NO_ACCESS    0
#define SET_MEM_ATTR_DATA_PERM_RW           1
#define SET_MEM_ATTR_DATA_PERM_RO           3

#define SET_MEM_ATTR_CODE_PERM_MASK   0x1
#define SET_MEM_ATTR_CODE_PERM_SHIFT    2
#define SET_MEM_ATTR_CODE_PERM_X        0
#define SET_MEM_ATTR_CODE_PERM_XN       1

#define SET_MEM_ATTR_MAKE_PERM_REQUEST(d_perm, c_perm)                            \
    ((((c_perm) & SET_MEM_ATTR_CODE_PERM_MASK) << SET_MEM_ATTR_CODE_PERM_SHIFT) | \
    (( (d_perm) & SET_MEM_ATTR_DATA_PERM_MASK) << SET_MEM_ATTR_DATA_PERM_SHIFT))

#endif

ArmPkg/Include: Add SVC function IDs for Management Mode.

SVCs are in the range 0xC4000060 - 0xC400007f.
The functions available to the secure MM partition:
1. Signal completion of MM event handling.
2. Set/Get memory attributes for a memory region at runtime.
3. Get version number of secure partition manager.

Also, it defines memory attributes required for set/get operations.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Supreeth Venkatesh <e636ad8a3c68a860c3594da0efc73a6a46c31f2f@arm.com>
Reviewed-by: Ard Biesheuvel <66d3c5fdaeea7ff1f996ad04f2c45e08ab38e2f5@linaro.org>


// Copyright (c) 2019 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 QUICHE_SPDY_PLATFORM_API_SPDY_BUG_TRACKER_H_
#define QUICHE_SPDY_PLATFORM_API_SPDY_BUG_TRACKER_H_

#include "net/spdy/platform/impl/spdy_bug_tracker_impl.h"

#define SPDY_BUG SPDY_BUG_IMPL
#define SPDY_BUG_IF(condition) SPDY_BUG_IF_IMPL(condition)

// V2 macros are the same as all the SPDY_BUG flavor above, but they take a
// bug_id parameter.
#define SPDY_BUG_V2 SPDY_BUG_V2_IMPL
#define SPDY_BUG_IF_V2 SPDY_BUG_IF_V2_IMPL

#define FLAGS_spdy_always_log_bugs_for_tests \
  FLAGS_spdy_always_log_bugs_for_tests_impl

#endif  // QUICHE_SPDY_PLATFORM_API_SPDY_BUG_TRACKER_H_

// Copyright (c) 2019 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 QUICHE_SPDY_PLATFORM_API_SPDY_BUG_TRACKER_H_
#define QUICHE_SPDY_PLATFORM_API_SPDY_BUG_TRACKER_H_

#include "net/spdy/platform/impl/spdy_bug_tracker_impl.h"

#define SPDY_BUG SPDY_BUG_IMPL
#define SPDY_BUG_IF(bug_id, condition) SPDY_BUG_IF_IMPL(bug_id, condition)

// V2 macros are the same as all the SPDY_BUG flavor above, but they take a
// bug_id parameter.
#define SPDY_BUG_V2 SPDY_BUG_V2_IMPL
#define SPDY_BUG_IF_V2 SPDY_BUG_IF_V2_IMPL

#define FLAGS_spdy_always_log_bugs_for_tests \
  FLAGS_spdy_always_log_bugs_for_tests_impl

#endif  // QUICHE_SPDY_PLATFORM_API_SPDY_BUG_TRACKER_H_

Modify old-style derived GFE_BUG macros to have IDs.

Usage of the macros was replaced by V2 set of macros. Context: go/gfe-bug-improvements. Now that everything was migrated to V2, we are updating V1 macros and will updated everything back to drop the V2 suffix.

GFE_BUG macros were changed in cl/362922435
SPDY_BUG macros were changed in cl/363160900, but one was missed. This CL corrects it.

PiperOrigin-RevId: 363240499
Change-Id: I77b4932e8e47bfef2f34000c0f5984e0a3b6ce45


/*
https://www.urionlinejudge.com.br/judge/en/problems/view/1012
*/

#include <stdio.h>

int main(){

    const double PI = 3.14159;

    double a, b, c;

    scanf("%lf %lf %lf", &a, &b, &c);

    /* the area of the rectangled triangle that has base A and height C
    A = (base * height) / 2
    */
    printf("TRIANGULO = %.3lf\n", (a*c)/2);

    /* the area of the radius's circle C. (pi = 3.14159)
    A = PI * radius
    */
    printf("CIRCULO = %.3lf\n", PI*c*c);

    /* the area of the trapezium which has A and B by base, and C by height
    A = ((larger base + minor base) * height) / 2
    */
    printf("TRAPEZIO = %.3lf\n", ((a+b)*c)/2);

    /* the area of the square that has side B
    A = side^2
    */
    printf("QUADRADO = %.3lf\n", b*b);

    /* the area of the rectangle that has sides A and B
    A = base * height
    */
    printf("RETANGULO = %.3lf\n", a*b);

    return 0;
}

/*
https://www.urionlinejudge.com.br/judge/en/problems/view/1012
*/

#include <stdio.h>

int main(){

    const double PI = 3.14159;

    double a, b, c;

    scanf("%lf %lf %lf", &a, &b, &c);

    /* the area of the rectangled triangle that has base A and height C
    A = (base * height) / 2
    */
    printf("TRIANGULO: %.3lf\n", (a*c)/2);

    /* the area of the radius's circle C. (pi = 3.14159)
    A = PI * radius
    */
    printf("CIRCULO: %.3lf\n", PI*c*c);

    /* the area of the trapezium which has A and B by base, and C by height
    A = ((larger base + minor base) * height) / 2
    */
    printf("TRAPEZIO: %.3lf\n", ((a+b)*c)/2);

    /* the area of the square that has side B
    A = side^2
    */
    printf("QUADRADO: %.3lf\n", b*b);

    /* the area of the rectangle that has sides A and B
    A = base * height
    */
    printf("RETANGULO: %.3lf\n", a*b);

    return 0;
}

Update 1012 (Fix a typo)

Update 1012 (Fix a typo)

: instead of =


//
//  RocksDBPlainTableOptions.h
//  ObjectiveRocks
//
//  Created by Iska on 04/01/15.
//  Copyright (c) 2015 BrainCookie. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(char, PlainTableEncodingType)
{
	PlainTableEncodingPlain,
	PlainTableEncodingPrefix
};

@interface RocksDBPlainTableOptions : NSObject

@property (nonatomic, assign) uint32_t userKeyLen;
@property (nonatomic, assign) int bloomBitsPerKey;
@property (nonatomic, assign) double hashTableRatio;
@property (nonatomic, assign) size_t indexSparseness;
@property (nonatomic, assign) size_t hugePageTlbSize;
@property (nonatomic, assign) PlainTableEncodingType encodingType;
@property (nonatomic, assign) BOOL fullScanMode;
@property (nonatomic, assign) BOOL storeIndexInFile;

@end

//
//  RocksDBPlainTableOptions.h
//  ObjectiveRocks
//
//  Created by Iska on 04/01/15.
//  Copyright (c) 2015 BrainCookie. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef NS_ENUM(char, PlainTableEncodingType)
{
	PlainTableEncodingPlain,
	PlainTableEncodingPrefix
};

@interface RocksDBPlainTableOptions : NSObject

/**
 @brief
  Plain table has optimization for fix-sized keys, which can
  be specified via userKeyLen.
 */
@property (nonatomic, assign) uint32_t userKeyLen;

/**
 @brief
  The number of bits used for bloom filer per prefix.
  To disable it pass a zero.
 */
@property (nonatomic, assign) int bloomBitsPerKey;

/**
 @brief
  The desired utilization of the hash table used for prefix hashing.
  `hashTableRatio` = number of prefixes / #buckets in the hash table.
 */
@property (nonatomic, assign) double hashTableRatio;

/**
 @brief
  Used to build one index record inside each prefix for the number of
  keys for the binary search inside each hash bucket.
 */
@property (nonatomic, assign) size_t indexSparseness;

/**
 @brief
  Huge page TLB size. The user needs to reserve huge pages
  for it to be allocated, like:
  `sysctl -w vm.nr_hugepages=20`
 */
@property (nonatomic, assign) size_t hugePageTlbSize;

/**
 @brief
  Encoding type for the keys. The value will determine how to encode keys
  when writing to a new SST file.
 */
@property (nonatomic, assign) PlainTableEncodingType encodingType;

/**
 @brief
  Mode for reading the whole file one record by one without using the index.
 */
@property (nonatomic, assign) BOOL fullScanMode;

/**
 @brief
  Compute plain table index and bloom filter during file building and store
  it in file. When reading file, index will be mmaped instead of recomputation.
 */
@property (nonatomic, assign) BOOL storeIndexInFile;

@end

Add source code documentation for the RocksDB Plain Table Options class


// REQUIRES: x86-registered-target

// RUN: %clang -target i386-pc-elfiamcu -c -v %s 2>&1 | FileCheck %s
// CHECK-NOT: /usr/include
// CHECK-NOT: /usr/local/include

// REQUIRES: x86-registered-target

// RUN: %clang -target i386-pc-elfiamcu -c -v -fsyntax-only %s 2>&1 | FileCheck %s
// CHECK-NOT: /usr/include
// CHECK-NOT: /usr/local/include

Add -fsyntax-only to fix failure in read-only directories.

Internally, this test is executed in a read-only directory, which causes
it to fail because the driver tries to generate a file unnecessarily.
Adding -fsyntax-only fixes the issue (thanks to Artem Belevich for
figuring out the root cause).

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


// mruby libraries
#include "mruby.h"
#include "mruby/array.h"
#include "mruby/data.h"
#include "mruby/string.h"

#include <X11/Xlib.h>

mrb_value x11_simple_test(mrb_state* mrb, mrb_value self)
{
  Display *dpy = XOpenDisplay(NULL);
  Window win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 256, 256, 0, 0, 0);
  XMapWindow(dpy, win);
  XFlush(dpy);
  while(1);
  return mrb_nil_value();
}

// initializer
void mrb_mruby_x11_simple_gem_init(mrb_state* mrb)
{
  struct RClass* rclass = mrb_define_module(mrb, "X11");
  mrb_define_class_method(mrb, rclass, "test", x11_simple_test, ARGS_NONE());
  return;
}

// finalizer
void mrb_mruby_x11_simple_gem_final(mrb_state* mrb)
{
  return;
}

// mruby libraries
#include "mruby.h"
#include "mruby/array.h"
#include "mruby/data.h"
#include "mruby/string.h"

#include <X11/Xlib.h>

mrb_value x11_simple_test(mrb_state* mrb, mrb_value self)
{
  Display* dpy = XOpenDisplay(NULL);
  Window* win = mrb_malloc(mrb, sizeof(Window));
  *win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 0, 0, 256, 256, 0, 0, 0);
  XMapWindow(dpy, *win);
  XFlush(dpy);
  return mrb_fixnum_value((int)win);
}

// initializer
void mrb_mruby_x11_simple_gem_init(mrb_state* mrb)
{
  struct RClass* rclass = mrb_define_module(mrb, "X11");
  mrb_define_class_method(mrb, rclass, "test", x11_simple_test, ARGS_NONE());
  return;
}

// finalizer
void mrb_mruby_x11_simple_gem_final(mrb_state* mrb)
{
  return;
}

Return an adress of Window object.

Return an adress of Window object.


#ifndef QMLWARNINGDIALOG_H
#define QMLWARNINGDIALOG_H

#include <QDialog>

namespace Ui {
    class QmlWarningDialog;
}

namespace QmlDesigner {

namespace Internal {

class QmlWarningDialog : public QDialog
{
    Q_OBJECT

public:
    explicit QmlWarningDialog(QWidget *parent, const QStringList &warnings);
    ~QmlWarningDialog();

    bool warningsEnabled() const;

public slots:
    void ignoreButtonPressed();
    void okButtonPressed();
    void checkBoxToggled(bool);
    void linkClicked(const QString &link);

private:
    Ui::QmlWarningDialog *ui;
    const QStringList m_warnings;
};

} //Internal

} //QmlDesigner

#endif // QMLWARNINGDIALOG_H

#ifndef QMLWARNINGDIALOG_H
#define QMLWARNINGDIALOG_H

#include <QDialog>

QT_BEGIN_NAMESPACE
namespace Ui {
    class QmlWarningDialog;
}
QT_END_NAMESPACE

namespace QmlDesigner {

namespace Internal {

class QmlWarningDialog : public QDialog
{
    Q_OBJECT

public:
    explicit QmlWarningDialog(QWidget *parent, const QStringList &warnings);
    ~QmlWarningDialog();

    bool warningsEnabled() const;

public slots:
    void ignoreButtonPressed();
    void okButtonPressed();
    void checkBoxToggled(bool);
    void linkClicked(const QString &link);

private:
    Ui::QmlWarningDialog *ui;
    const QStringList m_warnings;
};

} //Internal

} //QmlDesigner

#endif // QMLWARNINGDIALOG_H

Fix compilation with namespaced Qt.

QmlDesigner: Fix compilation with namespaced Qt.

Change-Id: I4de7ae4391f57f4c7eac4e5e8b057b8365ca42c9
Reviewed-by: Thomas Hartmann <588ee739c05aab7547907becfd1420d2b7316069@digia.com>


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

#ifndef GLUONCORE_PRIVATEPOINTER_H
#define GLUONCORE_PRIVATEPOINTER_H

#include <memory>

namespace GluonCore
{
    template < typename T >
    class PrivatePointer
    {
        public:
            PrivatePointer() : p{ new T{} } { }
            template < typename... Args >
            explicit PrivatePointer( Args&& ... args ) : p{ std::forward< Args >( args ) ... }  { }

            PrivatePointer( const PrivatePointer< T >&& other ) { p = other.p; }
            PrivatePointer< T >& operator=( const PrivatePointer< T >&& other ) { p = other.p; return *this; }

            inline const T* operator->() const { return p.get(); }
            inline T* operator->() { return p.get(); }

        private:
            std::unique_ptr< T > p;
    };
}

#define GLUON_PRIVATE_POINTER \
private:\
    class Private;\
    GluonCore::PrivatePointer< Private > d;

#endif //GLUONCORE_PRIVATEPOINTER_H

core: Add a convenience template for private pointers.


#include <systick.h>
#include <protocol_hk310.h>

#define FRAME_TIME 5        // 1 frame every 5 ms

// ****************************************************************************
static void protocol_frame_callback(void)
{
    systick_set_callback(protocol_frame_callback, FRAME_TIME);
}

// ****************************************************************************
void init_protocol_hk310(void)
{
    systick_set_callback(protocol_frame_callback, FRAME_TIME);
}

#include <systick.h>
#include <protocol_hk310.h>

#define FRAME_TIME 5        // One frame every 5 ms

typedef enum {
    SEND_STICK1 = 0,
    SEND_STICK2,
    SEND_BIND_INFO,
    SEND_PROGRAMBOX
} frame_state_t;

static frame_state_t frame_state;

// ****************************************************************************
static void send_stick_data(void)
{

}

// ****************************************************************************
static void send_binding_data(void)
{

}

// ****************************************************************************
static void send_programming_box_data(void)
{

}

// ****************************************************************************
static void nrf_transmit_done_callback(void)
{
    switch (frame_state) {
        case SEND_STICK1:
            send_stick_data();
            frame_state = SEND_BIND_INFO;
            break;

        case SEND_STICK2:
            send_stick_data();
            frame_state = SEND_BIND_INFO;
            break;

        case SEND_BIND_INFO:
            send_binding_data();
            frame_state = SEND_PROGRAMBOX;
            break;

        case SEND_PROGRAMBOX:
            send_programming_box_data();
            frame_state = SEND_STICK1;
            break;

        default:
            break;
    }
}

// ****************************************************************************
static void protocol_frame_callback(void)
{
    systick_set_callback(protocol_frame_callback, FRAME_TIME);
    frame_state = SEND_STICK1;
    nrf_transmit_done_callback();
}

// ****************************************************************************
void init_protocol_hk310(void)
{
    systick_set_callback(protocol_frame_callback, FRAME_TIME);
}

Build skeleton for nRF frames

Build skeleton for nRF frames


#ifndef _WALKEREXCEPTION_H
#define _WALKEREXCEPTION_H

#include <string>

//! (base) class for exceptions in uvok/WikiWalker
class WalkerException : public std::exception
{
public:
    /*! Create a Walker exception with a message.
     *
     * Message might be shown on exception occurring, depending on
     * the compiler.
     *
     * \param exmessage The exception message.
     */
    WalkerException(std::string exmessage)
        : message(exmessage) {}

    virtual ~WalkerException() throw() {}

    //! get exception message
    const char* what() const throw()
    {
        return message.c_str();
    }

private:
    std::string message;
};

#endif // _WALKEREXCEPTION_H

#ifndef _WALKEREXCEPTION_H
#define _WALKEREXCEPTION_H

#include <string>

//! (base) class for exceptions in uvok/WikiWalker
class WalkerException : public std::exception
{
public:
    /*! Create a Walker exception with a message.
     *
     * Message might be shown on exception occurring, depending on
     * the compiler.
     *
     * \param exmessage The exception message.
     */
    WalkerException(std::string exmessage)
        : message(exmessage) {}

    virtual ~WalkerException() throw() {}

    //! get exception message
    const char* what() const noexcept
    {
        return message.c_str();
    }

private:
    std::string message;
};

#endif // _WALKEREXCEPTION_H

Use noexcept insead of throw() for what()