Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Fix SpinLock and add tryLock.
// SyncTools.h // This file is part of the EScript programming language (https://github.com/EScript) // // Copyright (C) 2015 Claudius Jhn <ClaudiusJ@live.de> // // Licensed under the MIT License. See LICENSE file for details. // --------------------------------------------------------------------------------- #ifndef ...
// SyncTools.h // This file is part of the EScript programming language (https://github.com/EScript) // // Copyright (C) 2015 Claudius Jhn <ClaudiusJ@live.de> // // Licensed under the MIT License. See LICENSE file for details. // --------------------------------------------------------------------------------- #ifndef ...
Add missing file. Remove debuggig statements
#ifndef TAILPRODUCE_UTILS_H #define TAILPRODUCE_UTILS_H #include <string> #include <sstream> #include <memory> #include <unordered_map> #include <utility> #include <cereal/cereal.hpp> #include <cereal/archives/json.hpp> #include <cereal/types/string.hpp> #include "helpers.h" #include "stream.h" #include "dbm_iterato...
Use integers instead of floats in for-loop
#ifndef SPIRALLINESGLWIDGET_H #define SPIRALLINESGLWIDGET_H #include "GLWidget.h" #include <cmath> class SpiralLinesGLWidget : public GLWidget { public: SpiralLinesGLWidget(QWidget* parent = 0); protected: void initializeGL(); void render(); }; SpiralLinesGLWidget::SpiralLinesGLWidget(QWidget* parent) : GLWidget(...
#ifndef SPIRALLINESGLWIDGET_H #define SPIRALLINESGLWIDGET_H #include "GLWidget.h" #include <cmath> class SpiralLinesGLWidget : public GLWidget { public: SpiralLinesGLWidget(QWidget* parent = 0); protected: void initializeGL(); void render(); }; SpiralLinesGLWidget::SpiralLinesGLWidget(QWidget* parent) : GLWidget(...
Comment out unused fields in kndLearnerService
#pragma once #include <pthread.h> #include <glb-lib/output.h> #include <kmq.h> #include <knd_shard.h> struct kndLearnerService; struct kndLearnerOptions { char *config_file; struct addrinfo *address; }; struct kndLearnerService { struct kmqKnode *knode; struct kmqEndPoint *entry_point; struct ...
#pragma once #include <pthread.h> #include <glb-lib/output.h> #include <kmq.h> #include <knd_shard.h> struct kndLearnerService; struct kndLearnerOptions { char *config_file; struct addrinfo *address; }; struct kndLearnerService { struct kmqKnode *knode; struct kmqEndPoint *entry_point; struct ...
Change to send routine: return status
#ifndef HTTPD_PLATFORM_H #define HTTPD_PLATFORM_H void httpdPlatSendData(ConnTypePtr conn, char *buff, int len); void httpdPlatDisconnect(ConnTypePtr conn); void httpdPlatInit(int port, int maxConnCt); #endif
#ifndef HTTPD_PLATFORM_H #define HTTPD_PLATFORM_H int httpdPlatSendData(ConnTypePtr conn, char *buff, int len); void httpdPlatDisconnect(ConnTypePtr conn); void httpdPlatInit(int port, int maxConnCt); #endif
Make command line argument case insensitive
#include <stdio.h> #include <string.h> #include <X11/Xlib.h> #include <X11/XKBlib.h> #define CAPSLOCK 2 void setcaps(int on) { Display* display = XOpenDisplay(NULL); XkbLockModifiers(display, XkbUseCoreKbd, CAPSLOCK, on ? CAPSLOCK : 0); XCloseDisplay(display); } void usage(const char* program_name) { ...
#include <stdio.h> #include <strings.h> #include <X11/Xlib.h> #include <X11/XKBlib.h> #define CAPSLOCK 2 void setcaps(int on) { Display* display = XOpenDisplay(NULL); XkbLockModifiers(display, XkbUseCoreKbd, CAPSLOCK, on ? CAPSLOCK : 0); XCloseDisplay(display); } void usage(const char* program_name) { ...
Add routine screenBuffer to enable scrolling view and to enable syntax highlighting.
#! /usr/bin/tcc -run /*** construct scroll ready screen buffer ***/ // y = 0,1,2 ... (text buffer first line, second line, ...) // x = 0,1,2 ... (screen buffer first character in line y, ...) #include <stdio.h> #include <stdlib.h> #include <string.h> size_t linecap; FILE *fp; typedef struct slot { ...
Fix AddUserToList bug when root is NULL
#include "user.h" #include <stdlib.h> #include <string.h> #include <stdio.h> user_t* NewUser(int fd,char *addr,unsigned short port,char *name){ user_t *user = malloc(sizeof(user_t)); if(user == NULL){ goto ret; } if(fd < 0 || addr == NULL || name == NULL){ free(user); user = NU...
#include "user.h" #include <stdlib.h> #include <string.h> #include <stdio.h> user_t* NewUser(int fd,char *addr,unsigned short port,char *name){ user_t *user = malloc(sizeof(user_t)); if(user == NULL){ goto ret; } if(fd < 0 || addr == NULL || name == NULL){ free(user); user = NU...
Increase version number for KDE 3.5.9.
// KMail Version Information // #ifndef kmversion_h #define kmversion_h #define KMAIL_VERSION "1.9.8" #endif /*kmversion_h*/
// KMail Version Information // #ifndef kmversion_h #define kmversion_h #define KMAIL_VERSION "1.9.9" #endif /*kmversion_h*/
Add virtual deconstructor for abstract class Downloader
// Copyright (c) 2015, Galaxy Authors. All Rights Reserved // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // Author: yuanyi03@baidu.com #ifndef _DOWNLOAD_H #define _DOWNLOAD_H #include <string> namespace galaxy { class Downloader { public: virtual int ...
// Copyright (c) 2015, Galaxy Authors. All Rights Reserved // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // Author: yuanyi03@baidu.com #ifndef _DOWNLOAD_H #define _DOWNLOAD_H #include <string> namespace galaxy { class Downloader { public: virtual ~Dow...
Allow reading back callbacks set to handles
#include <string.h> #include "luv.h" #include "luv_functions.c" int luv_newindex(lua_State* L) { lua_getfenv(L, 1); lua_pushvalue(L, 2); lua_pushvalue(L, 3); lua_rawset(L, -3); lua_pop(L, 1); return 0; } LUALIB_API int luaopen_luv (lua_State *L) { luv_main_thread = L; luaL_newmetatable(L, "luv_hand...
#include <string.h> #include "luv.h" #include "luv_functions.c" static int luv_newindex(lua_State* L) { lua_getfenv(L, 1); lua_pushvalue(L, 2); lua_pushvalue(L, 3); lua_rawset(L, -3); lua_pop(L, 1); return 0; } static int luv_index(lua_State* L) { #ifdef LUV_STACK_CHECK int top = lua_gettop(L); #endif ...
Build if GETC_MACRO use is disabled
/* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org> * * GNU Library General Public License (LGPL) version 2 or later. * * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ #include "_stdio.h" link_warning(gets, "the 'gets' function is dangerous and should not be used.") /* UNSAFE FU...
/* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org> * * GNU Library General Public License (LGPL) version 2 or later. * * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ #include "_stdio.h" link_warning(gets, "the 'gets' function is dangerous and should not be used.") /* UNSAFE FU...
Make sure NOMINMAX is not redefined
#pragma once #define NOMINMAX #include <windows.h> #include <streams.h> #include <audioclient.h> #include <comdef.h> #include <malloc.h> #include <mmdeviceapi.h> #include <process.h> #include <algorithm> #include <array> #include <cassert> #include <deque> #include <functional> #include <future> ...
#pragma once #ifndef NOMINMAX # define NOMINMAX #endif #include <windows.h> #include <streams.h> #include <audioclient.h> #include <comdef.h> #include <malloc.h> #include <mmdeviceapi.h> #include <process.h> #include <algorithm> #include <array> #include <cassert> #include <deque> #include <f...
Fix for missing forward declaration in AliROOT
#ifndef ALIVERTEXERHYPERTRITON3BODY_H #define ALIVERTEXERHYPERTRITON3BODY_H #include <AliVertexerTracks.h> class AliESDVertex; class AliESDtrack; class AliExternalTrackParam; class AliVertexerHyperTriton3Body { public: AliVertexerHyperTriton3Body(); AliESDVertex* GetCurrentVertex() { return mCurrentVertex; } ...
#ifndef ALIVERTEXERHYPERTRITON3BODY_H #define ALIVERTEXERHYPERTRITON3BODY_H class TClonesArray; /// This will be removed as soon as alisw/AliRoot#898 is merged and a new tag is available #include <AliVertexerTracks.h> class AliESDVertex; class AliESDtrack; class AliExternalTrackParam; class AliVertexerHyperTriton3B...
Add method 'RClean' for clean memory
#ifndef RUTIL2_RALLOC_H #define RUTIL2_RALLOC_H #include "OO.h" void* RAlloc(int Size); void* RAlign(int Align, int Size); #if defined(__MINGW32__) #define _aligned_malloc __mingw_aligned_malloc #define _aligned_free __mingw_aligned_free #define memalign(align, size) _aligned_malloc(size, align) #endif //For MinGW ...
#ifndef RUTIL2_RALLOC_H #define RUTIL2_RALLOC_H #include <memory.h> #include "OO.h" void* RAlloc(int Size); void* RAlign(int Align, int Size); #if defined(__MINGW32__) #define _aligned_malloc __mingw_aligned_malloc #define _aligned_free __mingw_aligned_free #define memalign(align, size) _aligned_malloc(size, align...
Fix typo in a comment: it's base58, not base48.
#ifndef BITCOINADDRESSVALIDATOR_H #define BITCOINADDRESSVALIDATOR_H #include <QValidator> /** Base48 entry widget validator. Corrects near-miss characters and refuses characters that are no part of base48. */ class BitcoinAddressValidator : public QValidator { Q_OBJECT public: explicit BitcoinAddressVali...
#ifndef BITCOINADDRESSVALIDATOR_H #define BITCOINADDRESSVALIDATOR_H #include <QValidator> /** Base58 entry widget validator. Corrects near-miss characters and refuses characters that are not part of base58. */ class BitcoinAddressValidator : public QValidator { Q_OBJECT public: explicit BitcoinAddressVal...
Make sure export macro is properly set
#ifndef CUTELYST_GLOBAL_H #define CUTELYST_GLOBAL_H #include <QtCore/QtGlobal> #if defined(CUTELYST_LIBRARY) # define CUTELYST_LIBRARY Q_DECL_EXPORT #else # define CUTELYST_LIBRARY Q_DECL_IMPORT #endif #endif // CUTELYST_GLOBAL_H
#ifndef CUTELYST_GLOBAL_H #define CUTELYST_GLOBAL_H #include <QtCore/QtGlobal> // defined by cmake when building this library #if defined(cutelyst_qt5_EXPORTS) # define CUTELYST_LIBRARY Q_DECL_EXPORT #else # define CUTELYST_LIBRARY Q_DECL_IMPORT #endif #endif // CUTELYST_GLOBAL_H
Support several texture coords and colors per vertex
/* * Copyright (c) 2017 Lech Kulina * * This file is part of the Realms Of Steel. * For conditions of distribution and use, see copyright details in the LICENSE file. */ #ifndef ROS_VERTEX_H #define ROS_VERTEX_H #include <glm/vec2.hpp> #include <glm/vec3.hpp> #include <glm/vec4.hpp> #include <core/Common.h> #incl...
/* * Copyright (c) 2017 Lech Kulina * * This file is part of the Realms Of Steel. * For conditions of distribution and use, see copyright details in the LICENSE file. */ #ifndef ROS_VERTEX_H #define ROS_VERTEX_H #include <glm/vec2.hpp> #include <glm/vec3.hpp> #include <glm/vec4.hpp> #include <core/Common.h> #incl...
Fix up name of init_namespaces method.
/* $Id: ruby_xml_ns.h 612 2008-11-21 08:01:29Z cfis $ */ /* Please see the LICENSE file for copyright and distribution information */ #ifndef __RXML_NAMESPACES__ #define __RXML_NAMESPACES__ extern VALUE cXMLNamespaces; void ruby_init_xml_namespaces(void); #endif
/* $Id: ruby_xml_ns.h 612 2008-11-21 08:01:29Z cfis $ */ /* Please see the LICENSE file for copyright and distribution information */ #ifndef __RXML_NAMESPACES__ #define __RXML_NAMESPACES__ extern VALUE cXMLNamespaces; void rxml_init_namespaces(void); #endif
Fix missing dependency on sys/types.h
#pragma once #include <uk/mman.h> BEGIN_DECLS void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); int munmap(void *addr, size_t length); int mprotect(void *addr, size_t length, int prot); int madvise(void *addr, size_t length, int advice); END_DECLS
#pragma once #include <sys/types.h> #include <uk/mman.h> BEGIN_DECLS void *mmap(void *addr, size_t length, int prot, int flags, int fd, off_t offset); int munmap(void *addr, size_t length); int mprotect(void *addr, size_t length, int prot); int madvise(void *addr, size_t length, int advice); END_DECLS
Support to division every number.
// // Created by wan on 1/2/16. // #include <stdio.h> int main(void) { printf("Input:"); int a; scanf("%d", &a); if (2016 % a != 0) { printf("No way. Exit.\n"); return 0; } int s = 2016; printf("2016 = "); int flag = 0, b; for (b = 1111; b >= 1; b /= 10) { in...
// // Created by Hexapetalous on 1/1/16. // #include <stdio.h> int main(void) { printf("Input[1]:"); int a; scanf("%d", &a); printf("Input[2]:"); int z; scanf("%d", &z); if (z % a != 0) { printf("No way. Exit.\n"); return 0; } int s = z; printf("%d = ", z); i...
Make it so that if no path for the shen boot file is specified, it is looked at the same directory of the shen-scheme executable
#include "scheme.h" #include <stdio.h> #include <stdlib.h> #include <unistd.h> #ifndef DEFAULT_BOOTFILE_PATH # define DEFAULT_BOOTFILE_PATH "./shen.boot" #endif static void custom_init(void) {} int main(int argc, char *argv[]) { int status; char *bfpath = getenv("SHEN_BOOTFILE_PATH"); if (bfpath == NULL) { ...
#include "scheme.h" #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <limits.h> #ifndef DEFAULT_BOOTFILE_PATH # define DEFAULT_BOOTFILE_PATH NULL #endif static void custom_init(void) {} int main(int argc, char *argv[]) { int status; char *bfpath = getenv("SHEN_BOOTFILE_PAT...
Change FreesoundExtractor version to 0.5
#ifndef EXTRACTOR_VERSION_H_ #define EXTRACTOR_VERSION_H_ #define FREESOUND_EXTRACTOR_VERSION "freesound 2.0" #endif /* EXTRACTOR_VERSION_H_ */
#ifndef EXTRACTOR_VERSION_H_ #define EXTRACTOR_VERSION_H_ #define FREESOUND_EXTRACTOR_VERSION "freesound 0.5" #endif /* EXTRACTOR_VERSION_H_ */
Add warning when a subclass doesn’t call super on pushViewController:animated:
// Created by Arkadiusz on 01-04-14. #import <UIKit/UIKit.h> /// A UINavigationController subclass allowing the interactive pop gesture when the navigation bar is hidden or a custom back button is used. @interface AHKNavigationController : UINavigationController @end
// Created by Arkadiusz on 01-04-14. #import <UIKit/UIKit.h> /// A UINavigationController subclass allowing the interactive pop gesture when the navigation bar is hidden or a custom back button is used. @interface AHKNavigationController : UINavigationController - (void)pushViewController:(UIViewController *)viewCo...
Fix double precision function return type
_CLC_DEF _CLC_OVERLOAD float __clc_ldexp(float, int); #ifdef cl_khr_fp64 #pragma OPENCL EXTENSION cl_khr_fp64 : enable _CLC_DEF _CLC_OVERLOAD float __clc_ldexp(double, int); #endif
_CLC_DEF _CLC_OVERLOAD float __clc_ldexp(float, int); #ifdef cl_khr_fp64 #pragma OPENCL EXTENSION cl_khr_fp64 : enable _CLC_DEF _CLC_OVERLOAD double __clc_ldexp(double, int); #endif
Use inline as a workaround so that the utf8 functions are not exported
#include <cstdint> #include <cstring> #include <string> #include <vector> #include "../utf8/utf8.h" /* * Convert UTF-8 string to std::vector<uint32_t> */ void utf8to32(const std::string &s, std::vector<uint32_t> &vec) { vec.assign(utf8::distance(s.cbegin(), s.cend()), 0); utf8::utf8to32(s.cbegin(), s.cend(), vec....
#include <cstdint> #include <cstring> #include <string> #include <vector> #include "../utf8/utf8.h" /* * Convert UTF-8 string to std::vector<uint32_t> */ void inline utf8to32(const std::string &s, std::vector<uint32_t> &vec) { vec.assign(utf8::distance(s.cbegin(), s.cend()), 0); utf8::utf8to32(s.cbegin(), s.cend(...
Add doxygen comment to IsRBFOptIn
// Copyright (c) 2016-2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_POLICY_RBF_H #define BITCOIN_POLICY_RBF_H #include <txmempool.h> enum class RBFTransactionState { UNKNO...
// Copyright (c) 2016-2019 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_POLICY_RBF_H #define BITCOIN_POLICY_RBF_H #include <txmempool.h> /** The rbf state of unconfirmed transacti...
Add Reachability to toolkit header.
// // Toolkit header to include the main headers of the 'AFToolkit' library. // #import "AFDefines.h" #import "AFLogHelper.h" #import "AFFileHelper.h" #import "AFPlatformHelper.h" #import "AFKVO.h" #import "AFArray.h" #import "AFMutableArray.h" #import "NSBundle+Universal.h" #import "UITableViewCell+Universal.h" #impo...
// // Toolkit header to include the main headers of the 'AFToolkit' library. // #import "AFDefines.h" #import "AFLogHelper.h" #import "AFFileHelper.h" #import "AFPlatformHelper.h" #import "AFReachability.h" #import "AFKVO.h" #import "AFArray.h" #import "AFMutableArray.h" #import "NSBundle+Universal.h" #import "UITable...
Add export attribute to header declaration.
//===--- RuntimeStubs.h -----------------------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LI...
//===--- RuntimeStubs.h -----------------------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LI...
Add test program for easier grabber's tests
/* Media Server - a library and daemon for medias indexation and streaming * * Copyright (C) 2012 Enna Team. 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 sour...
Define the functions on one line
#include <stdlib.h> #include "chip8.h" chip8_t * chip8_new(void) { chip8_t * self = (chip8_t *) malloc(sizeof(chip8_t)); /* The first 512 bytes are used by the interpreter. */ self->program_counter = 0x200; self->index_register = 0; self->stack_pointer = 0; self->opcode = 0; return self; } ...
#include <stdlib.h> #include "chip8.h" chip8_t * chip8_new(void) { chip8_t * self = (chip8_t *) malloc(sizeof(chip8_t)); /* The first 512 bytes are used by the interpreter. */ self->program_counter = 0x200; self->index_register = 0; self->stack_pointer = 0; self->opcode = 0; return self; } ...
Fix build error on Android
#ifndef StringUtils_h #define StringUtils_h #include <stdio.h> #include <string.h> namespace CCMessageWindow { class Utils { public: static std::string substringUTF8(const char* str, int from, int length); static std::vector<std::string> split(const std::string& input, char delimiter); ...
#ifndef StringUtils_h #define StringUtils_h #include "cocos2d.h" namespace CCMessageWindow { class Utils { public: static std::string substringUTF8(const char* str, int from, int length); static std::vector<std::string> split(const std::string& input, char delimiter); static std::strin...
Use NS_ENUM instead of enum makes more clear
#import <Foundation/Foundation.h> #import <UIKit/UIKit.h> typedef enum { UILabelCountingMethodEaseInOut, UILabelCountingMethodEaseIn, UILabelCountingMethodEaseOut, UILabelCountingMethodLinear } UILabelCountingMethod; typedef NSString* (^UICountingLabelFormatBlock)(float value); typedef NSAttributedStr...
#import <Foundation/Foundation.h> #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger, UILabelCountingMethod) { UILabelCountingMethodEaseInOut, UILabelCountingMethodEaseIn, UILabelCountingMethodEaseOut, UILabelCountingMethodLinear }; typedef NSString* (^UICountingLabelFormatBlock)(float value); typedef ...
Add surface server side implementation for tests
/* * This file is part of meego-im-framework * * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * Contact: Nokia Corporation (directui@nokia.com) * * If you have questions regarding the use of this file, please contact * Nokia at directui@nokia.com. * * This library ...
/* * This file is part of meego-im-framework * * * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * Contact: Nokia Corporation (directui@nokia.com) * * If you have questions regarding the use of this file, please contact * Nokia at directui@nokia.com. * * This library ...
Add global exception functions to CONFIG
/** * nlp_exception.h * Copyright (C) 2015 Tony Lim <atomictheorist@gmail.com> * * Distributed under terms of the MIT license. */ #ifndef NLP_EXCEPTION_H #define NLP_EXCEPTION_H #include <exception> using namespace std; namespace NLP { class unimplemented_exc: public exception { virtual const ch...
Change the Content class to the Element class
/* * Copyright © 2017 AperLambda <aper.entertainment@gmail.com> * * This file is part of λcommon. * * Licensed under the MIT license. For more information, * see the LICENSE file. */ #ifndef LAMBDACOMMON_DOCUMENT_H #define LAMBDACOMMON_DOCUMENT_H #include "../lambdacommon.h" #include <map> namespace lambdacom...
/* * Copyright © 2017 AperLambda <aper.entertainment@gmail.com> * * This file is part of λcommon. * * Licensed under the MIT license. For more information, * see the LICENSE file. */ #ifndef LAMBDACOMMON_DOCUMENT_H #define LAMBDACOMMON_DOCUMENT_H #include "../lambdacommon.h" #include <map> namespace lambdacom...
Add example for working threads and events
/** * @file * * @brief * * @date 15.01.2013 * @author Lapshin Alexander */ #include <stdio.h> #include <errno.h> #include <framework/example/self.h> #include <kernel/thread/api.h> #include <kernel/thread/event.h> #include <util/macro.h> /** * This macro is used to register this example at the system. */ EMBO...
Hide VDP1 even if FB hasn't been erased and changed
/* * Copyright (c) 2012-2016 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <mrkotfw@gmail.com> */ #include <stdlib.h> #include <vdp1.h> #include <vdp2.h> #include <vdp2/tvmd.h> #include <vdp2/vram.h> #include <cons.h> void __noreturn internal_exception_show(const char *buffer) { /* Reset...
/* * Copyright (c) 2012-2016 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <mrkotfw@gmail.com> */ #include <stdlib.h> #include <vdp1.h> #include <vdp2.h> #include <vdp2/tvmd.h> #include <vdp2/vram.h> #include <cons.h> void __noreturn internal_exception_show(const char *buffer) { /* Reset...
Check in an old testcase
/* Provide Declarations */ #ifndef NULL #define NULL 0 #endif #ifndef __cplusplus typedef unsigned char bool; #endif /* Support for floating point constants */ typedef unsigned long long ConstantDoubleTy; typedef unsigned int ConstantFloatTy; /* Global Declarations */ /* External Global Variable Declarati...
Test "list" embeding to arbitary struct It is not confortable for me to use too much "address of".
#include <stdio.h> #include <stdlib.h> #include "list.h" struct list { int ctx; struct list_head loc; }; int main(int argc, char *argv[]) { struct list l[3]; for(int i = 0; i < 3; i++) { l[i].ctx = i * 10; //l[i].loc = (struct list_head *) malloc(sizeof(struct list_head)); } ...
Define optimized mbed TLS heap size
/* * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <debug.h> /* mbed TLS headers */ #include <mbedtls/memory_buffer_alloc.h> #include <mbedtls/platform.h> /* * mbed TLS heap */ #if (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_ECDSA) #d...
/* * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <debug.h> /* mbed TLS headers */ #include <mbedtls/memory_buffer_alloc.h> #include <mbedtls/platform.h> /* * mbed TLS heap */ #if (TF_MBEDTLS_KEY_ALG_ID == TF_MBEDTLS_ECDSA) #d...
Fix compile error with VC++2013 preview
#ifndef LZ4MT_COMPAT_H #define LZ4MT_COMPAT_H namespace Lz4Mt { unsigned getHardwareConcurrency(); struct launch { #if defined(_MSC_VER) typedef std::launch::launch Type; #else typedef std::launch Type; #endif static const Type deferred; static const Type async; }; } #endif
#ifndef LZ4MT_COMPAT_H #define LZ4MT_COMPAT_H namespace Lz4Mt { unsigned getHardwareConcurrency(); struct launch { #if defined(_MSC_VER) && (_MSC_VER <= 1700) typedef std::launch::launch Type; #else typedef std::launch Type; #endif static const Type deferred; static const Type async; }; } #endif
Add an OS mutex to Halide runtime.
#ifndef HALIDE_RUNTIME_MUTEX_H #define HALIDE_RUNTIME_MUTEX_H #include "HalideRuntime.h" // Avoid ODR violations namespace { // An RAII mutex struct ScopedMutexLock { halide_mutex *mutex; ScopedMutexLock(halide_mutex *mutex) : mutex(mutex) { halide_mutex_lock(mutex); } ~ScopedMutexLock() { ...
Use Foundation instead of UIKit
// // OctoKit.h // OctoKit // // Created by Piet Brauer on 25/08/15. // Copyright (c) 2015 nerdish by nature. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for OctoKit. FOUNDATION_EXPORT double OctoKitVersionNumber; //! Project version string for OctoKit. FOUNDATION_EXPORT const unsi...
// // OctoKit.h // OctoKit // // Created by Piet Brauer on 25/08/15. // Copyright (c) 2015 nerdish by nature. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for OctoKit. FOUNDATION_EXPORT double OctoKitVersionNumber; //! Project version string for OctoKit. FOUNDATION_EXPORT ...
Include exceptions in main header
#ifndef APIMOCK_H #define APIMOCK_H #include "core/server.h" #endif
#ifndef APIMOCK_H #define APIMOCK_H #include "core/server.h" #include "core/exceptions.h" #endif
Add note to help FreeBSD users.
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #include "e.h" #include <execinfo.h> /* a tricky little devil, requires e and it's libs to be built * with the -rdynamic flag to GCC for any sort of decent output. */ void e_sigseg_act(int x, siginfo_t *info, void *data){ void *array[255]; size_t size...
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 * NOTE TO FreeBSD users. Install libexecinfo from * ports/devel/libexecinfo and add -lexecinfo to LDFLAGS * to add backtrace support. */ #include "e.h" #include <execinfo.h> /* a tricky little devil, requires e and it's libs to be built * with the -rdynamic...
Extend assert in getFDDesc to print invalid fd.
//===-- ipcreg_internal.h -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===-- ipcreg_internal.h -------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Add header function for creating new monitors.
#ifdef E_TYPEDEFS #else # ifndef E_SMART_MONITOR_H # define E_SMART_MONITOR_H # endif #endif
#ifdef E_TYPEDEFS #else # ifndef E_SMART_MONITOR_H # define E_SMART_MONITOR_H Evas_Object *e_smart_monitor_add(Evas *evas); # endif #endif
Fix VersionNumber comparison operator constness
/* * Copyright (C) 2019 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) 2019 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...
Remove the inflector from the router protocol
// // APIRouter.h // APIClient // // Created by Klaas Pieter Annema on 14-09-13. // Copyright (c) 2013 Klaas Pieter Annema. All rights reserved. // #import <Foundation/Foundation.h> #import "APIInflector.h" @protocol APIRouter <NSObject> @property (nonatomic, readonly, strong) id<APIInflector> inflector; - (NSS...
// // APIRouter.h // APIClient // // Created by Klaas Pieter Annema on 14-09-13. // Copyright (c) 2013 Klaas Pieter Annema. All rights reserved. // #import <Foundation/Foundation.h> #import "APIInflector.h" @protocol APIRouter <NSObject> - (NSString *)pathForAction:(NSString *)action onResource:(Class)resource; ...
Check for defines before defining to get rid of some warnings.
#pragma once #if defined(_MSC_VER) #define DLL_API __declspec(dllexport) #define STDCALL __stdcall #define CDECL __cdecl #else #define DLL_API __attribute__ ((visibility ("default"))) #define STDCALL __attribute__((stdcall)) #define CDECL __attribute__((cdecl)) #endif #define CS_OUT
#pragma once #if defined(_MSC_VER) #define DLL_API __declspec(dllexport) #ifndef STDCALL #define STDCALL __stdcall #endif #ifndef CDECL #define CDECL __cdecl #endif #else #define DLL_API __attribute__ ((visibility ("default"))) #ifndef STDCALL #define STDCALL __attribute__((stdcall)) #endif #ifndef CDECL #define C...
Add basic interface for recordable modules
// // CLURecordableModule.h // Clue // // Created by Ahmed Sulaiman on 5/18/16. // Copyright © 2016 Ahmed Sulaiman. All rights reserved. // #import <Foundation/Foundation.h> @protocol CLURecordableModule <NSObject> @required - (void)startRecording; - (void)stopRecording; - (BOOL)addNewFrameWithTimestamp:(CFTimeI...
Set up a client id and a client secret for production environment
// // SecretConstant.example.h // PHPHub // // Created by Aufree on 9/30/15. // Copyright (c) 2015 ESTGroup. All rights reserved. // #define Client_id @"kHOugsx4dmcXwvVbmLkd" #define Client_secret @"PuuFCrF94MloSbSkxpwS" #define UMENG_APPKEY @"Set up UMEng App Key" #define UMENG_QQ_ID @"Set up qq id...
// // SecretConstant.example.h // PHPHub // // Created by Aufree on 9/30/15. // Copyright (c) 2015 ESTGroup. All rights reserved. // #if DEBUG #define Client_id @"kHOugsx4dmcXwvVbmLkd" #define Client_secret @"PuuFCrF94MloSbSkxpwS" #else #define Client_id @"Set up a client id for production env" #defi...
Fix Pester prefix header to import Cocoa again.
// // Prefix header for all source files of the 'Pester' target in the 'Pester' project // #import "NJROperatingSystemVersion.h"
// // Prefix header for all source files of the 'Pester' target in the 'Pester' project // #ifdef __OBJC__ #import <Cocoa/Cocoa.h> #import "NJROperatingSystemVersion.h" #endif
Add ability to set base URL
// // PKTClient.h // PodioKit // // Created by Sebastian Rehnby on 16/01/14. // Copyright (c) 2014 Citrix Systems, Inc. All rights reserved. // #import "PKTRequest.h" #import "PKTResponse.h" #import "PKTRequestSerializer.h" #import "PKTResponseSerializer.h" typedef void(^PKTRequestCompletionBlock)(PKTResponse *re...
// // PKTClient.h // PodioKit // // Created by Sebastian Rehnby on 16/01/14. // Copyright (c) 2014 Citrix Systems, Inc. All rights reserved. // #import "PKTRequest.h" #import "PKTResponse.h" #import "PKTRequestSerializer.h" #import "PKTResponseSerializer.h" typedef void(^PKTRequestCompletionBlock)(PKTResponse *re...
Fix previous commit: by committing new include file.
//---------------------------------------------------------- -*- Mode: C++ -*- // $Id$ // // Created 2012/10/25 // Author: Mike Ovsiannikov // // Copyright 2012 Quantcast Corp. // // This file is part of Kosmos File System (KFS). // // Licensed under the Apache License, Version 2.0 // (the "License"); you may not use t...
Allow all RTS options to iserv
#include "../rts/PosixSource.h" #include "Rts.h" #include "HsFFI.h" int main (int argc, char *argv[]) { RtsConfig conf = defaultRtsConfig; // We never know what symbols GHC will look up in the future, so // we must retain CAFs for running interpreted code. conf.keep_cafs = 1; extern StgClosure Z...
#include "../rts/PosixSource.h" #include "Rts.h" #include "HsFFI.h" int main (int argc, char *argv[]) { RtsConfig conf = defaultRtsConfig; // We never know what symbols GHC will look up in the future, so // we must retain CAFs for running interpreted code. conf.keep_cafs = 1; conf.rts_opts_enabl...
Add test for octApron combine forgetting return assign locally
// SKIP PARAM: --sets ana.activated[+] octApron #include <assert.h> int f(int x) { return x + 1; } int main(void) { int y = 42; y = f(42); // combine should forget caller's y before unifying with y == 43 to avoid bottom assert(y); return 0; }
Fix compilation error when stack protector is enabled
/* * Copyright (c) 2017-2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <stdint.h> #include <lib/utils.h> #include "rpi3_private.h" /* Get 128 bits of entropy and fuse the values together to form the canary. */ #define TRNG_NBYTES 16U u_register_t ...
/* * Copyright (c) 2017-2019, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <stdint.h> #include <lib/utils.h> #include <lib/utils_def.h> #include "rpi3_private.h" /* Get 128 bits of entropy and fuse the values together to form the canary. */ #define TRN...
Add prototype for seekdir() for Suns.
#ifndef DIRECTORY_H #define DIRECTORY_H #if defined (ULTRIX42) || defined(ULTRIX43) /* _POSIX_SOURCE should have taken care of this, */ #define __POSIX /* but for some reason the ULTRIX version of dirent.h */ #endif /* is not POSIX conforming without it... */ #include <dirent.h> class Directory { public: Dire...
#ifndef DIRECTORY_H #define DIRECTORY_H #if defined (ULTRIX42) || defined(ULTRIX43) /* _POSIX_SOURCE should have taken care of this, but for some reason the ULTRIX version of dirent.h is not POSIX conforming without it... */ # define __POSIX #endif #include <dirent.h> #if defined(SUNOS41) /* Note that functio...
Add basic test for long constants
/* name: TEST023 description: Basic test for long constants comments: This test is done for z80 data types output: F1 G1 F1 main { - A2 W i A3 Z u A2 #W1 :W A2 #WFFFFFFFF :W A2 #WFFFFFFFF :W A2 #WFFFFFFFF :W A2 #WFFFFFFFF :W A2 #W3 :W A2 #W1 :W A2 #W0 :W A3 #Z1 :Z A3 #ZFFFFFFFF :Z A3 #ZFFFFFFFF :Z A3 #ZFFF...
Add setup and teardown for hashtable tests
/* * File: test_hashtable.c * * Testing suite for hashtables. * * Author: Jack Romo <sharrackor@gmail.com> */ #include "../cnoodle.h" #include <glib.h> #include <stdio.h> #include <stdlib.h> typedef struct { hashtable table; } hfixture; void table_setup(hfixture *hf, gconstpointer test_data) { hf->t...
Add forward declaration for QComboBox
/* kngrouppropdlg.h KNode, the KDE newsreader Copyright (c) 1999-2001 the KNode authors. See file AUTHORS for details 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; eith...
/* kngrouppropdlg.h KNode, the KDE newsreader Copyright (c) 1999-2001 the KNode authors. See file AUTHORS for details 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; eith...
Update umbrella header file declaration
// // Paystack.h // Paystack // // Created by Ibrahim Lawal on 02/02/16. // Copyright (c) 2016 Paystack. All rights reserved. // // The code in this workspace was adapted from https://github.com/stripe/stripe-ios. // Stripe was replaced with Paystack - and STP with PSTCK - to avoid collisions within // apps that ...
// // Paystack.h // Paystack // // Created by Ibrahim Lawal on 02/02/16. // Copyright (c) 2016 Paystack. All rights reserved. // // The code in this workspace was adapted from https://github.com/stripe/stripe-ios. // Stripe was replaced with Paystack - and STP with PSTCK - to avoid collisions within // apps that ...
Create file to implement commands
#include<stdio.h> #include<stdlib.h> #include<string.h> #define PFIX_CLI "[MTd]" #define MAX_BUF_SIZE 200 int mtd_server_cmd_run_HOSTNAME(char *msg_cmd, char *message); /* Get hostname */ int mtd_server_cmd_run_HOSTNAME(char *msg_cmd, char *message) { FILE *fd; char str_cmd[MAX_BUF_SIZE], str_buf[MAX_BUF_SIZE]; ...
Revert "Changed macro to look specifically for NS_STRING_ENUM"
// // SDLMacros.h // SmartDeviceLink-iOS // // Created by Muller, Alexander (A.) on 10/17/16. // Copyright © 2016 smartdevicelink. All rights reserved. // #ifndef SDLMacros_h #define SDLMacros_h // Resolves issue of pre-xcode 8 versions due to NS_STRING_ENUM unavailability. #ifndef SDL_SWIFT_ENUM #if __has_at...
// // SDLMacros.h // SmartDeviceLink-iOS // // Created by Muller, Alexander (A.) on 10/17/16. // Copyright © 2016 smartdevicelink. All rights reserved. // #ifndef SDLMacros_h #define SDLMacros_h // Resolves issue of pre-xcode 8 versions due to NS_STRING_ENUM unavailability. #ifndef SDL_SWIFT_ENUM #if __has_at...
Update integer limits to comply with spec
#define CHAR_BIT 8 #define INT_MAX 2147483647 #define INT_MIN -2147483648 #define LONG_MAX 0x7fffffffffffffffL #define LONG_MIN -0x8000000000000000L #define SCHAR_MAX 127 #define SCHAR_MIN -128 #define CHAR_MAX 127 #define CHAR_MIN -128 #define SHRT_MAX 32767 #define SHRT_MIN -32768 #define UCHAR_MAX 255 #define USHRT...
#define CHAR_BIT 8 #define INT_MAX 2147483647 #define INT_MIN ((int)(-2147483647 - 1)) #define LONG_MAX 0x7fffffffffffffffL #define LONG_MIN (-0x7fffffffffffffffL - 1) #define CHAR_MAX SCHAR_MAX #define CHAR_MIN SCHAR_MIN #define SCHAR_MAX 127 #define SCHAR_MIN ((char)(-127 - 1)) #define SHRT_MAX 32767 #define SHRT_MI...
Move the SilentPushCompletionHandler typedef in here
// // DataUtils.h // CFC_Tracker // // Created by Kalyanaraman Shankari on 3/9/15. // Copyright (c) 2015 Kalyanaraman Shankari. All rights reserved. // #import <Foundation/Foundation.h> #import <CoreLocation/CoreLocation.h> @interface BEMServerSyncCommunicationHelper: NSObject // Top level method + (void) backgro...
// // DataUtils.h // CFC_Tracker // // Created by Kalyanaraman Shankari on 3/9/15. // Copyright (c) 2015 Kalyanaraman Shankari. All rights reserved. // #import <Foundation/Foundation.h> #import <CoreLocation/CoreLocation.h> typedef void (^SilentPushCompletionHandler)(UIBackgroundFetchResult); @interface BEMServe...
Use 256 cols when in PHS mode.
#pragma once #include <stdlib.h> #include <stdint.h> #define PHS_NCOLS 64 int lyra2(char *key, uint32_t keylen, const char *pwd, uint32_t pwdlen, const char *salt, uint32_t saltlen, uint32_t R, uint32_t C, uint32_t T); int PHS(void *out, size_t outlen, const void *in, size_t inlen, const void *salt, size_t saltlen, ...
#pragma once #include <stdlib.h> #include <stdint.h> #define PHS_NCOLS 256 int lyra2(char *key, uint32_t keylen, const char *pwd, uint32_t pwdlen, const char *salt, uint32_t saltlen, uint32_t R, uint32_t C, uint32_t T); int PHS(void *out, size_t outlen, const void *in, size_t inlen, const void *salt, size_t saltlen,...
Define different lookup levels for PAE
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef __LIBSEL4_ARCH_MAPPING #define __LIBSEL4_ARCH_MAPPING #define SEL4_MAPPING_...
/* * Copyright 2014, NICTA * * This software may be distributed and modified according to the terms of * the BSD 2-Clause license. Note that NO WARRANTY is provided. * See "LICENSE_BSD2.txt" for details. * * @TAG(NICTA_BSD) */ #ifndef __LIBSEL4_ARCH_MAPPING #define __LIBSEL4_ARCH_MAPPING #include <autoconf.h>...
Fix on macOS while compiling w/ clang
/* * Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> * * 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 tests * @{ * * @file * @brief ssp test applicat...
/* * Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> * * 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 tests * @{ * * @file * @brief ssp test applicat...
Add command to see output of preprocessor
/* * Author: NagaChaitanya Vellanki * * TRY/THROW/CATCH/FINALLY - example * Reference: http://www.di.unipi.it/~nids/docs/longjump_try_trow_catch.html * */ #include <stdio.h> #include <stdlib.h> #include <setjmp.h> #define FOO_EXCEPTION (1) #define BAR_EXCEPTION (2) #define GOO_EXCEPTION (3) #define TRY do{ jm...
/* * Author: NagaChaitanya Vellanki * * TRY/THROW/CATCH/FINALLY - example * Reference: http://www.di.unipi.it/~nids/docs/longjump_try_trow_catch.html * * use gcc -E -P exception_handling_3.c to see the result of the preprocessing * step */ #include <stdio.h> #include <stdlib.h> #include <setjmp.h> #define FO...
Add more flags and documentation
#ifndef TIMER_H_ #define TIMER_H_ 1 /* * By default, the timer calls the function a few extra times that aren't * measured to get it into cache and ensure more consistent running times. * Specifying this option in flags will stop this. */ #define TIMER_NO_EXTRA 1 struct timer { unsigned long long ns; unsi...
#ifndef TIMER_H_ #define TIMER_H_ 1 /* * By default, the timer calls the function a few extra times that aren't * measured to get it into cache and ensure more consistent running times. * Specifying this option in flags will stop this. */ #define TIMER_NO_EXTRA 1 /* * By default, each of these functions assumes ...
Remove leftover constant declarations accidentally left behind by a previous patch.
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_ #pragm...
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MANAGEMENT_API_CONSTANTS_H_ #pragm...
Add header file defining standard image sizes
/* * Standard image size definitions * * Copyright (C) 2013, Sylwester Nawrocki <sylvester.nawrocki@gmail.com> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #ifndef _IMA...
Delete copy and move constructors for ConfigurableClassWrapper
#ifndef CALLER_CONFIGURABLE_CLASS_WRAPPER_H #define CALLER_CONFIGURABLE_CLASS_WRAPPER_H #include <memory> #include <nan.h> #include <string> #include "cleanup_handle.h" namespace nodegit { class Context; template<typename Traits> class ConfigurableClassWrapper : public CleanupHandle { public: typedef ty...
#ifndef CALLER_CONFIGURABLE_CLASS_WRAPPER_H #define CALLER_CONFIGURABLE_CLASS_WRAPPER_H #include <memory> #include <nan.h> #include <string> #include "cleanup_handle.h" namespace nodegit { class Context; template<typename Traits> class ConfigurableClassWrapper : public CleanupHandle { public: typedef ty...
Fix link command pattern in offloading interoperability test.
// REQUIRES: clang-driver // REQUIRES: powerpc-registered-target // REQUIRES: nvptx-registered-target // // Verify that CUDA device commands do not get OpenMP flags. // // RUN: %clang -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp %s 2>&1 \ // RUN: | FileCheck %s --check-prefix NO...
// REQUIRES: clang-driver // REQUIRES: powerpc-registered-target // REQUIRES: nvptx-registered-target // // Verify that CUDA device commands do not get OpenMP flags. // // RUN: %clang -### -x cuda -target powerpc64le-linux-gnu -std=c++11 --cuda-gpu-arch=sm_35 -fopenmp %s 2>&1 \ // RUN: | FileCheck %s --check-prefix NO...
Define functions for polling of sockets.
#ifndef _SERVER_H #define _SERVER_H #include <time.h> #include <sys/epoll.h> #include "list.h" #include "threadpool.h" int open_listenfd(int port); void* check_connections(void* data); struct http_socket { int fd; /*struct pollfd* poll_fd;*/ struct epoll_event event; char* read_buffer; int read_buf...
#ifndef _SERVER_H #define _SERVER_H #include <time.h> #include <sys/epoll.h> #include "list.h" #include "threadpool.h" struct http_socket; int open_listenfd(int port); void* check_connections(void* data); int watch_read(struct http_socket* http); int watch_write(struct http_socket* http); int destroy_socket(struct htt...
Add comment for added macros.
// // PBMacros.h // pblib // // Created by haxpor on 3/5/15. // Copyright (c) 2015 Maethee Chongchitnant. All rights reserved. // #ifndef pblib_PBMacros_h #define pblib_PBMacros_h #define PB_IS_NSNull(obj) ((obj == (id)[NSNull null]) ? YES : NO) #define PB_IS_NIL_OR_NSNull(obj) ((obj == nil) || (obj == (id)...
// // PBMacros.h // pblib // // Created by haxpor on 3/5/15. // Copyright (c) 2015 Maethee Chongchitnant. All rights reserved. // #ifndef pblib_PBMacros_h #define pblib_PBMacros_h /** Check against NSNull. If input obj is NSNull then return YES, otherwise return NO. */ #define PB_IS_NSNull(obj) ((obj == (id)...
Make sure nchp is big enough for real vegetation tiles
C $Header$ C $Name$ c Land Grid Horizontal Dimension (Number of Tiles) c ------------------------------------------------ integer nchp, maxtyp parameter (maxtyp = 10) c parameter (nchp = sNx*sNy*maxtyp) parameter (nchp = 2048)
C $Header$ C $Name$ c Land Grid Horizontal Dimension (Number of Tiles) c ------------------------------------------------ integer nchp, maxtyp parameter (maxtyp = 10) parameter (nchp = sNx*sNy*maxtyp)
Add test for ana.base.context.int disabled
// PARAM: --enable ana.int.interval --disable exp.widen-context --disable ana.base.context.int #include <assert.h> int f(int x) { if (x) return f(x+1); else return x; } int main () { int a = f(1); assert(!a); return 0; }
Fix shared library build for aura.
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_AURA_AURA_SWITCHES_H_ #define UI_AURA_AURA_SWITCHES_H_ #pragma once namespace switches { extern const char kAuraHostWindowSize[]; extern ...
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef UI_AURA_AURA_SWITCHES_H_ #define UI_AURA_AURA_SWITCHES_H_ #pragma once #include "ui/aura/aura_export.h" namespace switches { AURA_EXPORT ex...
Support using KURLRequester with remote files
/**************************************************************************** ** ui.h extension file, included from the uic-generated form implementation. ** ** If you wish to add, delete or rename functions or slots use ** Qt Designer which will update this file, preserving your code. Create an ** init() function in p...
Add example to run an command on linux using C language
#include<stdlib.h> #include<stdio.h> /* Run an program (in this case 'ls -la') and show it in stdout */ int main(void) { FILE *fd; char str_cmd[1024], str_buf[1024]; sprintf(str_cmd, "ls -la /tmp >/dev/null && echo testmt > /tmp/sysmt.log && cat /tmp/sysmt.log"); //sprintf(str_cmd, "ls -la /tmp"); fd = p...
Update reflection view on transition to visible state.
#pragma once #include <QtGui/QMouseEvent> #include <QtGui/QPaintEvent> #include <QtWidgets/QWidget> #include "binaryninjaapi.h" #include "dockhandler.h" #include "uitypes.h" class ContextMenuManager; class DisassemblyContainer; class Menu; class ViewFrame; class BINARYNINJAUIAPI ReflectionView: public QWidget, publ...
#pragma once #include <QtGui/QMouseEvent> #include <QtGui/QPaintEvent> #include <QtWidgets/QWidget> #include "binaryninjaapi.h" #include "dockhandler.h" #include "uitypes.h" class ContextMenuManager; class DisassemblyContainer; class Menu; class ViewFrame; class BINARYNINJAUIAPI ReflectionView: public QWidget, publ...
Fix main parameter of the test application
#include <stdio.h> #ifndef ENV_NAME # define ENV_NAME "host" #endif int main(int argc, char* argv) { printf("Hello World from Rebuild environment " ENV_NAME "\n"); return 0; }
#include <stdio.h> #ifndef ENV_NAME # define ENV_NAME "host" #endif int main(int argc, char** argv) { printf("Hello World from Rebuild environment " ENV_NAME "\n"); return 0; }
Add new cube-based LCD test
#include <errno.h> #include <string.h> #include <stdio.h> #include "stm32746g_discovery.h" #include "stm32746g_discovery_lcd.h" #include "stm32746g_discovery_sdram.h" #define LCD_FRAMEBUFFER SDRAM_DEVICE_ADDR static void lcd_test(void) { if (BSP_LCD_Init() != LCD_OK) { printf(">>> BSP_LCD_Init failed\n"); } ...
Add octapron test where base gets precise value for variable from octapron via EvalInt query
// SKIP PARAM: --sets ana.activated[+] octApron --enable ana.int.interval #include <assert.h> void foo(int a, int *pb) { int b = *pb; // base knows a == 4 and b == 4, octApron only knows a == 4 assert(a == b); } void main() { int x, y, z, a, b; if (x < y && y < z) { // base doesn't know anything, octAp...
Update files, Alura, Introdução a C - Parte 2, Aula 5.1
#include <stdio.h> void calcula(int* c) { printf("calcula %d %d\n", (*c), c); (*c)++; printf("calcula %d %d\n", (*c), c); } int main() { int c = 10; printf("main %d %d\n", c, &c); calcula(&c); printf("main %d %d\n", c, &c); }
Fix copypasta to re-enable clang-format.
// // NSDictionary+BONEquality.h // BonMot // // Created by Zev Eisenberg on 7/11/15. // Copyright © 2015 Zev Eisenberg. All rights reserved. // @import Foundation; @import CoreGraphics.CGBase; OBJC_EXTERN const CGFloat kBONCGFloatEpsilon; OBJC_EXTERN BOOL BONCGFloatsCloseEnough(CGFloat float1, CGFloat float2); ...
// // NSDictionary+BONEquality.h // BonMot // // Created by Zev Eisenberg on 7/11/15. // Copyright © 2015 Zev Eisenberg. All rights reserved. // @import Foundation; @import CoreGraphics.CGBase; OBJC_EXTERN const CGFloat kBONCGFloatEpsilon; OBJC_EXTERN BOOL BONCGFloatsCloseEnough(CGFloat float1, CGFloat float2); ...
Add a test program with a bit more substance.
#include "lua.h" #include "lua_debug.h" int main() { return 0; }
#include "lua.h" #include "lualib.h" #include "lauxlib.h" #include "lua_debug.h" static const luaL_Reg STANDARD_LIBS[] = { { "_G", luaopen_base }, { LUA_TABLIBNAME, luaopen_table }, { LUA_STRLIBNAME, luaopen_string }, { LUA_MATHLIBNAME, luaopen_math }, { LUA_DBLIBNAME, luaopen_debug }, { 0, 0 ...
Include the appropriate endianness header
#ifndef _ASM_POWERPC_BYTEORDER_H #define _ASM_POWERPC_BYTEORDER_H /* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version...
#ifndef _ASM_POWERPC_BYTEORDER_H #define _ASM_POWERPC_BYTEORDER_H /* * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version * 2 of the License, or (at your option) any later version...
Add regression test with deep integer expressions
// from SV-COMP: nla-digbench-scaling/ps6-ll_valuebound5.c // contains deep integer expressions that shouldn't cause extremely exponential slowdown // when evaluated by base's eval_rv and EvalInt jointly // runs (as unknown) under 0.1s #include <assert.h> void assume_abort_if_not(int cond) { if(!cond) {abort();} } ...
Update RingOpenGL 1.1 - Add Constant (Source Code) : GL_TEXTURE_COMPONENTS
#include "ring.h" /* OpenGL 1.1 Extension Copyright (c) 2017 Mahmoud Fayed <msfclipper@yahoo.com> */ #include <GL/glew.h> #include <GL/glut.h> RING_FUNC(ring_get_gl_zero) { RING_API_RETNUMBER(GL_ZERO); } RING_FUNC(ring_get_gl_false) { RING_API_RETNUMBER(GL_FALSE); } RING_FUNC(ring_get_gl_logic_op) { RING_AP...
#include "ring.h" /* OpenGL 1.1 Extension Copyright (c) 2017 Mahmoud Fayed <msfclipper@yahoo.com> */ #include <GL/glew.h> #include <GL/glut.h> RING_FUNC(ring_get_gl_zero) { RING_API_RETNUMBER(GL_ZERO); } RING_FUNC(ring_get_gl_false) { RING_API_RETNUMBER(GL_FALSE); } RING_FUNC(ring_get_gl_logic_op) { RING_AP...
Add module that prints YOU HAVE BEEN HACKED when writing to /proc/buddyinfo
#include <linux/module.h> // included for all kernel modules #include <linux/kernel.h> // included for KERN_INFO #include <linux/init.h> // included for __init and __exit macros #include <linux/proc_fs.h> #define MODULE_NAME "rootkit" MODULE_LICENSE("GPL"); MODULE_AUTHOR("Julia Evans"); MODULE_DESCRIPTION(...
Structure the program for minimum coupling
#ifndef _IRC_H #define _IRC_H #define NICK "slackboat" #define SERVER "irc.what.cd" #define PASSWORD "thisistheonlygoodbot" void irc_notice_event(char *, char *, char *); void irc_welcome_event(void); void irc_privmsg_event(char *, char *, char *); void irc_privmsg(const char *, const char *); void irc_join_channel(c...
#ifndef _IRC_H #define _IRC_H #define NICK "slackboat" #define SERVER "irc.what.cd" #define PASSWORD "PASSWORD" void irc_notice_event(char *, char *, char *); void irc_welcome_event(void); void irc_privmsg_event(char *, char *, char *); void irc_privmsg(const char *, const char *); void irc_join_channel(const char *)...
Add visibility to epoll headers
/* Copyright (c) 2016, Nokia * Copyright (c) 2016, ENEA Software AB * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef __OFP_EPOLL_H__ #define __OFP_EPOLL_H__ #include <stdint.h> typedef union ofp_epoll_data { void *ptr; int fd; uint32_t u32; uint64_t u64; } ofp_epoll_da...
/* Copyright (c) 2016, Nokia * Copyright (c) 2016, ENEA Software AB * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #ifndef __OFP_EPOLL_H__ #define __OFP_EPOLL_H__ #include <stdint.h> #if __GNUC__ >= 4 #pragma GCC visibility push(default) #endif typedef union ofp_epoll_data { void *...
Add float comparison utility macros for tests
#include <string.h> #include <math.h> #include <float.h> #include <glib.h> #include <json-glib/json-glib.h> #define json_fuzzy_equals(n1,n2,epsilon) \ (((n1) > (n2) ? ((n1) - (n2)) : ((n2) - (n1))) < (epsilon)) #define json_assert_fuzzy_equals(n1,n2,epsilon) \ G_STMT_START { \ double __n1 = (n1), __n2 = (n2),...
Set prgname to stub while in daemon
/* * Copyright (c) 2014, 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. * */ #include...
/* * Copyright (c) 2014, 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. * */ #include...
Add test for double call
#include <stdio.h> int int_func(void) { return 42; } float float_func(void) { return 13.5f; } int main(int argc, char *argv[]) { printf("calltest.c\n"); printf(" Calling int function: %d\n", int_func()); printf(" Calling float function: %f\n", float_func()); return 0; }
#include <stdio.h> int int_func(void) { return 42; } float float_func(void) { return 13.5f; } double double_func(void) { return 13.5; } int main(int argc, char *argv[]) { printf("calltest.c\n"); printf(" Calling int function: %d\n", int_func()); printf(" Calling float function: %f\n", float_func(...