Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Fix ThreadPool class/struct forward declaration mixup
/** * Copyright (c) 2016-present, Facebook, 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://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
/** * Copyright (c) 2016-present, Facebook, 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://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable ...
Add test case for ptr annotation.
// RUN: %llvmgcc -c -emit-llvm %s -o - | llvm-dis | grep llvm.ptr.annotation | count 3 #include <stdio.h> /* Struct with element X being annotated */ struct foo { int X __attribute__((annotate("StructAnnotation"))); int Y; int Z; }; void test(struct foo *F) { F->X = 42; F->Z = 1; F->Y = F->...
Add test where base invariant worsens precision
// extracted from 01/22 #include <assert.h> int main() { int a = 1; int b = 1; int *x; int rnd; if (rnd) x = &a; else x = &b; assert(*x == 1); b = 2; assert(a == 1); if (*x != 0) { // TODO: invariant makes less precise! assert(a == 1); // TODO } return 0; }
Create a CPU and start REPLing
// // main.c // v6502 // // Created by Daniel Loffgren on H.25/03/28. // Copyright (c) 平成25年 Hello-Channel, LLC. All rights reserved. // #include <stdio.h> #include "cpu.h" #include "mem.h" int main(int argc, const char * argv[]) { printf("Allocating virtual memory of size 2k…\n"); return 0; }
// // main.c // v6502 // // Created by Daniel Loffgren on H.25/03/28. // Copyright (c) 平成25年 Hello-Channel, LLC. All rights reserved. // #include <stdio.h> #include <string.h> #include "cpu.h" #include "mem.h" #include "core.h" int main(int argc, const char * argv[]) { printf("Creating 1 virtual CPU…\n"); v650...
Add missing internal Hportal header
/* 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 to in writing, so...
Increase the status LED brightness a bit so that newer DotStars aren't super dim. This will make status NeoPixels a bit bright but one can use samd.set_rgb_status_brightness() to dim them.
#define BLACK 0x000000 #define GREEN 0x001000 #define BLUE 0x000010 #define CYAN 0x001010 #define RED 0x100000 #define ORANGE 0x100800 #define YELLOW 0x101000 #define PURPLE 0x100010 #define WHITE 0x101010 #define BOOT_RUNNING BLUE #define MAIN_RUNNING GREEN #define SAFE_MODE YELLOW #define ALL_D...
#define BLACK 0x000000 #define GREEN 0x003000 #define BLUE 0x000030 #define CYAN 0x003030 #define RED 0x300000 #define ORANGE 0x302000 #define YELLOW 0x303000 #define PURPLE 0x300030 #define WHITE 0x303030 #define BOOT_RUNNING BLUE #define MAIN_RUNNING GREEN #define SAFE_MODE YELLOW #define ALL_D...
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...
Add missing parameter variable name 'k'
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); ListNode* ListNode_Create(void *); void ListNode_Destroy(ListNode* n); ListNode* List_Search(List* l, void* k, int (f)...
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); void List_Destroy(List* l); ListNode* ListNode_Create(void * k); void ListNode_Destroy(ListNode* n); ListNode* List_Search(List* l, void* k, int (...
Add thusfar-unused Linux seccomp filter test.
#include <sys/prctl.h> #include <linux/seccomp.h> int main(void) { prctl(PR_SET_SECCOMP, SECCOMP_MODE_FILTER, 0); return(EFAULT == errno ? 0 : 1); }
Disable allocation tracking (it appears to be broken)
#define ACPI_MACHINE_WIDTH 64 #define ACPI_SINGLE_THREADED #define ACPI_USE_LOCAL_CACHE #define ACPI_INLINE inline #define ACPI_USE_NATIVE_DIVIDE #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #ifdef ACPI_FULL_DEBUG #define ACPI_DEBUG_OUTPUT #define ACPI_DISASSEMBLER // Depends on threading support #define ACPI...
#define ACPI_MACHINE_WIDTH 64 #define ACPI_SINGLE_THREADED #define ACPI_USE_LOCAL_CACHE #define ACPI_INLINE inline #define ACPI_USE_NATIVE_DIVIDE #define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED #ifdef ACPI_FULL_DEBUG #define ACPI_DEBUG_OUTPUT #define ACPI_DISASSEMBLER // Depends on threading support #define ACPI...
Fix path in tails_files C wrapper
#include <unistd.h> int main(int argc, char* argv) { setuid(0); // Use absolute path to the Python binary and execl to avoid $PATH or symlink trickery execl("/usr/bin/python2.7", "python2.7", "/home/vagrant/tails_files/test.py", (char*)NULL); return 0; }
#include <unistd.h> int main(int argc, char* argv) { setuid(0); // Use absolute path to the Python binary and execl to avoid $PATH or symlink trickery execl("/usr/bin/python2.7", "python2.7", "/home/amnesia/Persistent/.securedrop/securedrop_init.py", (char*)NULL); return 0; }
Add note to fix confusing Instruction lengths
#ifndef _INC_INSTRUCTION_H #define _INC_INSTRUCTION_H #include "basetypes.h" #include <vector> #include <map> typedef std::vector<byte> ByteString; class BaseCPU; class Instruction { public: Instruction(ByteString opcode, SizeType instructionLength); virtual void execute(BaseCPU &cpu, const ByteString &para...
#ifndef _INC_INSTRUCTION_H #define _INC_INSTRUCTION_H #include "basetypes.h" #include <vector> #include <map> typedef std::vector<byte> ByteString; class BaseCPU; class Instruction { public: Instruction(ByteString opcode, SizeType instructionLength); virtual void execute(BaseCPU &cpu, const ByteString &para...
Use generic pointer hashes instead of custom ones.
/* Title: LiveVarMap.h Author: Ruchira Sasanka Date: Jun 30, 01 Purpose: This file contains the class for a map between the BasicBlock class and the BBLiveVar class, which is a wrapper class of BasicBlock used for the live variable analysis. The reverse mapping can be found in the B...
/* Title: LiveVarMap.h -*- C++ -*- Author: Ruchira Sasanka Date: Jun 30, 01 Purpose: This file contains the class for a map between the BasicBlock class and the BBLiveVar class, which is a wrapper class of BasicBlock used for the live variable analysis. The reverse mapping can be ...
Add a FrontendC testcase for the x86-64 Red Zone feature, to help verify that the feature may be disabled through the -mno-red-zone option.
// RUN: $llvmgcc -m64 -fomit-frame-pointer -O2 %s -S -o - > %t // RUN: not grep subq %t // RUN: not grep addq %t // RUN: grep {\\-4(%%rsp)} %t | count 2 // RUN: $llvmgcc -m64 -fomit-frame-pointer -O2 %s -S -o - -mno-red-zone > %t // RUN: grep subq %t | count 1 // RUN: grep addq %t | count 1 // This is a test for x86-64...
Revert r132426; this test passes more often than not, and we don't have a way to mark tests as intermittently failing at the moment.
// XFAIL: win32 // RUN: mkdir -p %t.dir // RUN: echo '#include "header2.h"' > %t.dir/header1.h // RUN: echo > %t.dir/header2.h // RUN: cp %s %t.dir/t.c // RUN: %clang_cc1 -x c-header %t.dir/header1.h -emit-pch -o %t.pch // RUN: echo >> %t.dir/header2.h // RUN: %clang_cc1 %t.dir/t.c -include-pch %t.pch -fsyntax-only 2>&...
// RUN: mkdir -p %t.dir // RUN: echo '#include "header2.h"' > %t.dir/header1.h // RUN: echo > %t.dir/header2.h // RUN: cp %s %t.dir/t.c // RUN: %clang_cc1 -x c-header %t.dir/header1.h -emit-pch -o %t.pch // RUN: echo >> %t.dir/header2.h // RUN: %clang_cc1 %t.dir/t.c -include-pch %t.pch -fsyntax-only 2>&1 | FileCheck %s...
Add delegate property for subscription
// // AVSubscription.h // AVOS // // Created by Tang Tianyong on 15/05/2017. // Copyright © 2017 LeanCloud Inc. All rights reserved. // #import <Foundation/Foundation.h> #import "AVQuery.h" #import "AVDynamicObject.h" NS_ASSUME_NONNULL_BEGIN @interface AVSubscriptionOptions : AVDynamicObject @end @interface AV...
// // AVSubscription.h // AVOS // // Created by Tang Tianyong on 15/05/2017. // Copyright © 2017 LeanCloud Inc. All rights reserved. // #import <Foundation/Foundation.h> #import "AVQuery.h" #import "AVDynamicObject.h" NS_ASSUME_NONNULL_BEGIN @protocol AVSubscriptionDelegate <NSObject> @end @interface AVSubscri...
Make the prototype match the declaration in the GUSI header files.
/* The equivalent of the Unix 'sync' system call: FlushVol. Public domain by Guido van Rossum, CWI, Amsterdam (July 1987). For now, we only flush the default volume (since that's the only volume written to by MacB). */ #include "macdefs.h" int sync(void) { if (FlushVol((StringPtr)0, 0) == noErr) return 0;...
/* The equivalent of the Unix 'sync' system call: FlushVol. Public domain by Guido van Rossum, CWI, Amsterdam (July 1987). For now, we only flush the default volume (since that's the only volume written to by MacB). */ #include "macdefs.h" void sync(void) { if (FlushVol((StringPtr)0, 0) == noErr) return; ...
Remove declare: class VTSTOR_API cDriveInterface
/* <License> Copyright 2015 Virtium Technology Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http ://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
/* <License> Copyright 2015 Virtium Technology Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http ://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing...
Add basic program to turn an LED on
#include <avr/io.h> #include <avr/delay.h>
#include <avr/io.h> int main (void) { //Set pin 3 as output to source current? PORTB = 1<<PORTB3; DDRB = 1<<DDB3; }
Use angle brackets for Ruby include
#include "ruby.h" VALUE Xorcist = Qnil; void Init_xorcist(); VALUE xor_in_place(VALUE x, VALUE y, VALUE self); VALUE xor_in_place(VALUE self, VALUE x, VALUE y) { const char *src = 0; char *dest = 0; size_t len; size_t y_len; rb_str_modify(x); dest = RSTRING_PTR(x); len = RSTRING_LEN(x);...
#include <ruby.h> VALUE Xorcist = Qnil; void Init_xorcist(); VALUE xor_in_place(VALUE x, VALUE y, VALUE self); VALUE xor_in_place(VALUE self, VALUE x, VALUE y) { const char *src = 0; char *dest = 0; size_t len; size_t y_len; rb_str_modify(x); dest = RSTRING_PTR(x); len = RSTRING_LEN(x);...
Test for struct in GNU ?: expressions
// RUN: %check -e %s main() { struct A { int i; } a, b, c; a = b ? : c; // CHECK: error: struct involved in if-expr }
Fix @brief description by making it on one line instead of two
// // This file is part of the Marble Desktop 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 2004-2007 Torsten Rahn <tackat@kde.org>" // Copyright 2007 Inge Wallin <ingwa@kde....
// // This file is part of the Marble Desktop 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 2004-2007 Torsten Rahn <tackat@kde.org>" // Copyright 2007 Inge Wallin <ingwa@kde....
Mend missing reference to stdint
#ifndef DEBUGGER_PARSER_GLOBAL_H_ #define DEBUGGER_PARSER_GLOBAL_H_ #include "common.h" #include <stdio.h> struct debug_expr { enum expr_type { EXPR_NULL, EXPR_MEM, EXPR_REG } type; int32_t val; }; enum display_type { DISP_NULL, DISP_DEC, DISP_HEX, DISP_INST, DISP_max }; struct debugg...
#ifndef DEBUGGER_PARSER_GLOBAL_H_ #define DEBUGGER_PARSER_GLOBAL_H_ #include "common.h" #include <stdint.h> #include <stdio.h> struct debug_expr { enum expr_type { EXPR_NULL, EXPR_MEM, EXPR_REG } type; int32_t val; }; enum display_type { DISP_NULL, DISP_DEC, DISP_HEX, DISP_INST, DISP_m...
Add [] operator. Fix potential memory errors.
/* * Copyright 2006-2008 The FLWOR Foundation. * * 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 o...
/* * Copyright 2006-2008 The FLWOR Foundation. * * 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 o...
Update file, Alura, Introdução a C, Aula 1.5
#include <stdio.h> int main() { // imprime o cabecalho do nosso jogo printf("******************************************\n"); printf("* Bem vindo ao nosso jogo de adivinhação *\n"); printf("******************************************\n"); int numerosecreto = 42; printf("O número %d é o secreto. Não conta p...
#include <stdio.h> int main() { // imprime o cabecalho do nosso jogo printf("******************************************\n"); printf("* Bem vindo ao nosso jogo de adivinhação *\n"); printf("******************************************\n"); int numerosecreto = 42; int chute; printf("Qual é o seu chute? "...
Add .hints initializer for clarity.
static struct hep_ctx ctx = { .initfails = 0, .hints = {{ 0 }}, .capt_host = "10.0.0.1", .capt_port = "9060", .capt_id = 101, .hep_version = 3, .usessl = 0, .pl_compress = 0, .sendPacketsCount = 0 };
static struct hep_ctx ctx = { .initfails = 0, .hints = {{ 0 }}, .capt_host = "10.0.0.1", .capt_port = "9060", .hints = {{ .ai_socktype = SOCK_DGRAM }}, .capt_id = 101, .hep_version = 3, .usessl = 0, .pl_compress = 0, .sendPacketsCount = 0...
Adjust test case to be compatible with future changes to explicitly pass the type to getelementptr
// RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm -O2 -o - %s | FileCheck %s // Under Windows 64, int and long are 32-bits. Make sure pointer math doesn't // cause any sign extensions. // CHECK: [[P:%.*]] = add i64 %param, -8 // CHECK-NEXT: [[Q:%.*]] = inttoptr i64 [[P]] to [[R:%.*\*]] // CHECK-NEXT: {{%.*}...
// RUN: %clang_cc1 -triple x86_64-pc-win32 -emit-llvm -O2 -o - %s | FileCheck %s // Under Windows 64, int and long are 32-bits. Make sure pointer math doesn't // cause any sign extensions. // CHECK: [[P:%.*]] = add i64 %param, -8 // CHECK-NEXT: [[Q:%.*]] = inttoptr i64 [[P]] to [[R:%.*]]* // CHECK-NEXT: {{%.*}}...
Add NRF24L01 node_ops 'driver' skeleton
/* * This file is part of the KNOT Project * * Copyright (c) 2015, CESAR. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright...
Allow suppression of "deprecated header" warning
/*------------------------------------------------------------------------- * * FILE * pqxx/util.h * * DESCRIPTION * Various utility definitions for libpqxx * * Copyright (c) 2001-2004, Jeroen T. Vermeulen <jtv@xs4all.nl> * * See COPYING for copyright license. If you did not receive a file called *...
/*------------------------------------------------------------------------- * * FILE * pqxx/util.h * * DESCRIPTION * Various utility definitions for libpqxx * * Copyright (c) 2001-2004, Jeroen T. Vermeulen <jtv@xs4all.nl> * * See COPYING for copyright license. If you did not receive a file called *...
Fix a typo in the comment.
// // Copyleft RIME Developers // License: GPLv3 // // 2011-03-14 GONG Chen <chen.sst@gmail.com> // #ifndef RIME_COMMON_H_ #define RIME_COMMON_H_ #include <memory> #include <utility> #define BOOST_BIND_NO_PLACEHOLDERS #include <boost/signals2/connection.hpp> #include <boost/signals2/signal.hpp> #ifdef RIME_ENABLE_LOG...
// // Copyleft RIME Developers // License: GPLv3 // // 2011-03-14 GONG Chen <chen.sst@gmail.com> // #ifndef RIME_COMMON_H_ #define RIME_COMMON_H_ #include <memory> #include <utility> #define BOOST_BIND_NO_PLACEHOLDERS #include <boost/signals2/connection.hpp> #include <boost/signals2/signal.hpp> #ifdef RIME_ENABLE_LOG...
Add override after overriden methods
// This program is free software licenced under MIT Licence. You can // find a copy of this licence in LICENCE.txt in the top directory of // source code. // #ifndef BASIC_ROUND_STRATEGY_H_INCLUDED #define BASIC_ROUND_STRATEGY_H_INCLUDED // Project #include "globals.h" #include "RoundStrategy.h" namespace warlight...
// This program is free software licenced under MIT Licence. You can // find a copy of this licence in LICENCE.txt in the top directory of // source code. // #ifndef BASIC_ROUND_STRATEGY_H_INCLUDED #define BASIC_ROUND_STRATEGY_H_INCLUDED // Project #include "globals.h" #include "RoundStrategy.h" namespace warlight...
Test program to get CPU affinity of an MPI application
/* Copyright (c) 2013 Janne Blomqvist 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, merge, publish, distribute,...
Include QList and QMap to header file to fix build
#ifndef DOWNLOAD_QUERY_LOADER_H #define DOWNLOAD_QUERY_LOADER_H #include <QString> class Site; class DownloadQueryImage; class DownloadQueryGroup; class DownloadQueryLoader { public: static bool load(QString path, QList<DownloadQueryImage> &uniques, QList<DownloadQueryGroup> &batchs, QMap<QString, Site*> &sites)...
#ifndef DOWNLOAD_QUERY_LOADER_H #define DOWNLOAD_QUERY_LOADER_H #include <QString> #include <QList> #include <QMap> class Site; class DownloadQueryImage; class DownloadQueryGroup; class DownloadQueryLoader { public: static bool load(QString path, QList<DownloadQueryImage> &uniques, QList<DownloadQueryGroup> &bat...
Add constant for spin increment
#pragma once #include "Tab.h" class Display : public Tab { public: virtual void SaveSettings(); protected: virtual void Initialize(); virtual void LoadSettings(); private: bool OnAnimationChanged(); bool OnAnimationSpin(NMUPDOWN *ud); bool OnCustomCheckChanged(); bool OnPositionChanged()...
#pragma once #include "Tab.h" #include <CommCtrl.h> class Display : public Tab { public: virtual void SaveSettings(); protected: virtual void Initialize(); virtual void LoadSettings(); private: bool OnAnimationChanged(); bool OnAnimationSpin(NMUPDOWN *ud); bool OnCustomCheckChanged(); b...
Add basic (base analysis) path sensitivity test
extern void __VERIFIER_error() __attribute__ ((__noreturn__)); extern int __VERIFIER_nondet_int(); void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR: __VERIFIER_error(); } return; } int main() { int x, y; if (__VERIFIER_nondet_int()) { x = 0; y = 1; } else ...
Remove spurious mLoop member from PinocchioTest
#include <QtCore/QProcess> #include <QtDBus/QtDBus> #include <QtTest/QtTest> #include <TelepathyQt4/Client/PendingOperation> #include <TelepathyQt4/Constants> #include "tests/lib/test.h" class PinocchioTest : public Test { Q_OBJECT public: PinocchioTest(QObject *parent = 0); virtual ~PinocchioTest()...
#include <QtCore/QProcess> #include <QtDBus/QtDBus> #include <QtTest/QtTest> #include <TelepathyQt4/Client/PendingOperation> #include <TelepathyQt4/Constants> #include "tests/lib/test.h" class PinocchioTest : public Test { Q_OBJECT public: PinocchioTest(QObject *parent = 0); virtual ~PinocchioTest()...
Use dirty C tricks to make it smaller
#include <stdio.h> int main() { long nc = 0; while (getchar() != EOF) { ++nc; } printf("count: %d\n", nc); }
#include <stdio.h> int main() { double nc = 0; for (nc = 0; getchar() != EOF; ++nc) ; printf("count: %f\n", nc); }
Remove __vectorcall calling convention on older versions of MSVC++
#pragma once #include <string> #if 0 int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; } int Strnicmp(const char* str1, const char* str2, int count) { int d = 0; while (count > 0 && (d = toupper(*str2) - toupper...
#pragma once #include <string> #if 0 int Stricmp(const char* str1, const char* str2) { int d; while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; } return d; } int Strnicmp(const char* str1, const char* str2, int count) { int d = 0; while (count > 0 && (d = toupper(*str2) - toupper...
Add ComPtr utility to laf-base library
// 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...
Add test where base has live bottom state
//PARAM: --set ana.activated '["base", "mallocWrapper"]' // Copied & modified from 33/04. #include <assert.h> int main() { // state: {bot}, because no locals/globals assert(1); // state: {bot}, because Hoare set add (in PathSensitive2 map) keeps bot, while reduce would remove assert(1); // state: {bot}, be...
CREATE ns_prefix/box/ didn't work right when namespace prefix existed.
/* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "mail-namespace.h" #include "commands.h" bool cmd_create(struct client_command_context *cmd) { struct mail_namespace *ns; const char *mailbox, *full_mailbox; bool directory; size_t len; /* <mailbox> */ if (!client_read_string_args(cmd, 1, &mai...
/* Copyright (C) 2002 Timo Sirainen */ #include "common.h" #include "mail-namespace.h" #include "commands.h" bool cmd_create(struct client_command_context *cmd) { struct mail_namespace *ns; const char *mailbox, *full_mailbox; bool directory; size_t len; /* <mailbox> */ if (!client_read_string_args(cmd, 1, &mai...
Add a Debug shmemlog tag.
/* * $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(HD_Unknown) SLTM(HD_Lost) #define HTTPH(a, b, c, d, e, f, g) SL...
/* * $Id$ * * Define the tags in the shared memory in a reusable format. * Whoever includes this get to define what the SLTM macro does. * */ SLTM(Debug) SLTM(CLI) SLTM(SessionOpen) SLTM(SessionClose) SLTM(ClientAddr) SLTM(Request) SLTM(URL) SLTM(Protocol) SLTM(HD_Unknown) SLTM(HD_Lost) #define HTTPH(a, b, c, d,...
Make work for AIX machines.
#ifndef _CONDOR_SYSCALLS_H #define _CONDOR_SYSCALLS_H #if defined( AIX32) # include "syscall.aix32.h" #else # include <syscall.h> #endif typedef int BOOL; static const int SYS_LOCAL = 1; static const int SYS_REMOTE = 0; static const int SYS_RECORDED = 2; static const int SYS_MAPPED = 2; static const int SYS_UNRE...
#ifndef _CONDOR_SYSCALLS_H #define _CONDOR_SYSCALLS_H #if defined( AIX32) # include "syscall.aix.h" #else # include <syscall.h> #endif typedef int BOOL; static const int SYS_LOCAL = 1; static const int SYS_REMOTE = 0; static const int SYS_RECORDED = 2; static const int SYS_MAPPED = 2; static const int SYS_UNRECO...
Fix MSVC compiler warnings about return value not being a boolean
#pragma once #include <stdint.h> #if _MSC_VER #include <intrin.h> #endif template<typename morton> inline bool findFirstSetBit(const morton x, unsigned long* firstbit_location) { #if _MSC_VER && !_WIN64 // 32 BIT on 32 BIT if (sizeof(morton) <= 4) { return _BitScanReverse(firstbit_location, x); } // 64 BIT on 3...
#pragma once // Libmorton - Common helper methods needed in Morton encoding/decoding #include <stdint.h> #if _MSC_VER #include <intrin.h> #endif template<typename morton> inline bool findFirstSetBit(const morton x, unsigned long* firstbit_location) { #if _MSC_VER && !_WIN64 // 32 BIT on 32 BIT if (sizeof(morton) <...
Make "visit" method pure virtual (needs to be implemented by subclass to make sense).
/****************************************************************************** * * file: Visitor.h * * Copyright (c) 2003, Michael E. Smoot . * All rights reverved. * * See the file COPYING in the top directory of this distribution for * more information. * * THE SOFTWARE IS PROVIDED _AS IS_, W...
/****************************************************************************** * * file: Visitor.h * * Copyright (c) 2003, Michael E. Smoot . * All rights reverved. * * See the file COPYING in the top directory of this distribution for * more information. * * THE SOFTWARE IS PROVIDED _AS IS_, W...
Add minimal failing test case
// PARAM: --enable ana.int.interval --enable ana.int.def_exc int main(){ unsigned long long a ; unsigned long long addr; if(a + addr > 0x0ffffffffULL){ return 1; } }
Fix microblaze build after merge 480c64b
/** * @file * @details This file contains @link interrupt_handler() @endlink function. * It's proxy between asm code and kernel interrupt handler * @link irq_dispatch() @endlink function. * * @date 27.11.09 * @author Anton Bondarev */ #include <drivers/irqctrl.h> #include <asm/msr.h> /* we havn'...
/** * @file * @details This file contains @link interrupt_handler() @endlink function. * It's proxy between asm code and kernel interrupt handler * @link irq_dispatch() @endlink function. * * @date 27.11.09 * @author Anton Bondarev */ #include <drivers/irqctrl.h> #include <asm/msr.h> #include <ke...
Rename VERSION to avoid overlapping with external macros
/** * mips.h - all the aliases to MIPS ISA * @author Aleksandr Misevich * Copyright 2018 MIPT-MIPS */ #ifndef MIPS_H_ #define MIPS_H_ #include "mips_instr.h" #include <infra/instrcache/instr_cache_memory.h> template<MIPSVersion VERSION> struct MIPS { using Register = MIPSRegister; using RegisterUInt = M...
/** * mips.h - all the aliases to MIPS ISA * @author Aleksandr Misevich * Copyright 2018 MIPT-MIPS */ #ifndef MIPS_H_ #define MIPS_H_ #include "mips_instr.h" #include <infra/instrcache/instr_cache_memory.h> template<MIPSVersion version> struct MIPS { using Register = MIPSRegister; using RegisterUInt = M...
Move class selection code out to a separate header
#ifndef CLASS_SELECTOR_H_ #define CLASS_SELECTOR_H_ #include "llvm/IR/Module.h" #include "llvm/IR/Instruction.h" #include "llvm/IR/Instructions.h" #include "llvm/IR/IntrinsicInst.h" #include "llvm/IR/BasicBlock.h" #include "llvm/IR/Function.h" #include "llvm/IR/Operator.h" #include "llvm/IR/Type.h" #include "llvm/IR/V...
Add license header, add version and help info
#include <stdio.h> int main(int argc, char *argv[]) { printf("gxtas - The GTA Text Assembler\n"); return 0; }
/* * Copyright (c) 2017 Wes Hampson <thehambone93@gmail.com> * * Licensed under the MIT License. See LICENSE at top level directory. */ #include <stdio.h> #include <string.h> #include "gxtas.h" void show_help_info(void) { printf("%s\n", GXTAS_HELP_MESSAGE); } void show_version_info(void) { printf("%s - ...
Add operators for arithmetic with ratios
//Copyright (c) 2018 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef RATIO_H #define RATIO_H namespace cura { /* * \brief Represents a ratio between two numbers. * * This is a facade. It behaves like a double. */ struct Ratio { /* * \brief Default constructor set...
//Copyright (c) 2018 Ultimaker B.V. //CuraEngine is released under the terms of the AGPLv3 or higher. #ifndef RATIO_H #define RATIO_H namespace cura { /* * \brief Represents a ratio between two numbers. * * This is a facade. It behaves like a double. */ struct Ratio { /* * \brief Default constructor set...
Add low and upper bound values for rocksdb::PerfLevel enum
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. #ifndef INCLUDE_ROCKSDB...
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved. // This source code is licensed under the BSD-style license found in the // LICENSE file in the root directory of this source tree. An additional grant // of patent rights can be found in the PATENTS file in the same directory. #ifndef INCLUDE_ROCKSDB...
Move SK_API from namespace to function
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkWebpEncoder_DEFINED #define SkWebpEncoder_DEFINED #include "SkEncoder.h" class SkWStream; namespace SK_API SkWebpEncoder { struct Options { /** ...
/* * Copyright 2017 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkWebpEncoder_DEFINED #define SkWebpEncoder_DEFINED #include "SkEncoder.h" class SkWStream; namespace SkWebpEncoder { struct SK_API Options { /** ...
Add test for spool path construction
#include <glib.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include "../marquise.h" extern uint8_t valid_namespace(char *namespace); extern char* build_spool_path(const char *spool_prefix, char *namespace); void test_valid_namespace() { int ret = valid_namespace("abcdefghijklmn12345"); g_assert_...
#include <glib.h> #include <stdlib.h> #include <stdint.h> #include <string.h> #include "../marquise.h" extern uint8_t valid_namespace(char *namespace); extern char* build_spool_path(const char *spool_prefix, char *namespace); void test_valid_namespace() { int ret = valid_namespace("abcdefghijklmn12345"); g_assert_...
Add basic setup for Elixir binding
// Regular C libs #include <stdio.h> // Elixir libs -- clang doesn't know where the hell this is #include "erl_nif.h" static ERL_NIF_TERM hello(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) { }
// Regular C libs #include <stdio.h> // Elixir libs -- clang doesn't know where the hell this is #include "erl_nif.h" // Needs to figure out what ERL_NIF_TERM means static ERL_NIF_TERM hello(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) { } static ErlNifFuncs funcs[] = { {"hello", 2, hello} }; ERL_NIF_INIT...
Add feedseek example to API docs.
/** \defgroup mpg123_examples example programs using libmpg123 @{ */ /** \file mpg123_to_wav.c A simple MPEG audio to WAV converter using libmpg123 (read) and libsndfile (write). ...an excersize on two simple APIs. */ /** \file mpglib.c Example program mimicking the old mpglib test program. It takes an MPEG bit...
/** \defgroup mpg123_examples example programs using libmpg123 @{ */ /** \file mpg123_to_wav.c A simple MPEG audio to WAV converter using libmpg123 (read) and libsndfile (write). ...an excersize on two simple APIs. */ /** \file mpglib.c Example program mimicking the old mpglib test program. It takes an MPEG bit...
Update the App Users documentation links
// // BOXAPIAccessTokenDelegate.h // BoxContentSDK // // Created by Andrew Chun on 6/6/15. // Copyright (c) 2015 Box. All rights reserved. // /** * App Users are full-featured enterprise Box accounts that belong to your application not a Box user. Unlike typical Box accounts, * these accounts do not have an ass...
// // BOXAPIAccessTokenDelegate.h // BoxContentSDK // // Created by Andrew Chun on 6/6/15. // Copyright (c) 2015 Box. All rights reserved. // /** * App Users are full-featured enterprise Box accounts that belong to your application not a Box user. Unlike typical Box accounts, * these accounts do not have an ass...
Allow local mass and mass to be set separately by form
inherit "/lib/string/sprint"; inherit "../support"; static string thing_form(object obj) { string buffer; buffer = "<h1>Object form</h1>\n"; buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; buffer += "<p>Mass: <input type=\"text\" name=\"mass\" value=\"" + mixed_sprint(o...
inherit "/lib/string/sprint"; inherit "../support"; static string thing_form(object obj) { string buffer; buffer = "<h1>Object form</h1>\n"; buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; buffer += "Mass: <input type=\"text\" name=\"mass\" value=\"" + mixed_sprint(obj-...
Check for EISDIR error as well. Fixed problems with BSD/OS.
/* Copyright (c) 2003 Timo Sirainen */ #include "lib.h" #include "mkdir-parents.h" #include <sys/stat.h> int mkdir_parents(const char *path, mode_t mode) { const char *p; if (mkdir(path, mode) < 0 && errno != EEXIST) { if (errno != ENOENT) return -1; p = strrchr(path, '/'); if (p == NULL || p == path) ...
/* Copyright (c) 2003 Timo Sirainen */ #include "lib.h" #include "mkdir-parents.h" #include <sys/stat.h> int mkdir_parents(const char *path, mode_t mode) { const char *p; /* EISDIR check is for BSD/OS which returns it if path contains '/' at the end and it exists. */ if (mkdir(path, mode) < 0 && errno != EEX...
Change int to long long
/** * @copyright Copyright 2016 The J-PET Framework Authors. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may find a copy of the License in the LICENCE file. * * Unless required by applicable la...
/** * @copyright Copyright 2016 The J-PET Framework Authors. All rights reserved. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may find a copy of the License in the LICENCE file. * * Unless required by applicable la...
Add an optional command line parameter to demostrate a custom form field
/* * Sample MPI "hello world" application in C * * J. Hursey * */ #include <stdio.h> #include "mpi.h" int main(int argc, char* argv[]) { int rank, size, len; char processor[MPI_MAX_PROCESSOR_NAME]; /* * Initialize the MPI library */ MPI_Init(&argc, &argv); /* * Get my 'rank' ...
/* * Sample MPI "hello world" application in C * * J. Hursey * */ #include <stdio.h> #include <string.h> #include <stdlib.h> #include "mpi.h" int main(int argc, char* argv[]) { int rank, size, len; char processor[MPI_MAX_PROCESSOR_NAME]; char *name = NULL; /* * Initialize the MPI library ...
Handle C11 compilers witout stdalign
#ifndef PSTDALIGN_H #define PSTDALIGN_H #ifndef __alignas_is_defined #ifndef __cplusplus #if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) /* C11 or newer */ #include <stdalign.h> #else #if defined(__GNUC__) || defined (__IBMC__) || defined(__clang__) #define _Alignas(...
#ifndef PSTDALIGN_H #define PSTDALIGN_H #ifndef __alignas_is_defined #ifndef __cplusplus #if ((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)) || defined(__IBMC__) #undef PORTABLE_C11_STDALIGN_MISSING #define PORTABLE_C11_STDALIGN_MISSING #endif #if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__)...
Correct initialisation of cull back faces.
// // Created by Asger Nyman Christiansen on 08/01/2017. // Copyright © 2017 Asger Nyman Christiansen. All rights reserved. // #pragma once namespace gle { class GLState { public: static void cull_back_faces(bool enable) { static bool currently_enabled = true; if(...
// // Created by Asger Nyman Christiansen on 08/01/2017. // Copyright © 2017 Asger Nyman Christiansen. All rights reserved. // #pragma once namespace gle { class GLState { public: static void cull_back_faces(bool enable) { static bool currently_enabled = false; if...
Fix temp profile setpoint interpolation.
#include "temp_profile.h" #include "sntp.h" float temp_profile_get_current_setpoint(const temp_profile_t* profile) { int i; uint32_t duration_into_profile = sntp_get_time() - profile->start_time; uint32_t step_begin = 0; float last_temp = profile->start_value.value; for (i = 0; i < profile->num_steps; ++i...
#include "temp_profile.h" #include "sntp.h" float temp_profile_get_current_setpoint(const temp_profile_t* profile) { int i; uint32_t duration_into_profile = sntp_get_time() - profile->start_time; uint32_t step_begin = 0; float last_temp = profile->start_value.value; for (i = 0; i < profile->num_steps; ++i...
Fix up missing newlines at eof
@interface ChromeBluetooth : CDVPlugin { } #pragma mark chrome.bluetoothLowEnergy interface // chrome.bluetooth and chrome.bluetoothLowEnergy uses same file because connect, and disconnect // a deivce requires the same instance of CBCentralManager that found the device. - (void)connect:(CDVInvokedUrlCommand*)com...
@interface ChromeBluetooth : CDVPlugin { } #pragma mark chrome.bluetoothLowEnergy interface // chrome.bluetooth and chrome.bluetoothLowEnergy uses same file because connect, and disconnect // a deivce requires the same instance of CBCentralManager that found the device. - (void)connect:(CDVInvokedUrlCommand*)com...
Use getloadavg() instead of using /proc, patch by Baptiste Daroussin
// vim:ts=8:expandtab #include "i3status.h" const char *get_load() { static char part[512]; /* Get load */ #ifdef LINUX slurp("/proc/loadavg", part, sizeof(part)); *skip_character(part, ' ', 3) = '\0'; #else /* TODO: correctly check for NetBSD, check if it works the same on *BSD */ ...
// vim:ts=8:expandtab #include "i3status.h" #include <err.h> #include <stdlib.h> #include <stdio.h> #include <string.h> const char *get_load() { static char part[512]; /* Get load */ #if defined(__FreeBSD__) || defined(linux) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__APPLE__) || defined(sun)...
Add generated file so that hg HEAD can be used with cmake.
/* This file was generated automatically by ./make_zip_err_str.sh from ./zip.h; make changes there. */ #include "zipint.h" const char * const _zip_err_str[] = { "No error", "Multi-disk zip archives not supported", "Renaming temporary file failed", "Closing zip archive failed", "Seek erro...
Build if GETC_MACRO use is disabled
/* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org> * * GNU Library General Public License (LGPL) version 2 or later. * * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ #include "_stdio.h" link_warning(gets, "the 'gets' function is dangerous and should not be used.") /* UNSAFE FU...
/* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org> * * GNU Library General Public License (LGPL) version 2 or later. * * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ #include "_stdio.h" link_warning(gets, "the 'gets' function is dangerous and should not be used.") /* UNSAFE FU...
Add new resource classes to the header.
// // SVNetworking.h // SVNetworking // // Created by Nate Stedman on 3/14/14. // Copyright (c) 2014 Svpply. All rights reserved. // #import <SVNetworking/NSObject+SVBindings.h> #import <SVNetworking/NSObject+SVMultibindings.h> #import <SVNetworking/SVDataRequest.h> #import <SVNetworking/SVDiskCache.h> #import <SV...
// // SVNetworking.h // SVNetworking // // Created by Nate Stedman on 3/14/14. // Copyright (c) 2014 Svpply. All rights reserved. // #import <SVNetworking/NSObject+SVBindings.h> #import <SVNetworking/NSObject+SVMultibindings.h> #import <SVNetworking/SVDataRequest.h> #import <SVNetworking/SVDiskCache.h> #import <SV...
Make this test portable to non-x86 hosts, patch by Mark Cianciosa!
// Test this without pch. // RUN: clang-cc -include %S/asm.h -fsyntax-only -verify %s && // Test with pch. // RUN: clang-cc -emit-pch -o %t %S/asm.h && // RUN: clang-cc -include-pch %t -fsyntax-only -verify %s void call_f(void) { f(); } void call_clobbers(void) { clobbers(); }
// Test this without pch. // RUN: clang-cc -triple i386-unknown-unknown -include %S/asm.h -fsyntax-only -verify %s && // Test with pch. // RUN: clang-cc -triple i386-unknown-unknown -emit-pch -o %t %S/asm.h && // RUN: clang-cc -triple i386-unknown-unknown -include-pch %t -fsyntax-only -verify %s void call_f(void) {...
Remove function now implemented in kremlib
#include <stdio.h> #include <stdlib.h> #include <inttypes.h> #include "Server.h" char char_of_uint8(uint8_t x) { return (char) x; } uint32_t bufstrcpy(char *dst, const char *src) { /* The F* precondition guarantees that src is zero-terminated */ return sprintf(dst, "%s", src); } uint32_t print_u32(char *dst, ...
#include <stdio.h> #include <stdlib.h> #include <inttypes.h> #include "Server.h" uint32_t bufstrcpy(char *dst, const char *src) { /* The F* precondition guarantees that src is zero-terminated */ return sprintf(dst, "%s", src); } uint32_t print_u32(char *dst, uint32_t i) { return sprintf(dst, "%"PRIu32, i); }
Add test case for visibility attributes
#include<stdlib.h> volatile int i1 __attribute__ ((visibility ("protected"))); volatile int i2 __attribute__ ((visibility ("default"))); volatile int i3 __attribute__ ((visibility ("hidden"))); volatile int i4 __attribute__ ((visibility ("protected"))); volatile int i5 __attribute__ ((visibility ("internal"))); int m...
Declare public function in header.
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifdef E_TYPEDEFS #else #ifndef E_INT_CONFIG_THEME_H #define E_INT_CONFIG_THEME_H EAPI E_Config_Dialog *e_int_config_theme(E_Container *con, const char *params __UNUSED__); EAPI void e_int_config_theme_import_done(E_Config_Dialog *dia); EAPI void...
/* * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #ifdef E_TYPEDEFS #else #ifndef E_INT_CONFIG_THEME_H #define E_INT_CONFIG_THEME_H EAPI E_Config_Dialog *e_int_config_theme(E_Container *con, const char *params __UNUSED__); EAPI void e_int_config_theme_import_done(E_Config_Dialog *dia); EAPI void...
Correct string length in pseries_of_derive_parent()
#include <linux/string.h> #include <linux/err.h> #include <linux/slab.h> #include <linux/of.h> #include "of_helpers.h" /** * pseries_of_derive_parent - basically like dirname(1) * @path: the full_name of a node to be added to the tree * * Returns the node which should be the parent of the node * described by pa...
#include <linux/string.h> #include <linux/err.h> #include <linux/slab.h> #include <linux/of.h> #include "of_helpers.h" /** * pseries_of_derive_parent - basically like dirname(1) * @path: the full_name of a node to be added to the tree * * Returns the node which should be the parent of the node * described by pa...
Add function to get current green thread at-will
#include "gc.h" #include "runtime_vars.h" #include "scheduler.h" GC_Env* __get_GC_Env() { #ifdef MULTITHREAD return get_currentthread()->gcEnv; #else return currentthread->gcEnv; #endif }
#include "gc.h" #include "runtime_vars.h" #include "scheduler.h" GC_Env* __get_GC_Env() { #ifdef MULTITHREAD return get_currentthread()->gcEnv; #else return currentthread->gcEnv; #endif } ThreadData* __mellow_get_cur_green_thread() { #ifdef MULTITHREAD return get_currentthread(); #else return current...
Expand max share name length to 256
/* * include/uapi/linux/cifs/cifs_mount.h * * Author(s): Scott Lovenberg (scott.lovenberg@gmail.com) * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 ...
/* * include/uapi/linux/cifs/cifs_mount.h * * Author(s): Scott Lovenberg (scott.lovenberg@gmail.com) * * This library is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License as published * by the Free Software Foundation; either version 2.1 ...
Declare C fallbacks in IDCT header.
/* * Copyright (c) 2010 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 contributin...
/* * Copyright (c) 2010 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 contributin...
Expand MCP messages to have user (modeled) and system (magic) types.
#ifndef __PACKET_TYPE_H__ #define __PACKET_TYPE_H__ enum PacketType { INVALID, USER, SHARED_MEM_REQ, SHARED_MEM_EVICT, SHARED_MEM_RESPONSE, SHARED_MEM_UPDATE_UNEXPECTED, SHARED_MEM_ACK, SHARED_MEM_TERMINATE_THREADS, MCP_REQUEST_TYPE, MCP_RESPONSE_TYPE, MCP_UTILIZATION_UPDATE_TYPE, ...
#ifndef __PACKET_TYPE_H__ #define __PACKET_TYPE_H__ enum PacketType { INVALID, USER, SHARED_MEM_REQ, SHARED_MEM_EVICT, SHARED_MEM_RESPONSE, SHARED_MEM_UPDATE_UNEXPECTED, SHARED_MEM_ACK, SHARED_MEM_TERMINATE_THREADS, MCP_REQUEST_TYPE, MCP_RESPONSE_TYPE, MCP_UTILIZATION_UPDATE_TYPE, ...
Remove unnecessary virtual keyword. Lower version number to minimun.
// @(#)root/cont // Author: Philippe Canal Aug 2013 /************************************************************************* * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
// @(#)root/cont // Author: Philippe Canal Aug 2013 /************************************************************************* * Copyright (C) 1995-2013, Rene Brun and Fons Rademakers. * * All rights reserved. * * ...
Add test code for array initialization.
// RUN: clang -checker-simple -verify %s // RUN: clang -checker-simple -analyzer-store-region -verify %s struct s { int data; int data_array[10]; }; typedef struct { int data; } STYPE; void f(void) { int a[10]; int (*p)[10]; p = &a; (*p)[3] = 1; struct s d; struct s *q; q = &d; q->data = 3; ...
// RUN: clang -checker-simple -verify %s // RUN: clang -checker-simple -analyzer-store-region -verify %s struct s { int data; int data_array[10]; }; typedef struct { int data; } STYPE; void f(void) { int a[10]; int (*p)[10]; p = &a; (*p)[3] = 1; struct s d; struct s *q; q = &d; q->data = 3; ...
Update driver version to 5.04.00-k5
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.04.00-k4"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2013 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.04.00-k5"
Use BANDIT_CONCAT instead of SNOWHOUSE_CONCAT macro
#ifndef BANDIT_REGISTRATION_REGISTRAR_H #define BANDIT_REGISTRATION_REGISTRAR_H #include <bandit/registration/spec_registry.h> namespace bandit { namespace detail { struct spec_registrar { spec_registrar(std::function<void()> func) { bandit::detail::specs().push_back(func); } }; } } #...
#ifndef BANDIT_REGISTRATION_REGISTRAR_H #define BANDIT_REGISTRATION_REGISTRAR_H #include <bandit/registration/spec_registry.h> namespace bandit { namespace detail { struct spec_registrar { spec_registrar(std::function<void()> func) { bandit::detail::specs().push_back(func); } }; } } #...
Remove useless explicit keyword on constructors without arguments.
/* * This file is part of SpeakEasy. * Copyright (C) 2012 Lambert Clara <lambert.clara@yahoo.fr> * * 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 Foundation, either version 3 of the * Licens...
/* * This file is part of SpeakEasy. * Copyright (C) 2012 Lambert Clara <lambert.clara@yahoo.fr> * * 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 Foundation, either version 3 of the * Licens...
Update the driver version to 8.06.00.12-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.06.00.08-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 6 #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.06.00.12-k" #define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MINOR_VER 6 #define QLA_DRIVER_PATCH_VER 0 #defi...
Update this to use a "valid" alignment.
// RUN: %llvmgcc -std=gnu99 %s -S -o - | grep ".*alloca.*align 32" extern void bar(int[]); void foo(int a) { int var[a] __attribute__((__aligned__(32))); bar(var); return; }
// RUN: %llvmgcc -std=gnu99 %s -S -o - | grep ".*alloca.*align 16" extern void bar(int[]); void foo(int a) { int var[a] __attribute__((__aligned__(16))); bar(var); return; }
Fix case sensitive import statement
/* * LastFmPopover.h * * Created by Sajid Anwar. * * Subject to terms and conditions in LICENSE.md. * */ #import <Cocoa/Cocoa.h> #import <LastFM/LastFm.h> #import "LastFmService.h" #define LASTFM_SIGN_IN_TAG 1 @interface LastFmPopover : NSPopover<NSPopoverDelegate> @property (retain) IBOutlet LastFmService ...
/* * LastFmPopover.h * * Created by Sajid Anwar. * * Subject to terms and conditions in LICENSE.md. * */ #import <Cocoa/Cocoa.h> #import <LastFm/LastFm.h> #import "LastFmService.h" #define LASTFM_SIGN_IN_TAG 1 @interface LastFmPopover : NSPopover<NSPopoverDelegate> @property (retain) IBOutlet LastFmService ...
Use stringWithUTF8String instead of deprecated stringWithCString
//*************************************************************************** extern "C" { #import <Cocoa/Cocoa.h> #import "RWPluginFramework.h" } //*************************************************************************** #pragma mark Logging #if ENABLE_LOGGING # define Log NSLog # define LOG_ENTRY NSLog(@"...
//*************************************************************************** extern "C" { #import <Cocoa/Cocoa.h> #import "RWPluginFramework.h" } //*************************************************************************** #pragma mark Logging #if ENABLE_LOGGING # define Log NSLog # define LOG_ENTRY NSLog(@"...
Add rempa_file_pages function by Will Newton <will.newton@imgtec.com>
/* * remap_file_pages() for uClibc * * Copyright (C) 2008 Will Newton <will.newton@imgtec.com> * * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. */ #include <sys/syscall.h> #ifdef __NR_remap_file_pages _syscall5(int, remap_file_pages, unsigned long, start, unsigned long, size, unsi...
Implement the equivalent of std::unique_ptr using boost::scoped_ptr.
//--------------------------------------------------------------------------- // $Id$ // Version: $Name$ // // Copyright (C) 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer // to the file deal.II/doc/l...
//--------------------------------------------------------------------------- // $Id$ // Version: $Name$ // // Copyright (C) 2009 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer // to the file deal.II/doc/l...
Define magic uids and gids for use in devfs_add_devsw[f]().
/* usual BSD style copyright here */ /* Written by Julian Elischer (julian@dialix.oz.au)*/ /* * $Id: devfsext.h,v 1.6 1996/01/21 09:03:04 julian Exp $ */ #ifndef _SYS_DEVFSECT_H_ #define _SYS_DEVFSECT_H_ 1 void *devfs_add_devsw(char *path, char *name, void *devsw, int minor, int chrblk, uid_t uid, gid_t ...
/* usual BSD style copyright here */ /* Written by Julian Elischer (julian@dialix.oz.au)*/ /* * $Id: devfsext.h,v 1.7 1996/01/25 07:17:05 phk Exp $ */ #ifndef _SYS_DEVFSECT_H_ #define _SYS_DEVFSECT_H_ 1 void *devfs_add_devsw(char *path, char *name, void *devsw, int minor, int chrblk, uid_t uid, gid_t gid...
Add generic header for CC2538 sensors
/* * Copyright (c) 2015, Zolertia - http://www.zolertia.com * Copyright (c) 2015, University of Bristol - http://www.bristol.ac.uk * 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. Re...
Add target requirements for those bots which don't handle x86.
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -O2 -o - %s | FileCheck %s // CHECK-LABEL: f: // CHECK: movl $1, %eax // CHECK-NEXT: #APP // CHECK-NEXT: outl %eax, $1 // CHECK-NEXT: #NO_APP static inline void pr41027(unsigned a, unsigned b) { if (__builtin_constant_p(a)) { __asm__ volatile...
// REQUIRES: x86-registered-target // RUN: %clang_cc1 -triple x86_64-unknown-unknown -S -O2 -o - %s | FileCheck %s // CHECK-LABEL: f: // CHECK: movl $1, %eax // CHECK-NEXT: #APP // CHECK-NEXT: outl %eax, $1 // CHECK-NEXT: #NO_APP static inline void pr41027(unsigned a, unsigned b) { if (__builtin_co...
Create wrapper for SDL_Init routine
#ifndef SDL_WRAPPER_H #define SDL_WRAPPER_H 1 //------------------------------------------------------------------- #include <SDL.h> #include "wrapper/exceptions.h" //------------------------------------------------------------------- namespace SDL { template<class ErrorHandler =Throw> class SDL { ErrorHandler handl...
Test case for r113248. Raar 8361341.
// RUN: not %llvmgcc -S %s -o /dev/null |& grep "error: assignment of read-only location" // PR 1603 int func() { const int *arr; arr[0] = 1; }
// RUN: not %llvmgcc_only -c %s -o /dev/null |& FileCheck %s // PR 1603 void func() { const int *arr; arr[0] = 1; // CXHECK: error: assignment of read-only location } struct foo { int bar; }; struct foo sfoo = { 0 }; int func2() { const struct foo *fp; fp = &sfoo; fp[0].bar = 1; // CHECK: error: assig...
Fix gateway header path in UWP
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #pragma once #include "pch.h" #include "..\..\..\..\core\inc\gateway_ll.h" #include "IGatewayModule.h" namespace Microsoft { namespace Azure { namespace IoT { namesp...
// Copyright (c) Microsoft. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. #pragma once #include "pch.h" #include "gateway.h" #include "IGatewayModule.h" namespace Microsoft { namespace Azure { namespace IoT { namespace Gateway { interfac...
Add a virtual destructor to SimpleWebMimeRegistryImpl so that child class destructors get called correctly.
// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this // source code is governed by a BSD-style license that can be found in the // LICENSE file. #ifndef WEBMIMEREGISTRY_IMPL_H_ #define WEBMIMEREGISTRY_IMPL_H_ #include "third_party/WebKit/WebKit/chromium/public/WebMimeRegistry.h" namespace we...
// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this // source code is governed by a BSD-style license that can be found in the // LICENSE file. #ifndef WEBMIMEREGISTRY_IMPL_H_ #define WEBMIMEREGISTRY_IMPL_H_ #include "third_party/WebKit/WebKit/chromium/public/WebMimeRegistry.h" namespace we...
Add library to make secret logs
#include <kotaka/paths/system.h> inherit "~System/lib/struct/list"; private mapping buffers; private void append_node(string file, string fragment) { mixed **list; if (!buffers) { buffers = ([ ]); } list = buffers[file]; if (!list) { list = ({ nil, nil }); buffers[file] = list; } list_append_string(...
Print seed to stderr, not stdout.
#include "random.h" #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> void seed_random(void) { /* Single iteration of Xorshift to get a good seed. */ unsigned int seed = time(NULL) ^ getpid(); seed ^= (seed << 19); seed ^= (seed >> 11); seed ^= (seed << 9); printf("seed = %u\n", seed...
#include "random.h" #include <stdio.h> #include <stdlib.h> #include <time.h> #include <unistd.h> void seed_random(void) { /* Single iteration of Xorshift to get a good seed. */ unsigned int seed = time(NULL) ^ getpid(); seed ^= (seed << 19); seed ^= (seed >> 11); seed ^= (seed << 9); fprintf(stderr, "seed = %u...
Use explicit constructors for correctness
#ifndef ARGON2_NODE_H #define ARGON2_NODE_H #include <memory> #include <nan.h> namespace NodeArgon2 { class HashAsyncWorker final: public Nan::AsyncWorker { public: HashAsyncWorker(std::string&& plain, std::string&& salt, std::tuple<uint32_t, uint32_t, uint32_t, argon2_type>&& params); void Exec...
#ifndef ARGON2_NODE_H #define ARGON2_NODE_H #include <memory> #include <nan.h> namespace NodeArgon2 { class HashAsyncWorker final: public Nan::AsyncWorker { public: explicit HashAsyncWorker(std::string&& plain, std::string&& salt, std::tuple<uint32_t, uint32_t, uint32_t, argon2_type>&& params); ...
Implement the inverse tangent function.
#include <pal.h> /** * * Calculates inverse tangent (arc tangent) of the input value. The function * returns a value between -pi/2 to pi/2 but does not check for illegal input * values. * * @param a Pointer to input vector * * @param c Pointer to output vector * * @param n Size of 'a' and 'c' vec...
#include <pal.h> /* * -1 <= x <= 1 * atan x = a1 * x + a3 * x^3 + ... + a9 * x^9 + e(x) * |e(x)| <= 10^-5 */ static inline float _p_atan(const float x) { const float a1 = 0.9998660f; const float a3 = -0.3302995f; const float a5 = 0.1801410f; const float a7 = -0.0851330f; const float a9 = 0.0...