Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add test for assign as rval |
int
main()
{
int x;
int y;
x = 1;
y = 1;
x = y = 0;
if(x != 0)
return 1;
if(y != 0)
return 1;
return 0;
}
| |
Read and print command line options in 5-3 | // for exit, strtol, EXIT_SUCCESS, EXIT_FAILURE
#include <stdlib.h>
// for fprintf, stderr
#include <stdio.h>
// for bool, true, false
#include <stdbool.h>
/**
* Options from the command line.
*/
struct opts {
/** The filename. */
char * filename;
/** The number of bytes to write. */
int num_bytes;
/** Whethe... | |
Make kernel_execve() suitable for stack unwinding | /*
* This file contains various random system calls that
* have a non-standard calling sequence on the Linux/i386
* platform.
*/
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/smp.h>
#include <linux/sem.h>
#include <linux/msg.h>
#include <linux/shm.h>
... | /*
* This file contains various random system calls that
* have a non-standard calling sequence on the Linux/i386
* platform.
*/
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/smp.h>
#include <linux/sem.h>
#include <linux/msg.h>
#include <linux/shm.h>
... |
Fix Valgrind variable initialization issue. | /* This file is part of VoltDB.
* Copyright (C) 2008-2019 VoltDB Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any la... | /* This file is part of VoltDB.
* Copyright (C) 2008-2019 VoltDB Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any la... |
Add basic implementation of progress bar methods | #pragma once
#include "Control.h"
#include "StatusCallback.h"
class ProgressBar : public Control, public StatusCallback {
public:
ProgressBar(int id, Dialog &parent, bool translate = true) :
Control(id, parent, translate) {
}
protected:
virtual IFACEMETHODIMP OnProgress(
unsigned long ulProg... | #pragma once
#include "Control.h"
#include "StatusCallback.h"
#include <CommCtrl.h>
class ProgressBar : public Control, public StatusCallback {
public:
ProgressBar(int id, Dialog &parent, bool translate = true) :
Control(id, parent, translate) {
}
void Range(int min, int max) {
SendMessage(_... |
CREATE mailbox<hierarchy separator> failed always. | /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "commands.h"
int cmd_create(Client *client)
{
const char *mailbox;
/* <mailbox> */
if (!client_read_string_args(client, 1, &mailbox))
return FALSE;
if (!client_verify_mailbox_name(client, mailbox, FALSE, TRUE))
return TRUE;
if (mailbox[st... | /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "commands.h"
int cmd_create(Client *client)
{
const char *mailbox;
int ignore;
/* <mailbox> */
if (!client_read_string_args(client, 1, &mailbox))
return FALSE;
ignore = mailbox[strlen(mailbox)-1] == client->storage->hierarchy_sep;
if (ignor... |
Convert also 0x80..0x9f characters to '?' | /* Copyright (c) 2004 Timo Sirainen */
#include "lib.h"
#include "str.h"
#include "str-sanitize.h"
void str_sanitize_append(string_t *dest, const char *src, size_t max_len)
{
const char *p;
for (p = src; *p != '\0'; p++) {
if ((unsigned char)*p < 32)
break;
}
str_append_n(dest, src, (size_t)(p - src));
fo... | /* Copyright (c) 2004 Timo Sirainen */
#include "lib.h"
#include "str.h"
#include "str-sanitize.h"
void str_sanitize_append(string_t *dest, const char *src, size_t max_len)
{
const char *p;
for (p = src; *p != '\0'; p++) {
if (((unsigned char)*p & 0x7f) < 32)
break;
}
str_append_n(dest, src, (size_t)(p - s... |
Fix 2f21735 to actually distinguish phases. | //===--- Timer.h - Shared timers for compilation phases ---------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... | //===--- Timer.h - Shared timers for compilation phases ---------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2017 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/L... |
Revert "Add support for the Python Stdout Log" | // Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "ModuleManager.h"
DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All);
class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface
{
public:
bool PythonGILAcquire();
void PythonGILRelease();
virtual void Start... | // Copyright 1998-2016 Epic Games, Inc. All Rights Reserved.
#pragma once
#include "ModuleManager.h"
DECLARE_LOG_CATEGORY_EXTERN(LogPython, Log, All);
class UNREALENGINEPYTHON_API FUnrealEnginePythonModule : public IModuleInterface
{
public:
bool PythonGILAcquire();
void PythonGILRelease();
virtual void Start... |
Use GCC builtins instead of inline asm | #include <stdlib.h>
#include "HsFFI.h"
StgInt* hs_counter_new(void) {
StgInt* counter = malloc(sizeof(StgInt));
*counter = 0;
return counter;
}
void hs_counter_add(volatile StgInt* counter, StgInt n) {
StgInt temp = n;
#if SIZEOF_VOID_P == 8
__asm__ __volatile__("lock; xaddq %0,%1"
#elif SIZEOF_VOID_P == 4
... | #include <stdlib.h>
#include "HsFFI.h"
StgInt* hs_counter_new(void) {
StgInt* counter = malloc(sizeof(StgInt));
*counter = 0;
return counter;
}
void hs_counter_add(volatile StgInt* counter, StgInt n) {
__sync_fetch_and_add(counter, n);
}
StgInt hs_counter_read(volatile const StgInt* counter) {
return *count... |
Revert "tests: Call ssh_init() and ssh_finalize() before we run the tests." | #include <stdio.h>
#include <libssh/libssh.h>
#include "torture.h"
static int verbosity = 0;
int torture_libssh_verbosity(void){
return verbosity;
}
int main(int argc, char **argv) {
int rc;
(void) argc;
(void) argv;
ssh_init();
rc = torture_run_tests();
ssh_finalize();
return rc;... | #include "torture.h"
#include <stdio.h>
static int verbosity = 0;
int torture_libssh_verbosity(void){
return verbosity;
}
int main(int argc, char **argv) {
(void) argc;
(void) argv;
return torture_run_tests();
}
|
Improve test output on failure | #include <mongoc.h>
#include <mongoc-openssl-private.h>
#include "TestSuite.h"
static void
test_extract_subject (void)
{
char *subject;
subject = _mongoc_openssl_extract_subject (BINARY_DIR"/../certificates/client.pem");
ASSERT (0 == strcmp (subject, "CN=client,OU=kerneluser,O=10Gen,L=New York City,ST=New ... | #include <mongoc.h>
#include <mongoc-openssl-private.h>
#include "TestSuite.h"
static void
test_extract_subject (void)
{
char *subject;
subject = mongoc_ssl_extract_subject (BINARY_DIR"/../certificates/client.pem");
ASSERT_CMPSTR (subject, "CN=client,OU=kerneluser,O=10Gen,L=New York City,ST=New York,C=US")... |
Fix for reporting specta/expecta failures on the main thread. | #import <Foundation/Foundation.h>
extern NSString * const spt_kCurrentTestSuiteKey;
extern NSString * const spt_kCurrentSpecKey;
#define SPTCurrentTestSuite [[NSThread currentThread] threadDictionary][spt_kCurrentTestSuiteKey]
#define SPTCurrentSpec [[NSThread currentThread] threadDictionary][spt_kCurrentSpecKey]
#d... | #import <Foundation/Foundation.h>
extern NSString * const spt_kCurrentTestSuiteKey;
extern NSString * const spt_kCurrentSpecKey;
#define SPTCurrentTestSuite [[NSThread mainThread] threadDictionary][spt_kCurrentTestSuiteKey]
#define SPTCurrentSpec [[NSThread mainThread] threadDictionary][spt_kCurrentSpecKey]
#define ... |
Remove + fix erroneous comments | // Dispatches asyncronously unless ARPerformWorkSynchronously is set on the shared dispatch manager
extern void ar_dispatch_async(dispatch_block_t block);
// Dispatches to the main queue unless ARPerformWorkSynchronously is set on the shared dispatch manager
extern void ar_dispatch_main_queue(dispatch_block_t block);
... | extern void ar_dispatch_async(dispatch_block_t block);
extern void ar_dispatch_main_queue(dispatch_block_t block);
// Dispatches to a queue unless ARPerformWorkAsynchronously is set to false
extern void ar_dispatch_on_queue(dispatch_queue_t queue, dispatch_block_t block);
extern void ar_dispatch_after_on_queue(float... |
Add SK_API to null canvas create method | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkNullCanvas_DEFINED
#define SkNullCanvas_DEFINED
#include "SkBitmap.h"
class SkCanvas;
/**
* Creates a canvas that draws nothing. This is useful for performance t... | /*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkNullCanvas_DEFINED
#define SkNullCanvas_DEFINED
#include "SkBitmap.h"
class SkCanvas;
/**
* Creates a canvas that draws nothing. This is useful for performance t... |
Add missing new files for revision 32092 | #include <complex>
#ifndef __hpux
using namespace std;
#endif
#pragma create TClass std::complex<int>+;
#pragma create TClass std::complex<long>+;
#pragma create TClass std::complex<float>+;
#pragma create TClass std::complex<double>+;
#ifdef G__NATIVELONGLONG
#pragma create TClass std::complex<long long>+;
// #pragm... | |
Add a default value for TEST_SRCDIR |
#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... |
#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... |
Define WSAPOLLFD only on mingw 4.x | #ifndef _FIX_WINSOCK2_H
#define _FIX_WINSOCK2_H 1
#include_next <winsock2.h>
typedef struct pollfd {
SOCKET fd;
short events;
short revents;
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLFD;
#endif
| #ifndef _FIX_WINSOCK2_H
#define _FIX_WINSOCK2_H 1
#include_next <winsock2.h>
// mingw 4.0.x has broken headers (#9246) but mingw-w64 does not.
#if defined(__MINGW_MAJOR_VERSION) && __MINGW_MAJOR_VERSION == 4
typedef struct pollfd {
SOCKET fd;
short events;
short revents;
} WSAPOLLFD, *PWSAPOLLFD, *LPWSAPOLLF... |
Add action predicate block typedef | /*
Copyright 2009-2013 Urban Airship Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the f... | /*
Copyright 2009-2013 Urban Airship Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the f... |
Fix compile warning for struct/class mismatch | // Copyright 2016 The Bazel 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 appl... | // Copyright 2016 The Bazel 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 appl... |
Include header where for_each is defined | #ifndef _CPR_TYPES_H_
#define _CPR_TYPES_H_
#include <map>
#include <string>
#include <curl/curl.h>
struct case_insensitive_compare
{
case_insensitive_compare() {}
bool operator()(const std::string& a, const std::string& b) const {
return to_lower(a) < to_lower(b);
}
static void char_to_lo... | #ifndef _CPR_TYPES_H_
#define _CPR_TYPES_H_
#include <algorithm>
#include <map>
#include <string>
#include <curl/curl.h>
struct case_insensitive_compare
{
case_insensitive_compare() {}
bool operator()(const std::string& a, const std::string& b) const {
return to_lower(a) < to_lower(b);
}
s... |
Enable Cord in NVCC build. | /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... | /* Copyright 2015 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
Fix assignment in concrete case for example benchmark so that bug should be deterministic. | #ifdef KLEE
#include "klee/klee.h"
#endif
#include <assert.h>
#include <stdio.h>
int main() {
int a;
#ifdef KLEE
klee_make_symbolic(&a, sizeof(a), "a");
#endif
if (a == 0) {
printf("a is zero\n");
#ifdef BUG
assert(0);
#endif
} else {
printf("a is non-zero\n");
}
return 0;
}
| #ifdef KLEE
#include "klee/klee.h"
#endif
#include <assert.h>
#include <stdio.h>
int main() {
int a = 0;
#ifdef KLEE
klee_make_symbolic(&a, sizeof(a), "a");
#endif
if (a == 0) {
printf("a is zero\n");
#ifdef BUG
assert(0);
#endif
} else {
printf("a is non-zero\n");
}
return 0;
}
|
Include ASEditableTextNode in framework header. | /* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <Async... | /* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
#import <Async... |
Add datatypes for swift to represent source locations and ranges, which are distinct from the SMXXX types. This is important because SMRange and SourceRange have subtly different semantics, and is also nice to isolate SMLoc from swift. | //===- SourceLoc.h - Source Locations and Ranges ----------------*- C++ -*-===//
//
// This source file is part of the Swift.org open source project
//
// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See http://swift.org/LI... | |
Introduce USB target raw device accessor | #pragma once
#include "ntddk.h"
#include "wdf.h"
#include "usb.h"
#include "UsbSpec.h"
#include "wdfusb.h"
#include "Alloc.h"
class CWdfUsbInterface;
class CWdfUsbTarget
{
public:
CWdfUsbTarget();
~CWdfUsbTarget();
NTSTATUS Create(WDFDEVICE Device);
void DeviceDescriptor(USB_DEVICE_DESCRIPTOR &Descr... | #pragma once
#include "ntddk.h"
#include "wdf.h"
#include "usb.h"
#include "UsbSpec.h"
#include "wdfusb.h"
#include "Alloc.h"
class CWdfUsbInterface;
class CWdfUsbTarget
{
public:
CWdfUsbTarget();
~CWdfUsbTarget();
NTSTATUS Create(WDFDEVICE Device);
void DeviceDescriptor(USB_DEVICE_DESCRIPTOR &Descr... |
Add 2 missing public methods to .h, including new onStationary method | //
// CDVBackgroundGeoLocation.h
//
// Created by Chris Scott <chris@transistorsoft.com>
//
#import <Cordova/CDVPlugin.h>
#import "CDVLocation.h"
#import <AudioToolbox/AudioToolbox.h>
@interface CDVBackgroundGeoLocation : CDVPlugin <CLLocationManagerDelegate>
@property (nonatomic, strong) NSString* syncCallbackId;... | //
// CDVBackgroundGeoLocation.h
//
// Created by Chris Scott <chris@transistorsoft.com>
//
#import <Cordova/CDVPlugin.h>
#import "CDVLocation.h"
#import <AudioToolbox/AudioToolbox.h>
@interface CDVBackgroundGeoLocation : CDVPlugin <CLLocationManagerDelegate>
@property (nonatomic, strong) NSString* syncCallbackId;... |
Include <stdlib.h> for malloc related functions. | #include <nan.h>
#include <condition_variable>
#include "libsass/sass_context.h"
#ifdef __cplusplus
extern "C" {
#endif
using namespace v8;
void compile_data(struct Sass_Data_Context* dctx);
void compile_file(struct Sass_File_Context* fctx);
void compile_it(uv_work_t* req);
struct sass_context_wrapper {
... | #include <stdlib.h>
#include <nan.h>
#include <condition_variable>
#include "libsass/sass_context.h"
#ifdef __cplusplus
extern "C" {
#endif
using namespace v8;
void compile_data(struct Sass_Data_Context* dctx);
void compile_file(struct Sass_File_Context* fctx);
void compile_it(uv_work_t* req);
struct sass... |
Add a note to update varnishlog(1) whenever this list changes. | /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(Debug)
SLTM(Error)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(BackendOpen)
SLTM(BackendXID)
SLTM(BackendReuse)
SLTM(BackendClose)
SLTM(Htt... | /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
* REMEMBER to update the documentation (especially the varnishlog(1) man
* page) whenever this list changes.
*/
SLTM(Debug)
SLTM(Error)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(Ses... |
Revert "Conditionally include CLIColor in umbrella header" | //
// CocoaLumberjack.h
// CocoaLumberjack
//
// Created by Andrew Mackenzie-Ross on 3/02/2015.
//
//
#import <Foundation/Foundation.h>
//! Project version number for CocoaLumberjack.
FOUNDATION_EXPORT double CocoaLumberjackVersionNumber;
//! Project version string for CocoaLumberjack.
FOUNDATION_EXPORT const uns... | //
// CocoaLumberjack.h
// CocoaLumberjack
//
// Created by Andrew Mackenzie-Ross on 3/02/2015.
//
//
#import <Foundation/Foundation.h>
//! Project version number for CocoaLumberjack.
FOUNDATION_EXPORT double CocoaLumberjackVersionNumber;
//! Project version string for CocoaLumberjack.
FOUNDATION_EXPORT const uns... |
Introduce realloc_or_free(), which does what realloc() does but will free the argument if the reallocation fails. This is useful in some, but not all, use cases of realloc(). | /*****************************************************************************
* vlc_memory.h: Memory functions
*****************************************************************************
* Copyright (C) 2009 the VideoLAN team
*
* Authors: JP Dinger <jpd at videolan dot org>
*
* This program is free software; ... | |
Fix iOS nightly release. Exports the actual c api header instead of the shim header in the TensorflowLiteC framework | /* Copyright 2022 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 2022 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 the missing namespace bits | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will b... | /*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will b... |
Add comment on `GetTfrtPluginDeviceClient` to explain where to put the implementation. | /* Copyright 2022 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 2022 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 file that was missing from the last change | /*
* Copyright (C) 2009 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions a... | |
Include information for armv4l from Mark Knox <segfault@hardline.org>. | /* __USE_POSIX, __USE_BSD, and __USE_BSD_SIGNAL used to be defined either
here or with -D compile options, but __ macros should be set and used by C
library macros, not Postgres code. __USE_POSIX is set by features.h,
__USE_BSD is set by bsd/signal.h, and __USE_BSD_SIGNAL appears not to
be used.
*/
#define... | /* __USE_POSIX, __USE_BSD, and __USE_BSD_SIGNAL used to be defined either
here or with -D compile options, but __ macros should be set and used by C
library macros, not Postgres code. __USE_POSIX is set by features.h,
__USE_BSD is set by bsd/signal.h, and __USE_BSD_SIGNAL appears not to
be used.
*/
#define... |
Add the missing Parser header file. | /*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it wi... | |
Fix typo in header guard. | #ifndef _WLC_COMPOSITOR_H_
#define _WLC_COMPOSTIOR_H_
#include "visibility.h"
#include <stdbool.h>
#include <wayland-util.h>
struct wl_display;
struct wl_event_loop;
struct wl_event_source;
struct wlc_shell;
struct wlc_xdg_shell;
struct wlc_backend;
struct wlc_context;
struct wlc_render;
struct wlc_compositor {
s... | #ifndef _WLC_COMPOSITOR_H_
#define _WLC_COMPOSITOR_H_
#include "visibility.h"
#include <stdbool.h>
#include <wayland-util.h>
struct wl_display;
struct wl_event_loop;
struct wl_event_source;
struct wlc_shell;
struct wlc_xdg_shell;
struct wlc_backend;
struct wlc_context;
struct wlc_render;
struct wlc_compositor {
s... |
Update the year of the Copyright | //
// OCChunkInputStream.h
// Owncloud iOs Client
//
// Copyright (C) 2014 ownCloud Inc. (http://www.owncloud.org/)
//
// 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... | //
// OCChunkInputStream.h
// Owncloud iOs Client
//
// Copyright (C) 2015 ownCloud Inc. (http://www.owncloud.org/)
//
// 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... |
Move the import controls into a formal protocol | //
// NSManagedObject+JSONHelpers.h
//
// Created by Saul Mora on 6/28/11.
// Copyright 2011 Magical Panda Software LLC. All rights reserved.
//
#import <CoreData/CoreData.h>
extern NSString * const kMagicalRecordImportCustomDateFormatKey;
extern NSString * const kMagicalRecordImportDefaultDateFormatString;
extern... | //
// NSManagedObject+JSONHelpers.h
//
// Created by Saul Mora on 6/28/11.
// Copyright 2011 Magical Panda Software LLC. All rights reserved.
//
#import <CoreData/CoreData.h>
extern NSString * const kMagicalRecordImportCustomDateFormatKey;
extern NSString * const kMagicalRecordImportDefaultDateFormatString;
extern... |
Split assert into "static check" and "missing code" variants. | /*
* $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>
#ifndef NULL
#define NULL ((void*)0)
#endif
/* 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... |
Add comment explaining why there is no PrimitiveTypeToDataType function. | /* Copyright 2017 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 2017 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... |
Split assert into "static check" and "missing code" variants. | /*
* $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>
#ifndef NULL
#define NULL ((void*)0)
#endif
/* 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... |
Add a test for '0B' prefix. | // Copyright 2012 Rui Ueyama <rui314@gmail.com>
// This program is free software licensed under the MIT license.
#include "test.h"
void testmain(void) {
print("numeric constants");
expect(1, 0x1);
expect(17, 0x11);
expect(511, 0777);
expect(11, 0b1011); // GNU extension
expect(3, 3L);
e... | // Copyright 2012 Rui Ueyama <rui314@gmail.com>
// This program is free software licensed under the MIT license.
#include "test.h"
void testmain(void) {
print("numeric constants");
expect(1, 0x1);
expect(17, 0x11);
expect(511, 0777);
expect(11, 0b1011); // GNU extension
expect(11, 0B1011); ... |
Add a native mate converter for command lines | // Copyright (c) 2014 GitHub, Inc.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ATOM_COMMON_NATIVE_MATE_CONVERTERS_COMMAND_LINE_CONVERTER_H_
#define ATOM_COMMON_NATIVE_MATE_CONVERTERS_COMMAND_LINE_CONVERTER_H_
#include <string>
#include "atom/common/nati... | |
Add the test code itself | /*
*
* Copyright 2015, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of condi... | |
Change DB prefix string to comply with Android's | //
// Blueprint.h
// SoomlaiOSProfile
//
// Created by Gur Dotan on 6/9/14.
// Copyright (c) 2014 Soomla. All rights reserved.
//
#define BP_DB_KEY_PREFIX @"soomla.blueprint"
| //
// Blueprint.h
// SoomlaiOSProfile
//
// Created by Gur Dotan on 6/9/14.
// Copyright (c) 2014 Soomla. All rights reserved.
//
#define BP_DB_KEY_PREFIX @"soomla.levelup"
|
Remove broken (and unnecessary) definition of DEF_PGPORT. | #include <winsock.h>
/*
* strcasecmp() is not in Windows, stricmp is, though
*/
#define strcasecmp(a,b) stricmp(a,b)
#define strncasecmp(a,b,c) _strnicmp(a,b,c)
#define ACCEPT_TYPE_ARG3 int
/*
* Some compat functions
*/
#define open(a,b,c) _open(a,b,c)
#define close(a) _close(a)
#define read(a,b,c) _read(a,b,c)
... | #include <winsock.h>
/*
* strcasecmp() is not in Windows, stricmp is, though
*/
#define strcasecmp(a,b) stricmp(a,b)
#define strncasecmp(a,b,c) _strnicmp(a,b,c)
/*
* Some compat functions
*/
#define open(a,b,c) _open(a,b,c)
#define close(a) _close(a)
#define read(a,b,c) _read(a,b,c)
#define write(a,b,c) _write(a,... |
Implement stubs for trirvial cache | /**
* @file
* @brief Handle cache lookup just by iterating vfs tree
* @author Denis Deryugin <deryugin.denis@gmail.com>
* @version 0.1
* @date 2015-06-09
*/
| /**
* @file
* @brief Handle cache lookup just by iterating vfs tree
* @author Denis Deryugin <deryugin.denis@gmail.com>
* @version 0.1
* @date 2015-06-09
*/
#include <fs/dvfs.h>
struct dentry *dvfs_cache_lookup(const char *path, struct dentry *base) {
return NULL;
}
struct dentry *dvfs_cache_get(char *path) {... |
Add two classes [as yet unused] needed for upcoming IDB Blob support. | // Copyright 2014 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 WebBlobInfo_h
#define WebBlobInfo_h
#include "WebCommon.h"
#include "WebString.h"
namespace blink {
class WebBlobInfo {
public:
WebBlobInfo... | |
Add shmem tag for Hits | /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(Debug)
SLTM(Error)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(BackendOpen)
SLTM(BackendXID)
SLTM(BackendReuse)
SLTM(BackendClose)
SLTM(Htt... | /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(Debug)
SLTM(Error)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(BackendOpen)
SLTM(BackendXID)
SLTM(BackendReuse)
SLTM(BackendClose)
SLTM(Htt... |
Reset default settings to stock kit configuration |
#ifndef __SETTINGS_H_
#define __SETTINGS_H_
#include <Arduino.h>
#include "Device.h"
// This section is for devices and their configuration
//Kit:
#define HAS_STD_LIGHTS (1)
#define LIGHTS_PIN 5
#define HAS_STD_CAPE (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_PILOT (1)
#define HAS_STD_CAMERAMOUNT (1)
#defin... |
#ifndef __SETTINGS_H_
#define __SETTINGS_H_
#include <Arduino.h>
#include "Device.h"
// This section is for devices and their configuration
//Kit:
#define HAS_STD_LIGHTS (1)
#define LIGHTS_PIN 5
#define HAS_STD_CAPE (1)
#define HAS_STD_2X1_THRUSTERS (1)
#define HAS_STD_PILOT (1)
#define HAS_STD_CAMERAMOUNT (1)
#defin... |
Fix compiler warning in release | #ifndef __MORDOR_VERSION_H__
#define __MORDOR_VERSION_H__
// OS
#ifdef _WIN32
# define WINDOWS
#else
# define POSIX
#endif
#ifdef __CYGWIN__
# define WINDOWS
# define CYGWIN
#endif
#if defined(linux) || defined(__linux__)
# define LINUX
#endif
#ifdef __APPLE__
# define OSX
# ifndef BSD
# define B... | #ifndef __MORDOR_VERSION_H__
#define __MORDOR_VERSION_H__
// OS
#ifdef _WIN32
# define WINDOWS
#else
# define POSIX
#endif
#ifdef __CYGWIN__
# define WINDOWS
# define CYGWIN
#endif
#if defined(linux) || defined(__linux__)
# define LINUX
#endif
#ifdef __APPLE__
# define OSX
# ifndef BSD
# define B... |
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 another sample file for C | /*A C calculator...of sorts*/
/* An attempt at a C calculator from stuff read so far */
#include<stdio.h>
/* function for addition */
int add(int input1, int input2)
{
int result;
result = input1 + input2;
return result;
}
/* function for multiplication */
int multi(int input1, int input2)
{
int resu... | |
Fix compile warning when selftests disabled | /*
* Selftest code
*/
#ifndef DUK_SELFTEST_H_INCLUDED
#define DUK_SELFTEST_H_INCLUDED
DUK_INTERNAL_DECL void duk_selftest_run_tests(void);
#endif /* DUK_SELFTEST_H_INCLUDED */
| /*
* Selftest code
*/
#ifndef DUK_SELFTEST_H_INCLUDED
#define DUK_SELFTEST_H_INCLUDED
#if defined(DUK_USE_SELF_TESTS)
DUK_INTERNAL_DECL void duk_selftest_run_tests(void);
#endif
#endif /* DUK_SELFTEST_H_INCLUDED */
|
Modify test 57/12 to actually trigger the issue | // PARAM: --enable ana.float.interval
#include <assert.h>
// previously failed in line 7 with "exception Invalid_argument("Cilfacade.get_ikind: non-integer type double ")"
//(same error as in sv-comp: float-newlib/float_req_bl_0220a.c)
// similar error also occured in the additional examples when branching on a float ... | // PARAM: --enable ana.float.interval
#include <assert.h>
// previously failed in line 7 with "exception Invalid_argument("Cilfacade.get_ikind: non-integer type double ")"
//(same error as in sv-comp: float-newlib/float_req_bl_0220a.c)
// similar error also occurred in the additional examples when branching on a float... |
Fix the DYNAMIC_GHC_PROGRAMS=NO build on Mac/Windows | /* -----------------------------------------------------------------------------
*
* (c) The GHC Team, 2000-2015
*
* RTS Symbols
*
* ---------------------------------------------------------------------------*/
#ifndef RTS_SYMBOLS_H
#define RTS_SYMBOLS_H
#ifdef LEADING_UNDERSCORE
#define MAYBE_LEADING_UNDERSCO... | /* -----------------------------------------------------------------------------
*
* (c) The GHC Team, 2000-2015
*
* RTS Symbols
*
* ---------------------------------------------------------------------------*/
#ifndef RTS_SYMBOLS_H
#define RTS_SYMBOLS_H
#include "ghcautoconf.h"
#ifdef LEADING_UNDERSCORE
#defi... |
Add new classes to umbrella header | //
// TWTValidation.h
// TWTValidation
//
// Created by Prachi Gauriar on 3/28/2014.
// Copyright (c) 2014 Two Toasters, LLC. All rights reserved.
//
@import Foundation;
#import <TWTValidation/TWTValidator.h>
#import <TWTValidation/TWTBlockValidator.h>
#import <TWTValidation/TWTCompoundValidator.h>
#import <TW... | //
// TWTValidation.h
// TWTValidation
//
// Created by Prachi Gauriar on 3/28/2014.
// Copyright (c) 2014 Two Toasters, LLC. All rights reserved.
//
@import Foundation;
#import <TWTValidation/TWTValidator.h>
#import <TWTValidation/TWTValidationErrors.h>
#import <TWTValidation/TWTBlockValidator.h>
#import <TWTV... |
Remove encoding conditionals that are no longer required | #ifndef REDCARPET_H__
#define REDCARPET_H__
#define RSTRING_NOT_MODIFIED
#include "ruby.h"
#include <stdio.h>
#ifdef HAVE_RUBY_ENCODING_H
# include <ruby/encoding.h>
# define redcarpet_str_new(data, size, enc) rb_enc_str_new(data, size, enc)
#else
# define redcarpet_str_new(data, size, enc) rb_str_new(data, size)
#en... | #ifndef REDCARPET_H__
#define REDCARPET_H__
#define RSTRING_NOT_MODIFIED
#include "ruby.h"
#include <stdio.h>
#include <ruby/encoding.h>
#define redcarpet_str_new(data, size, enc) rb_enc_str_new(data, size, enc)
#include "markdown.h"
#include "html.h"
#define CSTR2SYM(s) (ID2SYM(rb_intern((s))))
void Init_redcarpe... |
Put TextTube to line buffer mode | #include "common.h"
#include "tube.h"
int FdTube;
FILE *TextTube;
void InitTubes(int textTube, int fdTube) {
SetCloexec(textTube);
SetCloexec(fdTube);
TextTube = fdopen(textTube, "a+");
DieIf(TextTube == 0, "fdopen");
FdTube = fdTube;
}
| #include "common.h"
#include "tube.h"
int FdTube;
FILE *TextTube;
void InitTubes(int textTube, int fdTube) {
SetCloexec(textTube);
SetCloexec(fdTube);
TextTube = fdopen(textTube, "a+");
setlinebuf(TextTube);
DieIf(TextTube == 0, "fdopen");
FdTube = fdTube;
}
|
Add shmlog tags for pipe and pass handling | /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(Debug)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(Request)
SLTM(Response)
SLTM(Status)
SLTM(URL)
SLTM(Protocol)
SLTM(HD_U... | /*
* $Id$
*
* Define the tags in the shared memory in a reusable format.
* Whoever includes this get to define what the SLTM macro does.
*
*/
SLTM(Debug)
SLTM(CLI)
SLTM(SessionOpen)
SLTM(SessionReuse)
SLTM(SessionClose)
SLTM(ClientAddr)
SLTM(HandlingPass)
SLTM(HandlingPipe)
SLTM(Request)
SLTM(Response)
SLTM(Stat... |
Change a "inline" to "__inline__" | /* This file should provide inline versions of string functions.
Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.
This file should define __STRING_INLINES if functions are actually defined
as inlines. */
#ifndef _BITS_STRING_H
#define _BITS_STRING_H 1
#define _STRING_ARCH_unali... | /* This file should provide inline versions of string functions.
Surround GCC-specific parts with #ifdef __GNUC__, and use `__extern_inline'.
This file should define __STRING_INLINES if functions are actually defined
as inlines. */
#ifndef _BITS_STRING_H
#define _BITS_STRING_H 1
#define _STRING_ARCH_unali... |
Update for renamed struct in runtime.h (WinCall to LibCall) | #include <runtime.h>
#include <cgocall.h>
void runtime·asmstdcall(void *c);
void ·cSyscall(WinCall *c) {
runtime·cgocall(runtime·asmstdcall, c);
}
| #include <runtime.h>
#include <cgocall.h>
void runtime·asmstdcall(void *c);
void ·cSyscall(LibCall *c) {
runtime·cgocall(runtime·asmstdcall, c);
}
|
Define INFINITY and NAN when missing | #ifndef __math_compat_h
#define __math_compat_h
/* Define isnan and isinf on Windows/MSVC */
#ifndef HAVE_DECL_ISNAN
# ifdef HAVE_DECL__ISNAN
#include <float.h>
#define isnan(x) _isnan(x)
# endif
#endif
#ifndef HAVE_DECL_ISINF
# ifdef HAVE_DECL__FINITE
#include <float.h>
#define isinf(x) (!_finite(x))
# endif
#endif... | #ifndef __math_compat_h
#define __math_compat_h
/* Define isnan, isinf, infinity and nan on Windows/MSVC */
#ifndef HAVE_DECL_ISNAN
# ifdef HAVE_DECL__ISNAN
#include <float.h>
#define isnan(x) _isnan(x)
# endif
#endif
#ifndef HAVE_DECL_ISINF
# ifdef HAVE_DECL__FINITE
#include <float.h>
#define isinf(x) (!_finite(x))... |
Add action predicate block typedef | /*
Copyright 2009-2013 Urban Airship Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the f... | /*
Copyright 2009-2013 Urban Airship Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the f... |
Add header file for tracking our Maya type IDs | #ifndef MAYATYPEID_H
#define MAYATYPEID_H
// Inside Maya, the type IDs are used to identify nodes and dependency graph
// data. So when we create custom nodes and data in any Maya plugins, they must
// all be assigned unique IDs. For any plugins that will be used outside of
// Side Effects, we *must* assign globally u... | |
Add an API testcase for prototype loop and GC | /*
* Prototype loop is tricky to handle internally and must not cause e.g.
* GC failures. Exercise a few common paths.
*/
/*===
*** test_1 (duk_safe_call)
first gc
make unreachable
second gc
==> rc=0, result='undefined'
===*/
static duk_ret_t test_1(duk_context *ctx) {
duk_push_object(ctx);
duk_push_object(ct... | |
Fix build of tutorials that require libpng under Visual Studio. | // A current_time function for use in the tests. Returns time in
// milliseconds.
#ifdef _WIN32
extern "C" bool QueryPerformanceCounter(uint64_t *);
extern "C" bool QueryPerformanceFrequency(uint64_t *);
double current_time() {
uint64_t t, freq;
QueryPerformanceCounter(&t);
QueryPerformanceFrequency(&freq... | // A current_time function for use in the tests. Returns time in
// milliseconds.
#ifdef _WIN32
#include <Windows.h>
double current_time() {
LARGE_INTEGER freq, t;
QueryPerformanceCounter(&t);
QueryPerformanceFrequency(&freq);
return (t.QuadPart * 1000.0) / freq.QuadPart;
}
// Gross, these come from W... |
Backup of APM 2.5.2 calibration file |
/**
* FreeIMU calibration header. Automatically generated by FreeIMU_GUI.
* Do not edit manually unless you know what you are doing.
*/
#define CALIBRATION_H
const int acc_off_x = 426;
const int acc_off_y = -141;
const int acc_off_z = -540;
const float acc_scale_x = 16255.420145;
const float acc_scale_y = 16389.9... | |
Remove unused byte in freelist | #include "redislite.h"
#include "page_string.h"
#include "util.h"
#include <string.h>
#include <stdlib.h>
#include <math.h>
void redislite_free_freelist(void *_db, void *_page)
{
redislite_page_string* page = (redislite_page_string*)_page;
if (page == NULL) return;
redislite_free(page);
}
void redislite_write_fre... | #include "redislite.h"
#include "page_string.h"
#include "util.h"
#include <string.h>
#include <stdlib.h>
#include <math.h>
void redislite_free_freelist(void *_db, void *_page)
{
redislite_page_string* page = (redislite_page_string*)_page;
if (page == NULL) return;
redislite_free(page);
}
void redislite_write_fre... |
Fix initialization of once mutex |
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <orc/orconce.h>
#include <orc/orcdebug.h>
#if defined(HAVE_THREAD_PTHREAD)
#include <pthread.h>
static pthread_mutex_t once_mutex = PTHREAD_MUTEX_INITIALIZER;
void
_orc_once_init (void)
{
}
void
orc_once_mutex_lock (void)
{
pthread_mutex_lock (&once_... |
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <orc/orconce.h>
#include <orc/orcdebug.h>
#if defined(HAVE_THREAD_PTHREAD)
#include <pthread.h>
static pthread_mutex_t once_mutex = PTHREAD_MUTEX_INITIALIZER;
void
_orc_once_init (void)
{
}
void
orc_once_mutex_lock (void)
{
pthread_mutex_lock (&once_... |
Include all x86 defines macros for hwloc | /* Copyright 2019 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 2019 The TensorFlow Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or a... |
Remove non-existent 'view' parameter documentation | //
// MASCompositeConstraint.h
// Masonry
//
// Created by Jonas Budelmann on 21/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import "MASConstraint.h"
#import "MASUtilities.h"
/**
* A group of MASConstraint objects
* conforms to MASConstraint
*/
@interface MASCompositeConstraint : NSObject... | //
// MASCompositeConstraint.h
// Masonry
//
// Created by Jonas Budelmann on 21/07/13.
// Copyright (c) 2013 cloudling. All rights reserved.
//
#import "MASConstraint.h"
#import "MASUtilities.h"
/**
* A group of MASConstraint objects
* conforms to MASConstraint
*/
@interface MASCompositeConstraint : NSObject... |
Test the presence of some extra functions |
#define TEST_NAME "auth"
#include "cmptest.h"
/* "Test Case 2" from RFC 4231 */
unsigned char key[32] = "Jefe";
unsigned char c[] = "what do ya want for nothing?";
unsigned char a[32];
int main(void)
{
int i;
crypto_auth(a,c,sizeof c - 1U,key);
for (i = 0;i < 32;++i) {
printf(",0x%02x",(unsigned int) a[i]... |
#define TEST_NAME "auth"
#include "cmptest.h"
/* "Test Case 2" from RFC 4231 */
unsigned char key[32] = "Jefe";
unsigned char c[] = "what do ya want for nothing?";
unsigned char a[32];
int main(void)
{
int i;
crypto_auth(a,c,sizeof c - 1U,key);
for (i = 0;i < 32;++i) {
printf(",0x%02x",(unsigned int) a[i]... |
Update the shaders to work with Cogl 1.6.0+ and GLES2 |
#ifndef CLUTTER_GST_SHADERS_H
#define CLUTTER_GST_SHADERS_H
#include <clutter/clutter.h>
/* Copied from test-shaders */
/* These variables are used instead of the standard GLSL variables on
GLES 2 */
#ifdef COGL_HAS_GLES
#define GLES2_VARS \
"precision mediump float;\n" \
"varying vec2 tex_coo... |
#ifndef CLUTTER_GST_SHADERS_H
#define CLUTTER_GST_SHADERS_H
#include <clutter/clutter.h>
/* Copied from test-shaders */
/* These variables are used instead of the standard GLSL variables on
GLES 2 */
#ifdef COGL_HAS_GLES
#define GLES2_VARS \
"precision mediump float;\n"
#define TEX_COORD "cogl_te... |
Define _SODIUM_C99 as empty on retarded compilers, not only when using C++ |
#ifndef __SODIUM_UTILS_H__
#define __SODIUM_UTILS_H__
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef __cplusplus
# define _SODIUM_C99(X) X
#else
# define _SODIUM_C99(X)
#endif
unsigned char *_sodium_alignedcalloc(unsigned char ** const unaligned_p,
... |
#ifndef __SODIUM_UTILS_H__
#define __SODIUM_UTILS_H__
#include <stddef.h>
#include "export.h"
#ifdef __cplusplus
extern "C" {
#endif
#if defined(__cplusplus) || !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# define _SODIUM_C99(X)
#else
# define _SODIUM_C99(X) X
#endif
unsigned char *_sodium_alignedcal... |
Call ssh_init() and ssh_finalize() before we run the tests. | #include "torture.h"
#include <stdio.h>
static int verbosity = 0;
int torture_libssh_verbosity(void){
return verbosity;
}
int main(int argc, char **argv) {
(void) argc;
(void) argv;
return torture_run_tests();
}
| #include <stdio.h>
#include <libssh/libssh.h>
#include "torture.h"
static int verbosity = 0;
int torture_libssh_verbosity(void){
return verbosity;
}
int main(int argc, char **argv) {
int rc;
(void) argc;
(void) argv;
ssh_init();
rc = torture_run_tests();
ssh_finalize();
return rc;... |
Convert LayoutDrawingRecorder to be a simple helper of DrawingRecorder | // Copyright 2014 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 LayoutObjectDrawingRecorder_h
#define LayoutObjectDrawingRecorder_h
#include "core/layout/PaintPhase.h"
#include "platform/geometry/FloatRect.h"
... | // Copyright 2014 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 LayoutObjectDrawingRecorder_h
#define LayoutObjectDrawingRecorder_h
#include "core/layout/PaintPhase.h"
#include "platform/geometry/LayoutRect.h"... |
Add missing itkImageRegionSplitterBase to ImageSourceCommon. | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... | /*=========================================================================
*
* Copyright Insight Software Consortium
*
* 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
*
* h... |
CREATE was broken if namespace prefixes were set. Patch by Andreas Fuchs. | /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "commands.h"
int cmd_create(struct client *client)
{
struct mail_storage *storage;
const char *mailbox;
int directory;
size_t len;
/* <mailbox> */
if (!client_read_string_args(client, 1, &mailbox))
return FALSE;
storage = client_find_stora... | /* Copyright (C) 2002 Timo Sirainen */
#include "common.h"
#include "commands.h"
int cmd_create(struct client *client)
{
struct mail_storage *storage;
const char *mailbox, *full_mailbox;
int directory;
size_t len;
/* <mailbox> */
if (!client_read_string_args(client, 1, &mailbox))
return FALSE;
full_mailbox ... |
Fix typos in last commit. | /*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "gsm.h"
#include "private.h"
gsm gsm_create ... | /*
* Copyright 1992 by Jutta Degener and Carsten Bormann, Technische
* Universitaet Berlin. See the accompanying file "COPYRIGHT" for
* details. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
*/
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include "gsm.h"
#include "private.h"
gsm gsm_create ... |
Fix bridging header for iOS Swift tests | //
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <ObjectiveRocks/RocksDB.h>
#import <ObjectiveRocks/RocksDBColumnFamily.h>
#import <ObjectiveRocks/RocksDBColumnFamilyDescriptor.h>
#import <ObjectiveRocks/RocksDBIterator.h>
#import <ObjectiveRocks/RocksDBP... | //
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <ObjectiveRocks/RocksDB.h>
#import <ObjectiveRocks/RocksDBColumnFamily.h>
#import <ObjectiveRocks/RocksDBColumnFamilyDescriptor.h>
#import <ObjectiveRocks/RocksDBIterator.h>
#import <ObjectiveRocks/RocksDBP... |
Include basictypes.h for DISALLOW macro. | // 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 UI_AURA_EVENT_FILTER_H_
#define UI_AURA_EVENT_FILTER_H_
#pragma once
#include "base/logging.h"
#include "ui/gfx/point.h"
namespace aura {
c... | // 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 UI_AURA_EVENT_FILTER_H_
#define UI_AURA_EVENT_FILTER_H_
#pragma once
#include "base/basictypes.h"
namespace aura {
class Window;
class Mous... |
Change NELEM to take VA_ARGS to handle commas |
// Copyright 2015 Malcolm Inglis <http://minglis.id.au>
//
// This file is part of Libmacro.
//
// Libmacro is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at yo... |
// Copyright 2015 Malcolm Inglis <http://minglis.id.au>
//
// This file is part of Libmacro.
//
// Libmacro is free software: you can redistribute it and/or modify it under
// the terms of the GNU Affero General Public License as published by the
// Free Software Foundation, either version 3 of the License, or (at yo... |
Copy bezierpath category from bibdesk to skim. | //
// NSBezierPath_BDSKExtensions.h
// Bibdesk
//
// Created by Adam Maxwell on 10/22/05.
/*
This software is Copyright (c) 2005,2006,2007
Adam Maxwell. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
ar... | |
Include KeyValuePair definition, if needed. | /**
* Appcelerator Titanium - licensed under the Apache Public License 2
* see LICENSE in the root folder for details on the license.
* Copyright (c) 2008 Appcelerator, Inc. All Rights Reserved.
*/
#ifndef TITANIUM_URL_H_
#define TITANIUM_URL_H_
namespace ti
{
void NormalizeURLCallback(const char* url, char* buff... | /**
* Appcelerator Titanium - licensed under the Apache Public License 2
* see LICENSE in the root folder for details on the license.
* Copyright (c) 2008 Appcelerator, Inc. All Rights Reserved.
*/
#ifndef TITANIUM_URL_H_
#define TITANIUM_URL_H_
#ifndef KEYVALUESTRUCT
typedef struct {
char* key;
char* val... |
Add more common includes to PCH. |
/* StdAfx.h
*
* Copyright (C) 2013 Michael Imamura
*
* 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 ... |
/* StdAfx.h
*
* Copyright (C) 2013 Michael Imamura
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable ... |
Add simple post that triggers the earlier breakage of kcgi(3) with a blocking socket. | /* $Id$ */
/*
* Copyright (c) 2016 Kristaps Dzonsons <kristaps@bsd.lv>
*
* 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 PROVIDE... | |
Switch `value_t` to be `uintptr_t`. | /*
* This file is part of hat-trie.
*
* Copyright (c) 2011 by Daniel C. Jones <dcjones@cs.washington.edu>
*
*
* Common typedefs, etc.
*
*/
#ifndef HATTRIE_COMMON_H
#define HATTRIE_COMMON_H
typedef unsigned long value_t;
#endif
| /*
* This file is part of hat-trie.
*
* Copyright (c) 2011 by Daniel C. Jones <dcjones@cs.washington.edu>
*
*
* Common typedefs, etc.
*
*/
#ifndef HATTRIE_COMMON_H
#define HATTRIE_COMMON_H
#include "pstdint.h"
typedef uintptr_t value_t;
#endif
|
Add rudimentary init/clear test for fq_default_poly_factor. | /*
Copyright (C) 2021 William Hart
This file is part of FLINT.
FLINT is free software: you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License (LGPL) as published
by the Free Software Foundation; either version 2.1 of the License, or
(at your option) a... | |
Add another example on complex structure usage | #include "m-array.h"
#include "m-string.h"
/* This example show how to use complex structure with array
embedding another library */
/* This is a trivial library */
typedef struct lib_ext_struct {
int id;
// Other data
} lib_ext_struct;
static lib_ext_struct *lib_ext_struct_Duplicate(const lib_ext_struct *ob... | |
Update files, Alura, Introdução a C - Parte 2, Aula 2.1 | #include <stdio.h>
int main() {
int notas[10];
notas[0] = 10;
notas[2] = 9;
notas[3] = 8;
notas[9] = 4;
printf("%d %d %d\n", notas[0], notas[2], notas[9]);
} | |
Fix compilation errors on Mac OS | #pragma once
#include <time.h>
#include <sys/time.h>
static inline unsigned long long current_time_ns() {
#ifdef __MACH__
clock_serv_t cclock;
mach_timespec_t mts;
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
clock_get_time(cclock, &mts);
mach_port_deallocate(mach_task_self()... | #pragma once
#include <time.h>
#include <sys/time.h>
#ifdef __MACH__
#include <mach/clock.h>
#include <mach/mach.h>
#endif
static inline unsigned long long current_time_ns() {
#ifdef __MACH__
clock_serv_t cclock;
mach_timespec_t mts;
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &cclock);
... |
Use TERMINAL_IO_H as inclusion guard | #ifndef TERMINALIO_H
#define TERMINALIO_H
typedef struct io io_t;
typedef struct chip8 chip8_t;
io_t * terminal_io_new(void);
void terminal_io_render(io_t *, chip8_t *);
void terminal_io_listen(io_t *, chip8_t *);
#endif
| #ifndef TERMINAL_IO_H
#define TERMINAL_IO_H
typedef struct io io_t;
typedef struct chip8 chip8_t;
io_t * terminal_io_new(void);
void terminal_io_render(io_t *, chip8_t *);
void terminal_io_listen(io_t *, chip8_t *);
#endif
|
Add macro to assign Double3 values from toml files | // -----------------------------------------------------------------------------
//
// Copyright (C) The BioDynaMo Project.
// 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.
//
// See the LICENSE file distrib... | // -----------------------------------------------------------------------------
//
// Copyright (C) The BioDynaMo Project.
// 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.
//
// See the LICENSE file distrib... |
Use __builtin_trap to break to debugger | #include <stdarg.h>
#include <stdio.h>
#include <whitgl/logging.h>
#define LOG_BUFFER_MAX (256)
char _buffer[LOG_BUFFER_MAX];
void whitgl_logit(const char *file, const int line, const char *str, ...)
{
va_list args;
va_start(args, str);
vsnprintf(_buffer, LOG_BUFFER_MAX, str, args);
printf("%24s:%03d %s\n", fil... | #include <stdarg.h>
#include <stdio.h>
#include <whitgl/logging.h>
#define LOG_BUFFER_MAX (256)
char _buffer[LOG_BUFFER_MAX];
void whitgl_logit(const char *file, const int line, const char *str, ...)
{
va_list args;
va_start(args, str);
vsnprintf(_buffer, LOG_BUFFER_MAX, str, args);
printf("%24s:%03d %s\n", fil... |
Include arraytypes.c early for the no separate compilation case. | /*
* This file includes all the .c files needed for a complete multiarray module.
* This is used in the case where separate compilation is not enabled
*/
#include "common.c"
#include "hashdescr.c"
#include "numpyos.c"
#include "scalarapi.c"
#include "descriptor.c"
#include "flagsobject.c"
#include "ctors.c"
#inclu... | /*
* This file includes all the .c files needed for a complete multiarray module.
* This is used in the case where separate compilation is not enabled
*
* Note that the order of the includs matters
*/
#include "common.c"
#include "arraytypes.c"
#include "hashdescr.c"
#include "numpyos.c"
#include "scalarapi.c"
... |
Complete the license switch to 2-clause BSD | /* $Id$ */
/* Copyright (c) 2017 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS Desktop Mixer */
/* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the Li... | /* $Id$ */
/* Copyright (c) 2017 Pierre Pronchery <khorben@defora.org> */
/* This file is part of DeforaOS Desktop Mixer */
/* 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. Redistri... |
Change order of declarations to suppress compiler warning. | #include <Instrument.h> // the base class for this instrument
class MYINST : public Instrument {
public:
MYINST();
virtual ~MYINST();
virtual int init(double *, int);
virtual int configure();
virtual int run();
private:
void doupdate();
int _nargs, _inchan, _branch;
float _amp, _pan;
float *_in;
};
| #include <Instrument.h> // the base class for this instrument
class MYINST : public Instrument {
public:
MYINST();
virtual ~MYINST();
virtual int init(double *, int);
virtual int configure();
virtual int run();
private:
void doupdate();
float *_in;
int _nargs, _inchan, _branch;
float _amp, _pan;
};
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.