Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Fix undefined references in linker
// // Created by Hippo on 9/13/2016. // #ifndef IMAGE_IMAGE_DECODER_H #define IMAGE_IMAGE_DECODER_H #include "com_hippo_image_BitmapDecoder.h" #define IMAGE_CONFIG_INVALID -1; #define IMAGE_CONFIG_AUTO com_hippo_image_BitmapDecoder_CONFIG_AUTO #define IMAGE_CONFIG_RGB_565 com_hippo_image_BitmapDecoder_CON...
// // Created by Hippo on 9/13/2016. // #ifndef IMAGE_IMAGE_DECODER_H #define IMAGE_IMAGE_DECODER_H #include "com_hippo_image_BitmapDecoder.h" #define IMAGE_CONFIG_INVALID -1; #define IMAGE_CONFIG_AUTO com_hippo_image_BitmapDecoder_CONFIG_AUTO #define IMAGE_CONFIG_RGB_565 com_hippo_image_BitmapDecoder_CON...
Disable ffmpeg software conversion in define
#pragma once #define PRINT_QUEUE_INFOS 0 #define PRINT_FRAME_UPLOAD_INFOS 0 #define PRINT_MEMORY_STATS 0 #define PRINT_FRAME_DROPS 0 #define PRINT_VIDEO_REFRESH 0 #define PRINT_VIDEO_DELAY 0 #define PRINT_CLOCKS 0 #define PRINT_PTS 0 #define PRINT_FPS 0 // Rendering mode (Hardware or Software) #define USE_HARDWARE_RE...
#pragma once #define PRINT_QUEUE_INFOS 0 #define PRINT_FRAME_UPLOAD_INFOS 0 #define PRINT_MEMORY_STATS 0 #define PRINT_FRAME_DROPS 0 #define PRINT_VIDEO_REFRESH 0 #define PRINT_VIDEO_DELAY 0 #define PRINT_CLOCKS 0 #define PRINT_PTS 0 #define PRINT_FPS 0 // Rendering mode (Hardware or Software) #define USE_HARDWARE_RE...
Clarify the debug message that may be generated by the chpl_comm_barrier() call in chpl_exit_common().
#include <stdio.h> #include <stdlib.h> #include "chpl_rt_utils_static.h" #include "chpl-comm.h" #include "chplexit.h" #include "chpl-mem.h" #include "chplmemtrack.h" #include "chplrt.h" #include "gdb.h" #undef exit static void chpl_exit_common(int status, int all) { fflush(stdout); fflush(stderr); if (status !=...
#include <stdio.h> #include <stdlib.h> #include "chpl_rt_utils_static.h" #include "chpl-comm.h" #include "chplexit.h" #include "chpl-mem.h" #include "chplmemtrack.h" #include "chplrt.h" #include "gdb.h" #undef exit static void chpl_exit_common(int status, int all) { fflush(stdout); fflush(stderr); if (status !=...
Disable logger crash handling on Android
#ifndef LOGGING_H #define LOGGING_H #ifndef __ANDROID__ #define ELPP_STACKTRACE_ON_CRASH #endif #define ELPP_NO_DEFAULT_LOG_FILE #include "vendor/easylogging++.h" #define INITIALIZE_LOGGING INITIALIZE_EASYLOGGINGPP namespace sensekit { void initialize_logging(const char* logFilePath); } #endif /* LOGGING_H */...
#ifndef LOGGING_H #define LOGGING_H #ifdef __ANDROID__ #define ELPP_DISABLE_DEFAULT_CRASH_HANDLING #else // not android #define ELPP_STACKTRACE_ON_CRASH #endif #define ELPP_NO_DEFAULT_LOG_FILE #include "vendor/easylogging++.h" #define INITIALIZE_LOGGING INITIALIZE_EASYLOGGINGPP namespace sensekit { void initia...
Test for stack using array
#include <check.h> #include "../src/stack_using_array/stack.h" stack st; void setup() { init(&st); } void teardown() { } START_TEST( test_push_pop_normal_ops ) { push( &st, 10 ); push( &st, 12 ); ck_assert_int_eq( pop( &st ), 12 ); ck_assert_int_eq( pop( &st ), 10 ); } END_TEST START_TEST( test...
Decrease the number of notify_one calls
#pragma once #include <cstddef> #include <condition_variable> #include <mutex> #include <queue> namespace log { template<typename T> class LogQueue final { public: explicit LogQueue(size_t capacity) : m_capacity(capacity) {} ~LogQueue() = default; LogQueue(const LogQueue&) = delete; LogQueue& operato...
#pragma once #include <cstddef> #include <condition_variable> #include <mutex> #include <queue> namespace log { template<typename T> class LogQueue final { public: explicit LogQueue(size_t capacity) : m_capacity(capacity) {} ~LogQueue() = default; LogQueue(const LogQueue&) = delete; LogQueue& operato...
Add builtin_memcpy, builtin_memcmp generic helpers
#ifndef __CR_ASM_GENERIC_STRING_H__ #define __CR_ASM_GENERIC_STRING_H__ #include "compiler.h" #ifndef HAS_BUILTIN_MEMCPY static always_inline void *builtin_memcpy(void *to, const void *from, unsigned int n) { int i; unsigned char *cto = to; const unsigned char *cfrom = from; for (i = 0; i < n; ++i, ++cto, ++cfro...
#ifndef __CR_ASM_GENERIC_STRING_H__ #define __CR_ASM_GENERIC_STRING_H__ #include "compiler.h" #ifndef HAS_BUILTIN_MEMCPY static always_inline void *builtin_memcpy(void *to, const void *from, unsigned int n) { int i; unsigned char *cto = to; const unsigned char *cfrom = from; for (i = 0; i < n; ++i, ++cto, ++cfro...
Add file needed for rpl border router
/* Copied from mc1322x/dev/cpu. This file exists as a work-around for the hardware dependant calls to slip_arch_init. Current the prototype for slip_arch_init is slip_arch_init(urb) and a typical call is something like slip_arch_init(BAUD2URB(115200)) BAUD2UBR is hardware specific, however. Further...
Add export rules for scene node leaf.
/* dtkComposerSceneNodeLeaf.h --- * * Author: Julien Wintz * Copyright (C) 2008-2011 - Julien Wintz, Inria. * Created: Fri Feb 3 12:34:45 2012 (+0100) * Version: $Id$ * Last-Updated: Thu Feb 16 14:47:09 2012 (+0100) * By: Julien Wintz * Update #: 10 */ /* Commentary: * */ /* Change log: ...
/* dtkComposerSceneNodeLeaf.h --- * * Author: Julien Wintz * Copyright (C) 2008-2011 - Julien Wintz, Inria. * Created: Fri Feb 3 12:34:45 2012 (+0100) * Version: $Id$ * Last-Updated: Thu May 31 09:45:52 2012 (+0200) * By: tkloczko * Update #: 11 */ /* Commentary: * */ /* Change log: * ...
Add stub for windows random implementation.
/* *The MIT License (MIT) * * Copyright (c) <2017> <Stephan Gatzka> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, co...
Fix running of c++ apps when there are multiple apps in mods.conf
/** * @file * @brief Command registry and invocation code. * * @date 01.03.11 * @author Eldar Abusalimov */ #include <framework/cmd/api.h> #include <framework/cmd/types.h> #include <ctype.h> #include <stddef.h> #include <errno.h> #include <string.h> #include <util/array.h> #include <util/getopt.h> ARRAY_SPREA...
/** * @file * @brief Command registry and invocation code. * * @date 01.03.11 * @author Eldar Abusalimov */ #include <framework/cmd/api.h> #include <framework/cmd/types.h> #include <ctype.h> #include <stddef.h> #include <errno.h> #include <string.h> #include <util/array.h> #include <util/getopt.h> ARRAY_SPREA...
Make test robust to changes in prefix/avoid hardcoded line numbers
// REQUIRES: x86_64-linux // RUN: %host_cc -O0 -g %s -o %t 2>&1 // RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s #include <stdio.h> int inc(int a) { return a + 1; } int main() { printf("%p\n", inc); return 0; } // CHECK: inc // CHECK: print_context.c:7 // CHECK: 5 : #inc...
// REQUIRES: x86_64-linux // RUN: %host_cc -O0 -g %s -o %t 2>&1 // RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s // CHECK: inc // CHECK: print_context.c:[[@LINE+9]] // CHECK: [[@LINE+6]] : #include // CHECK: [[@LINE+6]] : // CHECK: [[@LINE+6]] >: int inc // CHECK: [[@LINE+6]] :...
Add typdef in header main()
/* * Three files to show how to put a typedef struct and * functions into a header file. * * Copyright 2017 Dave Cuthbert, MIT license */ #include <stdlib.h> #include <stdio.h> #include "typedef_in_header_file.h" int main(int argc, char *argv[]) { Node *root; root = new_node(); root->value = 1; ...
Comment the current arrayobject.h situation. Right now for Numpy packages that are consistent with python-1.5, this file could be a number of places relative to /usr/include/python$version so configure must look specifically for it. However, later Numpy packages consistent with python2.x always put it in a standard loc...
#include <Python.h> #include <arrayobject.h> #include "plplot/plplot.h" #include "plplot/plplotP.h" #if defined(PL_DOUBLE) || defined(DOUBLE) #define PL_ARGS(a, b) (a) #define PyArray_PLFLT PyArray_DOUBLE #else #define PL_ARGS(a, b) (b) #define PyArray_PLFLT PyArray_FLOAT #endif #define TRY(E) if(! (E)) return NULL...
#include <Python.h> /* Change this to the recommended #include <Numeric/arrayobject.h> once we no longer support python1.5 */ #include <arrayobject.h> #include "plplot/plplot.h" #include "plplot/plplotP.h" #if defined(PL_DOUBLE) || defined(DOUBLE) #define PL_ARGS(a, b) (a) #define PyArray_PLFLT PyArray_DOUBLE #els...
Remove some compiler warnings for C251.
#include "AceUnitLogging.h" #ifdef ACEUNIT_LOG_RUNNER /** @see TestLogger_t.runnerStarted */ void logRunnerStarted() { } #endif #ifdef ACEUNIT_LOG_SUITE /** @see TestLogger_t.suiteStarted */ void logSuiteStarted() { } #endif #ifdef ACEUNIT_LOG_FIXTURE /** @see TestLogger_t.fixtureStarted */ void logFixtureStarted(co...
#include "AceUnitLogging.h" #ifdef ACEUNIT_LOG_RUNNER /** @see TestLogger_t.runnerStarted */ void logRunnerStarted() { } #endif #ifdef ACEUNIT_LOG_RUNNER /** @see TestLogger_t.runnerEnded */ void logRunnerEnded() { } #endif /** This Logger. */ AceUnitNewLogger( loggerStub, /* CHANGE THIS NAME!!! */ logRunner...
Add VTK type caster to convert VTK wrapped classes
#ifndef pybind_extension_vtk_source_VTKTypeCaster_h #define pybind_extension_vtk_source_VTKTypeCaster_h #include <pybind11/pybind11.h> #include <type_traits> #include "vtkObjectBase.h" #include "vtkPythonUtil.h" #define PYBIND11_VTK_TYPECASTER(VTK_OBJ) \ namespace pybind11 { ...
Add convenience function for hashing arbitrary types
#ifndef ARBITER_HASH_H #define ARBITER_HASH_H #ifndef __cplusplus #error "This file must be compiled as C++." #endif #include <functional> #include <type_traits> namespace Arbiter { template<typename T> size_t hashOf (const T &value) { return std::hash<T>()(value); } } #endif
Add ignore warning pragma for deprecated declarations.
/* Headers needed for multiprocess communication through boost interprocess. * This needs to be included BEFORE anything referencing machine.h, * or macro definitions from machine.h would mess template args. */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wnarrowing" #pragma GCC diagnostic ignored "...
/* Headers needed for multiprocess communication through boost interprocess. * This needs to be included BEFORE anything referencing machine.h, * or macro definitions from machine.h would mess template args. */ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wnarrowing" #pragma GCC diagnostic ignored "...
Make this test actually test what its supposed to test.
// RUN: %llvmgcc -S %s -o - /dev/null // XFAIL: * #define ATTR_BITS(N) __attribute__((bitwidth(N))) typedef int ATTR_BITS( 4) My04BitInt; typedef int ATTR_BITS(16) My16BitInt; typedef int ATTR_BITS(17) My17BitInt; typedef int ATTR_BITS(37) My37BitInt; typedef int ATTR_BITS(65) My65BitInt; struct MyStruct { My04Bi...
// RUN: %llvmgcc -S %s -o - /dev/null 2>&1 > /dev/null | \ // RUN: not grep warning // XFAIL: * #define ATTR_BITS(N) __attribute__((bitwidth(N))) typedef int ATTR_BITS( 4) My04BitInt; typedef int ATTR_BITS(16) My16BitInt; typedef int ATTR_BITS(17) My17BitInt; typedef int ATTR_BITS(37) My37BitInt; typedef int ATTR_...
Update Skia milestone to 93
/* * 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 92 #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 93 #endif
Make State struct a clean POD strcut
#ifndef ZOMBIE_STATE_H #define ZOMBIE_STATE_H #include "box2ddef.h" namespace zombie { struct State { Position position_{0, 0}; Velocity velocity_{0, 0}; float angle_{0.f}; float anglularVelocity_{0.f}; }; } #endif
#ifndef ZOMBIE_STATE_H #define ZOMBIE_STATE_H #include "box2ddef.h" namespace zombie { struct State { Position position_; Velocity velocity_; float angle_; float anglularVelocity_; }; } #endif
Bump version to 9.1.0 to avoid confusion
#ifndef Version_h #define Version_h #define BFARCHIVE_COMMA_SEPARATED_VERSION 3,0,0,0 #define BFARCHIVE_VERSION_STRING "3.0.0" #endif
#ifndef Version_h #define Version_h #define BFARCHIVE_COMMA_SEPARATED_VERSION 9,1,0,0 #define BFARCHIVE_VERSION_STRING "9.1.0" #endif
Add APIntVal as a possible GenericeValue.
//===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------...
//===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------...
Add Gemstone which makes use of alphabet array and strchr
/* Problem Statement John has discovered various rocks. Each rock is composed of various elements, and each element is represented by a lower-case Latin letter from 'a' to 'z'. An element can be present multiple times in a rock. An element is called a gem-element if it occurs at least once in each of the rocks. Given...
Fix stupid msvc compile error
#pragma once #include <v8.h> #include "isolate/holder.h" #include "transferable_handle.h" #include <memory> namespace ivm { class ScriptHandle : public TransferableHandle { private: class ScriptHandleTransferable : public Transferable { private: std::shared_ptr<IsolateHolder> isolate; std::shared_ptr<v8...
#pragma once #include <v8.h> #include "isolate/holder.h" #include "transferable_handle.h" #include <memory> namespace ivm { class ContextHandle; class ScriptHandle : public TransferableHandle { private: class ScriptHandleTransferable : public Transferable { private: std::shared_ptr<IsolateHolder> isolate; ...
Make header parse standalone. NFC.
//===------ llvm/MC/MCAsmParserUtils.h - Asm Parser Utilities ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===------ llvm/MC/MCAsmParserUtils.h - Asm Parser Utilities ---*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Add 64 bit multiplication test
#include <stdio.h> typedef unsigned int fixed_t; fixed_t multiplyFixed(fixed_t a, fixed_t b) { return ((long long) a * (long long) b) >> 16; } int main(int argc, const char *argv[]) { printf("%08x\n", multiplyFixed(0xffffe350, 0x009fe0c6)); // CHECK: e0b4157f }
Update Skia milestone to 57
/* * 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 55 #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 57 #endif
Fix "control reaches end of non-void function" warning.
#include "direction.h" #include <assert.h> #include <base/base.h> enum direction direction_90_degrees_left(enum direction direction) { assert(direction_is_valid(direction)); return (direction + 270) % 360; } enum direction direction_90_degrees_right(enum direction direction) { assert(direction_is_valid...
#include "direction.h" #include <assert.h> #include <base/base.h> enum direction direction_90_degrees_left(enum direction direction) { assert(direction_is_valid(direction)); return (direction + 270) % 360; } enum direction direction_90_degrees_right(enum direction direction) { assert(direction_is_valid...
Switch to SIGLARM, to allow seamless gdb usage
#define _XOPEN_SOURCE 700 #include <stdio.h> #include <signal.h> #include <unistd.h> #include <assert.h> #include <stdlib.h> #include <setjmp.h> jmp_buf try; void handler(int sig) { static int i = 0; printf("stack overflow %d\n", i); longjmp(try, ++i); assert(0); } unsigned recurse(unsigned x) { return...
#define _XOPEN_SOURCE 700 #include <stdio.h> #include <signal.h> #include <unistd.h> #include <assert.h> #include <stdlib.h> #include <setjmp.h> jmp_buf try; void handler(int sig) { static int i = 0; printf("stack overflow %d\n", i); longjmp(try, ++i); assert(0); } unsigned recurse(unsigned x) { return...
Change test case to use 'clang -cc1' (without --disable-free) instead of c-index-test (whose memory management behavior may change in the future).
// RUN: c-index-test -test-load-source local %s 2>&1 | FileCheck %s // This is invalid source. Previously a double-free caused this // example to crash c-index-test. int foo(int x) { int y[x * 3]; help }; // CHECK: 8:3: error: use of undeclared identifier 'help' // CHECK: help // CHECK: 12:102: error: expected...
// RUN: %clang-cc1 -fsyntax-only %s 2>&1 | FileCheck %s // IMPORTANT: This test case intentionally DOES NOT use --disable-free. It // tests that we are properly reclaiming the ASTs and we do not have a double free. // Previously we tried to free the size expression of the VLA twice. int foo(int x) { int y[x * 3]; ...
Change transform interface to add/remove
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once class VolumeTransformation; class VolumeController { public: struct DeviceInfo { std::wstring name; std::wstring id; }; /// <summary> /// Retrieves the cu...
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once class VolumeTransformation; class VolumeController { public: struct DeviceInfo { std::wstring name; std::wstring id; }; /// <summary> /// Retrieves the cu...
Add test file for testing func
/* The MIT License (MIT) Copyright (c) 2015 Alexander Zazhigin mykeich@yandex.ru Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to ...
Adjust display position for pulse ox
#include "interface.h" #include "ecg.h" #include "AFE4400.h" SPI_Interface afe4400_spi(spi_c2); ECG ecg = ECG(1,1,4,9,PB0,4096,RA8875_BLUE,RA8875_BLACK,1000,tim3,&tft); PulseOx spo2 = PulseOx(6,1,3,3,&afe4400_spi,PC8,PA9,PA8,PB7,&tft); void enableSignalAcquisition(void) { spo2.enable(); ecg.enable(); } void...
#include "interface.h" #include "ecg.h" #include "AFE4400.h" SPI_Interface afe4400_spi(spi_c2); ECG ecg = ECG(1,1,4,9,PB0,4096,RA8875_BLUE,RA8875_BLACK,1000,tim3,&tft); PulseOx spo2 = PulseOx(5,1,4,9,&afe4400_spi,PC8,PA9,PA8,PB7,&tft); void enableSignalAcquisition(void) { spo2.enable(); ecg.enable(); } void...
Add intermediate TextureVideoFrame typedef for Chromium
/* * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contribut...
Fix 'umbrella header for module does not include...' error
// // libPhoneNumber-iOS.h // libPhoneNumber-iOS // // Created by Roy Marmelstein on 04/08/2015. // Copyright (c) 2015 ohtalk.me. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for libPhoneNumber-iOS. FOUNDATION_EXPORT double libPhoneNumber_iOSVersionNumber; //! Project version string...
// // libPhoneNumber-iOS.h // libPhoneNumber-iOS // // Created by Roy Marmelstein on 04/08/2015. // Copyright (c) 2015 ohtalk.me. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for libPhoneNumber-iOS. FOUNDATION_EXPORT double libPhoneNumber_iOSVersionNumber; //! Project version string...
Add Pagai's invariants extraction, fix various typos.
#include <stdio.h> int simpleloop (int x, int y) { while (x < y) { if (x < 3) x++; else x+=2; } return x; } int main () { printf("%i", simpleloop(0, 10), stdout); }
int simpleloop (int x, int y) { while (x < y) { if (x < 3) x++; else x+=2; } return x; }
Use the right import type.
// // SNPBlockUserOperation.h // Snapper // // Created by Paul Schifferer on 5/12/13. // Copyright (c) 2013 Pilgrimage Software. All rights reserved. // #import <Snapper/Snapper.h> #import "SNPUserParameters.h" @interface SNPBlockUserOperation : SNPBaseUserTokenOperation <SNPUserParameters> // -- Properties -- ...
// // SNPBlockUserOperation.h // Snapper // // Created by Paul Schifferer on 5/12/13. // Copyright (c) 2013 Pilgrimage Software. All rights reserved. // #import "SNPBaseUserTokenOperation.h" #import "SNPUserParameters.h" @interface SNPBlockUserOperation : SNPBaseUserTokenOperation <SNPUserParameters> // -- Prop...
Include all headers by default
// // MTStackableNavigationController.h // // Created by Mat Trudel on 2013-02-05. // Copyright (c) 2013 Mat Trudel. All rights reserved. // #import <UIKit/UIKit.h> #import "UIViewController+MTStackableNavigationController.h" @interface MTStackableNavigationController : UIViewController <UINavigationBarDelegate> @...
// // MTStackableNavigationController.h // // Created by Mat Trudel on 2013-02-05. // Copyright (c) 2013 Mat Trudel. All rights reserved. // #import <UIKit/UIKit.h> #import "UIViewController+MTStackableNavigationController.h" #import "MTStackableNavigationItem.h" @interface MTStackableNavigationController : UIView...
Add Chapter 27, exercise 9
/* Chapter 27, exercise 9: using only C facilities, including the C standard library, read a sequence of words from stdin and write them to stdout in lexicographical order. Use qsort() or insert the words into an ordered list as you read them. */ #include<stdio.h> #include<stdlib.h> #include<string.h> #de...
Fix ps depedency when ps not included
/* * Copyright (C) 2013 INRIA. * * 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 sys_shell_commands * @{ * * @file * @brief Shell commands for the PS module *...
/* * Copyright (C) 2013 INRIA. * * 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 sys_shell_commands * @{ * * @file * @brief Shell commands for the PS module *...
Add target triples to fix test on non-x86.
// RUN: %clang_cc1 -O1 -S -o - %s | FileCheck -check-prefix=STRCPY -check-prefix=MEMSET %s // RUN: %clang_cc1 -fno-builtin -O1 -S -o - %s | FileCheck -check-prefix=NOSTRCPY -check-prefix=NOMEMSET %s // RUN: %clang_cc1 -fno-builtin-memset -O1 -S -o - %s | FileCheck -check-prefix=STRCPY -check-prefix=NOMEMSET %s void PR...
// RUN: %clang_cc1 -triple x86_64-linux-gnu -O1 -S -o - %s | FileCheck -check-prefix=STRCPY -check-prefix=MEMSET %s // RUN: %clang_cc1 -triple x86_64-linux-gnu -fno-builtin -O1 -S -o - %s | FileCheck -check-prefix=NOSTRCPY -check-prefix=NOMEMSET %s // RUN: %clang_cc1 -triple x86_64-linux-gnu -fno-builtin-memset -O1 -S ...
Add declaration of double** to Qt metatype engine.
/* dtkComposerMetatype.h --- * * Author: tkloczko * Copyright (C) 2011 - Thibaud Kloczko, Inria. * Created: Sat Aug 4 00:26:47 2012 (+0200) * Version: $Id$ * Last-Updated: Wed Oct 17 11:45:26 2012 (+0200) * By: Julien Wintz * Update #: 12 */ /* Commentary: * */ /* Change log: * */ #i...
/* dtkComposerMetatype.h --- * * Author: tkloczko * Copyright (C) 2011 - Thibaud Kloczko, Inria. * Created: Sat Aug 4 00:26:47 2012 (+0200) * Version: $Id$ * Last-Updated: Thu Jun 13 14:55:45 2013 (+0200) * By: Thibaud Kloczko * Update #: 15 */ /* Commentary: * */ /* Change log: * */ ...
Check that there's something in the username buffer before reading it
#include <unistd.h> #include <stdio.h> #include <string.h> #include <pthread.h> #include <errno.h> #include "spotify-fs.h" int main(int argc, char *argv[]) { int retval = 0; char *password = NULL; char *username = malloc(SPOTIFY_USERNAME_MAXLEN); if ((getuid() == 0) || (geteuid() == 0)) { fprintf(stderr, "Runnin...
#include <unistd.h> #include <stdio.h> #include <string.h> #include <pthread.h> #include <errno.h> #include "spotify-fs.h" int main(int argc, char *argv[]) { int retval = 0; char *password = NULL; char *username = malloc(SPOTIFY_USERNAME_MAXLEN); if ((getuid() == 0) || (geteuid() == 0)) { fprintf(stderr, "Runnin...
Add header file def for private structure
#ifndef _LIBSMART_PRIV_H #define _LIBSMART_PRIV_H typedef struct smart_s { smart_protocol_e protocol; /* Device / OS specific follows this structure */ } smart_t; #endif
Fix compilation on MacOSX (common symbols not allowed with MH_DYLIB output format)
#ifdef _WIN32 #define DL_EXPORT __declspec( dllexport ) #else #define DL_EXPORT #endif DL_EXPORT int TestDynamicLoaderData; DL_EXPORT void TestDynamicLoaderFunction() { }
#ifdef _WIN32 #define DL_EXPORT __declspec( dllexport ) #else #define DL_EXPORT #endif DL_EXPORT int TestDynamicLoaderData = 0; DL_EXPORT void TestDynamicLoaderFunction() { }
Update Game to new objectd api
#include <kotaka/paths.h> #include <game/paths.h> inherit LIB_BIN; void main(string args) { object user; user = query_user(); if (user->query_class() < 2) { send_out("You do not have sufficient access rights to rebuild.\n"); return; } OBJECTD->klib_recompile(); OBJECTD->global_recompile(); }
#include <kotaka/paths.h> #include <game/paths.h> inherit LIB_BIN; void main(string args) { object user; user = query_user(); if (user->query_class() < 1) { send_out("You do not have sufficient access rights to rebuild.\n"); return; } OBJECTD->recompile_everything(); }
Fix missing include breaking compilation with Qt 5.0.
#ifndef HSQML_ENGINE_H #define HSQML_ENGINE_H #include <QtCore/QScopedPointer> #include <QtCore/QString> #include <QtCore/QUrl> #include <QtQml/QQmlEngine> #include <QtQml/QQmlContext> #include <QtQml/QQmlComponent> #include "hsqml.h" class HsQMLObjectProxy; class HsQMLWindow; struct HsQMLEngineConfig { HsQMLEn...
#ifndef HSQML_ENGINE_H #define HSQML_ENGINE_H #include <QtCore/QScopedPointer> #include <QtCore/QString> #include <QtCore/QStringList> #include <QtCore/QUrl> #include <QtQml/QQmlEngine> #include <QtQml/QQmlContext> #include <QtQml/QQmlComponent> #include "hsqml.h" class HsQMLObjectProxy; class HsQMLWindow; struct H...
Structure to hold data abouth crystal/cell energies corresponding to a single RCU block
#ifndef ALIHLTPHOSRCUCELLENERGYDATA_H #define ALIHLTPHOSRCUCELLENERGYDATA_H struct AliHLTPHOSRcuCellEnergyData { AliHLTUInt8_t fRcuX; AliHLTUInt8_t fRcuY; AliHLTUInt8_t fModuleID; unsigned long cellEnergies[32][28][2]; }; #endif
Test commit: Remove trailing whitespace.
//===-- GCs.h - Garbage collector linkage hacks ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===-- GCs.h - Garbage collector linkage hacks ---------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Fix operator<<(ostream&) and operator>>(istream&) for gfx::Size
// LAF Gfx Library // Copyright (C) 2019 Igara Studio S.A. // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef GFX_SIZE_IO_H_INCLUDED #define GFX_SIZE_IO_H_INCLUDED #pragma once #include "gfx/size.h" #include <iosfwd> namespace gfx { inline std::ostre...
// LAF Gfx Library // Copyright (C) 2019 Igara Studio S.A. // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef GFX_SIZE_IO_H_INCLUDED #define GFX_SIZE_IO_H_INCLUDED #pragma once #include "gfx/size.h" #include <iosfwd> namespace gfx { inline std::ostre...
Remove yet another memory leak
#include "blueprint.h" #include <assert.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> #include "parson.h" #include "bstrlib.h" void free_blueprint(struct blueprint *bp) { if (bp == NULL) return; bdestroy(bp->name); bdestroy(bp->blueprint_na...
#include "blueprint.h" #include <assert.h> #include <string.h> #include <stdio.h> #include <stdlib.h> #include <stdbool.h> #include <math.h> #include "parson.h" #include "bstrlib.h" void free_blueprint(struct blueprint *bp) { if (bp == NULL) return; bdestroy(bp->name); bdestroy(bp->blueprint_na...
Fix typo in `idxstat` subcommand
#include "goontools.h" void usage(char* prog) { fprintf(stderr, "\n"); fprintf(stderr, "Usage: %s <subcommand> <subcommand arguments>\n", prog); fprintf(stderr, "\n"); fprintf(stderr, "subcommands:\n"); fprintf(stderr, " index index file\n"); fprintf(stderr, " sort sort file\n"...
#include "goontools.h" void usage(char* prog) { fprintf(stderr, "\n"); fprintf(stderr, "Usage: %s <subcommand> <subcommand arguments>\n", prog); fprintf(stderr, "\n"); fprintf(stderr, "subcommands:\n"); fprintf(stderr, " index index file\n"); fprintf(stderr, " sort sort file\n"...
Add an unknown folder type
#ifndef KMFOLDERTYPE_H #define KMFOLDERTYPE_H typedef enum { KMFolderTypeMbox = 0, KMFolderTypeMaildir, KMFolderTypeCachedImap, KMFolderTypeImap, KMFolderTypeSearch } KMFolderType; typedef enum { KMStandardDir = 0, KMImapDir, KMSearchDir } KMFolderDirType; #endif // KMFOLDERTYPE_H
#ifndef KMFOLDERTYPE_H #define KMFOLDERTYPE_H typedef enum { KMFolderTypeMbox = 0, KMFolderTypeMaildir, KMFolderTypeCachedImap, KMFolderTypeImap, KMFolderTypeSearch, KMFolderTypeUnknown } KMFolderType; typedef enum { KMStandardDir = 0, KMImapDir, KMSearchDir } KMFolderDirType; #endif // KMFOLDER...
Fix compile of posix clock after timestamp_t was renamed to csp_timestamp_t
/* Cubesat Space Protocol - A small network-layer protocol designed for Cubesats Copyright (C) 2012 Gomspace ApS (http://www.gomspace.com) Copyright (C) 2012 AAUSAT3 Project (http://aausat3.space.aau.dk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General P...
/* Cubesat Space Protocol - A small network-layer protocol designed for Cubesats Copyright (C) 2012 Gomspace ApS (http://www.gomspace.com) Copyright (C) 2012 AAUSAT3 Project (http://aausat3.space.aau.dk) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General P...
Add override to overridden method
#pragma once #include <gloperate/gloperate_api.h> #include <gloperate/painter/AbstractOutputCapability.h> #include <gloperate/pipeline/AbstractPipeline.h> #include <string> #include <vector> namespace gloperate { class AbstractData; template <typename T> class Data; /** * @brief * OutputCapability for pipeli...
#pragma once #include <gloperate/gloperate_api.h> #include <gloperate/painter/AbstractOutputCapability.h> #include <gloperate/pipeline/AbstractPipeline.h> #include <string> #include <vector> namespace gloperate { class AbstractData; template <typename T> class Data; /** * @brief * OutputCapability for pipeli...
Use MCefRefPtr::get() to check for null reference
// Copyright 2010-2015 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" #include "include\cef_callback.h" namespace CefSharp { public ref class CefCallbackWrapper : public ICallbac...
// Copyright 2010-2015 The CefSharp Authors. All rights reserved. // // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file. #pragma once #include "Stdafx.h" #include "include\cef_callback.h" namespace CefSharp { public ref class CefCallbackWrapper : public ICallbac...
Fix the `__cplusplus` gating for std::make_unique
/** * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #pragma on...
/** * Copyright (c) 2016-present, Facebook, Inc. * All rights reserved. * * This source code is licensed under the BSD-style license found in the * LICENSE file in the root directory of this source tree. An additional grant * of patent rights can be found in the PATENTS file in the same directory. */ #pragma on...
Add string manipulation functions for windows.
/* *The MIT License (MIT) * * Copyright (c) <2017> <Stephan Gatzka> * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including * without limitation the rights to use, co...
Add formpost pointer in curl handle
#ifndef CPR_CURL_HOLDER_H #define CPR_CURL_HOLDER_H #include <memory> #include <curl/curl.h> namespace cpr { struct CurlHolder { CURL* handle; struct curl_slist* chunk; char error[CURL_ERROR_SIZE]; }; } // namespace cpr #endif
#ifndef CPR_CURL_HOLDER_H #define CPR_CURL_HOLDER_H #include <memory> #include <curl/curl.h> namespace cpr { struct CurlHolder { CURL* handle; struct curl_slist* chunk; struct curl_httppost* formpost; char error[CURL_ERROR_SIZE]; }; } // namespace cpr #endif
Change default port number 5432
//===----------------------------------------------------------------------===// // // Peloton // // config.h // // Identification: src/include/common/config.h // // Copyright (c) 2015-16, Carnegie Mellon University Database Group // //===---------------------------------------------------------...
//===----------------------------------------------------------------------===// // // Peloton // // config.h // // Identification: src/include/common/config.h // // Copyright (c) 2015-16, Carnegie Mellon University Database Group // //===---------------------------------------------------------...
Fix MCU procedure ID definitions.
#ifndef LMS7_MCU_PROGRAMS_H #define LMS7_MCU_PROGRAMS_H #include "LimeSuiteConfig.h" #include <stdint.h> #define MCU_PROGRAM_SIZE 16384 #define MCU_ID_DC_IQ_CALIBRATIONS 0x01 #define MCU_ID_CALIBRATIONS_SINGLE_IMAGE 0x05 #define MCU_FUNCTION_CALIBRATE_TX 1 #define MCU_FUNCTION_CALIBRATE_RX 2 #define MCU_FUNCTION_UP...
#ifndef LMS7_MCU_PROGRAMS_H #define LMS7_MCU_PROGRAMS_H #include "LimeSuiteConfig.h" #include <stdint.h> #define MCU_PROGRAM_SIZE 16384 #define MCU_ID_DC_IQ_CALIBRATIONS 0x01 #define MCU_ID_CALIBRATIONS_SINGLE_IMAGE 0x05 #define MCU_FUNCTION_CALIBRATE_TX 1 #define MCU_FUNCTION_CALIBRATE_RX 2 #define MCU_FUNCTION_UP...
Reorganize public header files (part 2)
/* * Copyright 2019 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/licens...
Use printf instead of "echo -ne".
// Check that clang is able to process response files with extra whitespace. // We generate a dos-style file with \r\n for line endings, and then split // some joined arguments (like "-x c") across lines to ensure that regular // clang (not clang-cl) can process it correctly. // // RUN: echo -en "-x\r\nc\r\n-DTEST\r\n"...
// Check that clang is able to process response files with extra whitespace. // We generate a dos-style file with \r\n for line endings, and then split // some joined arguments (like "-x c") across lines to ensure that regular // clang (not clang-cl) can process it correctly. // // RUN: printf " -x\r\nc\r\n-DTEST\r\n" ...
Test for return value codegen
// RUN: clang %s -emit-llvm -O0 -o - -S | FileCheck %s #include <enerc.h> int main () { return 0; } int fp(int p) { return p * 2; // CHECK: ret i32 %mul, !quals !0 } APPROX int fa(int p) { return p * 2; // CHECK: ret i32 %mul, !quals !1 } int fp2(int p) { if (p > 2) { return p * 3; ...
Add definitions for AIX 3.2.
#if defined(ULTRIX42) extern "C" int brk( void * ); extern "C" void *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(ULTRIX43) extern "C" char *brk( char * ); extern "C" char *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(SUNOS41) extern "C" int brk( void * ); extern "C" void *sbrk( i...
#if defined(ULTRIX42) extern "C" int brk( void * ); extern "C" void *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(ULTRIX43) extern "C" char *brk( char * ); extern "C" char *sbrk( int ); typedef void (*SIG_HANDLER)(); #elif defined(SUNOS41) extern "C" int brk( void * ); extern "C" void *sbrk( i...
Add custom def for uint32_t
/* This is part of pyahocorasick Python module. Windows declarations Author : Wojciech Muła, wojciech_mula@poczta.onet.pl WWW : http://0x80.pl License : BSD-3-Clause (see LICENSE) */ #ifndef PYAHCORASICK_WINDOWS_H__ #define PYAHCORASICK_WINDOWS_H__ typedef unsigned char uint...
/* This is part of pyahocorasick Python module. Windows declarations Author : Wojciech Muła, wojciech_mula@poczta.onet.pl WWW : http://0x80.pl License : BSD-3-Clause (see LICENSE) */ #ifndef PYAHCORASICK_WINDOWS_H__ #define PYAHCORASICK_WINDOWS_H__ typedef unsigned char uint...
Create helper functions for creating random floats
/* The Halfling Project - A Graphics Engine and Projects * * The Halfling Project is the legal property of Adrian Astley * Copyright Adrian Astley 2013 */ #ifndef MATH_H #define MATH_H namespace Common { template<typename T> inline T Min(const T& a, const T& b) { return a < b ? a : b; } template<typename T> i...
/* The Halfling Project - A Graphics Engine and Projects * * The Halfling Project is the legal property of Adrian Astley * Copyright Adrian Astley 2013 */ #ifndef MATH_H #define MATH_H #include "common/halfling_sys.h" namespace Common { template<typename T> inline T Min(const T& a, const T& b) { return a < b ...
Fix multiple defined symbol errors
/* * Copyright (C) 2007 The Android Open Source Project * * 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 app...
/* * Copyright (C) 2007 The Android Open Source Project * * 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 app...
Make list.h non-modifiabe in ADT
#ifndef _H_ADTS_LIST #define _H_ADTS_LIST #include <string.h> #include <stdbool.h> #include <inttypes.h> /** ************************************************************************** * \details * ************************************************************************** */ #define ADTS_LIST_BYTES (32) #d...
#ifndef _H_ADTS_LIST #define _H_ADTS_LIST #include <string.h> #include <stdbool.h> #include <inttypes.h> /** ************************************************************************** * \details * ************************************************************************** */ #define ADTS_LIST_BYTES (32) #d...
Remove the include of machdep.h which didn't need to be there, and didn't work on Solaris.
#if !defined(_URL_CONDOR_H) #define _URL_CONDOR_H #include <sys/types.h> #include <limits.h> #include "machdep.h" typedef int (*open_function_type)(const char *, int, size_t); class URLProtocol { public: URLProtocol(char *protocol_key, char *protocol_name, open_function_type protocol_open_func); /* int (*pr...
#if !defined(_URL_CONDOR_H) #define _URL_CONDOR_H #include <sys/types.h> #include <limits.h> typedef int (*open_function_type)(const char *, int, size_t); class URLProtocol { public: URLProtocol(char *protocol_key, char *protocol_name, open_function_type protocol_open_func); /* int (*protocol_open_func)(con...
Make runtime locale API available on windows
/* * Copyright 2014 Matthias Fuchs * * 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...
/* * Copyright 2014 Matthias Fuchs * * 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...
Add initial PDB file format
/** * Declarations of data structures in PDB files. * * These are, for the most part, undocumented. At the time of this writing there * is no detailed documentation on the PDB file format. Microsoft has open * sourced the PDB file format: * * https://github.com/Microsoft/microsoft-pdb * * This is among the...
Add reboot programm for demon
#include <wiringPi.h> #include <signal.h> #include <errno.h> #include <unistd.h> #include <sys/reboot.h> #include <stdio.h> void gpio4Callback(void) { sync(); reboot(RB_AUTOBOOT); } int main(){ sigset_t set; int sig; int *sigptr = &sig; int ret_val; sigemptyset(&set); sigaddset(&set, ...
Add missing include for size_t
//===--- Stack.h - Utilities for dealing with stack space -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===--- Stack.h - Utilities for dealing with stack space -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Use <openssl/e_os2.h> rather than <stdint.h>
/* * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * https://www.openssl.org/source/license.html * or in the file LICENSE...
/* * Copyright 2016-2021 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the Apache License 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * https://www.openssl.org/source/license.html * or in the file LICENSE...
Fix decoding of LINUX_REBOOT_CMD_RESTART2 argument
#include "defs.h" #include "xlat/bootflags1.h" #include "xlat/bootflags2.h" #include "xlat/bootflags3.h" SYS_FUNC(reboot) { printflags(bootflags1, tcp->u_arg[0], "LINUX_REBOOT_MAGIC_???"); tprints(", "); printflags(bootflags2, tcp->u_arg[1], "LINUX_REBOOT_MAGIC_???"); tprints(", "); printflags(bootflags3, tcp->u...
#include "defs.h" #include "xlat/bootflags1.h" #include "xlat/bootflags2.h" #include "xlat/bootflags3.h" SYS_FUNC(reboot) { const unsigned int magic1 = tcp->u_arg[0]; const unsigned int magic2 = tcp->u_arg[1]; const unsigned int cmd = tcp->u_arg[2]; printflags(bootflags1, magic1, "LINUX_REBOOT_MAGIC_???"); tpri...
Add WinMain for windows platform
#include <mruby.h> #include <mruby/compile.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { mrb_state *mrb; mrbc_context *c; mrb_value v; FILE *fp; fp = fopen("init_minigame.rb", "rb"); if (fp == NULL) { fputs("Couldn't load 'init_minigame.rb'", stderr); ...
#include <mruby.h> #include <mruby/compile.h> #include <windows.h> #include <stdlib.h> #include <stdlib.h> #ifdef _WIN32 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) #else int main(int argc, char **argv) #endif { mrb_state *mrb; mrbc_context *c; ...
Fix this testcase: there are two matches for llvm.cttz.i64 because of the declaration of the intrinsic. Also, emit-llvm is automatic and doesn't need to be specified.
// RUN: %llvmgcc -O2 -S -o - -emit-llvm %s | grep {llvm.cttz.i64} | count 1 // RUN: %llvmgcc -O2 -S -o - -emit-llvm %s | not grep {lshr} int bork(unsigned long long x) { return __builtin_ctzll(x); }
// RUN: %llvmgcc -O2 -S -o - %s | grep {llvm.cttz.i64} | count 2 // RUN: %llvmgcc -O2 -S -o - %s | not grep {lshr} int bork(unsigned long long x) { return __builtin_ctzll(x); }
Mark test as requiring x86-registered-target.
// RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-obj --mrelax-relocations %s -mrelocation-model pic -o %t // RUN: llvm-readobj -r %t | FileCheck %s // CHECK: R_X86_64_REX_GOTPCRELX foo extern int foo; int *f(void) { return &foo; }
// REQUIRES: x86-registered-target // RUN: %clang_cc1 -triple x86_64-pc-linux-gnu -emit-obj --mrelax-relocations %s -mrelocation-model pic -o %t // RUN: llvm-readobj -r %t | FileCheck %s // CHECK: R_X86_64_REX_GOTPCRELX foo extern int foo; int *f(void) { return &foo; }
Add a ThreadX implementation of malloc
#include <stdint.h> #include <stdbool.h> #include <assert.h> #include <threadx/tx_api.h> #pragma mark - Definitions - /* * In this example, I am using the compiler's builtin atomic compare and swap * Routine. This will provide atomic access to swapping the malloc pointer, * and only one function will initialize the m...
Add header to provide C99 compatibility
/*! * @file c99.h * @brief Provide C99 compatibility * @author koturn */ #ifndef KOTLIB_COMPAT_C99_H #define KOTLIB_COMPAT_C99_H #include "defsupport.h" #if defined(_MSC_VER) || KOTLIB_COMPAT_IS_SUPPORT_C99 # define __func__ __FUNCTION__ #endif #ifndef __cplusplus # if defined(_MSC_VER) # define inlin...
Add terms for more general mapping (other than just vertical for fizhi)
c Alternate grid Mapping Common c ------------------------------ common /gridalt_mapping/ nlperdyn,dpphys0,dpphys integer nlperdyn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,Nsy) _RL dpphys0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy) _RL dpphys(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy)
c Alternate grid Mapping Common c ------------------------------ common /gridalt_mapping/ nlperdyn,dpphys0,dpphys, . dxfalt,dyfalt,drfalt integer nlperdyn(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nr,nSx,Nsy) _RL dpphys0(1-OLx:sNx+OLx,1-OLy:sNy+OLy,Nrphys,nSx,nSy) ...
Make squere.c to work with nXn
#include <stdio.h> int isMagic(int squere[3][3]) { int currSum = 0; int sum = squere[0][0]+squere[0][1]+squere[0][2]; int i = 0; for(i=1;i<3;i++) { int j; for(j=0;j<3;j++) { currSum+=squere[i][j]; } if(currSum != sum) { return 0...
#include <stdio.h> int isMagic(int n,int squere[n][n]) { int currSum = 0; int sum = 0; int i = 0; for(i=0;i<n;i++) { int j; for(j=0;j<n;j++) { currSum+=squere[i][j]; } if(i==0) { sum = currSum; } if(currSum != sum...
Add array size check to sizeof() test
// RUN: %ocheck 0 %s typedef struct { int x; } A; main() { int sz = sizeof((A *)0)->x; if(sz != sizeof(int)) abort(); return 0; }
// RUN: %ocheck 0 %s typedef struct { int x; } A; main() { int sz = sizeof((A *)0)->x; if(sz != sizeof(int)) abort(); int ar[10]; sz = sizeof(ar)[0]; if(sz != sizeof(int)) abort(); return 0; }
Add a zoom level + comments
#ifndef SCREEN_MAP_H #define SCREEN_MAP_H // in meters/pixels #define MAP_SCALE_MIN 250 #define MAP_SCALE_MAX 64000 #define MAP_SCALE_INI (MAP_SCALE_MIN*8) #define MAP_VSIZE_X 4000 #define MAP_VSIZE_Y 4000 #define XINI MAP_VSIZE_X/2 #define YINI MAP_VSIZE_Y/2 // external variables (debug purpose) extern int map_sca...
#ifndef SCREEN_MAP_H #define SCREEN_MAP_H // at level 7 (MAP_SCALE=16000), the screen width is approximatively 14.5km => 100m/px) // level 1: MAP_SCALE=250 => 1.5m/px - screen 225m // level 8: MAP_SCALE_MAX 32000 => 200m/px - screen: 29km #define MAP_SCALE_MIN 250 #define MAP_SCALE_MAX 32000 //2000=MAP_SCALE_MIN * 8 =...
Add the necessary includes and forward declarations such that the class can be compiled independently.
// @(#)root/meta:$Name: $:$Id: TVirtualIsAProxy.h,v 1.1 2005/05/27 16:42:58 pcanal Exp $ // Author: Markus Frank 20/05/2005 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. ...
// @(#)root/meta:$Name: $:$Id: TVirtualIsAProxy.h,v 1.2 2005/06/08 18:51:36 rdm Exp $ // Author: Markus Frank 20/05/2005 /************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. ...
Add newline to end of file.
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_ #define VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_ namespace views { namespace interna...
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_ #define VIEWS_CONTROLS_MENU_NATIVE_MENU_HOST_DELEGATE_H_ namespace views { namespace interna...
Make AutoSeeded_RNG::reseed's parameter default to 256 for compatability with the version in earlier releases. Rickard Bondesson pointed out that this was a problem on the mailing list.
/* * Auto Seeded RNG * (C) 2008 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_AUTO_SEEDING_RNG_H__ #define BOTAN_AUTO_SEEDING_RNG_H__ #include <botan/rng.h> #include <string> namespace Botan { /** * RNG that attempts to seed itself */ class BOTAN_DLL AutoSeeded_RNG : public Random...
/* * Auto Seeded RNG * (C) 2008 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_AUTO_SEEDING_RNG_H__ #define BOTAN_AUTO_SEEDING_RNG_H__ #include <botan/rng.h> #include <string> namespace Botan { /** * RNG that attempts to seed itself */ class BOTAN_DLL AutoSeeded_RNG : public Random...
Fix wildcard matching on CHECK lines. Now recognises arch64--.
// Check target CPUs are correctly passed. // RUN: %clang -target aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s // GENERIC: "-cc1"{{.*}} "-triple" "aarch64" {{.*}} "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s // CA53: "-cc1"{{...
// Check target CPUs are correctly passed. // RUN: %clang -target aarch64 -### -c %s 2>&1 | FileCheck -check-prefix=GENERIC %s // GENERIC: "-cc1"{{.*}} "-triple" "aarch64{{.*}}" "-target-cpu" "generic" // RUN: %clang -target aarch64 -mcpu=cortex-a53 -### -c %s 2>&1 | FileCheck -check-prefix=CA53 %s // CA53: "-cc1"{{....
Change to double. Missed from previous commit.
#include <string.h> #include "proxrcmds.h" #include "sim-hab.h" void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value) { double data; double content; int id; bionet_node_t *node; bionet_value_get_float(value, &data); if(data < 0 || data > 255) return; node = bionet_reso...
#include <string.h> #include "proxrcmds.h" #include "sim-hab.h" void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value) { double data; double content; int id; bionet_node_t *node; bionet_value_get_float(value, &data); if(data < 0 || data > 255) return; node = bionet_reso...
Include the generic startup header, since that declares iosglk_startup_code().
#include "glk.h" extern void iosglk_set_can_restart_flag(int); extern int iosglk_can_restart_cleanly(void); extern void iosglk_shut_down_process(void) GLK_ATTRIBUTE_NORETURN;
#include "glk.h" #include "iosglk_startup.h" extern void iosglk_set_can_restart_flag(int); extern int iosglk_can_restart_cleanly(void); extern void iosglk_shut_down_process(void) GLK_ATTRIBUTE_NORETURN;
Fix unused incorrect 'VTypePattern<T*>::val_t' definition
#ifndef Vca_VTypePattern_Interface #define Vca_VTypePattern_Interface /********************* ***** Library ***** *********************/ #include "Vca.h" /************************** ***** Declarations ***** **************************/ class VString; /************************* ***** Definitions ***** ***...
#ifndef Vca_VTypePattern_Interface #define Vca_VTypePattern_Interface /********************* ***** Library ***** *********************/ #include "Vca.h" /************************** ***** Declarations ***** **************************/ class VString; /************************* ***** Definitions ***** ***...
Add crash case: "Invalid read of size 4" in printOperand(…)
#include <capstone.h> #define BINARY "\x3b\x30\x62\x93\x5d\x61\x03\xe8" int main(int argc, char **argv, char **envp) { csh handle; if (cs_open(CS_ARCH_X86, CS_MODE_64, &handle)) { printf("cs_open(…) failed\n"); return 1; } cs_insn *insn; cs_disasm(handle, (uint8_t *)BINARY, sizeof(BINARY) - 1, 0x100...
Add var_eq test with invalid widen
// SKIP PARAM: --set ana.activated[+] var_eq // manually minimized from sv-benchmarks/c/ldv-linux-3.16-rc1/205_9a_array_unsafes_linux-3.16-rc1.tar.xz-205_9a-drivers--net--usb--cx82310_eth.ko-entry_point.cil.out.i // used to call widen incorrectly typedef _Bool bool; void usb_bulk_msg(int *arg4, int x) { } void cx823...
Support "--version" in the CLI to print the version.
#include <stdio.h> #include <string.h> #include "os.h" #include "vm.h" #include "wren.h" int main(int argc, const char* argv[]) { if (argc == 2 && strcmp(argv[1], "--help") == 0) { printf("Usage: wren [file] [arguments...]\n"); printf(" --help Show command line usage\n"); return 0; } osSetArg...
#include <stdio.h> #include <string.h> #include "os.h" #include "vm.h" #include "wren.h" int main(int argc, const char* argv[]) { if (argc == 2 && strcmp(argv[1], "--help") == 0) { printf("Usage: wren [file] [arguments...]\n"); printf(" --help Show command line usage\n"); return 0; } if (argc...
Add another complex promotion test.
// RUN: clang %s -verify -fsyntax-only float a; int b[__builtin_classify_type(a + 1i) == 9 ? 1 : -1]; int c[__builtin_classify_type(1i + a) == 9 ? 1 : -1]; double d; __typeof__ (d + 1i) e; int f[sizeof(e) == 2 * sizeof(double) ? 1 : -1];
// RUN: clang %s -verify -fsyntax-only float a; int b[__builtin_classify_type(a + 1i) == 9 ? 1 : -1]; int c[__builtin_classify_type(1i + a) == 9 ? 1 : -1]; double d; __typeof__ (d + 1i) e; int f[sizeof(e) == 2 * sizeof(double) ? 1 : -1]; int g; int h[__builtin_classify_type(g + 1.0i) == 9 ? 1 : -1]; int i[__builti...
Add test for multiple thread init/shutdown
#include "clar_libgit2.h" #include "cache.h" static git_repository *g_repo; void test_threads_basic__initialize(void) { g_repo = cl_git_sandbox_init("testrepo"); } void test_threads_basic__cleanup(void) { cl_git_sandbox_cleanup(); } void test_threads_basic__cache(void) { // run several threads polling the cac...
#include "clar_libgit2.h" #include "cache.h" static git_repository *g_repo; void test_threads_basic__initialize(void) { g_repo = cl_git_sandbox_init("testrepo"); } void test_threads_basic__cleanup(void) { cl_git_sandbox_cleanup(); } void test_threads_basic__cache(void) { // run several threads polling the cac...
Fix non-ISA link error in drivers/scsi/advansys.c
/* * ISA bus. */ #ifndef __LINUX_ISA_H #define __LINUX_ISA_H #include <linux/device.h> #include <linux/kernel.h> struct isa_driver { int (*match)(struct device *, unsigned int); int (*probe)(struct device *, unsigned int); int (*remove)(struct device *, unsigned int); void (*shutdown)(struct device *, unsigned...
/* * ISA bus. */ #ifndef __LINUX_ISA_H #define __LINUX_ISA_H #include <linux/device.h> #include <linux/kernel.h> struct isa_driver { int (*match)(struct device *, unsigned int); int (*probe)(struct device *, unsigned int); int (*remove)(struct device *, unsigned int); void (*shutdown)(struct device *, unsigned...
Add a missing prototype to fix a warning.
/*- * 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...