Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add minimize and maximize function on Linux | #ifndef APPJS_WINDOW_H
#define APPJS_WINDOW_H
#pragma once
#include "appjs.h"
// GTK+ binding for linux
#if defined(__LINUX__)
#include "linux/mainwindow.h"
// Mac files
#elif defined(__MAC__)
#include "mac/mainwindow.h"
// Windows necessary files
#elif defined(__WIN__)
#include "windows/mainwindow.h"
#endif
... | #ifndef APPJS_WINDOW_H
#define APPJS_WINDOW_H
#pragma once
#include "appjs.h"
// GTK+ binding for linux
#if defined(__LINUX__)
#include "linux/mainwindow.h"
// Mac files
#elif defined(__MAC__)
#include "mac/mainwindow.h"
// Windows necessary files
#elif defined(__WIN__)
#include "windows/mainwindow.h"
#endif
... |
Enforce actor addition through Engine | /**
* An efficient c++ simulation demo
*
* @author Skylar Kelty <skylarkelty@gmail.com>
*/
#pragma once
#include "src/common.h"
/**
* A linked list
*/
template <typename T>
class LinkedList {
private:
LLNode<T> *head;
LLNode<T> *tail;
public:
LinkedList();
~LinkedList();
void append(LLNode<T> *node);
... | /**
* An efficient c++ simulation demo
*
* @author Skylar Kelty <skylarkelty@gmail.com>
*/
#pragma once
#include "src/common.h"
/**
* A linked list
*/
template <typename T>
class LinkedList {
friend class Engine;
private:
LLNode<T> *head;
LLNode<T> *tail;
protected:
void append(LLNode<T> *node);
public:
... |
Define PIT interrupt more correctly if using the IOAPIC | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#ifndef _PLATSUPPORT_PIT_H
#define _PLATSUPPORT_PIT_H
#include <platsupport/timer.h>... | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#ifndef _PLATSUPPORT_PIT_H
#define _PLATSUPPORT_PIT_H
#include <autoconf.h>
#include... |
Fix types in this test case | #include <stdlib.h>
int y;
int *g = &y;
int* arr[100];
void f(int *p) {
g = p;
}
int main() {
y = rand();
/* y = 1; */
/* y *= 10; */
f(&arr[y]);
y = y / 4;
return 0;
}
| #include <stdlib.h>
int y;
int *g = &y;
int arr[100];
void f(int *p) {
g = p;
}
int main() {
y = rand();
/* y = 1; */
/* y *= 10; */
f(&arr[y]);
y = y / 4;
return 0;
}
|
Include a header we use. | /** @file
@brief Header declaring device callback types
Must be c-safe!
@date 2014
@author
Ryan Pavlik
<ryan@sensics.com>
<http://sensics.com>
*/
/*
// Copyright 2014 Sensics, Inc.
//
// All rights reserved.
//
// (Final version intended to be licensed under
// the Apache License, Versio... | /** @file
@brief Header declaring device callback types
Must be c-safe!
@date 2014
@author
Ryan Pavlik
<ryan@sensics.com>
<http://sensics.com>
*/
/*
// Copyright 2014 Sensics, Inc.
//
// All rights reserved.
//
// (Final version intended to be licensed under
// the Apache License, Versio... |
Add comment to NSData's MD5 category method | //
// NSData+YZLibrary.h
// YZLibrary
//
// Copyright (c) 2016 Yichi Zhang
// https://github.com/yichizhang
// zhang-yi-chi@hotmail.com
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the So... | //
// NSData+YZLibrary.h
// YZLibrary
//
// Copyright (c) 2016 Yichi Zhang
// https://github.com/yichizhang
// zhang-yi-chi@hotmail.com
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the So... |
Update the documentation - no more Boost | /******************************************************************************
This source file is part of the Avogadro project.
Copyright 2013 Kitware, Inc.
This source code is released under the New BSD License, (the "License").
Unless required by applicable law or agreed to in writing, software
distri... | /******************************************************************************
This source file is part of the Avogadro project.
Copyright 2013 Kitware, Inc.
This source code is released under the New BSD License, (the "License").
Unless required by applicable law or agreed to in writing, software
distri... |
Add sort of numerical sequence by bit array | #include <stdio.h>
int main()
{
unsigned int bit_array = 0;
unsigned int a = 1;
unsigned int result;
FILE *fr;
FILE *fw;
char row[10];
fr = fopen("out/testdata", "r");
if (!fr) {
puts("read error");
exit(1);
}
while(fgets(row, sizeof(row), fr) != NULL) {
int x = atoi(row);
bit_ar... | |
Switch from std::shared_mutex to libuv's uv_rwlock | #ifndef HunspellContext_H
#define HunspellContext_H
#include <hunspell.hxx>
#include <napi.h>
#include <mutex>
#include <shared_mutex>
class HunspellContext {
public:
Hunspell* instance;
HunspellContext(Hunspell* instance): instance(instance) {};
~HunspellContext() {
if (instance) {
delete ins... | #ifndef HunspellContext_H
#define HunspellContext_H
#include <hunspell.hxx>
#include <napi.h>
#include <mutex>
#include <shared_mutex>
#include <uv.h>
class HunspellContext {
public:
Hunspell* instance;
HunspellContext(Hunspell* instance): instance(instance) {
uv_rwlock_init(&rwLock);
};
~HunspellCont... |
Store haBuffer shared_ptr in Node. | #ifndef SRC_NODE_H_
#define SRC_NODE_H_
#include <boost/serialization/serialization.hpp>
#include <boost/serialization/access.hpp>
#include <boost/serialization/nvp.hpp>
#include <memory>
#include "./graphics/render_data.h"
#include "./math/obb.h"
#include "./graphics/gl.h"
/**
* \brief Base class for nodes which ... | #ifndef SRC_NODE_H_
#define SRC_NODE_H_
#include <boost/serialization/serialization.hpp>
#include <boost/serialization/access.hpp>
#include <boost/serialization/nvp.hpp>
#include <memory>
#include "./graphics/render_data.h"
#include "./math/obb.h"
#include "./graphics/gl.h"
#include "./graphics/ha_buffer.h"
/**
* \... |
CREATE was broken if namespace prefixes were set. Patch by Andreas Fuchs. | /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "commands.h"
int cmd_create(struct client *client)
{
struct mail_storage *storage;
const char *mailbox;
int directory;
size_t len;
/* <mailbox> */
if (!client_read_string_args(client, 1, &mailbox))
return FALSE;
storage = client_find_stora... | /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "commands.h"
int cmd_create(struct client *client)
{
struct mail_storage *storage;
const char *mailbox, *full_mailbox;
int directory;
size_t len;
/* <mailbox> */
if (!client_read_string_args(client, 1, &mailbox))
return FALSE;
full_mailbox ... |
Fix CMAKE_CXX_STANDARD 17 build on Windows | /* guiddatabase.h
Copyright (c) 2017, LongSoft. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-licens... | /* guiddatabase.h
Copyright (c) 2017, LongSoft. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-licens... |
Remove MATHD and SORTD macros | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2018 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 Foundati... | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2018 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 Foundati... |
Make gcc4 happy as well | /* vi: set sw=4 ts=4: */
/*
* getgid() for uClibc
*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
#if defined __NR_getxgid
# define __NR_getgid __NR_getxgid
#endif
_syscall0(g... | /* vi: set sw=4 ts=4: */
/*
* getgid() for uClibc
*
* Copyright (C) 2000-2006 Erik Andersen <andersen@uclibc.org>
*
* Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
#include "syscalls.h"
#include <unistd.h>
#if defined __NR_getxgid
# define __NR_getgid __NR_getxgid
#endif
libc_hidden... |
Use std::function instead of boost::function | #ifndef PICTUS_ACTIONMAP_H
#define PICTUS_ACTIONMAP_H
#include <boost/function.hpp>
#include <map>
namespace App {
template <typename _key, typename _param>
class ActionMapParam {
public:
typedef boost::function<void(_param)> Function_Type;
void AddAction(_key id, Function_Type f) {
m_map[id] = f;
}
bo... | #ifndef PICTUS_ACTIONMAP_H
#define PICTUS_ACTIONMAP_H
#include <functional>
#include <map>
namespace App {
template <typename _key, typename _param>
class ActionMapParam {
public:
typedef typename std::function<void(_param)> Function_Type;
void AddAction(_key id, Function_Type f) {
m_map[id] = f;
}
boo... |
Use override keyword on methods in DummyInvocationLog | #pragma once
#include "invocation_log.h"
namespace shk {
class DummyInvocationLog : public InvocationLog {
public:
void createdDirectory(const std::string &path) throw(IoError) {}
void removedDirectory(const std::string &path) throw(IoError) {}
void ranCommand(
const Hash &build_step_hash,
std::... | #pragma once
#include "invocation_log.h"
namespace shk {
class DummyInvocationLog : public InvocationLog {
public:
void createdDirectory(const std::string &path)
throw(IoError) override {}
void removedDirectory(const std::string &path)
throw(IoError) override {}
void ranCommand(
const Hash... |
Fix typos.. The vector for "int 0x12" (get base mem) is not written in hex as "0x1a". :-) Fix a comment about the extended memory checks, that's int 0x15. | /*
* mjs copyright
*/
/*
* Obtain memory configuration information from the BIOS
*
* Note that we don't try too hard here; knowing the size of
* base memory and extended memory out to 16 or 64M is enough for
* the requirements of the bootstrap.
*
* We also maintain a pointer to the top of physical memory
* o... | /*
* mjs copyright
*/
/*
* Obtain memory configuration information from the BIOS
*
* Note that we don't try too hard here; knowing the size of
* base memory and extended memory out to 16 or 64M is enough for
* the requirements of the bootstrap.
*
* We also maintain a pointer to the top of physical memory
* o... |
Add git r done version of detail::raw_pointer_cast | /*
* Copyright 2008-2009 NVIDIA Corporation
*
* 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... | |
Add dummy "syscall()" routine for AIX so we can at least test compiling and linking. | /*******************************************************************
**
** Manage system call mode and do remote system calls.
**
*******************************************************************/
#define _POSIX_SOURCE
#include <stdio.h>
#include "condor_syscalls.h"
static int SyscallMode;
int
SetSyscalls( int mo... | /*******************************************************************
**
** Manage system call mode and do remote system calls.
**
*******************************************************************/
#define _POSIX_SOURCE
#include <stdio.h>
#include "condor_syscalls.h"
static int SyscallMode;
int
SetSyscalls( int mo... |
Add success / error message | #include <stdio.h>
#include <CUnit/CUnit.h>
#include <CUnit/Basic.h>
#include "hashtable/hashtable.h"
#include "dll/dll.h"
int main(int argc, char *argv[]) {
CU_initialize_registry();
test_hashtable_init();
test_dll_init();
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
unsigned i... | #include <stdio.h>
#include <CUnit/CUnit.h>
#include <CUnit/Basic.h>
#include "hashtable/hashtable.h"
#include "dll/dll.h"
int main(int argc, char *argv[]) {
CU_initialize_registry();
test_hashtable_init();
test_dll_init();
CU_basic_set_mode(CU_BRM_VERBOSE);
CU_basic_run_tests();
unsigned i... |
Add Thread support on Win32 API | #ifndef ELOG_THREAD_WIN32_H_
#define ELOG_THREAD_WIN32_H_
#include <functional>
#include <process.h>
#include <windows.h>
#include "util.h"
namespace LOG {
class ScopedThreadHandle : NonCopyable {
public:
explicit ScopedThreadHandle(HANDLE handle = NULL)
: handle_(handle) {
}
~ScopedThreadHandle() {
... | |
Fix OOB indexing, buffer check, realloc size | #include <stdio.h>
#include <stdlib.h>
char* Input(char *buffer){
unsigned int size = 10;
unsigned int len = 0;
int ch;
buffer = malloc(sizeof(char)*size);
if(!buffer){
printf("Error allocating memory");
return buffer;
}
while((ch = fgetc(stdin)) != EOF && ch != '\n'){
... | |
Add RValueWrapper, a wrapper for passing rvalue through std::bind and allow binding to function with rvalue reference parameters. | /**
* rvalue_wrapper.h
*/
#ifndef UTIL_RVALUE_WRAPPER_H_
#define UTIL_RVALUE_WRAPPER_H_
/**
* A wrapper for holding and passing rvalues through std::bind. The rvalue wrapped will be stored
* inside the wrapper until the functor returned by std::bind is invoked, at when the stored rvalue
* will be moved from. The ... | |
Split int from float instantiations | /*ckwg +5
* Copyright 2011-2012 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.
*/
#include <boost/cstdint.hpp>
#define VISTK_IMAGE_INSTANTIATE(cls) \
template class cl... | /*ckwg +5
* Copyright 2011-2012 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_IMAGE_INSTANTIATE_H
#define VISTK_IMAGE_INSTANTIATE_H
#include <boost/cst... |
Clarify the need for calling tensorflow::port::InitMain() before using the rest of TensorFlow. | /* Copyright 2015 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 a... | /* Copyright 2015 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 a... |
Fix crash when hardware acceleration is disabled. | /*
Copyright © 2018-2019 Atlas Engineer LLC.
Use of this file is governed by the license that can be found in LICENSE.
*/
#include <gtk/gtk.h>
#include <stdlib.h>
#include "server.h"
static void on_name_acquired(GDBusConnection *connection,
const gchar *name,
gpointer user_data) {
g_message("Starting platform port... | /*
Copyright © 2018-2019 Atlas Engineer LLC.
Use of this file is governed by the license that can be found in LICENSE.
*/
#include <gtk/gtk.h>
#include <stdlib.h>
#include "server.h"
static void on_name_acquired(GDBusConnection *connection,
const gchar *name,
gpointer user_data) {
g_message("Starting platform port... |
Fix the gc_instrumentation test on toolchain bots. | /*
* Copyright 2010 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can
* be found in the LICENSE file.
*/
/*
* gc_noinst.c : Functions that shouldn't be instrumented by the compiler
*/
__thread unsigned int thread_suspend_if_needed_count = 0;
... | /*
* Copyright (c) 2011 The Native Client Authors. All rights reserved.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
/*
* gc_noinst.c : Functions that shouldn't be instrumented by the compiler
*/
__thread unsigned int thread_suspend_if_needed_count = 0... |
Delete second argument to FB_LINK_REQUIRE_ | /*
* Copyright (c) 2004-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#ifndef FB_SK_MACROS_H
#define FB_SK_MACROS_H
#define FB_LINK_REQUIRE_(NAME, UNIQUE)
#define FB_LINKABLE(NAME)
... | /*
* Copyright (c) 2004-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
#ifndef FB_SK_MACROS_H
#define FB_SK_MACROS_H
#define FB_LINK_REQUIRE_(NAME)
#define FB_LINKABLE(NAME)
#define FB_LINK_... |
Add a tool similar to hexdump, but for text files. | /* strdump.c -- similar to hexdump but with ascii strings */
#include <stdio.h>
#include <string.h>
int
strdump(FILE *fo, FILE *fi)
{
int c, n;
n = 0;
fputs("\"", fo);
c = fgetc(fi);
while (c != -1)
{
if (c == '\n' || c == '\r')
fputs("\\n\"\n\"", fo);
else
putc(c, fo);
c = fgetc... | |
Move fibers out of experimental | /*
* Copyright (c) 2016, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma onc... | /*
* Copyright (c) 2016, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
#pragma onc... |
Fix 'redundant redeclaration' warning due to missing include guard | /* JSON_checker.h */
#ifdef JSON_checker_EXPORTS
#if defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
#define JSON_CHECKER_PUBLIC_API __global
#elif defined __GNUC__
#define JSON_CHECKER_PUBLIC_API __attribute__ ((visibility("default")))
#elif defined(_MSC_VER)
#define JSON_CHECKER_PUBLIC_API __declspec(dllexport)
#else... | /* JSON_checker.h */
#pragma once
#ifdef JSON_checker_EXPORTS
#if defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
#define JSON_CHECKER_PUBLIC_API __global
#elif defined __GNUC__
#define JSON_CHECKER_PUBLIC_API __attribute__ ((visibility("default")))
#elif defined(_MSC_VER)
#define JSON_CHECKER_PUBLIC_API __declspec(dl... |
Fix warning for a missing nonnull | //
// HauteStreamsController.h
// Hauth
//
// Created by Rizwan Sattar on 11/7/15.
// Copyright © 2015 Rizwan Sattar. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface HauthStreamsController : NSObject
@property (strong, nonatomic, nullable) NSInputStream *inputStream;
@property (strong, nonat... | //
// HauteStreamsController.h
// Hauth
//
// Created by Rizwan Sattar on 11/7/15.
// Copyright © 2015 Rizwan Sattar. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface HauthStreamsController : NSObject
@property (strong, nonatomic, nullable) NSInputStream *inputStream;
@property (strong, nonat... |
Add {c|r}{begin|end} since gcc doesnt know it. | #pragma once
namespace std {
template <typename T> auto cbegin(const T &c) { return c.cbegin(); }
template <typename T> auto crbegin(const T &c) { return c.crbegin(); }
template <typename T> auto cend(const T &c) { return c.crbegin(); }
template <typename T> auto crend(const T &c) { return c.crbegin(); }
}
| |
Put destructor to private according to chromium style | // 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 BASE_MESSAGE_PUMP_UV_H_
#define BASE_MESSAGE_PUMP_UV_H_
#pragma once
#include "base/message_pump.h"
#include "base/time.h"
#include "base/bas... | // 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 BASE_MESSAGE_PUMP_UV_H_
#define BASE_MESSAGE_PUMP_UV_H_
#pragma once
#include "base/message_pump.h"
#include "base/time.h"
#include "base/bas... |
Change scan to login guide url | //
// APIConstant.h
// PHPHub
//
// Created by Aufree on 9/30/15.
// Copyright (c) 2015 ESTGroup. All rights reserved.
//
#define APIAccessTokenURL [NSString stringWithFormat:@"%@%@", APIBaseURL, @"/oauth/access_token"]
#define QiniuUploadTokenIdentifier @"QiniuUploadTokenIdentifier"
#if DEBUG
#define APIBaseURL ... | //
// APIConstant.h
// PHPHub
//
// Created by Aufree on 9/30/15.
// Copyright (c) 2015 ESTGroup. All rights reserved.
//
#define APIAccessTokenURL [NSString stringWithFormat:@"%@%@", APIBaseURL, @"/oauth/access_token"]
#define QiniuUploadTokenIdentifier @"QiniuUploadTokenIdentifier"
#if DEBUG
#define APIBaseURL ... |
Disable copy on Mutex objects | /**
* Mutex management astraction layer
*/
#ifndef EPYX_MUTEX_H
#define EPYX_MUTEX_H
#include <pthread.h>
#include "exception.h"
namespace Epyx
{
class Mutex
{
private:
pthread_mutex_t mutex;
public:
inline Mutex ()
{
int status = pthread_mutex_init (&(this->mute... | /**
* Mutex management astraction layer
*/
#ifndef EPYX_MUTEX_H
#define EPYX_MUTEX_H
#include <pthread.h>
#include "exception.h"
namespace Epyx
{
class Mutex
{
private:
pthread_mutex_t mutex;
// Disable copy construction and assignment.
Mutex (const Mutex&);
const Mutex ... |
Improve new file in future | #define GET_CLASS_INFO_EXTENDS(extends, ...) \
extends
#define GET_CLASS_INFO_IMPLEMENTS(x, y, implements...) \
implements
#define GET_CLASS_INFO_NB_IMPLEMENTS(x, nb, ...) \
nb
#define GET_CLASS_INFO(what, extends, nbInter, interfaces...) \
GET_CLASS_INFO_ ## what(extends, nbInter, ... | #define GET_CLASS_INFO_EXTENDS(extends, ...) \
extends
#define GET_CLASS_INFO_IMPLEMENTS(x, y, implements...) \
implements
#define GET_CLASS_INFO_NB_IMPLEMENTS(x, nb, ...) \
nb
#define CLASS_INFO_String(what) \
GET_CLASS_INFO_ ## what(Object, 2, toString, Serializable)
#d... |
Migrate ::StringPiece to absl::string_view. PiperOrigin-RevId: 222828687 | /* Copyright 2015 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 a... | /* Copyright 2015 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 a... |
Remove errant comment from copypasta | #pragma once
#include "drake/drakeOptimization_export.h"
#include "drake/solvers/MathematicalProgram.h"
namespace drake {
namespace solvers {
class DRAKEOPTIMIZATION_EXPORT LinearSystemSolver :
public MathematicalProgramSolverInterface {
public:
// This solver is implemented in various pieces depending on... | #pragma once
#include "drake/drakeOptimization_export.h"
#include "drake/solvers/MathematicalProgram.h"
namespace drake {
namespace solvers {
class DRAKEOPTIMIZATION_EXPORT LinearSystemSolver :
public MathematicalProgramSolverInterface {
public:
bool available() const override;
SolutionResult Solve(Opti... |
Add basic binary search implementation | /*
* Copyright (c) 2014-2015, NVIDIA CORPORATION
* Copyright (c) 2015, Nuno Subtil <subtil@gmail.com>
* Copyright (c) 2015, Roche Molecular Systems Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditio... | |
Update driver version to 5.02.00-k16 | /*
* 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-k15"
| /*
* 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-k16"
|
Update driver version to 5.03.00-k0 | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k20"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.03.00-k0"
|
Add minimal pfscan regression test due to combine problem | #include <pthread.h>
struct __anonstruct_PQUEUE_63 {
int closed ;
pthread_mutex_t mtx ;
};
typedef struct __anonstruct_PQUEUE_63 PQUEUE;
PQUEUE pqb;
int pqueue_init(PQUEUE *qp)
{
qp->closed = 0;
pthread_mutex_init(& qp->mtx, NULL);
return (0);
}
void pqueue_close(PQUEUE *qp )
{
pthread_mutex_lock(& qp... | |
Move a call to exitChplThreads() to after the final barrier | #include <stdio.h>
#include <stdlib.h>
#include "chplcomm.h"
#include "chplexit.h"
#include "chplmem.h"
#include "chplrt.h"
#include "gdb.h"
#undef exit
static void _chpl_exit_common(int status, int all) {
fflush(stdout);
fflush(stderr);
if (status != 0) {
gdbShouldBreakHere();
}
if (all) {
exitChpl... | #include <stdio.h>
#include <stdlib.h>
#include "chplcomm.h"
#include "chplexit.h"
#include "chplmem.h"
#include "chplrt.h"
#include "gdb.h"
#undef exit
static void _chpl_exit_common(int status, int all) {
fflush(stdout);
fflush(stderr);
if (status != 0) {
gdbShouldBreakHere();
}
if (all) {
_chpl_co... |
Remove no longer used SkipEncodingUnusedStreams. | /*
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... | /*
* Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contribut... |
Check for GCC before checking version | #ifndef PSTDALIGN_H
#define PSTDALIGN_H
#ifndef __alignas_is_defined
#ifndef __cplusplus
#if ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)) || defined(__IBMC__)
#undef PORTABLE_C11_STDALIGN_MISSING
#define PORTABLE_C11_STDALIGN_MISSING
#endif
#if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__)... | #ifndef PSTDALIGN_H
#define PSTDALIGN_H
#ifndef __alignas_is_defined
#ifndef __cplusplus
#if ((defined(__GNUC__) && ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 7))) || defined(__IBMC__))
#undef PORTABLE_C11_STDALIGN_MISSING
#define PORTABLE_C11_STDALIGN_MISSING
#endif
#if (defined(__STDC__) && __STDC__ && ... |
Fix multiple def errors for strcasecmp && strncasecmp. | #include_next <string.h>
#ifndef LIBCRYPTOCOMPAT_STRING_H
#define LIBCRYPTOCOMPAT_STRING_H
#include <sys/types.h>
#ifdef __sun
/* Some functions historically defined in string.h were placed in strings.h by
* SUS. Use the same hack as OS X and FreeBSD use to work around on Solaris.
*/
#include <strings.h>
#endif
s... | #include_next <string.h>
#ifndef LIBCRYPTOCOMPAT_STRING_H
#define LIBCRYPTOCOMPAT_STRING_H
#include <sys/types.h>
#ifdef __sun
/* Some functions historically defined in string.h were placed in strings.h by
* SUS. Use the same hack as OS X and FreeBSD use to work around on Solaris.
*/
#include <strings.h>
#endif
s... |
Add a comment that "changed" is unused. | /*************************************************************************/
/* Copyright (c) 2004 */
/* Daniel Sleator, David Temperley, and John Lafferty */
/* Copyright (c) 2014 Linas Vepstas */
/* All rights re... | /*************************************************************************/
/* Copyright (c) 2004 */
/* Daniel Sleator, David Temperley, and John Lafferty */
/* Copyright (c) 2014 Linas Vepstas */
/* All rights re... |
Add CommandLine for easier command line parsing | /*
Copyright (c) 2013 Daniele Bartolini, Michele Rossi
Copyright (c) 2012 Daniele Bartolini, Simone Boscaratto
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including withou... | |
Remove a duplicate definition of __pmServerPresence | /*
* Copyright (c) 2013 Red Hat.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distrib... | /*
* Copyright (c) 2013 Red Hat.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distrib... |
Add C implementation of insertion sort. | #include <stdio.h>
#include <stdlib.h>
const int N = 1e4;
void
isort(int *ns, int n)
{
int i, j, key;
for(i = 1; i < n; i++) {
key = ns[i];
for(j = i-1; j >= 0 && key < ns[j]; j--)
ns[j+1] = ns[j];
ns[j+1] = key;
}
}
int
main(void)
{
int i;
int *ns = malloc(si... | |
Add a bunch of tests | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <saneopt.h>
void test_no_arg() {
char** argv;
saneopt_t* opt = saneopt_init(0, argv);
assert(saneopt_get(opt, "no-option") == NULL);
free(opt);
}
void test_no_value() {
char** argv = malloc(1 * sizeof(char*));
argv... | |
Add memory size info example | #include <stdio.h>
#include <sys/sysinfo.h>
#include <stdint.h>
uint64_t get_memory_size()
{
struct sysinfo info;
sysinfo( &info );
printf("total ram %lu, mem units %lu\n", (size_t)info.totalram, (size_t)info.mem_unit);
return (size_t)info.totalram * (size_t)info.mem_unit;
}
int main(int argc, char* argv[])
{
ui... | |
Add header which imports all files | //
// IGIdenticon.h
// IGIdenticon
//
// Created by Evgeniy Yurtaev on 29/07/15.
// Copyright (c) 2015 Evgeniy Yurtaev. All rights reserved.
//
#import "IGImageGenerator.h"
#import "IGSimpleIdenticon.h"
#import "IGGitHubIdenticon.h"
#import "IGHashFunctions.h"
| |
Add 3 new classes about User Defined Functions | /* include files for the package output */
#include "CDatum.h"
#include "COutput.h"
#include "COutputLine.h"
#include "COutputList.h"
#include "COutputEvent.h"
| /* include files for the package output */
#include "CDatum.h"
#include "COutput.h"
#include "COutputLine.h"
#include "COutputList.h"
#include "COutputEvent.h"
#include "CNodeO.h"
#include "CUDFunction.h"
#include "CUDFunctionDB.h" |
Fix thread initialisation race (thread sanitizer) | //
// log_thread.h
//
#ifndef log_thread_h
#define log_thread_h
#include "queue_atomic.h"
struct log_thread;
typedef std::shared_ptr<log_thread> log_thread_ptr;
#define LOG_BUFFER_SIZE 1024
struct log_thread : std::thread
{
static const bool debug;
static const int flush_inter... | //
// log_thread.h
//
#ifndef log_thread_h
#define log_thread_h
#include "queue_atomic.h"
struct log_thread;
typedef std::shared_ptr<log_thread> log_thread_ptr;
#define LOG_BUFFER_SIZE 1024
struct log_thread : std::thread
{
static const bool debug;
static const int flush_inter... |
Move the lhlo dialect into its own directory. | // Copyright 2020 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// This files defines a helper to trigger the registration of dialects to
// the system.
#ifndef... | // Copyright 2020 The IREE Authors
//
// Licensed under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// This files defines a helper to trigger the registration of dialects to
// the system.
#ifndef... |
Fix backslash warning from missing blank line at end of file | #include <iostream>
#include <vector>
#include <string>
#include "erosion.h"
#include "dilation.h"
#include "opening.h"
#include "closing.h"
#include "gradient.h"
/** run: A macro to call a function. */
#define run( function, ctype, dim ) \
if ( operation == #function ) \
{ \
if ( componentType == #ctype && Dimens... | #include <iostream>
#include <vector>
#include <string>
#include "erosion.h"
#include "dilation.h"
#include "opening.h"
#include "closing.h"
#include "gradient.h"
/** run: A macro to call a function. */
#define run( function, ctype, dim ) \
if ( operation == #function ) \
{ \
if ( componentType == #ctype && Dimens... |
Remove one more reference to __interception::GetRealFunctionAddress (follow-up to r215707) | //===-- interception_linux.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===-- interception_linux.h ------------------------------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Fix Py_Logger to raise instances of Exception instead of strings | #ifndef PYLOGGER_H
#define PYLOGGER_H
#include "Python.h"
#include <string>
#include "cantera/base/logger.h"
namespace Cantera
{
/// Logger for Python.
/// @ingroup textlogs
class Py_Logger : public Logger
{
public:
Py_Logger() {
PyRun_SimpleString("import sys");
}
virtual ~Py_Logger() {}
vi... | #ifndef PYLOGGER_H
#define PYLOGGER_H
#include "Python.h"
#include <string>
#include "cantera/base/logger.h"
namespace Cantera
{
/// Logger for Python.
/// @ingroup textlogs
class Py_Logger : public Logger
{
public:
Py_Logger() {
PyRun_SimpleString("import sys");
}
virtual ~Py_Logger() {}
vi... |
Disable compiled format for GCC 8 & below | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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 applic... | /*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* 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 applic... |
Remove casting away of volatile and explicit call to seL4_Yield. | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#include <camkes.h>
#include <stdio.h>
#include <string.h>
#include <sel4/sel4.h>
i... | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#include <camkes.h>
#include <stdio.h>
#include <string.h>
int run(void) {
char... |
Fix bug spotted by Justin Hibbits. | #include "visibility.h"
#include "objc/runtime.h"
#include "gc_ops.h"
#include "class.h"
#include <stdlib.h>
#include <stdio.h>
static id allocate_class(Class cls, size_t extraBytes)
{
intptr_t *addr = calloc(cls->instance_size + extraBytes + sizeof(intptr_t), 1);
return (id)(addr + 1);
}
static void free_object(id... | #include "visibility.h"
#include "objc/runtime.h"
#include "gc_ops.h"
#include "class.h"
#include <stdlib.h>
#include <stdio.h>
static id allocate_class(Class cls, size_t extraBytes)
{
intptr_t *addr = calloc(cls->instance_size + extraBytes + sizeof(intptr_t), 1);
return (id)(addr + 1);
}
static void free_object(id... |
Add newline to end of header | /*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | /*
*
* Copyright 2018 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
Add Function to get avaliable Effect name | #ifndef __SPU_H__
#define __SPU_H__
typedef enum {
NONE,
VOLUME,
COMPRESSOR,
DISTORTION,
OVERDRIVE,
DELAY,
REVERB,
FLANGER,
EQULIZER,
BACK,
EFFECT_TYPE_NUM
} EffectType_t;
void SignalProcessingUnit(void const * argument);
void attachNewEffect(uint32_t stage, EffectType_t e... | #ifndef __SPU_H__
#define __SPU_H__
typedef enum {
NONE,
VOLUME,
COMPRESSOR,
DISTORTION,
OVERDRIVE,
DELAY,
REVERB,
FLANGER,
EQULIZER,
EFFECT_TYPE_NUM
} EffectType_t;
void SignalProcessingUnit(void const * argument);
void attachEffect(uint32_t stage, EffectType_t effectType);
c... |
Fix test key initialization to be endian-neutral | #include "siphash.h"
#include <stdio.h>
int main(void)
{
uint64_t k0 = 0x0706050403020100ull;
uint64_t k1 = 0x0f0e0d0c0b0a0908ull;
uint8_t msg[] = {0x00, 0x01, 0x02, 0x03, 0x04,
0x05, 0x06, 0x07, 0x08, 0x09,
0x0a, 0x0b, 0x0c, 0x0d, 0x0e};
... | #include "siphash.h"
#include <stdio.h>
int main(void)
{
uint8_t key[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f};
uint64_t k0 = *(uint64_t*)(key + 0);
uint64_t k1 = *(uint64_t*)(key + 8);
uint8_t msg[] = {0x00, 0x01, 0x02, ... |
Clarify row and column iterators | #ifndef LB_MATRIX_INCLUDED
typedef struct {
double* data;
unsigned int num_rows;
unsigned int num_cols;
} Matrix;
Matrix lb_create_matrix(double* data, unsigned int num_rows, unsigned int num_cols);
Matrix lb_allocate_matrix(unsigned int num_rows, unsigned int num_cols);
#define lb_mat_element_ptr(A,i,j) (... | #ifndef LB_MATRIX_INCLUDED
typedef struct {
double* data;
unsigned int num_rows;
unsigned int num_cols;
} Matrix;
Matrix lb_create_matrix(double* data, unsigned int num_rows, unsigned int num_cols);
Matrix lb_allocate_matrix(unsigned int num_rows, unsigned int num_cols);
#define lb_mat_element_ptr(A,i,j) (... |
Fix overflow bug introduced in f6b3328f | #include <ctype.h>
#include <stdio.h>
#include "debug.h"
#ifndef NDEBUG
const char * const col[] = {MAG, RED, YEL, CYN, BLU, GRN};
regex_t _comp;
// Initialize the regular expression used for restricting debug output
static void __attribute__((constructor)) premain()
{
if (regcomp(&_comp, DCOMPONENT, REG_EXTE... | #include <ctype.h>
#include <stdio.h>
#include "debug.h"
#ifndef NDEBUG
const char * const col[] = {MAG, RED, YEL, CYN, BLU, GRN};
regex_t _comp;
// Initialize the regular expression used for restricting debug output
static void __attribute__((constructor)) premain()
{
if (regcomp(&_comp, DCOMPONENT, REG_EXTE... |
Make this darwin only for now while investigating to clear up x86_64 Release+Asserts linux tests. | // RUN: %clang_cc1 -emit-llvm %s -o /dev/null
struct foo { int X; };
struct bar { int Y; };
extern int Func(struct foo*) __asm__("Func64");
extern int Func64(struct bar*);
int Func(struct foo *F) {
return 1;
}
int Func64(struct bar* B) {
return 0;
}
int test() {
Func(0); /* should be renamed to call Fu... | // RUN: %clang_cc1 -emit-llvm %s -triple x86_64-apple-darwin -o /dev/null
struct foo { int X; };
struct bar { int Y; };
extern int Func(struct foo*) __asm__("Func64");
extern int Func64(struct bar*);
int Func(struct foo *F) {
return 1;
}
int Func64(struct bar* B) {
return 0;
}
int test() {
Func(0); /* s... |
Test from PR2332; bug already fixed by r51311. | // RUN: clang -fsyntax-only %s -verify
x(a) int a; {return a;}
y(b) int b; {return a;} // expected-error {{use of undeclared identifier}}
| // RUN: clang -fsyntax-only %s -verify
x(a) int a; {return a;}
y(b) int b; {return a;} // expected-error {{use of undeclared identifier}}
// PR2332
a(a)int a;{a=10;return a;}
|
Disable another warning in GLFW. | #pragma once
#define GLFW_INCLUDE_GLU
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
#endif
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpadded"
# include <GLFW/glfw3.h>
#pragma GCC diagnostic pop
#if __clang__
#pragma clang diagnostic pop
#endif
| #pragma once
#define GLFW_INCLUDE_GLU
#if __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdocumentation"
#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
#endif
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wpadded"
# include <GLFW/glfw3.h>
#pragma GCC d... |
Define alias type, forward declaration | #ifndef MAP_H
#define MAP_H
#include <vector>
#include <map>
#include "DelaunayTriangulation.h"
#include "Structure.h"
#include "QuadTree.h"
#endif | #ifndef MAP_H
#define MAP_H
#include <vector>
#include <map>
#include "DelaunayTriangulation.h"
#include "Structure.h"
#include "QuadTree.h"
using pCenterQT = QuadTree<Center*>;
// Forward Declaration
class Vector2;
namespace Noise
{
namespace Module
{
class Perlin;
}
}
#endif |
Add missing backticks and period in media attachment header comment. | //
// LYRUIMediaAttachment.h
// LayerSample
//
// Created by Kevin Coleman on 9/12/14.
// Copyright (c) 2014 Layer, Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
@abstract The `LYRUIMediaAttachment` class configures the appropriate size
for an NSTextAttachment to comfortably fit inside of a LYRUIMess... | //
// LYRUIMediaAttachment.h
// LayerSample
//
// Created by Kevin Coleman on 9/12/14.
// Copyright (c) 2014 Layer, Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
@abstract The `LYRUIMediaAttachment` class configures the appropriate size
for an NSTextAttachment to comfortably fit inside of a `LYRUIMes... |
Update header documentation for BTAPIClient-Internal | #import "BTAnalyticsService.h"
#import "BTAPIClient.h"
#import "BTClientMetadata.h"
#import "BTClientToken.h"
#import "BTHTTP.h"
#import "BTJSON.h"
NS_ASSUME_NONNULL_BEGIN
@class BTPaymentMethodNonce;
@interface BTAPIClient ()
@property (nonatomic, copy, nullable) NSString *tokenizationKey;
@property (nonatomic, st... | #import "BTAnalyticsService.h"
#import "BTAPIClient.h"
#import "BTClientMetadata.h"
#import "BTClientToken.h"
#import "BTHTTP.h"
#import "BTJSON.h"
NS_ASSUME_NONNULL_BEGIN
@class BTPaymentMethodNonce;
@interface BTAPIClient ()
@property (nonatomic, copy, nullable) NSString *tokenizationKey;
@property (nonatomic, st... |
Make assert in 36/01 stronger | // SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy
// Example from https://www-apr.lip6.fr/~mine/publi/arti... | // SKIP PARAM: --set solver td3 --enable ana.int.interval --set ana.base.arrays.domain partitioned --set ana.activated "['base','threadid','threadflag','expRelation','mallocWrapper','apron']" --set ana.base.privatization none --set ana.apron.privatization dummy
// Example from https://www-apr.lip6.fr/~mine/publi/arti... |
Make the cache directory accessor public. | //
// CDAUtilities.h
// ContentfulSDK
//
// Created by Boris Bügling on 04/03/14.
//
//
#import <ContentfulDeliveryAPI/CDAClient.h>
#import <Foundation/Foundation.h>
NSString* CDACacheFileNameForQuery(CDAClient* client, CDAResourceType resourceType, NSDictionary* query);
NSString* CDACacheFileNameForResource(CDARe... | //
// CDAUtilities.h
// ContentfulSDK
//
// Created by Boris Bügling on 04/03/14.
//
//
#import <ContentfulDeliveryAPI/CDAClient.h>
#import <Foundation/Foundation.h>
NSString* CDACacheDirectory();
NSString* CDACacheFileNameForQuery(CDAClient* client, CDAResourceType resourceType, NSDictionary* query);
NSString* CD... |
Change PointsToMeters ratio to a float, so we doing floating point math | //
// PHYGeometry.h
// PHYKit
//
// Created by Nora Trapp on 8/1/13.
// Copyright (c) 2013 Nora Trapp. All rights reserved.
//
#import <Box2D/Common/b2Math.h>
#define kPointsToMeterRatio (32)
#define PointsToMeters(points) (points / kPointsToMeterRatio)
#define MetersToPoints(meters) (meters * kPointsToMet... | //
// PHYGeometry.h
// PHYKit
//
// Created by Nora Trapp on 8/1/13.
// Copyright (c) 2013 Nora Trapp. All rights reserved.
//
#import <Box2D/Common/b2Math.h>
#define kPointsToMeterRatio (32.0)
#define PointsToMeters(points) (points / kPointsToMeterRatio)
#define MetersToPoints(meters) (meters * kPointsToM... |
Reorder terms by expected size, though this does not affect calculation | #include "kernel/log.h"
#include "normalize.h"
#include "../reinterpret.h"
#include <math.h>
static double _finite(int64_t i)
{
const double ln2[] = { 0x1.62e42fefa4p-1, -0x1.8432a1b0e2634p-43 };
int64_t exponent = (i - 0x3FE6A09E667F3BCD) >> 52;
double x = reinterpret(double, i - (exponent << 52)) - 1;
... | #include "kernel/log.h"
#include "normalize.h"
#include "../reinterpret.h"
#include <math.h>
static double _finite(int64_t i)
{
const double ln2[] = { 0x1.62e42fefa4p-1, -0x1.8432a1b0e2634p-43 };
int64_t exponent = (i - 0x3FE6A09E667F3BCD) >> 52;
double x = reinterpret(double, i - (exponent << 52)) - 1;
... |
Add minimized test where abort fails. | // SKIP PARAM: --enable exp.solver.td3.restart.wpoint.enabled --enable exp.solver.td3.abort
#include<stdlib.h>
struct a {
int b;
} c(), *f;
int g;
void d();
void e();
int main() {
void *h = calloc(1, sizeof(struct a));
f = h;
d(e);
while (1) {
g = c;
if (c)
break;
f->b = 0;
}
d(h);
} | |
Change monitor_grid_set function to also accept the grid geometry (used for virtual-->canvas coordinate functions). | #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch);
void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Ra... | #ifdef E_TYPEDEFS
#else
# ifndef E_SMART_MONITOR_H
# define E_SMART_MONITOR_H
Evas_Object *e_smart_monitor_add(Evas *evas);
void e_smart_monitor_crtc_set(Evas_Object *obj, Ecore_X_Randr_Crtc crtc, Evas_Coord cx, Evas_Coord cy, Evas_Coord cw, Evas_Coord ch);
void e_smart_monitor_output_set(Evas_Object *obj, Ecore_X_Ra... |
Convert all files on the master branch to unix line endings. | // Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../lpng_v163/png.h"
| // Copyright 2014 PDFium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
#include "../lpng_v163/png.h"
|
Add SUNOS41 to an existing conditional compilation directive. | #ifndef _CONDOR_SYSCALLS_H
#define _CONDOR_SYSCALLS_H
#if defined( AIX32)
# include "syscall.aix32.h"
#else
# include <syscall.h>
#endif
typedef int BOOL;
static const int SYS_LOCAL = 1;
static const int SYS_REMOTE = 0;
static const int SYS_RECORDED = 2;
static const int SYS_MAPPED = 2;
static const int SYS_UNRE... | #ifndef _CONDOR_SYSCALLS_H
#define _CONDOR_SYSCALLS_H
#if defined( AIX32)
# include "syscall.aix32.h"
#else
# include <syscall.h>
#endif
typedef int BOOL;
static const int SYS_LOCAL = 1;
static const int SYS_REMOTE = 0;
static const int SYS_RECORDED = 2;
static const int SYS_MAPPED = 2;
static const int SYS_UNRE... |
Make 64Bit Friendly, NonStatic for Ubuntu 14.04 delete unneeded files | #include "k2pktdef.h"
#define TRACE2_STA_LEN 7
#define TRACE2_CHAN_LEN 9 /* 4 bytes plus padding for loc and version */
#define TRACE2_NET_LEN 9
#define TRACE2_LOC_LEN 3
#define K2INFO_TYPE_STRING "TYPE_K2INFO_PACKET"
typedef struct {
char net[TRACE2_NET_LEN]; /* Network name */
char sta[TRACE2_... | #include "k2pktdef.h"
#define TRACE2_STA_LEN 7
#define TRACE2_CHAN_LEN 9 /* 4 bytes plus padding for loc and version */
#define TRACE2_NET_LEN 9
#define TRACE2_LOC_LEN 3
#define K2_TIME_CONV ((unsigned long)315532800)
#define K2INFO_TYPE_STRING "TYPE_K2INFO_PACKET"
typedef struct {
char net[TRACE2_NET_LEN]... |
Drop $Id$ and update copyright | /*
* $Id$
*
* Copyright (c) 2010-2011, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
* using the SOFTWARE, you agree to be bound by the terms of that
* LICENSE.
*/
/**
* Called... | /*
* Copyright (c) 2010-201e, Juniper Networks, Inc.
* All rights reserved.
* This SOFTWARE is licensed under the LICENSE provided in the
* ../Copyright file. By downloading, installing, copying, or otherwise
* using the SOFTWARE, you agree to be bound by the terms of that
* LICENSE.
*/
/**
* Called from the d... |
Add to header file IDPSingletonModel. | #import "IDPBlock.h"
#import "IDPBufferArray.h"
#import "IDPKVOContext.h"
#import "IDPKVOMutableArray.h"
#import "IDPKeyPathObserver.h"
#import "IDPMachTimer.h"
#import "IDPMutableArray.h"
#import "IDPMutableDictionary.h"
#import "IDPOCContext.h"
#import "IDPOCImplementation.h"
#import "IDPOCStack.h"
#import "NSObject+... | #import "IDPBlock.h"
#import "IDPBufferArray.h"
#import "IDPKVOContext.h"
#import "IDPKVOMutableArray.h"
#import "IDPKeyPathObserver.h"
#import "IDPMachTimer.h"
#import "IDPMutableArray.h"
#import "IDPMutableDictionary.h"
#import "IDPOCContext.h"
#import "IDPOCImplementation.h"
#import "IDPOCStack.h"
#import "NSObject+... |
Add color testing command with random order, to uncover subtle bugs | /*
* 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 Foundati... | |
Add an option to force use of auto_ptr for legacy STL implementations. | // Copyright 2014 The open-vcdiff Authors. All Rights Reserved.
// Author: Mostyn Bramley-Moore
//
// 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/L... | // Copyright 2014 The open-vcdiff Authors. All Rights Reserved.
// Author: Mostyn Bramley-Moore
//
// 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/L... |
Make sure file stat actually finished. Don't check a size_t for neg. | //
// Created by gravypod on 9/20/17.
//
#include "files.h"
#include <sys/stat.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
long int fsize(const char *filename)
{
struct stat st;
if (stat(filename, &st) == 0)
return st.st_size;
return -1;
}
char* read_file(const char* filename... | //
// Created by gravypod on 9/20/17.
//
#include "files.h"
#include <sys/stat.h>
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
long int fsize(const char *filename)
{
struct stat st;
if (stat(filename, &st) == 0)
return st.st_size;
return -1;
}
char* read_file(const char* filename... |
Add as_address on mnemonic argument. | #include <vector>
enum GHCMnemonic {
MOV,
INC,
DEC,
ADD,
SUB,
MUL,
DIV,
AND,
OR,
XOR,
JLT,
JEQ,
JGT,
INT,
HLT
};
enum GHCRegister {
A = 0,
B,
C,
D,
E,
F,
G,
H,
PC
};
enum GHCArgumentType {
Constant,
Register,
Memory
};
struct GHCArgument {
GHCArgumentType type... | #include <vector>
enum GHCMnemonic {
MOV,
INC,
DEC,
ADD,
SUB,
MUL,
DIV,
AND,
OR,
XOR,
JLT,
JEQ,
JGT,
INT,
HLT
};
enum GHCRegister {
A = 0,
B,
C,
D,
E,
F,
G,
H,
PC
};
enum GHCArgumentType {
Constant,
Register,
Memory
};
struct GHCArgument {
GHCArgumentType type... |
Add ansi colors file header | #ifndef _ANSI_COLORS
#define _ANSI_COLORS
#define ANSI_COLOR_RED "\x1b[31m"
#define ANSI_COLOR_GREEN "\x1b[32m"
#define ANSI_COLOR_YELLOW "\x1b[33m"
#define ANSI_COLOR_BLUE "\x1b[34m"
#define ANSI_COLOR_MAGENTA "\x1b[35m"
#define ANSI_COLOR_CYAN "\x1b[36m"
#define ANSI_COLOR_RESET "\x1b[0m"
#endif
| |
Use "is_signal_frame" instead of IA64_FLAG_SIGTRAMP flag bit. | /* libunwind - a platform-independent unwind library
Copyright (C) 2001-2002 Hewlett-Packard Co
Contributed by David Mosberger-Tang <davidm@hpl.hp.com>
This file is part of libunwind.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (... | |
Add missing errno.h include for Linux/UNIX | /* Very simple example for parse buf example */
#include <string.h>
#include <stdlib.h>
#include "confuse.h"
int main(void)
{
cfg_t *cfg;
cfg_opt_t arg_opts[] = {
CFG_STR("value", "default", CFGF_NONE),
CFG_END()
};
cfg_opt_t opts[] = {
CFG_INT("delay", 3, CFGF_NONE),
CFG_STR("message", "This is a message"... | /* Very simple example for parse buf example */
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include "confuse.h"
int main(void)
{
cfg_t *cfg;
cfg_opt_t arg_opts[] = {
CFG_STR("value", "default", CFGF_NONE),
CFG_END()
};
cfg_opt_t opts[] = {
CFG_INT("delay", 3, CFGF_NONE),
CFG_STR("message", ... |
Reduce implicit calls, add fix for large memory sections | /*
* kisskiss.h
*
* Tim "diff" Strazzere <strazz@gmail.com>
*/
#include <stdlib.h>
#include <stdio.h>
#include <sys/ptrace.h>
#include <dirent.h>
#include <fcntl.h> // open / O_RDONLY
static const char* odex_magic = "dey\n036";
static const char* static_safe_location = "/data/local/tmp/";
static const char* suffi... | /*
* kisskiss.h
*
* Tim "diff" Strazzere <strazz@gmail.com>
*/
#include <stdlib.h>
#include <stdio.h>
#include <sys/ptrace.h>
#include <dirent.h>
#include <fcntl.h> // open / O_RDONLY
#include <unistd.h> // close
#include <errno.h> // perror
#include <string.h> // strlen
static const char* odex_magic = "dey\n036"... |
Change forward declaration of HttpRequestInfo from class to struct to fix build breakage. | // 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 NET_SPDY_SPDY_HTTP_UTILS_H_
#define NET_SPDY_SPDY_HTTP_UTILS_H_
#pragma once
#include "net/spdy/spdy_framer.h"
namespace net {
class HttpRe... | // 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 NET_SPDY_SPDY_HTTP_UTILS_H_
#define NET_SPDY_SPDY_HTTP_UTILS_H_
#pragma once
#include "net/spdy/spdy_framer.h"
namespace net {
class HttpRe... |
Fix mp3 field size constants so that the ID3 information gets parsed correctly. |
#define MP3ID3_TITLELEN NAMELEN
#define MP3ID3_ARTISTLEN AUTHORLEN
#define MP3ID3_ALBUMLEN 30
#define MP3ID3_YEARLEN 4
#define MP3ID3_COMMENTLEN 30
typedef struct {
int present:1;
char title[MP3ID3_TITLELEN+1];
char artist[MP3ID3_ARTISTLEN+1];
char album[MP3ID3_ALBUMLEN+1];
char year[MP3ID3_YEARLEN+1];
ch... |
#define MP3ID3_TITLELEN 30
#define MP3ID3_ARTISTLEN 30
#define MP3ID3_ALBUMLEN 30
#define MP3ID3_YEARLEN 4
#define MP3ID3_COMMENTLEN 30
typedef struct {
int present:1;
char title[MP3ID3_TITLELEN+1];
char artist[MP3ID3_ARTISTLEN+1];
char album[MP3ID3_ALBUMLEN+1];
char year[MP3ID3_YEARLEN+1];
char comment[M... |
Fix build with modern Panda headers | // Filename: config_lui.h
// Created by: tobspr (28Aug14)
//
#ifndef CONFIG_LUI_H
#define CONFIG_LUI_H
#include "pandabase.h"
#include "notifyCategoryProxy.h"
#include "dconfig.h"
#define EXPCL_LUI EXPORT_CLASS
#define EXPTP_LUI EXPORT_TEMPL
ConfigureDecl(config_lui, EXPCL_LUI, EXPTP_LUI);
NotifyCategoryDecl(lui, ... | // Filename: config_lui.h
// Created by: tobspr (28Aug14)
//
#ifndef CONFIG_LUI_H
#define CONFIG_LUI_H
#include "pandabase.h"
#include "notifyCategoryProxy.h"
#include "dconfig.h"
#define EXPCL_LUI EXPORT_CLASS
#define EXPTP_LUI EXPORT_TEMPL
ConfigureDecl(config_lui, EXPCL_LUI, EXPTP_LUI);
NotifyCategoryDecl(lui, ... |
Add newline at end of file | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/*
* Copyright (C) 2008 Collabora Ltd.
*
* 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
* vers... | /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/*
* Copyright (C) 2008 Collabora Ltd.
*
* 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
* vers... |
Delete todo comments and add assert to avoid null entry | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "phonebook_opt.h"
/* FILL YOUR OWN IMPLEMENTATION HERE! */
entry *findName(char lastname[], entry *pHead)
{
while (pHead != NULL) {
if (strcasecmp(lastname, pHead->lastName) == 0)
return pHead;
pHead... | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <assert.h>
#include "phonebook_opt.h"
entry *findName(char lastname[], entry *pHead)
{
while (pHead != NULL) {
if (strcasecmp(lastname, pHead->lastName) == 0)
return pHead;
pHead = pHead->pNext;
... |
Fix typo in deprecation message | /*
* Copyright (C) Fondazione Istituto Italiano di Tecnologia
*
* Licensed under either the GNU Lesser General Public License v3.0 :
* https://www.gnu.org/licenses/lgpl-3.0.html
* or the GNU Lesser General Public License v2.1 :
* https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
* at your option.
*/
#ifn... | /*
* Copyright (C) Fondazione Istituto Italiano di Tecnologia
*
* Licensed under either the GNU Lesser General Public License v3.0 :
* https://www.gnu.org/licenses/lgpl-3.0.html
* or the GNU Lesser General Public License v2.1 :
* https://www.gnu.org/licenses/old-licenses/lgpl-2.1.html
* at your option.
*/
#ifn... |
Update pyramid of numbers in C language | /* Pyramid of numbers
Exercise #7 from my college
Make a program that's receive a number and print it like a pyramid in descending order.
Example with number 5 inputted. The output must be like that:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
*/
#include <stdio.h>
int main() {
int number;
printf("Type a number: ");
scanf(... | /* Pyramid of numbers
Exercise #7 from my college
Make a program that's receive a number and print it like a pyramid in ascending order.
Example with number 5 inputted. The output must be like that:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
*/
#include <stdio.h>
int main() {
int number;
printf("Type a number: ");
scanf("... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.