Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Fix runtime bug caused by typo.
/* * Copyright (c) 2015 Nathan Osman * * 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, publis...
/* * Copyright (c) 2015 Nathan Osman * * 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, publis...
Add memory module to package header
/** * --------------------------------------------------------------------------- * @file core.h * @brief The package header. * */ #pragma once #include "./types.h" #include "./error.h" #include "./fault.h" #include "./trace.h" #include "./results.h" #include "./cast.h"
/** * --------------------------------------------------------------------------- * @file core.h * @brief The package header. * */ #pragma once #include "./types.h" #include "./error.h" #include "./fault.h" #include "./trace.h" #include "./results.h" #include "./cast.h" #include "./memory.h"
Add missing inline for accessing factors in fmpz_mod_poly.
/*============================================================================= This file is part of FLINT. FLINT is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, ...
Add missing key comparison function parameter
#include <stdlib.h> #ifndef __BST_H__ #define __BST_H__ struct BSTNode; struct BST; typedef struct BSTNode BSTNode; typedef struct BST BST; BST* BST_Create(void); BSTNode* BSTNode_Create(void* k); void BST_Inorder_Tree_Walk(BST* T, void (f)(void*)); void BST_Preorder_Tree_Walk(BST* T, void (f)(void*)); void BST_Postor...
#include <stdlib.h> #ifndef __BST_H__ #define __BST_H__ struct BSTNode; struct BST; typedef struct BSTNode BSTNode; typedef struct BST BST; BST* BST_Create(void); BSTNode* BSTNode_Create(void* k); void BST_Inorder_Tree_Walk(BST* T, void (f)(void*)); void BST_Preorder_Tree_Walk(BST* T, void (f)(void*)); void BST_Postor...
Add List Node creation function implementation
#include "list.h" struct ListNode { ListNode* prev; ListNode* next; void* k; }; struct List { ListNode* head; }; List* List_Create(void) { List* l = (List *)malloc(sizeof(List)); l->head = NULL; return l; }
#include "list.h" struct ListNode { ListNode* prev; ListNode* next; void* k; }; struct List { ListNode* head; }; List* List_Create(void) { List* l = (List *)malloc(sizeof(List)); l->head = NULL; return l; } ListNode* ListNode_Create(void* k) { ListNode* n = (ListNode *)malloc(sizeof(ListNode)); n->prev = N...
Rewrite match line to be friendlier to misc buildbots.
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s // Radar 8026855 int test (void *src) { register int w0 asm ("0"); // CHECK: call i32 asm "ldr $0, [$1]", "={ax},r,~{dirflag},~{fpsr},~{flags}"(i8* %tmp) asm ("ldr %0, [%1]": "=r" (w0): "r" (src)); return w0; }
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s // Radar 8026855 int test (void *src) { register int w0 asm ("0"); // CHECK: call i32 asm "ldr $0, [$1]", "={ax},r,~{dirflag},~{fpsr},~{flags}"(i8* asm ("ldr %0, [%1]": "=r" (w0): "r" (src)); return w0; }
Test for new system clock
#ifndef CODETREE_H #define CODETREE_H #include "constants.h" typedef struct operation{ char *sign; bool isCommunitative; bool isAssociative; int precedence; } Operation; typedef struct node{ char *name; Operation *op; struct node *left; struct node *right; bool isRoot; int ran...
#ifndef CODETREE_H #define CODETREE_H #include "constants.h" typedef struct operation{ char *sign; bool isCommunitative; bool isAssociative; int precedence; } Operation; typedef struct node{ char *name; Operation *op; struct node *left; struct node *right; bool isRoot; int ran...
Fix test due to mempool internal change.
/* EINA - EFL data type library * Copyright (C) 2008 Cedric Bail * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later...
/* EINA - EFL data type library * Copyright (C) 2008 Cedric Bail * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later...
Add throw to what() function for linux compile
#pragma once #include <exception> #include <string> namespace core { class Exception : public std::exception { public: Exception(); virtual ~Exception(); virtual char const * what() const override; protected: void setMessage(const std::string& message); private: std::string _message; }; }
#pragma once #include <exception> #include <string> namespace core { class Exception : public std::exception { public: Exception(); virtual ~Exception(); virtual char const * what() const throw() override; protected: void setMessage(const std::string& message); private: std::string _message; }; ...
Add property for search item object
// // SearchItem.h // bikepath // // Created by Farheen Malik on 8/15/14. // Copyright (c) 2014 Bike Path. All rights reserved. // #import <Foundation/Foundation.h> @interface SearchItem : NSObject @end
// // SearchItem.h // bikepath // // Created by Farheen Malik on 8/15/14. // Copyright (c) 2014 Bike Path. All rights reserved. // #import <Foundation/Foundation.h> @interface SearchItem : NSObject @property NSString *searchQuery; @property (readonly) NSDate *creationDate; @end
Solve Distance Between Two Points in c
#include <math.h> #include <stdio.h> int main() { float x1, y1, x2, y2; scanf("%f %f", &x1, &y1); scanf("%f %f", &x2, &y2); printf("%.4f\n", sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1))); }
Add ASH_EXPORT to base class of exported WindowSelectorController.
// Copyright 2013 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 ASH_WM_WINDOW_SELECTOR_DELEGATE_H_ #define ASH_WM_WINDOW_SELECTOR_DELEGATE_H_ #include "base/compiler_specific.h" namespace aura { class Window;...
// Copyright 2013 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 ASH_WM_WINDOW_SELECTOR_DELEGATE_H_ #define ASH_WM_WINDOW_SELECTOR_DELEGATE_H_ #include "ash/ash_export.h" #include "base/compiler_specific.h" na...
Add expected fail triple x86_64-pc-windows-gnu to test as x86_64-w64-mingw32 is already there
// RUN: %clang_cc1 %s -o - -emit-llvm | FileCheck %s // XFAIL: aarch64, arm64, x86_64-pc-win32, x86_64-w64-mingw32 // PR1513 // AArch64 ABI actually requires the reverse of what this is testing: the callee // does any extensions and remaining bits are unspecified. // Win64 ABI does expect extensions for type smaller...
// RUN: %clang_cc1 %s -o - -emit-llvm | FileCheck %s // XFAIL: aarch64, arm64, x86_64-pc-win32, x86_64-w64-mingw32, x86_64-pc-windows-gnu // PR1513 // AArch64 ABI actually requires the reverse of what this is testing: the callee // does any extensions and remaining bits are unspecified. // Win64 ABI does expect exte...
Correct inconsistent use of override.
//===- BreakConstantGEPs.h - Change constant GEPs into GEP instructions --- --// // // The SAFECode Compiler // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===-------------...
//===- BreakConstantGEPs.h - Change constant GEPs into GEP instructions --- --// // // The SAFECode Compiler // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===-------------...
Add all the glue together to have an interpreter actually run.
// This is the actual main program int main(int argc, const char *argv[]) { }
// This is the actual main program #include "lorito.h" #include "microcode.h" #include "interp.h" #include "loader.h" int main(int argc, const char *argv[]) { int i; Lorito_Interp *interp; if (argc < 2) { fprintf(stderr, "Usage: lorito <bytecodefiles>\n"); return 255; } interp = lorito_init(); ...
Update files, Alura, Introdução a C - Parte 2, Aula 2.3
#include <stdio.h> int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); printf("%s\n", palavrasecreta); /* palavrasecreta[0] = 'M'; palavrasecreta[1] = 'E'; palavrasecreta[2] = 'L'; palavrasecreta[3] = 'A'; palavrasecreta[4] = 'N'; palavrasecreta[5] = 'C'; palavrasecreta[...
#include <stdio.h> int main() { char palavrasecreta[20]; sprintf(palavrasecreta, "MELANCIA"); int acertou = 0; int enforcou = 0; do { // comecar o nosso jogo!! } while(!acertou && !enforcou); }
Add basic test for do while statements
/* name: TEST008 description: Basic do while loop output: F1 G1 F1 main { - A2 I x A2 #I0 :I d L3 A2 A2 #I1 +I :I j L3 A2 #IA <I b L4 d L5 A2 A2 #I1 +I :I j L5 A2 #I14 <I b L6 yI A2 #I14 -I } */ int main() { int x; x = 0; do x = x + 1; while(x < 10); do { x = x + 1; } while(x < 20); retu...
Add example for log with formatting args
// cc log_example.c log.c -rdynamic #include "log.h" char make_segmentfault() { char *s = NULL; char ch = s[1]; // segment fault return ch; } int main(int argc, const char *argv[]) { /* open global logger to stderr (by setting filename to NULL) */ log_open("example", NULL, 0); /* set log leve...
// cc log_example.c log.c -rdynamic #include "log.h" char make_segmentfault() { char *s = NULL; char ch = s[1]; // segment fault return ch; } int main(int argc, const char *argv[]) { /* open global logger to stderr (by setting filename to NULL) */ log_open("example", NULL, 0); /* set log leve...
Add SET_STATIC opcode to enum
#pragma once enum class Opcode { INVALID = 0, NOP = 1, PUSH = 2, PUSH_STATIC = 3, POP = 4, SET = 5, CALL = 6, CALL_METHOD = 7, CALL_INTERNAL = 8, RETURN = 9, PRINT = 10, METHOD_END = 11 };
#pragma once enum class Opcode { INVALID = 0, NOP = 1, PUSH = 2, // pushes a reference into the stack PUSH_STATIC = 3, // pushes static data into the stack POP = 4, // pop anything to void SET = 5, // pop a reference from the stack and assign it SET_STATIC = 6, // set a reference to static data CALL = 7, ...
Add a big file test
/* * 06/21/2016: bigfile2.c */ #include <stdio.h> #include <fcntl.h> #include <errno.h> #include <stdlib.h> #include <unistd.h> main(int argc, char *argv[]) { long val; char *buf, *filename; int error = 0, readonly = 0; size_t i, j, c, fd, seed, size, bsize, nblocks; bsize = 5678; nblocks = 12345; seed = get...
Print name of test before parsing it - easier to identify segfaulting tests. On branch master Your branch is up-to-date with 'github/master'.
/*! @file main.c @brief A simple test program for the C library code. */ #include "stdio.h" #include "verilog_parser.h" int main(int argc, char ** argv) { if(argc < 2) { printf("ERROR. Please supply at least one file path argument.\n"); return 1; } else { int F = 0; ...
/*! @file main.c @brief A simple test program for the C library code. */ #include "stdio.h" #include "verilog_parser.h" int main(int argc, char ** argv) { if(argc < 2) { printf("ERROR. Please supply at least one file path argument.\n"); return 1; } else { int F = 0; ...
Test that simple expressions are simplified at -O0
// RUN: %clang %s -O0 -emit-llvm -S -o - | FileCheck %s void foo(); void bar(); void fold_if(int a, int b) { // CHECK: define {{.*}} @fold_if( // CHECK-NOT: = phi // CHECK: } if (a && b) foo(); else bar(); } void fold_for(int a, int b) { // CHECK: define {{.*}} @fold_for( // CHECK-NOT: = phi ...
Add BST preorder traversal function implementation
#include "bst.h" static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v); struct BSTNode { BSTNode* left; BSTNode* right; BSTNode* p; void* k; }; struct BST { BSTNode* root; }; BST* BST_Create(void) { BST* T = (BST* )malloc(sizeof(BST)); T->root = NULL; return T; } BSTNode* BSTNode_Create(void* k) { BS...
#include "bst.h" static void BST_Transplant(BST* T, BSTNode* u, BSTNode* v); struct BSTNode { BSTNode* left; BSTNode* right; BSTNode* p; void* k; }; struct BST { BSTNode* root; }; BST* BST_Create(void) { BST* T = (BST* )malloc(sizeof(BST)); T->root = NULL; return T; } BSTNode* BSTNode_Create(void* k) { BS...
Add missing z_abs. In BSD tradition this is in libm.a.
/* * cabs() wrapper for hypot(). * * Written by J.T. Conklin, <jtc@wimsey.com> * Placed into the Public Domain, 1994. */ #include <math.h> struct complex { double x; double y; }; double cabs(z) struct complex z; { return hypot(z.x, z.y); }
/* * cabs() wrapper for hypot(). * * Written by J.T. Conklin, <jtc@wimsey.com> * Placed into the Public Domain, 1994. */ #include <math.h> struct complex { double x; double y; }; double cabs(z) struct complex z; { return hypot(z.x, z.y); } double z_abs(z) struct complex *z; { return hypot(z->x, z->y); }...
Use sigaction instead of signal
#include <unistd.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> char **params; // double fork to avoid zombies and exec the python server void signal_handler() { if (fork() == 0) { execv(params[0], params); } return; } int main(int argc, char *argv[])...
#include <unistd.h> #include <signal.h> #include <stdio.h> #include <stdlib.h> #include <sys/types.h> #include <sys/wait.h> char **params; /* * Launch the lambda server. */ void signal_handler() { if (fork() == 0) { execv(params[0], params); } return; } /* * Install the handler and block all other signals w...
Make LED block compatible with PIL in model reference
#ifndef __MDAQLED_H #define __MDAQLED_H #ifndef MATLAB_MEX_FILE #include "gpio.h" #endif void mdaqled_init(void); void mdaqled_set(unsigned char led, unsigned char state); #endif
#ifndef __MDAQLED_H #define __MDAQLED_H #if (!defined MATLAB_MEX_FILE) && (!defined MDL_REF_SIM_TGT) #include "gpio.h" #endif void mdaqled_init(void); void mdaqled_set(unsigned char led, unsigned char state); #endif
Return codes of XLib functions are handled
#include <stdio.h> #include <string.h> #include <X11/Xlib.h> #include <X11/XKBlib.h> #include <X11/extensions/XKBrules.h> int main(int argc, char *argv[]) { Display *display = XOpenDisplay(NULL); XkbEvent event; XkbRF_VarDefsRec varDefs; XkbStateRec state; char *tmp = NULL; char *groups[XkbNumK...
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <X11/Xlib.h> #include <X11/XKBlib.h> #include <X11/extensions/XKBrules.h> #define DELIMETER "," #define LAYOUT_FORMAT "%s\r\n" int main(int argc, char *argv[]) { int rc = EXIT_FAILURE; XkbEvent event; XkbRF_VarDefsRec vd; XkbStateRec ...
Add fifth exercise from chapter 5.
/* Program that verifies that duplicated file descriptors share a file offset and open file status flags. */ #include <stdlib.h> #include <fcntl.h> #include <unistd.h> #include <stdio.h> #include <assert.h> void exitErr(const char* msg); int main(__attribute__((unused)) int _argc, __attribute__((unused)) char **...
Add skeleton for EBook plugin
/* * * OBEX Server * * Copyright (C) 2007-2008 Marcel Holtmann <marcel@holtmann.org> * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (a...
Include stdlib to get size_t.
#ifndef ITERATOR_H #define ITERATOR_H struct iterator { size_t index; void *iterable; void *current; void *(*next)(struct iterator *this); void (*destroy)(struct iterator *this); }; struct iterator *iterator_create(void *iterable, void *(*next)(struct iterator *)); void iterator_destroy(struct it...
#ifndef ITERATOR_H #define ITERATOR_H #include <stdlib.h> struct iterator { size_t index; void *iterable; void *current; void *(*next)(struct iterator *this); void (*destroy)(struct iterator *this); }; struct iterator *iterator_create(void *iterable, void *(*next)(struct iterator *)); void itera...
Define a whole bunch of new message tags for checkpoint and migration functions.
#if !defined(_CARMIPRO_H) #define _CARMIPRO_H #include "pvmsdpro.h" #define CARMI_FIRST (SM_LAST+1) #define CARMI_RESPAWN (CARMI_FIRST+1) #define CARMI_CHKPT (CARMI_FIRST+2) #define CARMI_ADDHOST (CARMI_FIRST+3) #endif
#if !defined(_CARMIPRO_H) #define _CARMIPRO_H #include "pvmsdpro.h" #define CARMI_FIRST (SM_LAST+1) #define CARMI_RESPAWN (CARMI_FIRST+1) #define CARMI_CHKPT (CARMI_FIRST+2) #define CARMI_ADDHOST (CARMI_FIRST+3) #define CARMI_SPAWN (CARMI_FIRST+4) #define CARMI_CKPT_ON_VACATE (CARMI_FIRST + 5) #define CARMI_LAST ...
Put the -d option into the usage: message
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <mkdio.h> float main(int argc, char **argv) { int opt; int debug = 0; char *ofile = 0; extern char version[]; opterr = 1; while ( (opt=getopt(argc, argv, "do:V")) != EOF ) { switch (opt) { case 'd': debug = 1; brea...
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <mkdio.h> float main(int argc, char **argv) { int opt; int debug = 0; char *ofile = 0; extern char version[]; opterr = 1; while ( (opt=getopt(argc, argv, "do:V")) != EOF ) { switch (opt) { case 'd': debug = 1; brea...
Add pragma once to camera auto switch header.
/* * cameraautoswitch.h * StatusSpec project * * Copyright (c) 2014-2015 Forward Command Post * BSD 2-Clause License * http://opensource.org/licenses/BSD-2-Clause * */ #include "igameevents.h" #include "../modules.h" class CCommand; class ConCommand; class ConVar; class IConVar; class CameraAutoSwitch...
/* * cameraautoswitch.h * StatusSpec project * * Copyright (c) 2014-2015 Forward Command Post * BSD 2-Clause License * http://opensource.org/licenses/BSD-2-Clause * */ #pragma once #include "igameevents.h" #include "../modules.h" class CCommand; class ConCommand; class ConVar; class IConVar; class Ca...
Update files, Alura, Introdução a C, Aula 2.2
#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? "...
#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? "...
Remove unused glyph font defines.
#define WIKIGLYPH_FORWARD @"\ue954" #define WIKIGLYPH_BACKWARD @"\ue955" #define WIKIGLYPH_DOWN @"\ue956" #define WIKIGLYPH_X @"\ue95e" #define WIKIGLYPH_FLAG @"\ue963" #define WIKIGLYPH_USER_SMILE @"\ue964" #define WIKIGLYPH_USER_SLEEP @"\ue965" #define WIKIGLYPH_CC @"\ue969" #define WIKIGLYPH_CITE @"\ue96b" #define W...
#define WIKIGLYPH_X @"\ue95e" #define WIKIGLYPH_FLAG @"\ue963" #define WIKIGLYPH_USER_SMILE @"\ue964" #define WIKIGLYPH_USER_SLEEP @"\ue965" #define WIKIGLYPH_CC @"\ue969" #define WIKIGLYPH_PUBLIC_DOMAIN @"\ue96c"
Add typedef to number of operators. This will help inside code to distinguish from counting particles, forces or operators.
/*===- Operator.h - libSimulation -============================================= * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef OPERATOR...
/*===- Operator.h - libSimulation -============================================= * * DEMON * * This file is distributed under the BSD Open Source License. See LICENSE.TXT * for details. * *===-----------------------------------------------------------------------===*/ #ifndef OPERATOR...
Clean up smyrna files: remove unnecessary globals modify libraries not to rely on code in cmd/smyrna remove static declarations from .h files remove unnecessary libraries mark unused code and clean up warnings
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (...
/* $Id$ $Revision$ */ /* vim:set shiftwidth=4 ts=8: */ /********************************************************** * This software is part of the graphviz package * * http://www.graphviz.org/ * * * * Copyright (...
Add unit tests for rocks.c.
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <glib.h> #include "cem/rocks.h" static void test_set_rock_blocks(void) { const int shape[2] = {10, 20}; double **z = (double**)malloc(sizeof(double*) * shape[0]); char **rock_type = (char**)malloc(sizeof(char*) * shape[0]); int i; char exp...
Make a pointer-signedness warning in testing magically disappear~
#include <glib.h> #include <stdlib.h> #include <string.h> #include "../marquise.h" void test_hash_identifier() { const char *id = "hostname:fe1.example.com,metric:BytesUsed,service:memory,"; size_t id_len = strlen(id); uint64_t address = marquise_hash_identifier(id, id_len); g_assert_cmpint(address, ==, 760288338...
#include <glib.h> #include <stdlib.h> #include <string.h> #include "../marquise.h" void test_hash_identifier() { const char *id = "hostname:fe1.example.com,metric:BytesUsed,service:memory,"; size_t id_len = strlen(id); uint64_t address = marquise_hash_identifier((const unsigned char*) id, id_len); g_assert_cmpint...
Add a header for use from C++
#ifndef __RSImg_h__ #define __RSImg_h__ #include <stdint.h> #include <stdio.h> extern "C" int RSImgFreadPPMP6Header(FILE *file, uint32_t *width, uint32_t *height, uint32_t *headerSize); #endif
Add primary header with initial API draft.
#ifndef http_h #define http_h typedef struct http_context_s http_context; typedef struct http_session_s http_session; typedef struct http_request_s http_request; /* * A Context is bound to a collection of sessions and * ongoing requests. Each thread in a process should have its * own Context to avoid deadlocks and...
Revert "Corregido Error en Funcion restar"
//codigo para hecer pruebas de como funciona github. //programa simple que suma, resta, multiplica y divide numeros ingresador por pantalla. #include <stdio.h> #include <stdlib.h> void sumar(int a, int b); void restar(int a,int b); int main() { int a,b; printf("Bienvenido... Ingrese 2 numeros"); printf ...
//codigo para hecer pruebas de como funciona github. //programa simple que suma, resta, multiplica y divide numeros ingresador por pantalla. #include <stdio.h> #include <stdlib.h> void sumar(int a, int b); void restar(int a,int b); int main() { int a,b; printf ("Primer numero: "); scanf ("%d",&a); ...
Fix volume control with ffmpeg 2.3
#ifndef SRC_CONFIG_H_S6A1C09K #define SRC_CONFIG_H_S6A1C09K /* package name */ #define PACKAGE "pianobar" #define VERSION "2014.06.08-dev" /* ffmpeg/libav quirks detection * ffmpeg’s micro versions always start at 100, that’s how we can distinguish * ffmpeg and libav */ #include <libavfilter/version.h> /* is "tim...
#ifndef SRC_CONFIG_H_S6A1C09K #define SRC_CONFIG_H_S6A1C09K /* package name */ #define PACKAGE "pianobar" #define VERSION "2014.06.08-dev" /* ffmpeg/libav quirks detection * ffmpeg’s micro versions always start at 100, that’s how we can distinguish * ffmpeg and libav */ #include <libavfilter/version.h> /* is "tim...
Fix compiler warning for nullable check
// // BFTaskCenter.h // Pods // // Created by Superbil on 2015/8/22. // // #import "Bolts.h" @interface BFTaskCenter : NSObject /*! A block that can act as a continuation for a task. */ typedef void (^BFTaskCenterBlock)(BFTask * _Nonnull task); + (nonnull instancetype)defaultCenter; - (instancetype)initWithEx...
// // BFTaskCenter.h // Pods // // Created by Superbil on 2015/8/22. // // #import "Bolts.h" NS_ASSUME_NONNULL_BEGIN @interface BFTaskCenter : NSObject /*! A block that can act as a continuation for a task. */ typedef void (^BFTaskCenterBlock)(BFTask * _Nonnull task); + (instancetype)defaultCenter; - (instan...
Unify and simplify a lot of pixomatic code
#pragma once #include "cal3d/global.h" #include "cal3d/vector.h" typedef unsigned long CalColor32; // 32-bit integer, compatible with NSPR inline CalColor32 CalMakeColor(CalVector cv) { return ( ( unsigned int ) ( cv.z * 0xff ) << 0) + ( ( ( unsigned int ) ( cv.y * 0xff ) ) << 8 ) + ...
#pragma once #include "cal3d/global.h" #include "cal3d/vector.h" typedef unsigned int CalColor32; // 32-bit integer, compatible with NSPR inline CalColor32 CalMakeColor(CalVector cv) { return ( ( unsigned int ) ( cv.z * 0xff ) << 0) + ( ( ( unsigned int ) ( cv.y * 0xff ) ) << 8 ) + ...
Add some definitions in Framework FV 0.9 spec but not in PI 1.0.
/** @file This file defines the data structures that are architecturally defined for file images loaded via the FirmwareVolume protocol. The Firmware Volume specification is the basis for these definitions. Copyright (c) 2006, Intel Corporation ...
Remove width, height and fps variable from YFrame struct
#ifndef __YANIMATED__ #define __YANIMATED__ typedef struct YFrame { int current; int first; int last; int width; int height; int fps; YFrame(){}; YFrame(int a_current, int a_first, int a_last, int a_width, int a_height, int a_fps): current(a_current), first...
#ifndef __YANIMATED__ #define __YANIMATED__ /*! Store animation frame indexes */ typedef struct YFrame { //! Default Constructor YFrame(): current(0), first(0), last(0){}; //! Constructor with parameters /*! \param Current animation frame index \param First animation frame index ...
Add standard ANSI-92 data types
/* * Use and distribution licensed under the Apache license version 2. * * See the COPYING file in the root project directory for full text. */ #ifndef SQLTOAST_DATA_TYPE_H #define SQLTOAST_DATA_TYPE_H namespace sqltoast { typedef enum data_type { DATA_TYPE_CHAR, DATA_TYPE_VARCHAR, DATA_TYPE_NCHAR, ...
Add SIG_SWITCH_TIME at Sat, 20 Sep 2014
#ifndef BITCOIN_TIMESTAMPS_H #define BITCOIN_TIMESTAMPS_H static const unsigned int ENTROPY_SWITCH_TIME = 1362791041; // Sat, 09 Mar 2013 01:04:01 GMT static const unsigned int STAKE_SWITCH_TIME = 1371686400; // Thu, 20 Jun 2013 00:00:00 GMT static const unsigned int TARGETS_SWITCH_TIME = 1374278400; // Sat, 20 Jul 20...
#ifndef BITCOIN_TIMESTAMPS_H #define BITCOIN_TIMESTAMPS_H static const unsigned int ENTROPY_SWITCH_TIME = 1362791041; // Sat, 09 Mar 2013 01:04:01 GMT static const unsigned int STAKE_SWITCH_TIME = 1371686400; // Thu, 20 Jun 2013 00:00:00 GMT static const unsigned int TARGETS_SWITCH_TIME = 1374278400; // Sat, 20 Jul 20...
Update default max tip age
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Copyright (c) 2014-2017 The Dash Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VALIDATION_H ...
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2015 The Bitcoin Core developers // Copyright (c) 2014-2017 The Dash Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_VALIDATION_H ...
Fix missing include of <cerrno>
//===-- xray_emulate_tsc.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===-- xray_emulate_tsc.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Test getipnodebyname() & gethostbyname() implementations.
/* * Copyright (C) 2000 Internet Software Consortium. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * * THE SOFTWARE IS PROVIDED "AS IS" AND ...
Define macro for size of proc parser
#ifndef FILE_UTILS_H #define FILE_UTILS_H #include <stdint.h> #include <string.h> #include <dirent.h> #define PATHLEN 32 #define MAXPATH 1024 #define PROC "/proc/" #define MEMINFO "/proc/meminfo" #define STATUS "/proc/%s/status" #define IO_STAT "/proc/%s/io" #define STAT "/proc/%s/stat" #define STAT_BUFFER 4096 ...
#ifndef FILE_UTILS_H #define FILE_UTILS_H #include <stdint.h> #include <string.h> #include <dirent.h> #define PATHLEN 32 #define MAXPATH 1024 #define PROC_SIZE 1024 #define PROC "/proc/" #define MEMINFO "/proc/meminfo" #define STATUS "/proc/%s/status" #define IO_STAT "/proc/%s/io" #define STAT "/proc/%s/stat" #d...
Add imports for the public categories in the umbrella header
// // HTMLKit.h // HTMLKit // // Created by Iska on 15/09/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for HTMLKit. extern double HTMLKitVersionNumber; //! Project version string for HTMLKit. extern const unsigned char HTMLKitVersionS...
// // HTMLKit.h // HTMLKit // // Created by Iska on 15/09/14. // Copyright (c) 2014 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> //! Project version number for HTMLKit. extern double HTMLKitVersionNumber; //! Project version string for HTMLKit. extern const unsigned char HTMLKitVersionS...
Add new line at end of file
#ifndef JOINABLE_IMPL #define JOINABLE_IMPL #include "joinable_types.h" #include "types/MediaObjectImpl.h" using ::com::kurento::kms::api::Joinable; using ::com::kurento::kms::api::Direction; using ::com::kurento::kms::api::StreamType; namespace com { namespace kurento { namespace kms { class JoinableImpl : public ...
#ifndef JOINABLE_IMPL #define JOINABLE_IMPL #include "joinable_types.h" #include "types/MediaObjectImpl.h" using ::com::kurento::kms::api::Joinable; using ::com::kurento::kms::api::Direction; using ::com::kurento::kms::api::StreamType; namespace com { namespace kurento { namespace kms { class JoinableImpl : public ...
Add Apron branched thread creation privatization test, where protected is unsound
// SKIP PARAM: --set ana.activated[+] apron extern int __VERIFIER_nondet_int(); #include <pthread.h> #include <assert.h> int g = 5; int h = 5; pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { return NULL; } int main() { int r = __VERIFIER_nondet_int(); pthread_t id; if (r) { pthr...
Add MRSHelper functions to Bridging Header
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "OpenMRSAPIManager.h" #import "LocationListTableViewController.h" #import "UIAlertView+Blocks.h"
// // Use this file to import your target's public headers that you would like to expose to Swift. // #import "OpenMRSAPIManager.h" #import "LocationListTableViewController.h" #import "UIAlertView+Blocks.h" #import "MRSHelperFunctions.h"
Add header file for publishing ArduinoJson objects and arrays
/* PubSubClient_JSON.h - ArduinoJson support for PubSubClient Copyright (C) 2016 Ian Tester This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your optio...
Fix compiler warnings in the test suite
inline string get_file_contents(char *filename) { ifstream file(filename, ios::in | ios::ate); if (!file.is_open()) return string(); streampos sz = file.tellg(); file.seekg(0, ios::beg); vector<char> v(sz); file.read(&v[0], sz); file.close(); string data(v.empty() ? string() : string (v.begin(), v.end()).c_st...
inline string get_file_contents(const char *filename) { ifstream file(filename, ios::in | ios::ate); if (!file.is_open()) return string(); streampos sz = file.tellg(); file.seekg(0, ios::beg); vector<char> v(sz); file.read(&v[0], sz); file.close(); string data(v.empty() ? string() : string (v.begin(), v.end()...
Make include flag name match file name.
#ifndef __NEW_ITERATOR_PYWRAP_H #define __NEW_ITERATOR_PYWRAP_H NPY_NO_EXPORT PyObject * NpyIter_NestedIters(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds); #endif
#ifndef __NDITER_PYWRAP_H #define __NDITER_PYWRAP_H NPY_NO_EXPORT PyObject * NpyIter_NestedIters(PyObject *NPY_UNUSED(self), PyObject *args, PyObject *kwds); #endif
Fix class name and remove GameObject::clean call.
#ifndef __PLAYER_H__ #define __PLAYER_H__ #include<iostream> #include"GameObject.h" class PLayer: public GameObject { public: void update(); void clean() { GameObject::clean(); std::cout << "clean PLayer"; } }; #endif
#ifndef __PLAYER_H__ #define __PLAYER_H__ #include<iostream> #include"GameObject.h" class Player: public GameObject { public: void update(); void clean() { std::cout << "clean PLayer"; } }; #endif
Remove include of header that doesn't exist (yet).
//===-- DIContext.h ---------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
//===-- DIContext.h ---------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Add info on I2C address
// Derived from blog post at http://www.ermicro.com/blog/?p=1239 #ifndef __MCP23008_H__ #define __MCP23008_H__ #include <compat/twi.h> #include "i2c_utils.h" #define MCP23008_ID 0x40 // MCP23008 I2C Device Identifier (0100, fixed) #define MCP23008_ADDR 0x00 // MCP23008 I2C Address (000-111 in bits 3..1) #defin...
// I/O functions for MCP23008 port expander using I2C/TWI protocol // Derived from blog post at http://www.ermicro.com/blog/?p=1239 #ifndef __MCP23008_H__ #define __MCP23008_H__ #include <compat/twi.h> #include "i2c_utils.h" // About the 7-bit I2C slave address MCP23008: // - The high bits 7..4 are fixed at 0100. /...
Add "\x" for hex part.
#pragma once #include <string> #include <ostream> #include <iomanip> #include <iostream> struct Hex { Hex(char *buffer, size_t size) : m_buffer(buffer) , m_size(size) { } friend std::ostream& operator <<(std::ostream &os, const Hex &obj) { unsigned char* aschar = (unsigne...
#pragma once #include <string> #include <ostream> #include <iomanip> #include <iostream> struct Hex { Hex(char *buffer, size_t size) : m_buffer(buffer) , m_size(size) { } friend std::ostream& operator <<(std::ostream &os, const Hex &obj) { unsigned char* aschar = (unsigne...
Add notify() function to print message around function call
#include "gdt.h" #include "idt.h" #include "vga.h" #include "term_printf.h" void kernel_main() { init_term(); term_puts(NAME " booting..."); term_puts("Initializing GDT..."); init_gdt(); term_puts("Initializing IDT..."); init_idt(); term_printf("term_printf is %d%% p%cre %s\n", 100, 'u', "awesome"); __asm__...
#include "gdt.h" #include "idt.h" #include "vga.h" #include "term_printf.h" void notify(void (*func)(), char *str) { term_putsn(str); func(); term_puts(" done"); } void kernel_main() { init_term(); term_puts(NAME " booting..."); notify(init_gdt, "Initializing GDT..."); notify(init_idt, "Initializing IDT...");...
Address David Blaikie comment by replacing grep with FileCheck.
// test for r305179 // RUN: %clang_cc1 -emit-llvm -O -mllvm -print-after-all %s -o %t 2>&1 | grep '*** IR Dump After Function Integration/Inlining ***' void foo() {}
// test for r305179 // RUN: %clang_cc1 -emit-llvm -O -mllvm -print-after-all %s -o %t 2>&1 | FileCheck %s // CHECK: *** IR Dump After Function Integration/Inlining *** void foo() {}
Initialize DeviceFuncs::ifuncs_ to zero in constructor
// Copyright (c) 2010 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 PPAPI_CPP_MODULE_IMPL_H_ #define PPAPI_CPP_MODULE_IMPL_H_ #include "ppapi/cpp/module.h" namespace { template <typename T> class DeviceFuncs...
// Copyright (c) 2010 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 PPAPI_CPP_MODULE_IMPL_H_ #define PPAPI_CPP_MODULE_IMPL_H_ #include "ppapi/cpp/module.h" namespace { template <typename T> class DeviceFuncs...
Revert __udivi3 (word in compiler always 32 bit)
/** * @file * @brief * * @date 16.05.12 * @author Anton Bondarev * @author Ilia Vaprol */ #include <limits.h> #include <stdint.h> #define MASK_DWORD (uint64_t)1 << ((WORD_BIT * 2) - 1) uint64_t __udivdi3(uint64_t num, uint64_t den) { uint64_t result = 0; int steps; if (den == 0) { return 0; } steps =...
/** * @file * @brief * * @date 16.05.12 * @author Anton Bondarev * @author Ilia Vaprol */ #include <stdint.h> uint64_t __udivdi3(uint64_t num, uint64_t den) { uint64_t result = 0; int steps; if (den == 0) { return 0; } steps = 0; result = 0; while (!(den & 0x8000000000000000)) { den <<= 1; ++st...
Change long int to int
/* * Author: hx1997 * Desc: жһȻǷΪƽԸβ */ #include <stdio.h> int is_automorphic(long int num) { long int sqrd = num * num; int lsig_digit, lsig_digit_sqrd; if(num > 44720) return -1; for(; num > 0; num /= 10, sqrd /= 10) { lsig_digit = num % 10; lsig_digit_sqrd = sqrd % 10; if(lsig_digit != lsig_di...
/* * Author: hx1997 * Desc: жһȻǷΪƽԸβ */ #include <stdio.h> int is_automorphic(int num) { int sqrd = num * num; int lsig_digit; int lsig_digit_sqrd; if(num > 44720) return -1; for(; num > 0; num /= 10, sqrd /= 10) { lsig_digit = num % 10; lsig_digit_sqrd = sqrd % 10; if(lsig_digit != lsig_digit_sq...
Add a test case for diagnostic suppression on a graph with cycles.
// RUN: %clang_cc1 -analyze -analyzer-checker=core -analyzer-config suppress-null-return-paths=true -analyzer-output=text -verify %s // expected-no-diagnostics int *returnNull() { return 0; } int coin(); // Use a float parameter to ensure that the value is unknown. This will create // a cycle in the generated Explode...
Update Skia milestone to 102
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 101 #endif
/* * Copyright 2016 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SK_MILESTONE #define SK_MILESTONE 102 #endif
Test debug label emission with local variables
// RUN: %ocheck 3 %s g() { return 3; } main() { if(0){ f(); // shouldn't hit a linker error here - dead code a: return g(); } goto a; }
// RUN: %ocheck 3 %s -g // test debug emission too g() { return 3; } main() { if(0){ int i; f(); // shouldn't hit a linker error here - dead code a: i = 2; return g(i); } goto a; }
Update ROOT version files to v5.34/23.
#ifndef ROOT_RVersion #define ROOT_RVersion /* Version information automatically generated by installer. */ /* * These macros can be used in the following way: * * #if ROOT_VERSION_CODE >= ROOT_VERSION(2,23,4) * #include <newheader.h> * #else * #include <oldheader.h> * #endif * */ #defin...
#ifndef ROOT_RVersion #define ROOT_RVersion /* Version information automatically generated by installer. */ /* * These macros can be used in the following way: * * #if ROOT_VERSION_CODE >= ROOT_VERSION(2,23,4) * #include <newheader.h> * #else * #include <oldheader.h> * #endif * */ #defin...
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...
Update RingOpenGL 1.1 - Add Constant (Source Code) : GL_ZERO
#include "ring.h" /* OpenGL 1.1 Extension Copyright (c) 2017 Mahmoud Fayed <msfclipper@yahoo.com> */ #include <GL/glew.h> #include <GL/glut.h> RING_FUNC(ring_get_gl_zero) { RING_API_RETNUMBER(GL_ZERO); } RING_API void ringlib_init(RingState *pRingState) { ring_vm_funcregister("get_gl_zero",ring_get_gl_zero); ...
Create macros for certain repetitive shifts
#ifndef PHYSICAL_ALLOCATOR_H #define PHYSICAL_ALLOCATOR_H typedef uint32_t page_frame_t; #define PAGE_FRAME_CACHE_SIZE 32 #define PAGE_FRAME_MAP_SIZE (PHYS_MEMORY_SIZE/8/PAGE_SIZE) // Linear search of page frame bitmap page_frame_t alloc_frame_helper(); void free_frame(page_frame_t frame); page_frame_t alloc_frame...
#ifndef PHYSICAL_ALLOCATOR_H #define PHYSICAL_ALLOCATOR_H #include <stdint.h> #include <stddef.h> #include <libk/kabort.h> #include <libk/kassert.h> #include <libk/kputs.h> #ifdef ARCH_X86 #include <arch/x86/memlayout.h> #endif #ifdef ARCH_USERLAND #include "tests/memlayout.h" #endif typedef uint32_t page_frame_t; ...
Use a better custom exception code.
/************************************************************************** * * Copyright 2015 Jose Fonseca * All Rights Reserved. * * 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 wit...
/************************************************************************** * * Copyright 2015 Jose Fonseca * All Rights Reserved. * * 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 wit...
Add dummy block implementation for Muen
/* * Copyright (c) 2017 Contributors as noted in the AUTHORS file * * This file is part of Solo5, a unikernel base layer. * * Permission to use, copy, modify, and/or distribute this software * for any purpose with or without fee is hereby granted, provided * that the above copyright notice and this permission no...
Remove outdated octApron comment from 06/24
// PARAM: --set ana.activated[+] "'var_eq'" // Copy of 04/45 with var_eq enabled // octApron needs to be included again and fixed #include <pthread.h> #include <stdio.h> pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int *p = (int *) ...
// PARAM: --set ana.activated[+] "'var_eq'" // Copy of 04/45 with var_eq enabled #include <pthread.h> #include <stdio.h> pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; void *t_fun(void *arg) { int *p = (int *) arg; pthread_mutex_lock(&mutex1); (*p)++; p...
Remove an old stdio.h include from the invalid-array test
// RUN: %clang_cc1 -triple x86_64-apple-darwin -fsyntax-only -verify %s // PR6913 #include <stdio.h> int main() { int x[10][10]; int (*p)[] = x; int i; for(i = 0; i < 10; ++i) { p[i][i] = i; // expected-error {{subscript of pointer to incomplete type 'int []'}} } } // rdar://13705391 void ...
// RUN: %clang_cc1 -triple=x86_64-apple-darwin -fsyntax-only -verify %s // PR6913 int main() { int x[10][10]; int (*p)[] = x; int i; for(i = 0; i < 10; ++i) { p[i][i] = i; // expected-error {{subscript of pointer to incomplete type 'int []'}} } } // rdar://13705391 void foo(int a[*][2]) {(v...
Convert a tab into a space
/* * File: executeStage.h * Author: Alex Savarda */ #define INSTR_COUNT 16 // Possible size of the instruction set #ifndef EXECUTESTAGE_H #define EXECUTESTAGE_H typedef struct { unsigned int stat; unsigned int icode; unsigned int ifun; unsigned int valC; unsigned int valA; unsigned...
/* * File: executeStage.h * Author: Alex Savarda */ #define INSTR_COUNT 16 // Possible size of the instruction set #ifndef EXECUTESTAGE_H #define EXECUTESTAGE_H typedef struct { unsigned int stat; unsigned int icode; unsigned int ifun; unsigned int valC; unsigned int valA; unsigned...
Remove inclusion of 'parser.h' and fix pointer type
/* This is main header file that is ought to be included as library */ //Include proper header files #include <string.h> #include <stdlib.h> #include <inttypes.h> #include "parser.h" //Function prototypes extern uint16_t MODBUSSwapEndian( uint16_t ); extern uint16_t MODBUSCRC16( uint16_t *, uint16_t );
/* This is main header file that is ought to be included as library */ //Include proper header files #include <string.h> #include <stdlib.h> #include <inttypes.h> //Function prototypes extern uint16_t MODBUSSwapEndian( uint16_t ); extern uint16_t MODBUSCRC16( uint8_t *, uint16_t );
Fix the small test to use Handle instead of On
#include "Components.h" class HealthComponent : public HealthComponentBase { public: HealthComponent(Entity* entity, int maxHealth, int startHealth, const int& Health): HealthComponentBase(entity, maxHealth, startHealth, Health) { } void OnHeal(int amount) { } void OnDamage(int amount) { } ...
#include "Components.h" class HealthComponent : public HealthComponentBase { public: HealthComponent(Entity* entity, int maxHealth, int startHealth, const int& Health): HealthComponentBase(entity, maxHealth, startHealth, Health) { } void HandleHeal(int amount) { } void HandleDamage(int amount) { ...
Use pointers to start of arrays
#include <stdio.h> int main(int argc, char *argv[]){ //create two arrays we care about int ages[] = {23,55,15,34,78,12}; char *names[] = { "Feinb", "Fhilp", "Wastan", "Wustak","Henris","Abkar" }; //safely get the size of ages int count = sizeof(ages) / sizeof(int); int i = 0; //first way using ...
#include <stdio.h> int main(int argc, char *argv[]){ //create two arrays we care about int ages[] = {23,55,15,34,78,12}; char *names[] = { "Feinb", "Fhilp", "Wastan", "Wustak","Henris","Abkar" }; //safely get the size of ages int count = sizeof(ages) / sizeof(int); int i = 0; //first way using ...
Fix a warning with -pedantic on some old gcc versions
#ifndef IFILE_H #define IFILE_H #include <vector> #include <memory> #include "IMediaLibrary.h" #include "ITrackInformation.h" class IAlbumTrack; class IShowEpisode; class ITrackInformation; class IFile { public: enum Type { VideoType, // Any video file, not being a tv show episode ...
#ifndef IFILE_H #define IFILE_H #include <vector> #include <memory> #include "IMediaLibrary.h" #include "ITrackInformation.h" class IAlbumTrack; class IShowEpisode; class ITrackInformation; class IFile { public: enum Type { VideoType, // Any video file, not being a tv show episode ...
Fix ChromeOS build (C99 break)
/* * Copyright (c) 2011 The WebRTC 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 contribut...
/* * Copyright (c) 2011 The WebRTC 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 contribut...
Add indent comment for header guard
/* * chewing-compat.h * * Copyright (c) 2014 * libchewing Core Team. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ #ifndef _CHEWING_COMPAT_ #define _CHEWING_COMPAT_ /** @brief indicate the internal encoding of data processing. * @si...
/* * chewing-compat.h * * Copyright (c) 2014 * libchewing Core Team. See ChangeLog for details. * * See the file "COPYING" for information on usage and redistribution * of this file. */ /* *INDENT-OFF* */ #ifndef _CHEWING_COMPAT_ #define _CHEWING_COMPAT_ /* *INDENT-ON* */ /** @brief indicate the internal...
Kill hands that reach five fingers
#include <stdio.h> typedef struct { int hands[2][2]; int turn; } Sticks; void sticks_create(Sticks *sticks) { sticks->hands[0][0] = 1; sticks->hands[0][1] = 1; sticks->hands[1][0] = 1; sticks->hands[1][1] = 1; sticks->turn = 0; } void sticks_play(Sticks *sticks, int actor, int target) { ...
#include <stdio.h> typedef struct { int hands[2][2]; int turn; } Sticks; void sticks_create(Sticks *sticks) { sticks->hands[0][0] = 1; sticks->hands[0][1] = 1; sticks->hands[1][0] = 1; sticks->hands[1][1] = 1; sticks->turn = 0; } void sticks_play(Sticks *sticks, int actor, int target) { ...
Add method to check audio device state
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once class VolumeTransformation; class VolumeController { public: struct DeviceInfo { std::wstring name; std::wstring id; }; /// <summary> /// Retrieves the cu...
// Copyright (c) 2015, Matthew Malensek. // Distributed under the BSD 2-Clause License (see LICENSE.txt for details) #pragma once class VolumeTransformation; class VolumeController { public: struct DeviceInfo { std::wstring name; std::wstring id; }; /// <summary> /// Retrieves the cu...
Add Vesal's version of 13/24 where mutex-oplus and mutex-meet are more precise than old and mine
// PARAM: --enable ana.int.interval // Copied & modified from 13/24. #include <pthread.h> #include <assert.h> int g2; pthread_mutex_t mutex1 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t mutex2 = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_t __global_lock = PTHREAD_MUTEX_INITIALIZER; void *t2_fun(void *arg) { pthread_m...
Use __typeof__ since typeof is unavailable in our build
#import "AsyncActualValue.h" namespace CedarAsync { template<typename T> struct InTimeMarker { T(^actualExpression)(void); const char *fileName; int lineNumber; }; template<typename T> const AsyncActualValue<T> operator,(const InTimeMarker<T> & marker, const Cedar::Matchers...
#import "AsyncActualValue.h" namespace CedarAsync { template<typename T> struct InTimeMarker { T(^actualExpression)(void); const char *fileName; int lineNumber; }; template<typename T> const AsyncActualValue<T> operator,(const InTimeMarker<T> & marker, const Cedar::Matchers...
Use OpenSSL engine by default.
/* Copyright 2000-2004 The Apache Software 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 applica...
/* Copyright 2000-2004 The Apache Software 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 applica...
Fix the constructor of OptimizePass
#pragma once #include "onnx/onnx_pb.h" #include "onnx/ir.h" namespace onnx { namespace optimization { enum class API_TYPE { PROTO, IR }; struct OptimizePass { std::string name; API_TYPE type; explicit OptimizePass(const std::string name, API_TYPE type) : name(name), type(type) { } virtual void op...
#pragma once #include "onnx/onnx_pb.h" #include "onnx/ir.h" namespace onnx { namespace optimization { enum class API_TYPE { PROTO, IR }; struct OptimizePass { std::string name; API_TYPE type; explicit OptimizePass(const std::string& name, API_TYPE type) : name(name), type(type) { } virtual void o...
Add BSD 3-clause open source header
#ifndef _AUTOMATON_H_ #define _AUTOMATON_H_ /* * type and function definitions for an automaton */ #include "event.h" #include "srpc/srpc.h" typedef struct automaton Automaton; void au_init(void); Automaton *au_create(char *program, RpcConnection rpc, char *ebuf); int au_destroy(unsigned lo...
#ifndef _AUTOMATON_H_ #define _AUTOMATON_H_ /* * Copyright (c) 2013, Court of the University of Glasgow * 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...
Make the registering and unregistering of the Notification private
#include "DefSoundDeviceState.h" #include "AudioEndPointLibraryImpl.h" // This class is exported from the AudioEndPointLibrary.dll namespace AudioEndPoint { class AUDIOENDPOINTLIBRARY_API CAudioEndPointLibrary { public: ~CAudioEndPointLibrary(); HRESULT OnDeviceStateChanged(LPCWSTR pwstr_dev...
#include "DefSoundDeviceState.h" #include "AudioEndPointLibraryImpl.h" // This class is exported from the AudioEndPointLibrary.dll namespace AudioEndPoint { class AUDIOENDPOINTLIBRARY_API CAudioEndPointLibrary { public: ~CAudioEndPointLibrary(); HRESULT OnDeviceStateChanged(LPCWSTR pwstr_dev...
Add fallback implemetation for rint()/round()
/* GTK - The GIMP Toolkit * Copyright (C) 2011 Chun-wei Fan <fanc999@yahoo.com.tw> * * Author: Chun-wei Fan <fanc999@yahoo.com.tw> * * 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;...
Test attribute merging for the availability attribute.
// RUN: %clang_cc1 "-triple" "x86_64-apple-darwin3.0.0-iphoneos" -fsyntax-only -verify %s void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1))); void f1(int) __attribute__((availability(ios,introduced=2.1))); void f2(int) __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); void f3...
// RUN: %clang_cc1 "-triple" "x86_64-apple-darwin3.0.0-iphoneos" -fsyntax-only -verify %s void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1))); void f1(int) __attribute__((availability(ios,introduced=2.1))); void f2(int) __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); void f3...
Change return value of run to bool
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATION_H_ #include <unordered_map> #include "../ds_task_typedefs.h" namespace You { namespace DataStore { /// A pure virtual class of operations to be put into transaction stack class IOperation { public: /// The constructor ...
#pragma once #ifndef YOU_DATASTORE_INTERNAL_OPERATION_H_ #define YOU_DATASTORE_INTERNAL_OPERATION_H_ #include <unordered_map> #include "../ds_task_typedefs.h" namespace You { namespace DataStore { /// A pure virtual class of operations to be put into transaction stack class IOperation { public: /// The constructor ...
Comment out conflicting debug macro
/* This file is part of ethash. ethash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ethash is distributed in the hope that i...
/* This file is part of ethash. ethash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. ethash is distributed in the hope that i...
Use double instead of float
#include <stdio.h> #include <math.h> float f(float x) { return 1/x; } int main(int argc, char *argv[]) { // Integral (1 to 6) of 1/x float integral; float a = 1, b = 6; int n = 2000; float h; float x; h = (b-a)/n; integral = (f(a) + f(b)) / 2.0; x = a; for (int i = 1; i...
#include <stdio.h> #include <math.h> double f(double x) { return 1 / x; } int main(int argc, char *argv[]) { // Integral (1 to 6) of 1/x double integral; int a = 1, b = 6; int n = 2000; double h; double x; h = (double)(b-a)/n; integral = (f(a) + f(b)) / 2.0; x = a; for (int...