/*
 * libefivar - library for the manipulation of EFI variables
 * Copyright 2012 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.
 *
 * 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/>.
 */

#include "efivar.h"

int main(void)
{

	return 0;
}

/*
 * libefivar - library for the manipulation of EFI variables
 * Copyright 2012 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.
 *
 * 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/>.
 */

#include <stdio.h>

#include "efivar.h"

int main(void)
{
	efi_guid_t *guid;
	char *name;
	int rc;

	while ((rc = efi_get_next_variable_name(&guid, &name)) > 0) {
		 printf("name: \"%s\"\n", name);
	}

	return 0;
}

Add some sample code for efi_get_next_variable_name()

Signed-off-by: Peter Jones <2e0a021e603479ff81838c00c3b770daca4e0214@redhat.com>


/*
 *  ClusteredPoller
 *
 *  Created by Jakob Borg.
 *  Copyright 2011 Nym Networks. See LICENSE for terms.
 */

#include "cltime.h"
#include <stddef.h>

#include <sys/time.h>

curms_t curms(void)
{
        struct timeval now;
        gettimeofday(&now, NULL);
        return now.tv_sec * 1000 + now.tv_usec / 1000;
}

/*
 *  ClusteredPoller
 *
 *  Created by Jakob Borg.
 *  Copyright 2011 Nym Networks. See LICENSE for terms.
 */

#include "cltime.h"
#include <stddef.h>

#include <sys/time.h>

curms_t curms(void)
{
        struct timeval now;
        gettimeofday(&now, NULL);
        return (curms_t) now.tv_sec * 1000 + (curms_t) now.tv_usec / 1000;
}

Fix for Solaris type conversion.

Fix for Solaris type conversion.


//
//  FileSystem.h
//  arc
//
//  Created by Jerome Cheng on 19/3/13.
//  Copyright (c) 2013 nus.cs3217. All rights reserved.
//

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

@interface FileSystem : NSObject {
    Folder *_rootFolder; // The root folder.
}

// Returns the root folder of the entire file system.
- (Folder*)getRootFolder;

// Returns the single FileSystem instance.
+ (FileSystem*)getInstance;

@end

//
//  FileSystem.h
//  arc
//
//  Created by Jerome Cheng on 19/3/13.
//  Copyright (c) 2013 nus.cs3217. All rights reserved.
//

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

@interface FileSystem : NSObject {
    @private
    Folder *_rootFolder; // The root folder.
}

// Returns the root folder of the entire file system.
- (Folder*)getRootFolder;

// Returns the single FileSystem instance.
+ (FileSystem*)getInstance;

@end

Add @private indicator to instance variable.


#ifndef _ARDUINO_COMPAT_H
#define _ARDUINO_COMPAT_H

#include <stdio.h>
#include <stdlib.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h>

#include <ctype.h>

#include <string.h>

#include <iostream>
using namespace std;

typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef bool boolean;
typedef iostream Stream;

#endif

#ifndef _ARDUINO_COMPAT_H
#define _ARDUINO_COMPAT_H

#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h>

#include <ctype.h>

#include <string.h>

#include <iostream>
using namespace std;

typedef bool boolean;
typedef iostream Stream;

#endif

Use stdint.h for unsigned integer typedefs

Fixes problem compiling regression tests on 64 bit OS.


#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>

void
usage(char *progname)
{
	printf("usage: %s filename [address]\n", progname);
}

void
prepare_filebuf(char **fb, long size)
{
	*fb = (char*) malloc(size);
}

int
main(int argc, char *argv[])
{
	int fd;
	struct stat statbuf;
	char *filebuf;

	if (argc <= 1) {
		usage(argv[0]);
		exit(1);
	}

	if ((fd = open(argv[1], O_RDONLY)) == -1)  {
		perror("Error openinig file");
		exit(2);
	}

	fstat(fd, &statbuf);

	if (argc == 3)
		filebuf = (char*) strtol(argv[2], NULL, 16);
	else
		prepare_filebuf(&filebuf, statbuf.st_size);

	printf("file is %ld bytes long, will load at %p\n", (long) statbuf.st_size, filebuf);

	if (read(fd, filebuf, statbuf.st_size) == -1) {
		perror("Error reading file");
		exit(3);
	}
}

Add original source from 2014. Split from 9tcfg.


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

inherit SECOND_AUTO;

object queue;

static void create()
{
	queue = new_object(BIGSTRUCT_DEQUE_LWO);
}

void queue_touch(object obj)
{
	if (queue->empty()) {
		call_out("touch", 0);
	}

	queue->push_back(obj);
}

static void touch()
{
	object obj;

	obj = queue->get_front();

	queue->pop_front();

	if (obj) {
		obj->_F_dummy();
	}

	if (!queue->empty()) {
		call_out("touch", 0);
	}
}

Add daemon to touch down all touched objects in the background


/*
 *  C++ 'static const' works differently from C 'static const'.
 *  This example compiles with gcc but not with g++.  G++ will
 *  issue errors.
 */

/*
$ g++ -o /tmp/foo cxx_static_const.c -lm

cxx_static_const.c:2:26: error: uninitialized const ‘N1’ [-fpermissive]
 static const struct node N1;
                          ^
cxx_static_const.c:1:21: note: ‘const struct node’ has no user-provided default constructor
 struct node; struct node { const struct node *other; };
                     ^
cxx_static_const.c:1:47: note: and the implicitly-defined constructor does not initialize ‘const node* node::other’
 struct node; struct node { const struct node *other; };
                                               ^
cxx_static_const.c:3:26: error: uninitialized const ‘N2’ [-fpermissive]
 static const struct node N2;
                          ^
cxx_static_const.c:1:21: note: ‘const struct node’ has no user-provided default constructor
 struct node; struct node { const struct node *other; };
                     ^
cxx_static_const.c:1:47: note: and the implicitly-defined constructor does not initialize ‘const node* node::other’
 struct node; struct node { const struct node *other; };
                                               ^
cxx_static_const.c:4:26: error: redefinition of ‘const node N1’
 static const struct node N1 = { &N2 };
                          ^
cxx_static_const.c:2:26: error: ‘const node N1’ previously declared here
 static const struct node N1;
                          ^
cxx_static_const.c:5:26: error: redefinition of ‘const node N2’
 static const struct node N2 = { &N1 };
                          ^
cxx_static_const.c:3:26: error: ‘const node N2’ previously declared here
 static const struct node N2;
*/

struct node; struct node { const struct node *other; };
static const struct node N1;
static const struct node N2;
static const struct node N1 = { &N2 };
static const struct node N2 = { &N1 };

int main(int argc, char *argv[]) {
	(void) argc; (void) argv; return 0;
}

Add example of C++ 'static const' issue

Add example of C++ 'static const' issue


#include <stdio.h>

main() {
  char ch0 = 'a';
  char ch1 = 'b';
  char ch2 = 'c';

  char *p = &ch1;
  printf("%d, %c, %c\n", p, *p, ch1);
  ++p;
  printf("%d, %c, %c\n", p, *p, ch1);
  printf("%d, %d, %d\n", &ch0, &ch1, &ch2); // Prevent the compiler from optimizing away the char constants
}

#include <stdio.h>

main() {
  char ch0 = 'e';
  char ch1 = 'v';
  char ch2 = 'i';

  char *p = &ch1;
  printf("%d, %c, %c\n", p, *p, ch1);
  ++p;
  printf("%d, %c, %c\n", p, *p, ch1);
  printf("%d, %d, %d\n", &ch0, &ch1, &ch2); // Prevent the compiler from optimizing away the char constants
}

Make it more ovious we are not incrementing and decrementing chars


// RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep llvm.noinline

int bar(int x, int y); __attribute__((noinline))

int bar(int x, int y)
{
 return x + y;
}

int foo(int a, int b) {
 return  bar(b, a);
}

Test case for noinline attribute.

Test case for noinline attribute.

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


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

#ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_
#define CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_

#include <vector>

#include "chrome/browser/autofill/autofill_profile.h"

// Shows the AutoFill dialog, which allows the user to edit profile information.
// |profiles| is a vector of autofill profiles that contains the current profile
// information.  The dialog fills out the profile fields using this data.  Any
// changes made to the profile information through the dialog should be
// transferred back into |profiles|.
void ShowAutoFillDialog(const std::vector<AutoFillProfile>& profiles);

#endif  // CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_

Add the AutoFillDialog header, needed by the cross-platform implementations to implement the autofill dialog.

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/549014

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@36030 4ff67af0-8c30-449e-8e8b-ad334ec8d88c


#ifndef _CONDOR_GETMNT_H
#define _CONDOR_GETMNT_H

#if defined(ULTRIX42) || defined(ULTRIX43)
#include <sys/mount.h>
#endif

#if !defined(OSF1)
#include <mntent.h>
#endif

#if !defined(NMOUNT)
#define NMOUNT 256
#endif

#if !defined(ULTRIX42) && !defined(ULTRIX43)
struct fs_data_req {
	dev_t	dev;
	char	*devname;
	char	*path;
};
struct fs_data {
	struct fs_data_req fd_req;
};
#define NOSTAT_MANY 0
#endif

#if NMOUNT < 256
#undef  NMOUNT
#define NMOUNT  256
#endif

#endif /* _CONDOR_GETMNT_H */

#ifndef _CONDOR_GETMNT_H
#define _CONDOR_GETMNT_H

#if defined(ULTRIX42) || defined(ULTRIX43)
#include <sys/mount.h>
#endif

#if !defined(OSF1) && !defined(AIX32)
#include <mntent.h>
#endif

#if defined(AIX32)
#	include <sys/mntctl.h>
#	include <sys/vmount.h>
#	include <sys/sysmacros.h>
#endif

#if !defined(NMOUNT)
#define NMOUNT 256
#endif

#if !defined(ULTRIX42) && !defined(ULTRIX43)
struct fs_data_req {
	dev_t	dev;
	char	*devname;
	char	*path;
};
struct fs_data {
	struct fs_data_req fd_req;
};
#define NOSTAT_MANY 0
#endif

#if NMOUNT < 256
#undef  NMOUNT
#define NMOUNT  256
#endif

#endif /* _CONDOR_GETMNT_H */

Add AIX specific include files.

Add AIX specific include files.


// -*- c++ -*-

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

  Program:   Visualization Toolkit
  Module:    Tokenizer.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

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

/*
 * Copyright 2003 Sandia Corporation.
 * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
 * license for use of this work by or on behalf of the
 * U.S. Government. Redistribution and use in source and binary forms, with
 * or without modification, are permitted provided that this Notice and any
 * statement of authorship are reproduced on all copies.
 */

#include <vtkConfigure.h>
#include <string>

class Tokenizer
{
public:
  Tokenizer(const char *s, const char *delim = " \t\n");
  Tokenizer(const vtkstd::string &s, const char *delim = " \t\n");

  vtkstd::string GetNextToken();
  vtkstd::string GetRemainingString() const;
  bool HasMoreTokens() const;

  void Reset();

private:
  vtkstd::string FullString;
  vtkstd::string Delim;
  vtkstd::string::size_type Position;
};

// -*- c++ -*-

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

  Program:   Visualization Toolkit
  Module:    Tokenizer.h

  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

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

/*
 * Copyright 2003 Sandia Corporation.
 * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive
 * license for use of this work by or on behalf of the
 * U.S. Government. Redistribution and use in source and binary forms, with
 * or without modification, are permitted provided that this Notice and any
 * statement of authorship are reproduced on all copies.
 */

#include <vtkConfigure.h>
#include <vtkstd/string>

class Tokenizer
{
public:
  Tokenizer(const char *s, const char *delim = " \t\n");
  Tokenizer(const vtkstd::string &s, const char *delim = " \t\n");

  vtkstd::string GetNextToken();
  vtkstd::string GetRemainingString() const;
  bool HasMoreTokens() const;

  void Reset();

private:
  vtkstd::string FullString;
  vtkstd::string Delim;
  vtkstd::string::size_type Position;
};

COMP: Use the VTK wrapping of the string class header file.


// Check that we don't try to forward -Xclang or -mlinker-version to GCC.
// PR12920 -- Check also we may not forward W_Group options to GCC.
//
// RUN: %clang -target powerpc-unknown-unknown \
// RUN:   %s \
// RUN:   -Wall -Wdocumentation \
// RUN:   -Xclang foo-bar \
// RUN:   -march=x86_64 \
// RUN:   -mlinker-version=10 -### 2> %t
// RUN: FileCheck < %t %s
//
// clang-cc1
// CHECK: "-Wall" "-Wdocumentation"
// CHECK: "-o" "{{[^"]+}}.o"
//
// gcc-ld
// CHECK: gcc{{[^"]*}}"
// CHECK-NOT: "-mlinker-version=10"
// CHECK-NOT: "-Xclang"
// CHECK-NOT: "foo-bar"
// CHECK-NOT: "-Wall"
// CHECK-NOT: "-Wdocumentation"
// CHECK: -march
// CHECK-NOT: "-mlinker-version=10"
// CHECK-NOT: "-Xclang"
// CHECK-NOT: "foo-bar"
// CHECK-NOT: "-Wall"
// CHECK-NOT: "-Wdocumentation"
// CHECK: "-o" "a.out"

// Check that we're not forwarding -g options to the assembler
// RUN: %clang -g -target x86_64-unknown-linux-gnu -no-integrated-as -c %s -### 2>&1 \
// RUN:   | FileCheck --check-prefix=CHECK-ASM %s
// CHECK-ASM: as
// CHECK-ASM-NOT: "-g"

Test that we're not forwarding on -g options to the non integrated assembler.

This is adding a test for an old fixed PR to make sure we don't regress.

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


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

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

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

  uintptr_t numExtraThreads;
  Thread *threads;

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

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

  uintptr_t numFixIts;
  FixIt *fixIts;

  uintptr_t numNotes;
  Note *notes;
};

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

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

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

#include <stdint.h>

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

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

  uintptr_t numExtraThreads;
  Thread *threads;

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

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

  uintptr_t numFixIts;
  FixIt *fixIts;

  uintptr_t numNotes;
  Note *notes;
};

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

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

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


/*
 * Modified version of Keypoint.h
 * Source location: https://github.com/pippy360/transformationInvariantImageSearch/blob/master/fullEndToEndDemo/src/Keypoint.h
*/
#pragma once
#ifndef REVERSE_IMAGE_SEARCH_KEYPOINT_H
#define REVERSE_IMAGE_SEARCH_KEYPOINT_H

#include <iostream>
#include <sstream>

using namespace std;

class KeyPoint {
  public:
    double x_, y_;
    KeyPoint(double x, double y) {
        x_ = x;
        y_ = y;
    };

    /**
     * Convert a KeyPoint to a string
     * @return string
     */
    string ToString() {
        std::ostringstream string_stream_;
      string_stream_<< "KeyPoint[ " << x_ << ", " << y_ << "]";
        return string_stream_.str();
    }
};

namespace hash {
  template <>
  struct hash<KeyPoint> {
      std::size_t operator()(const KeyPoint &k) const {
        using std::hash;
          return ((hash<double>()(k.x_) ^ (hash<double>()(k.y_) << 1)) >> 1);
      }
  };
}
#endif

/*
 * Modified version of Keypoint.h
 * Source location: https://github.com/pippy360/transformationInvariantImageSearch/blob/master/fullEndToEndDemo/src/Keypoint.h
*/
#pragma once
#ifndef REVERSE_IMAGE_SEARCH_KEYPOINT_H
#define REVERSE_IMAGE_SEARCH_KEYPOINT_H

#include <iostream>
#include <sstream>
#include <math.h>

using namespace std;

class KeyPoint {
  public:
    double x_, y_;
    KeyPoint(double x, double y) {
        x_ = x;
        y_ = y;
    };

    /**
     * Convert a KeyPoint to a string
     * @return string
     */
    string ToString() {
        std::ostringstream string_stream_;
      string_stream_<< "KeyPoint[ " << x_ << ", " << y_ << "]";
        return string_stream_.str();
    }
};

namespace std {
  template <>
  struct hash<KeyPoint> {
      std::size_t operator()(const KeyPoint &k) const {
        using std::hash;
          return ((hash<double>()(k.x_) ^ (hash<double>()(k.y_) << 1)) >> 1);
      }
  };
}
#endif

Resolve compilation issue due to missing math.h inclusion


#ifndef _FAKE_LOCK_SCREEN_PATTERN_H_
#define _FAKE_LOCK_SCREEN_PATTERN_H_

#include <gtk/gtk.h>

#if !GTK_CHECK_VERSION(3, 0, 0)
typedef struct {
  gdouble red;
  gdouble green;
  gdouble blue;
  gdouble alpha;
} GdkRGBA;
#endif

void flsp_draw_circle(cairo_t *context,
                      gint x, gint y, gint radius,
                      GdkRGBA circle, GdkRGBA border);

#endif

#ifndef _FAKE_LOCK_SCREEN_PATTERN_H_
#define _FAKE_LOCK_SCREEN_PATTERN_H_

#include <gtk/gtk.h>

#if !GTK_CHECK_VERSION(3, 0, 0)
typedef struct {
  gdouble red;
  gdouble green;
  gdouble blue;
  gdouble alpha;
} GdkRGBA;
#endif

void flsp_draw_circle(cairo_t *context,
                      gint x, gint y, gint radius,
                      GdkRGBA circle, GdkRGBA border);

gboolean is_marked(gint x, gint y,
                   gint *marked, void *user_data);

#endif

Add prototype to judge marked point

Add prototype to judge marked point


/*
 * Copyright © 2009 CNRS
 * Copyright © 2009-2010 INRIA
 * Copyright © 2009-2010 Université Bordeaux 1
 * See COPYING in top-level directory.
 */

#include <private/config.h>
#include <hwloc.h>

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

int main(void)
{
  hwloc_topology_t topology;
  hwloc_bitmap_t cpuset;
  hwloc_obj_t obj;

  hwloc_topology_init(&topology);
  hwloc_topology_load(topology);
  hwloc_topology_check(topology);
  cpuset = hwloc_bitmap_alloc();
  hwloc_bitmap_set(cpuset, 0);
  obj = hwloc_topology_insert_misc_object_by_cpuset(topology, cpuset, "test");
  hwloc_topology_insert_misc_object_by_parent(topology, obj, "test2");
  hwloc_topology_check(topology);
  hwloc_topology_destroy(topology);

  return 0;
}

/*
 * Copyright © 2009 CNRS
 * Copyright © 2009-2010 INRIA
 * Copyright © 2009-2010 Université Bordeaux 1
 * See COPYING in top-level directory.
 */

#include <private/config.h>
#include <hwloc.h>

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

int main(void)
{
  hwloc_topology_t topology;
  hwloc_bitmap_t cpuset;
  hwloc_obj_t obj;

  hwloc_topology_init(&topology);
  hwloc_topology_load(topology);
  hwloc_topology_check(topology);
  cpuset = hwloc_bitmap_alloc();
  hwloc_bitmap_set(cpuset, 0);
  obj = hwloc_topology_insert_misc_object_by_cpuset(topology, cpuset, "test");
  hwloc_bitmap_free(cpuset);
  hwloc_topology_insert_misc_object_by_parent(topology, obj, "test2");
  hwloc_topology_check(topology);
  hwloc_topology_destroy(topology);

  return 0;
}

Fix a memory leak in tests

Fix a memory leak in tests

git-svn-id: 14be032f8f42541b1a281b51ae8ea69814daf20e@2903 4b44e086-7f34-40ce-a3bd-00e031736276


#ifndef _UART_H_
#define _UART_H_

#include "mk20dx256.h"

void uart_setup(UART_MemMapPtr base, int baud);
void uart_putchar(UART_MemMapPtr base, char ch);
void uart_putline(UART_MemMapPtr base, char * str);

#endif

#ifndef _UART_H_
#define _UART_H_

#include "mk20dx256.h"
#include "pins.h"

void uart_setup(UART_MemMapPtr base, int baud);
void uart_putchar(UART_MemMapPtr base, char ch);
void uart_putline(UART_MemMapPtr base, char * str);

/*
 * Convenience function to setup UART0 on pins 0 and 1 with 115200 baud
 */
inline static void uart0_setup_default() {
  PIN0_PORT_PCR = PORT_PCR_MUX(3);
  PIN1_PORT_PCR = PORT_PCR_MUX(3);
  uart_setup(UART0_BASE_PTR, 115200);
}

inline static void uart0_putchar(char ch) {
  uart_putchar(UART0_BASE_PTR, ch);
}

inline static void uart0_putline(char * str) {
  uart_putline(UART0_BASE_PTR, str);
}

#endif

Add convenience functions for UART0

Add convenience functions for UART0


/* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

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

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

   You should have received a copy of the GNU Library General Public
   License along with the GNU C Library; see the file COPYING.LIB.  If not,
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.  */

#ifndef _SYS_MSG_H
# error "Never use <bits/msq.h> directly; include <sys/msg.h> instead."
#endif

#include <bits/types.h>

/* Define options for message queue functions.  */
#define MSG_NOERROR    010000  /* no error if message is too big */
#ifdef __USE_GNU
# define MSG_EXCEPT    020000  /* recv any msg except of specified type */
#endif

/* Types used in the structure definition.  */
typedef unsigned long int msgqnum_t;
typedef unsigned long int msglen_t;

/* Structure of record for one message inside the kernel.
   The type `struct msg' is opaque.  */
struct msqid_ds
{
  struct ipc_perm msg_perm;    /* structure describing operation permission */
  unsigned int __unused1;
  __time_t msg_stime;          /* time of last msgsnd command */
  unsigned int __unused2;
  __time_t msg_rtime;          /* time of last msgrcv command */
  unsigned int __unused3;
  __time_t msg_ctime;          /* time of last change */
  unsigned long __msg_cbytes; /* current number of bytes on queue */
  msgqnum_t msg_qnum;          /* number of messages currently on queue */
  msglen_t msg_qbytes;         /* max number of bytes allowed on queue */
  __pid_t msg_lspid;           /* pid of last msgsnd() */
  __pid_t msg_lrpid;           /* pid of last msgrcv() */
  unsigned long __unused4;
  unsigned long __unused5;
};

#ifdef __USE_MISC

# define msg_cbytes    __msg_cbytes

/* ipcs ctl commands */
# define MSG_STAT 11
# define MSG_INFO 12

/* buffer for msgctl calls IPC_INFO, MSG_INFO */
struct msginfo
  {
    int msgpool;
    int msgmap;
    int msgmax;
    int msgmnb;
    int msgmni;
    int msgssz;
    int msgtql;
    unsigned short int msgseg;
  };

#endif /* __USE_MISC */

Make powerpc compile. Needs this header...


// RUN: rm -f %t
// RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.dia > /dev/null 2>&1
// RUN: c-index-test -read-diagnostics %t.dia 2>&1 | FileCheck %s

// RUN: c-index-test -read-diagnostics %S/Inputs/serialized-diags-stable.dia 2>&1 | FileCheck %s

int foo() {
  // CHECK: serialized-diags-stable.c:[[@LINE+2]]:1: warning: control reaches end of non-void function [-Wreturn-type] [Semantic Issue]
  // CHECK-NEXT: Number FIXITs = 0
}

// CHECK: serialized-diags-stable.c:[[@LINE+5]]:13: error: redefinition of 'bar' as different kind of symbol [] [Semantic Issue]
// CHECK-NEXT: Number FIXITs = 0
// CHECK-NEXT: +-/Volumes/Lore/llvm-public/clang/test/Misc/serialized-diags-stable.c:[[@LINE+2]]:6: note: previous definition is here [] []
// CHECK-NEXT: Number FIXITs = 0
void bar() {}
typedef int bar;

// CHECK-LABEL: Number of diagnostics: 2

// RUN: rm -f %t
// RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.dia > /dev/null 2>&1
// RUN: c-index-test -read-diagnostics %t.dia 2>&1 | FileCheck %s

// RUN: c-index-test -read-diagnostics %S/Inputs/serialized-diags-stable.dia 2>&1 | FileCheck %s

int foo() {
  // CHECK: serialized-diags-stable.c:[[@LINE+2]]:1: warning: control reaches end of non-void function [-Wreturn-type] [Semantic Issue]
  // CHECK-NEXT: Number FIXITs = 0
}

// CHECK: serialized-diags-stable.c:[[@LINE+5]]:13: error: redefinition of 'bar' as different kind of symbol [] [Semantic Issue]
// CHECK-NEXT: Number FIXITs = 0
// CHECK-NEXT: +-serialized-diags-stable.c:[[@LINE+2]]:6: note: previous definition is here [] []
// CHECK-NEXT: Number FIXITs = 0
void bar() {}
typedef int bar;

// CHECK-LABEL: Number of diagnostics: 2

Remove absolute path from r202733.

Remove absolute path from r202733.

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


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

int main() {
  int i,k,j;

  if (k == 5) {
    assert(k == 5);
    return 0;
  }
  assert(k != 5);

  // simple arithmetic
  i = k + 1;
  assert(i != 6);
  i = k - 1;
  assert(i != 4);
  i = k * 2;
  assert(i != 10); // UNKNOWN! k could be -2147483643;
  i = k / 2;
  assert(i != 2); // UNKNOWN! k could be 4

  return 0;
}

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

int main() {
  int i,k,j;

  if (k == 5) {
    assert(k == 5);
    return 0;
  }
  assert(k != 5);

  // simple arithmetic
  i = k + 1;
  assert(i != 6);
  i = k - 1;
  assert(i != 4);
  i = k * 3;       // multiplication with odd numbers is injective
  assert(i != 15);
  i = k * 2;       // multiplication with even numbers is not-injective
  assert(i != 10); // UNKNOWN! k could be -2147483643;
  i = k / 2;
  assert(i != 2); // UNKNOWN! k could be 4

  return 0;
}

Add assertion about result of multiplication to test


#include <objlib.h>

#define MAXFILTS 30

class VOCODE2 : public Instrument {
   int       skip, numfilts, branch;
   float     amp, aamp, pctleft, noise_amp, hipass_mod_amp;
   float     *in, *amparray, amptabs[2];
   SubNoiseL *noise;
   Butter    *modulator_filt[MAXFILTS], *carrier_filt[MAXFILTS], *hipassmod;
   Balance   *balancer[MAXFILTS];

public:
   VOCODE2();
   virtual ~VOCODE2();
   int init(float *, int);
   int run();
};

#include <objlib.h>

#define MAXFILTS 200

class VOCODE2 : public Instrument {
   int       skip, numfilts, branch;
   float     amp, aamp, pctleft, noise_amp, hipass_mod_amp;
   float     *in, *amparray, amptabs[2];
   SubNoiseL *noise;
   Butter    *modulator_filt[MAXFILTS], *carrier_filt[MAXFILTS], *hipassmod;
   Balance   *balancer[MAXFILTS];

public:
   VOCODE2();
   virtual ~VOCODE2();
   int init(float *, int);
   int run();
};

Raise limit on number of filter bands.

Raise limit on number of filter bands.


/*ckwg +5
 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
 * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
 * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
 */

#ifndef VISTK_LUA_PIPELINE_LUA_STATIC_MEMBER_H
#define VISTK_LUA_PIPELINE_LUA_STATIC_MEMBER_H

#include "lua_include.h"

#include <cstring>

/**
 * \file lua_static_member.h
 *
 * \brief Helpers setting static members on objects in Lua.
 */

#define LUA_STATIC_boolean(var)   var
#define LUA_STATIC_cfunction(var) &var
#define LUA_STATIC_integer(var)   var
#define LUA_STATIC_literal(var)   var
#define LUA_STATIC_lstring(var)   var, strlen(var)
#define LUA_STATIC_number(var)    var
#define LUA_STATIC_string(var)    var.c_str()

#define LUA_STATIC_MEMBER(interp, type, var, name)  \
  do                                                \
  {                                                 \
    lua_push##type(interp, LUA_STATIC_##type(var)); \
    lua_setfield(L, -2, name);                      \
  } while (false)

#endif // VISTK_LUA_PIPELINE_LUA_STATIC_MEMBER_H

Add macro to set static members on lua classes


// RUN: %clang -### -target amdgcn--amdhsa -x assembler -mcpu=kaveri %s 2>&1 | FileCheck -check-prefix=AS_LINK %s
// AS_LINK: bin/clang{{.*}} "-cc1as"
// AS_LINK: bin/lld{{.*}} "-flavor" "gnu" "-target" "amdgcn--amdhsa"

// RUN: %clang -### -target amdgcn--amdhsa -x assembler -mcpu=kaveri %s 2>&1 | FileCheck -check-prefix=AS_LINK %s
// AS_LINK: bin/clang{{.*}} "-cc1as"
// AS_LINK: lld{{.*}} "-flavor" "gnu" "-target" "amdgcn--amdhsa"

Handle lld not being found in PATH.

Handle lld not being found in PATH.

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


// test for r305179
// RUN: %clang_cc1 -emit-llvm -O -mllvm -print-after-all %s -o %t 2>&1 | grep '*** IR Dump After Function Integration/Inlining ***'
void foo() {}

Add regression test for r305179.

Add regression test for r305179.

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


/*
 * Copyright (c) 2002 David O'Brien <obrien@FreeBSD.org>.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. Neither the name of the author nor the names of any co-contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY DAVID O'BRIEN AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $FreeBSD$
 */

#ifndef _FLOATINGPOINT_H_
#define _FLOATINGPOINT_H_

#include <machine/ieeefp.h>

#endif /* !_FLOATINGPOINT_H_ */

Add this FreeBSD standard header.

Add this FreeBSD standard header.


// RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=region %s
// XFAIL

struct tea_cheese { unsigned magic; };
typedef struct tea_cheese kernel_tea_cheese_t;
extern kernel_tea_cheese_t _wonky_gesticulate_cheese;

// This test case exercises the ElementRegion::getRValueType() logic.

void foo( void )
{
  kernel_tea_cheese_t *wonky = &_wonky_gesticulate_cheese;
  struct load_wine *cmd = (void*) &wonky[1];
  cmd = cmd;
  char *p = (void*) &wonky[1];
  *p = 1;
  kernel_tea_cheese_t *q = &wonky[1];
  kernel_tea_cheese_t r = *q; // expected-warning{{out-of-bound memory position}}
}

// RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=region %s

struct tea_cheese { unsigned magic; };
typedef struct tea_cheese kernel_tea_cheese_t;
extern kernel_tea_cheese_t _wonky_gesticulate_cheese;

// This test case exercises the ElementRegion::getRValueType() logic.

void foo( void )
{
  kernel_tea_cheese_t *wonky = &_wonky_gesticulate_cheese;
  struct load_wine *cmd = (void*) &wonky[1];
  cmd = cmd;
  char *p = (void*) &wonky[1];
  *p = 1;
  kernel_tea_cheese_t *q = &wonky[1];
  kernel_tea_cheese_t r = *q; // expected-warning{{out-of-bound memory position}}
}

Test now passes.  I'll hold off merging it with the BasicStore test until we know this is a stable change.

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


#ifndef NRF51_HAL_CONF_H__
#define NRF51_HAL_CONF_H__

#define HAL_UART_MODULE_ENABLED
#define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#define HAL_RTC_MODULE_ENABLED
#define HAL_TIMER_MODULE_ENABLED

#endif // NRF51_HAL_CONF_H__

#ifndef NRF51_HAL_CONF_H__
#define NRF51_HAL_CONF_H__

#define HAL_UART_MODULE_ENABLED
// #define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
// #define HAL_RTC_MODULE_ENABLED
// #define HAL_TIMER_MODULE_ENABLED

#endif // NRF51_HAL_CONF_H__

nrf5/boards: Disable SPI/Timer/RTC hal from microbit board.


/* +
 */

#include "dpl/acc.h"
#include "dpl/defs.h"
#include "dpl/utils.h"

int dpl_acc_durance (DplIter *iter, time_t *dur)
{
    DplEntry *task;
    *dur = 0;
    time_t begin, end;

    while (dpl_iter_next (iter, &task) == DPL_OK) {
        dpl_entry_begin_get (task, &begin);
        DPL_FORWARD_ERROR (dpl_entry_work_end_get (task, &end));
        *dur += (end - begin);
    }

    return DPL_OK;
}

/* +
 */

#include "dpl/acc.h"
#include "dpl/defs.h"
#include "dpl/utils.h"

int dpl_acc_durance (DplIter *iter, time_t *dur)
{
    const DplEntry *task;
    *dur = 0;
    time_t begin, end;

    while (dpl_iter_next (iter, &task) == DPL_OK) {
        dpl_entry_begin_get (task, &begin);
        DPL_FORWARD_ERROR (dpl_entry_work_end_get (task, &end));
        *dur += (end - begin);
    }

    return DPL_OK;
}

Fix constness to avoid a compiler warning.

Fixes #39.


#ifndef _NPY_ARRAY_CONVERT_DATATYPE_H_
#define _NPY_ARRAY_CONVERT_DATATYPE_H_

NPY_NO_EXPORT PyObject *
PyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran);

#endif

#ifndef _NPY_ARRAY_CONVERT_DATATYPE_H_
#define _NPY_ARRAY_CONVERT_DATATYPE_H_

NPY_NO_EXPORT PyObject *
PyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran);

NPY_NO_EXPORT int
PyArray_CastTo(PyArrayObject *out, PyArrayObject *mp);

NPY_NO_EXPORT PyArray_VectorUnaryFunc *
PyArray_GetCastFunc(PyArray_Descr *descr, int type_num);

NPY_NO_EXPORT int
PyArray_CanCastSafely(int fromtype, int totype);

NPY_NO_EXPORT Bool
PyArray_CanCastTo(PyArray_Descr *from, PyArray_Descr *to);

NPY_NO_EXPORT int
PyArray_ObjectType(PyObject *op, int minimum_type);

NPY_NO_EXPORT PyArrayObject **
PyArray_ConvertToCommonType(PyObject *op, int *retn);

NPY_NO_EXPORT int
PyArray_ValidType(int type);

#endif

Add API for datatype conversion.

Add API for datatype conversion.

git-svn-id: 77a43f9646713b91fea7788fad5dfbf67e151ece@6920 94b884b6-d6fd-0310-90d3-974f1d3f35e1


#pragma once

#include "Platform.h"
#include "UpdateMessage.h"
#include "UpdateObserver.h"

#include "wincore.h"
#include "controls.h"
#include "stdcontrols.h"

class UpdateDialogWin32 : public UpdateDialog
{
	public:
		UpdateDialogWin32();
		~UpdateDialogWin32();

		// implements UpdateDialog
		virtual void init(int argc, char** argv);
		virtual void exec();
		virtual void quit();

		// implements UpdateObserver
		virtual void updateError(const std::string& errorMessage);
		virtual void updateProgress(int percentage);
		virtual void updateFinished();

		LRESULT WINAPI windowProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam);

	private:
		void installWindowProc(CWnd* window);

		CWinApp m_app;
		CWnd m_window;
		CStatic m_progressLabel;
		CProgressBar m_progressBar;
		CButton m_finishButton;
		bool m_hadError;
};

#pragma once

#include "Platform.h"
#include "UpdateDialog.h"
#include "UpdateMessage.h"

#include "wincore.h"
#include "controls.h"
#include "stdcontrols.h"

class UpdateDialogWin32 : public UpdateDialog
{
	public:
		UpdateDialogWin32();
		~UpdateDialogWin32();

		// implements UpdateDialog
		virtual void init(int argc, char** argv);
		virtual void exec();
		virtual void quit();

		// implements UpdateObserver
		virtual void updateError(const std::string& errorMessage);
		virtual void updateProgress(int percentage);
		virtual void updateFinished();

		LRESULT WINAPI windowProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam);

	private:
		void installWindowProc(CWnd* window);

		CWinApp m_app;
		CWnd m_window;
		CStatic m_progressLabel;
		CProgressBar m_progressBar;
		CButton m_finishButton;
		bool m_hadError;
};

Fix Win32 build - add missing include

Fix Win32 build - add missing include


#include <stdlib.h>

/**
 * @author: Hendrik Werner
 */

typedef struct Position {
	int row;
	int col;
} Position;

int main() {
	return EXIT_SUCCESS;
}

#include <stdlib.h>

/**
 * @author: Hendrik Werner
 */

#define BOARD_HEIGHT 50
#define BOARD_WIDTH 50

typedef struct Position {
	int row;
	int col;
} Position;

int main() {
	return EXIT_SUCCESS;
}

Define the board height and width.

Define the board height and width.


#ifndef PHEVALUATOR_HAND_H
#define PHEVALUATOR_HAND_H

#ifdef __cplusplus

#include <vector>
#include <array>
#include <string>
#include "card.h"

namespace phevaluator {

class Hand {
 public:
  Hand() {}

  Hand(const std::vector<Card>& cards);
  Hand(const Card& card);

  Hand& operator+=(const Card& card);
  Hand operator+(const Card& card);

  const unsigned char& getSize() const { return size_; }
  const int& getSuitHash() const { return suitHash_; }
  const std::array<int, 4>& getSuitBinary() const { return suitBinary_; }
  const std::array<unsigned char, 13> getQuinary() const { return quinary_; }

 private:
  unsigned char size_ = 0;
  int suitHash_ = 0;
  std::array<int, 4> suitBinary_{0};
  std::array<unsigned char, 13> quinary_{0};
};

} // namespace phevaluator

#endif // __cplusplus

#endif // PHEVALUATOR_HAND_H

#ifndef PHEVALUATOR_HAND_H
#define PHEVALUATOR_HAND_H

#ifdef __cplusplus

#include <vector>
#include <array>
#include <string>
#include "card.h"

namespace phevaluator {

class Hand {
 public:
  Hand() {}

  Hand(const std::vector<Card>& cards);
  Hand(const Card& card);

  Hand& operator+=(const Card& card);
  Hand operator+(const Card& card);

  const unsigned char& getSize() const { return size_; }
  const int& getSuitHash() const { return suitHash_; }
  const std::array<int, 4>& getSuitBinary() const { return suitBinary_; }
  const std::array<unsigned char, 13> getQuinary() const { return quinary_; }

 private:
  unsigned char size_ = 0;
  int suitHash_ = 0;
  std::array<int, 4> suitBinary_{{0}};
  std::array<unsigned char, 13> quinary_{{0}};
};

} // namespace phevaluator

#endif // __cplusplus

#endif // PHEVALUATOR_HAND_H

Fix a Hand type compiling errors in GNU compiler


#pragma once

#include "Monster.h"

class cAggressiveMonster :
	public cMonster
{
	typedef cMonster super;

public:

	cAggressiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height);

	virtual void Tick          (std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
	virtual void InStateChasing(std::chrono::milliseconds a_Dt) override;

	virtual void EventSeePlayer(cEntity *) override;
	virtual bool Attack(std::chrono::milliseconds a_Dt);
} ;

#pragma once

#include "Monster.h"

class cAggressiveMonster :
	public cMonster
{
	typedef cMonster super;

public:

	cAggressiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height);

	virtual void Tick          (std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override;
	virtual void InStateChasing(std::chrono::milliseconds a_Dt) override;

	virtual void EventSeePlayer(cEntity *) override;

	/** Try to perform attack
	returns true if attack was deemed successful (hit player, fired projectile, creeper exploded, etc.) even if it didn't actually do damage
	return false if e.g. the mob is still in cooldown from a previous attack */
	virtual bool Attack(std::chrono::milliseconds a_Dt);
} ;

Add comment to Attack() return values

Add comment to Attack() return values


/*
 * 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-k12"

/*
 * 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-k13"

Update driver version to 5.02.00-k13

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

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


#ifndef SSPAPPLICATION_ENTITIES_DOORENTITY_H
#define SSPAPPLICATION_ENTITIES_DOORENTITY_H
#include "Entity.h"
#include <vector>

struct DoorSyncState {
	int entityID;
	bool isOpened;
};

struct ElementState {
	int entityID;
	EVENT desiredState;
	bool desiredStateReached;
};

class DoorEntity :
	public Entity
{
private:

	std::vector<ElementState> m_subjectStates;

	bool m_isOpened;
	float m_minRotation;
	float m_maxRotation;
	float m_rotateTime;
	float m_rotatePerSec;

	bool m_needSync;
public:
	DoorEntity();
	virtual ~DoorEntity();

	int Initialize(int entityID, PhysicsComponent* pComp, GraphicsComponent* gComp, std::vector<ElementState> subjectStates, float rotateTime = 1.0f, float minRotation = 0.0f, float maxRotation = DirectX::XM_PI / 2.0f);

	int Update(float dT, InputHandler* inputHandler);
	int React(int entityID, EVENT reactEvent);

	bool SetIsOpened(bool isOpened);
	bool GetIsOpened();
};

#endif

#ifndef SSPAPPLICATION_ENTITIES_DOORENTITY_H
#define SSPAPPLICATION_ENTITIES_DOORENTITY_H
#include "Entity.h"
#include <vector>

struct ElementState {
	int entityID;
	EVENT desiredState;
	bool desiredStateReached;
};

class DoorEntity :
	public Entity
{
private:

	std::vector<ElementState> m_subjectStates;

	bool m_isOpened;
	float m_minRotation;
	float m_maxRotation;
	float m_rotateTime;
	float m_rotatePerSec;

	bool m_needSync;
public:
	DoorEntity();
	virtual ~DoorEntity();

	int Initialize(int entityID, PhysicsComponent* pComp, GraphicsComponent* gComp, std::vector<ElementState> subjectStates, float rotateTime = 1.0f, float minRotation = 0.0f, float maxRotation = DirectX::XM_PI / 2.0f);

	int Update(float dT, InputHandler* inputHandler);
	int React(int entityID, EVENT reactEvent);

	bool SetIsOpened(bool isOpened);
	bool GetIsOpened();
};

#endif

REMOVE syns state from Door

REMOVE syns state from Door

We will only sync actuators such as levers, buttons and wheels


#ifndef __MOTORS_H_
#define __MOTORS_H_

#include <Servo.h>

#define MIDPOINT 128

class Motors {
  private:
    Servo port, vertical, starbord;
    int port_pin, vertical_pin, starbord_pin;

  public:

    Motors(int p_pin, int v_pin, int s_pin);
    void reset();
    void go(int p, int v, int s);
    void stop();

};

#endif

#ifndef __MOTORS_H_
#define __MOTORS_H_

#include <Servo.h>

#define MIDPOINT 90

class Motors {
  private:
    Servo port, vertical, starbord;
    int port_pin, vertical_pin, starbord_pin;

  public:

    Motors(int p_pin, int v_pin, int s_pin);
    void reset();
    void go(int p, int v, int s);
    void stop();

};

#endif

Set MIDPOINT to 90 instead of 128 (servo lib goes from 0 to 180)


/*
 * opencog/atoms/base/types.h
 *
 * Copyright (C) 2002-2007 Novamente LLC
 * All Rights Reserved
 *
 * Written by Thiago Maia <thiago@vettatech.com>
 *            Andre Senna <senna@vettalabs.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License v3 as
 * published by the Free Software Foundation and including the exceptions
 * at http://opencog.org/wiki/Licenses
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program; if not, write to:
 * Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

/**
 * basic type definitions.
 */

#ifndef _OPENCOG_TYPES_H
#define _OPENCOG_TYPES_H

namespace opencog
{
/** \addtogroup grp_atomspace
 *  @{
 */

//! type of Atoms, represented as short integer (16 bits)
typedef unsigned short Type;

/** @}*/
} // namespace opencog

#endif // _OPENCOG_TYPES_H

/*
 * opencog/atoms/base/types.h
 *
 * Copyright (C) 2002-2007 Novamente LLC
 * All Rights Reserved
 *
 * Written by Thiago Maia <thiago@vettatech.com>
 *            Andre Senna <senna@vettalabs.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License v3 as
 * published by the Free Software Foundation and including the exceptions
 * at http://opencog.org/wiki/Licenses
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program; if not, write to:
 * Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

/**
 * basic type definitions.
 */

#ifndef _OPENCOG_TYPES_H
#define _OPENCOG_TYPES_H

#include <set>

namespace opencog
{
/** \addtogroup grp_atomspace
 *  @{
 */

//! type of Atoms, represented as short integer (16 bits)
typedef unsigned short Type;

//! Set of atom types
typedef std::set<Type> TypeSet;

/** @}*/
} // namespace opencog

#endif // _OPENCOG_TYPES_H

Add TypeSet type as set of Types

Add TypeSet type as set of Types


/* mbed Microcontroller Library
 * Copyright (c) 2021 ARM Limited
 * Copyright (c) 2021 Embedded Planet, Inc.
 * SPDX-License-Identifier: Apache-2.0
 *
 * 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 <stdint.h>

#include "subtarget_init.h"

#include "nrf.h"

/**
 * Override the subtarget sdk init startup hook (specific to nRF2)
 * This will configure the internal regulator to operate at 3.3V
 */
void subtarget_sdk_init(void) {

    if (NRF_UICR->REGOUT0 != UICR_REGOUT0_VOUT_3V3)
    {
         NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Wen << NVMC_CONFIG_WEN_Pos;
         while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}
         NRF_UICR->REGOUT0 = UICR_REGOUT0_VOUT_3V3;
         NRF_NVMC->CONFIG = NVMC_CONFIG_WEN_Ren << NVMC_CONFIG_WEN_Pos;
         while (NRF_NVMC->READY == NVMC_READY_READY_Busy){}

         // Trigger a soft reset so that the settings take effect
         NVIC_SystemReset();
     }
}

Configure internal regulators at startup

This commit introduces an implementation of the `subtarget_sdk_init` startup hook (called during `mbed_sdk_init`) that configures the internal regulators of the nRF52840.

The configuration sets up the internal regulator to output 3.3V. If this is not done, the default system voltage may be too low for the on-board indicator LEDs to conduct (ie: system voltage is lower than LED forward voltage).


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

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

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

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

#include "tensorflow/lite/core/api/error_reporter.h"
#include "tensorflow/lite/micro/compatibility.h"
#include "tensorflow/lite/micro/debug_log.h"

namespace tflite {

class MicroErrorReporter : public ErrorReporter {
 public:
  ~MicroErrorReporter() {}
  int Report(const char* format, va_list args) override;

 private:
  TF_LITE_REMOVE_VIRTUAL_DELETE
};

}  // namespace tflite

#endif  // TENSORFLOW_LITE_MICRO_MICRO_ERROR_REPORTER_H_

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

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

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

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

#include "tensorflow/lite/core/api/error_reporter.h"
#include "tensorflow/lite/micro/compatibility.h"
#include "tensorflow/lite/micro/debug_log.h"

namespace tflite {

class MicroErrorReporter : public ErrorReporter {
 public:
  ~MicroErrorReporter() override {}
  int Report(const char* format, va_list args) override;

 private:
  TF_LITE_REMOVE_VIRTUAL_DELETE
};

}  // namespace tflite

#endif  // TENSORFLOW_LITE_MICRO_MICRO_ERROR_REPORTER_H_

Add override specifier to the destructor.

PiperOrigin-RevId: 306301066
Change-Id: Ied92a889ee7af2d0e9a420d55aa503c31b4eba92


#include <kotaka/paths.h>
#include <game/paths.h>
#include <kotaka/log.h>

inherit LIB_WIZBIN;

atomic void main(string args)
{
	proxy_call("destruct_object", args);
	proxy_call("compile_object", args);
}

Allow hard reset of an object by destructing and recreating


#pragma once

#include <chrono>
#include <functional>
#include <thread>
#include <atomic>

class Tick
{
public:
    Tick(std::chrono::microseconds timeBetweenTicks,
         std::function<void()>&& onTick)
        : timeBetweenTicks_(timeBetweenTicks)
        , onTick_(std::move(onTick))
        , active_(true)
        , timerThread_([this] { Loop(); }) // note initialization order is very important here;
                                            // thread should start last
    {}

    void Deactivate() { active_ = false; timerThread_.join(); }

private:
    void Loop() const
    {
        while (active_)
        {
            for (auto start = std::chrono::steady_clock::now(), now = start;
                 now < start + timeBetweenTicks_;
                 now = std::chrono::high_resolution_clock::now()) { /* Until next tick */
            }
            onTick_();	// may take significant time!
        }
    }

    const std::function<void()> onTick_;
    const std::chrono::microseconds timeBetweenTicks_;
    std::atomic<bool> active_;
    std::thread timerThread_;
};

#pragma once

#include <chrono>
#include <functional>
#include <thread>
#include <atomic>

using Clock = std::chrono::steady_clock;

class Tick
{
public:
    Tick(std::chrono::microseconds timeBetweenTicks,
         std::function<void()>&& onTick)
        : timeBetweenTicks_(timeBetweenTicks)
        , onTick_(std::move(onTick))
        , active_(true)
        , timerThread_([this] { Loop(); }) // note initialization order is very important here;
                                            // thread should start last
    {}

    void Deactivate() { active_ = false; timerThread_.join(); }

private:
    void Loop() const
    {
        while (active_)
        {
            for (auto start = Clock::now(), now = start;
                 now < start + timeBetweenTicks_;
                 now = Clock::now()) { /* Until next tick */
            }
            onTick_();	// may take significant time!
        }
    }

    const std::function<void()> onTick_;
    const std::chrono::microseconds timeBetweenTicks_;
    std::atomic<bool> active_;
    std::thread timerThread_;
};

Fix incorrect usage of 2 different clocks to a single uniform clock


#ifndef CUBE_H
#define CUBE_H

#include "stdafx.h"

using namespace std;

class Cube
{
public:
	typedef float * Array;

	//static
	int locAmbient, locDiffuse, locSpecular, locEyeLight, locLight, locTexture;
	//static
	int locMVP, locMV, locNM;

	int numFrame;

	GLuint shader, textureID;

	static bool readTexture;//, readShader;

	Array final_vert, final_text, norm_final;

	GLuint vertbuffID[1], normbuffID[1], texbuffID[1];

	int total, vsize, nsize, tsize;

	Cube(void);

	static GLuint loadShaderPair(char *, char *);

	void init(float[]);
	void bind(GLenum, GLenum);
	void draw(GLGeometryTransform);
};

#endif

#ifndef CUBE_H
#define CUBE_H

#include "stdafx.h"

using namespace std;

class Cube
{
public:
	typedef float * Array;

	static int locAmbient, locDiffuse, locSpecular, locEyeLight, locLight, locTexture;
	static int locMVP, locMV, locNM;

	int numFrame;

	static GLuint shader, textureID;

	static bool readTexture, readShader;

	Array final_vert, final_text, norm_final;

	GLuint vertbuffID[1], normbuffID[1], texbuffID[1];

	int total, vsize, nsize, tsize;

	Cube(void);

	static GLuint loadShaderPair(char *, char *);

	void init(float[]);
	void bind(GLenum, GLenum);
	void draw(GLGeometryTransform);
};

#endif

Reduce Even More Memory Usage

Reduce Even More Memory Usage


#ifndef TEST_UTILS_H
#define TEST_UTILS_H

#include <fplll.h>
using namespace std;
using namespace fplll;

/**
   @brief Read matrix from `input_filename`.

   @param A matrix
   @param input_filename
   @return zero if the file is correctly read, 1 otherwise.
*/
template <class ZT> int read_matrix(ZZ_mat<ZT> &A, const char *input_filename)
{
  int status = 0;
  ifstream is(input_filename);
  if (!is)
  {
    status = 1;
    cerr << "Could not open file " << input_filename << "." << endl;
  }  // throw std::runtime_error("could not open input file");
  is >> A;
  return status;
}

/**
   @brief Read vector from `input_filename` into `b`.

   @param b                vector
   @param input_filename   filename
   @return zero if the file is correctly read, 1 otherwise.
*/

template <class ZT> int read_vector(vector<Z_NR<ZT>> &b, const char *input_filename)
{
  int status = 0;
  ifstream is;
  is.exceptions(std::ifstream::failbit | std::ifstream::badbit);
  try {
    is.open(input_filename);
    is >> b;
    is.close();
  }
  catch (ifstream::failure e) {
    status = 1;
    cerr << "Error by reading " << input_filename << "." << endl;
  }
  return status;
}

#endif /* TEST_UTILS_H */

#ifndef TEST_UTILS_H
#define TEST_UTILS_H

#include <fplll.h>
using namespace std;
using namespace fplll;

#define read_file(X, input_filename) {\
  ifstream is;\
  is.exceptions(std::ifstream::failbit | std::ifstream::badbit);\
  try {\
    is.open(input_filename);\
    is >> X;\
    is.close();\
  }\
  catch (const ifstream::failure&) {\
    status = 1;\
    cerr << "Error by reading " << input_filename << "." << endl;\
  }\
}

/**
   @brief Read matrix from `input_filename`.

   @param A matrix
   @param input_filename
   @return zero if the file is correctly read, 1 otherwise.
*/
template <class ZT> int read_matrix(ZZ_mat<ZT> &A, const char *input_filename)
{
  int status = 0;
  read_file(A, input_filename);
  return status;
}

/**
   @brief Read vector from `input_filename` into `b`.

   @param b                vector
   @param input_filename   filename
   @return zero if the file is correctly read, 1 otherwise.
*/

template <class ZT> int read_vector(vector<Z_NR<ZT>> &b, const char *input_filename)
{
  int status = 0;
  read_file(b, input_filename);
  return status;
}

#endif /* TEST_UTILS_H */

Remove Wcatch-value and unify way to check if files are read.


/**
 * \kernelgroup{SceGpuEs4}
 * \usage{psp2kern/gpu_es4.h,SceGpuEs4ForDriver}
 */

#ifndef _PSP2_KERNEL_GPU_ES4_
#define _PSP2_KERNEL_GPU_ES4_

#include <psp2kern/types.h>

#ifdef __cplusplus
extern "C" {
#endif

int PVRSRVGetMiscInfoKM(void *info);

int ksceGpuGetRegisterDump(void *dst, SceSize size);

#ifdef __cplusplus
}
#endif

#endif /* _PSP2_KERNEL_GPU_ES4_ */

/**
 * \kernelgroup{SceGpuEs4}
 * \usage{psp2kern/gpu_es4.h,SceGpuEs4ForDriver}
 */

#ifndef _PSP2_KERNEL_GPU_ES4_
#define _PSP2_KERNEL_GPU_ES4_

#include <psp2kern/types.h>

#ifdef __cplusplus
extern "C" {
#endif

int PVRSRVGetMiscInfoKM(void *info);

int ksceGpuGetRegisterDump(void *dst, SceSize size);

int ksceGpuMmuMapMemory(void *mmuContext, uint32_t vaddr, void *base, uint32_t size, uint32_t flags);
int ksceGpuMmuUnmapMemory(void *mmuContext, uint32_t vaddr, uint32_t size);

#ifdef __cplusplus
}
#endif

#endif /* _PSP2_KERNEL_GPU_ES4_ */

Add prototypes for SceGpu MMU functions

Add prototypes for SceGpu MMU functions


#include "string.h"
#include "stdio.h"
#include "stdlib.h"

#define DATA_FILE_NAME    "nqmq.dat"
#define DATA_LINE_MAX_LEN 80

char **cities;
char *distances;

int main(int argc, char *argv[])
{
	// Step 1: Read file into cities array and distances adjacency matrix
	char line[DATA_LINE_MAX_LEN];
	FILE *data_file;

	data_file = fopen(DATA_FILE_NAME, "r");

	// The first line will be the number of cities
	fgets(line, DATA_LINE_MAX_LEN, data_file);
	int num_cities = atoi(line);

	// Allocate space for the city names
	cities = malloc(sizeof(char*) * num_cities);

	// Read in all cities
	for (int i = 0; i < num_cities; ++i)
	{
		fgets(line, DATA_LINE_MAX_LEN, data_file);
		cities[i] = malloc(strlen(line) * sizeof(char));
		strcpy(cities[i], line);
	}

	// Clean things up
	for (int i = 0; i < num_cities; ++i)
		free(cities[i]);
	free(cities);

	return 0;
}

#include "string.h"
#include "stdio.h"
#include "stdlib.h"

#define DATA_FILE_NAME    "nqmq.dat"
#define DATA_LINE_MAX_LEN 80

char **cities;
char *distances;

int main(int argc, char *argv[])
{
	// Step 1: Read file into cities array and distances adjacency matrix
	char line[DATA_LINE_MAX_LEN];
	FILE *data_file;
	int  num_cities = 0;

	data_file = fopen(DATA_FILE_NAME, "r");

	// The first line will be the number of cities
	fscanf(data_file, "%d", &num_cities);

	// Allocate space for the city names
	cities = malloc(sizeof(char*) * num_cities);

	// Read in all cities
	for (int i = 0; i < num_cities; ++i)
	{
		fgets(line, DATA_LINE_MAX_LEN, data_file);
		cities[i] = malloc(strlen(line) * sizeof(char));
		strcpy(cities[i], line);
	}

	// Clean things up
	for (int i = 0; i < num_cities; ++i)
		free(cities[i]);
	free(cities);

	return 0;
}

Use fscanf to get the number of cities

Use fscanf to get the number of cities


/*
 * This set (target) cpu specific macros:
 *      - NPY_TARGET_CPU: target CPU type
 */
#ifndef _NPY_CPUARCH_H_
#define _NPY_CPUARCH_H_

#if defined ( _i386_ ) || defined( __i386__ )
        /* __i386__ is defined by gcc and Intel compiler on Linux, _i386_ by
        VS compiler */
        #define NPY_TARGET_CPU NPY_X86
#elif defined(__x86_64__) || defined(__amd64__)
        /* both __x86_64__ and __amd64__ are defined by gcc */
        #define NPY_TARGET_CPU NPY_AMD64
#elif defined(__ppc__) || defined(__powerpc__)
        /* __ppc__ is defined by gcc, I remember having seen __powerpc__ once,
         * but can't find it ATM */
        #define NPY_TARGET_CPU NPY_PPC
#elif defined(__sparc__) || defined(__sparc)
        /* __sparc__ is defined by gcc and Forte (e.g. Sun) compilers */
        #define NPY_TARGET_CPU NPY_SPARC
#elif defined(__s390__)
        #define NPY_TARGET_CPU NPY_S390
#elif defined(__parisc__)
        /* XXX: Not sure about this one... */
        #define NPY_TARGET_CPU NPY_PA_RISC
#else
        #error Unknown CPU, please report this to numpy maintainers with \
        information about your platform
#endif

#endif

Add a (public) header to detect common CPU archs.


#ifndef ROOT_RVersion
#define ROOT_RVersion

/* Version information automatically generated by installer. */

/*
 * These macros can be used in the following way:
 *
 *    #if ROOT_VERSION_CODE >= ROOT_VERSION(2,23,4)
 *       #include <newheader.h>
 *    #else
 *       #include <oldheader.h>
 *    #endif
 *
*/

#define ROOT_RELEASE "5.34/23"
#define ROOT_RELEASE_DATE "Nov  7 2014"
#define ROOT_RELEASE_TIME "15:06:58"
#define ROOT_SVN_REVISION 49361
#define ROOT_GIT_COMMIT "v5-34-22-106-g4a0dea3"
#define ROOT_GIT_BRANCH "heads/v5-34-00-patches"
#define ROOT_VERSION_CODE 336407
#define ROOT_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

#endif

#ifndef ROOT_RVersion
#define ROOT_RVersion

/* Version information automatically generated by installer. */

/*
 * These macros can be used in the following way:
 *
 *    #if ROOT_VERSION_CODE >= ROOT_VERSION(2,23,4)
 *       #include <newheader.h>
 *    #else
 *       #include <oldheader.h>
 *    #endif
 *
*/

#define ROOT_RELEASE "5.34/24"
#define ROOT_RELEASE_DATE "Dec  2 2014"
#define ROOT_RELEASE_TIME "18:12:03"
#define ROOT_SVN_REVISION 49361
#define ROOT_GIT_COMMIT "v5-34-23-79-gbc6a48d"
#define ROOT_GIT_BRANCH "heads/v5-34-00-patches"
#define ROOT_VERSION_CODE 336408
#define ROOT_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))

#endif

Update ROOT version files to v5.34/24.

Update ROOT version files to v5.34/24.


#include <stdio.h>

#define major      1
#define minor      0
#define patch      0

#define ver(arg)   #arg
#define ver2(arg)  ver(arg)

#define maj        ver2(major)
#define min        ver2(minor)
#define pat        ver2(patch)
#define dot        "."

#define VERSION    (maj dot min dot pat)

/*
  @file  version.h
  @brief Defines macros to create version number string

  @license  MIT LICENSE

  @authors
  Prakhar Nigam, https://github.com/prakharnigam
  electrogeek, https://github.com/Nishant-Mishra

*/

#ifndef __VERSION_H__
#define __VERSION_H__

#ifdef __cplusplus
extern "C" {
#endif

#define major      1
#define minor      0
#define patch      0

#define ver(arg)   #arg
#define ver2(arg)  ver(arg)

#define maj        ver2(major)
#define min        ver2(minor)
#define pat        ver2(patch)
#define dot        "."

#define VERSION    (maj dot min dot pat)

#ifdef __cplusplus
} // extern "C"
#endif

#endif /* __VERSION_H__ */

Add guards to avoid multiple includes.

Add guards to avoid multiple includes.


#pragma once

#include <cstdint>
#include <cstdlib>

using uint = unsigned int;

using u8 = uint8_t;
using u16 = uint16_t;
using s8 = int8_t;

const int GAMEBOY_WIDTH = 160;
const int GAMEBOY_HEIGHT = 144;

const int CLOCK_RATE = 4194304;

template <typename... T> void unused(T&&...) {}

#define fatal_error() log_error("Fatal error: %s:%d", __FILE__, __LINE__); exit(1);

enum class GBColor {
    Color0, /* White */
    Color1, /* Light gray */
    Color2, /* Dark gray */
    Color3, /* Black */
};

enum class Color {
    White,
    LightGray,
    DarkGray,
    Black,
};

struct BGPalette {
    Color color0 = Color::White;
    Color color1 = Color::LightGray;
    Color color2 = Color::DarkGray;
    Color color3 = Color::Black;
};

struct Noncopyable {
    Noncopyable& operator=(const Noncopyable&) = delete;
    Noncopyable(const Noncopyable&) = delete;
    Noncopyable() = default;
};

#pragma once

#include <cstdint>
#include <cstdlib>

using uint = unsigned int;

using u8 = uint8_t;
using u16 = uint16_t;
using s8 = int8_t;
using s16 = uint16_t;

const int GAMEBOY_WIDTH = 160;
const int GAMEBOY_HEIGHT = 144;

const int CLOCK_RATE = 4194304;

template <typename... T> void unused(T&&...) {}

#define fatal_error() log_error("Fatal error: %s:%d", __FILE__, __LINE__); exit(1);

enum class GBColor {
    Color0, /* White */
    Color1, /* Light gray */
    Color2, /* Dark gray */
    Color3, /* Black */
};

enum class Color {
    White,
    LightGray,
    DarkGray,
    Black,
};

struct BGPalette {
    Color color0 = Color::White;
    Color color1 = Color::LightGray;
    Color color2 = Color::DarkGray;
    Color color3 = Color::Black;
};

struct Noncopyable {
    Noncopyable& operator=(const Noncopyable&) = delete;
    Noncopyable(const Noncopyable&) = delete;
    Noncopyable() = default;
};

Add a s16 (signed 16-bit int) for symmetry with u8/u16


#pragma once

#include <iomanip>

#include "H5Cpp.h"
#include "logger.h"

// N-wide hex output with 0x
template <unsigned int N> std::ostream &hexn(std::ostream &out) {
  return out << "0x" << std::hex << std::setw(N) << std::setfill('0');
}

inline int mymod(int a, int b) {
  int c = a % b;
  if (c < 0)
    c += b;
  return c;
}

#pragma once

#include <iomanip>

#include "logger.h"

// N-wide hex output with 0x
template <unsigned int N> std::ostream &hexn(std::ostream &out) {
  return out << "0x" << std::hex << std::setw(N) << std::setfill('0');
}

inline int mymod(int a, int b) {
  int c = a % b;
  if (c < 0)
    c += b;
  return c;
}

Remove reference to h5 header

Remove reference to h5 header


/**
 * @file
 * @brief contains some often-used function prototypes etc
 *
 * @date 25.03.2010
 */

#ifndef EMBOX_KERNEL_H_
#define EMBOX_KERNEL_H_

#ifdef __EMBOX__
#include <err.h>
#else
#include <linux/types.h>
#endif

#define ARRAY_SIZE(arr)                 (sizeof(arr) / sizeof((arr)[0]))
/* deprecated */
#define array_len(array)                ARRAY_SIZE(array)

#endif /* EMBOX_KERNEL_H_ */

/**
 * @file
 * @brief contains some often-used function prototypes etc
 *
 * @date 25.03.2010
 */

#ifndef EMBOX_KERNEL_H_
#define EMBOX_KERNEL_H_

#ifdef __EMBOX__
#include <err.h>
#else
#include <linux/types.h>
#endif

#include <util/array.h>

/* TODO deprecated. -- Eldar, Nikolay */
#define array_len(array)                ARRAY_SIZE(array)

#endif /* EMBOX_KERNEL_H_ */

Fix redefinition of ARRAY_SIZE macro warning


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

#include "euler.h"

int
check(int problem, int answer, int result)
{
    char *text = "INCORRECT";
    char *color = KRED;
    int ret = 1;
    if(answer == result) {
        text = "CORRECT";
        color = KGRN;
        ret = 0;
    }
    printf("%sProblm %i %s - Expected: %i; Got %i\n",
        color, problem, text, answer, result);
    return ret;
}

void
error(const char *str)
{
    fprintf(stderr, "%s%s\n", KRED, str);
    exit(1);
}

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

#include "euler.h"

int
check(int problem, int answer, int result)
{
    char *text = "INCORRECT";
    char *color = KRED;
    int ret = 1;
    if(answer == result) {
        text = "CORRECT";
        color = KGRN;
        ret = 0;
    }
    printf("%sProblem %i %s - Expected: %i; Got %i\n",
        color, problem, text, answer, result);
    return ret;
}

void
error(const char *str)
{
    fprintf(stderr, "%s%s\n", KRED, str);
    exit(1);
}

Fix typo: problm -> problem

Fix typo: problm -> problem


/* -----------------------------------------------------------------------------
 *
 * Example: read a STL file
 *
 * Just give a filepath and an initialized gmio_stl_mesh_creator object to
 * gmio_stl_read_file().
 * The gmio_stl_mesh_creator object holds pointers to the callbacks invoked
 * during the read operation.
 * These callbacks creates the final mesh object.
 *
 * Note if you want to have control over the stream to be used, call
 * gmio_stl_read() instead.
 *
 * -------------------------------------------------------------------------- */

#include <gmio_core/error.h>
#include <gmio_stl/stl_infos.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>

static const char* gmio_stl_format_to_str(enum gmio_stl_format format)
{
    switch (format) {
    case GMIO_STL_FORMAT_UNKNOWN: return "UNKNOWN";
    case GMIO_STL_FORMAT_ASCII: return "STL ASCII";
    case GMIO_STL_FORMAT_BINARY_LE: return "STL BINARY LITTLE-ENDIAN";
    case GMIO_STL_FORMAT_BINARY_BE: return "STL BINARY BIG-ENDIAN";
    }
}

static void print_stl_infos(const struct gmio_stl_infos* infos)
{
    printf("File: %s\n"
           "Format: %s\n"
           "Size: %uKo\n"
           "Facets: %u\n",
           filepath,
           gmio_stl_format_to_str(infos->format),
           infos->size / 1024,
           infos->facet_count);
    if (infos->format == GMIO_STL_FORMAT_ASCII) {
        printf("Solid name: %s\n", infos->stla_solidname);
    }
    else if (infos->format == GMIO_STL_FORMAT_BINARY_LE
             || infos->format == GMIO_STL_FORMAT_BINARY_BE)
    {
        printf("Header: %80.80s\n", infos->stlb_header.data);
    }
}

int main(int argc, char** argv)
{
    int error = 0;
    if (argc > 1) {
        /* Path to the STL file */
        const char* filepath = argv[1];
        /* Read-only standard stream on the STL file */
        FILE* file = fopen(filepath, "rb");

        if (file != NULL) {
            /* gmio stream interface object */
            struct gmio_stream stream = gmio_stream_stdio(file);
            /* Will holds informations about the STL file */
            struct gmio_stl_infos infos = {0};
            /* Retrieve STL informations */
            error = gmio_stl_infos_get(
                        &infos, &stream, GMIO_STL_INFO_FLAG_ALL, NULL);
            if (error == GMIO_ERROR_OK)
                print_stl_infos(&infos);
            else
                fprintf(stderr, "gmio error: 0x%X\n", error);

            fclose(file);
        }
    }
    return error;
}

Add new example for gmio_stl_infos_get()


// RUN: %llvmgcc -S %s -fasm-blocks -o - | FileCheck %s
// XFAIL: *
// XTARGET: x86,i386,i686
// 84282548

void foo()
{
// CHECK:  %0 = call i32 asm sideeffect "", "={ecx}"() nounwind
// CHECK:  %asmtmp = call i32 asm sideeffect alignstack "sall $$3, $0", "={ecx},{ecx},~{dirflag},~{fpsr},~{flags},~{memory}"(i32 %0) nounwind
// CHECK:  store i32 %asmtmp, i32* %"%ecx"
 __asm {
   sal ecx, 3;
   add esi, ecx;
   add edi, ecx;
 }
}

Test for llvm-gcc patch 119392.

Test for llvm-gcc patch 119392.

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


// 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 VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_
#define VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_

namespace views {
namespace internal {

class NativeMenuHostDelegate {
 public:
  virtual ~NativeMenuHostDelegate() {}
};

}  // namespace internal
}  // namespace views

#endif  // VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_

Add newline to end of file.

Add newline to end of file.

git-svn-id: dd90618784b6a4b323ea0c23a071cb1c9e6f2ac7@80087 4ff67af0-8c30-449e-8e8b-ad334ec8d88c


// Copyright (c) 2015 TeamSnap. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "TSDKCollectionObject.h"
#import "TSDKObjectsRequest.h"

@interface TSDKPartnerPreferences : TSDKCollectionObject

@property (nonatomic, assign) NSInteger canDisplayPartner; //Example: 0
@property (nonatomic, strong, nullable) NSString * partnerName; //Example: **NULL**
@property (nonatomic, strong, nullable) NSString * userId; //Example: <null>
@property (nonatomic, assign) NSInteger userIsPartner; //Example: 0
@property (nonatomic, strong, nullable) NSString * partnerId; //Example: <null>

@end

// Copyright (c) 2015 TeamSnap. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "TSDKCollectionObject.h"
#import "TSDKObjectsRequest.h"

@interface TSDKPartnerPreferences : TSDKCollectionObject

@property (nonatomic, assign) BOOL canDisplayPartner; //Example: 0
@property (nonatomic, strong, nullable) NSString * partnerName; //Example: **NULL**
@property (nonatomic, strong, nullable) NSString * userId; //Example: <null>
@property (nonatomic, assign) BOOL userIsPartner; //Example: 0
@property (nonatomic, strong, nullable) NSString * partnerId; //Example: <null>

@end

Change partner preference Int to Bool values


/**
 * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */

#ifndef STDAFX_H
#define STDAFX_H

// Common include file for all source code in Util

#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Psapi.h>
#ifdef __cplusplus
#pragma warning(disable:4995) /* suppress #pragma deprecated warnings from standard C++ headers */
#endif /* ifdef __cplusplus */
#else
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include <signal.h>
#include <unistd.h>
#include <dirent.h>
#include <spawn.h>
#endif
#include <assert.h>

// Include these so that cpptask fails if libraries not present
#include <fudge/fudge.h>
#include <log4cxx/log4cxx.h>

#endif /* ifndef STDAFX_H */

/**
 * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */

#ifndef STDAFX_H
#define STDAFX_H

// Common include file for all source code in Util

#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Psapi.h>
#ifdef __cplusplus
#pragma warning(disable:4995) /* suppress #pragma deprecated warnings from standard C++ headers */
#endif /* ifdef __cplusplus */
#else
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <fcntl.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include <signal.h>
#include <unistd.h>
#include <dirent.h>
#include <spawn.h>
#include <sys/stat.h>
#endif
#include <assert.h>

// Include these so that cpptask fails if libraries not present
#include <fudge/fudge.h>
#include <log4cxx/log4cxx.h>

#endif /* ifndef STDAFX_H */

Add sys/stat.h to headers for mkfifo declaration.


#import <Foundation/Foundation.h>

@class JSObjectionInjector;

@interface JSObjectFactory : NSObject
@property (nonatomic, readonly, strong) JSObjectionInjector *injector;

- (id)initWithInjector:(JSObjectionInjector *)injector;
- (id)getObject:(id)classOrProtocol;
- (id)objectForKeyedSubscript: (id)key;
- (id)getObjectWithArgs:(id)classOrProtocol, ... NS_REQUIRES_NIL_TERMINATION;
@end

#import <Foundation/Foundation.h>

@class JSObjectionInjector;

@interface JSObjectFactory : NSObject
@property (nonatomic, readonly, weak) JSObjectionInjector *injector;

- (id)initWithInjector:(JSObjectionInjector *)injector;
- (id)getObject:(id)classOrProtocol;
- (id)objectForKeyedSubscript: (id)key;
- (id)getObjectWithArgs:(id)classOrProtocol, ... NS_REQUIRES_NIL_TERMINATION;
@end

Use weak reference in object factory to avoid cyclical references


//
//  ResultsMapViewController.h
//  bikepath
//
//  Created by Farheen Malik on 8/14/14.
//  Copyright (c) 2014 Bike Path. All rights reserved.
//

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

@interface ResultsMapViewController : UIViewController <GMSMapViewDelegate>
@property (strong, nonatomic) IBOutlet GMSMapView *mapView;

- (IBAction)unwindToSearchPage:(UIStoryboardSegue *)segue;

@end

//
//  ResultsMapViewController.h
//  bikepath
//
//  Created by Farheen Malik on 8/14/14.
//  Copyright (c) 2014 Bike Path. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <GoogleMaps/GoogleMaps.h>
#import "SearchItem.h"

@interface ResultsMapViewController : UIViewController <GMSMapViewDelegate>
@property (strong, nonatomic) IBOutlet GMSMapView *mapView;

- (IBAction)unwindToSearchPage:(UIStoryboardSegue *)segue;

@property (nonatomic, strong) SearchItem *item;

@end

Add passing of information to prepareforsegue method


#include <unittest++/UnitTest++.h>

/*
 * This file provides a transitive include for the UnitTest++ library
 * so that you don't need to remember how to include it yourself. This
 * file also provides you with a reference for using UnitTest++.
 *
 * == BASIC REFERENCE ==
 *      - TEST(NAME_OF_TEST) { body_of_test }
 *      - TEST_FIXTURE(NAME_OF_FIXTURE,NAME_OF_TEST){ body_of_test }
 *
 * == CHECK MACRO REFERENCE ==
 *      - CHECK(EXPR);
 *      - CHECK_EQUAL(EXPECTED,ACTUAL);
 *      - CHECK_CLOSE(EXPECTED,ACTUAL,EPSILON);
 *      - CHECK_ARRAY_EQUAL(EXPECTED,ACTUAL,LENGTH);
 *      - CHECK_ARRAY_CLOSE(EXPECTED,ACTUAL,LENGTH,EPSILON);
 *      - CHECK_ARRAY2D_EQUAL(EXPECTED,ACTUAL,ROWCOUNT,COLCOUNT);
 *      - CHECK_ARRAY2D_CLOSE(EXPECTED,ACTUAL,ROWCOUNT,COLCOUNT,EPSILON);
 *      - CHECK_THROW(EXPR,EXCEPTION_TYPE_EXPECTED);
 *
 * == TIME CONSTRAINTS ==
 *
 *      - UNITTEST_TIME_CONSTRAINT(TIME_IN_MILLISECONDS);
 *      - UNITTEST_TIME_CONSTRAINT_EXEMPT();
 *
 * == MORE INFO ==
 *      See: http://unittest-cpp.sourceforge.net/UnitTest++.html
 */

#include "unittest++/UnitTest++.h"

/*
 * This file provides a transitive include for the UnitTest++ library
 * so that you don't need to remember how to include it yourself. This
 * file also provides you with a reference for using UnitTest++.
 *
 * == BASIC REFERENCE ==
 *      - TEST(NAME_OF_TEST) { body_of_test }
 *      - TEST_FIXTURE(NAME_OF_FIXTURE,NAME_OF_TEST){ body_of_test }
 *
 * == CHECK MACRO REFERENCE ==
 *      - CHECK(EXPR);
 *      - CHECK_EQUAL(EXPECTED,ACTUAL);
 *      - CHECK_CLOSE(EXPECTED,ACTUAL,EPSILON);
 *      - CHECK_ARRAY_EQUAL(EXPECTED,ACTUAL,LENGTH);
 *      - CHECK_ARRAY_CLOSE(EXPECTED,ACTUAL,LENGTH,EPSILON);
 *      - CHECK_ARRAY2D_EQUAL(EXPECTED,ACTUAL,ROWCOUNT,COLCOUNT);
 *      - CHECK_ARRAY2D_CLOSE(EXPECTED,ACTUAL,ROWCOUNT,COLCOUNT,EPSILON);
 *      - CHECK_THROW(EXPR,EXCEPTION_TYPE_EXPECTED);
 *
 * == TIME CONSTRAINTS ==
 *
 *      - UNITTEST_TIME_CONSTRAINT(TIME_IN_MILLISECONDS);
 *      - UNITTEST_TIME_CONSTRAINT_EXEMPT();
 *
 * == MORE INFO ==
 *      See: http://unittest-cpp.sourceforge.net/UnitTest++.html
 */

Use quotes for include so that UnitTest header is found locally.


// PARAM: --set ana.int.interval true --set solver "'td3'"
#include<pthread.h>
#include<assert.h>

int glob1 = 0;
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;

void *t_fun(void *arg) {
  int t;
  pthread_mutex_lock(&mutex1);
  if(t == 42) {
      glob1 = 1;
  }
  t = glob1;

  assert(t == 0); //UNKNOWN

  assert(t == 1); //UNKNOWN

  glob1 = 0;

  pthread_mutex_unlock(&mutex1);
  return NULL;
}

int main(void) {
  pthread_t id;
  assert(glob1 == 0);
  pthread_create(&id, NULL, t_fun, NULL);
  pthread_mutex_lock(&mutex1);
  assert(glob1 == 0);
  pthread_mutex_unlock(&mutex1);
  pthread_join (id, NULL);
  return 0;
}

// PARAM: --set ana.int.interval true --set solver "'td3'"
#include<pthread.h>
#include<assert.h>

int glob1 = 0;
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;

void *t_fun(void *arg) {
  int t;
  pthread_mutex_lock(&mutex1);
  if(t == 42) {
      glob1 = 1;
  }
  t = glob1;

  assert(t == 0); //UNKNOWN!

  assert(t == 1); //UNKNOWN!

  glob1 = 0;

  pthread_mutex_unlock(&mutex1);
  return NULL;
}

int main(void) {
  pthread_t id;
  assert(glob1 == 0);
  pthread_create(&id, NULL, t_fun, NULL);
  pthread_mutex_lock(&mutex1);
  assert(glob1 == 0);
  pthread_mutex_unlock(&mutex1);
  pthread_join (id, NULL);
  return 0;
}

Add exclamation mark to unknown to indicate it should always be unknown


#ifndef A_FILTER_HDR
#define A_FILTER_HDR
#include "u_vector.h"

namespace a {

struct source;

struct filterInstance {
    virtual void filter(float *buffer, size_t samples, bool strero, float sampleRate) = 0;
    virtual ~filterInstance();
};

struct filter {
    virtual void init(source *);
    virtual filterInstance *create() = 0;
    virtual ~filter();
};

struct echoFilter;

struct echoFilterInstance : filterInstance {
    virtual void filter(float *buffer, size_t samples, bool stereo, float sampleRate);
    virtual ~echoFilterInstance();
    echoFilterInstance(echoFilter *parent);

private:
    u::vector<float> m_buffer;
    echoFilter *m_parent;
    size_t m_offset;
};

struct echoFilter : filter {
    virtual void init(source *sourcer_);
    virtual filterInstance *create();
    echoFilter();
    void setParams(float delay, float decay);

private:
    friend struct echoFilterInstance;
    float m_delay;
    float m_decay;
};

}

#endif

#ifndef A_FILTER_HDR
#define A_FILTER_HDR
#include "u_vector.h"

namespace a {

struct source;

struct filterInstance {
    virtual void filter(float *buffer, size_t samples, bool strero, float sampleRate) = 0;
    virtual ~filterInstance();
};

struct filter {
    virtual void init(source *audioSource);
    virtual filterInstance *create() = 0;
    virtual ~filter();
};

struct echoFilter;

struct echoFilterInstance : filterInstance {
    virtual void filter(float *buffer, size_t samples, bool stereo, float sampleRate);
    virtual ~echoFilterInstance();
    echoFilterInstance(echoFilter *parent);

private:
    u::vector<float> m_buffer;
    echoFilter *m_parent;
    size_t m_offset;
};

struct echoFilter : filter {
    virtual void init(source *sourcer_);
    virtual filterInstance *create();
    echoFilter();
    void setParams(float delay, float decay);

private:
    friend struct echoFilterInstance;
    float m_delay;
    float m_decay;
};

}

#endif

Revert "Testing GPG key on github"

Revert "Testing GPG key on github"

This reverts commit 22b0c196d0aa47ffbd016da66e98207b80bcdc82.


// PARAM: --enable ana.int.interval --enable ana.int.def_exc --enable ana.sv-comp.functions --set ana.activated[+] var_eq --set ana.activated[+] region
#include <goblint.h>

int isNan(float arg) {
    float x;
    return arg != arg;
}

int main(){
    struct blub { float f; } s;
    float fs[3];

    float top;
    // float may be NaN here, therefore the comaprison should be unknown
    __goblint_check(top == top); //UNKNOWN!
    __goblint_check(s.f == s.f); //UNKNOWN!
    __goblint_check(fs[1] == fs[1]); //UNKNOWN!

    int r = isNan(top);

    if(r) {
        __goblint_check(1);
    } else {
        __goblint_check(1);
    }
 }

// PARAM: --enable ana.int.interval --enable ana.int.def_exc --enable ana.sv-comp.functions --set ana.activated[+] var_eq --set ana.activated[+] region
#include <goblint.h>

int isNan(float arg) {
    float x;
    return arg != arg;
}

int main(){
    struct blub { float f; } s;
    float fs[3];

    float top;
    // float may be NaN here, therefore the comaprison should be unknown
    __goblint_check(top == top); //UNKNOWN!
    __goblint_check(s.f == s.f); //UNKNOWN!
    __goblint_check(fs[1] == fs[1]); //UNKNOWN!

    int r = isNan(top);

    if(r) {
        __goblint_check(1);
    } else {
        __goblint_check(1);
    }

    float *p = ⊤
    float *q = &fs;
    __goblint_check(*p == *p); //UNKNOWN!
    __goblint_check(q[1] == q[1]); //UNKNOWN!
    return 0;
}

Add test for var_eq unsoundness with dereferenced floats


/* $PostgreSQL: pgsql/src/backend/port/dynloader/win32.c,v 1.4 2004/11/17 08:30:08 neilc Exp $ */

#include <windows.h>

char *dlerror(void);
int dlclose(void *handle);
void *dlsym(void *handle, const char *symbol);
void *dlopen(const char *path, int mode);

char *
dlerror(void)
{
	return "error";
}

int
dlclose(void *handle)
{
	return FreeLibrary((HMODULE) handle) ? 0 : 1;
}

void *
dlsym(void *handle, const char *symbol)
{
	return (void *) GetProcAddress((HMODULE) handle, symbol);
}

void *
dlopen(const char *path, int mode)
{
	return (void *) LoadLibrary(path);
}

/* $PostgreSQL: pgsql/src/backend/port/dynloader/win32.c,v 1.5 2004/12/02 19:38:50 momjian Exp $ */

#include <windows.h>

char *dlerror(void);
int dlclose(void *handle);
void *dlsym(void *handle, const char *symbol);
void *dlopen(const char *path, int mode);

char *
dlerror(void)
{
	return "dynamic load error";
}

int
dlclose(void *handle)
{
	return FreeLibrary((HMODULE) handle) ? 0 : 1;
}

void *
dlsym(void *handle, const char *symbol)
{
	return (void *) GetProcAddress((HMODULE) handle, symbol);
}

void *
dlopen(const char *path, int mode)
{
	return (void *) LoadLibrary(path);
}

Change Win32 dlerror message to:

Change Win32 dlerror message to:

	return "dynamic loading error";


/*
 * Copyright 2012 Facebook
 *
 * 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.
 */

#import <UIKit/UIKit.h>
#import "SCViewController.h"

@interface SCMealViewController : UIViewController

@property (strong, nonatomic) SelectItemCallback selectItemCallback;

@end

/*
 * Copyright 2012 Facebook
 *
 * 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.
 */

#import <UIKit/UIKit.h>
#import "SCViewController.h"

@interface SCMealViewController : UIViewController

@property (copy, nonatomic) SelectItemCallback selectItemCallback;

@end

Fix crash in Scrumptious app.

[ios-sdk] Fix crash in Scrumptious app.

Summary:
Fixed inconsistent crash in Scrumptious. Blocks need to be copied, not retained.
Thanks to jacl for finding this.

Test Plan: - jacl was able to repro on his simulator. Had him try this change, did not repro.

Reviewers: jacl, mmarucheck, gregschechte

Reviewed By: mmarucheck

Differential Revision: https://phabricator.fb.com/D478984

Task ID: 1074314


/*
 * Copyright 2016 Adam Chyła, adam@chyla.org
 * All rights reserved. Distributed under the terms of the MIT License.
 */

#pragma once

namespace apache
{

namespace analyzer
{

namespace detail
{

constexpr int SESSION_LENGTH = 60;

}

}

}

/*
 * Copyright 2016 Adam Chyła, adam@chyla.org
 * All rights reserved. Distributed under the terms of the MIT License.
 */

#pragma once

namespace apache
{

namespace analyzer
{

namespace detail
{

constexpr int SESSION_LENGTH = 3600;

}

}

}

Change session length to 1h

Change session length to 1h


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

int main (int argc, char *argv[]){
    if(argc != 3){
        printf("Number of parameters should be 2 (filename, cardinality).");
        exit(1);
    }

    //open file and get file length
    FILE *file;
    file = fopen(argv[1],"r");
    if(file == NULL){
        printf("File couldn't be opened.");
        exit(1);
    }
    fseek(file, 0, SEEK_END);
    int fileLength = ftell(file);
    fseek(file, 0, SEEK_SET);

    //save data from file to array
    char inputStream[fileLength];
    //printf("length: %d \n", fileLength);
    int i = 0;
    int character;
    while((character = fgetc(file)) != EOF){
            inputStream[i] = character;
            i++;
            }
    /*int j;
    for(j=0; j < fileLength; j++){
        char a = inputStream[j];
        printf("Znak: %c \n", a);
    }*/

    fclose(file);
}

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

int main (int argc, char *argv[]){
    if(argc != 3){
        printf("Number of parameters should be 2 (filename, arity).");
        exit(1);
    }

    int alphabet[128] = {0};
    int arity = atoi(argv[2]);
    int treeLayers = ceil(7/log2(arity));
    printf("Number of layers: %d \n", treeLayers);

    //open file and get file length
    FILE *file;
    file = fopen(argv[1],"r");
    if(file == NULL){
        printf("File couldn't be opened.");
        exit(1);
    }
    fseek(file, 0, SEEK_END);
    int fileLength = ftell(file);
    fseek(file, 0, SEEK_SET);

    //save data from file to array
    char inputStream[fileLength];
    printf("length: %d \n", fileLength);
    int i = 0;
    int character;
    int numOfChar = 0;
    while((character = fgetc(file)) != EOF){
            inputStream[i] = character;
            if(alphabet[character]==0){
                alphabet[character]=1;
                numOfChar++;
            }
            i++;
            }

    char charOfAlphabet[numOfChar];
    int j;
    int k = 0;
    for (j = 0; j < 128; j++){
        if(alphabet[j]==1){
            charOfAlphabet[k] = j;
            k++;
        }
    }
    //for(j=0; j < fileLength; j++){
      //  int a = inputStream[j];
        //printf("Znak: %d \n", a);
    //}

    fclose(file);
}

Define alphabet and number of tree layers


/*
 * $Id$
 */

#include <errno.h>
#include <time.h>

/* from libvarnish/argv.c */
void FreeArgv(char **argv);
char **ParseArgv(const char *s, int comment);

/* from libvarnish/time.c */
void TIM_format(time_t t, char *p);
time_t TIM_parse(const char *p);

/* from libvarnish/version.c */
void varnish_version(const char *);

/* from libvarnish/assert.c */
#ifdef WITHOUT_ASSERTS
#define assert(e)	((void)0)
#else /* WITH_ASSERTS */
#define assert(e)							\
do { 									\
	if (e)								\
		lbv_assert(__func__, __FILE__, __LINE__, #e, errno);	\
} while (0)
#endif

void lbv_assert(const char *, const char *, int, const char *, int);

/* Assert zero return value */
#define AZ(foo)	do { assert((foo) == 0); } while (0)

/*
 * $Id$
 */

#include <errno.h>
#include <time.h>

/* from libvarnish/argv.c */
void FreeArgv(char **argv);
char **ParseArgv(const char *s, int comment);

/* from libvarnish/time.c */
void TIM_format(time_t t, char *p);
time_t TIM_parse(const char *p);

/* from libvarnish/version.c */
void varnish_version(const char *);

/* from libvarnish/assert.c */
#ifdef WITHOUT_ASSERTS
#define assert(e)	((void)0)
#else /* WITH_ASSERTS */
#define assert(e)							\
do { 									\
	if (!(e))							\
		lbv_assert(__func__, __FILE__, __LINE__, #e, errno);	\
} while (0)
#endif

void lbv_assert(const char *, const char *, int, const char *, int);

/* Assert zero return value */
#define AZ(foo)	do { assert((foo) == 0); } while (0)

Make assert do the right thing

Make assert do the right thing

git-svn-id: 2c9807fa3ff65b17195bd55dc8a6c4261e10127b@745 d4fa192b-c00b-0410-8231-f00ffab90ce4


/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 */

#import "TiProxy.h"

@interface TiUIClipboardProxy : TiProxy {
@private
}

#pragma mark internal
-(BOOL)hasData_:(NSString *)mimeType;
-(id)getData_:(NSString *)mimeType;

-(void)clearData:(id)args;
-(void)clearText:(id)args;
-(id)getData:(id)args;
-(NSString *)getText:(id)args;
-(BOOL)hasData:(id)args;
-(BOOL)hasText:(id)args;
-(void)setData:(id)args;
-(void)setText:(id)args;

@end

/**
 * Appcelerator Titanium Mobile
 * Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.
 * Licensed under the terms of the Apache Public License
 * Please see the LICENSE included with this distribution for details.
 */

#import "TiProxy.h"

@interface TiUIClipboardProxy : TiProxy {
@private
}

#pragma mark internal
-(id)getData_:(NSString *)mimeType;

-(void)clearData:(id)args;
-(void)clearText:(id)args;
-(id)getData:(id)args;
-(NSString *)getText:(id)args;
-(BOOL)hasData:(id)args;
-(BOOL)hasText:(id)args;
-(void)setData:(id)args;
-(void)setText:(id)args;

@end

Remove Compile warning from clipboard proxy


//
//  UICollectionViewContactFlowLayout.h
//  MBContactPicker
//
//  Created by Matt Bowman on 12/1/13.
//  Copyright (c) 2013 Citrrus, LLC. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol UICollectionViewDelegateContactFlowLayout <UICollectionViewDelegateFlowLayout>

- (void)collectionView:(UICollectionView*)collectionView willChangeContentSizeFrom:(CGSize)currentSize to:(CGSize)newSize;

@end

@interface UICollectionViewContactFlowLayout : UICollectionViewFlowLayout

@end

//
//  UICollectionViewContactFlowLayout.h
//  MBContactPicker
//
//  Created by Matt Bowman on 12/1/13.
//  Copyright (c) 2013 Citrrus, LLC. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol UICollectionViewContactFlowLayoutDelegate

- (void)collectionView:(UICollectionView*)collectionView willChangeContentSizeFrom:(CGSize)currentSize to:(CGSize)newSize;

@end

@interface UICollectionViewContactFlowLayout : UICollectionViewFlowLayout

@end

Rename ContactFlowLayout’s protocol to match the class name


/* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */

/**********************************************************
*      This software is part of the graphviz package      *
*                http://www.graphviz.org/                 *
*                                                         *
*            Copyright (c) 1994-2004 AT&T Corp.           *
*                and is licensed under the                *
*            Common Public License, Version 1.0           *
*                      by AT&T Corp.                      *
*                                                         *
*        Information and Software Systems Research        *
*              AT&T Research, Florham Park NJ             *
**********************************************************/

#ifdef __cplusplus
extern "C" {
#endif

#ifndef CONVERT_H
#define CONVERT_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifdef USE_CGRAPH
#include <cgraph.h>
#include <cghdr.h>
#else
#include <agraph.h>
#endif
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <string.h>

    extern void gv_to_gxl(Agraph_t *, FILE *);
#ifdef HAVE_LIBEXPAT
    extern Agraph_t *gxl_to_gv(FILE *);
#endif

#endif

#ifdef __cplusplus
}
#endif

/* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */

/**********************************************************
*      This software is part of the graphviz package      *
*                http://www.graphviz.org/                 *
*                                                         *
*            Copyright (c) 1994-2004 AT&T Corp.           *
*                and is licensed under the                *
*            Common Public License, Version 1.0           *
*                      by AT&T Corp.                      *
*                                                         *
*        Information and Software Systems Research        *
*              AT&T Research, Florham Park NJ             *
**********************************************************/

#ifdef __cplusplus
extern "C" {
#endif

#ifndef CONVERT_H
#define CONVERT_H

#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#ifdef USE_CGRAPH
#include <cgraph.h>
#include <cghdr.h>
#else
#include <agraph.h>
#endif
#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <string.h>

    extern void gv_to_gxl(Agraph_t *, FILE *);
#ifdef HAVE_EXPAT
    extern Agraph_t *gxl_to_gv(FILE *);
#endif

#endif

#ifdef __cplusplus
}
#endif

Add --without-expat support to ./configure