Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Add missing plat header for IRQ combiner
/* * 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 _PLATSUPPORT_PLAT_IRQ_COMBINER_H_ #define _PLATSUPPORT_PLAT_IRQ_COMBINER_H_ ...
Add declarations for StartDevice and StopDevice
#if !defined(_XENIFACE_H_) #define _XENIFACE_H_ #include <ntddk.h> #pragma warning(disable:4100 4057) typedef struct _DEVICE_EXTENSION { PDEVICE_OBJECT DeviceObject; PDEVICE_OBJECT LowerDeviceObject; PDEVICE_OBJECT Pdo; UNICODE_STRING ifname; IO_REMOVE_LOCK RemoveLock; } DEVICE_EXTENSION, *PDEVIC...
#if !defined(_XENIFACE_H_) #define _XENIFACE_H_ #include <ntddk.h> #pragma warning(disable:4100 4057) typedef struct _DEVICE_EXTENSION { PDEVICE_OBJECT DeviceObject; PDEVICE_OBJECT LowerDeviceObject; PDEVICE_OBJECT Pdo; UNICODE_STRING ifname; IO_REMOVE_LOCK RemoveLock; } DEVICE_EXTENSION, *PDEVIC...
Use the definitions in machine/fsr.h instead of duplicating these magic numbers here (the values need to correspond to the %fsr ones for some libc functions to work right).
/* * Written by J.T. Conklin, Apr 6, 1995 * Public domain. * $FreeBSD$ */ #ifndef _MACHINE_IEEEFP_H_ #define _MACHINE_IEEEFP_H_ typedef int fp_except_t; #define FP_X_IMP 0x01 /* imprecise (loss of precision) */ #define FP_X_DZ 0x02 /* divide-by-zero exception */ #define FP_X_UFL 0x04 /* underflow exception */ #d...
/* * Written by J.T. Conklin, Apr 6, 1995 * Public domain. * $FreeBSD$ */ #ifndef _MACHINE_IEEEFP_H_ #define _MACHINE_IEEEFP_H_ #include <machine/fsr.h> typedef int fp_except_t; #define FP_X_IMP FSR_NX /* imprecise (loss of precision) */ #define FP_X_DZ FSR_DZ /* divide-by-zero exception */ #define FP_X_UFL FSR...
Add spotify-json codec for sf::Rect<double>
#pragma once #include <spotify/json.hpp> #include <SFML/Graphics/Rect.hpp> namespace spotify { namespace json { // See Vector2Codec.h for issues with making this generic. template<> struct default_codec_t<sf::Rect<double>> { typedef std::pair<double, double> DoublePair; typedef std::pair<DoublePair, DoubleP...
Test only: Correct id to instancetype
// OCHamcrest by Jon Reid, https://qualitycoding.org/ // Copyright 2018 hamcrest.org. See LICENSE.txt @import Foundation; NS_ASSUME_NONNULL_BEGIN @interface FakeWithoutCount : NSObject + (id)fake; @end NS_ASSUME_NONNULL_END
// OCHamcrest by Jon Reid, https://qualitycoding.org/ // Copyright 2018 hamcrest.org. See LICENSE.txt @import Foundation; NS_ASSUME_NONNULL_BEGIN @interface FakeWithoutCount : NSObject + (instancetype)fake; @end NS_ASSUME_NONNULL_END
Add accessor to Director of a FriendProxy
// @(#)root/treeplayer:$Id$ // Author: Philippe Canal 01/06/2004 /************************************************************************* * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers and al. * * All rights reserved. * * ...
// @(#)root/treeplayer:$Id$ // Author: Philippe Canal 01/06/2004 /************************************************************************* * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers and al. * * All rights reserved. * * ...
Disable copy and assign on ScriptObject
#ifndef INCLUDED_SCRIPT_OBJECT_H_ #define INCLUDED_SCRIPT_OBJECT_H_ #include "browser.h" #include "npapi-headers/npruntime.h" class EmacsInstance; class ScriptObject : public NPObject { public: static ScriptObject* create(NPP npp); void invalidate(); bool hasMethod(NPIdentifier name); bool invoke(NP...
#ifndef INCLUDED_SCRIPT_OBJECT_H_ #define INCLUDED_SCRIPT_OBJECT_H_ #include "browser.h" #include "npapi-headers/npruntime.h" #include "util.h" class EmacsInstance; class ScriptObject : public NPObject { public: static ScriptObject* create(NPP npp); void invalidate(); bool hasMethod(NPIdentifier name); ...
Fix warning about block declaration semantics
// // RFToolbarButton.h // // Created by Rudd Fawcett on 12/3/13. // Copyright (c) 2013 Rudd Fawcett. All rights reserved. // #import <UIKit/UIKit.h> /** * The block used for each button. */ typedef void (^eventHandlerBlock)(); @interface RFToolbarButton : UIButton /** * Creates a new RFToolbarButton. * *...
// // RFToolbarButton.h // // Created by Rudd Fawcett on 12/3/13. // Copyright (c) 2013 Rudd Fawcett. All rights reserved. // #import <UIKit/UIKit.h> /** * The block used for each button. */ typedef void (^eventHandlerBlock)(void); @interface RFToolbarButton : UIButton /** * Creates a new RFToolbarButton. ...
Change WINDOWS_YLE_DL_DIR to not have a version number.
#ifndef CONFIG_H #define CONFIG_H #define YLE_DOWNLOADER_GUI_VERSION "2.0" #define WINDOWS_YLE_DL_DIR "yle-dl-windows-1.99.7" #endif // CONFIG_H
#ifndef CONFIG_H #define CONFIG_H #define YLE_DOWNLOADER_GUI_VERSION "2.0" #define WINDOWS_YLE_DL_DIR "yle-dl-windows" #endif // CONFIG_H
Add http subsystem for later usage and expansion
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2014 Raymond Jennings * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundati...
Fix missing virtual dtor on new type Buddy Michael Chan
#pragma once #include "ISingleOptionAlertBoxDismissedHandler.h" #include "INavRoutingLocationFinder.h" #include "NavRoutingLocationModel.h" #include "SearchResultModel.h" #include "ILocationService.h" #include "IAlertBoxFactory.h" namespace ExampleApp { namespace NavRouting { namespace SdkModel ...
#pragma once #include "Types.h" #include "ISingleOptionAlertBoxDismissedHandler.h" #include "INavRoutingLocationFinder.h" #include "NavRoutingLocationModel.h" #include "SearchResultModel.h" #include "ILocationService.h" #include "IAlertBoxFactory.h" namespace ExampleApp { namespace NavRouting { namesp...
Remove hardcoded file path. Still awkward and not generally usable, but _more_ general.
#include <stdio.h> #include <stdlib.h> #include "udon.h" int main (int argc, char *argv[]) { int i; int found = 0; pstate *state = init_from_file("../sjson-examples/big.txt"); for(i=0; i<10000; i++) { found += parse(state); reset_state(state); } free_state(state); printf("%d...
#include <stdio.h> #include <stdlib.h> #include "udon.h" int main (int argc, char *argv[]) { int i; int found = 0; if(argc < 2) return 1; pstate *state = init_from_file(argv[1]); for(i=0; i<10000; i++) { found += parse(state); reset_state(state); } free_state(state); pri...
Add initial exported header file
#ifndef LIBISRCRYPTO_H #define LIBISRCRYPTO_H struct isrcry_aes_key { ulong32 eK[60], dK[60]; int Nr; }; struct isrcry_blowfish_key { ulong32 S[4][256]; ulong32 K[18]; }; /** A block cipher CBC structure */ typedef struct { /** The index of the cipher chosen */ int cipher, /** T...
Fix some comments and type names
// ---------------------------------------------------------------------------- // pomodoro - Defines a model to track progress through the Pomodoro Technique // Copyright (c) 2013 Jonathan Speicher (jon.speicher@gmail.com) // Licensed under the MIT license: http://opensource.org/licenses/MIT // -----------------------...
// ---------------------------------------------------------------------------- // pomodoro - Defines a model to track progress through the Pomodoro Technique // Copyright (c) 2013 Jonathan Speicher (jon.speicher@gmail.com) // Licensed under the MIT license: http://opensource.org/licenses/MIT // -----------------------...
Change MouseWheel deltaWheel field size to one byte. Add compile time size check to Mouse Event.
#pragma once #include <cstdint> namespace ni { struct MouseEvent { int32_t deltaX; int32_t deltaY; int32_t deltaWheel; uint8_t leftButtonDown; uint8_t rightButtonDown; uint8_t middleButtonDown; }; }
#pragma once #include <cstdint> namespace ni { struct MouseEvent { int32_t deltaX; int32_t deltaY; int8_t deltaWheel; uint8_t leftButtonDown; uint8_t rightButtonDown; uint8_t middleButtonDown; }; static_assert(sizeof(MouseEvent) == 12, "Improper mouse event size"); }
Fix major bug in definition of greatest negative float value
/* Copyright (c) 2014 Harm Hanemaaijer <fgenfb@yahoo.com> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR D...
/* Copyright (c) 2014 Harm Hanemaaijer <fgenfb@yahoo.com> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR D...
Update signature of quaternion unit inverse.
/* __ __ _ * / // /_____ ____ (_) * / // // ___// __ \ / / * / // // /__ / /_/ // / * /_//_/ \___/ \____//_/ * https://bitbucket.org/galaktor/llcoi * copyright (c) 2014, llcoi Team * MIT license applies - see file "LICENSE" for details. */ #pragma once #include "ogre_interface.h...
/* __ __ _ * / // /_____ ____ (_) * / // // ___// __ \ / / * / // // /__ / /_/ // / * /_//_/ \___/ \____//_/ * https://bitbucket.org/galaktor/llcoi * copyright (c) 2014, llcoi Team * MIT license applies - see file "LICENSE" for details. */ #pragma once #include "ogre_interface.h...
Add another example! (somando dois números)
/** * Exemplo 02 - Somando dois números * * Nesse exemplo, vemos como podemos somar dois números. * Além disso, vemos como é possível mostrar um número na tela */ #include <stdio.h> int main(void) { /** * Para realizar a soma em si, utilizamos o operador + * Para imprimir o resultado, utilizamos a função ...
Remove implementation details from API comment
/* * scheduler.h * * Created on: Jun 8, 2016 * Author: riley */ #ifndef SCHEDULER_H #define SCHEDULER_H #include <stdint.h> #include "scheduler_private.h" typedef void (*task_func_t)( void ) ; typedef volatile struct task_private_s { const char * name; volatile void * task_sp; //Task stack pointe...
/* * scheduler.h * * Created on: Jun 8, 2016 * Author: riley */ #ifndef SCHEDULER_H #define SCHEDULER_H #include <stdint.h> #include "scheduler_private.h" typedef void (*task_func_t)( void ) ; typedef volatile struct task_private_s { const char * name; volatile void * task_sp; //Task stack pointe...
Add Sanyo LM7000 tuner driver
#ifndef __LM7000_H #define __LM7000_H /* Sanyo LM7000 tuner chip control * * Copyright 2012 Ondrej Zary <linux@rainbow-software.org> * based on radio-aimslab.c by M. Kirkwood * and radio-sf16fmi.c by M. Kirkwood and Petr Vandrovec */ #define LM7000_DATA (1 << 0) #define LM7000_CLK (1 << 1) #define LM7000_CE (1 <...
Add bindings for XOpenDisplay and XCloseDisplay
#include "libx11_ruby.h" VALUE rb_mLibX11; void Init_libx11_ruby(void) { rb_mLibX11 = rb_define_module("LibX11"); }
#include <X11/Xlib.h> #include "libx11_ruby.h" VALUE rb_mLibX11, rb_cDisplay; static size_t display_memsize(const void *); static const rb_data_type_t display_type = { .wrap_struct_name = "libx11_display", .function = { .dmark = NULL, .dfree = NULL, .dsize = display_memsize, .reserved = { NULL, N...
Increase number of stars to 512.
#ifndef _nbody_h #define _nbody_h #include <stdbool.h> #include "window.h" #include "star.h" #define NUM_STARS 64 typedef struct { Window* window; bool running; Star stars[NUM_STARS]; } NBody; NBody* NBody_new(); void NBody_run(NBody* self); void NBody_destroy(NBody* self); #endif
#ifndef _nbody_h #define _nbody_h #include <stdbool.h> #include "window.h" #include "star.h" #define NUM_STARS 512 typedef struct { Window* window; bool running; Star stars[NUM_STARS]; } NBody; NBody* NBody_new(); void NBody_run(NBody* self); void NBody_destroy(NBody* self); #endif
Fix a bug with copy cctors, iterators and vector erases. Weird bugs are weird.
#ifndef ORDER_H_ #define ORDER_H_ /** * Represents an order with weight and volume */ class Order { public: Order(uint weight, uint volume) : _weight(weight), _volume(volume) { } ///< Constructor Order(const Order& other) : _weight(other._weight), _volume(other._volume) { } ///< Copy constructor Order oper...
#ifndef ORDER_H_ #define ORDER_H_ /** * Represents an order with weight and volume */ class Order { public: Order(uint weight, uint volume) : _weight(weight), _volume(volume) { } ///< Constructor uint GetWeight() const { return _weight; } ///< Returns the order weight uint GetVolume() const { return _volu...
Fix state_to_draw_t by adding the number of possible mvts
#ifndef __GRAPHICS_H__ #define __GRAPHICS_H__ #include "models.h" typedef struct { int num_goats_to_put; int num_eaten_goats; player_turn_t turn; mvt_t input; mvt_t *possible_mvts; board_t *board; } state_to_draw_t; #endif
#ifndef __GRAPHICS_H__ #define __GRAPHICS_H__ #include "models.h" typedef struct { int num_goats_to_put; int num_eaten_goats; player_turn_t turn; mvt_t input; mvt_t *possible_mvts; size_t num_possible_mvts; board_t *board; } state_to_draw_t;...
Remove explicit include of packages_config in here - it is included elsewhere in all routines which use this common
C $Header$ C $Name$ #include "PACKAGES_CONFIG.h" c Alternate grid Mapping Common c ------------------------------ #ifdef ALLOW_FIZHI 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 $Header$ C $Name$ c Alternate grid Mapping Common c ------------------------------ #ifdef ALLOW_FIZHI 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) _RL dxfalt,dyfalt,drfal...
Fix DEBUG_HIGHMEM build break from d4515646699
#ifndef _ASM_POWERPC_KMAP_TYPES_H #define _ASM_POWERPC_KMAP_TYPES_H #ifdef __KERNEL__ /* * 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 opti...
#ifndef _ASM_POWERPC_KMAP_TYPES_H #define _ASM_POWERPC_KMAP_TYPES_H #ifdef __KERNEL__ /* * 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 opti...
Make iPhone simulator build binary compatible between 3.x and 4.x
/* #if defined(__APPLE__) && !(defined(__DARWIN_ONLY_64_BIT_INO_T) && ___DARWIN_ONLY_64_BIT_INO_T) #define __DARWIN_ONLY_64_BIT_INO_T 1 #endif */ #include <sys/stat.h>
#if defined(__APPLE__) && !defined(__arm__) && !defined(__IPHONE_4_0) /* Simulator 3.2 or less */ #define RHO_IPHONE_SIMULATOR_3 #endif #ifdef RHO_IPHONE_SIMULATOR_3 #ifdef stat #undef stat #endif #ifdef lstat #undef lstat #endif #ifdef fstat #undef fstat #endif #endif #include <sys/stat.h> #ifdef RHO_IPHONE_SIMULAT...
Handle the 'X-Forwarded-For' HTTP header if present
/*****************************************************************************/ /* */ /* Telize 2.0.0 */ /* Copyright (c) 2013-2018, Frederic Cambus */ ...
/*****************************************************************************/ /* */ /* Telize 2.0.0 */ /* Copyright (c) 2013-2018, Frederic Cambus */ ...
Add a testcase to ensure that ctor/dtor attributes work in C
#include <stdio.h> void ctor() __attribute__((constructor)); void ctor() { printf("Create!\n"); } void dtor() __attribute__((destructor)); void dtor() { printf("Create!\n"); } int main() { return 0; }
Use = delete for deleted members.
#ifndef COMMON_INCLUDED #define COMMON_INCLUDED #pragma once #define _WIN32_WINNT _WIN32_WINNT_WINXP #define NOMINMAX #include <Windows.h> #define at_scope_exit(cb) auto CONCAT(scope_exit_, __COUNTER__) = make_scope_guard(cb); #define CONCAT(a, b) CONCAT2(a, b) #define CONCAT2(a, b) a ## b template <class Callback> ...
#ifndef COMMON_INCLUDED #define COMMON_INCLUDED #pragma once #define _WIN32_WINNT _WIN32_WINNT_WINXP #define NOMINMAX #include <Windows.h> #define at_scope_exit(cb) auto CONCAT(scope_exit_, __COUNTER__) = make_scope_guard(cb); #define CONCAT(a, b) CONCAT2(a, b) #define CONCAT2(a, b) a ## b template <class Callback> ...
Add a copyright to this file
#include "vqueue.h" #define ITER_DONE(iter) (iter->buf == iter->end ? hpk_done : hpk_more) struct dynhdr { struct hpk_hdr header; VTAILQ_ENTRY(dynhdr) list; }; VTAILQ_HEAD(dynamic_table,dynhdr); struct hpk_iter { struct hpk_ctx *ctx; char *orig; char *buf; char *end; }; const struct txt * tbl_get_key(co...
/*- * Copyright (c) 2008-2016 Varnish Software AS * All rights reserved. * * Author: Guillaume Quintard <guillaume.quintard@gmail.com> * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of s...
Add more flags for mmap() to ignore.
/* * Copyright (C) 2014, Galois, Inc. * This sotware is distributed under a standard, three-clause BSD license. * Please see the file LICENSE, distributed with this software, for specific * terms and conditions. */ #ifndef MINLIBC_MMAN_H #define MINLIBC_MMAN_H #include <sys/types.h> #define PROT_NONE ...
/* * Copyright (C) 2014, Galois, Inc. * This sotware is distributed under a standard, three-clause BSD license. * Please see the file LICENSE, distributed with this software, for specific * terms and conditions. */ #ifndef MINLIBC_MMAN_H #define MINLIBC_MMAN_H #include <sys/types.h> #define PROT_NONE ...
Implement operator<< with template method
// ============================================================================= // Licensed under the MIT License <http://opensource.org/licenses/MIT>. // Copyright (c) 2017 Kevin T Qi // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation...
Add the RUN: prefix to the start of the run line so this test doesn't fail. BTW .. isn't the date on this funky? We haven't reachec 2005-05-09 yet???
// %llvmgcc %s -S -o - #include <math.h> #define I 1.0iF double __complex test(double X) { return ~-(X*I); } _Bool EQ(double __complex A, double __complex B) { return A == B; } _Bool NE(double __complex A, double __complex B) { return A != B; }
// RUN: %llvmgcc %s -S -o - #include <math.h> #define I 1.0iF double __complex test(double X) { return ~-(X*I); } _Bool EQ(double __complex A, double __complex B) { return A == B; } _Bool NE(double __complex A, double __complex B) { return A != B; }
Make TRACE depend on DEBUG.
#ifndef _TRACE_H_ #define _TRACE_H_ #include <stdio.h> #include <errno.h> #define TRACE ERROR #define ERROR(fmt,arg...) \ fprintf(stderr, "%s: "fmt, program_invocation_short_name, ##arg) #define FATAL(fmt,arg...) do { \ ERROR(fmt, ##arg); \ exit(1); \ } while (0) #endif
#ifndef _TRACE_H_ #define _TRACE_H_ #include <stdio.h> #include <errno.h> #ifdef DEBUG #define TRACE ERROR #else #define TRACE(fmt,arg...) ((void) 0) #endif #define ERROR(fmt,arg...) \ fprintf(stderr, "%s: "fmt, program_invocation_short_name, ##arg) #define FATAL(fmt,arg...) do { \ ERROR(fmt, ##arg); \...
Add problematic example with missed must deadlock
// PARAM: --set ana.activated[+] deadlock --set ana.activated[+] threadJoins #include <pthread.h> int x; pthread_mutex_t m1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t m2 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t m3 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t m4 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t m5 = P...
Add parameters to a test
void change(int *p) { (*p)++; } int a; int main() { a = 5; int *p = &a; change(p); assert(a - 6 == 0); return 0; }
// PARAM: --sets solver td3 --set ana.activated "['base','threadid','threadflag','mallocWrapper','octApron']" void change(int *p) { (*p)++; } int a; int main() { a = 5; int *p = &a; change(p); assert(a - 6 == 0); return 0; }
Add enum constant TrackCollide::ALL with a value 0xFFFF.
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of th...
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of th...
Fix warnings and reorganize file.
// // PKMacros.h // PKToolBox // // Created by Pavel Kunc on 17/07/2013. // Copyright (c) 2013 PKToolBox. All rights reserved. // #define PK_NIL_IF_NULL(obj) ((obj == [NSNull null]) ? nil : obj) #define PK_NULL_IF_NIL(obj) ((obj == nil) ? [NSNull null] : obj) #define PK_BOOL_TO_LOCALIZED_STRING(val) ((val == YES)...
// // PKMacros.h // PKToolBox // // Created by Pavel Kunc on 17/07/2013. // Copyright (c) 2013 PKToolBox. All rights reserved. // #pragma mark - Foundation #define PK_NIL_IF_NULL(obj) ((obj == (id)[NSNull null]) ? nil : obj) #define PK_NULL_IF_NIL(obj) ((obj == nil) ? [NSNull null] : obj) #define PK_DEFAULT_IF_NI...
Change comment into descriptive variable name
#include <math.h> #include "lua5.2/lua.h" #include "lua5.2/lauxlib.h" // Functions exposed to Lua static int l_sin(lua_State *L) { // Verify that the argument is a number double d = luaL_checknumber(L, 1); // Call the function, and return the result lua_pushnumber(L, sin(d)); return 1; // Single r...
#include <math.h> #include "lua5.2/lua.h" #include "lua5.2/lauxlib.h" // Functions exposed to Lua static int l_sin(lua_State *L) { double value_as_number = luaL_checknumber(L, 1); // Call the function, and return the result lua_pushnumber(L, sin(value_as_number)); return 1; // Single result } static ...
Add new header file. (or: xcode is stupid)
// // BDSKSearchGroupViewController.h // Bibdesk // // Created by Christiaan Hofman on 1/2/07. /* This software is Copyright (c) 2007 Christiaan Hofman. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions ar...
Add missing Yoga headers to umbrella header.
// // Portal.h // Portal // // Created by Guido Marucci Blas on 3/14/17. // Copyright © 2017 Guido Marucci Blas. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for Portal. FOUNDATION_EXPORT double PortalVersionNumber; //! Project version string for Portal. FOUNDATION_EXPORT const unsi...
// // Portal.h // Portal // // Created by Guido Marucci Blas on 3/14/17. // Copyright © 2017 Guido Marucci Blas. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for Portal. FOUNDATION_EXPORT double PortalVersionNumber; //! Project version string for Portal. FOUNDATION_EXPORT const unsi...
Fix last-minute certificate subject changes
#include <mongoc.h> #include "mongoc-ssl-private.h" #include "TestSuite.h" #ifdef MONGOC_ENABLE_OPENSSL static void test_extract_subject (void) { char *subject; subject = mongoc_ssl_extract_subject (CERT_SERVER, NULL); ASSERT_CMPSTR (subject, "C=IS,ST=Reykjavik,L=Reykjavik,O=MongoDB,OU=Drivers,CN=server"); ...
#include <mongoc.h> #include "mongoc-ssl-private.h" #include "TestSuite.h" #ifdef MONGOC_ENABLE_OPENSSL static void test_extract_subject (void) { char *subject; subject = mongoc_ssl_extract_subject (CERT_SERVER, NULL); ASSERT_CMPSTR (subject, "C=US,ST=California,L=Palo Alto,O=MongoDB,OU=Drivers,CN=server");...
Rename printBinary function and write to string instead
#include <stdio.h> #include <string.h> #include <math.h> struct Packet { unsigned int status: 1; unsigned int group: 2; unsigned int plug: 2; }; unsigned int packet_to_binary(struct Packet packet) { unsigned int binary = (packet.status << 7); binary |= ((packet.group & 0x3) << 2); binary |= (p...
#include <stdio.h> #include <string.h> #include <math.h> struct Packet { unsigned int status: 1; unsigned int group: 2; unsigned int plug: 2; }; unsigned int packet_to_binary(struct Packet packet) { unsigned int binary = (packet.status << 7); binary |= ((packet.group & 0x3) << 2); binary |= (p...
Fix compile error with missing function declare
/** * @class Client * @brief Factor class for being able to generate connections * * This class will create connections using the common interface ClientBase * which is based on connections strings. The connections should be completly * abstracted from the parent classes other than this entry point. */ class ...
/** * @class Client * @brief Factor class for being able to generate connections * * This class will create connections using the common interface ClientBase * which is based on connections strings. The connections should be completly * abstracted from the parent classes other than this entry point. */ class ...
Remove a warning from NBDS.
/* * Written by Josh Dybnis and released to the public domain, as explained at * http://creativecommons.org/licenses/publicdomain */ #ifndef MEM_H #define MEM_H void *nbd_malloc (size_t n) __attribute__((malloc, alloc_size(1))); void nbd_free (void *x) __attribute__((nonnull)); #endif//MEM_H
/* * Written by Josh Dybnis and released to the public domain, as explained at * http://creativecommons.org/licenses/publicdomain */ #ifndef MEM_H #define MEM_H void *nbd_malloc (size_t n) __attribute__((malloc)); void nbd_free (void *x) __attribute__((nonnull)); #endif//MEM_H
Modify KernelGlobal structure; decrease TASK_STACK_SIZE
#ifndef __KERNEL_H__ #define __KERNEL_H__ #include <task.h> typedef struct kernel_global { TaskList *task_list; } KernelGlobal; #define TASK_MAX 30 #define TASK_STACK_SIZE 1000 #define TASK_PRIORITY_MAX 10 #define SWI_ENTRY_POINT 0x28 #define DATA_REGION_BASE 0x218000 #define CPU_MODE_USER 0x10 #define CPU_MODE_S...
#ifndef __KERNEL_H__ #define __KERNEL_H__ #include <task.h> typedef struct kernel_global { TaskList *tlist; FreeList *flist; } KernelGlobal; #define TASK_MAX 30 #define TASK_STACK_SIZE 512 #define TASK_PRIORITY_MAX 10 #define SWI_ENTRY_POINT 0x28 #define DATA_REGION_BASE 0x218000 #define CPU_MODE_USER 0x10 #defi...
Fix checked_static_cast to allow null pointers.
// For conditions of distribution and use, see copyright notice in license.txt #ifndef incl_CoreDefines_h #define incl_CoreDefines_h // useful defines #define SAFE_DELETE(p) { delete p; p=0; } #define SAFE_DELETE_ARRAY(p) { delete [] p; p=0; } #define NUMELEMS(x) (sizeof(x)/sizeof(x[0])) /// Use this template to d...
// For conditions of distribution and use, see copyright notice in license.txt #ifndef incl_CoreDefines_h #define incl_CoreDefines_h // useful defines #define SAFE_DELETE(p) { delete p; p=0; } #define SAFE_DELETE_ARRAY(p) { delete [] p; p=0; } #define NUMELEMS(x) (sizeof(x)/sizeof(x[0])) /// Use this template to d...
Fix PARENT_SKILLS declaration; remove NOSKILL
#ifndef SKILLCOMPONENT_H_ #define SKILLCOMPONENT_H_ /** * Data structure to represent an Entity's skill. */ typedef struct { int ranks; ///< Current ranks in the skill int xp; ///< Amount of XP earned towards next rank } SkillComponent; /** * Enumeration for identifying different skills. */ enum skill_t { NOSK...
#ifndef SKILLCOMPONENT_H_ #define SKILLCOMPONENT_H_ /** * Data structure to represent an Entity's skill. */ typedef struct { int ranks; ///< Current ranks in the skill int xp; ///< Amount of XP earned towards next rank } SkillComponent; /** * Enumeration for identifying different skills. */ enum skill_t { Mele...
Call ia64_make_proc_info() to ensure that the proc_info is valid.
/* libunwind - a platform-independent unwind library Copyright (C) 2002 Hewlett-Packard Co Contributed by David Mosberger-Tang <davidm@hpl.hp.com> This file is part of libunwind. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "...
Fix the black devtools view.
// Copyright (c) 2013 GitHub, Inc. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_ #define ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_ #import <Cocoa/Cocoa.h> // Override NSWindow ...
// Copyright (c) 2013 GitHub, Inc. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_ #define ATOM_BROWSER_UI_ATOM_EVENT_PROCESSING_WINDOW_H_ #import <Cocoa/Cocoa.h> #import "ui/base/coco...
Revert "original structure is out of sync with github"
/* ----------------------------------------------------------------------------- This source file is part of NLRE (NonLinear Rendering Engine) For the latest info, see https://github.com/AlexandrSachkov/NonLinearRenderingEngine Copyright (c) 2014 NonLinear Rendering Engine Team Permission is hereby granted, free of c...
Test normal (backend-)allocas inside VLA scope
// RUN: %ocheck 0 %s void abort(void); g() { return 0; } main() { int n = 5; // an unaligned value int vla[n]; vla[0] = 1; vla[1] = 2; vla[2] = 3; vla[3] = 4; { // this alloca is done in order after the vla, // but is coalesced to before the VLA by the stack logic int x = 99; if(x != 99) abort(); ...
Refactor to fix potential buffer overflow.
#ifndef PAPER_H #define PAPER_H #include <stdbool.h> bool paper_is_start_of_first_word(char *ptr) { // Lookback and check if that is a NUL then check that we aren't // currently on a space. return (*(ptr - 1) == KATA_NUL && *ptr != KATA_SPACE); } bool paper_is_start_of_subsequent_word(char *ptr) { //...
#ifndef PAPER_H #define PAPER_H #include <stdbool.h> bool paper_is_start_of_first_word(size_t word_count, char *ptr) { return (word_count == 0 && *ptr != KATA_SPACE); } bool paper_is_start_of_subsequent_word(char *ptr) { // Lookback and see if the prior character was a space then check that // we aren't ...
Make this pass for CYGWIN.
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep extern_weak // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | llvm-as | llc #if !defined(__linux__) && !defined(__FreeBSD__) && !defined(__OpenBSD__) void foo() __attribute__((weak_import)); #else void foo() __attribute__((weak)); #endif void bar() { foo(); }
// RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | grep extern_weak // RUN: %llvmgcc -O3 -S -o - -emit-llvm %s | llvm-as | llc #if !defined(__linux__) && !defined(__FreeBSD__) && \ !defined(__OpenBSD__) && !defined(__CYGWIN__) void foo() __attribute__((weak_import)); #else void foo() __attribute__((weak)); #endif void ...
Remove the leading hyphen so that grep doesn't parse it as one long option :)
// RUN: clang -### %s -c -o tmp.o -Wa,--noexecstack | grep "-mnoexecstack"
// RUN: clang -### %s -c -o tmp.o -Wa,--noexecstack | grep "mnoexecstack"
Fix default value of PERCENT_SIGN_AS_MOD
// // DDMathParser.h // DDMathParser // // Created by Dave DeLong on 11/20/10. // Copyright 2010 Home. All rights reserved. // #import "DDMathEvaluator.h" #import "DDExpression.h" #import "DDParser.h" #import "DDTypes.h" #import "NSString+DDMathParsing.h" #define DDRuleTemplateAnyNumber @"__num" #define DDRuleTem...
// // DDMathParser.h // DDMathParser // // Created by Dave DeLong on 11/20/10. // Copyright 2010 Home. All rights reserved. // #import "DDMathEvaluator.h" #import "DDExpression.h" #import "DDParser.h" #import "DDTypes.h" #import "NSString+DDMathParsing.h" #define DDRuleTemplateAnyNumber @"__num" #define DDRuleTem...
Fix include guards to match new location.
//===------ utils/obj2yaml.hpp - obj2yaml conversion tool -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // // This file declares some helper routines, and also the for...
//===------ utils/obj2yaml.hpp - obj2yaml conversion tool -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // // This file declares some helper routines, and also the for...
Use regular assert for static_assert, it's C++14 compatible
/* * Frozen * Copyright 2016 QuarksLab * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache Lice...
/* * Frozen * Copyright 2016 QuarksLab * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache Lice...
Use dynamic_cast in qScriptValueToQObject as qobject_cast fails for some metatypes such as Entity*. However, assert that if dynamic_cast is null, so is qobject_cast.
// For conditions of distribution and use, see copyright notice in license.txt #include <QScriptEngine> #include <QMetaType> // The following functions help register a custom QObject-derived class to a QScriptEngine. // See http://lists.trolltech.com/qt-interest/2007-12/thread00158-0.html . template <typename Tp> QSc...
// For conditions of distribution and use, see copyright notice in license.txt #include <QScriptEngine> #include <QMetaType> // The following functions help register a custom QObject-derived class to a QScriptEngine. // See http://lists.trolltech.com/qt-interest/2007-12/thread00158-0.html . template <typename Tp> QSc...
Add a small C99 test
/* How to compile for DOS (all mode(l)s: tiny/.COM, small/.EXE, huge/.EXE): smlrcc -dost c99.c -o c99dt.com smlrcc -doss c99.c -o c99ds.exe smlrcc -dosh c99.c -o c99dh.exe How to compile for Windows: smlrcc -win c99.c -o c99w.exe How to compile for Linux: smlrcc -linux c99.c -o c99l */ #inc...
Add prototypes to header (based on code by ramiro)
/* * Principal component analysis * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, o...
/* * Principal component analysis * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, o...
Add SharedCueSheet to global headers
#ifndef CCADX2Manager_Manager_h #define CCADX2Manager_Manager_h #include "Manager.h" #include "CueSheet.h" #endif
#ifndef CCADX2Manager_Manager_h #define CCADX2Manager_Manager_h #include "Manager.h" #include "CueSheet.h" #include "SharedCueSheet.h" #endif
Replace denormalise macro, broken on recent gcc's.
// Macro for killing denormalled numbers // // Written by Jezar at Dreampoint, June 2000 // http://www.dreampoint.co.uk // Based on IS_DENORMAL macro by Jon Watte // This code is public domain #ifndef _denormals_ #define _denormals_ #if 0 #define undenormalise(sample) if(((*(unsigned int*)&sample)&0x7f8000...
// Macro for killing denormalled numbers // // Written by Jezar at Dreampoint, June 2000 // http://www.dreampoint.co.uk // Based on IS_DENORMAL macro by Jon Watte // This code is public domain #ifndef _denormals_ #define _denormals_ #if defined(i386) #ifdef NOMORE // original code doesn't work on recent ...
Support RHO_ASSERT in Debug mode
#ifndef _RHOFATALERROR_H_ #define _RHOFATALERROR_H_ #include "RhoPort.h" #ifdef OS_SYMBIAN #include <e32std.h> #endif namespace rho{ namespace common{ class CRhoFatalError{ public: static void processFatalError(){ #ifdef RHO_DEBUG #if defined (OS_WINDOWS) //__debugbreak(); ...
#ifndef _RHOFATALERROR_H_ #define _RHOFATALERROR_H_ #include "RhoPort.h" #ifdef OS_SYMBIAN #include <e32std.h> #endif namespace rho{ namespace common{ class CRhoFatalError{ public: static void processFatalError(){ #ifdef RHO_DEBUG #if defined (OS_WINDOWS) //__debugbreak(); ...
Add test abortUnless unsound test
// PARAM: --set ana.activated[+] abortUnless #include <goblint.h> int zero(int cond) { return 0; } void assume_abort_if_not(int cond) { if (cond) { cond = zero(cond); } else { abort(); } } int main(void) { int x; assume_abort_if_not(x == 8); __goblint_check(x==8); // UNKNOWN! }
Add function for building request01
#include "../modlib.h" #include "../parser.h" #include "mtypes.h" #include "mcoils.h" //Use external master configuration extern MODBUSMasterStatus MODBUSMaster;
Make it build with gcc 4.1
//********************************************************************* //* C_Base64 - a simple base64 encoder and decoder. //* //* Copyright (c) 1999, Bob Withers - bwit@pobox.com //* //* This code may be freely used for any purpose, either personal //* or commercial, provided the authors copyright notice remains...
//********************************************************************* //* C_Base64 - a simple base64 encoder and decoder. //* //* Copyright (c) 1999, Bob Withers - bwit@pobox.com //* //* This code may be freely used for any purpose, either personal //* or commercial, provided the authors copyright notice remains...
Add forgotted notification observer header.
// Copyright (c) 2009 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_COMMON_NOTIFICATION_OBSERVER_H_ #define CHROME_COMMON_NOTIFICATION_OBSERVER_H_ class NotificationDetails; class NotificationSo...
Clarify XPC connection lifecycle for -launch:
// // SQRLShipItLauncher.h // Squirrel // // Created by Justin Spahr-Summers on 2013-08-12. // Copyright (c) 2013 GitHub. All rights reserved. // #import <Foundation/Foundation.h> // The domain for errors originating within SQRLShipItLauncher. extern NSString * const SQRLShipItLauncherErrorDomain; // The ShipIt ...
// // SQRLShipItLauncher.h // Squirrel // // Created by Justin Spahr-Summers on 2013-08-12. // Copyright (c) 2013 GitHub. All rights reserved. // #import <Foundation/Foundation.h> // The domain for errors originating within SQRLShipItLauncher. extern NSString * const SQRLShipItLauncherErrorDomain; // The ShipIt ...
Add some more acpi event types that we will handle.
#ifdef E_TYPEDEFS /* enum for various event types */ typedef enum _E_Acpi_Type { E_ACPI_TYPE_UNKNOWN = 0, E_ACPI_TYPE_LID, E_ACPI_TYPE_BATTERY, E_ACPI_TYPE_BUTTON, E_ACPI_TYPE_SLEEP, E_ACPI_TYPE_WIFI } E_Acpi_Type; /* struct used to pass to event handlers */ typedef struct _E_Event_Acpi E_Event_Acp...
#ifdef E_TYPEDEFS /* enum for various event types */ typedef enum _E_Acpi_Type { E_ACPI_TYPE_UNKNOWN = 0, E_ACPI_TYPE_BATTERY, E_ACPI_TYPE_BUTTON, E_ACPI_TYPE_FAN, E_ACPI_TYPE_LID, E_ACPI_TYPE_PROCESSOR, E_ACPI_TYPE_SLEEP, E_ACPI_TYPE_POWER, E_ACPI_TYPE_THERMAL, E_ACPI_TYPE_VIDEO, E_A...
Modify UnMap function return boolean value that succesfully unmaped.
#pragma once #include "ResourceDX11.h" namespace Mile { class MEAPI BufferDX11 : public ResourceDX11 { public: BufferDX11( RendererDX11* renderer ) : m_buffer( nullptr ), ResourceDX11( renderer ) { } ~BufferDX11( ) { SafeRelease( m_buffer ); ...
#pragma once #include "ResourceDX11.h" namespace Mile { class MEAPI BufferDX11 : public ResourceDX11 { public: BufferDX11( RendererDX11* renderer ) : m_buffer( nullptr ), ResourceDX11( renderer ) { } ~BufferDX11( ) { SafeRelease( m_buffer ); ...
Update the way of importing CDVViewController to avoid compiler warning when using xFaceLib in 3rd party.
/* This file was modified from or inspired by Apache Cordova. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Ap...
/* This file was modified from or inspired by Apache Cordova. Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Ap...
Add base struct for hasNode.
#include <stdio.h> #include <stdlib.h> #ifndef LINKED_LIST_H #define LINKED_LIST_H #include "linkedList.h" #endif struct Node { int data; struct Node* next; }; int main(int arc, char **argc) { // Create size for the nodes struct Node* head = malloc(sizeof(struct Node)); struct Node* middle = malloc(sizeof(st...
#include <stdio.h> #include <stdlib.h> #ifndef LINKED_LIST_H #define LINKED_LIST_H #include "linkedList.h" #endif struct Node { int data; struct Node* next; }; bool hasNode(struct Node* head, int data) { return true; } int main(int arc, char **argc) { // Create size for the nodes struct Node* head = malloc(...
Change the version to `1.0.1`
#ifndef PHP_EXTCSS3_H #define PHP_EXTCSS3_H #include <php.h> #include "extcss3/types.h" #define PHP_EXTCSS3_EXTNAME "extcss3" #define PHP_EXTCSS3_EXTVER "1.0.0" #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ extern zend_module_entry extcss3_module_entry; #define phpext_extcss3_ptr &extcss3_mo...
#ifndef PHP_EXTCSS3_H #define PHP_EXTCSS3_H #include <php.h> #include "extcss3/types.h" #define PHP_EXTCSS3_EXTNAME "extcss3" #define PHP_EXTCSS3_EXTVER "1.0.1" #ifdef HAVE_CONFIG_H #include "config.h" #endif /* HAVE_CONFIG_H */ extern zend_module_entry extcss3_module_entry; #define phpext_extcss3_ptr &extcss3_mo...
Change gets to fgets, because gets is unsafe
#include <stdio.h> #include "portable_io.h" char Prbuf[MAXLLEN]; //将输入输出函数包出来. void portable_puts(char* buf){ while((*buf)!=0){ putchar(*buf); buf++; } } void portable_input_int(int* val){ portable_gets(Prbuf); sscanf(Prbuf, "%d", val); } void portable_gets(char* buf){ gets(buf); }
#include <stdio.h> #include "portable_io.h" char Prbuf[MAXLLEN]; //将输入输出函数包出来. void portable_puts(char* buf){ while((*buf)!=0){ putchar(*buf); buf++; } } void portable_input_int(int* val){ portable_gets(Prbuf); sscanf(Prbuf, "%d", val); } void portable_gets(char* buf){ fgets(buf, MAXLLEN, stdin); }
Add stubs for itoa, ltoa
#include <stdlib.h> #include "stdlib_noniso.h" long atol_internal(const char* s) { return 0; } float atof_internal(const char* s) { return 0; } char * itoa (int val, char *s, int radix) { *s = 0; return s; } char * ltoa (long val, char *s, int radix) { *s = 0; return s; } char * utoa (unsigned int val...
#include <stdlib.h> #include "stdlib_noniso.h" extern int ets_sprintf(char*, const char*, ...); #define sprintf ets_sprintf long atol_internal(const char* s) { long result = 0; return result; } float atof_internal(const char* s) { float result = 0; return result; } char * itoa (int val, char *s, int radix...
Add information about the module source
//===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=// // // This functionality is implemented by the lib/Bytecode/Reader library. // This library is used to read VM bytecode files from an iostream. // // Note that performance of this library is _crucial_ for performance of the // JIT type app...
//===-- llvm/Bytecode/Reader.h - Reader for VM bytecode files ----*- C++ -*--=// // // This functionality is implemented by the lib/Bytecode/Reader library. // This library is used to read VM bytecode files from an iostream. // // Note that performance of this library is _crucial_ for performance of the // JIT type app...
Add documentation for NSURL category
// // NSURL+Pinmark.h // Pinmark // // Created by Kyle Stevens on 12/24/13. // Copyright (c) 2013 kilovolt42. All rights reserved. // #import <Foundation/Foundation.h> @interface NSURL (Pinmark) - (NSDictionary *)queryParameters; @end
// // NSURL+Pinmark.h // Pinmark // // Created by Kyle Stevens on 12/24/13. // Copyright (c) 2013 kilovolt42. All rights reserved. // #import <Foundation/Foundation.h> @interface NSURL (Pinmark) /** * Creates a dictionary of the query parameters in which fields are keys for the corresponding values. * Does not...
Add a rectangle definition for enesim
/* ENESIM - Direct Rendering Library * Copyright (C) 2007-2011 Jorge Luis Zapata * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your o...
Fix comment to reflect the change in the function name
#ifndef QBLOWFISH_H #define QBLOWFISH_H #include <QByteArray> class QBlowfish { public: QBlowfish(const QByteArray &key); bool init(); // Padding: // // Blowfish works on 8-byte blocks. Padding makes it usable even // in case where the input size is not in exact 8-byte blocks. // // I...
#ifndef QBLOWFISH_H #define QBLOWFISH_H #include <QByteArray> class QBlowfish { public: QBlowfish(const QByteArray &key); bool init(); // Padding: // // Blowfish works on 8-byte blocks. Padding makes it usable even // in case where the input size is not in exact 8-byte blocks. // // I...
Fix another header guard oversight
#ifndef __VARIABLE_H__ #define __VARAIBLE_H__ typedef struct { double weight; double sum; double sum2; } Variable; #define VARIABLE_INIT { 0.0, 0.0, 0.0 } void variable_init (Variable *variable); void variable_add_weighted (Variable *variable, double ...
#ifndef __VARIABLE_H__ #define __VARIABLE_H__ typedef struct { double weight; double sum; double sum2; } Variable; #define VARIABLE_INIT { 0.0, 0.0, 0.0 } void variable_init (Variable *variable); void variable_add_weighted (Variable *variable, double ...
Add some more acpi event types that we will handle.
#ifdef E_TYPEDEFS /* enum for various event types */ typedef enum _E_Acpi_Type { E_ACPI_TYPE_UNKNOWN = 0, E_ACPI_TYPE_LID, E_ACPI_TYPE_BATTERY, E_ACPI_TYPE_BUTTON, E_ACPI_TYPE_SLEEP, E_ACPI_TYPE_WIFI } E_Acpi_Type; /* struct used to pass to event handlers */ typedef struct _E_Event_Acpi E_Event_Acp...
#ifdef E_TYPEDEFS /* enum for various event types */ typedef enum _E_Acpi_Type { E_ACPI_TYPE_UNKNOWN = 0, E_ACPI_TYPE_BATTERY, E_ACPI_TYPE_BUTTON, E_ACPI_TYPE_FAN, E_ACPI_TYPE_LID, E_ACPI_TYPE_PROCESSOR, E_ACPI_TYPE_SLEEP, E_ACPI_TYPE_POWER, E_ACPI_TYPE_THERMAL, E_ACPI_TYPE_VIDEO, E_A...
Add regression test for extern function calling/spawning function pointer argument
#include<pthread.h> extern void foo(int (*callback)()); int glob; pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { pthread_mutex_lock(&mutex2); glob=glob+1; // RACE! pthread_mutex_unlock(&mutex2); return NULL; } int bar() { p...
Add the initial NCurses support for the program.
#include <stdio.h> int main(void) { return(0); }
#include <stdio.h> #include <stdlib.h> #include <sys/ioctl.h> #include <ncurses.h> struct winsize terminalSize; void initScreen(void) { initscr(); noecho(); nocbreak(); } void closeScreen(void) { endwin(); } void getScreenSize(void) { if (ioctl(0, TIOCGWINSZ, (char *) &terminalSize) < 0) { printf("The progra...
Add incr decr error test
int main() { // Issue: 3: error: operand of increment operator not a modifiable lvalue 4--; int array[5]; // Issue: 7: error: operand of increment operator not a modifiable lvalue array--; }
Change header to C style.
/** * File: control.h * Author: Alex Savarda */ #ifndef CONTROL_H #define CONTROL_H typedef struct { unsigned int d_srcA; unsigned int d_srcB; unsigned int E_dstM; unsigned int e_Cnd; unsigned int D_icode; unsigned int E_icode; unsigned int M_icode; } controlType; #endif /* CONTROL_H...
/* * File: control.h * Author: Alex Savarda */ #ifndef CONTROL_H #define CONTROL_H typedef struct { unsigned int d_srcA; unsigned int d_srcB; unsigned int E_dstM; unsigned int e_Cnd; unsigned int D_icode; unsigned int E_icode; unsigned int M_icode; } controlType; #endif /* CONTROL_H ...
Add array of valid commands.
// System #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <string.h> // Preprocessed #define PROGRAM_EXEC 0 #define COMMAND 1 #define MACHINE_NAME 2 // Commands #define LIST_COMMAND "list" void list_machines() { fprintf(stdout, "Here be a list of machines:\n"); fprintf(stdout, " - default\n"...
/** * xhyve-manager * a simple CLI utility to manage xhyve virtual machines. **/ // System #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <string.h> // Preprocessed #define PROGRAM_EXEC 0 #define COMMAND 1 #define MACHINE_NAME 2 // Valid Commands char *commands[] = { "list", "create", "...
Test case for aligned attribute on function declaration.
// RUN: %llvmgcc %s -S -emit-llvm -o - | FileCheck %s // rdar://7270273 void foo() __attribute__((aligned (64))); void foo() { // CHECK: define void @foo() {{.*}} align 64 }
Add CCSlider to the UI headers
/* * cocos2d for iPhone: http://www.cocos2d-iphone.org * * Copyright (c) 2013 Apportable Inc. * * 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 l...
/* * cocos2d for iPhone: http://www.cocos2d-iphone.org * * Copyright (c) 2013 Apportable Inc. * * 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 l...
Add Vesal's oddness cycle invariant example
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR: __VERIFIER_error(); } return; } void fun() { int i; // Ultimate can't handle i declared in for for (i = 1; i < 1000; i += 2) { ...
Abort LLVM in debug builds when the IR doesn't verify.
/* * Copyright (C) 2011 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) 2011 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...
Fix backspace at start of file.
#include "mode.h" #include <ctype.h> #include <termbox.h> #include "buffer.h" #include "gap.h" #include "editor.h" static void insert_mode_entered(editor_t *editor) { editor_status_msg(editor, "-- INSERT --"); } static void insert_mode_key_pressed(editor_t* editor, struct tb_event* ev) { buffer_t *buffer = edit...
#include "mode.h" #include <ctype.h> #include <termbox.h> #include "buffer.h" #include "gap.h" #include "editor.h" static void insert_mode_entered(editor_t *editor) { editor_status_msg(editor, "-- INSERT --"); } static void insert_mode_key_pressed(editor_t* editor, struct tb_event* ev) { buffer_t *buffer = edit...
Add a TODO to update PacketsDroppedByInterface documentation when it gets supported.
#pragma once #include "PcapDeclarations.h" namespace PcapDotNet { namespace Core { /// <summary> /// Statistics on capture from the start of the run. /// </summary> public ref class PacketTotalStatistics sealed : System::IEquatable<PacketTotalStatistics^> { public: /// <s...
#pragma once #include "PcapDeclarations.h" namespace PcapDotNet { namespace Core { /// <summary> /// Statistics on capture from the start of the run. /// </summary> public ref class PacketTotalStatistics sealed : System::IEquatable<PacketTotalStatistics^> { public: /// <s...
Use C_IN for class of information
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <netinet/in.h> #include <resolv.h> int check_mx(char *domain) { u_char nsbuf[4096]; return res_query(domain, ns_c_any, ns_t_mx, nsbuf, sizeof (nsbuf)) > 0; }
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <netinet/in.h> #include <resolv.h> int check_mx(char *domain) { u_char nsbuf[4096]; return res_query(domain, ns_c_in, ns_t_mx, nsbuf, sizeof (nsbuf)) > 0; }
Add macro for defining memory-mapped registers.
//////////////////////////////////////////////////////////////////////////////////////////////// /// /// @file /// @author Kuba Sejdak /// @date 11.12.2016 /// /// @copyright This file is a part of cosmos OS. All rights reserved. /// ///////////////////////////////////////////////////////////////////////////...
Reduce PWM frequency to 500 Hz.
/* * Supemeca Never Dies 2017 * \file Motor.h * \date 17/03/2017 * \author Romain Reignier */ #pragma once #include "hal.h" #include "Motors.h" class Motor { friend class Motors; public: enum eDirection { FORWARD, BACKWARD }; static constexpr uint32_t kPwmFrequency{1000000}; static constexp...
/* * Supemeca Never Dies 2017 * \file Motor.h * \date 17/03/2017 * \author Romain Reignier */ #pragma once #include "hal.h" #include "Motors.h" class Motor { friend class Motors; public: enum eDirection { FORWARD, BACKWARD }; static constexpr uint32_t kPwmFrequency{10000}; static constexpr ...
Add newline to end of file
// // PureLayout.h // v2.0.2 // https://github.com/smileyborg/PureLayout // // Copyright (c) 2014 Tyler Fox // // This code is distributed under the terms and conditions of the MIT license. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated docum...
// // PureLayout.h // v2.0.2 // https://github.com/smileyborg/PureLayout // // Copyright (c) 2014 Tyler Fox // // This code is distributed under the terms and conditions of the MIT license. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated docum...
Fix compilation on Linux with latest 1.10
// Filename: config_lui.h // Created by: tobspr (28Aug14) // #ifndef CONFIG_LUI_H #define CONFIG_LUI_H #include "pandabase.h" #include "notifyCategoryProxy.h" #include "dconfig.h" // It is convenient to put these here for now. // #if (defined(WIN32_VC) || defined(WIN64_VC)) && !defined(CPPPARSER) && !defined(LINK_A...
// Filename: config_lui.h // Created by: tobspr (28Aug14) // #ifndef CONFIG_LUI_H #define CONFIG_LUI_H #include "pandabase.h" #include "notifyCategoryProxy.h" #include "dconfig.h" #define EXPCL_LUI EXPORT_CLASS #define EXPTP_LUI EXPORT_TEMPL ConfigureDecl(config_lui, EXPCL_LUI, EXPTP_LUI); NotifyCategoryDecl(lui, ...
Move gVersionCheck into `ROOT::` (ROOT-10426):
// @(#)root/base:$Id$ // Author: Fons Rademakers 9/5/2007 /************************************************************************* * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
// @(#)root/base:$Id$ // Author: Fons Rademakers 9/5/2007 /************************************************************************* * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...