Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add struct to keep datastore things | #ifndef GWKV_HT_WRAPPER
#define GWKV_HT_WRAPPER
#include <stdlib.h>
#include "../hashtable/hashtable.h"
/* Operations the table supports */
typedef enum {
GET,
SET
} method;
/* Defines for result codes */
#define STORED 0
#define NOT_STORED 1
#define EXISTS 2
#define NOT_FOUND 3
/* Datatype for wrap... | #ifndef GWKV_HT_WRAPPER
#define GWKV_HT_WRAPPER
#include <stdlib.h>
#include "../hashtable/hashtable.h"
/* Types of hashing algorithms we support */
typedef enum {
MD5
} hash_type;
/* All encompassing datatype for server datastore */
struct {
ht* hashtable,
hash_type hash
} gwkv_server;
/* O... |
Use a static variable to track whether to use AES-NI | #include <stdio.h>
#include "aes.h"
static void aes_encrypt_block_openssl(const unsigned char *, unsigned char *, const AES_KEY *);
static void aes_encrypt_block_aesni(const unsigned char *, unsigned char *, const AES_KEY *);
int
use_aesni()
{
return 0;
}
void
aes_encrypt_block(const unsigned char *in, unsigned ch... | #include <stdio.h>
#include "aes.h"
static void aes_encrypt_block_openssl(const unsigned char *, unsigned char *, const AES_KEY *);
static void aes_encrypt_block_aesni(const unsigned char *, unsigned char *, const AES_KEY *);
int
use_aesni()
{
return 0;
}
void
aes_encrypt_block(const unsigned char *in, unsigned ch... |
Make detab actually work reliably. | /*
* detab: Replace tabs with blanks.
*/
#include <stdio.h>
#define MAXLINE 10000 /* Max input line length. */
#define TABSTOP 8 /* Set tab stop to eight characters. */
int getaline(char *, int);
void detab(char *);
/* detab: Replace tabs with blanks. */
int
main(void)
{
char line[MAXLINE]; /* Current input lin... | /*
* detab: Replace tabs with blanks.
*/
#include <stdio.h>
#define TABSIZE 8
/* detab: Replace tabs with blanks. */
int
main(void)
{
int ch, i;
for (i = 0; (ch = getchar()) != EOF; i++) {
if (ch == '\n')
i = 0;
if (ch == '\t') {
putchar(' ');
while (i % TABSIZE) {
putchar(' ');
i++;
}
... |
Update deprecation message in HTML Text node | //
// HTMLText.h
// HTMLKit
//
// Created by Iska on 26/02/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import "HTMLCharacterData.h"
NS_ASSUME_NONNULL_BEGIN
/**
A HTML Text node
*/
@interface HTMLText : HTMLCharacterData
/**
Initializes a new HTML text node.
@param data The text string.
... | //
// HTMLText.h
// HTMLKit
//
// Created by Iska on 26/02/15.
// Copyright (c) 2015 BrainCookie. All rights reserved.
//
#import "HTMLCharacterData.h"
NS_ASSUME_NONNULL_BEGIN
/**
A HTML Text node
*/
@interface HTMLText : HTMLCharacterData
/**
Initializes a new HTML text node.
@param data The text string.
... |
Add in stubbing in of new register allocator. | #include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#include <ctype.h>
#include <string.h>
#include <assert.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include "parse.h"
#include "asm.h"
struct Asmbb {
int id;
char **lbls;
size_t nlbls... | |
Clean up smyrna files: remove unnecessary globals modify libraries not to rely on code in cmd/smyrna remove static declarations from .h files remove unnecessary libraries mark unused code and clean up warnings | #ifndef TOPVIEWSETTINGS_H
#define TOPVIEWSETTINGS_H
#include "smyrnadefs.h"
_BB void on_settingsOKBtn_clicked (GtkWidget *widget,gpointer user_data);
_BB void on_settingsCancelBtn_clicked (GtkWidget *widget,gpointer user_data);
int load_settings_from_graph(Agraph_t *g);
int update_graph_from_settings(Agraph_t *g);
... | /* 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... |
Create an interface indicating a class requires construction (or constructor-like) logic to be delayed until Arduino setup() function | #ifndef RCR_LEVEL1PAYLOAD_SETUPABLE_H_
#define RCR_LEVEL1PAYLOAD_SETUPABLE_H_
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
namespace rcr {
namespace level1payload {
// An interface indicating a class requires construction (or constructor-like)
// logic to be delaye... | |
Add configuration file. Unity provides the ability for the user to add this file in order to substitute built in Unity functions for user specific ones. In this case we are using it to redefine UNITY_OUTPUT_CHAR which is used by all the printing functions. By default it is directed to stdout, however to ensure the use ... | /****************************************************************************
* Copyright (c) 2015, ARM Limited, All Rights Reserved
* 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 ma... | |
Add example using the pack library | /* 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... | |
Add Handler for user to handle a http request. | // The MIT License (MIT)
//
// Copyright(c) 2016 huan.wang
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files(the "Software"),
// to deal in the Software without restriction, including without limitation the rights
// to use, copy, m... | |
Add subscript operator to Vector3 | #pragma once
template <typename T>
class Vector3 {
public:
T x, y, z;
Vector3(T x, T y, T z)
{
this->x = x;
this->y = y;
this->z = z;
}
};
template <typename T>
class Vector4 {
public:
T x, y, z, w;
Vector4() {}
Vector4(T x, T y, T z, T w)
{
this->x = x;
this->y = y;
this->z = z;
this->w = w;... | #pragma once
template <typename T>
class Vector3 {
public:
T x, y, z;
Vector3(T x, T y, T z)
{
this->x = x;
this->y = y;
this->z = z;
}
T &operator[](unsigned i)
{
return (&x)[i];
}
};
template <typename T>
class Vector4 {
public:
T x, y, z, w;
Vector4() {}
Vector4(T x, T y, T z, T w)
{
this-... |
Add an intrusive linked list implementation to eliminate the heap allocations needed for the vectors. | #pragma once
namespace caprica {
template<typename T>
struct IntrusiveLinkedList final
{
void push_back(T* val) {
mSize++;
if (front == nullptr) {
front = back = val;
} else {
back->next = val;
back = val;
}
}
size_t size() const { return mSize; }
private:
size_t mSize{ 0 }... | |
Add the dispatch header to X_SEMAPHORE | /**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. ... | /**
******************************************************************************
* Xenia : Xbox 360 Emulator Research Project *
******************************************************************************
* Copyright 2013 Ben Vanik. All rights reserved. ... |
Remove unnecessary semicolon after method definitions | #pragma once
#include "../definitions.h"
class ByteRegister {
public:
ByteRegister() {};
void set(const u8 new_value) { val = new_value; };
u8 value() const { return val; };
void increment() { val += 1; };
void decrement() { val -= 1; };
private:
u8 val;
};
class WordRegister {
public:
... | #pragma once
#include "../definitions.h"
class ByteRegister {
public:
ByteRegister() {}
void set(const u8 new_value) { val = new_value; }
u8 value() const { return val; }
void increment() { val += 1; }
void decrement() { val -= 1; }
private:
u8 val;
};
class WordRegister {
public:
Word... |
Clean up suffix array tests. | #include "minunit.h"
#include <lcthw/sarray.h>
char *test_create_destroy()
{
char test[] = "abracadabra";
char test2[] = "acadabra";
SuffixArray *sarry = SuffixArray_create(test, sizeof(test));
mu_assert(sarry, "Failed to create.");
int at = SuffixArray_find_suffix(sarry, test2, sizeof(test2));
... | #include "minunit.h"
#include <lcthw/sarray.h>
static SuffixArray *sarry = NULL;
static char test[] = "abracadabra";
static char test2[] = "acadabra";
char *test_create()
{
sarry = SuffixArray_create(test, sizeof(test));
mu_assert(sarry, "Failed to create.");
return NULL;
}
char *test_destroy()
{
Su... |
Mark string functions unused, in case the header is included in files that only use one of them. | #include <string.h>
#include <stdint.h>
/**
* Efficient string hash function.
*/
static uint32_t string_hash(const char *str)
{
uint32_t hash = 0;
int32_t c;
while ((c = *str++))
{
hash = c + (hash << 6) + (hash << 16) - hash;
}
return hash;
}
/**
* Test two strings for equality.
*/
static int string_comp... | #include <string.h>
#include <stdint.h>
/**
* Efficient string hash function.
*/
__attribute__((unused))
static uint32_t string_hash(const char *str)
{
uint32_t hash = 0;
int32_t c;
while ((c = *str++))
{
hash = c + (hash << 6) + (hash << 16) - hash;
}
return hash;
}
/**
* Test two strings for equality.
*... |
Add C++11 compliance check file. | #ifndef CPP11_FEATURES_H
#define CPP11_FEATURES_H
#if defined(_MSC_VER) && (_MSC_FULL_VER >= 170050727)
// for (T t : collection) { }
#define CPP11_FOR_EACH
// enum class T {};
#define CPP11_ENUM_CLASS
#elif defined(__GNUC__) && (__GNUC__ >= 4) && (__GNUC_MINOR__ >= 6)
#define CPP11_FOR_EACH
#define CPP11_ENUM_CLASS
#... | |
Add missing license (amd, mit/x11) |
#ifndef R600_BLIT_SHADERS_H
#define R600_BLIT_SHADERS_H
extern const u32 r6xx_ps[];
extern const u32 r6xx_vs[];
extern const u32 r7xx_default_state[];
extern const u32 r6xx_default_state[];
extern const u32 r6xx_ps_size, r6xx_vs_size;
extern const u32 r6xx_default_size, r7xx_default_size;
#endif
| /*
* Copyright 2009 Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, m... |
Add tests on how clang currently handles some unknown options. | // RUN: not %clang_cc1 %s -cake-is-lie -%0 -%d 2> %t.log
// RUN: FileCheck %s -input-file=%t.log
// CHECK: unknown argument
// CHECK: unknown argument
// CHECK: unknown argument
| // RUN: not %clang_cc1 %s -cake-is-lie -%0 -%d 2> %t.log
// RUN: FileCheck %s -input-file=%t.log
// CHECK: unknown argument
// CHECK: unknown argument
// CHECK: unknown argument
// RUN: %clang -S %s -o %t.s -funknown-to-clang-option -Wunknown-to-clang-option -munknown-to-clang-optio
// IGNORED: warning: argument un... |
Remove underscores from header guard | /*
* %FFILE%
* Copyright (C) %YEAR% %USER% <%MAIL%>
*
* Distributed under terms of the %LICENSE% license.
*/
#ifndef __%GUARD%__
#define __%GUARD%__
%HERE%
#endif /* !__%GUARD%__ */
| /*
* %FFILE%
* Copyright (C) %YEAR% %USER% <%MAIL%>
*
* Distributed under terms of the %LICENSE% license.
*/
#ifndef %GUARD%
#define %GUARD%
%HERE%
#endif /* !%GUARD% */
|
Move static methods outside of class | #ifndef VECTOR_3D_H
#define VECTOR_3D_H
#include <math.h>
namespace classes {
struct Point3D {
double x, y, z;
};
typedef const char* err;
class Vector3D {
struct Cheshire;
Cheshire* smile;
static const Point3D nullPoint;
static unsigned int idCounter;
public:
Vector3D(Point3D point = nullPoin... | #ifndef VECTOR_3D_H
#define VECTOR_3D_H
#include <math.h>
namespace classes {
struct Point3D {
double x, y, z;
};
typedef const char* err;
class Vector3D {
struct Cheshire;
Cheshire* smile;
static const Point3D nullPoint;
static unsigned int idCounter;
public:
Vector3D(Point3D point = nullPoin... |
Declare routines which support SET keyword = value SQL commands. | /*
* Headers for handling of 'SET var TO', 'SHOW var' and 'RESET var'
* statements
*
* $Id: variable.h,v 1.6 1997/09/08 02:39:21 momjian Exp $
*
*/
enum DateFormat
{
Date_Postgres, Date_SQL, Date_ISO
};
/*-----------------------------------------------------------------------*/
struct PGVariables
{
struct
{
... | /*
* Headers for handling of 'SET var TO', 'SHOW var' and 'RESET var'
* statements
*
* $Id: variable.h,v 1.7 1997/11/07 06:45:16 thomas Exp $
*
*/
#ifndef VARIABLE_H
#define VARIABLE_H 1
enum DateFormat
{
Date_Postgres, Date_SQL, Date_ISO
};
/*-------------------------------------------------------------------... |
Use <> instead of \"\" | /* Define the real-function versions of all inline functions
defined in signal.h (or bits/sigset.h). */
#include <features.h>
#define _EXTERN_INLINE
#ifndef __USE_EXTERN_INLINES
# define __USE_EXTERN_INLINES 1
#endif
#include "signal.h"
| /* Define the real-function versions of all inline functions
defined in signal.h (or bits/sigset.h). */
#include <features.h>
#define _EXTERN_INLINE
#ifndef __USE_EXTERN_INLINES
# define __USE_EXTERN_INLINES 1
#endif
#include <signal.h>
|
Add a triple to the test. | // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
extern void foo_alias (void) __asm ("foo");
inline void foo (void) {
return foo_alias ();
}
extern void bar_alias (void) __asm ("bar");
inline __attribute__ ((__always_inline__)) void bar (void) {
return bar_alias ();
}
extern char *strrchr_foo (const char *__s,... | // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-llvm %s -o - | FileCheck %s
extern void foo_alias (void) __asm ("foo");
inline void foo (void) {
return foo_alias ();
}
extern void bar_alias (void) __asm ("bar");
inline __attribute__ ((__always_inline__)) void bar (void) {
return bar_alias ();
}
extern char *strrc... |
Swap fields in IPv4 header because of little endianness | #ifndef IPV4_H
#define IPV4_H
#include "syshead.h"
#include "netdev.h"
#define IPV4 0x04
#define ICMPV4 0x01
struct iphdr {
uint8_t version : 4;
uint8_t ihl : 4;
uint8_t tos;
uint16_t len;
uint16_t id;
uint16_t flags : 3;
uint16_t frag_offset : 13;
uint8_t ttl;
uint8_t proto;
... | #ifndef IPV4_H
#define IPV4_H
#include "syshead.h"
#include "netdev.h"
#define IPV4 0x04
#define ICMPV4 0x01
struct iphdr {
uint8_t ihl : 4; /* TODO: Support Big Endian hosts */
uint8_t version : 4;
uint8_t tos;
uint16_t len;
uint16_t id;
uint16_t flags : 3;
uint16_t frag_offset : 13;
... |
Include stdio.h in case bzlib.h needs it. | /* Copyright (c) 2005-2008 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream-internal.h"
#include "istream-zlib.h"
#ifdef HAVE_BZLIB
#include <bzlib.h>
#define BZLIB_INCLUDE
#define gzFile BZFILE
#define gzdopen BZ2_bzdopen
#define gzclose BZ2_bzclose
#define gzread BZ2_bzread
#de... | /* Copyright (c) 2005-2008 Dovecot authors, see the included COPYING file */
#include "lib.h"
#include "istream-internal.h"
#include "istream-zlib.h"
#ifdef HAVE_BZLIB
#include <stdio.h>
#include <bzlib.h>
#define BZLIB_INCLUDE
#define gzFile BZFILE
#define gzdopen BZ2_bzdopen
#define gzclose BZ2_bzclose
#define gz... |
Fix me missing the name | #pragma once
#include "main.h"
#include "logmanager.h"
#include "modtypes/socket.h"
const std::set<unsigned int> sockAPIVersions { 3000 };
class SocketManager {
public:
std::shared_ptr<Socket> getSocket(const std::string& socketType);
private:
void removeSocket(const std::string& socketType, void* sockFile, Soc... | #pragma once
#include "main.h"
#include "logmanager.h"
#include "modtypes/socket.h"
const std::set<unsigned int> sockAPIVersions { 3000 };
class SocketManager {
public:
std::shared_ptr<Socket> getSocket(const std::string& socketType);
private:
void removeSocket(const std::string& socketType, void* sockFile, Soc... |
Update Skia milestone to 83 | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 82
#endif
| /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 83
#endif
|
Update Skia milestone to 62 | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 61
#endif
| /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 62
#endif
|
Fix typo in file Header guard | /*
* Copyright (c) 2017 - 2020, Broadcom
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef SCP_H_
#define SCP_H
#include <stdint.h>
int download_scp_patch(void *image, unsigned int image_size);
#endif /* SCP_H */
| /*
* Copyright (c) 2017 - 2020, Broadcom
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef SCP_H
#define SCP_H
#include <stdint.h>
int download_scp_patch(void *image, unsigned int image_size);
#endif /* SCP_H */
|
Remove constness of int fields to enable it to build on VC6.0 | #ifndef __REFCACHE_H__
#define __REFCACHE_H__
// Class/Method/Field ID caching
// Cache of frequently-used class references
struct _classRef {
jclass classID;
const char *className;
};
typedef struct _classRef classRef;
// Cache of frequently-used method references
struct _methodRef {
jmethodID methodID;
const i... | #ifndef __REFCACHE_H__
#define __REFCACHE_H__
// Class/Method/Field ID caching
// Cache of frequently-used class references
struct _classRef {
jclass classID;
const char *className;
};
typedef struct _classRef classRef;
// Cache of frequently-used method references
struct _methodRef {
jmethodID methodID;
int cla... |
Install original sfdp files, with development logs; recommit new sfdp files | /* 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... | |
Store system clock as milliseconds, not microseconds. | #include "LPC17xx.h"
#include "lpc_types.h"
#include "lpc17xx_timer.h"
#include "timer.h"
#define SYSTEM_CLOCK_TIMER LPC_TIM3
#define DELAY_TIMER LPC_TIM0
void TIMER3_IRQHandler() { }
void delayMs(int delayInMs) {
TIM_TIMERCFG_Type delayTimerConfig;
TIM_ConfigStructInit(TIM_TIMER_MODE, &delayTimerConfig);
... | #include "LPC17xx.h"
#include "lpc_types.h"
#include "lpc17xx_timer.h"
#include "timer.h"
#define SYSTEM_CLOCK_TIMER LPC_TIM3
#define DELAY_TIMER LPC_TIM0
void delayMs(int delayInMs) {
TIM_TIMERCFG_Type delayTimerConfig;
TIM_ConfigStructInit(TIM_TIMER_MODE, &delayTimerConfig);
TIM_Init(DELAY_TIMER, TIM_TI... |
Make Document::add() and remove() static | /*
* Copyright (C) 2008-2013 The Communi Project
*
* This example is free, and not covered by the LGPL license. There is no
* restriction applied to their modification, redistribution, using and so on.
* You can study them, modify them, use them in your own program - either
* completely or partially.
*/
#ifndef... | /*
* Copyright (C) 2008-2013 The Communi Project
*
* This example is free, and not covered by the LGPL license. There is no
* restriction applied to their modification, redistribution, using and so on.
* You can study them, modify them, use them in your own program - either
* completely or partially.
*/
#ifndef... |
Fix compiler warning complaining about un-proto... | /*
* Copyright © 2009 CNRS, INRIA, Université Bordeaux 1
* See COPYING in top-level directory.
*/
#include <private/config.h>
#ifdef HAVE_XML
#include <hwloc.h>
#include "lstopo.h"
void output_xml(hwloc_topology_t topology, const char *filename, int verbose_mode)
{
if (!strcasecmp(filename, "-.xml"))
file... | /*
* Copyright © 2009 CNRS, INRIA, Université Bordeaux 1
* See COPYING in top-level directory.
*/
#include <private/config.h>
#ifdef HAVE_XML
#include <hwloc.h>
#include <string.h>
#include "lstopo.h"
void output_xml(hwloc_topology_t topology, const char *filename, int verbose_mode)
{
if (!strcasecmp(filename... |
Fix function prototype for sem_wait on freertos |
#include <FreeRTOS.h>
#include <semphr.h>
#include <csp/arch/csp_semaphore.h>
#include <csp/csp_debug.h>
#include <csp/csp.h>
void csp_bin_sem_init(csp_bin_sem_t * sem) {
xSemaphoreCreateBinaryStatic(sem);
xSemaphoreGive(sem);
}
int csp_bin_sem_wait(csp_bin_sem_t * sem, uint32_t timeout) {
csp_log_lock("Wait: %... |
#include <FreeRTOS.h>
#include <semphr.h>
#include <csp/arch/csp_semaphore.h>
#include <csp/csp_debug.h>
#include <csp/csp.h>
void csp_bin_sem_init(csp_bin_sem_t * sem) {
xSemaphoreCreateBinaryStatic(sem);
xSemaphoreGive(sem);
}
int csp_bin_sem_wait(csp_bin_sem_t * sem, unsigned int timeout) {
csp_log_lock("Wai... |
Put prototype for syscall() in for OSF/1 machines. | #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... |
Simplify test so that it is more portable. | // XFAIL: hexagon
// RUN: rm -rf %t.dir
// RUN: mkdir -p %t.dir/a.out
// RUN: cd %t.dir && not %clang %s
// RUN: test -d %t.dir/a.out
// REQUIRES: shell
int main() { return 0; }
| // RUN: rm -rf %t.dir
// RUN: mkdir -p %t.dir
// RUN: not %clang %s -c -emit-llvm -o %t.dir
// RUN: test -d %t.dir
int main() { return 0; }
|
Fix intermittent build error about non-modular header. | //
// BNNSHelpers.h
// NumberPad
//
// Created by Bridger Maxwell on 9/1/16.
// Copyright © 2016 Bridger Maxwell. All rights reserved.
//
#include <Accelerate/Accelerate.h>
BNNSFilterParameters createEmptyBNNSFilterParameters();
| //
// BNNSHelpers.h
// NumberPad
//
// Created by Bridger Maxwell on 9/1/16.
// Copyright © 2016 Bridger Maxwell. All rights reserved.
//
@import Accelerate;
BNNSFilterParameters createEmptyBNNSFilterParameters();
|
Include guard reflects the new project name. | /*
* Copyright (c) 2012 Kyle Isom <kyle@tyrfingr.is>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE ... | /*
* Copyright (c) 2012 Kyle Isom <kyle@tyrfingr.is>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE ... |
Add back the allocator implementation for WMSDK | // Copyright (c) 2003-2013, LogMeIn, Inc. All rights reserved.
// This is part of Xively C library, it is under the BSD 3-Clause license.
/**
* \file xi_allocator_wmsdk.h
* \author Olgierd Humenczuk
* \brief Our custom `alloc()` and `free()` [see xi_allocator.h]
*/
#ifndef __XI_ALLOCATOR_STDLIB_H__
#define __X... | |
Set thread stack size to 256K | #include <stdlib.h>
#include <pthread.h>
#include "multithread.h"
mt_threads *mt_threads_create(unsigned nthreads)
{
mt_threads *threads = (mt_threads *) malloc(sizeof(mt_threads));
if (!threads)
return NULL;
threads->contexts = (mt_context *) malloc(sizeof(mt_context) * nthrea... | #include <stdlib.h>
#include <pthread.h>
#include "multithread.h"
#define THREAD_STACK_SIZE (256*1024)
mt_threads *mt_threads_create(unsigned nthreads)
{
mt_threads *threads = (mt_threads *) malloc(sizeof(mt_threads));
if (!threads)
return NULL;
threads->contexts = (mt_context... |
Add tableview editing function to header | #import <Cocoa/Cocoa.h>
#import "IPCurveStorage.h"
#import "IPCurveView.h"
@interface IPSourceController : NSObject <NSTableViewDelegate>
{
IBOutlet NSTableView * curveSetChooser;
IBOutlet IPCurveView * controlPointView;
IBOutlet IPCurveStorage * curveStorage;
}
- (int)numberOfRowsInTableView:(NSTableVi... | #import <Cocoa/Cocoa.h>
#import "IPCurveStorage.h"
#import "IPCurveView.h"
@interface IPSourceController : NSObject <NSTableViewDelegate>
{
IBOutlet NSTableView * curveSetChooser;
IBOutlet IPCurveView * controlPointView;
IBOutlet IPCurveStorage * curveStorage;
}
- (int)numberOfRowsInTableView:(NSTableVi... |
Fix link time bug caused by missing header include. | /* 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... |
Add correct work of client | #include <unistd.h>
#include <stdio.h>
#include <master/usage.h>
#include <master/arg.h>
#include <share/socket.h>
#define IP "88.176.106.132"
int main(int argc, char *argv[])
{
int socket_fd;
config_t *config;
if (argc < 5)
{
usage();
return 0;
}
/* Error on processing a... | #include <unistd.h>
#include <stdio.h>
#include <master/usage.h>
#include <master/arg.h>
#include <share/socket.h>
#define IP "88.176.106.132"
int main(int argc, char *argv[])
{
int socket_fd;
config_t *config;
if (argc < 5)
{
usage();
return 0;
}
/* Error on processing a... |
Change NULL or 0 to nullptr | /****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
*************************************... | /****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
*************************************... |
Convert the embedded test to the bitmap API | #include <hwloc.h>
#include <stdio.h>
/* The body of the test is in a separate .c file and a separate
library, just to ensure that hwloc didn't force compilation with
visibility flags enabled. */
int do_test(void)
{
mytest_hwloc_topology_t topology;
unsigned depth;
hwloc_cpuset_t cpu_set;
/* Ju... | #include <hwloc.h>
#include <stdio.h>
/* The body of the test is in a separate .c file and a separate
library, just to ensure that hwloc didn't force compilation with
visibility flags enabled. */
int do_test(void)
{
mytest_hwloc_topology_t topology;
unsigned depth;
hwloc_bitmap_t cpu_set;
/* Ju... |
Include InternalDataStore into Operation interface | #pragma once
#ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_
#define YOU_DATASTORE_INTERNAL_OPERATION_H_
#include <unordered_map>
#include "../task_typedefs.h"
namespace You {
namespace DataStore {
namespace Internal {
/// A pure virtual class of operations to be put into transaction stack
class IOperation {
public:
vir... | #pragma once
#ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_
#define YOU_DATASTORE_INTERNAL_OPERATION_H_
#include <unordered_map>
#include "../task_typedefs.h"
#include "internal_datastore.h"
namespace You {
namespace DataStore {
namespace Internal {
/// A pure virtual class of operations to be put into transaction stack... |
Change outlets from strong to weak references. | //
// FlickrViewController.h
// PhotoWheel
//
// Created by Kirby Turner on 12/16/12.
// Copyright (c) 2012 White Peak Software Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
@class PhotoAlbum;
@interface FlickrViewController : UIViewController <UICollectionViewDataSource, UICollectionViewDelegate, UISearc... | //
// FlickrViewController.h
// PhotoWheel
//
// Created by Kirby Turner on 12/16/12.
// Copyright (c) 2012 White Peak Software Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
@class PhotoAlbum;
@interface FlickrViewController : UIViewController <UICollectionViewDataSource, UICollectionViewDelegate, UISearc... |
Add source file for Problem Set 2 (Hacker Edition) | #define _XOPEN_SOURCE
#include <cs50.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
bool dictionaryAttack(string ciphertext);
bool bruteForceAttack(string ciphertext);
bool next(char* word, int n);
int main(int argc, string argv[])
{
if (argc != 2) {
printf("Usage: ./crack ciphertext\n");
... | |
Update all-in-one header (add ode.h) | // All-in-one header of nmlib
#ifndef NMLIB_H
#define NMLIB_H
#include "chrono.h"
#include "diff.h"
#include "fft.h"
#include "integral.h"
#include "io.h"
#include "kalman.h"
#include "lp.h"
#include "matrix.h"
#include "matrix_decomp.h"
#include "optimization.h"
#include "polynomial.h"
#include "random.h"
#include... | // All-in-one header of nmlib
#ifndef NMLIB_H
#define NMLIB_H
#include "chrono.h"
#include "diff.h"
#include "fft.h"
#include "integral.h"
#include "io.h"
#include "kalman.h"
#include "lp.h"
#include "matrix.h"
#include "matrix_decomp.h"
#include "ode.h"
#include "optimization.h"
#include "polynomial.h"
#include "r... |
Comment on didEndTouchesInRangeSlider and other delegate method | //
// YLRangeSliderViewDelegate.h
// FantasyRealFootball
//
// Created by Tom Thorpe on 16/04/2014.
// Copyright (c) 2014 Yahoo inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@class TTRangeSlider;
@protocol TTRangeSliderDelegate <NSObject>
-(void)rangeSlider:(TTRangeSlider *)sender didChangeSelec... | //
// YLRangeSliderViewDelegate.h
// FantasyRealFootball
//
// Created by Tom Thorpe on 16/04/2014.
// Copyright (c) 2014 Yahoo inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@class TTRangeSlider;
@protocol TTRangeSliderDelegate <NSObject>
/**
* Called when the RangeSlider values are changed
*/... |
Drop ifdefs in favor of more comprehensive code | /* The contents of this file is in the public domain. */
#include <ipify.h>
int main(void)
{
char addr[256];
#if 0
int sd;
sd = ipify_connect();
if (sd < 0)
return 1;
if (!ipify_query(sd, addr, sizeof(addr)))
printf("%s\n", addr);
return ipify_disconnect(sd);
#else
if (ipify(addr, sizeof(addr)))
return... | /* The contents of this file is in the public domain. */
#include <ipify.h>
int main(void)
{
char addr[256];
int sd;
sd = ipify_connect();
if (sd < 0)
return 1;
if (!ipify_query(sd, addr, sizeof(addr)))
printf("%s\n", addr);
return ipify_disconnect(sd);
}
|
Make C example more C, less asm | void
PokeBitplanePointers(unsigned short* copper, unsigned char* bitplanes, unsigned offset, unsigned numBitplanes, unsigned screenWidthBytes)
{
int i;
copper += offset;
for (i = 0; i < numBitplanes; i++) {
*(copper+1) = (unsigned)bitplanes;
*(copper+3) = ((unsigned)bitplanes >> 16);
bitplanes += sc... | typedef union {
unsigned char* ptr;
unsigned short word[2];
} word_extract_t;
void
PokeBitplanePointers(unsigned short* copper, unsigned char* bitplanes, unsigned offset, unsigned numBitplanes, unsigned screenWidthBytes)
{
int i;
copper += offset;
for (i = 0; i < numBitplanes; i++) {
word_extract_t ext... |
Fix possible memory overflow and remove DEBUG_MAX_BUFFER |
/**
* `debug.h' - debug.c
*
* copyright (c) 2014 joseph werle <joseph.werle@gmail.com>
*/
#ifndef DEBUG_H
#define DEBUG_H 1
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#define DEBUG_MAX_BUFFER 1024
/**
* Debug function type
*/
typedef void (* debug_t) (const char *, ...);
/**
* Initialize a... |
/**
* `debug.h' - debug.c
*
* copyright (c) 2014 joseph werle <joseph.werle@gmail.com>
*/
#ifndef DEBUG_H
#define DEBUG_H 1
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
/**
* Debug function type
*/
typedef void (* debug_t) (const char *, ...);
/**
* Initialize a debug function
*/
#define de... |
Make it say "Hello universe." | /*
* hello.c - Say hello to the world.
* Susumu Ishihara 2015/4/12
*/
#include <stdio.h>
int main() {
printf("Hello world.\n.");
printf("Hello susumu.\n");
printf("Added new branch.\n");
return 0;
}
| /*
* hello.c - Say hello to the world.
* Susumu Ishihara 2015/4/12
*/
#include <stdio.h>
int main() {
printf("Hello world.\n.");
printf("Hello susumu.\n");
printf("Added new branch.\n");
printf("Hello universe.\n");
return 0;
}
|
Add initial test cases for scanf format string checking. | // RUN: %clang_cc1 -fsyntax-only -verify -Wformat-nonliteral %s
typedef __typeof(sizeof(int)) size_t;
typedef struct _FILE FILE;
int fscanf(FILE * restrict, const char * restrict, ...) ;
int scanf(const char * restrict, ...) ;
int sscanf(const char * restrict, const char * restrict, ...) ;
void test(const char *s, i... | |
Use the macros from machine/fsr.h; some minor cleanups. | /*
* Written by J.T. Conklin, Apr 10, 1995
* Public domain.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <ieeefp.h>
fp_except_t
fpsetmask(mask)
fp_except_t mask;
{
fp_except_t old;
fp_except_t new;
__asm__("st %%fsr,%0" : "=m" (*&old));
new = old;
new &= ~(0x1f << 23);
new |= ((mask & 0x1f)... | /*
* Written by J.T. Conklin, Apr 10, 1995
* Public domain.
*/
#include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <machine/fsr.h>
#include <ieeefp.h>
fp_except_t
fpsetmask(mask)
fp_except_t mask;
{
fp_except_t old;
fp_except_t new;
__asm__("st %%fsr,%0" : "=m" (old));
new = old;
new &= ~FSR_TEM_MASK;
... |
Set removed item's prev/next pointers to NULL. | #ifndef LLIST_H
#define LLIST_H
/* Doubly linked list */
#define DLLIST_PREPEND(list, item) STMT_START { \
(item)->prev = NULL; \
(item)->next = *(list); \
if (*(list) != NULL) (*(list))->prev = (item); \
*(list) = (item); \
} STMT_END
#define DLLIST_REMOVE(list, item) STMT_START { \
if ((item)->prev == NULL) \... | #ifndef LLIST_H
#define LLIST_H
/* Doubly linked list */
#define DLLIST_PREPEND(list, item) STMT_START { \
(item)->prev = NULL; \
(item)->next = *(list); \
if (*(list) != NULL) (*(list))->prev = (item); \
*(list) = (item); \
} STMT_END
#define DLLIST_REMOVE(list, item) STMT_START { \
if ((item)->prev == NULL) \... |
Make ScopedOleInitializer work on windows if you aren't including build_config already. | // Copyright (c) 2009 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_APP_SCOPED_OLE_INITIALIZER_H_
#define CHROME_APP_SCOPED_OLE_INITIALIZER_H_
// Wraps OLE initialization in a cross-platform class meant... | // Copyright (c) 2009 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_APP_SCOPED_OLE_INITIALIZER_H_
#define CHROME_APP_SCOPED_OLE_INITIALIZER_H_
#include "base/logging.h"
#include "build/build_config.h"
... |
Add header guards for test input headers | class PublicPrivate {
public:
int PublicMemberVar;
static int PublicStaticMemberVar;
void publicMemberFunc();
typedef int PublicTypedef;
struct PublicStruct {};
enum PublicEnum { PublicEnumValue1 };
enum { PublicAnonymousEnumValue };
enum PublicClosedEnum {
PublicClosedEnumValue1
} __attribute__(... | #ifndef TEST_INTEROP_CXX_CLASS_INPUTS_ACCESS_SPECIFIERS_H
#define TEST_INTEROP_CXX_CLASS_INPUTS_ACCESS_SPECIFIERS_H
class PublicPrivate {
public:
int PublicMemberVar;
static int PublicStaticMemberVar;
void publicMemberFunc();
typedef int PublicTypedef;
struct PublicStruct {};
enum PublicEnum { PublicEnumV... |
Add stdin and stdout redirects | #include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char* argv[]) {
if (argc > 1) {
int fdWrite = open(argv[1], O_WRONLY | O_CREAT, 0666);
if (fdWrite == -1) {
write(2, "Cannot open file", 16);
return 1;
}
int fdRead = open(argv[1], O_RDONLY);
if (fdRead == -1... | #include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
int main(int argc, char* argv[]) {
if (argc > 1) {
int stdoutCopy = dup(1);
close(1);
int fdWrite = open(argv[1], O_WRONLY | O_CREAT | O_APPEND, 0666);
if (fdWrite == -1) {
write(2, "Cannot open file", 16);
return 1;
}
clos... |
Add more helpful C++ error messages | #include "NativeNodeUtils.h"
#ifndef __FF_CATCHCVEXCEPTIONWORKER_H__
#define __FF_CATCHCVEXCEPTIONWORKER_H__
struct CatchCvExceptionWorker : public FF::SimpleWorker {
public:
std::string execute() {
try {
return executeCatchCvExceptionWorker();
} catch (std::exception e) {
return std::string(e.what());
}... | #include "NativeNodeUtils.h"
#ifndef __FF_CATCHCVEXCEPTIONWORKER_H__
#define __FF_CATCHCVEXCEPTIONWORKER_H__
struct CatchCvExceptionWorker : public FF::SimpleWorker {
public:
std::string execute() {
try {
return executeCatchCvExceptionWorker();
} catch (std::exception &e) {
return std::string(e.what());
... |
Add the vpsc library for IPSEPCOLA features | /**
* \brief remove overlaps between a set of rectangles.
*
* Authors:
* Tim Dwyer <tgdwyer@gmail.com>
*
* Copyright (C) 2005 Authors
*
* This version is released under the CPL (Common Public License) with
* the Graphviz distribution.
* A version is also available under the LGPL as part of the Adaptagrams
... | |
Make expected test result endianness-neutral | #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, ... | #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, ... |
Update this testcase for the new metadata assembler syntax. | // RUN: %clang -g -S -emit-llvm -o - %s | FileCheck %s
// RUN: %clang -S -emit-llvm -o - %s | FileCheck %s --check-prefix=NO_DEBUG
int main (void) {
return 0;
}
// CHECK: i32 2, !"Debug Info Version", i32 2}
// NO_DEBUG-NOT: metadata !"Debug Info Version"
| // RUN: %clang -g -S -emit-llvm -o - %s | FileCheck %s
// RUN: %clang -S -emit-llvm -o - %s | FileCheck %s --check-prefix=NO_DEBUG
int main (void) {
return 0;
}
// CHECK: i32 2, !"Debug Info Version", i32 2}
// NO_DEBUG-NOT: !"Debug Info Version"
|
Make the branches explicit rather than implicit | #include "duktape.h"
#include "mininode.h"
#include "uv.h"
#include <unistd.h>
duk_ret_t mn_bi_os_homedir(duk_context *ctx) {
char buf[PATH_MAX];
size_t len = sizeof(buf);
const int err = uv_os_homedir(buf, &len);
if (err) {
duk_push_string(ctx, "uv_os_homedir() error!");
duk_throw(ctx);
}
duk_push_string(... | #include "duktape.h"
#include "mininode.h"
#include "uv.h"
#include <unistd.h>
duk_ret_t mn_bi_os_homedir(duk_context *ctx) {
char buf[PATH_MAX];
size_t len = sizeof(buf);
const int err = uv_os_homedir(buf, &len);
if (err) {
duk_push_string(ctx, "uv_os_homedir() error!");
duk_throw(ctx);
} else {
duk_push_... |
Add Logger for dealloc methods. | ////////////////////////////////////////////////////////////////////////////////
//
// JASPER BLUES
// Copyright 2013 Jasper Blues
// All Rights Reserved.
//
// NOTICE: Jasper Blues permits you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
///... | ////////////////////////////////////////////////////////////////////////////////
//
// JASPER BLUES
// Copyright 2013 Jasper Blues
// All Rights Reserved.
//
// NOTICE: Jasper Blues permits you to use, modify, and distribute this file
// in accordance with the terms of the license agreement accompanying it.
//
///... |
Add compile-time check for bit length of prime field | #ifndef CONSTANTS_H_
#define CONSTANTS_H_
#include <math.h>
#define PRIME_FIELD_BINARY_BIT_LENGTH (64)
#define LIMB_SIZE_IN_BITS (64)
#define LIMB_SIZE_IN_BYTES (LIMB_SIZE_IN_BITS / 8)
#define LIMB_SIZE_IN_HEX (LIMB_SIZE_IN_BITS / 4)
// +1 is important for basic operations like addition that may overflow to the
// n... | #ifndef CONSTANTS_H_
#define CONSTANTS_H_
#include <math.h>
// Modify PRIME_FIELD_BINARY_BIT_LENGTH at will
#define PRIME_FIELD_BINARY_BIT_LENGTH (131)
// Do not modify anything below
#define LIMB_SIZE_IN_BITS (64)
#define LIMB_SIZE_IN_BYTES (LIMB_SIZE_IN_BITS / 8)
#define LIMB_SIZE_IN_HEX (LIMB_SIZE_IN_BITS / 4)
#d... |
Add the decoder and field decoder headers to plugin.h | /*
This file is part of MAMBO, a low-overhead dynamic binary modification tool:
https://github.com/beehive-lab/mambo
Copyright 2013-2016 Cosmin Gorgovan <cosmin at linux-geek dot org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the ... | /*
This file is part of MAMBO, a low-overhead dynamic binary modification tool:
https://github.com/beehive-lab/mambo
Copyright 2013-2016 Cosmin Gorgovan <cosmin at linux-geek dot org>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the ... |
Add a carriage return with the newline | #include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
void disableRawMode() {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
void enableRawMode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disableRawMode);
struct termios r... | #include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <termios.h>
#include <unistd.h>
struct termios orig_termios;
void disableRawMode() {
tcsetattr(STDIN_FILENO, TCSAFLUSH, &orig_termios);
}
void enableRawMode() {
tcgetattr(STDIN_FILENO, &orig_termios);
atexit(disableRawMode);
struct termios r... |
Add missing file from previous commit | #include <magick/api.h>
#include "macros.h"
#include "quantum.h"
void
image_matrix(const Image *image, double **out, ExceptionInfo *ex) {
register long y;
register long x;
register const PixelPacket *p;
unsigned int width = image->columns;
for(y = 0; y < image->rows; ++y) {
p = ACQUIRE_IMA... | |
Rename member field according to the style guide. | // Taken from https://gist.github.com/arvidsson/7231973
#ifndef BITCOIN_REVERSE_ITERATOR_HPP
#define BITCOIN_REVERSE_ITERATOR_HPP
/**
* Template used for reverse iteration in C++11 range-based for loops.
*
* std::vector<int> v = {1, 2, 3, 4, 5};
* for (auto x : reverse_iterate(v))
* std::cout << x << "... | // Taken from https://gist.github.com/arvidsson/7231973
#ifndef BITCOIN_REVERSE_ITERATOR_H
#define BITCOIN_REVERSE_ITERATOR_H
/**
* Template used for reverse iteration in C++11 range-based for loops.
*
* std::vector<int> v = {1, 2, 3, 4, 5};
* for (auto x : reverse_iterate(v))
* std::cout << x << " ";
... |
Fix the documentation main page | /** \file
* This file only exists to contain the front-page of the documentation
*/
/** \mainpage Documentation of the API if the Tiramisu Compiler
*
* Tiramisu provides few classes to enable users to represent their program:
* - The \ref tiramisu::function class: a function in Tiramisu is equivalent to a functio... | /** \file
* This file only exists to contain the front-page of the documentation
*/
/** \mainpage Documentation of the Tiramisu Compiler API
*
* Tiramisu provides few classes to enable users to represent their program:
* - The \ref tiramisu::function class: used to declare Tiramisu functions. A function in Tiram... |
Rename MBArtist to MbArtist to make it compile. | /* Get artist by id.
*
* Usage:
* getartist 'artist id'
*
* $Id$
*/
#include <stdio.h>
#include <musicbrainz3/mb_c.h>
int
main(int argc, char **argv)
{
MBQuery query;
MBArtist artist;
char data[256];
if (argc < 2) {
printf("Usage: getartist 'artist id'\n");
return 1;
}
mb_webservice_init();
... | /* Get artist by id.
*
* Usage:
* getartist 'artist id'
*
* $Id$
*/
#include <stdio.h>
#include <musicbrainz3/mb_c.h>
int
main(int argc, char **argv)
{
MbQuery query;
MbArtist artist;
char data[256];
if (argc < 2) {
printf("Usage: getartist 'artist id'\n");
return 1;
}
mb_webservice_init();
... |
Change comment to eliminate reference to eliminated test double | // MockUIAlertController by Jon Reid, http://qualitycoding.org/about/
// Copyright 2015 Jonathan M. Reid. See LICENSE.txt
#import <UIKit/UIKit.h>
#import "QCOMockPopoverPresentationController.h" // Convenience import instead of @class
/**
Captures QCOMockAlertController arguments.
*/
@interface QCOMockAle... | // MockUIAlertController by Jon Reid, http://qualitycoding.org/about/
// Copyright 2015 Jonathan M. Reid. See LICENSE.txt
#import <UIKit/UIKit.h>
#import "QCOMockPopoverPresentationController.h" // Convenience import instead of @class
/**
Captures mocked UIAlertController arguments.
*/
@interface QCOMockA... |
Fix ARM build in CoreFoundation | //******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LI... | //******************************************************************************
//
// Copyright (c) 2015 Microsoft Corporation. All rights reserved.
//
// This code is licensed under the MIT License (MIT).
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LI... |
Add a default value for TEST_SRCDIR |
#ifndef __CMPTEST_H__
#define __CMPTEST_H__
#include <stdio.h>
#include "sodium.h"
#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp"
#ifdef HAVE_ARC4RANDOM
# undef rand
# define rand(X) arc4random(X)
#endif
FILE *fp_res;
int xmain(void);
int main(void)
{
FILE *fp... |
#ifndef __CMPTEST_H__
#define __CMPTEST_H__
#include <stdio.h>
#include "sodium.h"
#ifndef TEST_SRCDIR
# define TEST_SRCDIR "."
#endif
#define TEST_NAME_RES TEST_NAME ".res"
#define TEST_NAME_OUT TEST_SRCDIR "/" TEST_NAME ".exp"
#ifdef HAVE_ARC4RANDOM
# undef rand
# define rand(X) arc4random(X)
#endif
FILE *fp_r... |
Make vu meter react to trigger level | #include <inttypes.h>
#include "Effect.h"
#include "Inputs.h"
#include "Output.h"
class Channel {
public:
Channel(uint8_t _inputId, Output *_output);
void read(Inputs *inputs);
void setEffect(Effect *newEffect);
void runEffect();
inline Effect *getEffect() {return effect;};
uint8_t inputId;
Effect *effect;
priv... | #include <inttypes.h>
#include "Effect.h"
#include "Inputs.h"
#include "Output.h"
class Channel {
public:
Channel(uint8_t _inputId, Output *_output);
void read(Inputs *inputs);
void setEffect(Effect *newEffect);
void runEffect();
inline Effect *getEffect() {return effect;};
uint8_t inputId;
Effect *effect;
Out... |
Use doubled_t for MIPS defines | /**
* mips.h - all the aliases to MIPS ISA
* @author Aleksandr Misevich
* Copyright 2018 MIPT-MIPS
*/
#ifndef MIPS_H_
#define MIPS_H_
#include <infra/instrcache/instr_cache_memory.h>
#include "mips_instr.h"
struct MIPS
{
using FuncInstr = MIPSInstr;
using Register = MIPSRegister;
using Memory = Inst... | /**
* mips.h - all the aliases to MIPS ISA
* @author Aleksandr Misevich
* Copyright 2018 MIPT-MIPS
*/
#ifndef MIPS_H_
#define MIPS_H_
#include <infra/instrcache/instr_cache_memory.h>
#include "mips_instr.h"
struct MIPS
{
using FuncInstr = MIPSInstr;
using Register = MIPSRegister;
using Memory = Inst... |
Use make_unique in pimpl helper | #ifndef PIMPL_IMPL_H
#define PIMPL_IMPL_H
#include <utility>
template<typename T>
pimpl<T>::pimpl() : m{ new T{} } { }
template<typename T>
template<typename ...Args>
pimpl<T>::pimpl( Args&& ...args )
: m{ new T{ std::forward<Args>(args)... } } { }
template<typename T>
pimpl<T>::~pimpl() { }
template<typename T>... | #ifndef PIMPL_IMPL_H
#define PIMPL_IMPL_H
#include "make_unique.h"
#include <utility>
template<typename T>
pimpl<T>::pimpl() : m{ make_unique<T>() } { }
template<typename T>
template<typename ...Args>
pimpl<T>::pimpl( Args&& ...args )
: m{ make_unique<T>(std::forward<Args>(args)...) } { }
template<typename T>
pim... |
Correct conditional on DD_ERR macro | //
// DDMathParserMacros.h
// DDMathParser
//
// Created by Dave DeLong on 2/19/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DDTypes.h"
#ifndef ERR_ASSERT
#define ERR_ASSERT(_e) NSAssert((_e) != nil, @"NULL out error")
#endif
#ifndef ERR
#define DD_... | //
// DDMathParserMacros.h
// DDMathParser
//
// Created by Dave DeLong on 2/19/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "DDTypes.h"
#ifndef ERR_ASSERT
#define ERR_ASSERT(_e) NSAssert((_e) != nil, @"NULL out error")
#endif
#ifndef DD_ERR
#define ... |
Set up syscall() prototype for HP-UX 9 machines. | #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... |
Mark one function which return value should follow the GET rule | /*
* This file is part of the SDWebImage package.
* (c) Olivier Poitrey <rs@dailymotion.com>
* (c) Fabrice Aneche
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
#import <Foundation/Foundation.h>
#import "SDWebImageCompat.h"
type... | /*
* This file is part of the SDWebImage package.
* (c) Olivier Poitrey <rs@dailymotion.com>
* (c) Fabrice Aneche
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
#import <Foundation/Foundation.h>
#import "SDWebImageCompat.h"
type... |
Make linker script variables accessible | /******************************************************************************
* Copyright (c) 2020 IBM Corporation
* All rights reserved.
* This program and the accompanying materials
* are made available under the terms of the BSD License
* which accompanies this distribution, and is available at
* http://www.... | |
Add test with extra whitespace in macro defintions and invocations. | #define noargs() 1
# define onearg(foo) foo
# define twoargs( x , y ) x y
# define threeargs( a , b , c ) a b c
noargs ( )
onearg ( 2 )
twoargs ( 3 , 4 )
threeargs ( 5 , 6 , 7 )
| |
Add test for variadic invocation with pointers | /* Area: ffi_call
Purpose: Test passing pointers in variable argument lists.
Limitations: none.
PR: none.
Originator: www.frida.re */
/* { dg-do run } */
#include "ffitest.h"
#include <stdarg.h>
typedef void * T;
static T
test_fn (T a, T b, ...)
{
va_list ap;
T c;
va_start (ap, b);
... | |
Put physics FPS to 84 - that's the common value in LX .56. So far it seems it behaves exactly like old LX, needs still testing though. | /*
OpenLieroX
physic simulation interface
code under LGPL
created on 9/2/2008
*/
#ifndef __PHYSICSLX56_H__
#define __PHYSICSLX56_H__
#include "Physics.h"
PhysicsEngine* CreatePhysicsEngineLX56();
#define LX56PhysicsFixedFPS 100
#define LX56PhysicsDT TimeDiff(1000 / LX56PhysicsFixedFPS)
#endif
| /*
OpenLieroX
physic simulation interface
code under LGPL
created on 9/2/2008
*/
#ifndef __PHYSICSLX56_H__
#define __PHYSICSLX56_H__
#include "Physics.h"
PhysicsEngine* CreatePhysicsEngineLX56();
#define LX56PhysicsFixedFPS 84
#define LX56PhysicsDT TimeDiff(1000 / LX56PhysicsFixedFPS)
#endif
|
Fix NSDate property management attribute assign->strong | //
// OpenPGPPublicKey.h
// ObjectivePGP
//
// Created by Marcin Krzyzanowski on 04/05/14.
// Copyright (c) 2014 Marcin Krzyżanowski. All rights reserved.
//
// Tag 6
#import <Foundation/Foundation.h>
#import "PGPTypes.h"
#import "PGPPacketFactory.h"
#import "PGPKeyID.h"
#import "PGPFingerprint.h"
@class PGPMPI;... | //
// OpenPGPPublicKey.h
// ObjectivePGP
//
// Created by Marcin Krzyzanowski on 04/05/14.
// Copyright (c) 2014 Marcin Krzyżanowski. All rights reserved.
//
// Tag 6
#import <Foundation/Foundation.h>
#import "PGPTypes.h"
#import "PGPPacketFactory.h"
#import "PGPKeyID.h"
#import "PGPFingerprint.h"
@class PGPMPI;... |
Update driver version to 5.02.00-k8 | /*
* 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-k7"
| /*
* 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-k8"
|
Update driver version to 5.04.00-k2 | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.04.00-k1"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2013 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.04.00-k2"
|
Fix obvious issue which probably broke build on windows. | #ifndef _LA_LOG_H
#define _LA_LOG_H
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#ifndef _WIN32
#include <syslog.h>
#else
#define LOG_INFO 1
#define LOG_ERR 2
#define LOG_CRIT 3
#endif
#include <time.h>
void la_log_syslog_open();
void la_log(int priority, const char *format, ...);
void la_log_unsuppress... | #ifndef _LA_LOG_H
#define _LA_LOG_H
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#ifndef _WIN32
#include <syslog.h>
#else
#define LOG_DEBUG 0
#define LOG_INFO 1
#define LOG_ERR 2
#define LOG_CRIT 3
#endif
#include <time.h>
void la_log_syslog_open();
void la_log(int priority, const char *format, ...);
vo... |
Add a missing UIKit import. | /*
* This file is part of the FreeStreamer project,
* (C)Copyright 2011-2015 Matias Muhonen <mmu@iki.fi>
* See the file ''LICENSE'' for using the code.
*
* https://github.com/muhku/FreeStreamer
*/
#include "FSFrequencyDomainAnalyzer.h"
#define kFSFrequencyPlotViewMaxCount 64
@interface FSFrequencyPlotView : UI... | /*
* This file is part of the FreeStreamer project,
* (C)Copyright 2011-2015 Matias Muhonen <mmu@iki.fi>
* See the file ''LICENSE'' for using the code.
*
* https://github.com/muhku/FreeStreamer
*/
#import <UIKit/UIKit.h>
#include "FSFrequencyDomainAnalyzer.h"
#define kFSFrequencyPlotViewMaxCount 64
@interface... |
Fix member access issue stopping compile |
#include "logger.h"
#include <stdio.h>
#include <errno.h>
#include <libpp/map-lists.h>
#include <libpp/separators.h>
#include <libtypes/types.h>
Logger
logger__new_( Logger options )
{
if ( options.log == NULL ) {
options.log = logger__default_log;
}
return options;
}
int
logger__default_log(... |
#include "logger.h"
#include <stdio.h>
#include <errno.h>
#include <libpp/map-lists.h>
#include <libpp/separators.h>
#include <libtypes/types.h>
Logger
logger__new_( Logger options )
{
if ( options.log == NULL ) {
options.log = logger__default_log;
}
return options;
}
int
logger__default_log(... |
Use urbit types instead of size_t | /* j/3/xeb.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qc_xeb(u3_atom a)
{
mpz_t a_mp;
if ( __(u3a_is_dog(a)) ) {
u3r_mp(a_mp, a);
size_t log = mpz_sizeinbase(a_mp, 2);
mpz_t b_mp;
mpz_init_set_ui(b_mp, log);
return u3i_mp(b_mp);
}
else {
mpz_init_set_... | /* j/3/xeb.c
**
*/
#include "all.h"
/* functions
*/
u3_noun
u3qc_xeb(u3_atom a)
{
mpz_t a_mp;
if ( __(u3a_is_dog(a)) ) {
u3r_mp(a_mp, a);
c3_d x = mpz_sizeinbase(a_mp, 2);
mpz_t b_mp;
mpz_init_set_ui(b_mp, x);
return u3i_mp(b_mp);
}
else {
mpz_init_set_ui(a_m... |
Add decl of MIN macro | /*
* libvirt-utils.h: misc helper APIs for python binding
*
* Copyright (C) 2013 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 Licens... | /*
* libvirt-utils.h: misc helper APIs for python binding
*
* Copyright (C) 2013 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 Licens... |
Add a test case for bit accurate integer types in llvm-gcc. This is XFAILed for now until llvm-gcc changes are committed. | // RUN: %llvmgcc -S %s -o - /dev/null
// XFAIL: *
#define ATTR_BITS(N) __attribute__((bitwidth(N)))
typedef int ATTR_BITS( 4) My04BitInt;
typedef int ATTR_BITS(16) My16BitInt;
typedef int ATTR_BITS(17) My17BitInt;
typedef int ATTR_BITS(37) My37BitInt;
typedef int ATTR_BITS(65) My65BitInt;
struct MyStruct {
My04Bi... | |
Remove redundant == in Eq | // Copyright 2022 Google LLC
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... | // Copyright 2022 Google LLC
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
Add Cygwin fixes for sched_get_priority_min() and sched_get_priority_max(). |
/*
* Copyright 2005 The Apache Software Foundation or its licensors,
* as applicable.
*
* 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/LICE... |
/*
* Copyright 2005 The Apache Software Foundation or its licensors,
* as applicable.
*
* 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/LICE... |
Add type aliases for Group | /* vim: set filetype=cpp: */
/** Header file for canonpy.
*
* Currently it merely contains the definition of the object structure of the
* classes defined in canonpy. They are put here in case a C API is intended
* to be added for canonpy.
*/
#ifndef DRUDGE_CANONPY_H
#define DRUDGE_CANONPY_H
#include <Python.h... | /* vim: set filetype=cpp: */
/** Header file for canonpy.
*
* Currently it merely contains the definition of the object structure of the
* classes defined in canonpy. They are put here in case a C API is intended
* to be added for canonpy.
*/
#ifndef DRUDGE_CANONPY_H
#define DRUDGE_CANONPY_H
#include <Python.h... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.