Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Remove duplicate comment from the c file
#include <math.h> #include "gauge.h" /** * Initializes the gauge struct * @arg gauge The gauge struct to initialize * @return 0 on success. */ int init_gauge(gauge_t *gauge) { gauge->count = 0; gauge->sum = 0; gauge->value = 0; return 0; } /** * Adds a new sample to the struct * @arg gauge The g...
#include <math.h> #include "gauge.h" int init_gauge(gauge_t *gauge) { gauge->count = 0; gauge->sum = 0; gauge->value = 0; return 0; } int gauge_add_sample(gauge_t *gauge, double sample, bool delta) { if (delta) { gauge->value += sample; } else { gauge->value = sample; } ...
Make portable unit tests default on all platforms. (vs CPPUNIT)
// // // Copyright (C) 2010 SIPfoundry Inc. // Licensed by SIPfoundry under the LGPL license. // // Copyright (C) 2010 SIPez LLC All rights reserved. // Licensed to SIPfoundry under a Contributor Agreement. // // $$ // Author: Daniel Petrie // dpetrie AT SIPez DOT com //////////////////////////////////////////...
// // // Copyright (C) 2010-2016 SIPez LLC. All rights reserved. // // $$ // Author: Daniel Petrie // dpetrie AT SIPez DOT com ////////////////////////////////////////////////////////////////////////////// #ifndef _sipxunittests_h_ #define _sipxunittests_h_ //#if !defined(NO_CPPUNIT) && defined(ANDROID) #d...
Replace getcpy() with mh_xstrdup() where the string isn't NULL.
/* * getarguments.c -- Get the argument vector ready to go. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include <h/mh.h> #include <h/utils.h> char ** getarguments (char *invo_name, ...
/* * getarguments.c -- Get the argument vector ready to go. * * This code is Copyright (c) 2002, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for * complete copyright information. */ #include <h/mh.h> #include <h/utils.h> char ** getarguments (char *invo_name, ...
Add the reading and printing of the matrix.
/* Student: Szogyenyi Zoltan Anul: I Materie: Stagiu de Practica Limbaj de programare: C Data: Martie 21 2015 - Sambata 2. Se citesc de la tastatură elementele unei matrici de caractere (nr. linii=nr. coloane), A(NxN), N<=10. a) Să se afişeze matricea A; b) ...
Update the driver version to 8.04.00.13-k.
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.04.00.08-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 4 #define QLA_DRIVER_PATCH_VER 0 #defi...
/* * QLogic Fibre Channel HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla2xxx for copyright and licensing details. */ /* * Driver version */ #define QLA2XXX_VERSION "8.04.00.13-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 4 #define QLA_DRIVER_PATCH_VER 0 #defi...
Update driver version to 5.03.00-k7
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2012 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.03.00-k6"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2012 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.03.00-k7"
Change property attribute to strong
// // BNCDeviceInfo.h // Branch-TestBed // // Created by Sojan P.R. on 3/22/16. // Copyright © 2016 Branch Metrics. All rights reserved. // #import <Foundation/Foundation.h> #ifndef BNCDeviceInfo_h #define BNCDeviceInfo_h #endif /* BNCDeviceInfo_h */ @interface BNCDeviceInfo : NSObject //---------Properties---...
// // BNCDeviceInfo.h // Branch-TestBed // // Created by Sojan P.R. on 3/22/16. // Copyright © 2016 Branch Metrics. All rights reserved. // #import <Foundation/Foundation.h> #ifndef BNCDeviceInfo_h #define BNCDeviceInfo_h #endif /* BNCDeviceInfo_h */ @interface BNCDeviceInfo : NSObject //---------Properties---...
Switch hash map class to a flat hash map
#ifndef JTL_HASH_MAP_H__ #define JTL_HASH_MAP_H__ #include <memory> namespace jtl { template <typename Key, typename Value> class HashMap { struct MapNode { MapNode(Key k, Value v) : key(k), value(v) {} ~MapNode() { delete key; delete value; } Key key; Value value; }; /...
#ifndef JTL_FLAT_HASH_MAP_H__ #define JTL_FLAT_HASH_MAP_H__ #include <memory> #include <cctype> namespace jtl { template <typename Key> struct Hash { using argument_type = Key; using result_type = std::size_t; result_type operator()(const Key& k); }; // struct Hash template <typename Key, typename V...
Add instance var for hotkey arguments
#pragma once #include <vector> class HotkeyInfo { public: enum HotkeyActions { IncreaseVolume, DecreaseVolume, SetVolume, Mute, VolumeSlider, RunApp, Settings, Exit, }; static std::vector<std::wstring> ActionNames; public: int keyCombina...
#pragma once #include <vector> class HotkeyInfo { public: enum HotkeyActions { IncreaseVolume, DecreaseVolume, SetVolume, Mute, VolumeSlider, RunApp, Settings, Exit, }; static std::vector<std::wstring> ActionNames; public: int keyCombina...
Fix build error with import
// // CRToast // Copyright (c) 2014-2015 Collin Ruffenach. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for CRToast. FOUNDATION_EXPORT double CRToastVersionNumber; //! Project version string for CRToast. FOUNDATION_EXPORT const unsigned char CRToastVersionString[]; // In this header,...
// // CRToast // Copyright (c) 2014-2015 Collin Ruffenach. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for CRToast. FOUNDATION_EXPORT double CRToastVersionNumber; //! Project version string for CRToast. FOUNDATION_EXPORT const unsigned char CRToastVersionString[]; // In this header,...
Make the genericPage methods activate and deactivate widgets public instead of protected.
/* * dialer - MeeGo Voice Call Manager * Copyright (c) 2009, 2010, Intel Corporation. * * This program is licensed under the terms and conditions of the * Apache License, version 2.0. The full text of the Apache License is at * http://www.apache.org/licenses/LICENSE-2.0 * */ #ifndef GENERICPAGE_H #define GENE...
/* * dialer - MeeGo Voice Call Manager * Copyright (c) 2009, 2010, Intel Corporation. * * This program is licensed under the terms and conditions of the * Apache License, version 2.0. The full text of the Apache License is at * http://www.apache.org/licenses/LICENSE-2.0 * */ #ifndef GENERICPAGE_H #define GENE...
Support for MS Visual Studio 2008.
#ifndef __SimpleITKMacro_h #define __SimpleITKMacro_h #include <stdint.h> #include <itkImageBase.h> #include <itkImage.h> #include <itkLightObject.h> #include <itkSmartPointer.h> // Define macros to aid in the typeless layer typedef itk::ImageBase<3> SimpleImageBase; namespace itk { namespace simple { // To a...
#ifndef __SimpleITKMacro_h #define __SimpleITKMacro_h // Ideally, take the types from the C99 standard. However, // VS 8 does not have stdint.h, but they are defined anyway. #ifndef _MSC_VER #include <stdint.h> #endif #include <itkImageBase.h> #include <itkImage.h> #include <itkLightObject.h> #include <itkSmartPoi...
Fix this XTARGET so that this does doesn't XPASS on non-darwin hosts.
// RUN: %llvmgcc %s -c -m32 -fasm-blocks -o /dev/null // This should not warn about unreferenced label. 7729514. // XFAIL: * // XTARGET: i386-apple-darwin,x86_64-apple-darwin,i686-apple-darwin void quarterAsm(int array[], int len) { __asm { mov esi, array; mov ecx, len; shr ecx, 2; loop: movdqa xmm...
// RUN: %llvmgcc %s -c -m32 -fasm-blocks -o /dev/null // This should not warn about unreferenced label. 7729514. // XFAIL: * // XTARGET: x86,i386,i686 void quarterAsm(int array[], int len) { __asm { mov esi, array; mov ecx, len; shr ecx, 2; loop: movdqa xmm0, [esi]; psrad xmm0, 2; movdqa [e...
Add interface for stream cipher
// MIT License // Copyright (c) 2017 Zhuhao Wang // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, mer...
Fix type mismatch between property and ivar
// // MustacheToken.h // OCMustache // // Created by Wesley Moore on 31/10/10. // Copyright 2010 Wesley Moore. All rights reserved. // #import <Foundation/Foundation.h> enum mustache_token_type { mustache_token_type_etag = 1, // Escaped tag mustache_token_type_utag, // Unescaped tag mustache_token_type_section...
// // MustacheToken.h // OCMustache // // Created by Wesley Moore on 31/10/10. // Copyright 2010 Wesley Moore. All rights reserved. // #import <Foundation/Foundation.h> enum mustache_token_type { mustache_token_type_etag = 1, // Escaped tag mustache_token_type_utag, // Unescaped tag mustache_token_type_section...
Add unitconverter include to gmx top reader
/* * Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org) * * 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 * * Unle...
/* * Copyright 2009-2019 The VOTCA Development Team (http://www.votca.org) * * 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 * * Unle...
Change incorrect prototype from 'dram_init(void)' to 'dram_cartridge_init(void)'
/* * Copyright (c) 2012 Israel Jacques * See LICENSE for details. * * Israel Jacques <mrko@eecs.berkeley.edu> */ #ifndef _DRAM_CARTRIDGE_H__ #define _DRAM_CARTRIDGE_H__ extern void dram_init(void); #endif /* !_DRAM_CARTRIDGE_H_
/* * Copyright (c) 2012 Israel Jacques * See LICENSE for details. * * Israel Jacques <mrko@eecs.berkeley.edu> */ #ifndef _DRAM_CARTRIDGE_H__ #define _DRAM_CARTRIDGE_H__ extern void dram_cartridge_init(void); #endif /* !_DRAM_CARTRIDGE_H_
Test for shift by negative
// PARAM: --enable ana.int.interval --enable exp.partition-arrays.enabled --set ana.activated "['base', 'mallocWrapper']" int main(void) { // Shifting by a negative number is UB, but we should still not crash on it, but go to top instead int v = -1; int r = 17; int u = r >> v; }
Change hard limit on heap
/* * Copyright (c) 2012 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <mrkotfw@gmail.com> */ #ifndef _SLOB_H_ #define _SLOB_H_ #include <stddef.h> /*- * Restrictions * * 1. Allocation requests bigger than SLOB_PAGE_BREAK_2ND cannot be * serviced. This is due to the memory block manager...
/* * Copyright (c) 2012 Israel Jacquez * See LICENSE for details. * * Israel Jacquez <mrkotfw@gmail.com> */ #ifndef _SLOB_H_ #define _SLOB_H_ #include <stddef.h> /*- * Restrictions * * 1. Heap size limit: Allocation requests bigger than * SLOB_PAGE_BREAK_2ND cannot be serviced. This is due to the * ...
Add further issue with recursion
// PARAM: --sets solver td3 --set ana.activated "['base','threadid','threadflag','octagon','mallocWrapper']" // Example from https://github.com/sosy-lab/sv-benchmarks/blob/master/c/recursive-simple/afterrec_2calls-1.c void f(int); void f2(int); void f(int n) { if (n<3) return; n--; f2(n); assert(1); } void f...
Fix dll import name error[132001]
#ifndef MUSICMOBILEGLOBALDEFINE_H #define MUSICMOBILEGLOBALDEFINE_H /* ================================================= * This file is part of the TTK Music Player project * Copyright (c) 2015 - 2017 Greedysky Studio * All rights reserved! * Redistribution and use of the source code or any derivative * works are...
#ifndef MUSICMOBILEGLOBALDEFINE_H #define MUSICMOBILEGLOBALDEFINE_H /* ================================================= * This file is part of the TTK Music Player project * Copyright (c) 2015 - 2017 Greedysky Studio * All rights reserved! * Redistribution and use of the source code or any derivative * works are...
Boost json::spirit support for mArrays and mObjects
#include <json_spirit.h> namespace sqlite { // json_spirit::mArray template<> void get_col_from_db(database_binder& db, int inx, json_spirit::mArray& a) { json_spirit::mValue tmp; std::string str((char*)sqlite3_column_blob(db._stmt, inx), sqlite3_column_bytes(db._stmt, inx)); json_spirit::read(str, tmp); ...
Initialize global var to avoid macOS linker error
/*------------------------------------------------------------------------- * * resource_manager.c * GPDB resource manager code. * * * Copyright (c) 2006-2017, Greenplum inc. * * ------------------------------------------------------------------------- */ #include "postgres.h" #include "utils/guc.h" #inclu...
/*------------------------------------------------------------------------- * * resource_manager.c * GPDB resource manager code. * * * Copyright (c) 2006-2017, Greenplum inc. * * ------------------------------------------------------------------------- */ #include "postgres.h" #include "utils/guc.h" #inclu...
Use WALL time for timer
#include <stdio.h> #include <time.h> int multiples_three_five(int limit) { long total = 0; int i; for (i=1; i < limit; i++) total += i % 3 == 0 || i % 5 == 0 ? i : 0; return total; } int main(void) { clock_t start, stop; start = clock(); long ans = multiples_three_five(1000); ...
#include <time.h> #include <stdio.h> #define NANO 10000000000 int multiples_three_five(int limit) { long total = 0; for (int i=1; i < limit; i++) total += i % 3 == 0 || i % 5 == 0 ? i : 0; return total; } int main(void) { struct timespec start; clock_gettime(CLOCK_REALTIME, &start); ...
Use condor_commands.h instead of defining commands here.
#ifndef __COLLECTOR_H__ #define __COLLECTOR_H__ #include "sched.h" enum AdTypes { STARTD_AD, SCHEDD_AD, MASTER_AD, GATEWAY_AD, CKPT_SRVR_AD, NUM_AD_TYPES }; // collector commands const int UPDATE_STARTD_AD = 0; const int UPDATE_SCHEDD_AD = 1; const int UPDATE_MASTER_AD = 2;...
#ifndef __COLLECTOR_H__ #define __COLLECTOR_H__ #include "sched.h" enum AdTypes { STARTD_AD, SCHEDD_AD, MASTER_AD, GATEWAY_AD, CKPT_SRVR_AD, NUM_AD_TYPES }; #include "condor_commands.h" // collector commands #endif // __COLLECTOR_H__
Update doxygen documentation on HMAC
/** * @file * Hashing module documentation file. */ /** * @addtogroup hashing_module Hashing module * * The Hashing module provides one-way hashing functions. Such functions can be * used for creating a hash message authentication code (HMAC) when sending a * message. Such a HMAC can be used in combination wit...
/** * @file * Hashing module documentation file. */ /** * @addtogroup hashing_module Hashing module * * The Hashing module provides one-way hashing functions. Such functions can be * used for creating a hash message authentication code (HMAC) when sending a * message. Such a HMAC can be used in combination wit...
Extend list of intel registers
enum args { AIMM = 1, AIMM8, AIMM16, AIMM32, AIMM64, AREG_AX, AREG_AL, AREG_AH, AREG_EAX, AREG_BC, AREG_BL, AREG_BH, AREG_EBX, AREG_CX, AREG_CL, AREG_CH, AREG_ECX, AREG_DX, AREG_DL, AREG_DH, AREG_EDX, AREG_SI, AREG_DI, AREG_SP, AREG_ESP, AREG_EBP, ...
enum args { AIMM = 1, AIMM8, AIMM16, AIMM32, AIMM64, AREG_CS, AREG_DS, AREG_SS, AREG_ES AREG_FS, AREG_GS, AREG_EFLAGS, AREG_AX, AREG_AL, AREG_AH, AREG_EAX, AREG_RAX, AREG_BX, AREG_BL, AREG_BH, AREG_EBX, AREG_RBX, AREG_CX, AREG_CL, AREG_CH, AREG_ECX, A...
Add raw array access to hsv structure, and operator[] operations to hsv and rgb classes
#ifndef __INC_PIXELS_H #define __INC_PIXELS_H #include <stdint.h> struct CRGB { union { struct { uint8_t r; uint8_t g; uint8_t b; }; uint8_t raw[3]; }; }; #ifdef SUPPORT_ARGB struct CARGB { union { struct { uint8_t a; uint8_t g; uint8_t r; uint8_t b; }; uint8_t raw[4]; uint32_t all32; }; }; #endif ...
#ifndef __INC_PIXELS_H #define __INC_PIXELS_H #include <stdint.h> struct CRGB { union { struct { uint8_t r; uint8_t g; uint8_t b; }; uint8_t raw[3]; }; inline uint8_t& operator[] (uint8_t x) __attribute__((always_inline)) { return raw[x]; } }; #ifdef SUPPORT_ARGB struct CARGB { union { struct { uint8_t a;...
Make creator compile without being on ahiemstra's machine ;)
/* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied ...
/* This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied ...
Correct this test for the fact that the number of uses is now printed in a comment.
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o %t %s // RUN: grep 'declare i32 @f0() readnone$' %t // RUN: grep 'declare i32 @f1() readonly$' %t // RUN: grep 'declare void @f2(.* sret)$' %t // RUN: grep 'declare void @f3(.* sret)$' %t // RUN: grep 'declare void @f4(.* byval)$' %t // RUN: grep 'declare void ...
// RUN: %clang_cc1 -triple i386-pc-linux-gnu -emit-llvm -o %t %s // RUN: grep 'declare i32 @f0() readnone ;' %t // RUN: grep 'declare i32 @f1() readonly ;' %t // RUN: grep 'declare void @f2(.* sret) ;' %t // RUN: grep 'declare void @f3(.* sret) ;' %t // RUN: grep 'declare void @f4(.* byval) ;' %t // RUN: grep 'declare ...
Add alias for invalid event ID.
#ifndef VAST_ALIASES_H #define VAST_ALIASES_H #include <cstdint> #include <limits> namespace vast { /// Uniquely identifies a VAST event. using event_id = uint64_t; /// The smallest possible event ID. static constexpr event_id min_event_id = 1; /// The largest possible event ID. static constexpr event_id max_event...
#ifndef VAST_ALIASES_H #define VAST_ALIASES_H #include <cstdint> #include <limits> namespace vast { /// Uniquely identifies a VAST event. using event_id = uint64_t; /// The invalid event ID. static constexpr event_id invalid_event_id = 0; /// The smallest possible event ID. static constexpr event_id min_event_id =...
Change client version number to 1.2.0.0
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning and copyright year // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 1 #define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_BUILD ...
#ifndef CLIENTVERSION_H #define CLIENTVERSION_H // // client versioning and copyright year // // These need to be macros, as version.cpp's and bitcoin-qt.rc's voodoo requires it #define CLIENT_VERSION_MAJOR 1 #define CLIENT_VERSION_MINOR 2 #define CLIENT_VERSION_REVISION 0 #define CLIENT_VERSION_BUILD ...
Use typedef for reading struct
#ifndef GH_DATASTORE_H #define GH_DATASTORE_H #include <sqlite3.h> struct reading { int id; char *title; int readmill_id; int total_pages; }; sqlite3 *gh_datastore_open_db (char *data_dir); int gh_datastore_get_db_version (sqlite3 *db); void gh_datastore_set_db_version (sqlite3 *db, int version); #en...
#ifndef GH_DATASTORE_H #define GH_DATASTORE_H #include <sqlite3.h> typedef struct { int id; char *title; int readmill_id; int total_pages; } Reading; sqlite3 *gh_datastore_open_db (char *data_dir); int gh_datastore_get_db_version (sqlite3 *db); void gh_datastore_set_db_version (sqlite3 *db, int versio...
Add ABI check for syscall numbers definitions
// 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. // This header will be kept up to date so that we can compile system-call // policies even when system headers are old. // System call numbers are acc...
// 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. // This header will be kept up to date so that we can compile system-call // policies even when system headers are old. // System call numbers are acc...
Add class for representing a Grid on the device
#ifndef GRIDINF_INCLUDE_GPUGRID_H #define GRIDINF_INCLUDE_GPUGRID_H #include "matdim.h" namespace ginf { // Mirrors the Grid class, but uses an implementation that is more suitable for GPUs. template <typename T> class GpuGrid { public: int smModel; // The smoothness cost model MatDim dimDt, dimSm; // Dimensi...
Add to comments; remove use of sinfo from calling routines; adjust code to play well with other routing functions; add framework for handling loops
/* $Id$Revision: */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c)...
/* $Id$Revision: */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (c)...
Fix a static analyzer error
// // ArticleCellView.h // PXListView // // Adapted from PXListView by Alex Rozanski // Modified by Barijaona Ramaholimihaso // #import <Cocoa/Cocoa.h> #import "PXListViewCell.h" #import "ArticleView.h" @interface ArticleCellView : PXListViewCell { AppController * controller; ArticleView *articleView; NSProg...
// // ArticleCellView.h // PXListView // // Adapted from PXListView by Alex Rozanski // Modified by Barijaona Ramaholimihaso // #import <Cocoa/Cocoa.h> #import "PXListViewCell.h" #import "ArticleView.h" @interface ArticleCellView : PXListViewCell { AppController * controller; ArticleView *articleView; NSProg...
Use http_headers.h to define HTTP header tags for logging
/* * $Id$ * * Define the tags in the shared memory in a reusable format. * Whoever includes this get to define what the SLTM macro does. * */ SLTM(CLI) SLTM(SessionOpen) SLTM(SessionClose) SLTM(ClientAddr) SLTM(Request) SLTM(URL) SLTM(Protocol) SLTM(Headers)
/* * $Id$ * * Define the tags in the shared memory in a reusable format. * Whoever includes this get to define what the SLTM macro does. * */ SLTM(CLI) SLTM(SessionOpen) SLTM(SessionClose) SLTM(ClientAddr) SLTM(Request) SLTM(URL) SLTM(Protocol) SLTM(H_Unknown) #define HTTPH(a, b) SLTM(b) #include "http_headers.h...
Add prototypes for functions for parsing slave's responses
#define _MASTERCOILS #include <inttypes.h> //Functions for building requests extern uint8_t MODBUSBuildRequest01( uint8_t, uint16_t, uint16_t ); extern uint8_t MODBUSBuildRequest05( uint8_t, uint16_t, uint16_t ); extern uint8_t MODBUSBuildRequest15( uint8_t, uint16_t, uint16_t, uint8_t * ); //Functions for parsing r...
#define _MASTERCOILS #include <inttypes.h> //Functions for building requests extern uint8_t MODBUSBuildRequest01( uint8_t, uint16_t, uint16_t ); extern uint8_t MODBUSBuildRequest05( uint8_t, uint16_t, uint16_t ); extern uint8_t MODBUSBuildRequest15( uint8_t, uint16_t, uint16_t, uint8_t * ); //Functions for parsing r...
Remove manual addObject usage from the collector
#include <unordered_set> #include "../src/include/gc_obj.h" #include "../src/include/collector.h" class BinaryTreeNode : public gc_obj { public: BinaryTreeNode(const int id); ~BinaryTreeNode() = delete; int size() const; void curtailToLevel(const int lvl); void extendToLevel(const int size,Collector* collector);...
#include <unordered_set> #include "../src/include/gc_obj.h" class BinaryTreeNode : public gc_obj { public: BinaryTreeNode(const int id); int size() const; void curtailToLevel(const int lvl); void extendToLevel(const int size); void addLeftChild(BinaryTreeNode* leftChild); void addRightChild(BinaryTreeNode* righ...
Add Q_OBJECT macro (requested by lupdate).
// // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2009 Bastian Holst <bastianholst@gmx.de> // #ifndef BBCWEATHERITEM_H #define BBCWE...
// // This file is part of the Marble Virtual Globe. // // This program is free software licensed under the GNU LGPL. You can // find a copy of this license in LICENSE.txt in the top directory of // the source code. // // Copyright 2009 Bastian Holst <bastianholst@gmx.de> // #ifndef BBCWEATHERITEM_H #define BBCWE...
Create headers for ImageFilter and EmoticonFilter
#include "message-processor.h" class UrlFilter : public AbstractMessageFilter { virtual void filterMessage(Message& message); };
#include "message-processor.h" class UrlFilter : public AbstractMessageFilter { virtual void filterMessage(Message& message); }; class ImageFilter : public AbstractMessageFilter { virtual void filterMessage(Message& message); }; class EmoticonFilter : public AbstractMessageFilter { virtual void filterMe...
UPDATE some variable name changes
#ifndef SSPAPPLICATION_DEBUG_DEBUGHANDLER_H #define SSPAPPLICATION_DEBUG_DEBUGHANDLER_H #include <vector> #include <iostream> #include <Windows.h> class DebugHandler { private: std::vector<LARGE_INTEGER> m_timers; std::vector<std::string> m_labels; std::vector<unsigned short int> m_timerMins; std::vector<unsigned...
#ifndef SSPAPPLICATION_DEBUG_DEBUGHANDLER_H #define SSPAPPLICATION_DEBUG_DEBUGHANDLER_H #include <vector> #include <iostream> #include <Windows.h> class DebugHandler { private: std::vector<LARGE_INTEGER> m_timers; std::vector<std::string> m_labels; std::vector<unsigned short int> m_timerMins; std::vector<unsigned...
Modify set resource. Using floats now.
#include <string.h> #include "proxrcmds.h" #include "sim-hab.h" void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value) { uint8_t data; float content; int id; bionet_node_t *node; bionet_value_get_uint8(value, &data); if(data < 0 || data > 255) return; node = bionet_reso...
#include <string.h> #include "proxrcmds.h" #include "sim-hab.h" void cb_set_resource(bionet_resource_t *resource, bionet_value_t *value) { float data; float content; int id; bionet_node_t *node; bionet_value_get_float(value, &data); if(data < 0 || data > 255) return; node = bionet_resour...
Remove stack hard limit on ia64
#ifndef _ASM_IA64_RESOURCE_H #define _ASM_IA64_RESOURCE_H #include <asm/ustack.h> #define _STK_LIM_MAX DEFAULT_USER_STACK_SIZE #include <asm-generic/resource.h> #endif /* _ASM_IA64_RESOURCE_H */
#ifndef _ASM_IA64_RESOURCE_H #define _ASM_IA64_RESOURCE_H #include <asm/ustack.h> #include <asm-generic/resource.h> #endif /* _ASM_IA64_RESOURCE_H */
Decrease MAX_EDITSTR. Was way too big.
#pragma once #include <Windows.h> #include <functional> #include <string> class Control { public: Control(); Control(int id, HWND parent); ~Control(); virtual RECT Dimensions(); virtual void Enable(); virtual void Disable(); virtual bool Enabled(); virtual void Enabled(bool enabled);...
#pragma once #include <Windows.h> #include <functional> #include <string> class Control { public: Control(); Control(int id, HWND parent); ~Control(); virtual RECT Dimensions(); virtual void Enable(); virtual void Disable(); virtual bool Enabled(); virtual void Enabled(bool enabled);...
Document (lack of) character encoding rules in the API
/* * libtu/util.h * * Copyright (c) Tuomo Valkonen 1999-2002. * * You may distribute and modify this library under the terms of either * the Clarified Artistic License or the GNU LGPL, version 2.1 or later. */ #ifndef LIBTU_UTIL_H #define LIBTU_UTIL_H #include <stdarg.h> #include <stdio.h> #include <stdlib.h>...
/* * libtu/util.h * * Copyright (c) Tuomo Valkonen 1999-2002. * * You may distribute and modify this library under the terms of either * the Clarified Artistic License or the GNU LGPL, version 2.1 or later. */ #ifndef LIBTU_UTIL_H #define LIBTU_UTIL_H #include <stdarg.h> #include <stdio.h> #include <stdlib.h>...
Fix bad template SFINAE declaration
#pragma once #include <type_traits> namespace ugly { template<typename T> constexpr const bool is_enum_flag = false; template<typename T = typename std::enable_if<is_enum_flag<T>, T>::type> class auto_bool { private: T val_; public: constexpr auto_bool(T val) : val_(val) {} ...
#pragma once #include <type_traits> namespace ugly { template<typename T> constexpr const bool is_enum_flag = false; template<typename T, typename = typename std::enable_if<is_enum_flag<T>>::type> class auto_bool { private: T val_; public: constexpr auto_bool(T val) : val_(val...
Kill processes which access descendants of given directory
#include <stdlib.h> #include <stdio.h> #include <string.h> #include <dirent.h> #include <limits.h> /** * kill processes which access descendants of given directory */ int is_number(const char *s) { size_t i, len = strlen(s); for (i = 0; i < len; i++) { if (!isdigit(s[i])) return 0; } return 1; } void kill...
Add some more print statements to this test, just to help differentiate the output when debugging is enabled
/* * Copyright © 2009 CNRS, INRIA, Université Bordeaux 1 * Copyright © 2009 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ #include <hwloc.h> #include <stdio.h> int main(int argc, char *argv[]) { mytest_hwloc_topology_t topology; unsigned depth; hwloc_cpuset_t cpu_s...
/* * Copyright © 2009 CNRS, INRIA, Université Bordeaux 1 * Copyright © 2009 Cisco Systems, Inc. All rights reserved. * See COPYING in top-level directory. */ #include <hwloc.h> #include <stdio.h> int main(int argc, char *argv[]) { mytest_hwloc_topology_t topology; unsigned depth; hwloc_cpuset_t cpu_s...
Fix some GCC initialization warnings
#pragma once #include <vector> #include <boost/multiprecision/cpp_int.hpp> namespace dev { namespace eth { namespace jit { using byte = uint8_t; using bytes = std::vector<byte>; using u256 = boost::multiprecision::uint256_t; using bigint = boost::multiprecision::cpp_int; struct NoteChannel {}; // FIXME: Use some lo...
#pragma once #include <vector> #include <boost/multiprecision/cpp_int.hpp> namespace dev { namespace eth { namespace jit { using byte = uint8_t; using bytes = std::vector<byte>; using u256 = boost::multiprecision::uint256_t; using bigint = boost::multiprecision::cpp_int; struct NoteChannel {}; // FIXME: Use some lo...
Rename of Input to HandleInput
/****************************************************************************** GameState.h Game State Management Copyright (c) 2013 Jeffrey Carpenter Portions Copyright (c) 2013 Fielding Johnston ******************************************************************************/ #ifndef GAMEAPP_GAMESTATE_HEA...
/****************************************************************************** GameState.h Game State Management Copyright (c) 2013 Jeffrey Carpenter Portions Copyright (c) 2013 Fielding Johnston ******************************************************************************/ #ifndef GAMEAPP_GAMESTATE_HEA...
Change printf format %d -> %u
#define _BSD_SOURCE #include <stdio.h> #include <arpa/inet.h> #include <netinet/ip.h> #include "config.h" #include "common.h" void printpkt(void) { struct ip *iphdr = (struct ip *) pkt; printf("ip.version=%d " "ip.ihl=%d " "ip.tos=%02x " "ip.length=%d " "ip.id=%d " "ip.flags=%d%c%c " "ip.offset...
#define _BSD_SOURCE #include <stdio.h> #include <arpa/inet.h> #include <netinet/ip.h> #include "config.h" #include "common.h" void printpkt(void) { struct ip *iphdr = (struct ip *) pkt; printf("ip.version=%u " "ip.ihl=%u " "ip.tos=%02x " "ip.length=%u " "ip.id=%u " "ip.flags=%u%c%c " "ip.offset...
Disable function execution for now, to focus on parsing issues
// // Wasm3 - high performance WebAssembly interpreter written in C. // // Copyright © 2019 Steven Massey, Volodymyr Shymanskyy. // All rights reserved. // #include <stdint.h> #include <stddef.h> #include "wasm3.h" #define FATAL(...) __builtin_trap() int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {...
// // Wasm3 - high performance WebAssembly interpreter written in C. // // Copyright © 2019 Steven Massey, Volodymyr Shymanskyy. // All rights reserved. // #include <stdint.h> #include <stddef.h> #include "wasm3.h" #define FATAL(...) __builtin_trap() int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {...
Remove logger ids loop from sample
#ifndef MYTHREAD_H #define MYTHREAD_H #include <QThread> #include "easylogging++.h" class MyThread : public QThread { Q_OBJECT public: MyThread(int id) : threadId(id) {} private: int threadId; protected: void run() { LINFO <<"Writing from a thread " << threadId; LVERBOSE(2) << "This ...
#ifndef MYTHREAD_H #define MYTHREAD_H #include <QThread> #include "easylogging++.h" class MyThread : public QThread { Q_OBJECT public: MyThread(int id) : threadId(id) {} private: int threadId; protected: void run() { LINFO <<"Writing from a thread " << threadId; LVERBOSE(2) << "This ...
Add tools to mark a field as never-non-zero while constructed
// Copyright 2022 Google LLC // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
Add GPIO Switch first implementation
#include <stdlib.h> #include <stdio.h> #include <iostream> #include <errno.h> int main (int argc, char* argv[]){ if (argc < 2){ printf("Error, missing arguments\n"); printf("Convention: \n"); printf("./gpio_switch pin value\n"); return EXIT_SUCCESS; }else{ int valueFile; ...
Fix do_isfile to support symbolic links on Windows.
/** * \file os_isfile.c * \brief Returns true if the given file exists on the file system. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #include <sys/stat.h> #include "premake.h" int os_isfile(lua_State* L) { const char* filename = luaL_checkstring(L, 1); lua_pushboolean(L, do_...
/** * \file os_isfile.c * \brief Returns true if the given file exists on the file system. * \author Copyright (c) 2002-2008 Jason Perkins and the Premake project */ #include <sys/stat.h> #include "premake.h" int os_isfile(lua_State* L) { const char* filename = luaL_checkstring(L, 1); lua_pushboolean(L, do_...
Use a fresh version number for the trunk version
// KMail Version Information // #ifndef kmversion_h #define kmversion_h #define KMAIL_VERSION "1.8.91" #endif /*kmversion_h*/
// KMail Version Information // #ifndef kmversion_h #define kmversion_h #define KMAIL_VERSION "1.9.50" #endif /*kmversion_h*/
Use a deque instead of a list as inner cache in nested loop.
#pragma once #include <annis/types.h> #include <annis/graphstorage/graphstorage.h> #include <annis/db.h> #include <annis/iterators.h> namespace annis { class Operator; /** * A join that checks all combinations of the left and right matches if their are connected. * * @param lhsIdx the column of the ...
#pragma once #include <annis/types.h> #include <annis/graphstorage/graphstorage.h> #include <annis/db.h> #include <annis/iterators.h> #include <deque> namespace annis { class Operator; /** * A join that checks all combinations of the left and right matches if their are connected. * * @param lhsIdx t...
Add test with inconsistent IntDomain crash
// PARAM: --enable ana.int.def_exc --enable ana.int.interval --enable ana.sv-comp.functions --set sem.int.signed_overflow assume_none --set ana.int.refinement never // used to crash in branch when is_bool returned true, but to_bool returned None on (0,[1,1]) // manually minimized from sv-benchmarks/c/recursive/MultComm...
Use extern C if C++
#ifndef PATHFINDER_H_DEF #define PATHFINDER_H_DEF #include "pathfinder/mathutil.h" #include "pathfinder/structs.h" #include "pathfinder/fit.h" #include "pathfinder/spline.h" #include "pathfinder/trajectory.h" #include "pathfinder/modifiers/tank.h" #include "pathfinder/modifiers/swerve.h" #include "pathfinder/follow...
#ifndef PATHFINDER_H_DEF #define PATHFINDER_H_DEF #ifdef __cplusplus extern "C" { #endif #include "pathfinder/mathutil.h" #include "pathfinder/structs.h" #include "pathfinder/fit.h" #include "pathfinder/spline.h" #include "pathfinder/trajectory.h" #include "pathfinder/modifiers/tank.h" #include "pathfinder/modifier...
Add regression test where known functions in unknown AD should be spawned
#include <pthread.h> #include <assert.h> void foo() { assert(1); } void bar() { assert(1); } void (*funs[2])() = { &foo, &bar }; extern void magic1(); extern void magic2(void (*funs[])()); void *t_fun(void *arg) { // just for going to multithreaded mode return NULL; } int main() { pthread_t id; p...
Add unsigned eq emits spurious underflow warning
// PARAM: --enable ana.int.interval #include <assert.h> int main() { unsigned long x; x = 0; int b; b = x == 7; // NOWARN if (b) assert(0); // NOWARN (unreachable) else assert(1); // reachable return 0; }
Append node to end of the list.
#include<stdio.h> #include"listHelper.h" void makeNode(struct linkList **head, struct linkList **tail, int dat) { struct linkList *curr; curr = (struct linkList*)malloc(sizeof(struct linkList)); curr->data = dat; curr->next = NULL; if(*he...
Implement vectorEffect nonScalingStroke / non-scaling-stroke
/** * Copyright (c) 2015-present, react-native-community. * All rights reserved. * * This source code is licensed under the MIT-style license found in the * LICENSE file in the root directory of this source tree. */ typedef CF_ENUM(int32_t, RNSVGVectorEffect) { kRNSVGVectorEffectDefault, kRNSVGVectorEffe...
Fix osx build (this is going to be removed soon anyways)
#ifndef __SYS_TYPES_H__ #define __SYS_TYPES_H__ 1 #include <MacTypes.h> #include <alloca.h> #include <string.h> typedef short int16_t; typedef long int32_t; typedef long long int64_t; #define vorbis_size32_t long #if defined(__cplusplus) extern "C" { #endif #pragma options ali...
#ifndef __SYS_TYPES_H__ #define __SYS_TYPES_H__ 1 #include <MacTypes.h> #include <alloca.h> #include <string.h> typedef short int16_t; // typedef long int32_t; typedef long long int64_t; #define vorbis_size32_t long #if defined(__cplusplus) extern "C" { #endif #pragma options ...
Replace inline with static inline to enable DEBUG build (linking actually)
#ifndef PZLIB_H #define PZLIB_H typedef unsigned int psize_type; typedef int pssize_type; typedef pssize_type writerfunc(void *cookie, const void *buf, psize_type len); typedef void closefunc(void*); struct pz { writerfunc *wf; closefunc *cf; }; inline pssize_type do_write(void *cookie, const void *buf, psiz...
#ifndef PZLIB_H #define PZLIB_H typedef unsigned int psize_type; typedef int pssize_type; typedef pssize_type writerfunc(void *cookie, const void *buf, psize_type len); typedef void closefunc(void*); struct pz { writerfunc *wf; closefunc *cf; }; static inline pssize_type do_write(void *cookie, const void *bu...
Add helper function Queue empty implementation
#include "queue.h" struct Queue { size_t head; size_t tail; size_t size; void** e; }; Queue* Queue_Create(size_t n) { Queue* q = (Queue *)malloc(sizeof(Queue)); q->size = n; q->head = q->tail = 1; q->e = (void **)malloc(sizeof(void*) * (n + 1)); return q; }
#include "queue.h" struct Queue { size_t head; size_t tail; size_t size; void** e; }; Queue* Queue_Create(size_t n) { Queue* q = (Queue *)malloc(sizeof(Queue)); q->size = n; q->head = q->tail = 1; q->e = (void **)malloc(sizeof(void*) * (n + 1)); return q; } int Queue_Empty(Queue* q) { return (q->head == q-...
Fix mispelled separate compilation macro.
#ifndef _NPY_PRIVATE_BUFFER_H_ #define _NPY_PRIVATE_BUFFER_H_ #ifdef NPY_ENABLE_MULTIPLE_COMPILATION extern NPY_NO_EXPORT PyBufferProcs array_as_buffer; #else NPY_NO_EXPORT PyBufferProcs array_as_buffer; #endif #endif
#ifndef _NPY_PRIVATE_BUFFER_H_ #define _NPY_PRIVATE_BUFFER_H_ #ifdef NPY_ENABLE_SEPARATE_COMPILATION extern NPY_NO_EXPORT PyBufferProcs array_as_buffer; #else NPY_NO_EXPORT PyBufferProcs array_as_buffer; #endif #endif
Add cast to uint16_t in CRC function
#include "modlib.h" uint16_t MODBUSSwapEndian( uint16_t Data ) { //Change big-endian to little-endian and vice versa uint8_t Swap; //Create 2 bytes long union union Conversion { uint16_t Data; uint8_t Bytes[2]; } Conversion; //Swap bytes Conversion.Data = Data; Swap = C...
#include "modlib.h" uint16_t MODBUSSwapEndian( uint16_t Data ) { //Change big-endian to little-endian and vice versa uint8_t Swap; //Create 2 bytes long union union Conversion { uint16_t Data; uint8_t Bytes[2]; } Conversion; //Swap bytes Conversion.Data = Data; Swap = C...
Fix minimum version to one that exists in 10.5
#import <Cocoa/Cocoa.h> #include <gtk/gtk.h> #if (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_6) @interface _GNSMenuDelegate : NSObject <NSMenuDelegate> {} #else @interface _GNSMenuDelegate : NSObject {} #endif @end
#import <Cocoa/Cocoa.h> #include <gtk/gtk.h> #if (MAC_OS_X_VERSION_MIN_REQUIRED > MAC_OS_X_VERSION_10_5) @interface _GNSMenuDelegate : NSObject <NSMenuDelegate> {} #else @interface _GNSMenuDelegate : NSObject {} #endif @end
Change logger define to namespace stone function
#ifndef lilthumb #define lilthumb #include <ctime> namespace lilthumb{ std::string timeString() { time_t rawtime; struct tm * timeinfo; char buffer[80]; time (&rawtime); timeinfo = localtime(&rawtime); strftime(buffer,80,"%d-%m-%Y %I:%M:%S",timeinfo); std::string str(buffer); return str; } } #defi...
#ifndef lilthumb #define lilthumb #include <ctime> #include <ostream> namespace lilthumb{ std::string timeString() { time_t rawtime; struct tm * timeinfo; char buffer[80]; time (&rawtime); timeinfo = localtime(&rawtime); strftime(buffer,80,"%d-%m-%Y %I:%M:%S",timeinfo); std::string str(buffer); re...
Add motes_abp and motes_otaa link list structure definition.
#ifndef __LWP_CONFIG_H #define __LWP_CONFIG_H #include <stdint.h> #include <stdbool.h> typedef enum{ CFLAG_NWKSKEY = (1<<0), CFLAG_APPSKEY = (1<<1), CFLAG_APPKEY = (1<<2), CFLAG_JOINR = (1<<3), CFLAG_JOINA = (1<<4), }config_flag_t; typedef struct message{ uint8_t *buf; ...
#ifndef __LWP_CONFIG_H #define __LWP_CONFIG_H #include <stdint.h> #include <stdbool.h> typedef enum{ CFLAG_NWKSKEY = (1<<0), CFLAG_APPSKEY = (1<<1), CFLAG_APPKEY = (1<<2), CFLAG_JOINR = (1<<3), CFLAG_JOINA = (1<<4), }config_flag_t; typedef struct message{ uint8_t *buf; ...
Add missing header method declarations.
//--------------------------------------------------------------------*- C++ -*- // CLING - the C++ LLVM-based InterpreterG :) // version: $Id$ // author: Vassil Vassilev <vasil.georgiev.vasilev@cern.ch> //------------------------------------------------------------------------------ #ifndef CLING_RUNTIME_EXCEPTIONS_...
//--------------------------------------------------------------------*- C++ -*- // CLING - the C++ LLVM-based InterpreterG :) // version: $Id$ // author: Vassil Vassilev <vasil.georgiev.vasilev@cern.ch> //------------------------------------------------------------------------------ #ifndef CLING_RUNTIME_EXCEPTIONS_...
Fix typo spotted by Nico Weber.
//===--- ASTConsumers.h - ASTConsumer implementations -----------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===--- ASTConsumers.h - ASTConsumer implementations -----------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Disable db upgrade code for the moment.
/* Uncomment to compile with tcpd/libwrap support. */ //#define WITH_WRAP /* Compile with database upgrading support? If disabled, mosquitto won't * automatically upgrade old database versions. */ #define WITH_DB_UPGRADE /* Compile with memory tracking support? If disabled, mosquitto won't track * heap memory usage...
/* Uncomment to compile with tcpd/libwrap support. */ //#define WITH_WRAP /* Compile with database upgrading support? If disabled, mosquitto won't * automatically upgrade old database versions. */ //#define WITH_DB_UPGRADE /* Compile with memory tracking support? If disabled, mosquitto won't track * heap memory usa...
Add a triple to this test and make sure it passes on arm where it was supposed to.
// RUN: %clang_cc1 %s -emit-llvm -O0 -o - | FileCheck %s // PR 5406 // XFAIL: * // XTARGET: arm typedef struct { char x[3]; } A0; void foo (int i, ...); // CHECK: call void (i32, ...)* @foo(i32 1, i32 {{.*}}) nounwind int main (void) { A0 a3; a3.x[0] = 0; a3.x[0] = 0; a3.x[2] = 26; foo (1, a3 ); return...
// RUN: %clang_cc1 %s -emit-llvm -triple arm-apple-darwin -o - | FileCheck %s // PR 5406 typedef struct { char x[3]; } A0; void foo (int i, ...); // CHECK: call arm_aapcscc void (i32, ...)* @foo(i32 1, [1 x i32] {{.*}}) int main (void) { A0 a3; a3.x[0] = 0; a3.x[0] = 0; a3.x[2] = 26; foo (1, a3 ); retu...
Add framework timer code from Pebble feature_timer demo app
#include "pebble_os.h" #include "pebble_app.h" #include "pebble_fonts.h" #define MY_UUID { 0x78, 0x1D, 0x21, 0x66, 0x09, 0x09, 0x4F, 0x9C, 0x88, 0xFD, 0x89, 0x9B, 0x04, 0xBF, 0x5E, 0x32 } PBL_APP_INFO(MY_UUID, "Pomade", "Jon Speicher", 0, 1, /* App version */ DEFAULT_MENU_ICON, ...
#include "pebble_os.h" #include "pebble_app.h" #include "pebble_fonts.h" #define MY_UUID { 0x78, 0x1D, 0x21, 0x66, 0x09, 0x09, 0x4F, 0x9C, 0x88, 0xFD, 0x89, 0x9B, 0x04, 0xBF, 0x5E, 0x32 } PBL_APP_INFO(MY_UUID, "Pomade", "Jon Speicher", 0, 1, /* App version */ DEFAULT_MENU_ICON, ...
Add header file for linked list queue
/* * Copyright 2017 Brandon Yannoni * * 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...
Add function.toString() and source code if --debug
namespace NJS::Class { class Function { public: int cnt = 0; string code = "[native code]"; void Delete(); Function(void *_f); void *__NJS_VALUE; vector<pair<const char *, NJS::VAR>> __OBJECT; template <class... Args> NJS::VAR operator()(Args... args); explicit NJS::Class::Function::operator std::s...
namespace NJS::Class { class Function { public: int cnt = 0; string code = "[native code]"; void Delete(); Function(void *_f); void *__NJS_VALUE; vector<pair<const char *, NJS::VAR>> __OBJECT; template <class... Args> NJS::VAR operator()(Args... args); explicit operator std::string() const { r...
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...
Implement the inverse sine function.
#include <pal.h> /** * * Caclulates the inverse sine (arc sine) of the argument 'a'. Arguments must be * in the range -1 to 1. The function does not check for illegal input values. * Results are in the range -pi/2 to pi/2. * * @param a Pointer to input vector * * @param c Pointer to output vector * *...
#include <math.h> #include <pal.h> static const float pi_2 = (float) M_PI / 2.f; /* * 0 <= x <= 1 * asin x = pi/2 - (1 - x)^(1/2) * (a0 + a1 * x + ... + a3 * x^3) + e(x) * |e(x)| <= 5 * 10^-5 */ static inline float __p_asin_pos(const float x) { const float a0 = 1.5707288f; const float a1 = -0.2121144f; ...
Add --nocolor to more programs
/* * @file _usage.h * @brief standardize help/usage output across all our programs * @internal * * Copyright 2007 Gentoo Foundation * Released under the GPLv2 */ #define getoptstring_COMMON "Ch" #define longopts_COMMON \ { "help", 0, NULL, 'h'}, \ { "nocolor", 0, NULL, 'C'}, #define case_RC_...
Adjust a test case and make it more jump optimization neutral for JIT case.
/*- * Test 0083: Check that the last instruction is BPF_RET. * * $FreeBSD$ */ /* BPF program */ struct bpf_insn pc[] = { BPF_JUMP(BPF_JMP+BPF_JA, 0, 0, 0), }; /* Packet */ u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ u_int buflen ...
/*- * Test 0083: Check that the last instruction is BPF_RET. * * $FreeBSD$ */ /* BPF program */ struct bpf_insn pc[] = { BPF_STMT(BPF_LD|BPF_IMM, 0), }; /* Packet */ u_char pkt[] = { 0x00, }; /* Packet length seen on wire */ u_int wirelen = sizeof(pkt); /* Packet length passed on buffer */ u_int buflen = size...
Add enough space in DNS cache for IPV6
/* Copyright 2016 Vanderbilt University 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...
/* Copyright 2016 Vanderbilt University 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...
Add crc32 and identity hash functions
// SPDX-License-Identifier: Apache-2.0 // Copyright 2021 Eotvos Lorand University, Budapest, Hungary #include "dpdk_model_v1model.h" #include "util_packet.h" #include "util_debug.h" #include "dpdk_lib.h" #include "stateful_memory.h" #include <rte_ip.h> void hash(uint16_t* result, enum_HashAlgorithm_t hash, uint16_t...
// SPDX-License-Identifier: Apache-2.0 // Copyright 2021 Eotvos Lorand University, Budapest, Hungary #include "dpdk_model_v1model.h" #include "util_packet.h" #include "util_debug.h" #include "dpdk_lib.h" #include "stateful_memory.h" #include "rte_hash_crc.h" #include <rte_ip.h> void hash(uint16_t* result, enum_Has...
Add support for pushing ints to the stack.
#include <stdlib.h> #include <stdio.h> #include <string.h> void runStep(struct stack_node node, struct stack_node *top) { switch( node.data.type ) { case 0: struct stack_node push; push.cdr = top; push.data = node.data; *top = push; break; } }
Add a factory for Producer<Byte>
#include "ByteProducer.h" static void _start (struct ByteProducerInternal *self, struct ByteListenerInternal *listener) { ByteProducer *producer = (ByteProducer *) self; producer->start (producer, (ByteListener *) listener); } static void _stop (struct ByteProducerInternal *self) { ByteProducer *producer = (Byte...
Address compiler warning - unused variable
{ struct RClass *Control_class = mrb_define_class_under(mrb, UI_module(mrb), "Control", mrb->object_class); #define CONTROL_SUBCLASS(name) { struct RClass* subclass = mrb_define_class_under(mrb, UI_module(mrb), #name, Control_class); } CONTROL_SUBCLASS(Area) CONTROL_SUBCLASS(Box) CONTROL_SUBCLASS(Button) CONT...
{ struct RClass *Control_class = mrb_define_class_under(mrb, UI_module(mrb), "Control", mrb->object_class); #define CONTROL_SUBCLASS(name) { mrb_define_class_under(mrb, UI_module(mrb), #name, Control_class); } CONTROL_SUBCLASS(Area) CONTROL_SUBCLASS(Box) CONTROL_SUBCLASS(Button) CONTROL_SUBCLASS(Checkbox) C...
Declare the properties as nonatomic
#import <UIKit/UIKit.h> #define SUPPORTS_UNDOCUMENTED_API 1 @interface UIColor (expanded) - (CGColorSpaceModel) colorSpaceModel; - (NSString *) colorSpaceString; - (BOOL) canProvideRGBComponents; - (NSArray *) arrayFromRGBAComponents; - (CGFloat) red; - (CGFloat) blue; - (CGFloat) green; - (CGFloat) alpha; - (NSStr...
#import <UIKit/UIKit.h> #define SUPPORTS_UNDOCUMENTED_API 1 @interface UIColor (expanded) - (CGColorSpaceModel) colorSpaceModel; - (NSString *) colorSpaceString; - (BOOL) canProvideRGBComponents; - (NSArray *) arrayFromRGBAComponents; - (CGFloat) red; - (CGFloat) blue; - (CGFloat) green; - (CGFloat) alpha; - (NSStr...
Add some extra operators to base::ComPtr
// LAF Base Library // Copyright (c) 2017 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef BASE_WIN_COMPTR_H_INCLUDED #define BASE_WIN_COMPTR_H_INCLUDED #pragma once #if !defined(_WIN32) #error This header file can be used only on Window...
// LAF Base Library // Copyright (c) 2021 Igara Studio S.A. // Copyright (c) 2017 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef BASE_WIN_COMPTR_H_INCLUDED #define BASE_WIN_COMPTR_H_INCLUDED #pragma once #if !defined(_WIN32) #error Thi...
Use new NanoTime location header, oops.
#ifndef TIMEOUT_QUEUE_H #define TIMEOUT_QUEUE_H #include <map> class TimeoutQueue { typedef std::map<NanoTime, CallbackQueue> timeout_map_t; LogHandle log_; timeout_map_t timeout_queue_; public: TimeoutQueue(void) : log_("/event/timeout/queue"), timeout_queue_() { } ~TimeoutQueue() { } bool empty(void)...
#ifndef TIMEOUT_QUEUE_H #define TIMEOUT_QUEUE_H #include <map> #include <common/time/time.h> class TimeoutQueue { typedef std::map<NanoTime, CallbackQueue> timeout_map_t; LogHandle log_; timeout_map_t timeout_queue_; public: TimeoutQueue(void) : log_("/event/timeout/queue"), timeout_queue_() { } ~Timeout...
Fix alpha build and add __FBSDID.
/*- * Copyright (c) 2004 Doug Rabson * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditi...
/*- * Copyright (c) 2004 Doug Rabson * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditi...
UPDATE doubble checked for Fransisco
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATE_H #define SSPAPPLICATION_GAMESTATES_GAMESTATE_H #include "InputHandler.h" #include "ComponentHandler.h" #include "../GraphicsDLL/Camera.h" #include "../NetworkDLL/NetworkModule.h" //class NetworkModule; class GameStateHandler; class GameState { private: //Variables protecte...
#ifndef SSPAPPLICATION_GAMESTATES_GAMESTATE_H #define SSPAPPLICATION_GAMESTATES_GAMESTATE_H #include "InputHandler.h" #include "ComponentHandler.h" #include "../GraphicsDLL/Camera.h" //#include "../NetworkDLL/NetworkModule.h" //class NetworkModule; class GameStateHandler; class GameState { private: //Variables protec...
Use a breakpoint to cause an exception to cause the registers to be saved for debugging purposes.
/* $OpenBSD: db_interface.c,v 1.2 1996/12/28 06:21:50 rahnds Exp $ */ #include <sys/param.h> #include <sys/proc.h> #include <machine/db_machdep.h> void Debugger() { db_trap(T_BREAKPOINT); /* __asm volatile ("tw 4,2,2"); */ }
/* $OpenBSD: db_interface.c,v 1.3 1999/07/05 20:23:08 rahnds Exp $ */ #include <sys/param.h> #include <sys/proc.h> #include <machine/db_machdep.h> void Debugger() { /* db_trap(T_BREAKPOINT); */ __asm volatile ("tw 4,2,2"); }
Fix inclusion guard for NavigationWidget
#ifndef NAVIGATIONWIDGET_H #define NAVIGATIONWIDGET_H #include <QWidget> #include <QLabel> #include "qnavigation_global.h" class QLabel; class QPushButton; namespace QNavigation { class SlidingStackedWidget; class NavigationWidgetPrivate; class NavigationWidget : public QWidget { Q_OBJECT Q_DECLARE_PRIVATE...
#ifndef QNAVIGATION_NAVIGATIONWIDGET_H #define QNAVIGATION_NAVIGATIONWIDGET_H #include <QWidget> #include <QLabel> #include "qnavigation_global.h" class QLabel; class QPushButton; namespace QNavigation { class SlidingStackedWidget; class NavigationWidgetPrivate; class NavigationWidget : public QWidget { Q_OBJE...
Add missing WebRTC header file
/* * libjingle * Copyright 2014, Google Inc. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the f...
Fix Instapaper Root API issue
// // InstapaperAPI.h // newsyc // // Created by Grant Paul on 3/10/11. // Copyright 2011 Xuzz Productions, LLC. All rights reserved. // #import <HNKit/NSString+URLEncoding.h> #define kInstapaperAPIRootURL [NSURL URLWithString:@"https://instapaper.com/api/"] #define kInstapaperAPIAuthenticationURL [NSURL URLWithS...
// // InstapaperAPI.h // newsyc // // Created by Grant Paul on 3/10/11. // Copyright 2011 Xuzz Productions, LLC. All rights reserved. // #import <HNKit/NSString+URLEncoding.h> #define kInstapaperAPIRootURL [NSURL URLWithString:@"https://www.instapaper.com/api/"] #define kInstapaperAPIAuthenticationURL [NSURL URLW...
Make Cons::car_ and Cons::cdr_ public members.
#ifndef MCLISP_CONS_H_ #define MCLISP_CONS_H_ namespace mclisp { class ConsCell { public: ConsCell(): car_(nullptr), cdr_(nullptr) {} ConsCell(ConsCell* car, ConsCell* cdr): car_(car), cdr_(cdr) {} private: ConsCell* car_; ConsCell* cdr_; }; } // namespace mclisp #endif // MCLISP_CONS_H_
#ifndef MCLISP_CONS_H_ #define MCLISP_CONS_H_ namespace mclisp { class ConsCell { public: ConsCell(): car_(nullptr), cdr_(nullptr) {} ConsCell(ConsCell* car, ConsCell* cdr): car_(car), cdr_(cdr) {} ConsCell* car_; ConsCell* cdr_; }; } // namespace mclisp #endif // MCLISP_CONS_H_