Instruction stringlengths 14 778 | input_code stringlengths 0 4.24k | output_code stringlengths 1 5.44k |
|---|---|---|
Fix TestDebugBreak.py failure with gcc, for loop declarations are not allowed by default with gcc | #ifdef _MSC_VER
#include <intrin.h>
#define BREAKPOINT_INTRINSIC() __debugbreak()
#else
#define BREAKPOINT_INTRINSIC() __asm__ __volatile__ ("int3")
#endif
int
bar(int const *foo)
{
int count = 0;
for (int i = 0; i < 10; ++i)
{
count += 1;
BREAKPOINT_INTRINSIC();
count += 1;
... | #ifdef _MSC_VER
#include <intrin.h>
#define BREAKPOINT_INTRINSIC() __debugbreak()
#else
#define BREAKPOINT_INTRINSIC() __asm__ __volatile__ ("int3")
#endif
int
bar(int const *foo)
{
int count = 0, i = 0;
for (; i < 10; ++i)
{
count += 1;
BREAKPOINT_INTRINSIC();
count += 1;
... |
Adjust to changes in slcd library | #include <avr/io.h>
#include <util/delay.h>
#include "slcd.h"
int main()
{
init_lcd();
uint8_t backlit = 1;
while (1)
{
lcd_clrscr();
lcd_goto(LINE1);
lcd_puts("Line 1", backlit);
lcd_goto(LINE2);
lcd_puts("Line 2", backlit);
lcd_goto(LINE3);
lcd_puts("Line 3", backlit);
l... | #include <avr/io.h>
#include <util/delay.h>
#include "slcd.h"
int main()
{
init_lcd();
uint8_t backlit = 1;
while (1)
{
lcd_clrscr();
lcd_goto(0, 0);
lcd_puts("Line 1", backlit);
lcd_goto(1, 0);
lcd_puts("Line 2", backlit);
lcd_goto(2, 0);
lcd_puts("Line 3", backlit);
lcd_... |
Update with new lefty, fixing many bugs and supporting new features | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright (... | /* $Id$ $Revision$ */
/* vim:set shiftwidth=4 ts=8: */
/**********************************************************
* This software is part of the graphviz package *
* http://www.graphviz.org/ *
* *
* Copyright ... |
Add mutable deep link to sdk header. | #import "DPLTargetViewControllerProtocol.h"
#import "DPLDeepLinkRouter.h"
#import "DPLRouteHandler.h"
#import "DPLDeepLink.h"
#import "DPLErrors.h"
| #import "DPLTargetViewControllerProtocol.h"
#import "DPLDeepLinkRouter.h"
#import "DPLRouteHandler.h"
#import "DPLDeepLink.h"
#import "DPLMutableDeepLink.h"
#import "DPLErrors.h"
|
Rename dbg struct to Debug. | /*
Copyright libCellML Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwa... | /*
Copyright libCellML Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwa... |
Add a linked list to itself | /* last written on 11/09/2017 16:34:14
owner ise2017001 rajaneesh
@devrezo on twitter
@devrezo on github
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct node {
int data;
struct node *next;
};
struct node *createNode (int value) {
struct node *newNode = (struct node *) malloc... | |
Introduce a PushSubscriptionOptions struct in the Blink API. | // Copyright 2015 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 WebPushSubscriptionOptions_h
#define WebPushSubscriptionOptions_h
namespace blink {
struct WebPushSubscriptionOptions {
WebPushSubscriptionO... | |
Fix typo in compareMath doxygen documentation. | /*
Copyright libCellML Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwa... | /*
Copyright libCellML Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwa... |
Fix build break from the future. | // 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 CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
#define CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
#pragma once
#include "base/basictypes.h"
#include ... | // 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 CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
#define CHROME_RENDERER_WEBVIEW_COLOR_OVERLAY_H_
#pragma once
#include "base/basictypes.h"
#include ... |
Check that bodies and calls but not declarations are marked nounwind when compiling without -fexceptions. | // RUN: %llvmgcc -S -o - %s | grep nounwind | count 2
// RUN: %llvmgcc -S -o - %s | not grep {declare.*nounwind}
void f(void);
void g(void) {
f();
}
| |
Test case for r120740. Radar 8712503. | // RUN: %llvmgcc -S %s -o - | llvm-as -o /dev/null
// Don't crash on a common-linkage constant global.
extern const int kABSourceTypeProperty;
int foo(void) {
return kABSourceTypeProperty;
}
const int kABSourceTypeProperty;
| |
Make sure to do sanity checking before any of the reading. | #include <iobuf/iobuf.h>
#include <str/str.h>
/** Read the remainder of the \c ibuf into the \c str. */
int ibuf_readall(ibuf* in, str* out)
{
for (;;) {
if (!str_catb(out,
in->io.buffer+in->io.bufstart,
in->io.buflen-in->io.bufstart))
return 0;
in->io.bufstart = in->io.buflen;
if (!ibuf_re... | #include <iobuf/iobuf.h>
#include <str/str.h>
/** Read the remainder of the \c ibuf into the \c str. */
int ibuf_readall(ibuf* in, str* out)
{
if (ibuf_eof(in)) return 1;
if (ibuf_error(in)) return 0;
for (;;) {
if (!str_catb(out,
in->io.buffer+in->io.bufstart,
in->io.buflen-in->io.bufstart))
r... |
Add default config for USB OTG FS peripheral | /*
* Copyright (C) 2019 Koen Zandberg
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/
/**
* @ingroup boards_common_stm32
* @{
*
* @file
* @brief Common configuration for STM... | |
Fix a lexical token ordering issue | /*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef LEXER_H
#define LEXER_H
#include <stdlib.h>
#include "linked_list.h"
enum ctache_token_type {
/... | /*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef LEXER_H
#define LEXER_H
#include <stdlib.h>
#include "linked_list.h"
enum ctache_token_type {
/... |
Add a numargs field to struct function, which refers to the number of arguments the function takes. | #include <stdlib.h>
#include <stdio.h>
struct llnode;
struct symbol;
struct function;
union value;
struct variable;
struct statement;
struct call;
struct llnode {
struct type* car;
struct llnode* cdr;
};
struct call {
char* name;
struct function func;
struct symbol* arguments;
int numargs;
}
struct s... | #include <stdlib.h>
#include <stdio.h>
struct llnode;
struct symbol;
struct function;
union value;
struct variable;
struct statement;
struct call;
struct llnode {
struct variable* car;
struct llnode* cdr;
};
struct call {
char* name;
struct function func;
struct symbol* arguments;
int numargs;
}
stru... |
Fix a typo in the argument type. | /* trace.h
* Copyright: (When this is determined...it will go here)
* CVS Info
* $Id$
* Overview:
* Tracing support for runops_cores.c.
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#ifndef PARROT_TRACE_H_GUARD
#define PARROT_TRACE_H_GUARD
#include "parrot/parrot.h"
v... | /* trace.h
* Copyright: (When this is determined...it will go here)
* CVS Info
* $Id$
* Overview:
* Tracing support for runops_cores.c.
* Data Structure and Algorithms:
* History:
* Notes:
* References:
*/
#ifndef PARROT_TRACE_H_GUARD
#define PARROT_TRACE_H_GUARD
#include "parrot/parrot.h"
v... |
Use pair<'const' Key, Value> in defining MaterialMap type | #pragma once
#include <string>
#include <map>
#include <Eigen/Dense>
typedef std::map<std::string, Eigen::Vector4d, std::less<std::string>,
Eigen::aligned_allocator<
std::pair<std::string, Eigen::Vector4d> > > MaterialMap;
| #pragma once
#include <string>
#include <map>
#include <Eigen/Dense>
typedef std::map<std::string, Eigen::Vector4d, std::less<std::string>,
Eigen::aligned_allocator<
std::pair<const std::string,
Eigen::Vector4d> > > MaterialMap;
|
Print an error when lstopo fails to export to X... | /*
* Copyright © 2009 CNRS
* Copyright © 2009-2010 INRIA. All rights reserved.
* Copyright © 2009 Université Bordeaux 1
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
*/
#include <private/autogen/config.h>
#ifdef HWLOC_HAVE_XML
#include <hwloc.h>
#inclu... | /*
* Copyright © 2009 CNRS
* Copyright © 2009-2010 INRIA. All rights reserved.
* Copyright © 2009 Université Bordeaux 1
* Copyright © 2009-2011 Cisco Systems, Inc. All rights reserved.
* See COPYING in top-level directory.
*/
#include <private/autogen/config.h>
#ifdef HWLOC_HAVE_XML
#include <hwloc.h>
#inclu... |
Support wu-ftpd-like chrooting in /etc/passwd. If home directory ends with "/./", it's chrooted to. | /* Copyright (C) 2002-2003 Timo Sirainen */
#include "config.h"
#undef HAVE_CONFIG_H
#ifdef USERDB_PASSWD
#include "common.h"
#include "userdb.h"
#include <pwd.h>
static void passwd_lookup(const char *user, userdb_callback_t *callback,
void *context)
{
struct user_data data;
struct passwd *pw;
pw = getpwn... | /* Copyright (C) 2002-2003 Timo Sirainen */
#include "config.h"
#undef HAVE_CONFIG_H
#ifdef USERDB_PASSWD
#include "common.h"
#include "userdb.h"
#include <pwd.h>
static void passwd_lookup(const char *user, userdb_callback_t *callback,
void *context)
{
struct user_data data;
struct passwd *pw;
size_t len;
... |
Add RETJMP for jumping to dynamic addresses | #pragma once
#include <stdint.h>
#define ASMJMP(a) _asm { mov CPatcher::uJumpBuffer, a } _asm { jmp CPatcher::uJumpBuffer }
typedef void (*tfnHookFunc)(void);
class CPatcher {
public:
static void InstallHook(uint32_t uAddress, void (*pfnFunc)(void));
static void UninstallHook(uint32_t uAddress, uint8_t uFirstByte... | #pragma once
#include <stdint.h>
#define ASMJMP(a) _asm { mov CPatcher::uJumpBuffer, a } _asm { jmp CPatcher::uJumpBuffer }
#define RETJMP(a) _asm { push a } _asm { ret }
typedef void (*tfnHookFunc)(void);
class CPatcher {
public:
static void InstallHook(uint32_t uAddress, void (*pfnFunc)(void));
static void Unin... |
Use an unsigned long offset instead of int. | /*
* OsmTileSource.h
* RunParticles
*
* Created by Doug Letterman on 6/30/14.
* Copyright 2014 Doug Letterman. All rights reserved.
*
*/
#ifndef OSMTILESOURCE_H
#define OSMTILESOURCE_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include "Singleton.h"
#include "math.h"
s... | /*
* OsmTileSource.h
* RunParticles
*
* Created by Doug Letterman on 6/30/14.
* Copyright 2014 Doug Letterman. All rights reserved.
*
*/
#ifndef OSMTILESOURCE_H
#define OSMTILESOURCE_H
#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include "Singleton.h"
#include "math.h"
s... |
Add definitions for atio and atol. | #ifndef _FXCG_STDLIB_H
#define _FXCG_STDLIB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
long abs(long n);
void free(void *p);
void *malloc(size_t sz);
void *realloc(void *p, size_t sz);
int rand(void);
void srand(unsigned seed);
long strtol(const char *str, char **str_end, int base);
void qsort(v... | #ifndef _FXCG_STDLIB_H
#define _FXCG_STDLIB_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
long abs(long n);
void free(void *p);
void *malloc(size_t sz);
void *realloc(void *p, size_t sz);
int rand(void);
void srand(unsigned seed);
long strtol(const char *str, char **str_end, int base);
#define atoi... |
Change dlopening of libs to call libraries with their major version on linux systems | #if HAVE_CONFIG_H
#include "config.h"
#endif
#include "dl.h"
#include "util/macro.h"
#include "util/logging.h"
#include <stdlib.h>
#include <dlfcn.h>
#include <string.h>
// Note the dlopen takes just the name part. "aacs", internally we
// translate to "libaacs.so" "libaacs.dylib" or "aacs.dll".
void *dl_dlopen (... | #if HAVE_CONFIG_H
#include "config.h"
#endif
#include "dl.h"
#include "util/macro.h"
#include "util/logging.h"
#include <stdlib.h>
#include <dlfcn.h>
#include <string.h>
void *dl_dlopen ( const char* path )
{
DEBUG(DBG_BDPLUS, "searching for library '%s' ...\n", path);
void *result = dlopen(path, RTLD_LAZ... |
Fix build on older MSVC. | #pragma once
// Clobber previous definitions with extreme prejudice
#ifdef UNUSED
# undef UNUSED
#endif
#ifdef likely
# undef likely
#endif
#ifdef unlikely
# undef unlikely
#endif
#ifdef alignment
# undef alignment
#endif
#define UNUSED __pragma(warning(disable:4100))
#define unlikely(x) (x)
#define likely(x) (x)
#de... | #pragma once
// Clobber previous definitions with extreme prejudice
#ifdef UNUSED
# undef UNUSED
#endif
#ifdef likely
# undef likely
#endif
#ifdef unlikely
# undef unlikely
#endif
#ifdef alignment
# undef alignment
#endif
#define unlikely(x) (x)
#define likely(x) (x)
#define alignment(x) __declspec(align(x))
#if (_M... |
Fix spacing in parameter for readability | #include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;
List* List_Create(void);
void List_Destroy(List* l);
ListNode* ListNode_Create(void * k);
void ListNode_Destroy(ListNode* n);
ListNode* List_Search(List* l, void* k, int (... | #include <stdlib.h>
#ifndef __LIST_H__
#define __LIST_H__
struct ListNode;
struct List;
typedef struct ListNode ListNode;
typedef struct List List;
List* List_Create(void);
void List_Destroy(List* l);
ListNode* ListNode_Create(void* k);
void ListNode_Destroy(ListNode* n);
ListNode* List_Search(List* l, void* k, int (f... |
Remove redundant void argument lists | //
// Created by Mathew Seng on 2019-06-03.
//
#ifndef ExampleCostFunction_h
#define ExampleCostFunction_h
#include "itkSingleValuedCostFunction.h"
namespace itk
{
class ExampleCostFunction2 : public SingleValuedCostFunction
{
public:
/** Standard class typedefs. */
typedef ExampleCostFunction2 Self;
typede... | //
// Created by Mathew Seng on 2019-06-03.
//
#ifndef ExampleCostFunction_h
#define ExampleCostFunction_h
#include "itkSingleValuedCostFunction.h"
namespace itk
{
class ExampleCostFunction2 : public SingleValuedCostFunction
{
public:
/** Standard class typedefs. */
typedef ExampleCostFunction2 Self;
typede... |
Update file, Alura, Introdução a C, Aula 1 | #include <stdio.h>
int main() {
// imprime o cabecalho do nosso jogo
printf("******************************************\n");
printf("* Bem vindo ao nosso jogo de adivinhação *\n");
printf("******************************************\n");
}
| #include <stdio.h>
int main() {
// imprime o cabecalho do nosso jogo
printf("******************************************\n");
printf("* Bem vindo ao nosso jogo de adivinhação *\n");
printf("******************************************\n");
int numerosecreto = 42;
printf("O número %d é o secreto. Não conta p... |
Allow test subsystem to set off clone bombs | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2010, 2012, 2013, 2014 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free... | /*
* This file is part of Kotaka, a mud library for DGD
* http://github.com/shentino/kotaka
*
* Copyright (C) 2010, 2012, 2013, 2014 Raymond Jennings
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free... |
Set MAX_FILE_NAME appropiately with LFN and FATFS | /*
* Copyright (c) 2016 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
#define ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CONFIG_FILE_SYSTEM_LITTLEFS)
#define MAX_FILE_NAME 256
#else /* FAT_FS */
#define MAX_FILE_N... | /*
* Copyright (c) 2016 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
#define ZEPHYR_INCLUDE_FS_FS_INTERFACE_H_
#ifdef __cplusplus
extern "C" {
#endif
#if defined(CONFIG_FILE_SYSTEM_LITTLEFS)
#define MAX_FILE_NAME 256
#elif defined(CONFIG_FAT_FILESYSTEM_E... |
Add unit tests for list sorting. | #include "test_lib.h"
#include "test_helpers.h"
#include "commit.h"
#include <git/odb.h>
#include <git/commit.h>
BEGIN_TEST(list_sort_test)
git_commit_list list;
git_commit_node *n;
int i, t;
time_t previous_time;
#define TEST_SORTED() \
previous_time = 0;\
for (n = list.head; n != NULL; n = ... | |
Add normal information to terrain. | // =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of th... | // =============================================================================
// PROJECT CHRONO - http://projectchrono.org
//
// Copyright (c) 2014 projectchrono.org
// All right reserved.
//
// Use of this source code is governed by a BSD-style license that can be found
// in the LICENSE file at the top level of th... |
Add a wrapper between Seen_table and pymue.SeenTable | #ifndef PYMUE_SEEN_TABLE_WRAPPER
#define PYMUE_SEEN_TABLE_WRAPPER
#include <memory>
#include "seen_table.h"
namespace pymue {
class Seen_table_wrapper
{
private:
std::shared_ptr<mue::Seen_table> _seen_table;
Seen_table_wrapper(mue::Seen_table&& seen_table)
: _seen_table(new mue::Seen_table(std::move(... | |
Add missing include, fix variable name. | #pragma once
#include <string>
#include <memory>
#include <stdexcept>
namespace JWTXX
{
enum class Algorithm {
HS256, HS384, HS512,
RS256, RS384, RS512,
ES256, ES384, ES512,
none
};
class Key
{
public:
struct Error : std::runtime_error
{
Error(const std::string& messa... | #pragma once
#include <string>
#include <unordered_map>
#include <memory>
#include <stdexcept>
namespace JWTXX
{
enum class Algorithm {
HS256, HS384, HS512,
RS256, RS384, RS512,
ES256, ES384, ES512,
none
};
class Key
{
public:
struct Error : std::runtime_error
{
Error... |
Add a new testcase where a points-to or esafe edge is not being added properly | #include "../small1/testharness.h"
#include "../small1/testkinds.h"
#ifndef ERROR
#define __WILD
#endif
// NUMERRORS 1
typedef struct foo Foo;
struct bar
{
Foo * __WILD next;
};
struct foo
{
int *base;
unsigned int length;
struct bar link;
};
int main()
{
struct foo s, *sptr = &s;
if(HAS_KIND(sptr->base,... | |
Test for struct in GNU ?: expressions | // RUN: %check -e %s
main()
{
struct A
{
int i;
} a, b, c;
a = b ? : c; // CHECK: error: struct involved in if-expr
}
| |
Check ifndef NULL before define NULL, because clang stddef.h defines NULL | #define NULL ((void *)0)
#define MIN(_a, _b) \
({ \
__typeof__(_a) __a = (_a); \
__typeof__(_b) __b = (_b); \
__a <= __b ? __a : __b; \
})
#define MAX(_a, _b) \
({ \
__typeof__(_a) __a = (_a); \
__typeof__(_... | #ifndef NULL
#define NULL ((void *)0)
#endif
#define MIN(_a, _b) \
({ \
__typeof__(_a) __a = (_a); \
__typeof__(_b) __b = (_b); \
__a <= __b ? __a : __b; \
})
#define MAX(_a, _b) \
({ \
__typeof__(_a) __a = (_a);... |
Add initial code to list IPv4 addresses | #include <arpa/inet.h>
#include <net/if.h>
#include <netinet/in.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <unistd.h>
#if INET_ADDRSTRLEN > INET6_ADDRSTRLEN
#define BUF_LEN #INET_ADDRSTRLEN
#else
#define BUF_LEN INET6_ADDRSTRLEN
#endif
int ... | |
Add target triple in test | // RUN: %clang_cc1 -S -fno-preserve-as-comments %s -o - | FileCheck %s --check-prefix=NOASM --check-prefix=CHECK
// RUN: %clang_cc1 -S %s -o - | FileCheck %s --check-prefix=ASM --check-prefix=CHECK
// CHECK-LABEL: main
// CHECK: #APP
// ASM: #comment
// NOASM-NOT: #comment
// CHECK: #NO_APP
int main() {
__asm__("/*c... | // RUN: %clang_cc1 -S -triple=x86_64-unknown-unknown -fno-preserve-as-comments %s -o - | FileCheck %s --check-prefix=NOASM --check-prefix=CHECK
// RUN: %clang_cc1 -S %s -triple=x86_64-unknown-unknown -o - | FileCheck %s --check-prefix=ASM --check-prefix=CHECK
// CHECK-LABEL: main
// CHECK: #APP
// ASM: #comment
// NOA... |
Make this test a bit stricter by checking clang's output too. | // RUN: %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -emit-llvm-bc -o %t.bc %s
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-NO-BC %s
// RUN: not %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -mlink-bitcode-file %t.bc -O3 -emit-llvm -o -... | // RUN: %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -emit-llvm-bc -o %t.bc %s
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -mlink-bitcode-file %t.bc -O3 -emit-llvm -o - %s | FileCheck -check-prefix=CHECK-NO-BC %s
// RUN: not %clang_cc1 -triple i386-pc-linux-gnu -DBITCODE -mlink-bitcode-file %t.bc -O3 -emit-llvm -o -... |
Add solution to Exercise 1-12. | /* Exercise 1-12: Write a program that prints its input one word per line. */
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
int16_t character;
bool in_whitespace;
while ((character = getchar()) != EOF) {
if ((character == ' ') || (character... | |
Fix an outdated comment in a test. NFC. | // RUN: %clang_analyze_cc1 -w -x c -analyzer-checker=core -analyzer-output=text -verify %s
// Avoid the crash when finding the expression for tracking the origins
// of the null pointer for path notes. Apparently, not much actual tracking
// needs to be done in this example.
void pr34373() {
int *a = 0; // expected-... | // RUN: %clang_analyze_cc1 -w -x c -analyzer-checker=core -analyzer-output=text -verify %s
// Avoid the crash when finding the expression for tracking the origins
// of the null pointer for path notes.
void pr34373() {
int *a = 0; // expected-note{{'a' initialized to a null pointer value}}
(a + 0)[0]; // expected-... |
Add test of newly checked in Union support! | union X;
struct Empty {};
union F {};
union Q { union Q *X; };
union X {
char C;
int A, Z;
long long B;
void *b1;
struct { int A; long long Z; } Q;
};
union X foo(union X A) {
A.C = 123;
A.A = 39249;
//A.B = (void*)123040123321;
A.B = 12301230123123LL;
A.Z = 1;
return A;
}
| |
Fix the two-step-macro behavior, tests pass | #import <Foundation/Foundation.h>
#define EEEPrepareBlockSelf() __weak __typeof__(self) __weakSelf = self
#define EEEUseBlockSelf() __typeof__(__weakSelf) __weak blockSelf = __weakSelf
@class EEEInjector;
@class EEEOperation;
@interface EEEOperationCenter : NSObject
@property(nonatomic, strong) NSOperationQueue *ma... | #import <Foundation/Foundation.h>
#define EEEPrepareBlockSelf() __weak __typeof__(self) __weakSelf = self
#define EEEUseBlockSelf() __strong __typeof__(__weakSelf) blockSelf = __weakSelf
@class EEEInjector;
@class EEEOperation;
@interface EEEOperationCenter : NSObject
@property(nonatomic, strong) NSOperationQueue *... |
Add prototypes for setbuffer() and setlinebuf(). Questionable as these should probably be replaced with ANSI stype setbuf() calls. | #ifndef FIX_STDIO_H
#define FIX_STDIO_H
#include <stdio.h>
#if defined(__cplusplus)
extern "C" {
#endif
/*
For some reason the stdio.h on OSF1 fails to provide prototypes
for popen() and pclose() if _POSIX_SOURCE is defined.
*/
#if defined(OSF1)
#if defined(__STDC__) || defined(__cplusplus)
FILE *popen( char ... | #ifndef FIX_STDIO_H
#define FIX_STDIO_H
#include <stdio.h>
#if defined(__cplusplus)
extern "C" {
#endif
/*
For some reason the stdio.h on OSF1 fails to provide prototypes
for popen() and pclose() if _POSIX_SOURCE is defined.
*/
#if defined(OSF1)
#if defined(__STDC__) || defined(__cplusplus)
FILE *popen( char ... |
Revert "mv example source code" | #include <stdio.h>
#include <string.h>
#include "../src/mlist.h"
int main (int argc, char *argv[]) {
mlist_t *list;
int *n;
char *c;
char *s = NULL;
const char *name = "cubicdaiya";
list = mlist_create();
n = mlist_palloc(list, sizeof(int));
list = mlist_extend(list);
c = mlist_palloc(list, ... | #include <stdio.h>
#include <string.h>
#include "mlist.h"
int main (int argc, char *argv[]) {
mlist_t *list;
int *n;
char *c;
char *s = NULL;
const char *name = "cubicdaiya";
list = mlist_create();
n = mlist_palloc(list, sizeof(int));
list = mlist_extend(list);
c = mlist_palloc(list, sizeof(... |
Add framework version info to umbrella header | // Douglas Hill, May 2015
// https://github.com/douglashill/DHScatterGraph
#import <DHScatterGraph/DHScatterGraphLineAttributes.h>
#import <DHScatterGraph/DHScatterGraphPointSet.h>
#import <DHScatterGraph/DHScatterGraphView.h>
| // Douglas Hill, May 2015
// https://github.com/douglashill/DHScatterGraph
extern double const DHScatterGraphVersionNumber;
extern unsigned char const DHScatterGraphVersionString[];
#import <DHScatterGraph/DHScatterGraphLineAttributes.h>
#import <DHScatterGraph/DHScatterGraphPointSet.h>
#import <DHScatterGraph/DHSc... |
Add a PID implementation that doesn't independently keep track of time | #ifndef PIDEXTERNALTIME_H
#define PIDEXTERNALTIME_H
#include "Arduino.h"
#include "util/PIDparameters.h"
class PIDexternaltime{
private:
PIDparameters* param;
float setPoint;
float previous;
float acc;
boolean stopped;
public:
PIDexternaltime(PIDparameters* pid): param(pid), setPoint(0),
... | |
Add a missing copyright for Doug. There are other files missing this copyright in -stable. | #include <sys/cdefs.h>
__FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>
#include <stdarg.h>
#include <stdlib.h>
int semctl(int semid, int semnum, int cmd, ...)
{
va_list ap;
union semun semun;
union semun *semun_ptr;
va_start(ap, cmd);
if (cmd == IPC_SET || cmd == IPC_STAT... | /*-
* Copyright (c) 2002 Doug Rabson
* 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 conditi... |
Use the right type for the csync_vio_method_handle_t. | /*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008 by Andreas Schneider <mail@cynapses.org>
*
* 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 v... | /*
* libcsync -- a library to sync a directory with another
*
* Copyright (c) 2008 by Andreas Schneider <mail@cynapses.org>
*
* 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 v... |
Rework and kill pointless static variable -Erik |
/*
* This file lifted in toto from 'Dlibs' on the atari ST (RdeBath)
*
*
* Dale Schumacher 399 Beacon Ave.
* (alias: Dalnefre') St. Paul, MN 55104
* dal@syntel.UUCP United States of America
* "It's not reality that's important, bu... | /*
* This file originally lifted in toto from 'Dlibs' on the atari ST (RdeBath)
*
*
* Dale Schumacher 399 Beacon Ave.
* (alias: Dalnefre') St. Paul, MN 55104
* dal@syntel.UUCP United States of America
* "It's not reality that's imp... |
Test to see what jenkins will do | static char startmessage[] = "Linux Backup Client";
#include<stdio.h>
#include<string.h>
#include"db.h"
int main(int argc, char **argv)
{
int argindex = 0;
puts(startmessage);
for(argindex = 1; argindex < argc; argindex++)
{
if(strcmp(argv[argindex], "version") == 0)
{
puts("This should display version");
... | static char startmessage[] = "Linux Backup Client";
#include<stdio.h>
#include<string.h>
#include"db.h"
int main(int argc, char **argv)
{
THIS WILL BREAK THE BUILD!
int argindex = 0;
puts(startmessage);
for(argindex = 1; argindex < argc; argindex++)
{
if(strcmp(argv[argindex], "version") == 0)
{
puts("This... |
Make library type checkbox part of the library record. | testScreens: setup: stuffCheckBox
Go to Field [ ]
If [ tempSetup::InventoryLibaryYN = "" ]
Set Field [ tempSetup::layoutLtagK; "" ]
Set Field [ tempSetup::layoutRtagK; "" ]
Set Field [ tempSetup::layoutLtagN; "" ]
Set Field [ tempSetup::layoutRtagN; "" ]
Else
Set Field [ tempSetup::layoutLtagK; "moreltagNKs2" ]
Set Fie... | changeLibraryOrLibraryName: stuffCheckBox
#
#Exit the checkbox.
Go to Field [ ]
#
#Set default layouts for a reference library.
If [ tempSetup::InventoryLibaryYN = "" ]
Set Field [ tempSetup::layoutLtagK; "" ]
Set Field [ tempSetup::layoutRtagK; "" ]
Set Field [ tempSetup::layoutLtagN; "" ]
Set Field [ tempSetup::layou... |
Fix logic error in check() function. | //===- Error.h --------------------------------------------------*- C++ -*-===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------... | //===- Error.h --------------------------------------------------*- C++ -*-===//
//
// The LLVM Linker
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------... |
Add routines to print sparse data structures |
#if defined(CRAY_T3E) || defined(CRAY_T3D)
int ONBITMASK( int *len )
#else
int onbitmask_( int *len )
#endif
{
unsigned int mask;
mask = ~((~0) << *len);
return ((int)mask);
}
| #include <stdio.h>
void c_print_sparsemat( int, int, int *, int *, int, double * );
#if defined(CRAY_T3E) || defined(CRAY_T3D)
int ONBITMASK( int *len )
#else
int onbitmask_( int *len )
#endif
{
unsigned int mask;
mask = ~((~0) << *len);
return ((int)mask);
}
#ifdef NOCOMPILE
void print_sparsemat_( ... |
Add 2D Array - DS Challenge | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int main(){
int arr[6][6];
int max = 0;
int sum = 0;
int n = 0;
for(int arr_i = 0; arr_i < 6; arr_i++){
for(int arr_j = 0; arr_j < 6; arr_j++){
scanf("%d",&arr[... | #include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>
int hourglass(int *array);
int main(){
int arr[6][6];
int max = 0;
int sum = 0;
int n = 0;
int i = 0;
int j = 0;
for(int row = 0; row < 6; row++){
for(int colum... |
Return errorlevel with macro EXIT_SUCCESS. | #include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* ʾǺ궨ʱõһּ
* 1) ĺһǸ
* 2) ΪͨԺǿ׳ҪܶԺʹ÷κμ
*/
#define PRINT_GREETINGS do { \
printf("Hi there!\n"); \
} while (0)
int main(const int argc, const char* const* argv)
{
// Invoke function via macro
PRINT_GREETINGS;
return 0;
}
| #include <stdio.h>
#include <stdlib.h>
#include <string.h>
/*
* ʾǺ궨ʱõһּ
* 1) ĺһǸ
* 2) ΪͨԺǿ׳ҪܶԺʹ÷κμ
*/
#define PRINT_GREETINGS do { \
printf("Hi there!\n"); \
} while (0)
int main(const int argc, const char* const* argv)
{
// Invoke function via macro
PRINT_GREETINGS;
return EXIT_SUCCESS;
}
|
Make it work under MPW too. |
/*
* macsetfiletype - Set the mac's idea of file type
*
*/
#include <Files.h>
#include <pascal.h>
int
setfiletype(name, creator, type)
char *name;
long creator, type;
{
FInfo info;
unsigned char *pname;
pname = c2pstr(name);
if ( GetFInfo(pname, 0, &info) < 0 )
return -1;
info.fdType = type;
info.fdCr... |
/*
* macsetfiletype - Set the mac's idea of file type
*
*/
#include "macdefs.h"
int
setfiletype(name, creator, type)
char *name;
long creator, type;
{
FInfo info;
unsigned char *pname;
pname = (StringPtr) c2pstr(name);
if ( GetFInfo(pname, 0, &info) < 0 )
return -1;
info.fdType = type;
info.fdCreator ... |
Fix copy_from_user_nmi() return if range is not ok | /*
* User address space access functions.
*
* For licencing details see kernel-base/COPYING
*/
#include <linux/highmem.h>
#include <linux/module.h>
#include <asm/word-at-a-time.h>
#include <linux/sched.h>
/*
* We rely on the nested NMI work to allow atomic faults from the NMI path; the
* nested NMI paths are ... | /*
* User address space access functions.
*
* For licencing details see kernel-base/COPYING
*/
#include <linux/highmem.h>
#include <linux/module.h>
#include <asm/word-at-a-time.h>
#include <linux/sched.h>
/*
* We rely on the nested NMI work to allow atomic faults from the NMI path; the
* nested NMI paths are ... |
Declare bswap functions as static inline | /*
*
* Copyright 2017 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 2017 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... |
Remove the unused bidir functions from path tracer | #ifndef PATH_INTEGRATOR_H
#define PATH_INTEGRATOR_H
#include "surface_integrator.h"
#include "renderer/renderer.h"
/*
* Surface integrator that uses Path tracing for computing illumination at a point on the surface
*/
class PathIntegrator : public SurfaceIntegrator {
const int min_depth, max_depth;
public:
/*
... | #ifndef PATH_INTEGRATOR_H
#define PATH_INTEGRATOR_H
#include "surface_integrator.h"
#include "renderer/renderer.h"
/*
* Surface integrator that uses Path tracing for computing illumination at a point on the surface
*/
class PathIntegrator : public SurfaceIntegrator {
const int min_depth, max_depth;
public:
/*
... |
Fix solution to Exercise 1-2. | /*
* A solution to Exercise 1-2 in The C Programming Language (Second Edition).
*
* This file was written by Damien Dart, <damiendart@pobox.com>. This is free
* and unencumbered software released into the public domain. For more
* information, please refer to the accompanying "UNLICENCE" file.
*/
#include <stdio... | /*
* A solution to Exercise 1-2 in The C Programming Language (Second Edition).
*
* This file was written by Damien Dart, <damiendart@pobox.com>. This is free
* and unencumbered software released into the public domain. For more
* information, please refer to the accompanying "UNLICENCE" file.
*/
#include <stdio... |
Fix the buxton_debug macro to support arguments | /*
* This file is part of buxton.
*
* Copyright (C) 2013 Intel Corporation
*
* buxton 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... | /*
* This file is part of buxton.
*
* Copyright (C) 2013 Intel Corporation
*
* buxton 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... |
Add car to system res | /*
* system_res.h
*
* Author: Ben Lai, Ming Tsang, Peggy Lau
* Copyright (c) 2014-2015 HKUST SmartCar Team
* Refer to LICENSE for details
*/
namespace camera
{
struct SystemRes
{
};
}
| /*
* system_res.h
*
* Author: Ben Lai, Ming Tsang, Peggy Lau
* Copyright (c) 2014-2015 HKUST SmartCar Team
* Refer to LICENSE for details
*/
namespace camera
{
class Car;
}
namespace camera
{
struct SystemRes
{
Car *car;
};
}
|
Update threshold for second window | #ifndef EVENT_DETECTION_H
# define EVENT_DETECTION_H
# include "scrappie_structures.h"
typedef struct {
size_t window_length1;
size_t window_length2;
float threshold1;
float threshold2;
float peak_height;
} detector_param;
static detector_param const event_detection_defaults = {
.windo... | #ifndef EVENT_DETECTION_H
# define EVENT_DETECTION_H
# include "scrappie_structures.h"
typedef struct {
size_t window_length1;
size_t window_length2;
float threshold1;
float threshold2;
float peak_height;
} detector_param;
static detector_param const event_detection_defaults = {
.windo... |
Initialize FixedVector's member in its null constructor to eliminate a Wall warning. | #pragma once
template <typename T, unsigned int N>
struct FixedVector
{
T data[N];
__host__ __device__
FixedVector() { }
__host__ __device__
FixedVector(T init)
{
for(unsigned int i = 0; i < N; i++)
data[i] = init;
}
__host__ __device__
FixedVector operato... | #pragma once
template <typename T, unsigned int N>
struct FixedVector
{
T data[N];
__host__ __device__
FixedVector() : data() { }
__host__ __device__
FixedVector(T init)
{
for(unsigned int i = 0; i < N; i++)
data[i] = init;
}
__host__ __device__
FixedVecto... |
Return success rather than failure from shutdown() on FileDescriptor, since it is entirely immaterial. | #ifndef FILE_DESCRIPTOR_H
#define FILE_DESCRIPTOR_H
#include <io/channel.h>
class FileDescriptor : public Channel {
LogHandle log_;
protected:
int fd_;
public:
FileDescriptor(int);
~FileDescriptor();
virtual Action *close(EventCallback *);
virtual Action *read(size_t, EventCallback *);
virtual Action *write(B... | #ifndef FILE_DESCRIPTOR_H
#define FILE_DESCRIPTOR_H
#include <io/channel.h>
class FileDescriptor : public Channel {
LogHandle log_;
protected:
int fd_;
public:
FileDescriptor(int);
~FileDescriptor();
virtual Action *close(EventCallback *);
virtual Action *read(size_t, EventCallback *);
virtual Action *write(B... |
Fix typo in r375186. Unbreaks tests. | // RUN: %clang_analyze_cc1 -analyzer-checker=core \
// RUN: -analyzer-dump-egraph=%t.dot %s
// RUN: cat %t.dot | FileCheck %s
// RUN: %clang_analyze_cc1 -analyzer-checker=core \
// RUN: -analyzer-dump-egraph=%t.dot \
// RUN: -trim-egraph %s
// RUN: cat %t.dot | FileCheck %s
// REQUIRES: asserts
int getJ();
int f... | // RUN: %clang_analyze_cc1 -analyzer-checker=core \
// RUN: -analyzer-dump-egraph=%t.dot %s
// RUN: cat %t.dot | FileCheck %s
// RUN: %clang_analyze_cc1 -analyzer-checker=core \
// RUN: -analyzer-dump-egraph=%t.dot \
// RUN: -trim-egraph %s
// RUN: cat %t.dot | FileCheck %s
// REQUIRES: asserts
int getJ();
int f... |
Use __func__ instead of __FUNCTION__ | #ifndef LOG_TESTFW_H
#define LOG_TESTFW_H
#include <stdio.h>
#define NEUTRAL "\x1B[0m"
#define GREEN "\x1B[32m"
#define RED "\x1B[31m"
void testfw_add(void (*)(int*), const char*);
int testfw_run();
#define TEST(name) void name(int*); void __attribute__((constructor)) pre_##name() {testfw_add(name, #name);} v... | #ifndef LOG_TESTFW_H
#define LOG_TESTFW_H
#include <stdio.h>
#define NEUTRAL "\x1B[0m"
#define GREEN "\x1B[32m"
#define RED "\x1B[31m"
void testfw_add(void (*)(int*), const char*);
int testfw_run();
#define TEST(name) void name(int*); void __attribute__((constructor)) pre_##name() {testfw_add(name, #name);} v... |
Add test for hexadecimal numbers with upper and lower case | /*
name: TEST062
description: Test for hexadecimal numbers in upper and lower case
error:
output:
G2 I F "main
{
\
h #I1
}
*/
int
main(void)
{
return 0xa == 0xA &&
0xb == 0xB &&
0xc == 0xC &&
0xd == 0xD &&
0xe == 0xE &&
0xf == 0xF;
}
| |
Enable slice support in config. | // This file contains default configuration settings for MicroPython.
// You can override any of these options using mpconfigport.h file located
// in a directory of your port.
#include <mpconfigport.h>
#ifndef INT_FMT
// printf format spec to use for machine_int_t and friends
#ifdef __LP64__
// Archs where machine_i... | // This file contains default configuration settings for MicroPython.
// You can override any of these options using mpconfigport.h file located
// in a directory of your port.
#include <mpconfigport.h>
#ifndef INT_FMT
// printf format spec to use for machine_int_t and friends
#ifdef __LP64__
// Archs where machine_i... |
Index schedule not the main struct |
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <area51/hashmap.h>
#include <area51/list.h>
#include <area51/log.h>
#include <libxml/xmlreader.h>
#include <nre/reference.h>
#include <nre/schedule.h>
/*
* Callback to add a schedule to the crs locations map
*/
static bool inde... |
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <area51/hashmap.h>
#include <area51/list.h>
#include <area51/log.h>
#include <nre/reference.h>
#include <nre/schedule.h>
/*
* Callback to add a schedule to the crs locations map
*/
static bool indexAll(void *k, void *v, void *c... |
Disable crange while fixing bugs in other systems. | #define TREE
// A mapping of a chunk of an address space to
// a specific memory object.
enum vmatype { PRIVATE, COW};
struct vma {
uptr va_start; // start of mapping
uptr va_end; // one past the last byte
enum vmatype va_type;
struct vmnode *n;
struct spinlock lock; // s... | //#define TREE
// A mapping of a chunk of an address space to
// a specific memory object.
enum vmatype { PRIVATE, COW};
struct vma {
uptr va_start; // start of mapping
uptr va_end; // one past the last byte
enum vmatype va_type;
struct vmnode *n;
struct spinlock lock; //... |
Revert "client version to 1.0.1" | #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 0
#define CLIENT_VERSION_REVISION 1
#define CLIENT_VERSION_BUILD 0
// Convert... | #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 0
#define CLIENT_VERSION_REVISION 0
#define CLIENT_VERSION_BUILD 0
// Convert... |
Add macro to know if "real" is double. | #pragma once
#include <stdint.h>
#include <climits>
//#define TYPE_DOUBLE
#ifdef TYPE_DOUBLE
using real = double;
#else
using real = float;
#endif
| #pragma once
#include <stdint.h>
#include <climits>
//#define TYPE_DOUBLE
#ifdef TYPE_DOUBLE
using real = double;
#define AT_IS_TYPE_DOUBLE (true)
#else
using real = float;
#define AT_IS_TYPE_DOUBLE (false)
#endif
|
Revert to old pre-1.0 meta directory | /*
* License: BSD-style license
* Copyright: Radek Podgorny <radek@podgorny.cz>,
* Bernd Schubert <bernd-schubert@gmx.de>
*/
#ifndef UNIONFS_H
#define UNIONFS_H
#define PATHLEN_MAX 1024
#define HIDETAG "_HIDDEN~"
#define METANAME ".unionfs-fuse"
#define METADIR (METANAME "/") // string concetanation!
//... | /*
* License: BSD-style license
* Copyright: Radek Podgorny <radek@podgorny.cz>,
* Bernd Schubert <bernd-schubert@gmx.de>
*/
#ifndef UNIONFS_H
#define UNIONFS_H
#define PATHLEN_MAX 1024
#define HIDETAG "_HIDDEN~"
#define METANAME ".unionfs"
#define METADIR (METANAME "/") // string concetanation!
// fuse... |
Change version string to reflect the release of beta 2. | #ifndef HEADER_OPENSSLV_H
#define HEADER_OPENSSLV_H
/* Numeric release version identifier:
* MMNNFFRBB: major minor fix final beta/patch
* For example:
* 0.9.3-dev 0x00903000
* 0.9.3beta1 0x00903001
* 0.9.3beta2-dev 0x00903002
* 0.9.3beta2 0x00903002 (same as ...beta2-dev)
* 0.9.3 0x00903100
* 0.9.3a... | #ifndef HEADER_OPENSSLV_H
#define HEADER_OPENSSLV_H
/* Numeric release version identifier:
* MMNNFFRBB: major minor fix final beta/patch
* For example:
* 0.9.3-dev 0x00903000
* 0.9.3beta1 0x00903001
* 0.9.3beta2-dev 0x00903002
* 0.9.3beta2 0x00903002 (same as ...beta2-dev)
* 0.9.3 0x00903100
* 0.9.3a... |
Add code and data segments definitions. | #ifndef __BOOT_H__
#define __BOOT_H__
/* multiboot definitions */
#define MB_HEADER_MAGIC 0x1BADB002
#define MB_BOOT_MAGIC 0x2BADB002
#define MB_PAGE_ALIGN 0x00000001
#define MB_MEMORY_INFO 0x00000002
/* common boot definitions */
#define BOOT_TIME_STACK_SIZE 0x4000
#endif /*__BOOT_H__*/
| #ifndef __BOOT_H__
#define __BOOT_H__
/* multiboot definitions */
#define MB_HEADER_MAGIC 0x1BADB002
#define MB_BOOT_MAGIC 0x2BADB002
#define MB_PAGE_ALIGN 0x00000001
#define MB_MEMORY_INFO 0x00000002
/* common boot definitions */
#define BOOT_TIME_STACK_SIZE 0x4000
#define BOOT_CS_ENTRY 1
#define BOOT_C... |
Fix memory leak by making dtor virtual | /*
* Unit tests for libkvkontakte.
* Copyright (C) 2015 Alexander Potashev <aspotashev@gmail.com>
*
* 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
* ... | /*
* Unit tests for libkvkontakte.
* Copyright (C) 2015 Alexander Potashev <aspotashev@gmail.com>
*
* 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
* ... |
Remove padding from vertex buffers | #pragma once
#include "pixelboost/graphics/device/bufferFormats.h"
namespace pb
{
class GraphicsDevice;
struct Vertex_P3
{
float position[3];
float __padding;
};
struct Vertex_P3_UV
{
float position[3];
float uv[2];
float __padding[3]; // for 32-byte alignment
};
struct Vertex_P3_C4
{
... | #pragma once
#include "pixelboost/graphics/device/bufferFormats.h"
namespace pb
{
class GraphicsDevice;
struct Vertex_P3
{
float position[3];
};
struct Vertex_P3_UV
{
float position[3];
float uv[2];
};
struct Vertex_P3_C4
{
float position[3];
float color[4];
};
struct Vertex_P3_C4... |
Change how CSS would be used | #include <chopsui.h>
void say_hi_clicked(sui_t *button, sui_event_t *event) {
sui_alert("Hello world!");
}
void exit_clicked(sui_t *button, sui_event_t *event) {
sui_exit();
}
int main(int argc, char **argv) {
init_sui();
sui_t *window = sui_load("window.sui");
sui_load_css("window.css");
sui_add_handler(windo... | #include <chopsui.h>
void say_hi_clicked(sui_t *button, sui_event_t *event) {
sui_alert("Hello world!");
}
void exit_clicked(sui_t *button, sui_event_t *event) {
sui_exit();
}
int main(int argc, char **argv) {
init_sui();
sui_t *window = sui_load("window.sui");
sui_css_t *css = sui_load_css("window.css");
sui_... |
Fix undefined reference to "midisend" when using ALSA | #include <alsa/asoundlib.h>
snd_seq_t *hdl;
static snd_midi_event_t *mbuf;
static int midiport;
/* open */
int
midiopen(void)
{
snd_midi_event_new(32, &mbuf);
if (snd_seq_open(&hdl, "default", SND_SEQ_OPEN_OUTPUT, 0) != 0) {
return 1;
} else {
snd_seq_set_client_name(hdl, "svmidi");
if ((midiport = snd_seq_c... | #include <alsa/asoundlib.h>
snd_seq_t *hdl;
static snd_midi_event_t *mbuf;
static int midiport;
/* open */
int
midiopen(void)
{
snd_midi_event_new(32, &mbuf);
if (snd_seq_open(&hdl, "default", SND_SEQ_OPEN_OUTPUT, 0) != 0) {
return 1;
} else {
snd_seq_set_client_name(hdl, "svmidi");
if ((midiport = snd_seq_c... |
Add scroll layer click config override helpers | #pragma once
#include <pebble.h>
#include "simply/simply.h"
static inline ClickConfigProvider scroll_layer_click_config_provider_accessor(ClickConfigProvider provider) {
static ClickConfigProvider s_provider;
if (provider) {
s_provider = provider;
}
return s_provider;
}
static inline void scroll_layer_c... | |
Use an unordered map to track clients. | #ifndef VAST_QUERY_SEARCH_H
#define VAST_QUERY_SEARCH_H
#include <unordered_map>
#include <cppa/cppa.hpp>
#include <ze/event.h>
#include <vast/query/query.h>
namespace vast {
namespace query {
class search : public cppa::sb_actor<search>
{
friend class cppa::sb_actor<search>;
public:
search(cppa::actor_ptr arch... | #ifndef VAST_QUERY_SEARCH_H
#define VAST_QUERY_SEARCH_H
#include <unordered_map>
#include <cppa/cppa.hpp>
#include <ze/event.h>
#include <vast/query/query.h>
namespace vast {
namespace query {
class search : public cppa::sb_actor<search>
{
friend class cppa::sb_actor<search>;
public:
search(cppa::actor_ptr arch... |
Fix Uninitialized Value compiler warning in the scoped_timer | /*
* Copyright 2011-2013 Blender Foundation
*
* 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 ag... | /*
* Copyright 2011-2013 Blender Foundation
*
* 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 ag... |
Change visibility of the destructor to public. | // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef TESTING_PLATFORM_TEST_H_
#define TESTING_PLATFORM_TEST_H_
#include <gtest/gtest.h>
#if defined(GTEST_OS_MAC)
#ifdef __OBJC__
@class NSA... | // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef TESTING_PLATFORM_TEST_H_
#define TESTING_PLATFORM_TEST_H_
#include <gtest/gtest.h>
#if defined(GTEST_OS_MAC)
#ifdef __OBJC__
@class NSA... |
Fix Epiphany GCC 5 link error | #include <stdint.h>
#define SKIP 77
struct status {
uint32_t done;
uint32_t _pad1;
uint32_t returncode;
uint32_t _pad2;
} __attribute__((packed));
volatile struct status *epiphany_status = (struct status *) 0x8f200000;
volatile char *epiphany_results = (char *) 0x8f300000;
int main(int argc, char *ar... | #include <stdint.h>
#define SKIP 77
struct status {
uint32_t done;
uint32_t _pad1;
uint32_t returncode;
uint32_t _pad2;
} __attribute__((packed));
volatile struct status *epiphany_status = (struct status *) 0x8f200000;
volatile char *epiphany_results = (char *) 0x8f300000;
/* HACK: Provide symbol to ... |
Add a test case for r185707/PR16547. | // RUN: rm -fR %T/dir
// RUN: mkdir %T/dir
// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %T/dir %s
// Currently this test mainly checks that the HTML diagnostics doesn't crash
// when handling macros will calls with macros. We should actually validate
// the output, but that requires bei... | // RUN: rm -fR %T/dir
// RUN: mkdir %T/dir
// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %T/dir %s
// RUN: ls %T/dir | grep report
// PR16547: Test relative paths
// RUN: cd %T/dir
// RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o testrelative %s
// RUN: ls %T/di... |
Allow suppression of "deprecated header" warning | /*-------------------------------------------------------------------------
*
* FILE
* pqxx/util.h
*
* DESCRIPTION
* Various utility definitions for libpqxx
*
* Copyright (c) 2001-2004, Jeroen T. Vermeulen <jtv@xs4all.nl>
*
* See COPYING for copyright license. If you did not receive a file called
*... | /*-------------------------------------------------------------------------
*
* FILE
* pqxx/util.h
*
* DESCRIPTION
* Various utility definitions for libpqxx
*
* Copyright (c) 2001-2004, Jeroen T. Vermeulen <jtv@xs4all.nl>
*
* See COPYING for copyright license. If you did not receive a file called
*... |
Add lo_keyboard_did_hide() and improve comment | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Copyright 2013 LibreOffice contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.or... | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* Copyright 2013 LibreOffice contributors.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.or... |
Change of the default msg | #include <stdlib.h>
#include <stdio.h>
#include "logging.h"
int log_fail(char* msg) {
perror(msg);
// TODO fix log to file
return 0;
}
int log_success(char* msg) {
printf("%s\n", msg);
return 0;
}
| #include <stdlib.h>
#include <stdio.h>
#include "logging.h"
int log_fail(char* msg) {
perror(msg);
// TODO fix log to file
return 0;
}
int log_success(char* msg) {
printf("SUCCESS: %s\n", msg);
return 0;
}
|
Increase max length of a network message to support larger records | #pragma once
#define NETWORK_MAX_MESSAGE_LENGTH 65535
#include <sys/types.h>
namespace pb
{
class NetworkMessage
{
public:
NetworkMessage();
NetworkMessage(const NetworkMessage& src);
~NetworkMessage();
bool ReadChar(char& value);
bool ReadByte(__uint8_t& value);
bool ReadInt(__int32_t&... | #pragma once
#define NETWORK_MAX_MESSAGE_LENGTH 262140
#include <sys/types.h>
namespace pb
{
class NetworkMessage
{
public:
NetworkMessage();
NetworkMessage(const NetworkMessage& src);
~NetworkMessage();
bool ReadChar(char& value);
bool ReadByte(__uint8_t& value);
bool ReadInt(__int32_t... |
Add list function declarations, node structure | //
// lineart.h
// LineArt
//
// Created by Allek Mott on 10/1/15.
// Copyright © 2015 Loop404. All rights reserved.
//
#ifndef lineart_h
#define lineart_h
#include <stdio.h>
#define MAX_LINE_LENGTH 200
// data structure for line
// (x1, y1) = inital point
// (x2, y2) = final point
struct line {
int x1;
... | //
// lineart.h
// LineArt
//
// Created by Allek Mott on 10/1/15.
// Copyright © 2015 Loop404. All rights reserved.
//
#ifndef lineart_h
#define lineart_h
#include <stdio.h>
#define MAX_LINE_LENGTH 200
// data structure for line
// (x1, y1) = inital point
// (x2, y2) = final point
struct line {
int x1;
... |
Remove pointless const from function declarations. | #ifndef CONSTBITS_H
#define CONSTBITS_H
#include "adt/obst.h"
#include "tv.h"
typedef struct bitinfo
{
ir_tarval* z; /* safe zeroes, 0 = bit is zero, 1 = bit maybe is 1 */
ir_tarval* o; /* safe ones, 0 = bit maybe is zero, 1 = bit is 1 */
} bitinfo;
/* Get analysis information for node irn */
bitinfo* get_... | #ifndef CONSTBITS_H
#define CONSTBITS_H
#include "adt/obst.h"
#include "tv.h"
typedef struct bitinfo
{
ir_tarval* z; /* safe zeroes, 0 = bit is zero, 1 = bit maybe is 1 */
ir_tarval* o; /* safe ones, 0 = bit maybe is zero, 1 = bit is 1 */
} bitinfo;
/* Get analysis information for node irn */
bitinfo* get_... |
Remove DISABLE_WIDEVINE_CDM_CANPLAYTYPE as we should start using canPlayType now | // Copyright (c) 2013 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 WIDEVINE_CDM_VERSION_H_
#define WIDEVINE_CDM_VERSION_H_
#include "third_party/widevine/cdm/widevine_cdm_common.h"
// Indicates that the Wide... | // Copyright (c) 2013 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 WIDEVINE_CDM_VERSION_H_
#define WIDEVINE_CDM_VERSION_H_
#include "third_party/widevine/cdm/widevine_cdm_common.h"
// Indicates that the Wide... |
Fix block property type in NSCache. | //
// NSCache+BlocksKit.h
// %PROJECT
//
#import "BKGlobals.h"
/** NSCache with block adding of objects
This category allows you to conditionally add objects to
an instance of NSCache using blocks. Both the normal
delegation pattern and a block callback for NSCache's one
delegate method are allowed.
These... | //
// NSCache+BlocksKit.h
// %PROJECT
//
#import "BKGlobals.h"
/** NSCache with block adding of objects
This category allows you to conditionally add objects to
an instance of NSCache using blocks. Both the normal
delegation pattern and a block callback for NSCache's one
delegate method are allowed.
These... |
Add missing header and fix build on FreeBSD | #ifndef NEWSBOAT_QUEUEMANAGER_H_
#define NEWSBOAT_QUEUEMANAGER_H_
#include <memory>
#include <string>
namespace newsboat {
class ConfigContainer;
class ConfigPaths;
class RssFeed;
class QueueManager {
ConfigContainer* cfg = nullptr;
ConfigPaths* paths = nullptr;
public:
QueueManager(ConfigContainer* cfg, Config... | #ifndef NEWSBOAT_QUEUEMANAGER_H_
#define NEWSBOAT_QUEUEMANAGER_H_
#include <ctime>
#include <memory>
#include <string>
namespace newsboat {
class ConfigContainer;
class ConfigPaths;
class RssFeed;
class QueueManager {
ConfigContainer* cfg = nullptr;
ConfigPaths* paths = nullptr;
public:
QueueManager(ConfigConta... |
Add a simple test program to read the GPIO signal. | #include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "input.h"
int
main(int argc, char **argv)
{
unsigned long high, low, err;
struct gpio_req req;
int fd;
int old;
int res;
struct hardware hw;
res = read_hardware_parameters("hardware.txt", &hw);
if (res)
return res;
fd ... | |
Update Skia milestone to 73 | /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 72
#endif
| /*
* Copyright 2016 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SK_MILESTONE
#define SK_MILESTONE 73
#endif
|
Fix error message in version check | #ifdef __GNUC__
#if __clang__
#if __cplusplus >= 201103L && !__has_include(<initializer_list>)
#warning "Your compiler supports C++11 but your C++ standard library does not. If your system has libc++ installed (as should be the case on e.g. Mac OSX), try adding -stdlib=libc++ to your CFLAGS (ignore the oth... | #ifdef __GNUC__
#if __clang__
#if __cplusplus >= 201103L && !__has_include(<initializer_list>)
#warning "Your compiler supports C++11 but your C++ standard library does not. If your system has libc++ installed (as should be the case on e.g. Mac OSX), try adding -stdlib=libc++ to your CFLAGS (ignore the oth... |
Remove arg{c,v} params for main() since they are unneeded | #include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
int main (int argc, char ** argv)
{ CURL * handle;
CURLcode res;
curl_global_init(CURL_GLOBAL_ALL);
handle = curl_easy_init();
if ( handle )
{ curl_easy_setopt(handle, CURLOPT_URL, "http://icanhazip.com");
curl_easy_setopt(... | #include <stdio.h>
#include <stdlib.h>
#include <curl/curl.h>
int main ()
{ CURL * handle;
CURLcode res;
curl_global_init(CURL_GLOBAL_ALL);
handle = curl_easy_init();
if ( handle )
{ curl_easy_setopt(handle, CURLOPT_URL, "http://icanhazip.com");
curl_easy_setopt(handle, CURLOPT_FOLLOW... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.