Instruction
stringlengths
14
778
input_code
stringlengths
0
4.24k
output_code
stringlengths
1
5.44k
Add timing and formating for times
#include "stdio.h" #include "stdlib.h" #define TRIALS 4 #define MATRIX_SIZE 2048 short A[MATRIX_SIZE][MATRIX_SIZE], B[MATRIX_SIZE][MATRIX_SIZE], C[MATRIX_SIZE][MATRIX_SIZE] = {{0}}; int main(int argc, char* argv[]) { // Initalize array A and B with '1's for (int i = 0; i < MATRIX_SIZE; ++i) for (int...
#include "stdio.h" #include "stdlib.h" #include "sys/time.h" #define TRIALS 4 #define MATRIX_SIZE 2048 short A[MATRIX_SIZE][MATRIX_SIZE], B[MATRIX_SIZE][MATRIX_SIZE], C[MATRIX_SIZE][MATRIX_SIZE] = {{0}}; int main(int argc, char* argv[]) { // Initalize array A and B with '1's for (int i = 0; i < MATRIX...
Solve a bug with line endings
/* INCLUDES */ #include <stdio.h> #include "commands.h" #define MAX_MSG_LENGTH 200 //For the receiving frame... (circular buffer) int main(int argc, char *argv[]) { char input_buffer[MAX_MSG_LENGTH]; int input_argc; char *input_argv[CMD_MAX_N_OPTIONS+CMD_MAX_N_OPTIONS_WITH_ARGS]; ...
/* INCLUDES */ #include <stdio.h> #include "commands.h" #define MAX_MSG_LENGTH 200 //For the receiving frame... (circular buffer) int main(int argc, char *argv[]) { char input_buffer[MAX_MSG_LENGTH]; int input_argc; char *input_argv[CMD_MAX_N_OPTIONS+CMD_MAX_N_OPTIONS_WITH_ARGS]; ...
Remove all chars from s2 in s1 O(n)
#include <limits.h> #include <stdio.h> #include <errno.h> /* K&R C (Dennis M. Ritchie & Brian W. Kernighan) Exercise 2-4. Write an alternative version of squeeze(s1,s2) that deletes each character in s1 that matches any character in the string s2. */ // O(n) solution int Squeeze(char* s1, const char* s2) { ...
UPDATE Uncommented door variables for reacting
#ifndef SSPAPPLICATION_ENTITIES_DOORENTITY_H #define SSPAPPLICATION_ENTITIES_DOORENTITY_H #include "Entity.h" #include <vector> class DoorEntity : public Entity { private: /*struct ElementState { int entityID; EVENT desiredState; bool desiredStateReached; }; std::vector<ElementState> m_elementStates;*/ ...
#ifndef SSPAPPLICATION_ENTITIES_DOORENTITY_H #define SSPAPPLICATION_ENTITIES_DOORENTITY_H #include "Entity.h" #include <vector> class DoorEntity : public Entity { private: struct ElementState { int entityID; EVENT desiredState; bool desiredStateReached; }; std::vector<ElementState> m_elementStates; bool...
Add C implementation for problem 1
#include <stdio.h> #define LIST_SIZE 1000 int divisible_by(int x, int y){ return x % y == 0; } int sum_multiples_of(int n1, int n2){ int list[LIST_SIZE], i, s; s = 0; for(i = 0; i < LIST_SIZE; i++){ if(divisible_by(i, n1) == 1 || divisible_by(i, n2) == 1){ list[i] = i; s += i; } } ret...
Switch to 32bit indices for gui rendering
#pragma once #include <ionMath.h> //---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4. #define IM_VEC2_CLASS_EXTRA \ ImVec2(const ion::vec2f& f) { x = f.X; y = f.Y; } ...
#pragma once #include <ionCore.h> //---- Define constructor and implicit cast operators to convert back<>forth from your math types and ImVec2/ImVec4. #define IM_VEC2_CLASS_EXTRA \ ImVec2(const ion::vec2f& f) { x = f.X; y = f.Y; } ...
Allow use of inline keyword in c++/c99 mode.
/* Copyright 2013 Google Inc. 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 obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ag...
/* Copyright 2013 Google Inc. 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 obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or ag...
Build Tools: Moved special test flags into -spec
/** * Copyright (c) 2015 Google Inc. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions an...
Fix compile warning of hash_map in OS X
#ifndef BERRY_COMMON_COMMON_H #define BERRY_COMMON_COMMON_H #if defined(__APPLE__) #include "TargetConditionals.h" #if ANGEL_MOBILE #include <sys/time.h> #import <Availability.h> #ifndef __IPHONE_5_0 #warning "This project uses features only available in iPhone SDK 5.0 and l...
#ifndef BERRY_COMMON_COMMON_H #define BERRY_COMMON_COMMON_H #if defined(__APPLE__) #include "TargetConditionals.h" #if ANGEL_MOBILE #include <sys/time.h> #import <Availability.h> #ifndef __IPHONE_5_0 #warning "This project uses features only available in iPhone SDK 5.0 and l...
Switch to NS_ASSUME_NONNULL_BEGIN and _END
/// /// Copyright (c) 2016 Dropbox, Inc. All rights reserved. /// #import <Foundation/Foundation.h> #import "DBHandlerTypes.h" /// /// Keychain class for storing OAuth tokens. /// @interface DBSDKKeychain : NSObject /// Stores a key / value pair in the keychain. + (BOOL)storeValueWithKey:(NSString * _Nonnull)key va...
/// /// Copyright (c) 2016 Dropbox, Inc. All rights reserved. /// #import <Foundation/Foundation.h> #import "DBHandlerTypes.h" NS_ASSUME_NONNULL_BEGIN /// /// Keychain class for storing OAuth tokens. /// @interface DBSDKKeychain : NSObject /// Stores a key / value pair in the keychain. + (BOOL)storeValueWithKey:(N...
Fix missing string in namespace std compiler error
#ifndef WINDOW_H #define WINDOW_H #include <ncurses.h> #include <array> #include "../game.h" // Used to define a datatype for calls to wborder struct Border { chtype ls, rs, ts, bs; chtype tl, tr, bl, br; }; class Window { public: Window(rect dim); // ctor ~Window(); // dtor ...
#ifndef WINDOW_H #define WINDOW_H #include <ncurses.h> #include <string> #include <array> #include "../game.h" // Used to define a datatype for calls to wborder struct Border { chtype ls, rs, ts, bs; chtype tl, tr, bl, br; }; class Window { public: Window(rect dim); // ctor ~Window(); ...
Test case for transparent PTH support.
// RUN: cp %s %t && // RUN: xcc -x c-header %t -o %t.pth && // RUN: xcc -### -S -include %t -x c /dev/null &> %t.log && // RUN: grep '"-token-cache" ".*/pth.c.out.tmp.pth"' %t.log // RUN: true
Move layoutMargin method and Frame method to public interface of UIView additions category. (mostly for testing purposes and those method should be public IMO anyway)
// // UIView+CLUViewRecordableAdditions.h // Clue // // Created by Ahmed Sulaiman on 5/27/16. // Copyright © 2016 Ahmed Sulaiman. All rights reserved. // #import <UIKit/UIKit.h> #import "CLUViewRecordableProperties.h" @interface UIView (CLUViewRecordableAdditions) <CLUViewRecordableProperties> - (NSDictionary *)...
// // UIView+CLUViewRecordableAdditions.h // Clue // // Created by Ahmed Sulaiman on 5/27/16. // Copyright © 2016 Ahmed Sulaiman. All rights reserved. // #import <UIKit/UIKit.h> #import "CLUViewRecordableProperties.h" @interface UIView (CLUViewRecordableAdditions) <CLUViewRecordableProperties> - (NSDictionary *)...
Remove no longer used SkipEncodingUnusedStreams.
/* * Copyright (c) 2013 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) 2013 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...
Implement + support in numbers
#pragma once #include <string> #include "Program.h" #include "ThingInstance.h" class NumberInstance : public ThingInstance { public: NumberInstance(int val) : val(val), ThingInstance(NumberInstance::methods) {}; virtual std::string text() const override { return std::to_string(val); } const int val; stat...
#pragma once #include <string> #include "Program.h" #include "ThingInstance.h" class NumberInstance : public ThingInstance { public: NumberInstance(int val) : val(val), ThingInstance(NumberInstance::methods) {}; virtual std::string text() const override { return std::to_string(val); } static void add() { ...
Make the member variables of MDx_HashFunction private instead of protected - no subclass needs access to any of these variables.
/** * MDx Hash Function * (C) 1999-2008 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_MDX_BASE_H__ #define BOTAN_MDX_BASE_H__ #include <botan/hash.h> namespace Botan { /** * MDx Hash Function Base Class */ class BOTAN_DLL MDx_HashFunction : public HashFunction { public: ...
/** * MDx Hash Function * (C) 1999-2008 Jack Lloyd * * Distributed under the terms of the Botan license */ #ifndef BOTAN_MDX_BASE_H__ #define BOTAN_MDX_BASE_H__ #include <botan/hash.h> namespace Botan { /** * MDx Hash Function Base Class */ class BOTAN_DLL MDx_HashFunction : public HashFunction { public: ...
Add file that should have been in r223027
//===---- MipsABIInfo.h - Information about MIPS ABI's --------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===-------------------------------------------------------...
Add remote array classes to headers.
// // SVNetworking.h // SVNetworking // // Created by Nate Stedman on 3/14/14. // Copyright (c) 2014 Svpply. All rights reserved. // #import "NSObject+SVBindings.h" #import "NSObject+SVMultibindings.h" #import "SVDataRequest.h" #import "SVDiskCache.h" #import "SVFunctional.h" #import "SVImageView.h" #import "SVJSO...
// // SVNetworking.h // SVNetworking // // Created by Nate Stedman on 3/14/14. // Copyright (c) 2014 Svpply. All rights reserved. // #import "NSObject+SVBindings.h" #import "NSObject+SVMultibindings.h" #import "SVDataRequest.h" #import "SVDiskCache.h" #import "SVFunctional.h" #import "SVImageView.h" #import "SVJSO...
Apply HAVE_CONFIG_H condition in src/tests/uiomux_test.h
/* * UIOMux: a conflict manager for system resources, including UIO devices. * Copyright (C) 2009 Renesas Technology Corp. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either ...
/* * UIOMux: a conflict manager for system resources, including UIO devices. * Copyright (C) 2009 Renesas Technology Corp. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either ...
Change K_32 const value to more readable (with floating point)
#include <stdio.h> float K_5_BY_9 = 5.0 / 9.0; float K_32 = 32; int SUCCESS = 0; int main(void) { float fahrenheit, celsius; int lower, upper, step; lower = 0; upper = 300; step = 20; printf("|-----------|\n"); printf("|%4s|%6s|\n", "F", "C"); printf("|-----------|\n"); f...
#include <stdio.h> float K_5_BY_9 = 5.0 / 9.0; float K_32 = 32.0; int SUCCESS = 0; int main(void) { float fahrenheit, celsius; int lower, upper, step; lower = 0; upper = 300; step = 20; printf("|-----------|\n"); printf("|%4s|%6s|\n", "F", "C"); printf("|-----------|\n"); ...
Add Sha1 class methods digest() and size()
// LAF Base Library // Copyright (c) 2001-2016 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef BASE_SHA1_H_INCLUDED #define BASE_SHA1_H_INCLUDED #pragma once #include <vector> #include <string> extern "C" struct SHA1Context; namespace b...
// LAF Base Library // Copyright (c) 2001-2016 David Capello // // This file is released under the terms of the MIT license. // Read LICENSE.txt for more information. #ifndef BASE_SHA1_H_INCLUDED #define BASE_SHA1_H_INCLUDED #pragma once #include <vector> #include <string> extern "C" struct SHA1Context; namespace b...
Define NSS_3_4 so that we get the right code and not Stan code that isn't quite ready.
/* Defines common to all versions of NSS */ #define NSPR20 1 #define MP_API_COMPATIBLE 1
/* Defines common to all versions of NSS */ #define NSPR20 1 #define MP_API_COMPATIBLE 1 #define NSS_3_4_CODE 1 /* Remove this when we start building NSS 4.0 by default */
Update Skia milestone to 52
/* * 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 51 #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 52 #endif
Add random_trunc function, which truncates (with integer modulus) instead of scaling (with floating point divide and multiply) the base random number.
#ifndef MISC__H__ #define MISC__H__ #include <sysdeps.h> extern void random_init(uint32 seed); extern uint32 random_int(void); #define random_float() (random_int() * (double)(1.0/4294967296.0)) #define random_scale(S) ((unsigned int)(random_float() * (S))) unsigned long strtou(const char* str, const char** end); cons...
#ifndef MISC__H__ #define MISC__H__ #include <sysdeps.h> extern void random_init(uint32 seed); extern uint32 random_int(void); #define random_float() (random_int() * (double)(1.0/4294967296.0)) #define random_scale(S) ((unsigned int)(random_float() * (S))) #define random_trunc(T) (random_int() % (T)) unsigned long st...
Add a private header for user-provided dom libs
/* Egueb_Dom - DOM * Copyright (C) 2011 - 2013 Jorge Luis Zapata * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later...
Make sure that the copy of the string is always null terminated
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you...
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you...
Remove double underscore from include guard.
/*========================================================================= Program: DICOM for VTK Copyright (c) 2012-2015 David Gobbi All rights reserved. See Copyright.txt or http://dgobbi.github.io/bsd3.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied ...
/*========================================================================= Program: DICOM for VTK Copyright (c) 2012-2015 David Gobbi All rights reserved. See Copyright.txt or http://dgobbi.github.io/bsd3.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied ...
Test for struct return-by-value, both caller and callee
// RUN: %ocheck 0 %s struct A { int x, y, z; int e, f; }; void clobber_args() { } struct A f(void) { clobber_args(0, 1, 2); // clobber the stret pointer return (struct A){ 1, 2, 3, 4, 5}; } int main() { struct A a; a = f(); if(a.x != 1 || a.y != 2 || a.z != 3 || a.e != 4 || a.f != 5) { abort(); } ...
Adjust declared types of llair intrinsics
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <stdbool.h> #include <stdlib.h> #ifdef __cplusplus extern "C" { #endif /* allocation that cannot fail */ void* __llair_a...
/* * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */ #include <stdbool.h> #include <stdlib.h> #ifdef __cplusplus extern "C" { #endif /* allocation that cannot fail */ void* __llair_a...
Add explaining comment for path property.
// // FileObject.h // arc // // Created by Jerome Cheng on 19/3/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> @interface FileObject : NSObject { @protected NSURL* _url; id _contents; BOOL _needsRefresh; } // The name of this object. @property (str...
// // FileObject.h // arc // // Created by Jerome Cheng on 19/3/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> @interface FileObject : NSObject { @protected NSURL* _url; id _contents; BOOL _needsRefresh; } // The name of this object. @property (str...
Include "setjmp_i.h". Abstract ia64-specific code into bsp_match() routine. Support any platform with at least 2 EH argument registers.
/* libunwind - a platform-independent unwind library Copyright (C) 2003-2004 Hewlett-Packard Co Contributed by David Mosberger-Tang <davidm@hpl.hp.com> This file is part of libunwind. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (...
Fix this on the bots and make the test more complete by enabling optimizations.
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s extern void foo_alias (void) __asm ("foo"); inline void foo (void) { return foo_alias (); } extern void bar_alias (void) __asm ("bar"); inline __attribute__ ((__always_inline__)) void bar (void) { return bar_alias (); } void f(void) { foo(); bar(); } // CHE...
// RUN: %clang_cc1 -emit-llvm %s -O1 -o - | FileCheck %s extern void foo_alias (void) __asm ("foo"); inline void foo (void) { return foo_alias (); } extern void bar_alias (void) __asm ("bar"); inline __attribute__ ((__always_inline__)) void bar (void) { return bar_alias (); } void f(void) { foo(); bar(); } //...
Add a triple to try to fix the buildbot error.
// RUN: clang-cc -fsyntax-only -verify %s typedef int i128 __attribute__((__mode__(TI))); typedef unsigned u128 __attribute__((__mode__(TI))); int a[((i128)-1 ^ (i128)-2) == 1 ? 1 : -1]; int a[(u128)-1 > 1LL ? 1 : -1]; // PR5435 __uint128_t b = (__uint128_t)-1;
// RUN: clang-cc -fsyntax-only -verify -triple x86_64-apple-darwin9 %s typedef int i128 __attribute__((__mode__(TI))); typedef unsigned u128 __attribute__((__mode__(TI))); int a[((i128)-1 ^ (i128)-2) == 1 ? 1 : -1]; int a[(u128)-1 > 1LL ? 1 : -1]; // PR5435 __uint128_t b = (__uint128_t)-1;
Standardize on nonnull attribute (vs __nonnull__)
// // DMNotificationObserver.h // Library // // Created by Jonathon Mah on 2011-07-11. // Copyright 2011 Delicious Monster Software. All rights reserved. // #import <Foundation/Foundation.h> /* The action block is passed the notification, the owner as a parameter (to avoid retain cycles), * and the triggering o...
// // DMNotificationObserver.h // Library // // Created by Jonathon Mah on 2011-07-11. // Copyright 2011 Delicious Monster Software. All rights reserved. // #import <Foundation/Foundation.h> /* The action block is passed the notification, the owner as a parameter (to avoid retain cycles), * and the triggering o...
Replace with portable version in C
/* hello.c build with: gcc -nostartfiles -fno-asynchronous-unwind-tables -Os -static -o hello hello.c strip -R .comment -s hello */ #include <unistd.h> const char message[] = "\n" "Hello from Docker.\n" "This message shows that your installation appears to be working correctly.\n" "\n" "To generate this message,...
Add tests for id generation and ISO date strings
#ifndef ENTRYTESTSUITE #define ENTRYTESTSUITE #include <cxxtest/TestSuite.h> #include "../src/entry.h" class EntryTestSuite : public CxxTest::TestSuite { public: void testEntryHasGivenTitle(void) { testEntry.setTitle("testTitle"); TS_ASSERT_SAME_DATA(testEntry.title().c_str(), "testTitle", 9);...
#ifndef ENTRYTESTSUITE #define ENTRYTESTSUITE #include <cxxtest/TestSuite.h> #include <qt5/QtCore/QDateTime> #include "../src/entry.h" class EntryTestSuite : public CxxTest::TestSuite { public: void testTitleCanBeSetCorrectly(void) { testEntry.setTitle("testTitle"); TS_ASSERT_SAME_DATA(testEntry.t...
Add another autoload key for TDataFrameImpl'
/************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing...
/************************************************************************* * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * * All rights reserved. * * * * For the licensing...
Fix test that wasn't testing anything
// RUN: mkdir -p %t.dir // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t.dir // RUN: ls %t.dir | not grep report // RUN: rm -fR %t.dir // This tests that we do not currently emit HTML diagnostics for reports that // cross file boundaries. #include "html-diags-multifile.h" #define CALL_H...
// RUN: mkdir -p %t.dir // RUN: %clang_cc1 -analyze -analyzer-output=html -analyzer-checker=core -o %t.dir %s // RUN: ls %t.dir | not grep report // RUN: rm -fR %t.dir // This tests that we do not currently emit HTML diagnostics for reports that // cross file boundaries. #include "html-diags-multifile.h" #define CAL...
ADD - Added functional GPIO code to IMU folder
#include <stdio.h> #include <unistd.h> #include <errno.h> #include <signal.h> #include <stdlib.h> #include "mraa.h" #define thumb_f 8 #define index_f 9 #define middle_f 10 #define ring_f 11 #define pinky_f 12 int running = 0; int main(int argc, char** argv) { mraa_result_t r = MRAA_SUCCESS; mraa_init(); ...
Use right order of nonatomic and strong
/* PKRevealController - Copyright (C) 2012 Philip Kluz (Philip.Kluz@zuui.org) 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 u...
/* PKRevealController - Copyright (C) 2012 Philip Kluz (Philip.Kluz@zuui.org) 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 u...
Add some string utility functions.
// // string.h // pgf+ // // Created by Emil Djupfeldt on 2012-06-25. // Copyright (c) 2012 Chalmers University of Technology. All rights reserved. // #ifndef pgf__string_h #define pgf__string_h #include <string> #include <vector> namespace gf { static inline std::vector<std::string> split(const std::st...
Add copyright and RCS/CVS Id.
int dsinit(int, struct statinfo *, struct statinfo *, struct statinfo *); int dscmd(char *, char *, int, struct statinfo *);
/*- * Copyright (c) 1998 David E. O'Brien * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of co...
Fix JNI for C instead of C++
#include "org_bitcoin_NativeSecp256k1.h" #include "include/secp256k1.h" JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify (JNIEnv* env, jclass classObject, jobject byteBufferObject) { unsigned char* data = (unsigned char*) env->GetDirectBufferAddress(byteBufferObject); int sigLen = *...
#include "org_bitcoin_NativeSecp256k1.h" #include "include/secp256k1.h" JNIEXPORT jint JNICALL Java_org_bitcoin_NativeSecp256k1_secp256k1_1ecdsa_1verify (JNIEnv* env, jclass classObject, jobject byteBufferObject) { unsigned char* data = (unsigned char*) (*env)->GetDirectBufferAddress(env, byteBufferObject); int si...
Change mask size from 5 to 3
#pragma once #include "MyImage.h" #define MASK_SIZE 5 class Pixel { private: BYTE blue; BYTE green; BYTE red; public: Pixel(){ blue; green; red; } ~Pixel(){} BYTE GetBlue() { return blue; } BYTE GetGreen() { return green; } BYTE GetRed() { return red; } void Set(int _b, int _...
#pragma once #include "MyImage.h" #define MASK_SIZE 3 class Pixel { private: BYTE blue; BYTE green; BYTE red; public: Pixel(){ blue; green; red; } ~Pixel(){} BYTE GetBlue() { return blue; } BYTE GetGreen() { return green; } BYTE GetRed() { return red; } void Set(int _b, int _...
Use malloc/free as compile failed under MSVC. Ask rpmuller to check if okay.
#include "swap.h" #include <string.h> /* Swap generic function */ void swap(void *vp1, void *vp2, int size) { char buffer[size]; memcpy(buffer, vp1, size); memcpy(vp1,vp2,size); memcpy(vp2,buffer,size); }
#include "swap.h" #include <stdlib.h> #include <string.h> /* Swap generic function */ void swap(void *vp1, void *vp2, int size) { char* buffer = (char*) malloc(size*sizeof(char)); memcpy(buffer, vp1, size); memcpy(vp1,vp2,size); memcpy(vp2,buffer,size); free(buffer); }
Add missing NSObject protocol declaration.
//****************************************************************************** // // Copyright (c) 2016 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LI...
//****************************************************************************** // // Copyright (c) 2016 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LI...
Handle different sized wchar_t for windows.
// RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s // This should pass for any endianness combination of host and target. // This bit is taken from Sema/wchar.c so we can avoid the wchar.h include. typedef __WCHAR_TYPE__ wchar_t; #if defined(_WIN32) || defined(_M_IX86) || defined(__CYGWIN__) \ || defined(_M_X64) |...
// RUN: %clang_cc1 -emit-llvm %s -o - -triple i386-pc-win32 | FileCheck %s --check-prefix=WIN // RUN: %clang_cc1 -emit-llvm %s -o - -triple x86_64-apple-darwin | FileCheck %s --check-prefix=DAR // This should pass for any endianness combination of host and target. // This bit is taken from Sema/wchar.c so we can avoid...
Fix header file guard and API definitions
/* Copyright 2016 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ /* Header for tablet_mode.c */ #ifdef CONFIG_TABLET_MODE /* Return 1 if in tablet mode, 0 otherwise */ int tablet_get_mode(void); void tablet_set...
/* Copyright 2016 The Chromium OS 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 __CROS_EC_TABLET_MODE_H #define __CROS_EC_TABLET_MODE_H /** * Get tablet mode state * * Return 1 if in tablet mode, 0 otherwise */ int...
Move defines for error strings and dialogs into this file for central tracking of ids.
/* This header file contains all definitions needed for compatibility issues Most of them should be defined only if corresponding SYSDEF_XXX macro is defined (see system/sysdef.h) */ #ifndef OSDEFS_H #define OSDEFS_H int strcasecmp (const char *str1, const char *str2); int strncasecmp (char const *dst, ch...
/* This header file contains all definitions needed for compatibility issues Most of them should be defined only if corresponding SYSDEF_XXX macro is defined (see system/sysdef.h) */ #ifndef OSDEFS_H #define OSDEFS_H int strcasecmp (const char *str1, const char *str2); int strncasecmp (char const *dst, ch...
Add gyro sensor debug program
#pragma config(Sensor, S1, gyro, sensorI2CHiTechnicGyro) #define TIME_MAX 0xFFFF bool initialized = false; unsigned long lastUpdate = 0; long getTimeDelta() { if (!initialized) { initialized = true; lastUpdate = nSysTime; return 0; } long delta; if (nSysTime < lastUpdate) { // The time ha...
Add standard copyright notice; fix style bugs. (Reported by bde) Remove NO_NOLOGIN_LOG option now that we're off the root partition.
/*- * This program is in the public domain. I couldn't bring myself to * declare Copyright on a variant of Hello World. */ #include <sys/cdefs.h> __FBSDID("$FreeBSD$"); #include <sys/types.h> #include <sys/uio.h> #include <syslog.h> #include <unistd.h> #define MESSAGE "This account is currently not available.\n"...
/*- * Copyright (c) 2004 The FreeBSD Project. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list o...
Make parse() count the spaces in the regularized code string.
#include types.c #include <string.h> /* We can: Set something equal to something Function calls Function definitions Returning things -- delimiter '<' Printing things Iffing */ struct call parseCall(char* statement); struct function parseFunction(char* statement); char* fixSpacing(char* code) { c...
#include <stdlib.h> #include <stdio.h> #include types.c #include <string.h> /* We can: Set something equal to something Function calls Function definitions Returning things -- delimiter '<' Printing things Iffing */ struct call parseCall(char* statement); struct function parseFunction(char* statemen...
Remove the remaining ERR_ constants that are never used or tested for.
/* * * This file is part of Feng * * Copyright (C) 2009 by LScube team <team@lscube.org> * See AUTHORS for more details * * feng 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...
/* * * This file is part of Feng * * Copyright (C) 2009 by LScube team <team@lscube.org> * See AUTHORS for more details * * feng 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...
Fix a few warnings that prevented Travis from compiling
#include "ruby.h" #include "rtl-sdr.h" VALUE m_turtleshell = Qnil; static VALUE m_rtlsdr; static VALUE turtleshell_count() { return INT2NUM(rtlsdr_get_device_count()); } static VALUE turtleshell_new_device() { char *name; rtlsdr_dev_t *device = NULL; int count = rtlsdr_get_device_count(); // ensure we hav...
#include "ruby.h" #include "rtl-sdr.h" VALUE m_turtleshell = Qnil; VALUE c_device; static VALUE m_rtlsdr; static VALUE turtleshell_count() { return INT2NUM(rtlsdr_get_device_count()); } static VALUE turtleshell_new_device() { rtlsdr_dev_t *device = NULL; VALUE wrapped_device; VALUE hash; int count = rtlsdr...
Return with exit code from main functions
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "expression.h" #include "stream.h" #include "parser.h" #include "analyze.h" #include "generator.h" #include "backend.h" #include "optimize.h" int main(int argc, char *argv[]) { if (argc < 3) { fprintf(stderr, "usage: backend-test <input-file> <...
#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include "expression.h" #include "stream.h" #include "parser.h" #include "analyze.h" #include "generator.h" #include "backend.h" #include "optimize.h" int main(int argc, char *argv[]) { if (argc < 3) { fprintf(stderr, "usage: backend-test <input-file> <...
Add include file for standard unix functions we have to provide for systems like Windows
#ifndef COMPAT_H #define COMPAT_H #ifndef HAVE_STRCASECMP extern int strcasecmp(const char*, const char*); #endif #ifndef HAVE_STRNCASECMP extern int strncasecmp(const char*, const char*, unsigned int); #endif #endif
Update driver version to 5.02.00-k2
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2006 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k1"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2006 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k2"
Implement double to long double conversion
/* This file is part of Metallic, a runtime library for WebAssembly. * * Copyright (C) 2018 Chen-Pang He <chen.pang.he@jdh8.org> * * This Source Code Form is subject to the terms of the Mozilla * Public License v. 2.0. If a copy of the MPL was not distributed * with this file, You can obtain one at http://mozilla...
Work arounf use of weak when deployment target it iOS 4
// // KWFutureObject.h // iOSFalconCore // // Created by Luke Redpath on 13/01/2011. // Copyright 2011 LJR Software Limited. All rights reserved. // #import <Foundation/Foundation.h> typedef id (^KWFutureObjectBlock)(void); @interface KWFutureObject : NSObject { __weak id *objectPointer; KWFutureObjectBlock ...
// // KWFutureObject.h // iOSFalconCore // // Created by Luke Redpath on 13/01/2011. // Copyright 2011 LJR Software Limited. All rights reserved. // #import <Foundation/Foundation.h> #ifdef __weak #undef __weak #define __weak __unsafe_unretained #endif typedef id (^KWFutureObjectBlock)(void); @interface KWFutur...
Include file needed for slip rpl-border-router build
/* Copied from mc1322x/dev/cpu. This file exists as a work-around for the hardware dependant calls to slip_arch_init. Current the prototype for slip_arch_init is slip_arch_init(urb) and a typical call is something like slip_arch_init(BAUD2URB(115200)) BAUD2UBR is hardware specific, however. Further...
Use <functional> instead of <tr/functional>
// Copyright (c) 2017-2019 The Swipp developers // Copyright (c) 2019-2020 The Neutron Developers // // Distributed under the MIT/X11 software license, see the accompanying // file COPYING.daemon or http://www.opensource.org/licenses/mit-license.php. #ifndef NEUTRON_COLLECTIONHASHING_H #define NEUTRON_COLLECTIONHASHIN...
// Copyright (c) 2017-2019 The Swipp developers // Copyright (c) 2019-2020 The Neutron Developers // // Distributed under the MIT/X11 software license, see the accompanying // file COPYING.daemon or http://www.opensource.org/licenses/mit-license.php. #ifndef NEUTRON_COLLECTIONHASHING_H #define NEUTRON_COLLECTIONHASHIN...
Update files, Alura, Introdução a C, Aula 2.10
#include <stdio.h> #define NUMERO_DE_TENTATIVAS 5 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; ...
#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; int tentativas = 1; while(1...
Remove comment and add include guard
// Copyright 2019 Google 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 law or agreed to in...
// Copyright 2019 Google 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 law or agreed to in...
Use const T& instead of T&&
#pragma once #include <cuda_runtime.h> #include "xchainer/error.h" namespace xchainer { namespace cuda { class RuntimeError : public XchainerError { public: explicit RuntimeError(cudaError_t error); cudaError_t error() const noexcept { return error_; } private: cudaError_t error_; }; void CheckError(cu...
#pragma once #include <cuda_runtime.h> #include "xchainer/error.h" namespace xchainer { namespace cuda { class RuntimeError : public XchainerError { public: explicit RuntimeError(cudaError_t error); cudaError_t error() const noexcept { return error_; } private: cudaError_t error_; }; void CheckError(cu...
Change location of temporary file from /tmp to /var/tmp. This is a repeat of an earlier commit which apparently got lost with the last import. It helps solve the frequently reported problem
/*- * Copyright (c) 1998 Sendmail, Inc. All rights reserved. * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * By using this file, you agree to the terms and conditions set * forth in the LICENSE file which can be found at the top level of * the sendmail distrib...
/*- * Copyright (c) 1998 Sendmail, Inc. All rights reserved. * Copyright (c) 1990, 1993 * The Regents of the University of California. All rights reserved. * * By using this file, you agree to the terms and conditions set * forth in the LICENSE file which can be found at the top level of * the sendmail distrib...
Use RNDR in stack protector
/* * Copyright (c) 2018, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <stdint.h> #include <arch_helpers.h> #include <plat/common/platform.h> #define RANDOM_CANARY_VALUE ((u_register_t) 3288484550995823360ULL) u_register_t plat_get_stack_protector_canar...
/* * Copyright (c) 2021, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ #include <stdint.h> #include <arch_helpers.h> #include <arch_features.h> #include <plat/common/platform.h> #define RANDOM_CANARY_VALUE ((u_register_t) 3288484550995823360ULL) u_register_t pla...
Add printing even and odd numbers in separate threads.
#include <stdio.h> #include <pthread.h> #include <stdlib.h> #include <stdbool.h> #include <errno.h> #include <unistd.h> pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t condition = PTHREAD_COND_INITIALIZER; bool turn = true; int counter = 0; void* even_thread(void* arg) { do { pthread_mutex_lock...
Add string jump state source file including stub
/* * waysome - wayland based window manager * * Copyright in alphabetical order: * * Copyright (C) 2014-2015 Julian Ganz * Copyright (C) 2014-2015 Manuel Messner * Copyright (C) 2014-2015 Marcel Müller * Copyright (C) 2014-2015 Matthias Beyer * Copyright (C) 2014-2015 Nadja Sommerfeld * * This file is part o...
Change Interaction Observer Delegate to use Clue Touch model and NSArray instead of NSSet
// // CLUInteractionObserver.h // Clue // // Created by Ahmed Sulaiman on 6/7/16. // Copyright © 2016 Ahmed Sulaiman. All rights reserved. // #import <Foundation/Foundation.h> #import <UIKit/UIKit.h> @protocol CLUInteractionObserverDelegate <NSObject> @required - (void)touchesBegan:(NSSet<UITouch *> *)touches; -...
// // CLUInteractionObserver.h // Clue // // Created by Ahmed Sulaiman on 6/7/16. // Copyright © 2016 Ahmed Sulaiman. All rights reserved. // #import <Foundation/Foundation.h> #import "CLUTouch.h" @protocol CLUInteractionObserverDelegate <NSObject> @required - (void)touchesBegan:(NSArray<CLUTouch *> *)touches; -...
Make close, read and write virtual.
#ifndef FILE_DESCRIPTOR_H #define FILE_DESCRIPTOR_H #include <io/channel.h> class FileDescriptor : public Channel { LogHandle log_; protected: int fd_; public: FileDescriptor(int); ~FileDescriptor(); Action *close(EventCallback *); Action *read(size_t, EventCallback *); Action *write(Buffer *, EventCallback *...
#ifndef FILE_DESCRIPTOR_H #define FILE_DESCRIPTOR_H #include <io/channel.h> class FileDescriptor : public Channel { LogHandle log_; protected: int fd_; public: FileDescriptor(int); ~FileDescriptor(); virtual Action *close(EventCallback *); virtual Action *read(size_t, EventCallback *); virtual Action *write(B...
Add CoreMotion so that types can be detected
// // SRUtils.h // Sensorama // // Created by Wojciech Koszek (home) on 3/1/16. // Copyright © 2016 Wojciech Adam Koszek. All rights reserved. // @import Foundation; @import UIKit; @interface SRUtils : NSObject + (UIColor *)mainColor; + (NSDictionary *)deviceInfo; + (NSString*)computeSHA256DigestForString:(NSStr...
// // SRUtils.h // Sensorama // // Created by Wojciech Koszek (home) on 3/1/16. // Copyright © 2016 Wojciech Adam Koszek. All rights reserved. // @import Foundation; @import UIKit; @import CoreMotion; @interface SRUtils : NSObject + (UIColor *)mainColor; + (NSDictionary *)deviceInfo; + (NSString*)computeSHA256Di...
Fix buggy __phys_to_pfn / __pfn_to_phys
/* * linux/include/asm-arm/map.h * * Copyright (C) 1999-2000 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Page table mapping constructs and function p...
/* * linux/include/asm-arm/map.h * * Copyright (C) 1999-2000 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * Page table mapping constructs and function p...
Update Skia milestone to 66
/* * 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 65 #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 66 #endif
Update Skia milestone to 85
/* * 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 84 #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 85 #endif
Fix marching cubes unitialized variable
#pragma once #include <ionScene/CSimpleMesh.h> #include "SVolume.h" struct SMarchingCubesPoint { f32 Value; vec3f Gradient; SMarchingCubesPoint() {} SMarchingCubesPoint(f32 const & value) : Value(value) {} }; typedef SVolume<SMarchingCubesPoint> SMarchingCubesVolume; void Calculate...
#pragma once #include <ionScene/CSimpleMesh.h> #include "SVolume.h" struct SMarchingCubesPoint { f32 Value = 0; vec3f Gradient; SMarchingCubesPoint() {} SMarchingCubesPoint(f32 const & value) : Value(value) {} }; typedef SVolume<SMarchingCubesPoint> SMarchingCubesVolume; void Calcu...
Fix cut off BPM on aplite and basalt
#pragma once #include <pebble.h> #define BG_COLOR GColorWhite #define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12) #define BPM_FONT FONT_KEY_BITHAM_42_BOLD #define BPM_FONT_HEIGHT 42 #define BPM_DEFAULT "---" #define BPM_HINT_FONT FONT_KEY_GOTHIC_24_BOLD #define BPM_HINT_FONT_HEIGHT 24 #define BPM_HINT_TEXT "...
#pragma once #include <pebble.h> #define BG_COLOR GColorWhite #ifdef PBL_ROUND #define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 12) #else #define ACTION_BAR_WIDTH_WITH_GAP (ACTION_BAR_WIDTH + 2) #endif #define BPM_FONT FONT_KEY_BITHAM_42_BOLD #define BPM_FONT_HEIGHT 42 #define BPM_DEFAULT "---" #define BPM_HI...
Fix typo in a comment: it's base58, not base48.
#ifndef BITCOINADDRESSVALIDATOR_H #define BITCOINADDRESSVALIDATOR_H #include <QValidator> /** Base48 entry widget validator. Corrects near-miss characters and refuses characters that are no part of base48. */ class BitcoinAddressValidator : public QValidator { Q_OBJECT public: explicit BitcoinAddressVali...
#ifndef BITCOINADDRESSVALIDATOR_H #define BITCOINADDRESSVALIDATOR_H #include <QValidator> /** Base58 entry widget validator. Corrects near-miss characters and refuses characters that are not part of base58. */ class BitcoinAddressValidator : public QValidator { Q_OBJECT public: explicit BitcoinAddressVal...
Add BSD 3-clause open source header
/* * The Homework Database * * SQL Parser * * Authors: * Oliver Sharma and Joe Sventek * {oliver, joe}@dcs.gla.ac.uk * * (c) 2009. All rights reserved. */ #ifndef HWDB_PARSER_H #define HWDB_PARSER_H #include "sqlstmts.h" #include "gram.h" /* Places parsed output in externally declared global variable...
/* * 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 retain the above copyright notice, * thi...
Add preliminary structure for generic io handling.
/* *The MIT License (MIT) * * Copyright (c) <2016> <Stephan Gatzka> * * 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...
Add the string to search when parsing for token from website
#ifndef _CONFIG_H_ #define _CONFIG_H_ #define LOGINDB_FILE "logindb" #define LOGINDB_MAX 100 #define LOGINDB_MAXLINE 128 #define LOGIN_COOKIEJAR "cookie" #define LOGIN_COOKIESIZE 32 #define LOGIN_TOKENSIZE 64 #define LOGIN_URLMAXSIZE 256 static const char *haven_authserv = "moltke.seatribe.se"; static const char ...
#ifndef _CONFIG_H_ #define _CONFIG_H_ #define LOGINDB_FILE "logindb" #define LOGINDB_MAX 100 #define LOGINDB_MAXLINE 128 #define LOGIN_COOKIEJAR "cookie" #define LOGIN_COOKIESIZE 32 #define LOGIN_TOKENSIZE 64 #define LOGIN_URLMAXSIZE 256 #define LOGIN_TOKSTRSTART "<property name=\"jnlp.haven.authck\" value=\"" stati...
Add type definitions of structure documents
#ifndef ARTICLE_ANALYSIS_PROTOCOL_TYPES_H_ #define ARTICLE_ANALYSIS_PROTOCOL_TYPES_H_ #include <string.h> #include <time.h> #include <string> #include <vector> namespace protocol { namespace types { /** * Type of the document's title string. */ typedef std::wstring DocTitle; /** * Type of the user name str...
Add method to return path to db file
#include <sqlite3.h> #include <string.h> #include <stdlib.h> char * gh_db_path (char *data_dir) { char *db_file = "/ghighlighter.db"; int length = strlen (data_dir); length = length + strlen (db_file); char *path = malloc (length + sizeof (char)); strcat (path, data_dir); strcat (path, db_file); retur...
Fix ApiAnalyzer complaints about ImageIO headers.
//****************************************************************************** // // Copyright (c) 2016, Intel Corporation // Copyright (c) 2016 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EX...
//****************************************************************************** // // Copyright (c) 2016, Intel Corporation // Copyright (c) 2016 Microsoft Corporation. All rights reserved. // // This code is licensed under the MIT License (MIT). // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EX...
Add string jump state helper interface definition
/* * waysome - wayland based window manager * * Copyright in alphabetical order: * * Copyright (C) 2014-2015 Julian Ganz * Copyright (C) 2014-2015 Manuel Messner * Copyright (C) 2014-2015 Marcel Müller * Copyright (C) 2014-2015 Matthias Beyer * Copyright (C) 2014-2015 Nadja Sommerfeld * * This file is part o...
Add the calculations for the Oxygen Toxicity Unit
/* Oxygen Toxicity Unit Calulation */ #include <math> double otu_const(double time, double o2_ratio) { double otu = 0.0; otu = time * pow(( 0.5 / (o2_ratio - 0.5)), (-5/6)); return (otu); } double otu_descend(double time, double o2_ratio_i, double o2_r...
Fix case of file name
// ============================================================================= // PROJECT CHRONO - http://projectchrono.org // // Copyright (c) 2014 projectchrono.org // All right reserved. // // Use of this source code is governed by a BSD-style license that can be found // in the LICENSE file at the top level of th...
Add a compatibility layer for zmq 3
/* Copyright © 2001-2014, Canal TP and/or its affiliates. All rights reserved. This file is part of Navitia, the software to build cool stuff with public transport. Hope you'll enjoy and contribute to this project, powered by Canal TP (www.canaltp.fr). Help us simplify mobility and open public transport: ...
Add UNUSED so we get a clean compile.
#include <Elementary.h> #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif EAPI int elm_modapi_init(void *m) { return 1; // succeed always } EAPI int elm_modapi_shutdown(void *m) { return 1; // succeed always } EAPI Eina_Bool obj_hook(Evas_Object *obj) { return EINA_TRUE; } EAPI Eina_Bool o...
#include <Elementary.h> #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif EAPI int elm_modapi_init(void *m __UNUSED__) { return 1; // succeed always } EAPI int elm_modapi_shutdown(void *m __UNUSED__) { return 1; // succeed always } EAPI Eina_Bool obj_hook(Evas_Object *obj __UNUSED__) { retu...
Add a new example of the new M_LET feature.
#include <stdio.h> #include "m-string.h" #include "m-dict.h" #include "m-array.h" /* Definition of an associative map string_t --> size_t */ DICT_DEF2(dict_str, string_t, size_t) #define M_OPL_dict_str_t() DICT_OPLIST(dict_str, STRING_OPLIST, M_DEFAULT_OPLIST) /* Definition of an array of string_t */ ARRAY_DEF(vector...
Allow PS test03 with PS_ALLOW_ENTIRE_STORAGE_FILL flag
#include "val_interfaces.h" #include "pal_mbed_os_crypto.h" #include "lifecycle.h" #ifdef ITS_TEST void test_entry_s003(val_api_t *val_api, psa_api_t *psa_api); #elif PS_TEST #error [NOT_SUPPORTED] Test is too long for CI, thus always fails on timeout. void test_entry_p003(val_api_t *val_api, psa_api_t *psa_api); #end...
#include "val_interfaces.h" #include "pal_mbed_os_crypto.h" #include "lifecycle.h" #ifdef ITS_TEST void test_entry_s003(val_api_t *val_api, psa_api_t *psa_api); #elif PS_TEST #ifndef PS_ALLOW_ENTIRE_STORAGE_FILL #error [NOT_SUPPORTED] Test is too long for CI, thus always fails on timeout. #endif void test_entry_p003(v...
Use C99 stdint.h header for types
/* Mace - http://www.macehq.cx Copyright 1999-2004 See the file README for more information */ #ifndef GLOBALS_H #define GLOBALS_H #ifndef _MaceTypes #define _MaceTypes typedef unsigned char U8; typedef signed char S8; typedef unsigned short U16; typedef signed short S16; //Note: on 64-bit machines, replace "l...
/* Mace - http://www.macehq.cx Copyright 1999-2004 See the file README for more information */ #ifndef GLOBALS_H #define GLOBALS_H #ifndef _MaceTypes #define _MaceTypes #include <stdint.h> typedef uint8_t U8; typedef int8_t S8; typedef uint16_t U16; typedef int16_t S16; typedef uint32_t U32; typedef int32_t ...
Add one more missing function stub
#include "ecore_xcb_private.h" EAPI Eina_Bool ecore_x_input_multi_select(Ecore_X_Window win) { return 0; } EAPI void ecore_x_e_comp_sync_counter_set(Ecore_X_Window win, Ecore_X_Sync_Counter counter) { } EAPI void ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root, Ecore_X_Window win) { } EAPI Eina_Bool eco...
#include "ecore_xcb_private.h" EAPI void ecore_x_icccm_protocol_atoms_set(Ecore_X_Window win, Ecore_X_Atom *protos, int num) { } EAPI Eina_Bool ecore_x_input_multi_select(Ecore_X_Window win) { return 0; } EAPI void ecore_x_e_comp_sync_counter_set(Ecore_X_Window win, Ecore_X_Sync_Counter counter) { } EAPI void ...
Convert the remainder of this test case over to using FileCheck.
// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings %s 2> %t // RUN: grep -F '"-fblocks"' %t // RUN: grep -F '"-fpascal-strings"' %t // RUN: clang...
// RUN: clang -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS1 %s // RUN: clang -### -S -x c /dev/null -fblo...
Send two packet at once.
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "gpio.h" #include "leds.h" #include "radio.h" void error_handler(uint32_t err_code, uint32_t line_num, char * file_name) { while (1) { for (uint8_t i = LED_START; i < LED_S...
#include <stdio.h> #include <stdint.h> #include <string.h> #include "nrf51.h" #include "nrf_delay.h" #include "error.h" #include "gpio.h" #include "leds.h" #include "radio.h" void error_handler(uint32_t err_code, uint32_t line_num, char * file_name) { while (1) { for (uint8_t i = LED_START; i < LED_S...
Add comment to COIN constant.
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CONSENSUS_AMOUNT_H #define BITCOIN_CONSENSUS_AMOUNT_H #include <...
// Copyright (c) 2009-2010 Satoshi Nakamoto // Copyright (c) 2009-2018 The Bitcoin Core developers // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef BITCOIN_CONSENSUS_AMOUNT_H #define BITCOIN_CONSENSUS_AMOUNT_H #include <...
Switch to direct drive on startup
#define DC_BASE_MODE_OFF 0 #define DC_BASE_MODE_NO_GYRO 1 #define DC_BASE_MODE_GYRO 2 #define DC_BASE_MODE_OVER 3 const string dc_base_mode_names[] = {" OFF", "NO GYRO", " GYRO"}; int dc_base_mode = DC_BASE_MODE_GYRO; void dc_base_mode_next(void); #define DC_SHOOTER_MODE_NONE 0 #define DC_SHO...
#define DC_BASE_MODE_OFF 0 #define DC_BASE_MODE_NO_GYRO 1 #define DC_BASE_MODE_GYRO 2 #define DC_BASE_MODE_OVER 3 const string dc_base_mode_names[] = {" OFF", "NO GYRO", " GYRO"}; int dc_base_mode = DC_BASE_MODE_GYRO; void dc_base_mode_next(void); #define DC_SHOOTER_MODE_NONE 0 #define DC_SHO...
Remove accidental definitions of MyMem_*
#ifndef NUMBA_PY_MODULE_H_ #define NUMBA_PY_MODULE_H_ #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include <frameobject.h> #define MOD_ERROR_VAL NULL #define MOD_SUCCESS_VAL(val) val #define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void) #define MOD_DEF(ob, name, doc, methods) { \ ...
#ifndef NUMBA_PY_MODULE_H_ #define NUMBA_PY_MODULE_H_ #define PY_SSIZE_T_CLEAN #include <Python.h> #include <structmember.h> #include <frameobject.h> #define MOD_ERROR_VAL NULL #define MOD_SUCCESS_VAL(val) val #define MOD_INIT(name) PyMODINIT_FUNC PyInit_##name(void) #define MOD_DEF(ob, name, doc, methods) { \ ...
Use 3 decimal places, the sun uses 32-bit fp_type which chokes with 4.
/** * \file fixed_point.h * * * * \author Ethan Burns * \date 2009-01-16 */ #include "stdint.h" #include <limits> /* The type of a fixed point value. This should never be larger than * the size of the type for the 'value' field in the AtomicInt * class. */ typedef unsigned long fp_type; #define fp_sqrt2 1...
/** * \file fixed_point.h * * * * \author Ethan Burns * \date 2009-01-16 */ #include "stdint.h" #include <limits> /* The type of a fixed point value. This should never be larger than * the size of the type for the 'value' field in the AtomicInt * class. */ typedef unsigned long fp_type; #define fp_sqrt2 1...
Fix typing mistake. add code formatting.
//////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2013, Jasper Blues & Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement acco...
//////////////////////////////////////////////////////////////////////////////// // // TYPHOON FRAMEWORK // Copyright 2013, Jasper Blues & Contributors // All Rights Reserved. // // NOTICE: The authors permit you to use, modify, and distribute this file // in accordance with the terms of the license agreement acco...
Add start and stop params to randint
#include <algorithm> #include <time.h> template <typename Container1, typename Container2> bool sequences_are_equal(const Container1& seq1, const Container2& seq2) { typedef typename Container1::const_iterator Iter1; typedef typename Container2::const_iterator Iter2; typedef std::pair<Iter1, Iter2> IterPai...
#include <algorithm> template <typename Container1, typename Container2> bool sequences_are_equal(const Container1& seq1, const Container2& seq2) { typedef typename Container1::const_iterator Iter1; typedef typename Container2::const_iterator Iter2; typedef std::pair<Iter1, Iter2> IterPair; IterPair mi...