Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Add the BSD make build machinery | /*
* Hello World Program
* 2013-05-27
*/
#include <stdio.h>
int
main()
{
printf("Hello, World!\g");
return 0;
}
| /*
* Hello World Program
* 2013-05-27
*/
#include <stdio.h>
int
main()
{
printf("Hello, World!\n");
return 0;
}
|
Add flag to stage api change | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT ... | /*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkUserConfigManual_DEFINED
#define SkUserConfigManual_DEFINED
#define GR_TEST_UTILS 1
#define SK_BUILD_FOR_ANDROID_FRAMEWORK
#define SK_DEFAULT_FONT_CACHE_LIMIT ... |
Remove two variables which are handled MI now. | /*-
* Copyright (c) 2001 Jake Burkholder.
* 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 co... | /*-
* Copyright (c) 2001 Jake Burkholder.
* 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 co... |
Add compose header to CLI | #include <stdio.h>
#include "ot.h"
#include "otdecode.h"
int main(int argc, const char * argv[])
{
char buf[1024];
fputs("Operation 1: ", stdout);
fgets(buf, 1024, stdin);
char p[64];
ot_op* op = ot_new_op(0, p);
ot_decode_err err = ot_decode(op, buf);
if (err != OT_ERR_NONE) {
... | #include <stdio.h>
#include "ot.h"
#include "compose.h"
#include "otdecode.h"
int main(int argc, const char * argv[])
{
char buf[1024];
fputs("Operation 1: ", stdout);
fgets(buf, 1024, stdin);
char p[64];
ot_op* op = ot_new_op(0, p);
ot_decode_err err = ot_decode(op, buf);
if (err != O... |
Fix test case 11 to set the number of omp threads and make it portable | #include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
double sinTable[256];
#pragma omp parallel for
for(int n=0; n<256; ++n)
sinTable[n] = sin(2 * M_PI * n / 256);
// the table is now initialized
}
// RUN: clang -fopenmp -c -g -emit-llvm %s -o %t.1.bc
// RUN: o... | #include <omp.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main()
{
double sinTable[256];
#pragma omp parallel for
for(int n=0; n<256; ++n)
sinTable[n] = sin(2 * M_PI * n / 256);
// the table is now initialized
}
// RUN: clang -fopenmp -c -g -emit-llvm %s -o %t.1.bc
// RUN: o... |
Handle the terminal resizing while suspended, by sending ourselves a SIGWINCH after restoring. | /* A simple Lua module to suspend this process. */
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
#include <lua.h>
#include <lauxlib.h>
int l_kill(lua_State *L)
{
/* Send ourselves the terminal stop signal, equivalent to normally
* pressing ^Z. */
kill(0, SIGTSTP);
return 0;
}
/* The... | /* A simple Lua module to suspend this process. */
#include <sys/types.h>
#include <signal.h>
#include <unistd.h>
#include <lua.h>
#include <lauxlib.h>
int l_kill(lua_State *L)
{
/* Send ourselves the terminal stop signal, equivalent to normally
* pressing ^Z. */
kill(0, SIGTSTP);
/* We may have ... |
Test standard C interface for ll?seek | #include <sys/stat.h>
#include <assert.h>
#include <errno.h>
#include <stdio.h>
static long posix(const char path[static 1])
{
struct stat metadata;
assert(!stat(path, &metadata));
return metadata.st_size;
}
static long standard(const char path[static 1])
{
FILE* stream = fopen(path, "rb");
fse... | |
Add a prototype for abs(). | /*
* Copyright (C) 2014, Galois, Inc.
* This sotware is distributed under a standard, three-clause BSD license.
* Please see the file LICENSE, distributed with this software, for specific
* terms and conditions.
*/
#ifndef MINLIBC_STDLIB_H
#define MINLIBC_STDLIB_H
#define NULL 0
#define EXIT_SUCCESS ... | /*
* Copyright (C) 2014, Galois, Inc.
* This sotware is distributed under a standard, three-clause BSD license.
* Please see the file LICENSE, distributed with this software, for specific
* terms and conditions.
*/
#ifndef MINLIBC_STDLIB_H
#define MINLIBC_STDLIB_H
#define NULL 0
#define EXIT_SUCCESS ... |
Add methods to joinable to handle streams | #ifndef JOINABLE_IMPL
#define JOINABLE_IMPL
#include "joinable_types.h"
#include "types/MediaObjectImpl.h"
using ::com::kurento::kms::api::Joinable;
using ::com::kurento::kms::api::Direction;
namespace com { namespace kurento { namespace kms {
class JoinableImpl : public virtual Joinable, public virtual MediaObject... | #ifndef JOINABLE_IMPL
#define JOINABLE_IMPL
#include "joinable_types.h"
#include "types/MediaObjectImpl.h"
using ::com::kurento::kms::api::Joinable;
using ::com::kurento::kms::api::Direction;
using ::com::kurento::kms::api::StreamType;
namespace com { namespace kurento { namespace kms {
class JoinableImpl : public ... |
Change votes to use double. | #ifndef PROPOSER_H
#define PROPOSER_H
#include <boost/shared_ptr.hpp>
#include <vector>
#include <map>
#include "proctor/detector.h"
#include "proctor/database_entry.h"
namespace pcl
{
namespace proctor
{
struct Candidate {
std::string id;
float votes;
};
class Proposer {
public:
... | #ifndef PROPOSER_H
#define PROPOSER_H
#include <boost/shared_ptr.hpp>
#include <vector>
#include <map>
#include "proctor/detector.h"
#include "proctor/database_entry.h"
namespace pcl
{
namespace proctor
{
struct Candidate {
std::string id;
double votes;
};
class Proposer {
public:... |
Adjust for changes in libkcal | /*
KDE2 compatibility for KDE Alarm Daemon and KDE Alarm Daemon GUI.
This file is part of the KDE alarm daemon.
Copyright (c) 2001 David Jarvie <software@astrojar.org.uk>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as pu... | /*
KDE2 compatibility for KDE Alarm Daemon and KDE Alarm Daemon GUI.
This file is part of the KDE alarm daemon.
Copyright (c) 2001 David Jarvie <software@astrojar.org.uk>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as pu... |
Remove unused declaration of __initramfs_start | #ifndef __OPENRISC_VMLINUX_H_
#define __OPENRISC_VMLINUX_H_
#ifdef CONFIG_BLK_DEV_INITRD
extern char __initrd_start, __initrd_end;
extern char __initramfs_start;
#endif
extern u32 __dtb_start[];
#endif
| #ifndef __OPENRISC_VMLINUX_H_
#define __OPENRISC_VMLINUX_H_
#ifdef CONFIG_BLK_DEV_INITRD
extern char __initrd_start, __initrd_end;
#endif
extern u32 __dtb_start[];
#endif
|
Add macros to check for iOS 8 | //
// GCMDeviceInfo.h
// GCMCocoaExtensions
//
// Created by Jerry Hsu on 11/26/13.
// Copyright (c) 2013 GameChanger. All rights reserved.
//
#import <Foundation/Foundation.h>
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOr... | //
// GCMDeviceInfo.h
// GCMCocoaExtensions
//
// Created by Jerry Hsu on 11/26/13.
// Copyright (c) 2013 GameChanger. All rights reserved.
//
#import <Foundation/Foundation.h>
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOr... |
Adjust RPC parameter qualification for CAmkES changes. | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#include <Echo.h>
#include <string.h>
void b__init(void) {
}
char * b_echo_string(... | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#include <Echo.h>
#include <string.h>
void b__init(void) {
}
char * b_echo_string(... |
Reset a session if implicit reset option is set | #ifndef LIBTRADING_FAST_FEED_H
#define LIBTRADING_FAST_FEED_H
#include "libtrading/proto/fast_session.h"
#include <sys/socket.h>
#include <sys/types.h>
struct fast_feed {
struct fast_session *session;
struct fast_session_cfg cfg;
u64 recv_num;
char xml[128];
char lip[32];
char sip[32];
char ip[32];... | #ifndef LIBTRADING_FAST_FEED_H
#define LIBTRADING_FAST_FEED_H
#include "libtrading/proto/fast_session.h"
#include <sys/socket.h>
#include <sys/types.h>
struct fast_feed {
struct fast_session *session;
struct fast_session_cfg cfg;
u64 recv_num;
char xml[128];
char lip[32];
char sip[32];
char ip[32];... |
Update driver version to 5.03.00-k2 | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.03.00-k1"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2012 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.03.00-k2"
|
Add an octagn test for handling pointers | void change(int *p) {
(*p)++;
}
int a;
int main() {
a = 5;
int *p = &a;
change(p);
assert(a - 6 == 0);
return 0;
} | |
Remove a deprecation for minor-minor release | //
// SZSmartAlertUtils.h
// SocializeSDK
//
// Created by Nathaniel Griswold on 6/4/12.
// Copyright (c) 2012 Socialize, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SZSmartAlertUtils : NSObject
+ (BOOL)isAvailable;
+ (BOOL)handleNotification:(NSDictionary*)userInfo __attribute__((d... | //
// SZSmartAlertUtils.h
// SocializeSDK
//
// Created by Nathaniel Griswold on 6/4/12.
// Copyright (c) 2012 Socialize, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface SZSmartAlertUtils : NSObject
+ (BOOL)isAvailable;
+ (BOOL)handleNotification:(NSDictionary*)userInfo; // __attribute_... |
Update / add vec3 => JSON functions | /*
* Copyright (C) 2015 Luke San Antonio
* All rights reserved.
*/
#pragma once
#include "rapidjson/document.h"
#include "glm/glm.hpp"
namespace redc
{
inline glm::vec3 vec3_from_js(rapidjson::Value const& v) noexcept
{
return glm::vec3{v["x"].GetDouble(),v["y"].GetDouble(),v["z"].GetDouble()};
}
}
| /*
* Copyright (C) 2015 Luke San Antonio
* All rights reserved.
*/
#pragma once
#include "rapidjson/document.h"
#include "glm/glm.hpp"
namespace redc
{
inline glm::vec3 vec3_from_js_object(rapidjson::Value const& v) noexcept
{
return glm::vec3{v["x"].GetDouble(),v["y"].GetDouble(),v["z"].GetDouble()};
}
... |
Work around an optimization bug in IsPowerOfTwo. | #ifndef LOG2_H
#define LOG2_H
template <typename T>
#ifdef __GNUC__
__attribute__((const))
#endif
static bool IsPowerOfTwo(const T& x)
{
return (x & (x - 1)) == 0;
}
template<typename T>
#ifdef __GNUC__
__attribute__((const))
#endif
static inline unsigned ilog2(T n)
{
// returns the first power of two equal t... | #ifndef LOG2_H
#define LOG2_H
template <typename T>
#ifdef __GNUC__
__attribute__((const))
#endif
static inline bool IsPowerOfTwo(T x)
{
return (x & (x - 1)) == 0;
}
template<typename T>
#ifdef __GNUC__
__attribute__((const))
#endif
static inline unsigned ilog2(T n)
{
// returns the first power of two equal t... |
Disable test incompatible with new Android | // RUN: %clang_asan -O2 %s -o %t
// RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: %env_asan_opts=check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
// RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// FIXME: printf is not intercepted o... | // RUN: %clang_asan -O2 %s -o %t
// RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: %env_asan_opts=check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
// RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// FIXME: printf is not intercepted o... |
Fix component build with gcc 4.6 on Android. | // 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 CRYPTO_OPENSSL_BIO_STRING_H_
#define CRYPTO_OPENSSL_BIO_STRING_H_
#include <string>
#include "crypto/crypto_export.h"
// From <openssl/bio.h>
t... | // 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 CRYPTO_OPENSSL_BIO_STRING_H_
#define CRYPTO_OPENSSL_BIO_STRING_H_
#include <string>
#include "crypto/crypto_export.h"
// From <openssl/bio.h>
t... |
Remove useless comment from umbrella header | //
// PathKit.h
// PathKit
//
// Created by Kyle Fuller on 20/11/2014.
// Copyright (c) 2014 Cocode. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for PathKit.
FOUNDATION_EXPORT double PathKitVersionNumber;
//! Project version string for PathKit.
FOUNDATION_EXPORT const uns... | //
// PathKit.h
// PathKit
//
// Created by Kyle Fuller on 20/11/2014.
// Copyright (c) 2014 Cocode. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for PathKit.
FOUNDATION_EXPORT double PathKitVersionNumber;
//! Project version string for PathKit.
FOUNDATION_EXPORT const uns... |
Copy init brace conformance example, for structs | struct A
{
struct B
{
int i, j;
} b, c;
};
f(struct B *b)
{
struct A fine = {
.b = *b // XXX: should be no missing braces warning
};
struct A bad = {
.b = { *b }
};
}
| |
Add test for update function. | #include <stdlib.h>
#include <glib.h>
#include "bmi/bmi_cem.h"
static void test_bmi_initialize(void) {
BMI_Model *model = (BMI_Model *)malloc(sizeof(BMI_Model));
int status;
register_bmi_cem(model);
status = model->initialize(NULL, &(model->self));
g_assert_cmpint(status, ==, BMI_SUCCESS);
}
static vo... | #include <stdlib.h>
#include <glib.h>
#include "bmi/bmi_cem.h"
static void test_bmi_initialize(void) {
BMI_Model *model = (BMI_Model *)malloc(sizeof(BMI_Model));
int status;
register_bmi_cem(model);
status = model->initialize(NULL, &(model->self));
g_assert_cmpint(status, ==, BMI_SUCCESS);
}
static vo... |
Add our new method to get the list of installed layouts | #ifndef SRC_KEYBORD_LAYOUT_OBSERVER_H_
#define SRC_KEYBORD_LAYOUT_OBSERVER_H_
#include "nan.h"
using namespace v8; // NOLINT
class KeyboardLayoutObserver : public node::ObjectWrap {
public:
static void Init(Handle<Object> target);
void HandleKeyboardLayoutChanged();
private:
KeyboardLayoutObserver(NanCallb... | #ifndef SRC_KEYBORD_LAYOUT_OBSERVER_H_
#define SRC_KEYBORD_LAYOUT_OBSERVER_H_
#include "nan.h"
using namespace v8; // NOLINT
class KeyboardLayoutObserver : public node::ObjectWrap {
public:
static void Init(Handle<Object> target);
void HandleKeyboardLayoutChanged();
private:
KeyboardLayoutObserver(NanCallb... |
Fix UIPanGestureRecognizer property type; add property | @interface UIPanGestureRecognizer (Private)
@property (setter=_setHysteresis:) BOOL _hysteresis;
@end | @interface UIPanGestureRecognizer (Private)
@property (setter=_setHysteresis:) CGFloat _hysteresis;
@property (assign, nonatomic) BOOL failsPastMaxTouches;
@end |
Make ScopedOleInitializer work on windows if you aren't including build_config already. | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_APP_SCOPED_OLE_INITIALIZER_H_
#define CHROME_APP_SCOPED_OLE_INITIALIZER_H_
// Wraps OLE initialization in a cross-platform class meant... | // Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_APP_SCOPED_OLE_INITIALIZER_H_
#define CHROME_APP_SCOPED_OLE_INITIALIZER_H_
#include "base/logging.h"
#include "build/build_config.h"
... |
Format strings and more through test for stack floats | // RUN: %ucc -o %t %s
// RUN: %ocheck 0 %t
// RUN: %t | %output_check 'Hello 5 2.3' 'Hello 5 2.3'
// should run without segfaulting
main()
{
printf("Hello %d %.1f\n",
5,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3,
2.3); // this causes an infinite loop in glibc's printf()
pr... | // RUN: %ucc -o %t %s
// RUN: %ocheck 0 %t
// RUN: %t | %output_check 'Hello 5 5.9' '7.3 8.7 10.1 11.5 12.9 14.3 15.7 17.1 18.5 19.9' 'Hello 5 15.7' '14.3 12.9 11.5 10.1 8.7 7.3 5.9 4.5 3.1 1.7 0.3'
// should run without segfaulting
main()
{
printf("Hello %d %.1f\n"
"%.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %.1f %... |
Remove unused STL string include | /* 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... |
Add skeleton for callback and a few global vars | /*
* Copyright 2008 Markus Prinz
* Released unter an MIT licence
*
*/
#include <ruby.h>
VALUE crbCoreMidi;
void Init_rbcoremidi (void)
{
// Add the initialization code of your module here.
}
| /*
* Copyright 2008 Markus Prinz
* Released unter an MIT licence
*
*/
#include <ruby.h>
#include <CoreMIDI/CoreMIDI.h>
VALUE callback_proc = Qnil;
MIDIPortRef inPort = NULL;
MIDIClientRef client = NULL;
static void RbMIDIReadProc(const MIDIPacketList* packetList, void* readProcRefCon, void* srcConnRefCon)
{
... |
Fix the naming of the var's to match the actual naming. | //
// StravaKitOSX.h
// StravaKitOSX
//
// Created by Elmar Tampe on 04/12/14.
//
//
#import <UIKit/UIKit.h>
//! Project version number for StravaKitOSX.
FOUNDATION_EXPORT double StravaKitOSXVersionNumber;
//! Project version string for StravaKitOSX.
FOUNDATION_EXPORT const unsigned char StravaKitOSXVersionString... | //
// StravaKit.h
// StravaKit
//
// Created by Elmar Tampe on 04/12/14.
//
//
#import <UIKit/UIKit.h>
//! Project version number for StravaKit.
FOUNDATION_EXPORT double StravaKitVersionNumber;
//! Project version string for StravaKit.
FOUNDATION_EXPORT const unsigned char StravaKitVersionString[];
// In this he... |
Create file and read options | /* Standard libraries */
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int distance, n_ciclists, uniforme;
if (argc != 4) {
fprintf(stderr, "USAGE: %s d n [v|u]\n", argv[0]);
return EXIT_FAILURE;
}
distance = atoi(argv[1]);
n_ciclists = atoi(ar... | |
Change version, app and window name | #include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#define MY_UUID { 0x78, 0x1D, 0x21, 0x66, 0x09, 0x09, 0x4F, 0x9C, 0x88, 0xFD, 0x89, 0x9B, 0x04, 0xBF, 0x5E, 0x32 }
PBL_APP_INFO(MY_UUID,
"Template App", "Your Company",
1, 0, /* App version */
DEFAULT_MENU_... | #include "pebble_os.h"
#include "pebble_app.h"
#include "pebble_fonts.h"
#define MY_UUID { 0x78, 0x1D, 0x21, 0x66, 0x09, 0x09, 0x4F, 0x9C, 0x88, 0xFD, 0x89, 0x9B, 0x04, 0xBF, 0x5E, 0x32 }
PBL_APP_INFO(MY_UUID,
"Pomade", "Jon Speicher",
0, 1, /* App version */
DEFAULT_MENU_ICON,
... |
Change warning hint to be more useful | /*-
* Copyright (c) 2004 David E. O'Brien
* Copyright (c) 2004 Andrey A. Chernov
* 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 (c) 2004 David E. O'Brien
* Copyright (c) 2004 Andrey A. Chernov
* 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... |
Make emulator run for a little longer in non-interactive mode | //
// Non-interactive test runner just produces register traces and memory dumps
//
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/poll.h>
#include <stdarg.h>
#include "core.h"
#include "debug_info.h"
void runNonInteractive(Core *core)
{
int i;
enableTracing(core);
ru... | //
// Non-interactive test runner just produces register traces and memory dumps
//
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/poll.h>
#include <stdarg.h>
#include "core.h"
#include "debug_info.h"
void runNonInteractive(Core *core)
{
int i;
enableTracing(core);
fo... |
Fix broken connection in quick settings dock | #ifndef SETTINGS_DOCK_H
#define SETTINGS_DOCK_H
#include <QStringList>
#include <QWidget>
#include "dock.h"
namespace Ui
{
class SettingsDock;
}
class Profile;
class QEvent;
class QSettings;
class SettingsDock : public Dock
{
Q_OBJECT
public:
explicit SettingsDock(Profile *profile, QWidget *parent);
~Sett... | #ifndef SETTINGS_DOCK_H
#define SETTINGS_DOCK_H
#include <QStringList>
#include <QWidget>
#include "dock.h"
namespace Ui
{
class SettingsDock;
}
class Profile;
class QEvent;
class QSettings;
class SettingsDock : public Dock
{
Q_OBJECT
public:
explicit SettingsDock(Profile *profile, QWidget *parent);
~Sett... |
Set hook to block all ICMP packets | #include <linux/module.h>
#include <linux/kernel.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
static struct nf_hook_ops nfho;
unsigned int hook_func(unsigned int hooknum,
struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
int (*okfn)(struct sk_buff *))
{
return N... | #include <linux/module.h>
#include <linux/kernel.h>
#include <linux/netfilter.h>
#include <linux/netfilter_ipv4.h>
static struct nf_hook_ops nfho;
unsigned int hook_func(unsigned int hooknum,
struct sk_buff *skb,
const struct net_device *in,
const struct net_device *out,
int (*okfn)(struct sk_buff *))
{
socke... |
Add warn_unused_result to the ArgParse functions | #ifndef ARGPARSE_ArgObject_HDR
#define ARGPARSE_ArgObject_HDR
#include <string>
namespace ArgParse {
class ArgObject {
public:
typedef int Accept_t;
static const Accept_t No;
static const Accept_t WithArg;
static const Accept_t WithoutArg;
ArgObject();
virtual ~ArgObject();
virtual Accept_... | #ifndef ARGPARSE_ArgObject_HDR
#define ARGPARSE_ArgObject_HDR
#include <string>
namespace ArgParse {
class ArgObject {
public:
typedef int Accept_t;
static const Accept_t No;
static const Accept_t WithArg;
static const Accept_t WithoutArg;
ArgObject();
virtual ~ArgObject();
virtual Accept_... |
Change get_cycles to always return 0. | /*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1998, 1999, 2003 by Ralf Baechle
*/
#ifndef _ASM_TIMEX_H
#define _ASM_TIMEX_H
#ifdef __KERNEL__
#include <asm/mipsregs.h>... | /*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1998, 1999, 2003 by Ralf Baechle
*/
#ifndef _ASM_TIMEX_H
#define _ASM_TIMEX_H
#ifdef __KERNEL__
#include <asm/mipsregs.h>... |
Make root object protected to allow access to the root object from within subclasses. | /*=============================================================================
Library: XNAT/Core
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance wit... | /*=============================================================================
Library: XNAT/Core
Copyright (c) German Cancer Research Center,
Division of Medical and Biological Informatics
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance wit... |
Remove protocol from umbrella header | //
// RZCollectionList.h
// RZCollectionList
//
// Created by Nick Donaldson on 6/21/13.
// Copyright (c) 2013 Raizlabs. All rights reserved.
//
/************************************************************
*
* Include this file to get all the collection lists you need!
*
**************************************... | //
// RZCollectionList.h
// RZCollectionList
//
// Created by Nick Donaldson on 6/21/13.
// Copyright (c) 2013 Raizlabs. All rights reserved.
//
/************************************************************
*
* Include this file to get all the collection lists at once
*
****************************************... |
Define macros from inttypes.h when not available |
#ifndef _json_inttypes_h_
#define _json_inttypes_h_
#include "json_config.h"
#if defined(_MSC_VER) && _MSC_VER <= 1700
/* Anything less than Visual Studio C++ 10 is missing stdint.h and inttypes.h */
typedef __int32 int32_t;
#define INT32_MIN ((int32_t)_I32_MIN)
#define INT32_MAX ((int32_t)_I32_MAX)
typedef _... |
#ifndef _json_inttypes_h_
#define _json_inttypes_h_
#include "json_config.h"
#ifdef JSON_C_HAVE_INTTYPES_H
/* inttypes.h includes stdint.h */
#include <inttypes.h>
#else
#include <stdint.h>
#define PRId64 "I64d"
#define SCNd64 "I64d"
#endif
#endif
|
Print format if the length is longer than printf max length | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_vdprintf.c :+: :+: :+: ... | /* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_vdprintf.c :+: :+: :+: ... |
Print symbol names in backtrace | #include <kernel/panic.h>
#include <macros.h>
#include <stdio.h>
#include <types.h>
#define MAX_STACK_FRAME 10000
/*
* Walk up the stack and print the locations of each stack frame base.
*/
void bt(void) {
u32 *ebp, *eip;
unsigned int sf = 0;
/* Start form the current stack base */
asm volatile("mov %%ebp, %0... | #include <kernel/panic.h>
#include <elf.h>
#include <macros.h>
#include <stdio.h>
#include <types.h>
#define MAX_STACK_FRAME 10000
/*
* Walk up the stack and print the locations of each stack frame base.
*/
void bt(void) {
u32 *ebp, *eip;
unsigned int sf = 0;
/* Start form the current stack base */
asm volati... |
Remove now unused definition of phys_t. | /*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
* Copyright (C) 2008 Wind River Systems,
* written by Ralf Baechle
* Copyright (... | /*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1994, 1995, 1996, 1999 by Ralf Baechle
* Copyright (C) 2008 Wind River Systems,
* written by Ralf Baechle
* Copyright (... |
Fix indentation of Assert macros | //
// OCAObject.h
// Objective-Chain
//
// Created by Martin Kiss on 30.12.13.
// Copyright © 2014 Martin Kiss. All rights reserved.
//
#import <Foundation/Foundation.h>
#define OCA_atomic atomic
#define OCALazyGetter(TYPE, PROPERTY) \
@synthesize PROPERTY = _##PROPERTY; \
- (TYPE)PROPERTY { \
if ( ! self... | //
// OCAObject.h
// Objective-Chain
//
// Created by Martin Kiss on 30.12.13.
// Copyright © 2014 Martin Kiss. All rights reserved.
//
#import <Foundation/Foundation.h>
#define OCA_atomic atomic
#define OCALazyGetter(TYPE, PROPERTY) \
@synthesize PROPERTY = _##PROPERTY; \
- (TYPE)PROPERTY { \
if ( ! self... |
Fix for new Push signature | #pragma once
#ifndef DUKTAPE_H_INCLUDED
#error Duktape.h should be included before this header
#endif
#include <vector>
namespace dukbind
{
template< typename _Type_ >
void Push( duk_context * ctx, const std::vector<_Type_> & table )
{
size_t index, end = table.size();
duk_idx_t arr_... | #pragma once
#ifndef DUKTAPE_H_INCLUDED
#error Duktape.h should be included before this header
#endif
#include <vector>
namespace dukbind
{
template< typename _Type_ >
void Push( duk_context * ctx, const std::vector<_Type_> & table )
{
size_t index, end = table.size();
duk_idx_t arr_... |
Fix C-FFI: added pinned mark | // Copyright (c) <2015> <lummax>
// Licensed under MIT (http://opensource.org/licenses/MIT)
#ifndef RCIMMIXCONS_H
#define RCIMMIXCONS_H
#include <stdint.h>
#include <stdlib.h>
typedef struct {
size_t reference_count;
uint8_t spans_lines;
uint8_t forwarded;
uint8_t logged;
uint8_t marked;
uint... | // Copyright (c) <2015> <lummax>
// Licensed under MIT (http://opensource.org/licenses/MIT)
#ifndef RCIMMIXCONS_H
#define RCIMMIXCONS_H
#include <stdint.h>
#include <stdlib.h>
typedef struct {
size_t reference_count;
uint8_t spans_lines;
uint8_t forwarded;
uint8_t logged;
uint8_t marked;
uint... |
Remove references to Android from iOS API logger. | // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
#pragma once
#include "Types.h"
#if defined(EEGEO_DROID)
#include <android/log.h>
#define EXAMPLE_LOG(...) __android_log_print(ANDROID_LOG_INFO,"Eegeo_Examples",__VA_ARGS__)
#else
#define EXAMPLE_LOG(...) printf(__VA_ARGS__)
#endif
| // Copyright eeGeo Ltd (2012-2014), All Rights Reserved
#pragma once
#define EXAMPLE_LOG(...) printf(__VA_ARGS__)
|
Fix bug that was causing error building pod in RubyMotion project | //
// Copyright 2012 Ludovic Landry - http://about.me/ludoviclandry
//
// 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 ... | //
// Copyright 2012 Ludovic Landry - http://about.me/ludoviclandry
//
// 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 ... |
Add comment about ROBOTC "linking" |
#pragma config(Motor, port2, shooterleft, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port3, shooterright, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, spinnyintakeofdoomnumber1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, ga... |
#pragma config(Motor, port2, shooterleft, tmotorVex393_MC29, openLoop, reversed)
#pragma config(Motor, port3, shooterright, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port4, spinnyintakeofdoomnumber1, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port5, ga... |
Add page fault handler to abort on page fault. | #include "terminal.h"
#include "multiboot.h"
#include "pic.h"
#include "keyboard.h"
#include "frame_allocator.h"
#include "paging.h"
#include "assert.h"
//Calling convention on x86-64 System V ABI
//rdi, rsi, rdx, rcx for ints
void kernel_main(uintptr_t pmultiboot) {
init_terminal();
pic_init(0x20, 0x28);
pic_en... | #include "terminal.h"
#include "multiboot.h"
#include "pic.h"
#include "keyboard.h"
#include "frame_allocator.h"
#include "paging.h"
#include "assert.h"
//Calling convention on x86-64 System V ABI
//rdi, rsi, rdx, rcx for ints
void page_fault(void) {
terminal_printf("Fault");
assert(0!=0);
}
void kernel_main(uint... |
Add missing header to Forward codec | #pragma once
#include <spotify/json.hpp>
#include <noise/noise.h>
#include "noise/module/Wrapper.h"
namespace spotify
{
namespace json
{
template<>
struct default_codec_t<noise::module::Wrapper<noise::module::Forward>>
{
using ForwardWrapper = noise::module::Wrapper<noise::module::Forward>;
static codec::ob... | #pragma once
#include <spotify/json.hpp>
#include <noise/noise.h>
#include "noise/module/Wrapper.h"
#include "noise/module/Forward.h"
namespace spotify
{
namespace json
{
template<>
struct default_codec_t<noise::module::Wrapper<noise::module::Forward>>
{
using ForwardWrapper = noise::module::Wrapper<noise::modu... |
Fix typo on e_RelayDriverChannels declaration | #ifndef _RELAY_EXP_H_
#define _RELAY_EXP_H_
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <unistd.h>
#include <onion-mcp23008-driver.h>
#define RELAY_EXP_ADDR_SWITCH_NUM 3
#define RELAY_EXP_ADDR_SWITCH_DEFAULT_VAL "000"
// type definitions
typedef enum e_RelayDriverChannels {
RELAY_EXP_CHANNE... | #ifndef _RELAY_EXP_H_
#define _RELAY_EXP_H_
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <unistd.h>
#include <onion-mcp23008-driver.h>
#define RELAY_EXP_ADDR_SWITCH_NUM 3
#define RELAY_EXP_ADDR_SWITCH_DEFAULT_VAL "000"
// type definitions
typedef enum e_RelayDriverChannels {
RELAY_EXP_CHANNE... |
Check enqueued values in unit test | #include "mbb/test.h"
#include "mbb/queue.h"
#include "mbb/debug.h"
char *test_enqueue_dequeue()
{
int i;
MQUE_DEFINE_STRUCT(int, 5) queue;
MQUE_INITIALISE(&queue);
MUNT_ASSERT(MQUE_IS_EMPTY(&queue));
for (i = 1; i <= 5; i++) {
MUNT_ASSERT(!MQUE_IS_FULL(&queue));
MQUE_ENQUEUE(&queue, i);
}
for (i = 1; ... | #include "mbb/test.h"
#include "mbb/queue.h"
#include "mbb/debug.h"
char *test_enqueue_dequeue()
{
int i;
MQUE_DEFINE_STRUCT(int, 5) queue;
MQUE_INITIALISE(&queue);
MUNT_ASSERT(MQUE_IS_EMPTY(&queue));
for (i = 1; i <= 5; i++) {
MUNT_ASSERT(!MQUE_IS_FULL(&queue));
MQUE_ENQUEUE(&queue, i);
}
for (i = 1; ... |
Fix font size on rectangular watches | #pragma once
#include <pebble.h>
#define BG_COLOR GColorWhite
#ifdef PBL_ROUND
#define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12)
#else
#define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 2)
#endif
#define BPM_DEFAULT_BPM_T 1200
#define BPM_FONT FONT_KEY_BITHAM_42_BOLD
#define BPM_FONT_HEIGHT 42
#define ... | #pragma once
#include <pebble.h>
#define BG_COLOR GColorWhite
#ifdef PBL_ROUND
#define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12)
#else
#define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 2)
#endif
#define BPM_DEFAULT_BPM_T 1200
#define BPM_FONT FONT_KEY_BITHAM_42_BOLD
#define BPM_FONT_HEIGHT 42
#define ... |
Enable late move pruning at min 4 | #ifndef _CONFIG_H
#define _CONFIG_H
#define ENABLE_COUNTERMOVE_HISTORY 0
#define ENABLE_LMP_MIN_MOVES 0
#define ENABLE_HISTORY_PRUNE_DEPTH 4
#define ENABLE_NNUE 0
#define ENABLE_NNUE_SIMD 0
#endif
| #ifndef _CONFIG_H
#define _CONFIG_H
#define ENABLE_COUNTERMOVE_HISTORY 0
#define ENABLE_LMP_MIN_MOVES 4
#define ENABLE_HISTORY_PRUNE_DEPTH 4
#define ENABLE_NNUE 0
#define ENABLE_NNUE_SIMD 0
#endif
|
Make threshold function use absolute value of threshold value | #include "motion.h"
//Utilities
int threshold(int value, int threshold);
void reset_I2C_sensors(void);
//Driving
void drive(int y, int t = 0){
//y - Forwards/Backwards
//t - Turning (optional parameter)
motor[driveLeftFront] = y+t;
motor[driveRightFront] = y-t;
}
//Mogo (mobile goal lift)
void mogo(int power){
... | #include "motion.h"
//Utilities
int threshold(int value, int threshold);
void reset_I2C_sensors(void);
//Driving
void drive(int y, int t = 0){
//y - Forwards/Backwards
//t - Turning (optional parameter)
motor[driveLeftFront] = y+t;
motor[driveRightFront] = y-t;
}
//Mogo (mobile goal lift)
void mogo(int power){
... |
Change baud rate to 3mbps | #include <stdint.h>
#define STRIP_BLACK 0x8000
#define STRIP_PIXELS 50
#define USART_BAUD_RATE 115200
extern uint16_t* const strip_data;
void init();
void set_led(uint8_t state);
uint8_t get_button();
uint16_t get_voltage();
uint16_t get_current();
void strip_flush();
uint16_t pack_RGB(uint8_t red, uint8_t green,... | #include <stdint.h>
#define STRIP_BLACK 0x8000
#define STRIP_PIXELS 50
//#define USART_BAUD_RATE 115200
#define USART_BAUD_RATE 3000000
extern uint16_t* const strip_data;
void init();
void set_led(uint8_t state);
uint8_t get_button();
uint16_t get_voltage();
uint16_t get_current();
void strip_flush();
uint16_t pa... |
Comment file for the moment. | /**
* @file libARSAL/ARSAL.h
* @brief Library global header for libARSAL
* @date 04/12/2013
* @author nicolas.brulez@parrot.com
*/
#ifndef _ARSAL_H_
#define _ARSAL_H_
#include <libARSAL/ARSAL_Endianness.h>
#include <libARSAL/ARSAL_Ftw.h>
#include <libARSAL/ARSAL_Mutex.h>
#include <libARSAL/ARSAL_Print.h>
#include... | /**
* @file libARSAL/ARSAL.h
* @brief Library global header for libARSAL
* @date 04/12/2013
* @author nicolas.brulez@parrot.com
*/
#ifndef _ARSAL_H_
#define _ARSAL_H_
#include <libARSAL/ARSAL_Endianness.h>
//#include <libARSAL/ARSAL_Ftw.h>
#include <libARSAL/ARSAL_Mutex.h>
#include <libARSAL/ARSAL_Print.h>
#inclu... |
Fix command in path_nofun SV-COMP example | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern int __VERIFIER_nondet_int();
int main()
{
int x, y;
if (__VERIFIER_nondet_int())
{
x = 0;
y = 1;
}
else
{
x = 1;
y = 0;
}
// if (!(x + y == 1))
if (x + y != 1)
__VERIFIER_e... | extern void __VERIFIER_error() __attribute__ ((__noreturn__));
extern int __VERIFIER_nondet_int();
int main()
{
int x, y;
if (__VERIFIER_nondet_int())
{
x = 0;
y = 1;
}
else
{
x = 1;
y = 0;
}
// if (!(x + y == 1))
if (x + y != 1)
__VERIFIER_e... |
Add support for react-native < 0.40 | #import <React/RCTBridgeModule.h>
@interface RNI18n : NSObject <RCTBridgeModule>
@end
| #if __has_include("RCTBridgeModule.h")
#import "RCTBridgeModule.h"
#else
#import <React/RCTBridgeModule.h>
#endif
@interface RNI18n : NSObject <RCTBridgeModule>
@end
|
Include sys/resource.h for struct rusage | /*
*
* Copyright 2018 Asylo authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | /*
*
* Copyright 2018 Asylo authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
Add reference to register class to cpureg | #ifndef JIVE_ARCH_REGISTERS_H
#define JIVE_ARCH_REGISTERS_H
typedef struct jive_cpureg jive_cpureg;
typedef struct jive_regcls jive_regcls;
struct jive_cpureg {
const char name[32];
};
#endif
| #ifndef JIVE_ARCH_REGISTERS_H
#define JIVE_ARCH_REGISTERS_H
typedef struct jive_cpureg jive_cpureg;
typedef struct jive_regcls jive_regcls;
struct jive_cpureg {
const jive_regcls * regcls;
const char name[32];
};
#endif
|
Update crash diagnostics test to avoid attempting to write into various directories if possible and to not require %t to have "Output" in the name. | // RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: not %clang -fcrash-diagnostics-dir=%t -c %s 2>&1 | FileCheck %s
#pragma clang __debug parser_crash
// CHECK: Preprocessed source(s) and associated run script(s) are located at:
// CHECK: diagnostic msg: {{.*}}Output{{/|\\}}crash-diagnostics-dir.c.tmp{{(/|\\).*}}.c
| // RUN: rm -rf %t
// RUN: mkdir -p %t
// RUN: not %clang -fcrash-diagnostics-dir=%t -c %s -o - 2>&1 | FileCheck %s
#pragma clang __debug parser_crash
// CHECK: Preprocessed source(s) and associated run script(s) are located at:
// CHECK: diagnostic msg: {{.*}}{{/|\\}}crash-diagnostics-dir.c.tmp{{(/|\\).*}}.c
|
Update driver version to 5.02.00-k15 | /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2010 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k14"
| /*
* QLogic iSCSI HBA Driver
* Copyright (c) 2003-2010 QLogic Corporation
*
* See LICENSE.qla4xxx for copyright and licensing details.
*/
#define QLA4XXX_DRIVER_VERSION "5.02.00-k15"
|
Add likely and unlikely macros. | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#ifndef _UTILS_BUILTIN_H
#define _UTILS_BUILTIN_H
/* macros for accessing compiler b... | /*
* Copyright 2014, NICTA
*
* This software may be distributed and modified according to the terms of
* the BSD 2-Clause license. Note that NO WARRANTY is provided.
* See "LICENSE_BSD2.txt" for details.
*
* @TAG(NICTA_BSD)
*/
#ifndef _UTILS_BUILTIN_H
#define _UTILS_BUILTIN_H
/* macros for accessing compiler b... |
Remove empty constructors etc from TASubstance | #ifndef __OBJ_APPLIED_SUB_H
#define __OBJ_APPLIED_SUB_H
#include "obj.h"
// stub object relating to ranger herbalism
class TASubstance : public TObj {
public:
virtual void assignFourValues(int, int, int, int) { }
virtual void getFourValues(int *a, int *b, int *c, int *d) const { *a = *b = *c = *d = 0; }
... | #ifndef __OBJ_APPLIED_SUB_H
#define __OBJ_APPLIED_SUB_H
#include "obj.h"
// stub object relating to ranger herbalism
class TASubstance : public TObj {
public:
virtual void assignFourValues(int, int, int, int) { }
virtual void getFourValues(int *a, int *b, int *c, int *d) const { *a = *b = *c = *d = 0; }
... |
Fix Win32 build for TLS | /* */
#undef VERSION
#define VERSION "1.37.17"
#define BDATE "06 May 2005"
#define LSMDATE "06May05"
/* Debug flags */
#undef DEBUG
#define DEBUG 1
#define TRACEBACK 1
#define SMCHECK
#define TRACE_FILE 1
/* If this is set stdout will not be closed on startup */
#define DEVELOPER 1
/* Debug flags not normally ... | /* */
#undef VERSION
#define VERSION "1.37.17"
#define BDATE "07 May 2005"
#define LSMDATE "07May05"
/* Debug flags */
#undef DEBUG
#define DEBUG 1
#define TRACEBACK 1
#define SMCHECK
#define TRACE_FILE 1
/* If this is set stdout will not be closed on startup */
#define DEVELOPER 1
/* Debug flags not normally ... |
Add relational traces example where write would fail | // SKIP PARAM: --sets ana.activated[+] octApron --sets exp.solver.td3.side_widen cycle_self
// requires cycle_self to pass with protection
#include <pthread.h>
#include <assert.h>
int g = 25; // matches write in main
int h = 12; // matches write in main
pthread_mutex_t A = PTHREAD_MUTEX_INITIALIZER;
void *t_fun(void ... | |
Remove debugging lines from kernel logger | #include <libk/klog.h>
void initialize_klog() {
initialize_serial_port(COM1);
kputs("initing");
write_serial_string(COM1, "Logger initialized\n");
kputs("inited");
}
void klog(char *message) {
write_serial_string(COM1, message);
}
| #include <libk/klog.h>
void initialize_klog() {
initialize_serial_port(COM1);
write_serial_string(COM1, "Logger initialized!\n");
}
void klog(char *message) {
write_serial_string(COM1, message);
}
|
Add macro to declare SFINAE based traits | #pragma once
#include <type_traits>
#include <iostream>
namespace rc {
namespace detail {
namespace sfinae {
template<typename T, typename = decltype(std::declval<T>() == std::declval<T>())>
std::true_type isEqualityComparable(const T &);
std::false_type isEqualityComparable(...);
template<typename T, typename = de... | #pragma once
#include <type_traits>
#include <iostream>
namespace rc {
namespace detail {
#define RC_SFINAE_TRAIT(Name, expression) \
namespace sfinae { \
template<typename T, typename = expression> \
... |
Add DeviceNotFoundException throw on mac | /*
This file is part of Android File Transfer For Linux.
Copyright (C) 2015 Vladimir Menshakov
Android File Transfer For Linux 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 3... | /*
This file is part of Android File Transfer For Linux.
Copyright (C) 2015 Vladimir Menshakov
Android File Transfer For Linux 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 3... |
Fix the wrong comment on the header guard | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/*
* Copyright (C) 2014 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
* versi... | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/*
* Copyright (C) 2014 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
* versi... |
Add solution to Exercise 2-1. | /* A solution to Exercise 2-1 in The C Programming Language (Second Edition).
*/
#include <float.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
puts("Using macros from standard headers:");
printf(" Range of \"char\": %d to %d\n", SCHAR_MIN, SCHAR_MAX);
printf(" Range of \"unsi... | |
Make renderer to work properly | #include "local-loop.h"
#include "../voxtrees/search.h"
void vox_local_loop (struct vox_node *tree, int n, void (*action) (vox_rnd_context*), \
void (*inc) (vox_rnd_context*), vox_rnd_context *ctx)
{
int i, state, pn;
int depth = 1;
vox_tree_path path;
pn = vox_ray_tree_intersecti... | #include "local-loop.h"
#include "../voxtrees/search.h"
void vox_local_loop (struct vox_node *tree, int n, void (*action) (vox_rnd_context*), \
void (*inc) (vox_rnd_context*), vox_rnd_context *ctx)
{
int i, state, pn;
int depth = 1;
vox_tree_path path;
pn = vox_ray_tree_intersecti... |
Add missing includes for fork() and perror() | /*
* This program handles SIGINT and forwards it to another process.
* It is intended to be run as PID 1.
*
* Docker starts processes with "docker run" as PID 1.
* On Linux, the default signal handler for PID 1 ignores any signals.
* Therefore Ctrl-C aka SIGINT is ignored per default.
*/
#include <signal.h>
#in... | /*
* This program handles SIGINT and forwards it to another process.
* It is intended to be run as PID 1.
*
* Docker starts processes with "docker run" as PID 1.
* On Linux, the default signal handler for PID 1 ignores any signals.
* Therefore Ctrl-C aka SIGINT is ignored per default.
*/
#include <unistd.h>
#in... |
Fix warnings and errors brought up by VS2012 code analyzer. | /**********************************************************************
*
* PROJECT: Platform library
* FILE: Utils.c
* LICENCE: See Licence.txt
* PURPOSE: Various platform independent utility functions.
*
* (c) Tuomo Jauhiainen 2013
*
***********************************************************... | /**********************************************************************
*
* PROJECT: Platform library
* FILE: Utils.c
* LICENCE: See Licence.txt
* PURPOSE: Various platform independent utility functions.
*
* (c) Tuomo Jauhiainen 2013
*
***********************************************************... |
Insert 2 UILabel as property : *switchOnLabel, *switchOffLabel, allow the action function - (void)changeHint:(UISwitch *)userSwitch; to access them. | /**************************************************************************************************
* File name : ViewController.h
* Description : Define the ViewController class.
* Creator : Frederick Hsu
* Creation date: Thu. 23 Feb. 2017
* Copyright(C 2017 All rights reserved.
*
****************... | /**************************************************************************************************
* File name : ViewController.h
* Description : Define the ViewController class.
* Creator : Frederick Hsu
* Creation date: Thu. 23 Feb. 2017
* Copyright(C 2017 All rights reserved.
*
****************... |
Make sure to use proper name mangling | /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Module: $URL$
Copyright (c) 2006-2010 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is dist... | /*=========================================================================
Program: GDCM (Grassroots DICOM). A DICOM library
Module: $URL$
Copyright (c) 2006-2010 Mathieu Malaterre
All rights reserved.
See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.
This software is dist... |
Update Client Version for New Code Base | #ifndef CLIENTVERSION_H
#define CLIENTVERSION_H
//
// client versioning
//
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 2
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0
// Set to ... | #ifndef CLIENTVERSION_H
#define CLIENTVERSION_H
//
// client versioning
//
// These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it
#define CLIENT_VERSION_MAJOR 1
#define CLIENT_VERSION_MINOR 2
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 1
// Set to ... |
Add the interface method for OnDisplayChange | // Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
#include <Windows.h>
#include "../HotkeyProcessor.h"
#include "../MeterWnd/MeterWnd.h"
#include "../Settings.h"
#include "../Window.h"
#include "OSDType.h"
class Monitor;
class OSD : Ho... | // Copyright (c) 2015, Matthew Malensek.
// Distributed under the BSD 2-Clause License (see LICENSE.txt for details)
#pragma once
#include <Windows.h>
#include "../HotkeyProcessor.h"
#include "../MeterWnd/MeterWnd.h"
#include "../Settings.h"
#include "../Window.h"
#include "OSDType.h"
class Monitor;
class OSD : Ho... |
Add guarded 'extern "C"' attributes so that this header files can be used from both C and C++ programs. | // Harshad Kasture
//
// This file declares the user level message passing functions used in multithreaded applications
// for the multicore simulator.
#ifndef CAPI_H
#define CAPI_H
typedef int CAPI_return_t;
typedef int CAPI_endpoint_t;
// externed so the names don't get name-mangled
//extern "C" {
CAPI_retur... | // Harshad Kasture
//
// This file declares the user level message passing functions used in multithreaded applications
// for the multicore simulator.
#ifndef CAPI_H
#define CAPI_H
typedef int CAPI_return_t;
typedef int CAPI_endpoint_t;
#ifdef __cplusplus
// externed so the names don't get name-mangled
extern "C"... |
Watch for input from stdin and print it. | #include <stdio.h>
#include <sys/select.h>
/* pselect loop test */
int main(int argc, char *argv[])
{
struct timespec timeout;
fd_set readfds;
int fdcount;
while(1){
FD_ZERO(&readfds);
FD_SET(0, &readfds);
timeout.tv_sec = 1;
timeout.tv_nsec = 0;
fdcount = pselect(1, &readfds, NULL, NULL, &timeout, NUL... | #include <stdio.h>
#include <sys/select.h>
/* pselect loop test */
int main(int argc, char *argv[])
{
struct timespec timeout;
fd_set readfds;
int fdcount;
char buf[1024];
while(1){
FD_ZERO(&readfds);
FD_SET(0, &readfds);
timeout.tv_sec = 1;
timeout.tv_nsec = 0;
fdcount = pselect(1, &readfds, NULL, NU... |
Add EventSystem shim missed in r588. | #ifndef EVENT_SYSTEM_H
#define EVENT_SYSTEM_H
#include <event/event_thread.h>
/*
* XXX
* This is kind of an awful shim while we move
* towards something thread-oriented.
*/
class EventSystem {
EventThread td_;
private:
EventSystem(void)
: td_()
{ }
~EventSystem()
{ }
public:
Action *poll(const EventPoll... | |
Implement forked registerAllTranslations() as registerMlirTranslations() | // Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... | |
Implement stack with single linked list | #include <stdio.h>
#include <stdlib.h>
typedef struct Node{
int val;
struct Node *next;
}Node;
Node* Push(Node *p, int val){
Node *temp = (struct Node*)malloc(sizeof(struct Node));
temp->val = val;
temp->next = p;
p = temp;
return p;
}
void Pop(Node *p){
if(p == NULL)
return;
printf("%p\n",p);
Node *temp ... | #include <stdio.h>
#include <stdlib.h>
typedef struct Node{
int val;
struct Node *next;
}Node;
Node* Push(Node *p, int val){
Node *temp = (struct Node*)malloc(sizeof(struct Node));
temp->val = val;
temp->next = p;
p = temp;
return p;
}
Node* Pop(Node *p){
if(p == NULL)
return;
Node *temp = p;
p = p->next;... |
Fix reference to UIImage when compiled for OS X. | //
// MBImageRequest.h
// MBRequest
//
// Created by Sebastian Celis on 3/6/12.
// Copyright (c) 2012 Mobiata, LLC. All rights reserved.
//
#if __IPHONE_OS_VERSION_MIN_REQUIRED
#import <UIKit/UIKit.h>
#elif __MAC_OS_X_VERSION_MIN_REQUIRED
#import <Cocoa/Cocoa.h>
#endif
#import "MBHTTPRequest.h"
#if __IPHONE_OS_V... | //
// MBImageRequest.h
// MBRequest
//
// Created by Sebastian Celis on 3/6/12.
// Copyright (c) 2012 Mobiata, LLC. All rights reserved.
//
#if __IPHONE_OS_VERSION_MIN_REQUIRED
#import <UIKit/UIKit.h>
#elif __MAC_OS_X_VERSION_MIN_REQUIRED
#import <Cocoa/Cocoa.h>
#endif
#import "MBHTTPRequest.h"
#if __IPHONE_OS_V... |
Fix an off-by-1 in FTRACE_SYSCALL_MAX. | #ifndef __ASM_SH_FTRACE_H
#define __ASM_SH_FTRACE_H
#ifdef CONFIG_FUNCTION_TRACER
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
#define FTRACE_SYSCALL_MAX (NR_syscalls - 1)
#ifndef __ASSEMBLY__
extern void mcount(void);
#define MCOUNT_ADDR ((long)(mcount))
#ifdef CONFIG_DYNAMIC_FTRACE
#define CALL_ADDR ((l... | #ifndef __ASM_SH_FTRACE_H
#define __ASM_SH_FTRACE_H
#ifdef CONFIG_FUNCTION_TRACER
#define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */
#define FTRACE_SYSCALL_MAX NR_syscalls
#ifndef __ASSEMBLY__
extern void mcount(void);
#define MCOUNT_ADDR ((long)(mcount))
#ifdef CONFIG_DYNAMIC_FTRACE
#define CALL_ADDR ((long)(f... |
Add a check to see if DLog is already defined. | //
// LolayHttpClientGlobals.h
// LolayHttpClientGlobals
//
// Created by Bruce Johnson on 5/9/14.
// Copyright (c) 2014 Lolay. All rights reserved.
//
#if DEBUG
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
# define NSLog(...) NSLog(__VA_ARGS__)
#else
# define... | //
// LolayHttpClientGlobals.h
// LolayHttpClientGlobals
//
// Created by Bruce Johnson on 5/9/14.
// Copyright (c) 2014 Lolay. All rights reserved.
//
#ifndef DLog
#if DEBUG
# define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
# define NSLog(...) NSLog(__VA_ARGS__)
#... |
Comment the main for import as a library in the function of the least common divisor (LCD) | #include<stdio.h>
/* CALC GREATEST COMMON DIVISOR BY EUCLIDES ALGORITHM
* r -> remainder
* q -> quotient
*/
int calc_gcd(int n1, int n2, int r, int q){
if (r == 0)
return n2;
return calc_gcd(n2,r,n2 % r, n2 / r);
}
/* FIRE UP THE FUNCTION GCD
*/
int gcd(int n1, int n2){
if ( n1 > n2 )
... | #include<stdio.h>
/* CALC GREATEST COMMON DIVISOR BY EUCLIDES ALGORITHM
* r -> remainder
* q -> quotient
*/
int calc_gcd(int n1, int n2, int r, int q){
if (r == 0)
return n2;
return calc_gcd(n2,r,n2 % r, n2 / r);
}
/* FIRE UP THE FUNCTION GCD
*/
int gcd(int n1, int n2){
if ( n1 > n2 )
... |
Add macro for errors in tests | /*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_TEST_TEST_COMMON_H
#define VISTK_TEST_TEST_COMMON_H
#define EXPECT_EXCEPTION(e... | /*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_TEST_TEST_COMMON_H
#define VISTK_TEST_TEST_COMMON_H
#define TEST_ERROR(msg) ... |
Apply prefix to include guard | //! \file
#ifndef JSONSERIALIZER_H
#define JSONSERIALIZER_H
#include <iostream>
#include "ArticleCollection.h"
namespace WikiWalker
{
/*! Serialize AricleCollection from and to a custom JSON format
*/
class JsonSerializer
{
public:
/*! Serialize ArticleCollection to JSON in an output stream
* \p... | //! \file
#ifndef WIKIWALKER_JSONSERIALIZER_H
#define WIKIWALKER_JSONSERIALIZER_H
#include <iostream>
#include "ArticleCollection.h"
namespace WikiWalker
{
/*! Serialize AricleCollection from and to a custom JSON format
*/
class JsonSerializer
{
public:
/*! Serialize ArticleCollection to JSON in an o... |
Set the header protection to end with _H. | #ifndef MATH_CONTAINER
#define MATH_CONTAINER
#include <iostream>
#include <vector>
#include <complex>
#include <algorithm>
#include <cmath>
/********************************/
/*Find the index during the sort*/
/********************************/
template<typename T> class CompareIndicesByAnotherVectorValues
{
c... | #ifndef MATH_CONTAINER_H
#define MATH_CONTAINER_H
#include <iostream>
#include <vector>
#include <complex>
#include <algorithm>
#include <cmath>
/********************************/
/*Find the index during the sort*/
/********************************/
template<typename T> class CompareIndicesByAnotherVectorValues
{
... |
Move LRImageOperation inputs and outputs to an appropriate category | //
// LRImageOperation+Private.h
// iShows
//
// Created by Luis Recuenco on 19/05/13.
// Copyright (c) 2013 Luis Recuenco. All rights reserved.
//
#import "LRImageOperation.h"
@interface LRImageOperation (Private)
// Inputs
@property (nonatomic, strong, readonly) NSURL *url;
@property (nonatomic, assign, readon... | |
Add a comment to mention the memory ownership situation. | //===--- CodeGen/ModuleBuilder.h - Build LLVM from ASTs ---------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... | //===--- CodeGen/ModuleBuilder.h - Build LLVM from ASTs ---------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===-------------------------------------------------------... |
Change style 0 == Index to Index == 0 | /** @file
Base Library CPU Functions for all architectures.
Copyright (c) 2006 - 2008, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full ... | /** @file
Base Library CPU Functions for all architectures.
Copyright (c) 2006 - 2008, Intel Corporation<BR>
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full ... |
Add a new frame types. | #ifndef TLSCA_SVR__ALL_H_
#define TLSCA_SVR__ALL_H_
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <ft.h>
#include <tlsca.h>
#include <seacatcc.h>
struct sca_app;
extern struct sca_app sca_app;
#include "config.h"
#include "app.h"
#include "reactor.h"
#include "cntl.h"
#endif //TLSCA_SVR__ALL... | #ifndef TLSCA_SVR__ALL_H_
#define TLSCA_SVR__ALL_H_
#include <stdlib.h>
#include <stdio.h>
#include <pthread.h>
#include <ft.h>
#include <tlsca.h>
#include <seacatcc.h>
struct sca_app;
extern struct sca_app sca_app;
#include "config.h"
#include "app.h"
#include "reactor.h"
#include "cntl.h"
enum sca_frame_type
{
... |
Fix ESSSort to work with non-object properties | //
// NSSortDescriptor+Essentials.h
// Essentials
//
// Created by Martin Kiss on 11.4.14.
// Copyright (c) 2014 iAdverti. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef enum : BOOL {
ESSSortDescending = NO,
ESSSortAscending = YES,
} ESSSort;
@interface NSSortDescriptor (Essentials... | //
// NSSortDescriptor+Essentials.h
// Essentials
//
// Created by Martin Kiss on 11.4.14.
// Copyright (c) 2014 iAdverti. All rights reserved.
//
#import <Foundation/Foundation.h>
typedef enum : BOOL {
ESSSortDescending = NO,
ESSSortAscending = YES,
} ESSSort;
@interface NSSortDescriptor (Essentials... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.