Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Revert back to method, since it's not strictly a getter. | //
// PMDisplaySheet.h
// This file is part of the "SWApplicationSupport" project, and is distributed under the MIT License.
//
// Created by Samuel Williams on 10/07/05.
// Copyright 2005 Samuel Williams. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@class SWSheetController;
@protocol SWSheetDelegate
- (void... | //
// PMDisplaySheet.h
// This file is part of the "SWApplicationSupport" project, and is distributed under the MIT License.
//
// Created by Samuel Williams on 10/07/05.
// Copyright 2005 Samuel Williams. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@class SWSheetController;
@protocol SWSheetDelegate
- (void... |
Revert constexpr so that upgrade detection works | #pragma once
// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
constexpr float kCurrentVersion = 1.55f;
// Put a "#define VERSION_SUFFIX 'b'" line here to add a minor version
// ... | #pragma once
// const float in a header file can lead to duplication of the storage
// but I don't really care in this case. Just don't do it with a header
// that is included hundreds of times.
// constexpr might help avoid that, but then it breaks my fragile upgrade-needed
// detection code, so this should be ... |
Add a descriptor for binary streams. | #ifndef TUVOK_BSTREAM_H
#define TUVOK_BSTREAM_H
#include <cstdlib>
struct BStreamDescriptor {
uint64_t elements; ///< number of elements in the stream
size_t components;
size_t width; ///< byte width
bool is_signed;
bool fp; ///< is it floating point?
bool big_endian;
size_t timesteps;
};... | |
Handle MSVC's definition of __cplusplus | /*
* Copyright 2018 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 law ... | /*
* Copyright 2018 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 law ... |
Set ARC property semantics to "copy" for block. | #import <Foundation/Foundation.h>
typedef void (^JCNotificationBannerTapHandlingBlock)();
@interface JCNotificationBanner : NSObject
@property (nonatomic) NSString* title;
@property (nonatomic) NSString* message;
@property (nonatomic, strong) JCNotificationBannerTapHandlingBlock tapHandler;
- (JCNotificationBanner*... | #import <Foundation/Foundation.h>
typedef void (^JCNotificationBannerTapHandlingBlock)();
@interface JCNotificationBanner : NSObject
@property (nonatomic) NSString* title;
@property (nonatomic) NSString* message;
@property (nonatomic, copy) JCNotificationBannerTapHandlingBlock tapHandler;
- (JCNotificationBanner*) ... |
Fix broken LBR fixup code | /*
* User address space access functions.
*
* For licencing details see kernel-base/COPYING
*/
#include <linux/highmem.h>
#include <linux/module.h>
#include <asm/word-at-a-time.h>
#include <linux/sched.h>
/*
* best effort, GUP based copy_from_user() that is NMI-safe
*/
unsigned long
copy_from_user_nmi(void *t... | /*
* User address space access functions.
*
* For licencing details see kernel-base/COPYING
*/
#include <linux/highmem.h>
#include <linux/module.h>
#include <asm/word-at-a-time.h>
#include <linux/sched.h>
/*
* best effort, GUP based copy_from_user() that is NMI-safe
*/
unsigned long
copy_from_user_nmi(void *t... |
Test that a global is marked constant when it can be. | // RUN: %llvmgcc -xc %s -S -o - | grep 'ctor_.* constant '
// The synthetic global made by the CFE for big initializer should be marked
// constant.
void bar();
void foo() {
char Blah[] = "asdlfkajsdlfkajsd;lfkajds;lfkjasd;flkajsd;lkfja;sdlkfjasd";
bar(Blah);
}
| |
Change allocation header member padding type from char to unsigned short | #ifndef STACKALLOCATOR_H
#define STACKALLOCATOR_H
#include "Allocator.h"
class StackAllocator : public Allocator {
protected:
void* m_start_ptr;
std::size_t m_offset;
public:
StackAllocator(const std::size_t totalSize);
virtual ~StackAllocator();
virtual void* Allocate(const std::size_t size, const short align... | #ifndef STACKALLOCATOR_H
#define STACKALLOCATOR_H
#include "Allocator.h"
class StackAllocator : public Allocator {
protected:
void* m_start_ptr;
std::size_t m_offset;
public:
StackAllocator(const std::size_t totalSize);
virtual ~StackAllocator();
virtual void* Allocate(const std::size_t size, const short align... |
Update readstat_lseek header signature on Windows |
int readstat_open(const char *filename);
int readstat_close(int fd);
#ifdef _AIX
off64_t readstat_lseek(int fildes, off64_t offset, int whence);
#else
off_t readstat_lseek(int fildes, off_t offset, int whence);
#endif
readstat_error_t readstat_update_progress(int fd, size_t file_size,
readstat_progress_handle... |
int readstat_open(const char *filename);
int readstat_close(int fd);
#if defined _WIN32 || defined __CYGWIN__
_off64_t readstat_lseek(int fildes, _off64_t offset, int whence);
#elif defined _AIX
off64_t readstat_lseek(int fildes, off64_t offset, int whence);
#else
off_t readstat_lseek(int fildes, off_t offset, int whe... |
Create data directory on startup | #include <stdlib.h>
#include <pwd.h>
#include <string.h>
#include <gtk/gtk.h>
#include "gh-main-window.h"
char *
data_dir_path ()
{
uid_t uid = getuid ();
struct passwd *pw = getpwuid (uid);
char *home_dir = pw->pw_dir;
char *data_dir = "/.ghighlighter-c";
int length = strlen (home_dir);
length = length ... | #include <stdlib.h>
#include <pwd.h>
#include <string.h>
#include <sys/stat.h>
#include <gtk/gtk.h>
#include "gh-main-window.h"
char *
data_dir_path ()
{
uid_t uid = getuid ();
struct passwd *pw = getpwuid (uid);
char *home_dir = pw->pw_dir;
char *data_dir = "/.ghighlighter-c";
int length = strlen (home_di... |
Add a protocol for exposing RestKit object mapping and request information with the model implementations. | //
// BCObjectModeling.h
// ClearCostMobile
//
// Created by Seth Kingsley on 2/6/13.
// Copyright (c) 2013 Monkey Republic Design, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
@class RKObjectMapping, RKObjectManager;
@protocol BCObjectModeling <NSObject>
+ (RKObjectMapping *)objectMapping;
+ ... | |
Add a note about clearing complex_hilbert's imaginary input | #ifndef ALCOMPLEX_H
#define ALCOMPLEX_H
#include <complex>
#include "alspan.h"
/**
* Iterative implementation of 2-radix FFT (In-place algorithm). Sign = -1 is
* FFT and 1 is iFFT (inverse). Fills the buffer with the Discrete Fourier
* Transform (DFT) of the time domain data stored in the buffer. The buffer is
*... | #ifndef ALCOMPLEX_H
#define ALCOMPLEX_H
#include <complex>
#include "alspan.h"
/**
* Iterative implementation of 2-radix FFT (In-place algorithm). Sign = -1 is
* FFT and 1 is iFFT (inverse). Fills the buffer with the Discrete Fourier
* Transform (DFT) of the time domain data stored in the buffer. The buffer is
*... |
Remove superfluous call to OPENSSL_cpuid_setup | /*
* Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... | /*
* Copyright 2001-2018 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/l... |
Add preprocessor check to determine enabled roles are valid | #ifndef MBED_BLE_ROLES_H__
#define MBED_BLE_ROLES_H__
#ifdef BLE_ROLE_PERIPHERAL
#ifndef BLE_ROLE_OBSERVER
#error "BLE role 'PERIPHERAL' depends on role 'OBSERVER'"
#endif // BLE_ROLE_OBSERVER
#endif // BLE_ROLE_PERIPHERAL
#ifdef BLE_ROLE_CENTRAL
#ifndef BLE_ROLE_BROADCASTER
#error "BLE ro... | |
Use aligned(LINE_SIZE_BYTES) attribute instead of manually adjusted padding | #ifndef __THREAD_INFO_H
#define __THREAD_INFO_H
#include "globals.h"
#include "sift_writer.h"
#include "bbv_count.h"
#include "pin.H"
#include <deque>
typedef struct {
Sift::Writer *output;
std::deque<ADDRINT> *dyn_address_queue;
Bbv *bbv;
UINT64 thread_num;
ADDRINT bbv_base;
UINT64 bbv_count;
A... | #ifndef __THREAD_INFO_H
#define __THREAD_INFO_H
#include "globals.h"
#include "sift_writer.h"
#include "bbv_count.h"
#include "pin.H"
#include <deque>
typedef struct {
Sift::Writer *output;
std::deque<ADDRINT> *dyn_address_queue;
Bbv *bbv;
UINT64 thread_num;
ADDRINT bbv_base;
UINT64 bbv_count;
A... |
Include header file changes missed from last checkin | /**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
#ifdef USE_TI_UISCROLLABLEVIEW
#import "TiUIView.h"
@interface TiUIScrollableVie... | /**
* Appcelerator Titanium Mobile
* Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
#ifdef USE_TI_UISCROLLABLEVIEW
#import "TiUIView.h"
@interface TiUIScrollableVie... |
Add Chapter 27, exercise 13 | /* Chapter 27, exercise 13: define an input operation that reads an arbitrarily
long sequence of whitespace-terminated characters into a zero-terminated
array of chars */
#include<stdlib.h>
#include<string.h>
#include<stdio.h>
#include<ctype.h>
char* get_word()
{ int max = 8;
char* word = (char*)malloc(ma... | |
Use the correct format specifier for size_t in fz_strdup. | #include "fitz_base.h"
void * fz_malloc(int n)
{
void *p = malloc(n);
if (!p)
fz_throw("cannot malloc %d bytes", n);
return p;
}
void * fz_realloc(void *p, int n)
{
void *np = realloc(p, n);
if (np == nil)
fz_throw("cannot realloc %d bytes", n);
return np;
}
void fz_free(void *p)
{
free... | #include "fitz_base.h"
void * fz_malloc(int n)
{
void *p = malloc(n);
if (!p)
fz_throw("cannot malloc %d bytes", n);
return p;
}
void * fz_realloc(void *p, int n)
{
void *np = realloc(p, n);
if (np == nil)
fz_throw("cannot realloc %d bytes", n);
return np;
}
void fz_free(void *p)
{
free... |
Remove usage of a deprecated TestServer constructor. | // Copyright (c) 2006-2008 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 WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__
#define WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__
#include "net/base/load_flags.h"
#include "net/test/te... | // Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__
#define WEBKIT_GLUE_UNITTEST_TEST_SERVER_H__
#include "net/base/load_flags.h"
#include "net/test/test_se... |
Structure to hold average energies for each cell. Should be sendt to OCDB via the shuttle. | #ifndef ALIHLTPHOSNODULECELLAVERAGEENERGYDATASTRUCT_H
#define ALIHLTPHOSNODULECELLAVERAGEENERGYDATASTRUCT_H
/***************************************************************************
* Copyright(c) 2007, ALICE Experiment at CERN, All rights reserved. *
* ... | |
Add 'extern' declaration to strict equality test block | // Copyright 2014-present 650 Industries.
// Copyright 2014-present Andrew Toulouse.
#import <Foundation/Foundation.h>
@class BKDelta;
typedef BOOL (^delta_calculator_equality_test_t)(id a, id b);
const delta_calculator_equality_test_t BKDeltaCalculatorStrictEqualityTest;
@interface BKDeltaCalculator : NSObject
+... | // Copyright 2014-present 650 Industries.
// Copyright 2014-present Andrew Toulouse.
#import <Foundation/Foundation.h>
@class BKDelta;
typedef BOOL (^delta_calculator_equality_test_t)(id a, id b);
extern const delta_calculator_equality_test_t BKDeltaCalculatorStrictEqualityTest;
@interface BKDeltaCalculator : NSOb... |
Add documentation link to article on runloop | // OCHamcrest by Jon Reid, http://qualitycoding.org/about/
// Copyright 2016 hamcrest.org. See LICENSE.txt
#import <Foundation/Foundation.h>
/*!
* @abstract Runs runloop until fulfilled, or timeout is reached.
*/
@interface HCRunloopRunner : NSObject
- (instancetype)initWithFulfillmentBlock:(BOOL (^)())fulfillm... | // OCHamcrest by Jon Reid, http://qualitycoding.org/about/
// Copyright 2016 hamcrest.org. See LICENSE.txt
#import <Foundation/Foundation.h>
/*!
* @abstract Runs runloop until fulfilled, or timeout is reached.
* @discussion Based on http://bou.io/CTTRunLoopRunUntil.html
*/
@interface HCRunloopRunner : NSObject
... |
Add some sample code for efi_get_next_variable_name() | /*
* libefivar - library for the manipulation of EFI variables
* Copyright 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.... | /*
* libefivar - library for the manipulation of EFI variables
* Copyright 2012 Red Hat, Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License.... |
Fix for Solaris type conversion. | /*
* ClusteredPoller
*
* Created by Jakob Borg.
* Copyright 2011 Nym Networks. See LICENSE for terms.
*/
#include "cltime.h"
#include <stddef.h>
#include <sys/time.h>
curms_t curms(void)
{
struct timeval now;
gettimeofday(&now, NULL);
return now.tv_sec * 1000 + now.tv_usec / 1000;
}
| /*
* ClusteredPoller
*
* Created by Jakob Borg.
* Copyright 2011 Nym Networks. See LICENSE for terms.
*/
#include "cltime.h"
#include <stddef.h>
#include <sys/time.h>
curms_t curms(void)
{
struct timeval now;
gettimeofday(&now, NULL);
return (curms_t) now.tv_sec * 1000 + (curms_t) now... |
Add @private indicator to instance variable. | //
// FileSystem.h
// arc
//
// Created by Jerome Cheng on 19/3/13.
// Copyright (c) 2013 nus.cs3217. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Folder.h"
@interface FileSystem : NSObject {
Folder *_rootFolder; // The root folder.
}
// Returns the root folder of the entire file system... | //
// FileSystem.h
// arc
//
// Created by Jerome Cheng on 19/3/13.
// Copyright (c) 2013 nus.cs3217. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "Folder.h"
@interface FileSystem : NSObject {
@private
Folder *_rootFolder; // The root folder.
}
// Returns the root folder of the entir... |
Use stdint.h for unsigned integer typedefs | #ifndef _ARDUINO_COMPAT_H
#define _ARDUINO_COMPAT_H
#include <stdio.h>
#include <stdlib.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
#include <iostream>
using namespace std;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsi... | #ifndef _ARDUINO_COMPAT_H
#define _ARDUINO_COMPAT_H
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
//#include <sys/types.h>
//#include <sys/stat.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
#include <iostream>
using namespace std;
typedef bool boolean;
typedef iostream Stream;
#endif
|
Add original source from 2014. Split from 9tcfg. | #include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/stat.h>
void
usage(char *progname)
{
printf("usage: %s filename [address]\n", progname);
}
void
prepare_filebuf(char **fb, long size)
{
*fb = (char*) malloc(size);
}
int
main(int argc, char *argv[])
{
int fd;
struct stat... | |
Add daemon to touch down all touched objects in the background | /*
* 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 example of C++ 'static const' issue | /*
* C++ 'static const' works differently from C 'static const'.
* This example compiles with gcc but not with g++. G++ will
* issue errors.
*/
/*
$ g++ -o /tmp/foo cxx_static_const.c -lm
cxx_static_const.c:2:26: error: uninitialized const ‘N1’ [-fpermissive]
static const struct node N1;
... | |
Make it more ovious we are not incrementing and decrementing chars | #include <stdio.h>
main() {
char ch0 = 'a';
char ch1 = 'b';
char ch2 = 'c';
char *p = &ch1;
printf("%d, %c, %c\n", p, *p, ch1);
++p;
printf("%d, %c, %c\n", p, *p, ch1);
printf("%d, %d, %d\n", &ch0, &ch1, &ch2); // Prevent the compiler from optimizing away the char constants
}
| #include <stdio.h>
main() {
char ch0 = 'e';
char ch1 = 'v';
char ch2 = 'i';
char *p = &ch1;
printf("%d, %c, %c\n", p, *p, ch1);
++p;
printf("%d, %c, %c\n", p, *p, ch1);
printf("%d, %d, %d\n", &ch0, &ch1, &ch2); // Prevent the compiler from optimizing away the char constants
}
|
Test case for noinline attribute. | // RUN: %llvmgxx -c -emit-llvm %s -o - | llvm-dis | grep llvm.noinline
int bar(int x, int y); __attribute__((noinline))
int bar(int x, int y)
{
return x + y;
}
int foo(int a, int b) {
return bar(b, a);
}
| |
Add the AutoFillDialog header, needed by the cross-platform implementations to implement the autofill dialog. | // Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_
#define CHROME_BROWSER_AUTOFILL_AUTOFILL_DIALOG_H_
#include <vector>
#include "chrome/browser/aut... | |
Add AIX specific include files. | #ifndef _CONDOR_GETMNT_H
#define _CONDOR_GETMNT_H
#if defined(ULTRIX42) || defined(ULTRIX43)
#include <sys/mount.h>
#endif
#if !defined(OSF1)
#include <mntent.h>
#endif
#if !defined(NMOUNT)
#define NMOUNT 256
#endif
#if !defined(ULTRIX42) && !defined(ULTRIX43)
struct fs_data_req {
dev_t dev;
char *devname;
char ... | #ifndef _CONDOR_GETMNT_H
#define _CONDOR_GETMNT_H
#if defined(ULTRIX42) || defined(ULTRIX43)
#include <sys/mount.h>
#endif
#if !defined(OSF1) && !defined(AIX32)
#include <mntent.h>
#endif
#if defined(AIX32)
# include <sys/mntctl.h>
# include <sys/vmount.h>
# include <sys/sysmacros.h>
#endif
#if !defined(NMOUNT)
#de... |
Use the VTK wrapping of the string class header file. | // -*- c++ -*-
/*=========================================================================
Program: Visualization Toolkit
Module: Tokenizer.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This s... | // -*- c++ -*-
/*=========================================================================
Program: Visualization Toolkit
Module: Tokenizer.h
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
All rights reserved.
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
This s... |
Test that we're not forwarding on -g options to the non integrated assembler. | // Check that we don't try to forward -Xclang or -mlinker-version to GCC.
// PR12920 -- Check also we may not forward W_Group options to GCC.
//
// RUN: %clang -target powerpc-unknown-unknown \
// RUN: %s \
// RUN: -Wall -Wdocumentation \
// RUN: -Xclang foo-bar \
// RUN: -march=x86_64 \
// RUN: -mlinker-vers... | // Check that we don't try to forward -Xclang or -mlinker-version to GCC.
// PR12920 -- Check also we may not forward W_Group options to GCC.
//
// RUN: %clang -target powerpc-unknown-unknown \
// RUN: %s \
// RUN: -Wall -Wdocumentation \
// RUN: -Xclang foo-bar \
// RUN: -march=x86_64 \
// RUN: -mlinker-vers... |
Include the necessary headers to make the swift-runtime-reporting test work. | // library.h
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBU... | // library.h
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
// See https://swift.org/CONTRIBU... |
Resolve compilation issue due to missing math.h inclusion | /*
* Modified version of Keypoint.h
* Source location: https://github.com/pippy360/transformationInvariantImageSearch/blob/master/fullEndToEndDemo/src/Keypoint.h
*/
#pragma once
#ifndef REVERSE_IMAGE_SEARCH_KEYPOINT_H
#define REVERSE_IMAGE_SEARCH_KEYPOINT_H
#include <iostream>
#include <sstream>
using namespace std... | /*
* Modified version of Keypoint.h
* Source location: https://github.com/pippy360/transformationInvariantImageSearch/blob/master/fullEndToEndDemo/src/Keypoint.h
*/
#pragma once
#ifndef REVERSE_IMAGE_SEARCH_KEYPOINT_H
#define REVERSE_IMAGE_SEARCH_KEYPOINT_H
#include <iostream>
#include <sstream>
#include <math.h>
u... |
Add prototype to judge marked point | #ifndef _FAKE_LOCK_SCREEN_PATTERN_H_
#define _FAKE_LOCK_SCREEN_PATTERN_H_
#include <gtk/gtk.h>
#if !GTK_CHECK_VERSION(3, 0, 0)
typedef struct {
gdouble red;
gdouble green;
gdouble blue;
gdouble alpha;
} GdkRGBA;
#endif
void flsp_draw_circle(cairo_t *context,
gint x, gint y, gint radius,... | #ifndef _FAKE_LOCK_SCREEN_PATTERN_H_
#define _FAKE_LOCK_SCREEN_PATTERN_H_
#include <gtk/gtk.h>
#if !GTK_CHECK_VERSION(3, 0, 0)
typedef struct {
gdouble red;
gdouble green;
gdouble blue;
gdouble alpha;
} GdkRGBA;
#endif
void flsp_draw_circle(cairo_t *context,
gint x, gint y, gint radius,... |
Fix a memory leak in tests | /*
* Copyright © 2009 CNRS
* Copyright © 2009-2010 INRIA
* Copyright © 2009-2010 Université Bordeaux 1
* See COPYING in top-level directory.
*/
#include <private/config.h>
#include <hwloc.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
int main(void)
{
hwloc_topology_t topolo... | /*
* Copyright © 2009 CNRS
* Copyright © 2009-2010 INRIA
* Copyright © 2009-2010 Université Bordeaux 1
* See COPYING in top-level directory.
*/
#include <private/config.h>
#include <hwloc.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
int main(void)
{
hwloc_topology_t topolo... |
Add convenience functions for UART0 | #ifndef _UART_H_
#define _UART_H_
#include "mk20dx256.h"
void uart_setup(UART_MemMapPtr base, int baud);
void uart_putchar(UART_MemMapPtr base, char ch);
void uart_putline(UART_MemMapPtr base, char * str);
#endif
| #ifndef _UART_H_
#define _UART_H_
#include "mk20dx256.h"
#include "pins.h"
void uart_setup(UART_MemMapPtr base, int baud);
void uart_putchar(UART_MemMapPtr base, char ch);
void uart_putline(UART_MemMapPtr base, char * str);
/*
* Convenience function to setup UART0 on pins 0 and 1 with 115200 baud
*/
inline static... |
Make powerpc compile. Needs this header... | /* Copyright (C) 1995, 1996, 1997, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version ... | |
Remove absolute path from r202733. | // RUN: rm -f %t
// RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.dia > /dev/null 2>&1
// RUN: c-index-test -read-diagnostics %t.dia 2>&1 | FileCheck %s
// RUN: c-index-test -read-diagnostics %S/Inputs/serialized-diags-stable.dia 2>&1 | FileCheck %s
int foo() {
// CHECK: serialized-diags-stable.... | // RUN: rm -f %t
// RUN: not %clang -Wall -fsyntax-only %s --serialize-diagnostics %t.dia > /dev/null 2>&1
// RUN: c-index-test -read-diagnostics %t.dia 2>&1 | FileCheck %s
// RUN: c-index-test -read-diagnostics %S/Inputs/serialized-diags-stable.dia 2>&1 | FileCheck %s
int foo() {
// CHECK: serialized-diags-stable.... |
Add assertion about result of multiplication to test | #include<stdio.h>
#include<assert.h>
int main() {
int i,k,j;
if (k == 5) {
assert(k == 5);
return 0;
}
assert(k != 5);
// simple arithmetic
i = k + 1;
assert(i != 6);
i = k - 1;
assert(i != 4);
i = k * 2;
assert(i != 10); // UNKNOWN! k could be -2147483643;
i = k / 2;
assert(i != 2)... | #include<stdio.h>
#include<assert.h>
int main() {
int i,k,j;
if (k == 5) {
assert(k == 5);
return 0;
}
assert(k != 5);
// simple arithmetic
i = k + 1;
assert(i != 6);
i = k - 1;
assert(i != 4);
i = k * 3; // multiplication with odd numbers is injective
assert(i != 15);
i = k * 2... |
Raise limit on number of filter bands. | #include <objlib.h>
#define MAXFILTS 30
class VOCODE2 : public Instrument {
int skip, numfilts, branch;
float amp, aamp, pctleft, noise_amp, hipass_mod_amp;
float *in, *amparray, amptabs[2];
SubNoiseL *noise;
Butter *modulator_filt[MAXFILTS], *carrier_filt[MAXFILTS], *hipassmod;
Bal... | #include <objlib.h>
#define MAXFILTS 200
class VOCODE2 : public Instrument {
int skip, numfilts, branch;
float amp, aamp, pctleft, noise_amp, hipass_mod_amp;
float *in, *amparray, amptabs[2];
SubNoiseL *noise;
Butter *modulator_filt[MAXFILTS], *carrier_filt[MAXFILTS], *hipassmod;
Ba... |
Add macro to set static members on lua classes | /*ckwg +5
* Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
* KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
* Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
*/
#ifndef VISTK_LUA_PIPELINE_LUA_STATIC_MEMBER_H
#define VISTK_LUA_PIPELINE_LUA_STATIC_MEMBER_H... | |
Handle lld not being found in PATH. | // RUN: %clang -### -target amdgcn--amdhsa -x assembler -mcpu=kaveri %s 2>&1 | FileCheck -check-prefix=AS_LINK %s
// AS_LINK: bin/clang{{.*}} "-cc1as"
// AS_LINK: bin/lld{{.*}} "-flavor" "gnu" "-target" "amdgcn--amdhsa"
| // RUN: %clang -### -target amdgcn--amdhsa -x assembler -mcpu=kaveri %s 2>&1 | FileCheck -check-prefix=AS_LINK %s
// AS_LINK: bin/clang{{.*}} "-cc1as"
// AS_LINK: lld{{.*}} "-flavor" "gnu" "-target" "amdgcn--amdhsa"
|
Add regression test for r305179. | // test for r305179
// RUN: %clang_cc1 -emit-llvm -O -mllvm -print-after-all %s -o %t 2>&1 | grep '*** IR Dump After Function Integration/Inlining ***'
void foo() {}
| |
Add this FreeBSD standard header. | /*
* Copyright (c) 2002 David O'Brien <obrien@FreeBSD.org>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notic... | |
Test now passes. I'll hold off merging it with the BasicStore test until we know this is a stable change. | // RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=region %s
// XFAIL
struct tea_cheese { unsigned magic; };
typedef struct tea_cheese kernel_tea_cheese_t;
extern kernel_tea_cheese_t _wonky_gesticulate_cheese;
// This test case exercises the ElementRegion::getRValueType() logic.
void foo( void )
{
k... | // RUN: clang-cc -verify -analyze -checker-cfref -analyzer-store=region %s
struct tea_cheese { unsigned magic; };
typedef struct tea_cheese kernel_tea_cheese_t;
extern kernel_tea_cheese_t _wonky_gesticulate_cheese;
// This test case exercises the ElementRegion::getRValueType() logic.
void foo( void )
{
kernel_tea... |
Disable SPI/Timer/RTC hal from microbit board. | #ifndef NRF51_HAL_CONF_H__
#define NRF51_HAL_CONF_H__
#define HAL_UART_MODULE_ENABLED
#define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
#define HAL_RTC_MODULE_ENABLED
#define HAL_TIMER_MODULE_ENABLED
#endif // NRF51_HAL_CONF_H__
| #ifndef NRF51_HAL_CONF_H__
#define NRF51_HAL_CONF_H__
#define HAL_UART_MODULE_ENABLED
// #define HAL_SPI_MODULE_ENABLED
#define HAL_TIME_MODULE_ENABLED
// #define HAL_RTC_MODULE_ENABLED
// #define HAL_TIMER_MODULE_ENABLED
#endif // NRF51_HAL_CONF_H__
|
Fix constness to avoid a compiler warning. | /* +
*/
#include "dpl/acc.h"
#include "dpl/defs.h"
#include "dpl/utils.h"
int dpl_acc_durance (DplIter *iter, time_t *dur)
{
DplEntry *task;
*dur = 0;
time_t begin, end;
while (dpl_iter_next (iter, &task) == DPL_OK) {
dpl_entry_begin_get (task, &begin);
DPL_FORWARD_ERROR (dpl_entry_... | /* +
*/
#include "dpl/acc.h"
#include "dpl/defs.h"
#include "dpl/utils.h"
int dpl_acc_durance (DplIter *iter, time_t *dur)
{
const DplEntry *task;
*dur = 0;
time_t begin, end;
while (dpl_iter_next (iter, &task) == DPL_OK) {
dpl_entry_begin_get (task, &begin);
DPL_FORWARD_ERROR (dpl_... |
Add API for datatype conversion. | #ifndef _NPY_ARRAY_CONVERT_DATATYPE_H_
#define _NPY_ARRAY_CONVERT_DATATYPE_H_
NPY_NO_EXPORT PyObject *
PyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran);
#endif
| #ifndef _NPY_ARRAY_CONVERT_DATATYPE_H_
#define _NPY_ARRAY_CONVERT_DATATYPE_H_
NPY_NO_EXPORT PyObject *
PyArray_CastToType(PyArrayObject *mp, PyArray_Descr *at, int fortran);
NPY_NO_EXPORT int
PyArray_CastTo(PyArrayObject *out, PyArrayObject *mp);
NPY_NO_EXPORT PyArray_VectorUnaryFunc *
PyArray_GetCastFunc(PyArray_De... |
Define the board height and width. | #include <stdlib.h>
/**
* @author: Hendrik Werner
*/
typedef struct Position {
int row;
int col;
} Position;
int main() {
return EXIT_SUCCESS;
}
| #include <stdlib.h>
/**
* @author: Hendrik Werner
*/
#define BOARD_HEIGHT 50
#define BOARD_WIDTH 50
typedef struct Position {
int row;
int col;
} Position;
int main() {
return EXIT_SUCCESS;
}
|
Fix a Hand type compiling errors in GNU compiler | #ifndef PHEVALUATOR_HAND_H
#define PHEVALUATOR_HAND_H
#ifdef __cplusplus
#include <vector>
#include <array>
#include <string>
#include "card.h"
namespace phevaluator {
class Hand {
public:
Hand() {}
Hand(const std::vector<Card>& cards);
Hand(const Card& card);
Hand& operator+=(const Card& card);
Hand o... | #ifndef PHEVALUATOR_HAND_H
#define PHEVALUATOR_HAND_H
#ifdef __cplusplus
#include <vector>
#include <array>
#include <string>
#include "card.h"
namespace phevaluator {
class Hand {
public:
Hand() {}
Hand(const std::vector<Card>& cards);
Hand(const Card& card);
Hand& operator+=(const Card& card);
Hand o... |
Add comment to Attack() return values |
#pragma once
#include "Monster.h"
class cAggressiveMonster :
public cMonster
{
typedef cMonster super;
public:
cAggressiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height);
virtual void Tick (... |
#pragma once
#include "Monster.h"
class cAggressiveMonster :
public cMonster
{
typedef cMonster super;
public:
cAggressiveMonster(const AString & a_ConfigName, eMonsterType a_MobType, const AString & a_SoundHurt, const AString & a_SoundDeath, double a_Width, double a_Height);
virtual void Tick (... |
Update driver version to 5.02.00-k13 | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2010 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k12"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2010 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k13"
|
REMOVE syns state from Door | #ifndef SSPAPPLICATION_ENTITIES_DOORENTITY_H
#define SSPAPPLICATION_ENTITIES_DOORENTITY_H
#include "Entity.h"
#include <vector>
struct DoorSyncState {
int entityID;
bool isOpened;
};
struct ElementState {
int entityID;
EVENT desiredState;
bool desiredStateReached;
};
class DoorEntity :
public Entity
{
private:... | #ifndef SSPAPPLICATION_ENTITIES_DOORENTITY_H
#define SSPAPPLICATION_ENTITIES_DOORENTITY_H
#include "Entity.h"
#include <vector>
struct ElementState {
int entityID;
EVENT desiredState;
bool desiredStateReached;
};
class DoorEntity :
public Entity
{
private:
std::vector<ElementState> m_subjectStates;
bool m_is... |
Set MIDPOINT to 90 instead of 128 (servo lib goes from 0 to 180) | #ifndef __MOTORS_H_
#define __MOTORS_H_
#include <Servo.h>
#define MIDPOINT 128
class Motors {
private:
Servo port, vertical, starbord;
int port_pin, vertical_pin, starbord_pin;
public:
Motors(int p_pin, int v_pin, int s_pin);
void reset();
void go(int p, int v, int s);
void stop(... | #ifndef __MOTORS_H_
#define __MOTORS_H_
#include <Servo.h>
#define MIDPOINT 90
class Motors {
private:
Servo port, vertical, starbord;
int port_pin, vertical_pin, starbord_pin;
public:
Motors(int p_pin, int v_pin, int s_pin);
void reset();
void go(int p, int v, int s);
void stop()... |
Add TypeSet type as set of Types | /*
* opencog/atoms/base/types.h
*
* Copyright (C) 2002-2007 Novamente LLC
* All Rights Reserved
*
* Written by Thiago Maia <thiago@vettatech.com>
* Andre Senna <senna@vettalabs.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero Gener... | /*
* opencog/atoms/base/types.h
*
* Copyright (C) 2002-2007 Novamente LLC
* All Rights Reserved
*
* Written by Thiago Maia <thiago@vettatech.com>
* Andre Senna <senna@vettalabs.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Affero Gener... |
Configure internal regulators at startup | /* mbed Microcontroller Library
* Copyright (c) 2021 ARM Limited
* Copyright (c) 2021 Embedded Planet, Inc.
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the L... | |
Add override specifier to the destructor. | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | /* Copyright 2018 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
Allow hard reset of an object by destructing and recreating | #include <kotaka/paths.h>
#include <game/paths.h>
#include <kotaka/log.h>
inherit LIB_WIZBIN;
atomic void main(string args)
{
proxy_call("destruct_object", args);
proxy_call("compile_object", args);
}
| |
Fix incorrect usage of 2 different clocks to a single uniform clock | #pragma once
#include <chrono>
#include <functional>
#include <thread>
#include <atomic>
class Tick
{
public:
Tick(std::chrono::microseconds timeBetweenTicks,
std::function<void()>&& onTick)
: timeBetweenTicks_(timeBetweenTicks)
, onTick_(std::move(onTick))
, active_(true)
... | #pragma once
#include <chrono>
#include <functional>
#include <thread>
#include <atomic>
using Clock = std::chrono::steady_clock;
class Tick
{
public:
Tick(std::chrono::microseconds timeBetweenTicks,
std::function<void()>&& onTick)
: timeBetweenTicks_(timeBetweenTicks)
, onTick_(std::mov... |
Reduce Even More Memory Usage | #ifndef CUBE_H
#define CUBE_H
#include "stdafx.h"
using namespace std;
class Cube
{
public:
typedef float * Array;
//static
int locAmbient, locDiffuse, locSpecular, locEyeLight, locLight, locTexture;
//static
int locMVP, locMV, locNM;
int numFrame;
GLuint shader, textureID;
static bool readTexture;//, ... | #ifndef CUBE_H
#define CUBE_H
#include "stdafx.h"
using namespace std;
class Cube
{
public:
typedef float * Array;
static int locAmbient, locDiffuse, locSpecular, locEyeLight, locLight, locTexture;
static int locMVP, locMV, locNM;
int numFrame;
static GLuint shader, textureID;
static bool readTexture, read... |
Remove Wcatch-value and unify way to check if files are read. | #ifndef TEST_UTILS_H
#define TEST_UTILS_H
#include <fplll.h>
using namespace std;
using namespace fplll;
/**
@brief Read matrix from `input_filename`.
@param A matrix
@param input_filename
@return zero if the file is correctly read, 1 otherwise.
*/
template <class ZT> int read_matrix(ZZ_mat<ZT> &A, cons... | #ifndef TEST_UTILS_H
#define TEST_UTILS_H
#include <fplll.h>
using namespace std;
using namespace fplll;
#define read_file(X, input_filename) {\
ifstream is;\
is.exceptions(std::ifstream::failbit | std::ifstream::badbit);\
try {\
is.open(input_filename);\
is >> X;\
is.close();\
}\
catch (const ... |
Add prototypes for SceGpu MMU functions | /**
* \kernelgroup{SceGpuEs4}
* \usage{psp2kern/gpu_es4.h,SceGpuEs4ForDriver}
*/
#ifndef _PSP2_KERNEL_GPU_ES4_
#define _PSP2_KERNEL_GPU_ES4_
#include <psp2kern/types.h>
#ifdef __cplusplus
extern "C" {
#endif
int PVRSRVGetMiscInfoKM(void *info);
int ksceGpuGetRegisterDump(void *dst, SceSize size);
#ifdef __cplu... | /**
* \kernelgroup{SceGpuEs4}
* \usage{psp2kern/gpu_es4.h,SceGpuEs4ForDriver}
*/
#ifndef _PSP2_KERNEL_GPU_ES4_
#define _PSP2_KERNEL_GPU_ES4_
#include <psp2kern/types.h>
#ifdef __cplusplus
extern "C" {
#endif
int PVRSRVGetMiscInfoKM(void *info);
int ksceGpuGetRegisterDump(void *dst, SceSize size);
int ksceGpuMm... |
Use fscanf to get the number of cities | #include "string.h"
#include "stdio.h"
#include "stdlib.h"
#define DATA_FILE_NAME "nqmq.dat"
#define DATA_LINE_MAX_LEN 80
char **cities;
char *distances;
int main(int argc, char *argv[])
{
// Step 1: Read file into cities array and distances adjacency matrix
char line[DATA_LINE_MAX_LEN];
FILE *data_file;
dat... | #include "string.h"
#include "stdio.h"
#include "stdlib.h"
#define DATA_FILE_NAME "nqmq.dat"
#define DATA_LINE_MAX_LEN 80
char **cities;
char *distances;
int main(int argc, char *argv[])
{
// Step 1: Read file into cities array and distances adjacency matrix
char line[DATA_LINE_MAX_LEN];
FILE *data_file;
int ... |
Add a (public) header to detect common CPU archs. | /*
* This set (target) cpu specific macros:
* - NPY_TARGET_CPU: target CPU type
*/
#ifndef _NPY_CPUARCH_H_
#define _NPY_CPUARCH_H_
#if defined ( _i386_ ) || defined( __i386__ )
/* __i386__ is defined by gcc and Intel compiler on Linux, _i386_ by
VS compiler */
#define NPY_TARGET_CPU NPY... | |
Update ROOT version files to v5.34/24. | #ifndef ROOT_RVersion
#define ROOT_RVersion
/* Version information automatically generated by installer. */
/*
* These macros can be used in the following way:
*
* #if ROOT_VERSION_CODE >= ROOT_VERSION(2,23,4)
* #include <newheader.h>
* #else
* #include <oldheader.h>
* #endif
*
*/
#defin... | #ifndef ROOT_RVersion
#define ROOT_RVersion
/* Version information automatically generated by installer. */
/*
* These macros can be used in the following way:
*
* #if ROOT_VERSION_CODE >= ROOT_VERSION(2,23,4)
* #include <newheader.h>
* #else
* #include <oldheader.h>
* #endif
*
*/
#defin... |
Add guards to avoid multiple includes. | #include <stdio.h>
#define major 1
#define minor 0
#define patch 0
#define ver(arg) #arg
#define ver2(arg) ver(arg)
#define maj ver2(major)
#define min ver2(minor)
#define pat ver2(patch)
#define dot "."
#define VERSION (maj dot min dot pat)
| /*
@file version.h
@brief Defines macros to create version number string
@license MIT LICENSE
@authors
Prakhar Nigam, https://github.com/prakharnigam
electrogeek, https://github.com/Nishant-Mishra
*/
#ifndef __VERSION_H__
#define __VERSION_H__
#ifdef __cplusplus
extern "C" {
#endif
#define major... |
Add a s16 (signed 16-bit int) for symmetry with u8/u16 | #pragma once
#include <cstdint>
#include <cstdlib>
using uint = unsigned int;
using u8 = uint8_t;
using u16 = uint16_t;
using s8 = int8_t;
const int GAMEBOY_WIDTH = 160;
const int GAMEBOY_HEIGHT = 144;
const int CLOCK_RATE = 4194304;
template <typename... T> void unused(T&&...) {}
#define fatal_error() log_error... | #pragma once
#include <cstdint>
#include <cstdlib>
using uint = unsigned int;
using u8 = uint8_t;
using u16 = uint16_t;
using s8 = int8_t;
using s16 = uint16_t;
const int GAMEBOY_WIDTH = 160;
const int GAMEBOY_HEIGHT = 144;
const int CLOCK_RATE = 4194304;
template <typename... T> void unused(T&&...) {}
#define f... |
Remove reference to h5 header | #pragma once
#include <iomanip>
#include "H5Cpp.h"
#include "logger.h"
// N-wide hex output with 0x
template <unsigned int N> std::ostream &hexn(std::ostream &out) {
return out << "0x" << std::hex << std::setw(N) << std::setfill('0');
}
inline int mymod(int a, int b) {
int c = a % b;
if (c < 0)
c += b;
... | #pragma once
#include <iomanip>
#include "logger.h"
// N-wide hex output with 0x
template <unsigned int N> std::ostream &hexn(std::ostream &out) {
return out << "0x" << std::hex << std::setw(N) << std::setfill('0');
}
inline int mymod(int a, int b) {
int c = a % b;
if (c < 0)
c += b;
return c;
}
|
Add new example for gmio_stl_infos_get() | /* -----------------------------------------------------------------------------
*
* Example: read a STL file
*
* Just give a filepath and an initialized gmio_stl_mesh_creator object to
* gmio_stl_read_file().
* The gmio_stl_mesh_creator object holds pointers to the callbacks invoked
* during the read operation.... | |
Add newline to end of file. | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_
#define VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_
namespace views {
namespace interna... | // Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_
#define VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_
namespace views {
namespace interna... |
Change partner preference Int to Bool values | // Copyright (c) 2015 TeamSnap. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "TSDKCollectionObject.h"
#import "TSDKObjectsRequest.h"
@interface TSDKPartnerPreferences : TSDKCollectionObject
@property (nonatomic, assign) NSInteger canDisplayPartner; //Example: 0
@property (nonatomic, strong, null... | // Copyright (c) 2015 TeamSnap. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "TSDKCollectionObject.h"
#import "TSDKObjectsRequest.h"
@interface TSDKPartnerPreferences : TSDKCollectionObject
@property (nonatomic, assign) BOOL canDisplayPartner; //Example: 0
@property (nonatomic, strong, nullable)... |
Add sys/stat.h to headers for mkfifo declaration. | /**
* Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
#ifndef STDAFX_H
#define STDAFX_H
// Common include file for all source code in Util
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Psapi.h>
#ifdef __cpl... | /**
* Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
*
* Please see distribution for license.
*/
#ifndef STDAFX_H
#define STDAFX_H
// Common include file for all source code in Util
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#include <Psapi.h>
#ifdef __cpl... |
Use weak reference in object factory to avoid cyclical references | #import <Foundation/Foundation.h>
@class JSObjectionInjector;
@interface JSObjectFactory : NSObject
@property (nonatomic, readonly, strong) JSObjectionInjector *injector;
- (id)initWithInjector:(JSObjectionInjector *)injector;
- (id)getObject:(id)classOrProtocol;
- (id)objectForKeyedSubscript: (id)key;
- (id)getObje... | #import <Foundation/Foundation.h>
@class JSObjectionInjector;
@interface JSObjectFactory : NSObject
@property (nonatomic, readonly, weak) JSObjectionInjector *injector;
- (id)initWithInjector:(JSObjectionInjector *)injector;
- (id)getObject:(id)classOrProtocol;
- (id)objectForKeyedSubscript: (id)key;
- (id)getObject... |
Add passing of information to prepareforsegue method | //
// ResultsMapViewController.h
// bikepath
//
// Created by Farheen Malik on 8/14/14.
// Copyright (c) 2014 Bike Path. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <GoogleMaps/GoogleMaps.h>
@interface ResultsMapViewController : UIViewController <GMSMapViewDelegate>
@property (strong, nonatomic) IBOut... | //
// ResultsMapViewController.h
// bikepath
//
// Created by Farheen Malik on 8/14/14.
// Copyright (c) 2014 Bike Path. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <GoogleMaps/GoogleMaps.h>
#import "SearchItem.h"
@interface ResultsMapViewController : UIViewController <GMSMapViewDelegate>
@property (s... |
Use quotes for include so that UnitTest header is found locally. | #include <unittest++/UnitTest++.h>
/*
* This file provides a transitive include for the UnitTest++ library
* so that you don't need to remember how to include it yourself. This
* file also provides you with a reference for using UnitTest++.
*
* == BASIC REFERENCE ==
* - TEST(NAME_OF_TEST) { body_of_test }
... | #include "unittest++/UnitTest++.h"
/*
* This file provides a transitive include for the UnitTest++ library
* so that you don't need to remember how to include it yourself. This
* file also provides you with a reference for using UnitTest++.
*
* == BASIC REFERENCE ==
* - TEST(NAME_OF_TEST) { body_of_test }
... |
Add exclamation mark to unknown to indicate it should always be unknown | // PARAM: --set ana.int.interval true --set solver "'td3'"
#include<pthread.h>
#include<assert.h>
int glob1 = 0;
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
int t;
pthread_mutex_lock(&mutex1);
if(t == 42) {
glob1 = 1;
}
t = glob1;
assert(t == 0); //UNKNOWN
assert... | // PARAM: --set ana.int.interval true --set solver "'td3'"
#include<pthread.h>
#include<assert.h>
int glob1 = 0;
pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void *arg) {
int t;
pthread_mutex_lock(&mutex1);
if(t == 42) {
glob1 = 1;
}
t = glob1;
assert(t == 0); //UNKNOWN!
asser... |
Revert "Testing GPG key on github" | #ifndef A_FILTER_HDR
#define A_FILTER_HDR
#include "u_vector.h"
namespace a {
struct source;
struct filterInstance {
virtual void filter(float *buffer, size_t samples, bool strero, float sampleRate) = 0;
virtual ~filterInstance();
};
struct filter {
virtual void init(source *);
virtual filterInstanc... | #ifndef A_FILTER_HDR
#define A_FILTER_HDR
#include "u_vector.h"
namespace a {
struct source;
struct filterInstance {
virtual void filter(float *buffer, size_t samples, bool strero, float sampleRate) = 0;
virtual ~filterInstance();
};
struct filter {
virtual void init(source *audioSource);
virtual fi... |
Add test for var_eq unsoundness with dereferenced floats | // PARAM: --enable ana.int.interval --enable ana.int.def_exc --enable ana.sv-comp.functions --set ana.activated[+] var_eq --set ana.activated[+] region
#include <goblint.h>
int isNan(float arg) {
float x;
return arg != arg;
}
int main(){
struct blub { float f; } s;
float fs[3];
float top;
// ... | // PARAM: --enable ana.int.interval --enable ana.int.def_exc --enable ana.sv-comp.functions --set ana.activated[+] var_eq --set ana.activated[+] region
#include <goblint.h>
int isNan(float arg) {
float x;
return arg != arg;
}
int main(){
struct blub { float f; } s;
float fs[3];
float top;
// ... |
Change Win32 dlerror message to: | /* $PostgreSQL: pgsql/src/backend/port/dynloader/win32.c,v 1.4 2004/11/17 08:30:08 neilc Exp $ */
#include <windows.h>
char *dlerror(void);
int dlclose(void *handle);
void *dlsym(void *handle, const char *symbol);
void *dlopen(const char *path, int mode);
char *
dlerror(void)
{
return "error";
}
int
dlclose(void *... | /* $PostgreSQL: pgsql/src/backend/port/dynloader/win32.c,v 1.5 2004/12/02 19:38:50 momjian Exp $ */
#include <windows.h>
char *dlerror(void);
int dlclose(void *handle);
void *dlsym(void *handle, const char *symbol);
void *dlopen(const char *path, int mode);
char *
dlerror(void)
{
return "dynamic load error";
}
int... |
Fix crash in Scrumptious app. | /*
* Copyright 2012 Facebook
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in w... | /*
* Copyright 2012 Facebook
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in w... |
Change session length to 1h | /*
* Copyright 2016 Adam Chyła, adam@chyla.org
* All rights reserved. Distributed under the terms of the MIT License.
*/
#pragma once
namespace apache
{
namespace analyzer
{
namespace detail
{
constexpr int SESSION_LENGTH = 60;
}
}
}
| /*
* Copyright 2016 Adam Chyła, adam@chyla.org
* All rights reserved. Distributed under the terms of the MIT License.
*/
#pragma once
namespace apache
{
namespace analyzer
{
namespace detail
{
constexpr int SESSION_LENGTH = 3600;
}
}
}
|
Define alphabet and number of tree layers | #include<stdio.h>
#include<stdlib.h>
int main (int argc, char *argv[]){
if(argc != 3){
printf("Number of parameters should be 2 (filename, cardinality).");
exit(1);
}
//open file and get file length
FILE *file;
file = fopen(argv[1],"r");
if(file == NULL){
printf("File c... | #include<stdio.h>
#include<stdlib.h>
#include<math.h>
int main (int argc, char *argv[]){
if(argc != 3){
printf("Number of parameters should be 2 (filename, arity).");
exit(1);
}
int alphabet[128] = {0};
int arity = atoi(argv[2]);
int treeLayers = ceil(7/log2(arity));
printf("Nu... |
Make assert do the right thing | /*
* $Id$
*/
#include <errno.h>
#include <time.h>
/* from libvarnish/argv.c */
void FreeArgv(char **argv);
char **ParseArgv(const char *s, int comment);
/* from libvarnish/time.c */
void TIM_format(time_t t, char *p);
time_t TIM_parse(const char *p);
/* from libvarnish/version.c */
void varnish_version(const char... | /*
* $Id$
*/
#include <errno.h>
#include <time.h>
/* from libvarnish/argv.c */
void FreeArgv(char **argv);
char **ParseArgv(const char *s, int comment);
/* from libvarnish/time.c */
void TIM_format(time_t t, char *p);
time_t TIM_parse(const char *p);
/* from libvarnish/version.c */
void varnish_version(const char... |
Add --without-expat support to ./configure | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (... | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (... |
Replace spaces with "%20" in a string | #include <stdio.h>
int main(int argc, char** argv) {
if (argc < 2) {
printf("Too few arguments\n");
return 1;
}
char* word = argv[1];
// Length AFTER replacing ' ' with "%20", counting '\0'
int rlen = 1;
// Determine length of new word
for (int i = 0; word[i]; ++i) {
... | |
Increase refill and add logging. | // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved.
// Please see the AUTHORS file for details. Use of this source code is governed
// by a BSD license that can be found in the LICENSE file.
#ifndef SCALLOC_ALLOCATORS_PAGE_HEAP_H_
#define SCALLOC_ALLOCATORS_PAGE_HEAP_H_
#include "common.h"... | // Copyright (c) 2012-2013, the scalloc Project Authors. All rights reserved.
// Please see the AUTHORS file for details. Use of this source code is governed
// by a BSD license that can be found in the LICENSE file.
#ifndef SCALLOC_ALLOCATORS_PAGE_HEAP_H_
#define SCALLOC_ALLOCATORS_PAGE_HEAP_H_
#include "common.h"... |
Fix include path to make build work | #ifndef EGLTYPEDEFS_INCLUDED
#define EGLTYPEDEFS_INCLUDED
#include <GL/egl.h>
typedef struct _egl_config _EGLConfig;
typedef struct _egl_context _EGLContext;
typedef struct _egl_display _EGLDisplay;
typedef struct _egl_driver _EGLDriver;
typedef struct _egl_mode _EGLMode;
typedef struct _egl_screen _EGLScreen;... | #ifndef EGLTYPEDEFS_INCLUDED
#define EGLTYPEDEFS_INCLUDED
#include <GLES/egl.h>
typedef struct _egl_config _EGLConfig;
typedef struct _egl_context _EGLContext;
typedef struct _egl_display _EGLDisplay;
typedef struct _egl_driver _EGLDriver;
typedef struct _egl_mode _EGLMode;
typedef struct _egl_screen _EGLScree... |
Clean yacc file, move other functions out of it. | #include <stdio.h>
#include "y.tab.h"
int main(int argc, char ** argv)
{
if(argc > 1)
{
yyin = fopen(argv[1], "r");
if(yyin == NULL)
{
printf("File doesn't exits.\n");
return 1;
}
strcpy(file_name, argv[1]);
if(argc > 2)
{... | #include <stdio.h>
#include "list.h"
#include "syntax.h"
#include "scc_yacc.hpp"
extern FILE * yyin;
extern char *file_content[1024];
extern char file_name[1024];
extern int yyparse();
void read_file()
{
for(int i = 0; !feof(yyin); i++)
{
file_content[i] = (char * )malloc(1024 * sizeof(char));
... |
Move forward decls in right namespace. | #ifndef VAST_UTIL_BROCCOLI_H
#define VAST_UTIL_BROCCOLI_H
#include <ze/fwd.h>
#include "vast/util/server.h"
// Forward declaration.
struct bro_conn;
namespace vast {
namespace util {
namespace broccoli {
struct connection;
typedef util::server<connection> server;
typedef std::function<void(ze::event)> event_handler... | #ifndef VAST_UTIL_BROCCOLI_H
#define VAST_UTIL_BROCCOLI_H
#include <ze/fwd.h>
#include "vast/util/server.h"
namespace vast {
namespace util {
namespace broccoli {
// Forward declarations.
struct bro_conn;
struct connection;
typedef util::server<connection> server;
typedef std::function<void(ze::event)> event_handler... |
Define the user defined functions | /*****************************************************************************
* PROGRAM NAME: CUDFunction.h
* PROGRAMMER: Wei Sun wsun@vt.edu
* PURPOSE: Define the user defined function object
*****************************************************************************/
#ifndef COPASI_CUDFunction
#define COPASI_CUDFu... | |
Split every node into two based on node data | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct node {
int data;
struct node *next;
};
struct node *createNode (int value) {
struct node *newNode = (struct node *) malloc (sizeof (struct node));
newNode -> data = value;
newNode -> next = NULL;
return new... | |
Exit with an error code when an error occurs. | #include <stdio.h>
#include "libsass/sass_interface.h"
int main(int argc, char** argv)
{
if (argc < 2) {
printf("Usage: sassc [INPUT FILE]\n");
return 0;
}
struct sass_file_context* ctx = sass_new_file_context();
ctx->options.include_paths = "";
ctx->options.image_path = "images";
ctx->options.output_style ... | #include <stdio.h>
#include "libsass/sass_interface.h"
int main(int argc, char** argv)
{
int ret;
if (argc < 2) {
printf("Usage: sassc [INPUT FILE]\n");
return 0;
}
struct sass_file_context* ctx = sass_new_file_context();
ctx->options.include_paths = "";
ctx->options.image_path = "images";
ctx->options.ou... |
Add witness lifter path sensitive unsound branch test | // PARAM: --enable ana.sv-comp.enabled --enable ana.sv-comp.functions --set ana.specification 'CHECK( init(main()), LTL(G ! call(reach_error())) )' --enable ana.int.interval
// previously both branches dead
// simplified from 28-race_reach/06-cond_racing1
#include <pthread.h>
#include <assert.h>
int __VERIFIER_nondet_... | |
Add source code documentation for the Prefix Extractor class | //
// RocksDBPrefixExtractor.h
// ObjectiveRocks
//
// Created by Iska on 26/12/14.
// Copyright (c) 2014 BrainCookie. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger, RocksDBPrefixType)
{
RocksDBPrefixFixedLength
};
@interface RocksDBPrefixExtractor : NSObject
+ (instancet... | //
// RocksDBPrefixExtractor.h
// ObjectiveRocks
//
// Created by Iska on 26/12/14.
// Copyright (c) 2014 BrainCookie. All rights reserved.
//
#import <Foundation/Foundation.h>
/**
Constants for the built-in prefix extractors.
*/
typedef NS_ENUM(NSUInteger, RocksDBPrefixType)
{
/** @brief Extract a fixed-lengt... |
Add an MP test that uses imb instead of deps | // Test if message passing works
// Should on x86, not on arm
// Basically always just doesn't see the write at all.
// Probably need to loop.
// On ARM:
// mp - observed
// mp+ctrl - observed
// mp+addr - not observed :( was hoping to
// mp+sync+addr - not observed; good!
#include "atomic.h"
#include <st... | |
Add forgotten function in DX11 implementation |
#ifndef __IM_WINDOW_MANAGER_DX11_H__
#define __IM_WINDOW_MANAGER_DX11_H__
#include "ImwConfig.h"
#include "ImwWindowManager.h"
namespace ImWindow
{
class ImwWindowManagerDX11 : public ImwWindowManager
{
public:
ImwWindowManagerDX11();
virtual ~ImwWindowManagerDX11();
protected:
virtual ImwPlatformWi... |
#ifndef __IM_WINDOW_MANAGER_DX11_H__
#define __IM_WINDOW_MANAGER_DX11_H__
#include "ImwConfig.h"
#include "ImwWindowManager.h"
namespace ImWindow
{
class ImwWindowManagerDX11 : public ImwWindowManager
{
public:
ImwWindowManagerDX11();
virtual ~ImwWindowManagerDX11();
protected:
virtual bool CanC... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.