Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Add BST Create function implementation
#include "bst.h" static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v); struct BSTNode { BSTNode* left; BSTNode* right; BSTNode* p; void* k; }; struct BST { BSTNode* root; };
#include "bst.h" static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v); struct BSTNode { BSTNode* left; BSTNode* right; BSTNode* p; void* k; }; struct BST { BSTNode* root; }; BST* BST_Create(void) { BST* T = (BST* )malloc(sizeof(BST)); T->root = NULL; return T; }
Use an explicit target to test that source fortification is off when building for Darwin with -faddress-sanitizer.
// Make sure AddressSanitizer disables _FORTIFY_SOURCE on Darwin. // REQUIRES: system-darwin // RUN: %clang -faddress-sanitizer %s -E -dM -o - | FileCheck %s // CHECK: #define _FORTIFY_SOURCE 0
// Make sure AddressSanitizer disables _FORTIFY_SOURCE on Darwin. // RUN: %clang -faddress-sanitizer %s -E -dM -target x86_64-darwin - | FileCheck %s // CHECK: #define _FORTIFY_SOURCE 0
Add functions to build SM trees
#ifndef SYMBOLICMATHNODE_H #define SYMBOLICMATHNODE_H #include <vector> #include "SymbolicMathNode.h" namespace SymbolicMath { // clang-format off Node abs(Node a) { return Node(UnaryFunctionType::ABS, a); } Node acos(Node a) { return Node(UnaryFunctionType::ACOS, a); } Node acosh(Node a) { return Node(UnaryFunctio...
Remove the _POSIX_C_SOURCE def that the sparc doesn't like
/* -*- mode:linux -*- */ /** * \file timeout.h * * * * \author Ethan Burns * \date 2008-12-16 */ #define _POSIX_C_SOURCE 200112L void timeout(unsigned int sec);
/* -*- mode:linux -*- */ /** * \file timeout.h * * * * \author Ethan Burns * \date 2008-12-16 */ void timeout(unsigned int sec);
Drop C linkage for message validators
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2015 Couchbase, Inc * * 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://w...
/* -*- Mode: C++; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* * Copyright 2015 Couchbase, Inc * * 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://w...
Fix warning 'Empty paragraph passed to '@discussion' command'
@import Foundation; @interface NSObject (DPLJSONObject) /** Returns a JSON compatible version of the receiver. @discussion - NSDictionary and NSArray will call `DPLJSONObject' on all of their items. - Objects in an NSDictionary not keyed by an NSString will be removed. - NSNumbers that are NaN or Inf will be...
@import Foundation; @interface NSObject (DPLJSONObject) /** Returns a JSON compatible version of the receiver. @discussion - NSDictionary and NSArray will call `DPLJSONObject' on all of their items. - Objects in an NSDictionary not keyed by an NSString will be removed. - NSNumbers that are NaN or Inf will be r...
Update to version 9 to match libsetup/tmcd.
/* * EMULAB-COPYRIGHT * Copyright (c) 2000-2003 University of Utah and the Flux Group. * All rights reserved. */ #define TBSERVER_PORT 7777 #define TBSERVER_PORT2 14447 #define MYBUFSIZE 2048 #define BOSSNODE_FILENAME "bossnode" /* * As the tmcd changes, incompatable changes with older version of * the softw...
/* * EMULAB-COPYRIGHT * Copyright (c) 2000-2003 University of Utah and the Flux Group. * All rights reserved. */ #define TBSERVER_PORT 7777 #define TBSERVER_PORT2 14447 #define MYBUFSIZE 2048 #define BOSSNODE_FILENAME "bossnode" /* * As the tmcd changes, incompatable changes with older version of * the softw...
Change server set/get function names
#ifndef GWKV_HT_WRAPPER #define GWKV_HT_WRAPPER #include <stdlib.h> typedef enum { GET, SET } method; /* Defines for result codes */ #define STORED 0 #define NOT_STORED 1 #define EXISTS 2 #define NOT_FOUND 3 struct { method method_type, const char* key, size_t key_length, ...
#ifndef GWKV_HT_WRAPPER #define GWKV_HT_WRAPPER #include <stdlib.h> #include "../hashtable/hashtable.h" typedef enum { GET, SET } method; /* Defines for result codes */ #define STORED 0 #define NOT_STORED 1 #define EXISTS 2 #define NOT_FOUND 3 struct { method method_type, const char*...
Tag 2.1.1 because of the segfault fix.
#ifndef _COMMON_H #define _COMMON_H #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #ifdef _LINUX #include <bsd/string.h> #endif #include <libxml/parser.h> #include <libxml/tree.h> #include <libxml/xmlsave.h> #include <libxml/encoding.h> #include <libxml/xmlstring.h>...
#ifndef _COMMON_H #define _COMMON_H #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include <string.h> #ifdef _LINUX #include <bsd/string.h> #endif #include <libxml/parser.h> #include <libxml/tree.h> #include <libxml/xmlsave.h> #include <libxml/encoding.h> #include <libxml/xmlstring.h>...
Add file that holds the string hash function.
static inline unsigned int hash_func_string(const char* key) { unsigned int hash = 0; int c; while ((c = *key++) != 0) hash = c + (hash << 6) + (hash << 16) - hash; return hash; }
Fix Travis build (missing include for size_t)
/** * @file random.h * @ingroup CppAlgorithms * @brief Random utility functions. * * Copyright (c) 2013 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) */ /** * @brief Random...
/** * @file random.h * @ingroup CppAlgorithms * @brief Random utility functions. * * Copyright (c) 2013 Sebastien Rombauts (sebastien.rombauts@gmail.com) * * Distributed under the MIT License (MIT) (See accompanying file LICENSE.txt * or copy at http://opensource.org/licenses/MIT) */ #include <cstddef> ...
Add octApron test on signed overflows
// SKIP PARAM: --sets ana.activated[+] octApron --sets sem.int.signed_overflow assume_none --disable ana.int.interval // copied from signed-overflows/intervals for octApron int main(void) { int x = 0; while(x != 42) { x++; assert(x >= 1); } }
Include virtual in all methods.
#ifndef __GAME_OBJECT_H__ #define __GAME_OBJECT_H__ #include<iostream> #include<SDL2/SDL.h> class GameObject { public: void load(int pX, int pY, int pWidth, int pHeight, std::string pTextureId); void draw(SDL_Renderer *renderer); void update(); void clean() { std::cout << "clean ga...
#ifndef __GAME_OBJECT_H__ #define __GAME_OBJECT_H__ #include<iostream> #include<SDL2/SDL.h> class GameObject { public: virtual void load(int pX, int pY, int pWidth, int pHeight, std::string pTextureId); virtual void draw(SDL_Renderer *renderer); virtual void update(); virtual void c...
Add missing include for size_t
#ifndef _EXCELFORMUAL_TOKEN_ARRAY_H__ #define _EXCELFORMUAL_TOKEN_ARRAY_H__ #include <vector> using std::vector; namespace ExcelFormula{ class Token; class TokenArray{ public: TokenArray(); void toVector(vector<Token*>&); void fromVector(vector<Token*>&); size_t size() {return m_tokens.size();} ...
#ifndef _EXCELFORMUAL_TOKEN_ARRAY_H__ #define _EXCELFORMUAL_TOKEN_ARRAY_H__ #include <vector> #include <cstddef> using std::vector; namespace ExcelFormula{ class Token; class TokenArray{ public: TokenArray(); void toVector(vector<Token*>&); void fromVector(vector<Token*>&); size_t size() {return...
Define chdir as a macro.
#ifndef LIBPORT_UNISTD_H # define LIBPORT_UNISTD_H # include <libport/detect-win32.h> # include <libport/windows.hh> // Get sleep wrapper # include <libport/config.h> // This is traditional Unix file. # ifdef LIBPORT_HAVE_UNISTD_H # include <unistd.h> # endif // OSX does not have O_LARGEFILE. No information was f...
#ifndef LIBPORT_UNISTD_H # define LIBPORT_UNISTD_H # include <libport/detect-win32.h> # include <libport/windows.hh> // Get sleep wrapper # include <libport/config.h> // This is traditional Unix file. # ifdef LIBPORT_HAVE_UNISTD_H # include <unistd.h> # endif // OSX does not have O_LARGEFILE. No information was f...
Add type to Collection Property
// // TSDKCollectionJSON.h // TeamSnapSDK // // Created by Jason Rahaim on 1/10/14. // Copyright (c) 2014 TeamSnap. All rights reserved. // #import <Foundation/Foundation.h> @interface TSDKCollectionJSON : NSObject <NSCoding, NSCopying> @property (nonatomic, strong) NSURL *_Nullable href; @property (nonatomic, s...
// // TSDKCollectionJSON.h // TeamSnapSDK // // Created by Jason Rahaim on 1/10/14. // Copyright (c) 2014 TeamSnap. All rights reserved. // #import <Foundation/Foundation.h> @interface TSDKCollectionJSON : NSObject <NSCoding, NSCopying> @property (nonatomic, strong) NSURL *_Nullable href; @property (nonatomic, s...
Add name to top of file.
#include <stdio.h> /* Static functions and static global variables are only visible in * the file that it is declared in. Static variables inside of a * function have a different meaning and is described below */ void foo() { int x = 0; static int staticx = 0; // initialized once; keeps value between invocations ...
// Scott Kuhl #include <stdio.h> /* Static functions and static global variables are only visible in * the file that it is declared in. Static variables inside of a * function have a different meaning and is described below */ void foo() { int x = 0; static int staticx = 0; // initialized once; keeps value betwee...
Fix snprintf on VisualC++ with a conditional define.
/****************************** ** Tsunagari Tile Engine ** ** config.h ** ** Copyright 2011 OmegaSDG ** ******************************/ #ifndef CONFIG_H #define CONFIG_H // === Default Configuration Settings === /* Tsunagari config file. -- Command Line */ #define CLIENT_CONF_FILE "./client....
/****************************** ** Tsunagari Tile Engine ** ** config.h ** ** Copyright 2011 OmegaSDG ** ******************************/ #ifndef CONFIG_H #define CONFIG_H // === Default Configuration Settings === /* Tsunagari config file. -- Command Line */ #define CLIENT_CONF_FILE "./client....
Add missing file. Oops :(
// Copyright (c) 2008 The Chromium Authors. All rights reserved. Use of this // source code is governed by a BSD-style license that can be found in the // LICENSE file. #ifndef WEBKIT_GLUE_SCREEN_INFO_H_ #define WEBKIT_GLUE_SCREEN_INFO_H_ #include "base/gfx/rect.h" namespace webkit_glue { struct ScreenInfo { int...
Fix Krazy warnings: explicit - KreDBImporter
/*************************************************************************** * Copyright © 2004 Jason Kivlighn <jkivlighn@gmail.com> * * * * This program is free software; you can redistribute it and/or modify * * it under th...
/*************************************************************************** * Copyright © 2004 Jason Kivlighn <jkivlighn@gmail.com> * * * * This program is free software; you can redistribute it and/or modify * * it under th...
Add note about blacklisting interfaces
/* * Configurables. Adjust these to be appropriate for your system. */ /* change blacklist parameters (-b) if necessary */ static const char *ealargs[] = { "if_dpdk", "-b 00:00:03.0", "-c 1", "-n 1", }; /* change PORTID to the one your want to use */ #define IF_PORTID 0 /* change to the init method of your NI...
/* * Configurables. Adjust these to be appropriate for your system. */ /* change blacklist parameters (-b) if necessary * If you have more than one interface, you will likely want to blacklist * at least one of them. */ static const char *ealargs[] = { "if_dpdk", "-b 00:00:03.0", "-c 1", "-n 1", }; /* chang...
Extend IParser interface: remember parse state - succesfull or not; what part of string was parsed
#pragma once #include <mixal/config.h> #include <mixal/parsers_utils.h> namespace mixal { class MIXAL_PARSER_LIB_EXPORT IParser { public: std::size_t parse_stream(std::string_view str, std::size_t offset = 0); protected: ~IParser() = default; virtual void do_clear() = 0; virtual std::size_t do_pa...
#pragma once #include <mixal/config.h> #include <mixal/parsers_utils.h> namespace mixal { class MIXAL_PARSER_LIB_EXPORT IParser { public: std::size_t parse_stream(std::string_view str, std::size_t offset = 0); bool is_valid() const; std::string_view str() const; protected: IParser() = default; ...
Print out values of first two arrays
#include <stdio.h> int main(int argc, char *argv[]){ int numbers[4] = {0}; char name[4] = {'a'}; //first print them out raw printf("numbers: %d %d %d %d.\n", numbers[0], numbers[1], numbers[2], numbers[3]); printf("name each: %c %c %c %c.\n", name[0], ...
Rewrite matching line to be friendlier to misc buildbots.
// RUN: %clang_cc1 %s -triple x86_64-apple-darwin -emit-llvm -o - | FileCheck %s // PR 5995 struct s { int word; struct { int filler __attribute__ ((aligned (8))); }; }; void func (struct s *s) { // CHECK: load %struct.s** %s.addr, align 8 s->word = 0; }
// RUN: %clang_cc1 %s -triple x86_64-apple-darwin -emit-llvm -o - | FileCheck %s // PR 5995 struct s { int word; struct { int filler __attribute__ ((aligned (8))); }; }; void func (struct s *s) { // CHECK: load %struct.s**{{.*}}align 8 s->word = 0; }
Fix test suite compilation errors
#ifndef EP_TESTSUITE_H #define EP_TESTSUITE_H 1 #include <memcached/engine.h> #include <memcached/engine_testapp.h> #ifdef __cplusplus extern "C" { #endif MEMCACHED_PUBLIC_API engine_test_t* get_tests(void); MEMCACHED_PUBLIC_API bool setup_suite(struct test_harness *th); #ifdef __cplusplus } #endif #endif
#ifndef EP_TESTSUITE_H #define EP_TESTSUITE_H 1 #include <memcached/engine.h> #include <memcached/engine_testapp.h> #ifdef __cplusplus extern "C" { #endif MEMCACHED_PUBLIC_API engine_test_t* get_tests(void); MEMCACHED_PUBLIC_API bool setup_suite(struct test_harness *th); MEMCACHED_PUBLIC_API bool teardown_suite();...
Add empty test to prevent build system complaining.
/* Copyright (C) 2016 William Hart This file is part of FLINT. FLINT is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (LGPL) as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) a...
Fix InputSize symbol array size.
#ifndef INPUTSTATE_H #define INPUTSTATE_H #include <SDL2/SDL.h> #undef main #include <map> class InputState { public: enum KeyFunction { KF_EXIT, KF_FORWARDS, KF_BACKWARDS, KF_ROTATE_SUN }; InputState(); void readInputState(); bool getKeyState(KeyFunction f); int getAbsoluteMouseX() { return mouse_x; }; int ge...
#ifndef INPUTSTATE_H #define INPUTSTATE_H #include <SDL2/SDL.h> #undef main #include <map> class InputState { public: enum KeyFunction { KF_EXIT, KF_FORWARDS, KF_BACKWARDS, KF_ROTATE_SUN }; InputState(); void readInputState(); bool getKeyState(KeyFunction f); int getAbsoluteMouseX() { return mouse_x; }; int ge...
Fix integer overflow in jsonp_strdup()
/* * Copyright (c) 2009-2012 Petri Lehtinen <petri@digip.org> * Copyright (c) 2011-2012 Basile Starynkevitch <basile@starynkevitch.net> * * Jansson is free software; you can redistribute it and/or modify it * under the terms of the MIT license. See LICENSE for details. */ #include <stdlib.h> #include <string.h> ...
/* * Copyright (c) 2009-2012 Petri Lehtinen <petri@digip.org> * Copyright (c) 2011-2012 Basile Starynkevitch <basile@starynkevitch.net> * * Jansson is free software; you can redistribute it and/or modify it * under the terms of the MIT license. See LICENSE for details. */ #include <stdlib.h> #include <string.h> ...
Fix link error when component=shared_library is set
// 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_BASE_IME_CHARACTER_COMPOSER_H_ #define UI_BASE_IME_CHARACTER_COMPOSER_H_ #pragma once #include <vector> #include "base/basictypes.h" #inc...
// 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_BASE_IME_CHARACTER_COMPOSER_H_ #define UI_BASE_IME_CHARACTER_COMPOSER_H_ #pragma once #include <vector> #include "base/basictypes.h" #inc...
Undo change proposed by Philippe. Too many side effects.
#ifndef G__IOSFWD_H #define G__IOSFWD_H #include <iostream.h> typedef basic_streambuf<char, char_traits<char> > streambuf; #endif
#ifndef G__IOSFWD_H #define G__IOSFWD_H #include <iostream.h> #endif
Implement getting and setting uiImage size in Gtk
// 13 september 2016 #include "uipriv_unix.h" struct uiImage { uiUnixControl c; GtkWidget *widget; }; uiUnixControlAllDefaults(uiImage) uiImage *uiNewImage(const char *filename) { uiImage *img; uiUnixNewControl(uiImage, img); img->widget = gtk_image_new_from_file(filename); return img; }
// 13 september 2016 #include "uipriv_unix.h" struct uiImage { uiUnixControl c; GtkWidget *widget; }; uiUnixControlAllDefaults(uiImage) void uiImageSetSize(uiImage *i, unsigned int width, unsigned int height) { GdkPixbuf *pixbuf; pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(i->widget)); pixbuf = gdk_pixbuf_scale_si...
Replace nil with nullptr in GLContextNSGL to compile correctly
// LAF OS Library // Copyright (C) 2022 Igara Studio S.A. // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef OS_GL_CONTEXT_NSGL_INCLUDED #define OS_GL_CONTEXT_NSGL_INCLUDED #pragma once #include "os/gl/gl_context.h" namespace os { class GLContextNSGL :...
// LAF OS Library // Copyright (C) 2022 Igara Studio S.A. // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef OS_GL_CONTEXT_NSGL_INCLUDED #define OS_GL_CONTEXT_NSGL_INCLUDED #pragma once #include "os/gl/gl_context.h" namespace os { class GLContextNSGL :...
Update completion queue header to match code changes
/* * * Copyright 2016 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
/* * * Copyright 2016 gRPC authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
Allow indexing by operator[] when dimension is 1
#ifndef SCALAR_INDEXING_NONCONST_H #define SCALAR_INDEXING_NONCONST_H // Scalar indexing non-const //----------------------------------------------------------------------------------------------------------// template<typename... Args, typename std::enable_if<sizeof...(Args)==dimension_t::value && ...
#ifndef SCALAR_INDEXING_NONCONST_H #define SCALAR_INDEXING_NONCONST_H // Scalar indexing non-const //----------------------------------------------------------------------------------------------------------// template<typename... Args, typename std::enable_if<sizeof...(Args)==dimension_t::value && ...
Disable MBEDTLS_HAVE_DATE_TIME as ARMCC does not support gmtime
/** * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * 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/l...
/** * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved * SPDX-License-Identifier: Apache-2.0 * * 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/l...
Clear bit when writing to VDP2(TVMD)
/* * Copyright (c) 2012-2016 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <mrkotfw@gmail.com> */ #include <vdp2/tvmd.h> #include "vdp-internal.h" void vdp2_tvmd_display_clear(void) { _state_vdp2()->regs.tvmd &= 0x7FFF; /* Change the DISP bit during VBLANK */ vdp2_tvmd_vb...
/* * Copyright (c) 2012-2016 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <mrkotfw@gmail.com> */ #include <vdp2/tvmd.h> #include "vdp-internal.h" void vdp2_tvmd_display_clear(void) { _state_vdp2()->regs.tvmd &= 0x7EFF; /* Change the DISP bit during VBLANK */ vdp2_tvmd_vb...
Downgrade "libscp initialized" to LOG_LEVEL_DEBUG, remove line number
/** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2012 * * 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 ...
/** * xrdp: A Remote Desktop Protocol server. * * Copyright (C) Jay Sorg 2004-2012 * * 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 ...
Add command to tune bulkd
/* * This file is part of Kotaka, a mud library for DGD * http://github.com/shentino/kotaka * * Copyright (C) 2013 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...
Add a new-style constructor for labels
#pragma once #include "Control.h" #include "../../3RVX/Logger.h" class Label : public Control { public: Label() { } Label(int id, HWND parent) : Control(id, parent) { } };
#pragma once #include "Control.h" #include "../../3RVX/Logger.h" class Label : public Control { public: Label() { } Label(int id, HWND parent) : Control(id, parent) { } Label(int id, DialogBase &parent, bool translate = true) : Control(id, parent, false) { } };
Make stroke color an IBInspectable property.
#import <UIKit/UIKit.h> #import <GLKit/GLKit.h> @interface PPSSignatureView : GLKView @property (assign, nonatomic) UIColor *strokeColor; @property (assign, nonatomic) BOOL hasSignature; @property (strong, nonatomic) UIImage *signatureImage; - (void)erase; @end
#import <UIKit/UIKit.h> #import <GLKit/GLKit.h> @interface PPSSignatureView : GLKView @property (assign, nonatomic) IBInspectable UIColor *strokeColor; @property (assign, nonatomic) BOOL hasSignature; @property (strong, nonatomic) UIImage *signatureImage; - (void)erase; @end
Add helper functions to safely release Windows COM resources, and arrays of COM resources.
// // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // angleutils.h: Common ANGLE utilities. #ifndef COMMON_ANGLEUTILS_H_ #define COMMON_ANGLEUTILS_H_ // A macro to disallow the copy c...
// // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // angleutils.h: Common ANGLE utilities. #ifndef COMMON_ANGLEUTILS_H_ #define COMMON_ANGLEUTILS_H_ // A macro to disallow the copy c...
Set pointer to array data to null after free
#ifndef OOC_ARRAY_H_ #define OOC_ARRAY_H_ #define array_malloc(size) calloc(1, (size)) #define array_free free #include <stdint.h> #define _lang_array__Array_new(type, size) ((_lang_array__Array) { size, array_malloc((size) * sizeof(type)) }); #if defined(safe) #define _lang_array__Array_get(array, index, type) ( \...
#ifndef OOC_ARRAY_H_ #define OOC_ARRAY_H_ #define array_malloc(size) calloc(1, (size)) #define array_free free #include <stdint.h> #define _lang_array__Array_new(type, size) ((_lang_array__Array) { size, array_malloc((size) * sizeof(type)) }); #if defined(safe) #define _lang_array__Array_get(array, index, type) ( \...
Fix order of arguments to fputs
// RUN: %clang_asan -O2 %s -o %t // RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // FIXME: sprintf is not intercepted on Windows yet. // XFAIL: win32 #include <stdio.h> int main() { volatile char c = '0'; ...
// RUN: %clang_asan -O2 %s -o %t // RUN: %env_asan_opts=check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s // FIXME: sprintf is not intercepted on Windows yet. // XFAIL: win32 #include <stdio.h> int main() { volatile char c = '0'; ...
Adjust forward declarations in slobrok.
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/config/helper/configfetcher.h> #include <vespa/config/subscription/configuri.h> #include <vespa/config-stateserver.h> namespace vespalib { class HealthProducer; class MetricsP...
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #include <vespa/config/helper/configfetcher.h> #include <vespa/config/subscription/configuri.h> #include <vespa/config-stateserver.h> namespace vespalib { struct HealthProducer; struct Metric...
Allow specification of NoiseQuality with an int
#pragma once #include <spotify/json.hpp> #include <noise/noise.h> namespace spotify { namespace json { template<> struct default_codec_t<noise::NoiseQuality> { using NoiseQuality = noise::NoiseQuality; static codec::enumeration_t<NoiseQuality, codec::string_t> codec() { auto codec = codec::enume...
#pragma once #include <spotify/json.hpp> #include <noise/noise.h> namespace spotify { namespace json { template<> struct default_codec_t<noise::NoiseQuality> { using NoiseQuality = noise::NoiseQuality; static codec::one_of_t< codec::enumeration_t<NoiseQuality, codec::number_t<int>>, codec::e...
Replace printf with safe write to stdout
#define _GNU_SOURCE #include <stdio.h> #include <stddef.h> #include <unistd.h> #include <sys/mman.h> void* malloc(size_t size) { printf("malloc... "); size += sizeof(size_t); int page_size = getpagesize(); int rem = size % page_size; if (rem > 0) { size += page_size - rem; } void* addr = mmap(0, siz...
#define _GNU_SOURCE #include <stdio.h> #include <stddef.h> #include <unistd.h> #include <sys/mman.h> void* malloc(size_t size) { write(STDOUT_FILENO, "malloc... ", 10); size += sizeof(size_t); int page_size = getpagesize(); int rem = size % page_size; if (rem > 0) { size += page_size - rem; } void* ...
Make lexer constructor raise exception when file not found.
#include <stdlib.h> #include "py/lexer.h" #include "memzip.h" mp_lexer_t *mp_lexer_new_from_file(const char *filename) { void *data; size_t len; if (memzip_locate(filename, &data, &len) != MZ_OK) { return NULL; } return mp_lexer_new_from_str_len(qstr_from_str(filename), (const char *)dat...
#include <stdlib.h> #include "py/lexer.h" #include "py/runtime.h" #include "py/mperrno.h" #include "memzip.h" mp_lexer_t *mp_lexer_new_from_file(const char *filename) { void *data; size_t len; if (memzip_locate(filename, &data, &len) != MZ_OK) { mp_raise_OSError(MP_ENOENT); } return mp_l...
Use cluster iterator in to_int function
#include <string.h> #include <stdbool.h> #include "roman_convert_to_int.h" #include "roman_clusters.h" static const int ERROR = -1; static bool starts_with(const char *str, RomanCluster cluster); int roman_convert_to_int(const char *numeral) { if (!numeral) return ERROR; int total = 0; for (int cluster_index = ...
#include <string.h> #include <stdbool.h> #include "roman_convert_to_int.h" #include "roman_clusters.h" static const int ERROR = -1; static bool starts_with(const char *str, RomanCluster cluster); int roman_convert_to_int(const char *numeral) { if (!numeral) return ERROR; int total = 0; for (const RomanCluster *...
Revert to AlphaCalculatorMode in options codec
#pragma once #include <spotify/json.hpp> #include "Options.h" #include "metaoutput/codecs/FilenamesCodec.h" #include "TerrainSpecCodec.h" #include "TileFormatCodec.h" using namespace spotify::json::codec; namespace spotify { namespace json { template<> struct default_codec_t<Options> { static object_t<Options>...
#pragma once #include <spotify/json.hpp> #include "Options.h" #include "metaoutput/codecs/FilenamesCodec.h" #include "TerrainSpecCodec.h" #include "TileFormatCodec.h" using namespace spotify::json::codec; namespace spotify { namespace json { template<> struct default_codec_t<Options> { static object_t<Options>...
Fix a bug in the queue implementation
#include <stddef.h> #include <kernel/port/data.h> void enq(Queue *q, List *item) { item->next = NULL; if(!q->tail) { q->head = item; q->tail = item; } else { q->tail->next = item; } } List *deq(Queue *q) { if(!q->head) { return NULL; } List *ret = q->head; q->head = q->head->next; if(!q->head) { q-...
#include <stddef.h> #include <kernel/port/data.h> void enq(Queue *q, List *item) { item->next = NULL; if(!q->tail) { q->head = item; q->tail = item; } else { q->tail->next = item; q->tail = item; } } List *deq(Queue *q) { if(!q->head) { return NULL; } List *ret = q->head; q->head = q->head->next; i...
Reimplement InsertPointGuard to avoid LLVM ABI incompatibility.
#pragma once #include "preprocessor/llvm_includes_start.h" #include <llvm/IR/IRBuilder.h> #include "preprocessor/llvm_includes_end.h" namespace dev { namespace eth { namespace jit { class RuntimeManager; /// Base class for compiler helpers like Memory, GasMeter, etc. class CompilerHelper { protected: CompilerHelpe...
#pragma once #include "preprocessor/llvm_includes_start.h" #include <llvm/IR/IRBuilder.h> #include "preprocessor/llvm_includes_end.h" namespace dev { namespace eth { namespace jit { class RuntimeManager; /// Base class for compiler helpers like Memory, GasMeter, etc. class CompilerHelper { protected: CompilerHelpe...
Add alpha intrinsics, contributed by Rahul Joshi
//===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===// // // This file defines a set of enums which allow processing of intrinsic // functions. Values of these enum types are returned by // Function::getIntrinsicID. // //===---------------------------------------------------------------------...
//===-- llvm/Instrinsics.h - LLVM Intrinsic Function Handling ---*- C++ -*-===// // // This file defines a set of enums which allow processing of intrinsic // functions. Values of these enum types are returned by // Function::getIntrinsicID. // //===---------------------------------------------------------------------...
Work better on various versions of clang.
#pragma once #include <cassert> #include <string> #define assert2(expr, str) \ ((expr) \ ? __ASSERT_VOID_CAST (0)\ : __assert_fail ((std::string(__STRING(expr)) + "; " + (str)).c_str(), __FILE__, __LINE__, __ASSERT_FUNCTION))
#pragma once #include <cassert> #include <string> #if __GNUC__ #define assert2(expr, str) \ ((expr) \ ? __ASSERT_VOID_CAST (0)\ : __assert_fail ((std::string(__STRING(expr)) + "; " + (str)).c_str(), __FILE__, __LINE__, __ASSERT_FUNCTION)) #elif __clang__ #define assert2(expr, str) \ ((exp...
Update the OpenSSH addendum string for the buffer handling fix.
/* $OpenBSD: version.h,v 1.37 2003/04/01 10:56:46 markus Exp $ */ /* $FreeBSD$ */ #ifndef SSH_VERSION #define SSH_VERSION (ssh_version_get()) #define SSH_VERSION_BASE "OpenSSH_3.6.1p1" #define SSH_VERSION_ADDENDUM "FreeBSD-20030423" const char *ssh_version_get(void); void ssh_version_set_addend...
/* $OpenBSD: version.h,v 1.37 2003/04/01 10:56:46 markus Exp $ */ /* $FreeBSD$ */ #ifndef SSH_VERSION #define SSH_VERSION (ssh_version_get()) #define SSH_VERSION_BASE "OpenSSH_3.6.1p1" #define SSH_VERSION_ADDENDUM "FreeBSD-20030916" const char *ssh_version_get(void); void ssh_version_set_addend...
Make things depend on the compiler (G++, bsdcc, others) rather than on specific platforms.
#if defined(AIX32) && defined(__cplusplus ) # include "fix_gnu_fcntl.h" #elif defined(AIX32) && !defined(__cplusplus ) typedef unsigned short ushort; # include <fcntl.h> #elif defined(ULTRIX42) && defined(__cplusplus ) # include "fix_gnu_fcntl.h" #else # include <fcntl.h> #endif
#if defined(__cplusplus) && !defined(OSF1) /* GNU G++ */ # include "fix_gnu_fcntl.h" #elif defined(AIX32) /* AIX bsdcc */ # typedef unsigned short ushort; # include <fcntl.h> #else /* Everybody else */ # include <fcntl.h> #endif
Clarify class comment for ExtensionMessageHandler.
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_ #pragma once #include "...
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_ #define CHROME_BROWSER_EXTENSIONS_EXTENSION_MESSAGE_HANDLER_H_ #pragma once #include "...
Use Foundation framework instead of UIKit.
// // ReactiveAlamofire.h // ReactiveAlamofire // // Created by Srdan Rasic on 23/04/16. // Copyright © 2016 ReactiveKit. All rights reserved. // //! Project version number for ReactiveAlamofire. FOUNDATION_EXPORT double ReactiveAlamofireVersionNumber; //! Project version string for ReactiveAlamofire. FOUNDATION_...
// // ReactiveAlamofire.h // ReactiveAlamofire // // Created by Srdan Rasic on 23/04/16. // Copyright © 2016 ReactiveKit. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for ReactiveAlamofire. FOUNDATION_EXPORT double ReactiveAlamofireVersionNumber; //! Project version string...
Send only one packet at a time.
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "gpio.h" #include "leds.h" #include "radio.h" void error_handler(uint32_t err_code, uint32_t line_num, char * file_name) { while (1) { for (uint8_t i = LED_START; i < LED_S...
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "gpio.h" #include "leds.h" #include "radio.h" void error_handler(uint32_t err_code, uint32_t line_num, char * file_name) { while (1) { for (uint8_t i = LED_START; i < LED_S...
Add pragmas to differentiate init method types
// // GITBlob.h // CocoaGit // // Created by Geoffrey Garside on 29/06/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // #import <Cocoa/Cocoa.h> #import "GITObject.h" @interface GITBlob : GITObject { NSData * data; } #pragma mark - #pragma mark Properties @property(retain) NSData * data; #prag...
// // GITBlob.h // CocoaGit // // Created by Geoffrey Garside on 29/06/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // #import <Cocoa/Cocoa.h> #import "GITObject.h" @interface GITBlob : GITObject { NSData * data; } #pragma mark - #pragma mark Properties @property(retain) NSData * data; #prag...
Add API to detect SCU base address from CP15
#ifndef __ASMARM_ARCH_SCU_H #define __ASMARM_ARCH_SCU_H #define SCU_PM_NORMAL 0 #define SCU_PM_DORMANT 2 #define SCU_PM_POWEROFF 3 #ifndef __ASSEMBLER__ unsigned int scu_get_core_count(void __iomem *); void scu_enable(void __iomem *); int scu_power_mode(void __iomem *, unsigned int); #endif #endif
#ifndef __ASMARM_ARCH_SCU_H #define __ASMARM_ARCH_SCU_H #define SCU_PM_NORMAL 0 #define SCU_PM_DORMANT 2 #define SCU_PM_POWEROFF 3 #ifndef __ASSEMBLER__ #include <asm/cputype.h> static inline bool scu_a9_has_base(void) { return read_cpuid_part_number() == ARM_CPU_PART_CORTEX_A9; } static inline unsigned long scu_...
Define some more common ip22 CPU features.
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2003 Ralf Baechle */ #ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H #define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H /* *...
/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * Copyright (C) 2003 Ralf Baechle */ #ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H #define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H /* *...
Remove all trace functions from pre 0.0.1 prototyping
#include "cearth_network.h" void blob_init(blob *b) { b->size = 0; } void blob_add_int8(blob *b, int8_t i) { b->data[b->size] = i; b->size++; } void blob_add_str(blob *b, char *str) { int len = strlen(str); strcpy((char *)b->data+b->size, str); b->size += len; }
#include "cearth_network.h"
Add a single linked list
#include <stdio.h> #include <stdlib.h> typedef struct list_t { int data; struct list_t *next; } list_t; list_t *insert_start(list_t *list, int data) { list_t *node = malloc(sizeof(list_t)); node->data = data; node->next = list; return node; } list_t *insert_end(list_t *list, int data) { list_t *node = m...
Fix header file inclusion/define problems with xmalloc & Co and ruby
#ifndef H_RPM_RB #define H_RPM_RB /** * \file ruby/rpm-rb.h * \ingroup rb_c * * RPM Ruby bindings "RPM" module */ #include "system.h" #include <rpmiotypes.h> #include <rpmtypes.h> #include <rpmtag.h> #undef xmalloc #undef xcalloc #undef xrealloc #pragma GCC diagnostic ignored "-Wstrict-prototypes" #inclu...
#ifndef H_RPM_RB #define H_RPM_RB /** * \file ruby/rpm-rb.h * \ingroup rb_c * * RPM Ruby bindings "RPM" module */ #include "system.h" #include <rpmiotypes.h> #include <rpmtypes.h> #include <rpmtag.h> /** * The "RPM" Ruby module. */ extern VALUE rpmModule; #ifdef __cplusplus extern "C" { #endif /** *...
Add structure for stack frame
#pragma once namespace cpu { struct stack_frame { uint32_t ebx; uint32_t ecx; uint32_t edx; uint32_t esi; uint32_t edi; uint32_t ebp; uint32_t eax; uint16_t ds, __ds; uint16_t es, __es; uint16_t fs, __fs; uint16_t gs, __gs; uint32_t eip; uint16_t cs, __cs; uint3...
Use mt64_context instead of mp_rand_ctx
#ifndef _RSA_H_ #define _RSA_H_ #include "mpi.h" /* Everything must be kept private except for n and e. * (n,e) is the public key, (n,d) is the private key. */ typedef struct { mpi_t n; /* modulus n = pq */ mpi_t phi; /* phi = (p-1)(q-1) */ mpi_t e; /* public exponent 1 < e < phi s.t. gcd(e,phi)=1 */ mpi_t d; ...
#ifndef _RSA_H_ #define _RSA_H_ #include "mpi.h" /* Everything must be kept private except for n and e. * (n,e) is the public key, (n,d) is the private key. */ typedef struct { mpi_t n; /* modulus n = pq */ mpi_t phi; /* phi = (p-1)(q-1) */ mpi_t e; /* public exponent 1 < e < phi s.t. gcd(e,phi)=1 */ mpi_t d; ...
Add regression test for PR15823
// RUN: %clang %s -Wl,-as-needed -o %t && %run %t // Regression test for PR15823 // (http://llvm.org/bugs/show_bug.cgi?id=15823). #include <stdio.h> #include <time.h> int main() { struct timespec ts; clock_gettime(CLOCK_REALTIME, &ts); return 0; }
Rename isFile -> exists in header file too
// // file_API.h // Forge // // Copyright (c) 2020 Trigger Corp. All rights reserved. // #import <Foundation/Foundation.h> @interface file_API : NSObject + (void)getImage:(ForgeTask*)task; + (void)getVideo:(ForgeTask*)task; + (void)getFileFromSourceDirectory:(ForgeTask*)task resource:(NSString*)resource; + (void...
// // file_API.h // Forge // // Copyright (c) 2020 Trigger Corp. All rights reserved. // #import <Foundation/Foundation.h> @interface file_API : NSObject + (void)getImage:(ForgeTask*)task; + (void)getVideo:(ForgeTask*)task; + (void)getFileFromSourceDirectory:(ForgeTask*)task resource:(NSString*)resource; + (void...
Add proper import for NIMutableViewModel
// // Copyright 2011-2014 NimbusKit // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
// // Copyright 2011-2014 NimbusKit // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
Remove declaration of IrtInit(), which is no longer defined anywhere
/* * 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 NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPRUNTIME_H_ #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPRUNTIME_H_ #include "native_client/sr...
/* * 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 NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPRUNTIME_H_ #define NATIVE_CLIENT_SRC_SHARED_PPAPI_PROXY_PPRUNTIME_H_ #include "native_client/sr...
Fix SAUL read error return
/* * Copyright (C) 2018 HAW-Hamburg * * 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 drivers_sds011 * @{ * * @file * @brief SAUL adaption for SDS011 sensor ...
/* * Copyright (C) 2018 HAW-Hamburg * * 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 drivers_sds011 * @{ * * @file * @brief SAUL adaption for SDS011 sensor ...
Add SPI bit modify command definition
#ifndef MCP2515_LIB_DEFINITIONS_H_ #define MCP2515_LIB_DEFINITIONS_H_ /******************************************************************************* SPI Commands *******************************************************************************/ #define SPI_READ 0x03 /***********************************************...
#ifndef MCP2515_LIB_DEFINITIONS_H_ #define MCP2515_LIB_DEFINITIONS_H_ /******************************************************************************* SPI Commands *******************************************************************************/ #define SPI_READ 0x03 #define SPI_BIT_MODIFY 0x05 /************...
Comment out unnecessary use of gvio.h
#ifndef CSETTINGS_H #define CSETTINGS_H class MdiChild; #include <QDialog> #include <QString> #include "ui_settings.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gvc.h" #include "gvio.h" class CFrmSettings : public QDialog { Q_OBJECT public: CFrmSettings(); int runSettings(MdiChild*...
#ifndef CSETTINGS_H #define CSETTINGS_H class MdiChild; #include <QDialog> #include <QString> #include "ui_settings.h" #ifdef HAVE_CONFIG_H #include "config.h" #endif #include "gvc.h" /* #include "gvio.h" */ class CFrmSettings : public QDialog { Q_OBJECT public: CFrmSettings(); int runSettings(Mdi...
Add helper macro to log scope entry and exit
//---------------------------------------------------------------------------- // // "Copyright Centre National d'Etudes Spatiales" // // License: LGPL-2 // // See LICENSE.txt file in the top level directory for more details. // //---------------------------------------------------------------------------- // $Id$ #...
Add memory control method to support OneNAND sync burst read
/* * linux/include/asm-arm/mach/flash.h * * Copyright (C) 2003 Russell King, All Rights Reserved. * * 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 ASMARM_MACH_FLA...
/* * linux/include/asm-arm/mach/flash.h * * Copyright (C) 2003 Russell King, All Rights Reserved. * * 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 ASMARM_MACH_FLA...
Test showing no flow through aggregate init
void sink(void *o); void *user_input(void); struct AB { void *a; void *b; }; struct Outer { struct AB nestedAB; struct AB *pointerAB; }; void absink(struct AB *ab) { sink(ab->a); // flow x3 [NOT DETECTED] sink(ab->b); // no flow } int struct_init(void) { struct AB ab = { user_input(), 0 }; sink(ab....
Make some change to check if new branch is created.
#pragma once //MathLib.h #ifndef _MATHLIB_ #define _MATHLIB_ #endif
#pragma once //MathLib.h #ifndef _MATHLIB_ #define _MATHLIB_ //Make some change to check if new branch is created. #endif
Add test that passes union to unknown function
#include <stdlib.h> #include <stdio.h> typedef struct list { int val; struct list *next; } list_t; typedef union either { int value; struct list node; } either_t; // void mutate_either(either_t e){ // list_t *next = e.node.next; // next->val = 42; // } int main(){ list_t first; lis...
Move to namespace include/use model
#ifndef ZEPHYR_CEXPORT_H #define ZEPHYR_CEXPORT_H #ifdef __cplusplus #define Z_VAR(ns, n) n #else #define Z_VAR(ns, n) ns ## _ ## n #endif #ifdef __cplusplus #define Z_NS_START(n) namespace n { #define Z_NS_END } #else #define Z_NS_START(n) #define Z_NS_END #endif #ifdef __cplusplus #define Z_ENUM_CLASS(ns, n) enum ...
#ifndef ZEPHYR_CEXPORT_H #define ZEPHYR_CEXPORT_H /* declare a namespaced name */ #ifdef __cplusplus #define ZD(ns) #else #define ZD(ns) ns_ #endif /* use a namespaced name */ #ifdef __cplusplus #define ZU(ns) ns:: #else #define ZU(ns) ns_ #endif /* declare a namespace */ #ifdef __cplusplus #define Z_NS_START(n) nam...
Change the function of find_tree_path
#ifndef __GRAPH_H__ #define __GRAPH_H__ #include "resources.h" class graph { private: //For data structures struct vertex; struct edge { vertex *endpoint; edge *opposite_edge, *next_edge; double direction; bool in_tree; uint index; conductor_info elect_info; edge(); }; struct vertex { edge *firs...
#ifndef __GRAPH_H__ #define __GRAPH_H__ #include "resources.h" class graph { private: //For data structures struct vertex; struct edge { vertex *endpoint; edge *opposite_edge, *next_edge; double direction; bool in_tree; uint index; conductor_info elect_info; edge(); }; struct vertex { edge *firs...
Test use of arm_neon.h with -fno-lax-vector-conversions.
// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s // RUN: %clang_cc1 -x c++ -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s #include <arm_neon.h> // Radar 8228022: Should not report incompatible vect...
// RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -Wvector-conversions -verify %s // RUN: %clang_cc1 -triple thumbv7-apple-darwin10 -target-cpu cortex-a8 -fsyntax-only -fno-lax-vector-conversions -verify %s // RUN: %clang_cc1 -x c++ -triple thumbv7-apple-darwin10 -target-cpu cortex-a...
Add valuetype as "standard" type
#ifndef JIVE_VSDG_TYPES_H #define JIVE_VSDG_TYPES_H #include <jive/vsdg/basetype.h> #include <jive/vsdg/statetype.h> #include <jive/vsdg/controltype.h> #endif
#ifndef JIVE_VSDG_TYPES_H #define JIVE_VSDG_TYPES_H #include <jive/vsdg/basetype.h> #include <jive/vsdg/statetype.h> #include <jive/vsdg/controltype.h> #include <jive/vsdg/valuetype.h> #endif
Add a simple server abstraction.
#ifndef IO_SOCKET_SIMPLE_SERVER_H #define IO_SOCKET_SIMPLE_SERVER_H #include <io/socket/socket.h> /* * XXX * This is just one level up from using macros. Would be nice to use abstract * base classes and something a bit tidier. */ template<typename A, typename C, typename L> class SimpleServer { LogHandle log_; ...
Remove unnecessary inclusion of dst.h
#ifndef _NET_EVENT_H #define _NET_EVENT_H /* * Generic netevent notifiers * * Authors: * Tom Tucker <tom@opengridcomputing.com> * Steve Wise <swise@opengridcomputing.com> * * Changes: */ #ifdef __KERNEL__ #include <net/dst.h> struct netevent_redirect { struct dst_entry *...
#ifndef _NET_EVENT_H #define _NET_EVENT_H /* * Generic netevent notifiers * * Authors: * Tom Tucker <tom@opengridcomputing.com> * Steve Wise <swise@opengridcomputing.com> * * Changes: */ #ifdef __KERNEL__ struct dst_entry; struct netevent_redirect { struct dst_entry *old...
Fix for older MSVC compilers without operator<< for long longs (not tested on MSVC6)
#ifndef LOG_H #define LOG_H #include "types.h" #include <fstream> class Statement; class Exp; class LocationSet; class RTL; class Log { public: Log() { } virtual Log &operator<<(const char *str) = 0; virtual Log &operator<<(Statement *s); virtual Log &operator<<(Exp *e); virtual Log &operator<<(RTL *r); virt...
#ifndef LOG_H #define LOG_H #include "types.h" #include <fstream> class Statement; class Exp; class LocationSet; class RTL; class Log { public: Log() { } virtual Log &operator<<(const char *str) = 0; virtual Log &operator<<(Statement *s); virtual Log &operator<<(Exp *e); virtual Log &operator<<(RTL *r); virt...
Remove private headers from global public header
#ifndef StateMachine_StateMachine_h #define StateMachine_StateMachine_h #import "LSStateMachine.h" #import "LSEvent.h" #import "LSTransition.h" #import "LSStateMachineMacros.h" #endif
#ifndef StateMachine_StateMachine_h #define StateMachine_StateMachine_h #import "LSStateMachine.h" #import "LSStateMachineMacros.h" #endif
Make code not have a -Warray-parameter warning.
#ifndef SANDBOXED_API_SANDBOX2_SYSCALL_DEFS_H_ #define SANDBOXED_API_SANDBOX2_SYSCALL_DEFS_H_ #include <sys/types.h> #include <cstdint> #include <string> #include <vector> #include "absl/strings/string_view.h" #include "absl/types/span.h" #include "sandboxed_api/config.h" #include "sandboxed_api/sandbox2/syscall.h" ...
#ifndef SANDBOXED_API_SANDBOX2_SYSCALL_DEFS_H_ #define SANDBOXED_API_SANDBOX2_SYSCALL_DEFS_H_ #include <sys/types.h> #include <cstdint> #include <string> #include <vector> #include "absl/strings/string_view.h" #include "absl/types/span.h" #include "sandboxed_api/config.h" #include "sandboxed_api/sandbox2/syscall.h" ...
Add Notifier base class, complements Observer
#ifndef TE_OBSERVER_H #define TE_OBSERVER_H namespace te { template <class EventType> class Observer { public: virtual ~Observer() {} virtual void onNotify(const EventType& evt) = 0; }; } #endif
#ifndef TE_OBSERVER_H #define TE_OBSERVER_H #include <vector> #include <memory> #include <cassert> namespace te { template <class EventType> class Observer { public: virtual ~Observer() {} virtual void onNotify(const EventType& evt) = 0; }; template <class EventType> class Notifier {...
Update slide event method definition
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #include <Windows.h> #include <CommCtrl.h> #include "Control.h" class Slider : public Control { public: Slider(int id, DialogBase &parent) : Control(id, parent, false) { } ...
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once #include <Windows.h> #include <CommCtrl.h> #include "Control.h" class Slider : public Control { public: Slider(int id, DialogBase &parent) : Control(id, parent, false) { } ...
Add WBS support on Bluedroid (1/6)
/* * Copyright 2013 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 applica...
/* * Copyright 2013 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 applica...
Set a default value for boolean options (false).
#ifndef MLPACK_IO_OPTION_IMPL_H #define MLPACK_IO_OPTION_IMPL_H #include "io.h" namespace mlpack { /* * @brief Registers a parameter with IO. * This allows the registration of parameters at program start. */ template<typename N> Option<N>::Option(bool ignoreTemplate, N defaultValue, ...
#ifndef MLPACK_IO_OPTION_IMPL_H #define MLPACK_IO_OPTION_IMPL_H #include "io.h" namespace mlpack { /* * @brief Registers a parameter with IO. * This allows the registration of parameters at program start. */ template<typename N> Option<N>::Option(bool ignoreTemplate, N defaultValue, ...
Add TMCVerbose to the list of mc classes
// @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 08:46:10 brun Exp $ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ global gMC; #pragma link C++ enum PDG_t; #pragma link C++ enum TMCProcess; #pragma link C++ class TVirtualMC+; ...
// @(#)root/mc:$Name: $:$Id: LinkDef.h,v 1.2 2002/04/26 09:25:02 brun Exp $ #ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ global gMC; #pragma link C++ enum PDG_t; #pragma link C++ enum TMCProcess; #pragma link C++ class TVirtualMC+; ...
Remove friend function in FFTServer.
#ifndef FFTW_HAO_H #define FFTW_HAO_H #include "fftw_define.h" class FFTServer { int dimen; int* n; int L; std::complex<double>* inforw; std::complex<double>* outforw; std::complex<double>* inback; std::complex<double>* outback; fftw_plan planforw; fftw_plan planback; public: ...
#ifndef FFTW_HAO_H #define FFTW_HAO_H #include "fftw_define.h" class FFTServer { public: int dimen; int* n; int L; std::complex<double>* inforw; std::complex<double>* outforw; std::complex<double>* inback; std::complex<double>* outback; fftw_plan planforw; fftw_plan planback; ...
Remove some of ACPICA's x32 support
#include <stdarg.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> #define ACPI_MACHINE_WIDTH __INTPTR_WIDTH__ #define ACPI_SINGLE_THREADED #define ACPI_USE_LOCAL_CACHE #define ACPI_USE_NATIVE_DIVIDE #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #undef ACPI_GET_FUNCTION_NAME #ifdef ACPI_FULL_DEBU...
#include <stdarg.h> #include <stdbool.h> #include <stddef.h> #include <stdint.h> #define ACPI_MACHINE_WIDTH __INTPTR_WIDTH__ #define ACPI_SINGLE_THREADED #define ACPI_USE_LOCAL_CACHE #define ACPI_USE_NATIVE_DIVIDE #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #undef ACPI_GET_FUNCTION_NAME #ifdef ACPI_FULL_DEBU...
Add Visual Studio 2013 fix from omnus
#ifndef _client_h_ #define _client_h_ #define DEFAULT_PORT 4080 void client_enable(); void client_disable(); int get_client_enabled(); void client_connect(char *hostname, int port); void client_start(); void client_stop(); void client_send(char *data); char *client_recv(); void client_version(int version); void clien...
#ifndef _client_h_ #define _client_h_ #ifdef _MSC_VER #define snprintf _snprintf #endif #define DEFAULT_PORT 4080 void client_enable(); void client_disable(); int get_client_enabled(); void client_connect(char *hostname, int port); void client_start(); void client_stop(); void client_send(char *data); char *clie...
Update prototype of maskInterrupt to match implementations.
/* * Copyright 2014, General Dynamics C4 Systems * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(GD_GPL) */ #ifndef __MACHINE_HARDWARE_H #define __MACHINE_H...
/* * Copyright 2014, General Dynamics C4 Systems * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(GD_GPL) */ #ifndef __MACHINE_HARDWARE_H #define __MACHINE_H...
Fix bug in parser tests
#include "parser.h" #include "ast.h" #include "tests.h" void test_parse_number(); int main() { test_parse_number(); return 0; } struct token *make_token(enum token_type tk_type, char* str, double dbl, int number) { struct token *tk = malloc(sizeof(struct token)); tk->type = tk_type; if (t...
#include "parser.h" #include "ast.h" #include "tests.h" void test_parse_number(); int main() { test_parse_number(); return 0; } struct token *make_token(enum token_type tk_type, char* str, double dbl, int number) { struct token *tk = malloc(sizeof(struct token)); tk->type = tk_type; if (t...
Fix release mode compile error.
// Copyright (c) 2012 The WebM project authors. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the LICENSE file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing projec...
// Copyright (c) 2012 The WebM project authors. All Rights Reserved. // // Use of this source code is governed by a BSD-style license // that can be found in the LICENSE file in the root of the source // tree. An additional intellectual property rights grant can be found // in the file PATENTS. All contributing projec...
Add list LinkDef file for JPetTreeHeader
#ifdef __CINT__ #pragma link off all globals; #pragma link off all classes; #pragma link off all functions; #pragma link C++ nestedclasses; #pragma link C++ struct JPetTreeHeader::ProcessingStageInfo+; #pragma link C++ class JPetTreeHeader; #endif
Add C implementation for problem 4.
#include <stdio.h> #include <stdlib.h> #include <string.h> void reverse_string(char *str){ // skip null if (str == 0){ return; } // skip empty string if (*str == 0){ return; } // get range char *start = str; char *end = start + strlen(str) - 1; // -1 for \0 char temp; // reverse ...