commit
stringlengths
40
40
old_file
stringlengths
4
237
new_file
stringlengths
4
237
old_contents
stringlengths
1
4.24k
new_contents
stringlengths
1
4.87k
subject
stringlengths
15
778
message
stringlengths
15
8.75k
lang
stringclasses
266 values
license
stringclasses
13 values
repos
stringlengths
5
127k
440f8382b009c9af12da567119566113a89ec935
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * 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 66
Update Skia milestone to 66 TBR=reed@google.com Bug: skia: Change-Id: Ib011c6d4a6e54980d2e6e8b16a93551d99dcd948 Reviewed-on: https://skia-review.googlesource.com/97103 Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com> Commit-Queue: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
C
bsd-3-clause
google/skia,HalCanary/skia-hc,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,rubenvb/skia,rubenvb/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,rubenvb/skia,HalCanary/skia-hc,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,rubenvb/skia,rubenvb/skia,rubenvb/skia,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,google/skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc
5b2ede3d0d44f5d96ccaad5d72df41c1df678708
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * 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
Update Skia milestone to 85
Update Skia milestone to 85 Change-Id: If6f878b896397ec1946a0b29b10764722b35d737 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/289777 Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com> Commit-Queue: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com> Auto-Submit: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
C
bsd-3-clause
google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia
217b2661c14b7940bb273f4b793b3c6d41f7425c
ionScience/MarchingCubes.h
ionScience/MarchingCubes.h
#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 CalculateGradient(SMarchingCubesVolume & Volume); ion::Scene::CSimpleMesh * MarchingCubes(SMarchingCubesVolume & Volume);
#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 CalculateGradient(SMarchingCubesVolume & Volume); ion::Scene::CSimpleMesh * MarchingCubes(SMarchingCubesVolume & Volume);
Fix marching cubes unitialized variable
[ionScience] Fix marching cubes unitialized variable
C
mit
iondune/ionEngine,iondune/ionEngine
431fed0108bdccf1ea8fb40b952d32ec993cfaa4
src/config.h
src/config.h
#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 "BPM:" #define BPM_TEXT_BUFFER_SIZE 10 #define TAP_TIMEOUT_SECONDS 2
#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_HINT_FONT FONT_KEY_GOTHIC_24_BOLD #define BPM_HINT_FONT_HEIGHT 24 #define BPM_HINT_TEXT "BPM:" #define BPM_TEXT_BUFFER_SIZE 10 #define TAP_TIMEOUT_SECONDS 2
Fix cut off BPM on aplite and basalt
Fix cut off BPM on aplite and basalt Previously, BPMs that rendered wide, specifically 100.0 and simlar, would get cut off on these platforms. This change decreases border size on square watches to prevent this from happening.
C
mit
aarmea/bpm-pebble,aarmea/bpm-pebble,aarmea/bpm-pebble
380b06677936225540a538e032741e4ed7ef2d26
src/qt/bitcoinaddressvalidator.h
src/qt/bitcoinaddressvalidator.h
#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 BitcoinAddressValidator(QObject *parent = 0); State validate(QString &input, int &pos) const; static const int MaxAddressLength = 35; }; #endif // BITCOINADDRESSVALIDATOR_H
#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 BitcoinAddressValidator(QObject *parent = 0); State validate(QString &input, int &pos) const; static const int MaxAddressLength = 35; }; #endif // BITCOINADDRESSVALIDATOR_H
Fix typo in a comment: it's base58, not base48.
Fix typo in a comment: it's base58, not base48.
C
mit
MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin,MidasPaymentLTD/midascoin
ae360ba7aa18b1222a1ed92e67cbc7690e4a3f5c
src/parser.h
src/parser.h
/* * 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: * sqlstmt stmt */ void *sql_parse(char *query); void reset_statement(void); void sql_reset_parser(void *bufstate); void sql_dup_stmt(sqlstmt *dup); /* Prints externally declared global variable * sqlstmt stmt * to standard output */ void sql_print(); #endif
/* * 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, * this list of conditions and the following disclaimer. * * - Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * - Neither the name of the University of Glasgow nor the names of its * contributors may be used to endorse or promote products derived from this * software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. */ /* * The Homework Database * * SQL Parser * * Authors: * Oliver Sharma and Joe Sventek * {oliver, joe}@dcs.gla.ac.uk * */ #ifndef HWDB_PARSER_H #define HWDB_PARSER_H #include "sqlstmts.h" #include "gram.h" /* Places parsed output in externally declared global variable: * sqlstmt stmt */ void *sql_parse(char *query); void reset_statement(void); void sql_reset_parser(void *bufstate); void sql_dup_stmt(sqlstmt *dup); /* Prints externally declared global variable * sqlstmt stmt * to standard output */ void sql_print(); #endif
Add BSD 3-clause open source header
Add BSD 3-clause open source header
C
bsd-3-clause
fergul/Cache,jsventek/Cache,jsventek/Cache,jsventek/Cache,fergul/Cache,fergul/Cache
89bba249561dc480430c64d9eecbc4af92bf6376
src/config/cearth_config.h
src/config/cearth_config.h
#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 *haven_webauth = "www.havenandhearth.com"; static const char *haven_tokenlink = "/autohaven"; static const char *cearth_config_dir = "/.cearth/"; static const char *foo = "test"; #endif
#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=\"" static const char *haven_authserv = "moltke.seatribe.se"; static const char *haven_webauth = "www.havenandhearth.com"; static const char *haven_tokenlink = "/autohaven"; static const char *cearth_config_dir = "/.cearth/"; static const char *foo = "test"; #endif
Add the string to search when parsing for token from website
Add the string to search when parsing for token from website
C
mit
nyanpasu/cearth
298f58e073b2782bd264edea969769b7b5e7cf41
libc/sysdeps/linux/arm/bits/arm_asm.h
libc/sysdeps/linux/arm/bits/arm_asm.h
/* Various definitons used the the ARM uClibc assembly code. */ #ifndef _ARM_ASM_H #define _ARM_ASM_H #ifdef __thumb2__ # ifdef __ASSEMBLER__ .thumb .syntax unified # endif /* __ASSEMBLER__ */ #define IT(t, cond) i##t cond #else /* XXX: This can be removed if/when we require an assembler that supports unified assembly syntax. */ #define IT(t, cond) /* Code to return from a thumb function stub. */ #ifdef __ARM_ARCH_4T__ #define POP_RET pop {r2, pc} #else #define POP_RET pop {r2, r3}; bx r3 #endif #endif #if defined(__ARM_ARCH_6M__) /* Force arm mode to flush out errors on M profile cores. */ #undef IT #define THUMB1_ONLY 1 #endif #endif /* _ARM_ASM_H */
/* Various definitons used the the ARM uClibc assembly code. */ #ifndef _ARM_ASM_H #define _ARM_ASM_H #ifdef __thumb2__ # ifdef __ASSEMBLER__ .thumb .syntax unified # endif /* __ASSEMBLER__ */ #define IT(t, cond) i##t cond #else /* XXX: This can be removed if/when we require an assembler that supports unified assembly syntax. */ #define IT(t, cond) /* Code to return from a thumb function stub. */ # if defined __ARM_ARCH_4T__ && defined __THUMB_INTERWORK__ # define POP_RET pop {r2, r3}; bx r3 # else # define POP_RET pop {r2, pc} # endif #endif /* __thumb2__ */ #if defined(__ARM_ARCH_6M__) /* Force arm mode to flush out errors on M profile cores. */ #undef IT #define THUMB1_ONLY 1 #endif #endif /* _ARM_ASM_H */
Fix POP_RET for armv4t && interworking
arm: Fix POP_RET for armv4t && interworking It seems the condition was reversed which lead to e.g. arm-920t being confused Signed-off-by: Bernhard Reutner-Fischer <ce1ac9e9ad16abccd7821f371ad381197b4768ac@gmail.com>
C
lgpl-2.1
kraj/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,brgl/uclibc-ng,kraj/uclibc-ng,wbx-github/uclibc-ng,majek/uclibc-vx32,brgl/uclibc-ng,kraj/uClibc,brgl/uclibc-ng,foss-for-synopsys-dwc-arc-processors/uClibc,foss-for-synopsys-dwc-arc-processors/uClibc,wbx-github/uclibc-ng,majek/uclibc-vx32,kraj/uClibc,kraj/uclibc-ng,brgl/uclibc-ng,kraj/uclibc-ng,foss-for-synopsys-dwc-arc-processors/uClibc,kraj/uclibc-ng,wbx-github/uclibc-ng,wbx-github/uclibc-ng,majek/uclibc-vx32,majek/uclibc-vx32,kraj/uClibc
1ee690946e0b9dc2a44dd673f4e62942a953bec5
include/ImageIO/CGImageSourceInternal.h
include/ImageIO/CGImageSourceInternal.h
//****************************************************************************** // // 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, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //****************************************************************************** #pragma once @interface ImageSource : NSObject @property (nonatomic) NSData *data; - (instancetype)initWithData:(CFDataRef)data; - (instancetype)initWithURL:(CFURLRef)url; - (instancetype)initWithDataProvider:(CGDataProviderRef)provider; - (CFStringRef)getImageType; @end
//****************************************************************************** // // 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, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // //****************************************************************************** #pragma once #import <Foundation/NSObject.h> #import <CoreFoundation/CFData.h> #import <CoreFoundation/CFURL.h> #import <CoreGraphics/CoreGraphicsExport.h> @class NSData; @interface ImageSource : NSObject @property (nonatomic) NSData *data; - (instancetype)initWithData:(CFDataRef)data; - (instancetype)initWithURL:(CFURLRef)url; - (instancetype)initWithDataProvider:(CGDataProviderRef)provider; - (CFStringRef)getImageType; @end
Fix ApiAnalyzer complaints about ImageIO headers.
Fix ApiAnalyzer complaints about ImageIO headers.
C
mit
nathpete-msft/WinObjC,rajsesh-msft/WinObjC,yweijiang/WinObjC,autodesk-forks/WinObjC,yweijiang/WinObjC,bSr43/WinObjC,bbowman/WinObjC,MSFTFox/WinObjC,s5msft/WinObjC,bbowman/WinObjC,rajsesh-msft/WinObjC,MSFTFox/WinObjC,Microsoft/WinObjC,bbowman/WinObjC,vkvenkat/WinObjC,pradipd/WinObjC,ehren/WinObjC,nathpete-msft/WinObjC,afaruqui/WinObjC,yweijiang/WinObjC,Microsoft/WinObjC,bSr43/WinObjC,afaruqui/WinObjC,yweijiang/WinObjC,pradipd/WinObjC,autodesk-forks/WinObjC,s5msft/WinObjC,ehren/WinObjC,Microsoft/WinObjC,pradipd/WinObjC,bbowman/WinObjC,pradipd/WinObjC,s5msft/WinObjC,nathpete-msft/WinObjC,afaruqui/WinObjC,vkvenkat/WinObjC,bSr43/WinObjC,autodesk-forks/WinObjC,rajsesh-msft/WinObjC,s5msft/WinObjC,pradipd/WinObjC,MSFTFox/WinObjC,autodesk-forks/WinObjC,Microsoft/WinObjC,rajsesh-msft/WinObjC,ehren/WinObjC,bbowman/WinObjC,nathpete-msft/WinObjC,afaruqui/WinObjC,ehren/WinObjC,vkvenkat/WinObjC,nathpete-msft/WinObjC,bSr43/WinObjC,MSFTFox/WinObjC,ehren/WinObjC,vkvenkat/WinObjC
79c31c97a5c0c1b061f18fec06d6b969d267c766
src/modules/test_map/mod.c
src/modules/test_map/mod.c
#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 obj_unhook(Evas_Object *obj) { return EINA_TRUE; } EAPI Eina_Bool obj_convert_geo_into_coord(const Evas_Object *obj, int zoom, double lon, double lat, int size, int *x, int *y) { return EINA_FALSE; } EAPI Eina_Bool obj_convert_coord_into_geo(const Evas_Object *obj, int zoom, int x, int y, int size, double *lon, double *lat) { return EINA_FALSE; } EAPI char* obj_url_request(Evas_Object *obj, int x, int y, int zoom) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png", zoom, x, y); return strdup(buf); }
#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__) { return EINA_TRUE; } EAPI Eina_Bool obj_unhook(Evas_Object *obj __UNUSED__) { return EINA_TRUE; } EAPI Eina_Bool obj_convert_geo_into_coord(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, double lon __UNUSED__, double lat __UNUSED__, int size __UNUSED__, int *x __UNUSED__, int *y __UNUSED__) { return EINA_FALSE; } EAPI Eina_Bool obj_convert_coord_into_geo(const Evas_Object *obj __UNUSED__, int zoom __UNUSED__, int x __UNUSED__, int y __UNUSED__, int size __UNUSED__, double *lon __UNUSED__, double *lat __UNUSED__) { return EINA_FALSE; } EAPI char* obj_url_request(Evas_Object *obj __UNUSED__, int x, int y, int zoom) { char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "http://tile.openstreetmap.org/%d/%d/%d.png", zoom, x, y); return strdup(buf); }
Add UNUSED so we get a clean compile.
Add UNUSED so we get a clean compile. SVN revision: 55786
C
lgpl-2.1
rvandegrift/elementary,FlorentRevest/Elementary,tasn/elementary,tasn/elementary,tasn/elementary,FlorentRevest/Elementary,tasn/elementary,rvandegrift/elementary,tasn/elementary,FlorentRevest/Elementary,rvandegrift/elementary,FlorentRevest/Elementary,rvandegrift/elementary
7b6b9da98f07f48342a50a437e18f049c7f9537b
GITPackFile.h
GITPackFile.h
// // GITPackFile.h // CocoaGit // // Created by Geoffrey Garside on 05/08/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // #import <Cocoa/Cocoa.h> @interface GITPackFile : NSObject { NSData * idxData; NSData * packData; NSString * idxPath; NSString * packPath; NSArray * idxOffsets; NSUInteger idxVersion; NSUInteger packVersion; NSUInteger numberOfObjects; } @end @property(readonly,copy) NSString * idxPath; @property(readonly,copy) NSString * packPath;
// // GITPackFile.h // CocoaGit // // Created by Geoffrey Garside on 05/08/2008. // Copyright 2008 ManicPanda.com. All rights reserved. // #import <Cocoa/Cocoa.h> @interface GITPackFile : NSObject { NSData * idxData; NSData * packData; NSString * idxPath; NSString * packPath; NSArray * idxOffsets; NSUInteger idxVersion; NSUInteger packVersion; NSUInteger numberOfObjects; } @property(readonly,copy) NSString * idxPath; @property(readonly,copy) NSString * packPath; @property(readonly,assign) NSUInteger idxVersion; @property(readonly,assign) NSUInteger packVersion; @property(readonly,assign) NSUInteger numberOfObjects; - (id)initWithPath:(NSString*)path; - (void)setPackPath:(NSString*)path; - (void)setIdxPath:(NSString*)path; - (void)openIdxAndPackFiles; - (void)readPack; - (NSData*)objectAtOffset:(NSUInteger)offset; - (NSData*)objectAtOffsetVersion1:(NSUInteger)offset; - (NSData*)objectAtOffsetVersion2:(NSUInteger)offset; - (void)readIdx; - (NSData*)dataForSha1:(NSString*)sha1; - (NSUInteger)offsetForSha1:(NSString*)sha1; @end
Add more properties and methods to help with git-pack-inspect debugging
Add more properties and methods to help with git-pack-inspect debugging
C
mit
geoffgarside/cocoagit,schacon/cocoagit,geoffgarside/cocoagit,schacon/cocoagit
16a59cb9926bc96792cc9d1b7a996689f7bf1b86
components/TARGET_PSA/TESTS/compliance_its/test_s003/main.c
components/TARGET_PSA/TESTS/compliance_its/test_s003/main.c
#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); #endif int main(void) { #ifdef ITS_TEST test_start(test_entry_s003); #elif PS_TEST test_start(test_entry_p003); #endif }
#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(val_api_t *val_api, psa_api_t *psa_api); #endif int main(void) { #ifdef ITS_TEST test_start(test_entry_s003); #elif PS_TEST test_start(test_entry_p003); #endif }
Allow PS test03 with PS_ALLOW_ENTIRE_STORAGE_FILL flag
Allow PS test03 with PS_ALLOW_ENTIRE_STORAGE_FILL flag
C
apache-2.0
andcor02/mbed-os,mbedmicro/mbed,kjbracey-arm/mbed,kjbracey-arm/mbed,andcor02/mbed-os,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,kjbracey-arm/mbed,mbedmicro/mbed,andcor02/mbed-os,andcor02/mbed-os,andcor02/mbed-os,andcor02/mbed-os,kjbracey-arm/mbed
6af6de1f5cb48d109c1d58fa4bdd509de09e9c7f
Globals.h
Globals.h
/* 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 "long" with "int" #if __LP64__ typedef unsigned int U32; typedef signed int S32; #else typedef unsigned long U32; typedef signed long S32; #endif #endif void App_Exit(void); //Same as App_Exit2(), except that this calls setdis() void App_Exit2(void); U16 FlipW(U16 a); U32 FlipL(U32 a); void HexW (U16 n, char * String); void HexL (U32 n, char * String); #endif //GLOBALS_H
/* 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 S32; #endif void App_Exit(void); //Same as App_Exit2(), except that this calls setdis() void App_Exit2(void); U16 FlipW(U16 a); U32 FlipL(U32 a); void HexW (U16 n, char * String); void HexL (U32 n, char * String); #endif //GLOBALS_H
Use C99 stdint.h header for types
Use C99 stdint.h header for types
C
lgpl-2.1
MaddTheSane/Mace,MaddTheSane/Mace
47b3fd8dd3b1baa364ee93c221ae41d7a61810cb
src/lib/ecore_x/xcb/ecore_xcb_missing.c
src/lib/ecore_x/xcb/ecore_xcb_missing.c
#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 ecore_x_e_comp_sync_supported_get(Ecore_X_Window root) { return 0; }
#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 ecore_x_e_comp_sync_draw_done_send(Ecore_X_Window root, Ecore_X_Window win) { } EAPI Eina_Bool ecore_x_e_comp_sync_supported_get(Ecore_X_Window root) { return 0; }
Add one more missing function stub
Add one more missing function stub
C
mit
OpenInkpot-archive/ecore,OpenInkpot-archive/ecore,OpenInkpot-archive/ecore
5099b80088141137d81c62d3e03208835faced06
test/Driver/clang_f_opts.c
test/Driver/clang_f_opts.c
// 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 -### -S -x c /dev/null -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-wchar %s 2> %t // RUN: grep -F '"-fno-builtin"' %t // RUN: grep -F '"-fno-common"' %t // RUN: grep -F '"-fno-math-errno"' %t // RUN: grep -F '"-fno-show-source-location"' %t // RUN: grep -F '"-fshort-wchar"' %t // RUN: clang -fshort-enums -x c /dev/null 2>&1 | FileCheck -check-prefix=CHECK-SHORT-ENUMS %s // CHECK-SHORT-ENUMS: compiler does not support '-fshort-enums'
// 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 -fblocks -fbuiltin -fmath-errno -fcommon -fpascal-strings -fno-blocks -fno-builtin -fno-math-errno -fno-common -fno-pascal-strings -fno-show-source-location -fshort-wchar %s 2>&1 | FileCheck -check-prefix=CHECK-OPTIONS2 %s // RUN: clang -fshort-enums -x c /dev/null 2>&1 | FileCheck -check-prefix=CHECK-SHORT-ENUMS %s // CHECK-OPTIONS1: -fblocks // CHECK-OPTIONS1: -fpascal-strings // CHECK-OPTIONS2: -fno-builtin // CHECK-OPTIONS2: -fno-common // CHECK-OPTIONS2: -fno-math-errno // CHECK-OPTIONS2: -fno-show-source-location // CHECL-OPTIONS2: -fshort-wchar // CHECK-SHORT-ENUMS: compiler does not support '-fshort-enums'
Convert the remainder of this test case over to using FileCheck.
Convert the remainder of this test case over to using FileCheck. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@91194 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang
a6d0140a2c9bbaa73706472e0e748279cd0a2b7b
app/tx/main.c
app/tx/main.c
#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_STOP; i++) { led_toggle(i); nrf_delay_us(50000); } } } void radio_evt_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; uint32_t err_code; leds_init(); radio_packet_t packet; packet.len = 4; packet.flags.ack = 0; radio_init(radio_evt_handler); while (1) { packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); led_toggle(LED0); nrf_delay_us(1000000); } }
#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_STOP; i++) { led_toggle(i); nrf_delay_us(50000); } } } void radio_evt_handler(radio_evt_t * evt) { } int main(void) { uint8_t i = 0; uint32_t err_code; leds_init(); radio_packet_t packet; packet.len = 4; packet.flags.ack = 0; radio_init(radio_evt_handler); while (1) { packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); packet.data[0] = i++; packet.data[1] = 0x12; err_code = radio_send(&packet); ASSUME_SUCCESS(err_code); led_toggle(LED0); nrf_delay_us(1000000); } }
Send two packet at once.
Send two packet at once.
C
bsd-3-clause
hlnd/nrf51-simple-radio,hlnd/nrf51-simple-radio
1946af2c45372e3de39000a45a5954bb5870bc1b
src/consensus/amount.h
src/consensus/amount.h
// 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 <cstdint> /** Amount in satoshis (Can be negative) */ typedef int64_t CAmount; static constexpr CAmount COIN = 100000000; /** No amount larger than this (in satoshi) is valid. * * Note that this constant is *not* the total money supply, which in Bitcoin * currently happens to be less than 21,000,000 BTC for various reasons, but * rather a sanity check. As this sanity check is used by consensus-critical * validation code, the exact value of the MAX_MONEY constant is consensus * critical; in unusual circumstances like a(nother) overflow bug that allowed * for the creation of coins out of thin air modification could lead to a fork. * */ static constexpr CAmount MAX_MONEY = 21000000 * COIN; inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } #endif // BITCOIN_CONSENSUS_AMOUNT_H
// 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 <cstdint> /** Amount in satoshis (Can be negative) */ typedef int64_t CAmount; /** The amount of satoshis in one BTC. */ static constexpr CAmount COIN = 100000000; /** No amount larger than this (in satoshi) is valid. * * Note that this constant is *not* the total money supply, which in Bitcoin * currently happens to be less than 21,000,000 BTC for various reasons, but * rather a sanity check. As this sanity check is used by consensus-critical * validation code, the exact value of the MAX_MONEY constant is consensus * critical; in unusual circumstances like a(nother) overflow bug that allowed * for the creation of coins out of thin air modification could lead to a fork. * */ static constexpr CAmount MAX_MONEY = 21000000 * COIN; inline bool MoneyRange(const CAmount& nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); } #endif // BITCOIN_CONSENSUS_AMOUNT_H
Add comment to COIN constant.
Add comment to COIN constant. The COIN constant is critical in understanding Bitcoin's supply, but what it represents isn't clear from the name of the constant. Adding a comment clarifies the meaning of the constant for future readers.
C
mit
jlopp/statoshi,namecoin/namecoin-core,achow101/bitcoin,namecoin/namecoin-core,pataquets/namecoin-core,instagibbs/bitcoin,domob1812/bitcoin,tecnovert/particl-core,AkioNak/bitcoin,sstone/bitcoin,tecnovert/particl-core,dscotese/bitcoin,anditto/bitcoin,domob1812/namecore,pataquets/namecoin-core,namecoin/namecore,fujicoin/fujicoin,fanquake/bitcoin,bitcoinsSG/bitcoin,dscotese/bitcoin,jambolo/bitcoin,particl/particl-core,sipsorcery/bitcoin,MarcoFalke/bitcoin,domob1812/bitcoin,bitcoin/bitcoin,mruddy/bitcoin,jambolo/bitcoin,bitcoin/bitcoin,particl/particl-core,bitcoinsSG/bitcoin,sstone/bitcoin,namecoin/namecoin-core,fanquake/bitcoin,GroestlCoin/GroestlCoin,jamesob/bitcoin,ajtowns/bitcoin,namecoin/namecore,prusnak/bitcoin,domob1812/bitcoin,mruddy/bitcoin,achow101/bitcoin,instagibbs/bitcoin,jlopp/statoshi,mruddy/bitcoin,instagibbs/bitcoin,Xekyo/bitcoin,achow101/bitcoin,pataquets/namecoin-core,jambolo/bitcoin,domob1812/namecore,jlopp/statoshi,pataquets/namecoin-core,andreaskern/bitcoin,sstone/bitcoin,andreaskern/bitcoin,fujicoin/fujicoin,AkioNak/bitcoin,tecnovert/particl-core,bitcoinsSG/bitcoin,sipsorcery/bitcoin,Xekyo/bitcoin,mm-s/bitcoin,bitcoin/bitcoin,bitcoin/bitcoin,mruddy/bitcoin,kallewoof/bitcoin,kallewoof/bitcoin,sipsorcery/bitcoin,jamesob/bitcoin,bitcoinknots/bitcoin,Xekyo/bitcoin,jlopp/statoshi,kallewoof/bitcoin,tecnovert/particl-core,anditto/bitcoin,lateminer/bitcoin,prusnak/bitcoin,lateminer/bitcoin,anditto/bitcoin,prusnak/bitcoin,jamesob/bitcoin,mm-s/bitcoin,anditto/bitcoin,GroestlCoin/GroestlCoin,dscotese/bitcoin,achow101/bitcoin,fujicoin/fujicoin,bitcoinsSG/bitcoin,GroestlCoin/GroestlCoin,jambolo/bitcoin,GroestlCoin/bitcoin,instagibbs/bitcoin,MarcoFalke/bitcoin,particl/particl-core,Xekyo/bitcoin,fujicoin/fujicoin,sipsorcery/bitcoin,tecnovert/particl-core,jambolo/bitcoin,domob1812/bitcoin,MarcoFalke/bitcoin,prusnak/bitcoin,namecoin/namecore,prusnak/bitcoin,MarcoFalke/bitcoin,mm-s/bitcoin,AkioNak/bitcoin,mruddy/bitcoin,fujicoin/fujicoin,bitcoin/bitcoin,pataquets/namecoin-core,ajtowns/bitcoin,fanquake/bitcoin,MarcoFalke/bitcoin,GroestlCoin/bitcoin,tecnovert/particl-core,MarcoFalke/bitcoin,domob1812/namecore,kallewoof/bitcoin,anditto/bitcoin,bitcoinknots/bitcoin,dscotese/bitcoin,bitcoinknots/bitcoin,GroestlCoin/bitcoin,sipsorcery/bitcoin,bitcoinknots/bitcoin,bitcoinknots/bitcoin,fujicoin/fujicoin,lateminer/bitcoin,andreaskern/bitcoin,domob1812/namecore,kallewoof/bitcoin,achow101/bitcoin,jamesob/bitcoin,namecoin/namecore,pataquets/namecoin-core,sstone/bitcoin,jamesob/bitcoin,Xekyo/bitcoin,jamesob/bitcoin,lateminer/bitcoin,AkioNak/bitcoin,domob1812/bitcoin,fanquake/bitcoin,mm-s/bitcoin,bitcoinsSG/bitcoin,AkioNak/bitcoin,kallewoof/bitcoin,GroestlCoin/GroestlCoin,mm-s/bitcoin,mm-s/bitcoin,prusnak/bitcoin,lateminer/bitcoin,ajtowns/bitcoin,jlopp/statoshi,sipsorcery/bitcoin,ajtowns/bitcoin,GroestlCoin/bitcoin,namecoin/namecoin-core,ajtowns/bitcoin,particl/particl-core,GroestlCoin/bitcoin,sstone/bitcoin,andreaskern/bitcoin,fanquake/bitcoin,GroestlCoin/GroestlCoin,domob1812/namecore,namecoin/namecoin-core,jambolo/bitcoin,AkioNak/bitcoin,instagibbs/bitcoin,dscotese/bitcoin,lateminer/bitcoin,particl/particl-core,GroestlCoin/GroestlCoin,domob1812/bitcoin,mruddy/bitcoin,andreaskern/bitcoin,achow101/bitcoin,bitcoinsSG/bitcoin,sstone/bitcoin,andreaskern/bitcoin,instagibbs/bitcoin,ajtowns/bitcoin,domob1812/namecore,Xekyo/bitcoin,bitcoin/bitcoin,particl/particl-core,jlopp/statoshi,namecoin/namecore,GroestlCoin/bitcoin,fanquake/bitcoin,anditto/bitcoin,dscotese/bitcoin,namecoin/namecore,namecoin/namecoin-core
eb2dc60d19a206f5d51d3871ba81effa166c5219
src/driver_control/dc_common.c
src/driver_control/dc_common.c
#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_SHOOTER_MODE_DIRECT 1 #define DC_SHOOTER_MODE_SLIP 2 #define DC_SHOOTER_MODE_KICKER 3 #define DC_SHOOTER_MODE_OVER 4 const string dc_shooter_mode_names[] = {"NONE ", "DIRECT", "SLIP ", "KICKER"}; int dc_shooter_mode = DC_SHOOTER_MODE_NONE; void dc_shooter_mode_next(void);
#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_SHOOTER_MODE_DIRECT 1 #define DC_SHOOTER_MODE_SLIP 2 #define DC_SHOOTER_MODE_KICKER 3 #define DC_SHOOTER_MODE_OVER 4 const string dc_shooter_mode_names[] = {"NONE ", "DIRECT", "SLIP ", "KICKER"}; int dc_shooter_mode = DC_SHOOTER_MODE_DIRECT; // mode on startup void dc_shooter_mode_next(void);
Switch to direct drive on startup
Switch to direct drive on startup
C
mit
qsctr/vex-4194b-2016
75c6d50abe1dc506a0f21e4e19f742d799cad5c4
numba/_pymodule.h
numba/_pymodule.h
#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) { \ static struct PyModuleDef moduledef = { \ PyModuleDef_HEAD_INIT, name, doc, -1, methods, NULL, NULL, NULL, NULL }; \ ob = PyModule_Create(&moduledef); } #define MOD_INIT_EXEC(name) PyInit_##name(); #define PyString_AsString PyUnicode_AsUTF8 #define PyString_Check PyUnicode_Check #define PyString_FromFormat PyUnicode_FromFormat #define PyString_FromString PyUnicode_FromString #define PyString_InternFromString PyUnicode_InternFromString #define PyInt_Type PyLong_Type #define PyInt_Check PyLong_Check #define PyInt_CheckExact PyLong_CheckExact #define PyMem_RawMalloc malloc #define PyMem_RawRealloc realloc #define PyMem_RawFree free #endif /* NUMBA_PY_MODULE_H_ */
#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) { \ static struct PyModuleDef moduledef = { \ PyModuleDef_HEAD_INIT, name, doc, -1, methods, NULL, NULL, NULL, NULL }; \ ob = PyModule_Create(&moduledef); } #define MOD_INIT_EXEC(name) PyInit_##name(); #define PyString_AsString PyUnicode_AsUTF8 #define PyString_Check PyUnicode_Check #define PyString_FromFormat PyUnicode_FromFormat #define PyString_FromString PyUnicode_FromString #define PyString_InternFromString PyUnicode_InternFromString #define PyInt_Type PyLong_Type #define PyInt_Check PyLong_Check #define PyInt_CheckExact PyLong_CheckExact #endif /* NUMBA_PY_MODULE_H_ */
Remove accidental definitions of MyMem_*
Remove accidental definitions of MyMem_* These were guarded to only be defined on Python < 3.4. This should fix test_snapshot on the 32-bit build.
C
bsd-2-clause
stuartarchibald/numba,numba/numba,numba/numba,cpcloud/numba,gmarkall/numba,seibert/numba,seibert/numba,cpcloud/numba,stonebig/numba,numba/numba,IntelLabs/numba,IntelLabs/numba,stonebig/numba,stonebig/numba,seibert/numba,numba/numba,gmarkall/numba,seibert/numba,gmarkall/numba,stonebig/numba,stuartarchibald/numba,cpcloud/numba,stuartarchibald/numba,numba/numba,IntelLabs/numba,seibert/numba,gmarkall/numba,IntelLabs/numba,stonebig/numba,IntelLabs/numba,cpcloud/numba,stuartarchibald/numba,cpcloud/numba,gmarkall/numba,stuartarchibald/numba
0262f2fab71dca4874831d2d87ecaa099c1831d1
src/util/fixed_point.h
src/util/fixed_point.h
/** * \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 14142 #define fp_one 10000 #define fp_infinity (numeric_limits<fp_type>::max())
/** * \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 1414 #define fp_one 1000 #define fp_infinity (numeric_limits<fp_type>::max())
Use 3 decimal places, the sun uses 32-bit fp_type which chokes with 4.
Use 3 decimal places, the sun uses 32-bit fp_type which chokes with 4.
C
mit
eaburns/pbnf,eaburns/pbnf,eaburns/pbnf,eaburns/pbnf
af2e0e171ae1e1957f1f7aaf8d5c090c87c2f9dd
Tests/Component/FactoryProvider/PizzaFactory.h
Tests/Component/FactoryProvider/PizzaFactory.h
//////////////////////////////////////////////////////////////////////////////// // // 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 accompanying it. // //////////////////////////////////////////////////////////////////////////////// #import <Foundation/Foundation.h> #import "CreditService.h" #import "Pizza.h" @protocol PizzaFactory <NSObject> @property (nonatomic, strong, readonly) id<CreditService> creditService; - (id<Pizza>)pizzaWithRadius:(double)radius ingredients:(NSArray *)ingrendients; - (id<Pizza>)smallPizzaWithIngredients:(NSArray *)ingredients; - (id<Pizza>)mediumPizzaWithIngredients:(NSArray *)ingredients; - (id<Pizza>)largePizzaWithIngredients:(NSArray *)ingredients; @end
//////////////////////////////////////////////////////////////////////////////// // // 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 accompanying it. // //////////////////////////////////////////////////////////////////////////////// #import <Foundation/Foundation.h> #import "CreditService.h" #import "Pizza.h" @protocol PizzaFactory <NSObject> @property(nonatomic, strong, readonly) id <CreditService> creditService; - (id <Pizza>)pizzaWithRadius:(double)radius ingredients:(NSArray*)ingredients; - (id <Pizza>)smallPizzaWithIngredients:(NSArray*)ingredients; - (id <Pizza>)mediumPizzaWithIngredients:(NSArray*)ingredients; - (id <Pizza>)largePizzaWithIngredients:(NSArray*)ingredients; @end
Fix typing mistake. add code formatting.
Fix typing mistake. add code formatting.
C
apache-2.0
r2B3Challenge/Typhoon,zjh171/Typhoon,r2B3Challenge/Typhoon,nickynick/Typhoon,gaurav1981/Typhoon,manicakes/Typhoon,1yvT0s/Typhoon,manicakes/Typhoon,mbaltaks/Typhoon,nickynick/Typhoon,gaurav1981/Typhoon,pomozoff/Typhoon,literator/Typhoon,nickynick/Typhoon,gaurav1981/Typhoon,pomozoff/Typhoon,nickynick/Typhoon,manicakes/Typhoon,nickynick/Typhoon,r2B3Challenge/Typhoon,manicakes/Typhoon,gaurav1981/Typhoon,literator/Typhoon,gaurav1981/Typhoon,eyeem/Typhoon,mbaltaks/Typhoon,dmueller39/Typhoon,literator/Typhoon,pomozoff/Typhoon,mbaltaks/Typhoon,1yvT0s/Typhoon,zjh171/Typhoon,zjh171/Typhoon,eyeem/Typhoon,literator/Typhoon,1yvT0s/Typhoon,1yvT0s/Typhoon,manicakes/Typhoon,eyeem/Typhoon,gaurav1981/Typhoon,mbaltaks/Typhoon,1yvT0s/Typhoon,zjh171/Typhoon,zjh171/Typhoon,dmueller39/Typhoon,r2B3Challenge/Typhoon,mbaltaks/Typhoon,eyeem/Typhoon,1yvT0s/Typhoon,dmueller39/Typhoon,zjh171/Typhoon,literator/Typhoon,mbaltaks/Typhoon,manicakes/Typhoon,r2B3Challenge/Typhoon,pomozoff/Typhoon,literator/Typhoon,r2B3Challenge/Typhoon,dmueller39/Typhoon,eyeem/Typhoon,dmueller39/Typhoon,pomozoff/Typhoon,eyeem/Typhoon
08aad53abab851e5b39593495a6463c56e59c326
util.h
util.h
#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> IterPair; IterPair mismatch_pair = std::mismatch(seq1.begin(), seq1.end(), seq2.begin()); return mismatch_pair.first == seq1.end(); } struct randint { int range; public: randint(int range) : range(range) {} int operator()() { return (rand() / RAND_MAX) * range; } };
#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 mismatch_pair = std::mismatch(seq1.begin(), seq1.end(), seq2.begin()); return mismatch_pair.first == seq1.end(); } struct randint { int start; int stop; public: randint(int stop) : start(0), stop(stop) {} randint(int start, int stop) : start(start), stop(stop) {} int operator()() { return rand() % (this->stop - 1) + start; } };
Add start and stop params to randint
Add start and stop params to randint
C
mit
gg/algorithms,gg/algorithms,gg/algorithms
adcdb080cbf200a29d08dd61817d48abadc37d93
src/libguac/guacamole/parser-constants.h
src/libguac/guacamole/parser-constants.h
/* * 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 may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifndef _GUAC_PARSER_CONSTANTS_H #define _GUAC_PARSER_CONSTANTS_H /** * Constants related to the Guacamole protocol parser. * * @file parser-constants.h */ /** * The maximum number of characters per instruction. */ #define GUAC_INSTRUCTION_MAX_LENGTH 8192 /** * The maximum number of digits to allow per length prefix. */ #define GUAC_INSTRUCTION_MAX_DIGITS 5 /** * The maximum number of elements per instruction, including the opcode. */ #define GUAC_INSTRUCTION_MAX_ELEMENTS 64 #endif
/* * 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 may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #ifndef _GUAC_PARSER_CONSTANTS_H #define _GUAC_PARSER_CONSTANTS_H /** * Constants related to the Guacamole protocol parser. * * @file parser-constants.h */ /** * The maximum number of characters per instruction. */ #define GUAC_INSTRUCTION_MAX_LENGTH 8192 /** * The maximum number of digits to allow per length prefix. */ #define GUAC_INSTRUCTION_MAX_DIGITS 5 /** * The maximum number of elements per instruction, including the opcode. */ #define GUAC_INSTRUCTION_MAX_ELEMENTS 128 #endif
Increase max number of elements per instruction.
GUACAMOLE-587: Increase max number of elements per instruction.
C
apache-2.0
mike-jumper/incubator-guacamole-server,mike-jumper/incubator-guacamole-server,mike-jumper/incubator-guacamole-server,mike-jumper/incubator-guacamole-server,glyptodon/guacamole-server,glyptodon/guacamole-server,apache/guacamole-server,glyptodon/guacamole-server,apache/guacamole-server,apache/guacamole-server
24746780a3c46b0607edcf65fcdbb2e61b3058fd
src/ios/AppSettings.h
src/ios/AppSettings.h
// // AppPreferences.h // // #import <Cordova/CDV.h> #import <Cordova/CDVViewController.h> @interface AppSettings : CDVPlugin - (void)get:(CDVInvokedUrlCommand*)command; @end
// // AppPreferences.h // // #import <Cordova/CDV.h> #import <Cordova/CDVViewController.h> @interface AppSettings : CDVPlugin - (void)fetch:(CDVInvokedUrlCommand*)command; @end
Update method from get to fetch
Update method from get to fetch
C
apache-2.0
greg-laughlin-hs/app-settings-reader,greg-laughlin-hs/app-settings-reader
7a108087ed96c0d91b65b967f9c524a7c64116fa
targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/itm_api.c
targets/TARGET_Ambiq_Micro/TARGET_Apollo3/device/itm_api.c
/* mbed Microcontroller Library * Copyright (c) 2017 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if DEVICE_ITM #include "hal/itm_api.h" #include "cmsis.h" #include "am_bsp.h" #include <stdbool.h> /* SWO frequency: 1000 kHz */ // As SWO has to be accessible everywhere, including ISRs, we can't easily // communicate the dependency on clocks etc. to other components - so this // function checks that things appear to be set up, and if not re-configures // everything void itm_init(void) { am_bsp_itm_printf_enable(); } #endif
/* mbed Microcontroller Library * Copyright (c) 2017 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #if DEVICE_ITM #include "hal/itm_api.h" #include "cmsis.h" #include "am_bsp.h" #include <stdbool.h> /* SWO frequency: 1000 kHz */ #ifndef AM_BSP_GPIO_ITM_SWO #define AM_GPIO_ITM_SWO 22 const am_hal_gpio_pincfg_t g_AM_GPIO_ITM_SWO = { .uFuncSel = AM_HAL_PIN_22_SWO, .eDriveStrength = AM_HAL_GPIO_PIN_DRIVESTRENGTH_2MA }; #endif void itm_init(void) { #ifdef AM_BSP_GPIO_ITM_SWO am_bsp_itm_printf_enable(); #else am_bsp_itm_printf_enable(AM_GPIO_ITM_SWO,g_AM_GPIO_ITM_SWO); #endif } #endif
Add default SWO pin number and config if not defined in Ambiq target
Add default SWO pin number and config if not defined in Ambiq target
C
apache-2.0
mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed,mbedmicro/mbed
b13c0d7adb66133631e78f1aa6799bc2c712b803
WikipediaUnitTests/Code/FBSnapshotTestCase+WMFConvenience.h
WikipediaUnitTests/Code/FBSnapshotTestCase+WMFConvenience.h
#import <FBSnapshotTestCase/FBSnapshotTestCase.h> #import "UIApplication+VisualTestUtils.h" /** * @function WMFSnapshotVerifyView * * Verify correct appearance of a given view. * * Search all folder suffixes, use default naming conventions. * * @param view The view to verify. */ #define WMFSnapshotVerifyView(view) FBSnapshotVerifyView((view), nil) /** * @function WMFSnapshotVerifyViewForOSAndWritingDirection * * Compares @c view with a reference image matching the current OS version & application writing direction (e.g. * "testLaysOutProperly_9.2_RTL@2x.png"). * * @param view The view to verify. */ #define WMFSnapshotVerifyViewForOSAndWritingDirection(view) \ FBSnapshotVerifyViewWithOptions((view), [[UIApplication sharedApplication] wmf_systemVersionAndWritingDirection], FBSnapshotTestCaseDefaultSuffixes(), 0.1); @interface FBSnapshotTestCase (WMFConvenience) - (void)wmf_verifyMultilineLabelWithText:(id)stringOrAttributedString width:(CGFloat)width; - (void)wmf_verifyCellWithIdentifier:(NSString *)identifier fromTableView:(UITableView *)tableView width:(CGFloat)width configuredWithBlock:(void (^)(UITableViewCell *))block; - (void)wmf_verifyView:(UIView *)view width:(CGFloat)width; - (void)wmf_verifyViewAtWindowWidth:(UIView *)view; @end
#import <FBSnapshotTestCase/FBSnapshotTestCase.h> #import "UIApplication+VisualTestUtils.h" /** * @function WMFSnapshotVerifyView * * Verify correct appearance of a given view. * * Search all folder suffixes, use default naming conventions. * * @param view The view to verify. */ #define WMFSnapshotVerifyView(view) FBSnapshotVerifyView((view), nil) /** * @function WMFSnapshotVerifyViewForOSAndWritingDirection * * Compares @c view with a reference image matching the current OS version & application writing direction (e.g. * "testLaysOutProperly_9.2_RTL@2x.png"). * * @param view The view to verify. */ #define WMFSnapshotVerifyViewForOSAndWritingDirection(view) \ FBSnapshotVerifyView((view), [[UIApplication sharedApplication] wmf_systemVersionAndWritingDirection]); @interface FBSnapshotTestCase (WMFConvenience) - (void)wmf_verifyMultilineLabelWithText:(id)stringOrAttributedString width:(CGFloat)width; - (void)wmf_verifyCellWithIdentifier:(NSString *)identifier fromTableView:(UITableView *)tableView width:(CGFloat)width configuredWithBlock:(void (^)(UITableViewCell *))block; - (void)wmf_verifyView:(UIView *)view width:(CGFloat)width; - (void)wmf_verifyViewAtWindowWidth:(UIView *)view; @end
Revert "Add slight tolerance for image differences to visual test macro."
Revert "Add slight tolerance for image differences to visual test macro." This reverts commit 13d6d4e18d98f7c2d496f3454216d96a4d8e95d1.
C
mit
josve05a/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,wikimedia/wikipedia-ios,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,josve05a/wikipedia-ios,montehurd/apps-ios-wikipedia,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,montehurd/apps-ios-wikipedia,wikimedia/wikipedia-ios,josve05a/wikipedia-ios,josve05a/wikipedia-ios,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios,wikimedia/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,montehurd/apps-ios-wikipedia,wikimedia/apps-ios-wikipedia,julienbodet/wikipedia-ios,josve05a/wikipedia-ios,julienbodet/wikipedia-ios,julienbodet/wikipedia-ios,wikimedia/wikipedia-ios
60f92d0b69f688523e81adcc8991f6c44a7264c5
src/pomodoro.h
src/pomodoro.h
// ---------------------------------------------------------------------------- // pomodoro - Provides data structures and methods for manipulating pomodoros // Copyright (c) 2013 Jonathan Speicher (jon.speicher@gmail.com) // Licensed under the MIT license: http://opensource.org/licenses/MIT // ---------------------------------------------------------------------------- #pragma once // Defines the number of characters in a pomodoro time left display string. Note // that this does not account for the terminating NULL character. #define POMODORO_TIME_LEFT_STRING_NUM_CHARS 5 // Defines a pomodoro. Pomodoros consist primarily of the countdown timer and // associated display strings. typedef struct { unsigned int total_seconds_left; unsigned int minutes_left; unsigned int seconds_left; char time_left_string[POMODORO_TIME_LEFT_STRING_NUM_CHARS + 1]; } Pomodoro; // Initializes a pomodoro. This initializes the time remaining and sets the // display string appropriately. void pomodoro_init(Pomodoro* pomodoro); // Decrements the time remaining in the pomodoro by the number of seconds // specified. If the requested decrement is greater than the number of seconds // remaining, the time remaining is set to zero. void pomodoro_decrement_by_seconds(Pomodoro* pomodoro, unsigned int seconds);
// ---------------------------------------------------------------------------- // pomodoro - Provides data structures and methods for manipulating pomodoros // Copyright (c) 2013 Jonathan Speicher (jon.speicher@gmail.com) // Licensed under the MIT license: http://opensource.org/licenses/MIT // ---------------------------------------------------------------------------- #pragma once // Defines the number of characters in a pomodoro time left display string. // Note that this does not account for the terminating NULL character. #define POMODORO_TIME_LEFT_STRING_NUM_CHARS 5 // Defines a pomodoro. Pomodoros consist primarily of the countdown timer and // associated display strings. typedef struct { unsigned int total_seconds_left; unsigned int minutes_left; unsigned int seconds_left; char time_left_string[POMODORO_TIME_LEFT_STRING_NUM_CHARS + 1]; } Pomodoro; // Initializes a pomodoro. This initializes the time remaining and sets the // display string appropriately. void pomodoro_init(Pomodoro* pomodoro); // Decrements the time remaining in the pomodoro by the number of seconds // specified. If the requested decrement is greater than the number of seconds // remaining, the time remaining is set to zero. void pomodoro_decrement_by_seconds(Pomodoro* pomodoro, unsigned int seconds);
Fix a long line in a comment
Fix a long line in a comment
C
mit
elliots/simple-demo-pebble,jonspeicher/Pomade,jonspeicher/Pomade
aca127424836bc72763d64fe0ea655b896293524
src/settings.h
src/settings.h
#define PIN_GAS_PEDAL A0 #define PIN_BATTERY_VOLTAGE A1 #define PIN_CW 5 #define PIN_CCW 6 #define PIN_SWITCH_FORWARDS 10 #define PIN_SWITCH_BACKWARDS 11 #define GAS_VALUE_MIN 446 #define GAS_VALUE_MAX 510 #define BATTERY_READING_12V 670 #define BATTERY_READING_6V 331 #define BATTERY_VOLTAGE_MIN 11 #define SPEED_MIN 0 #define SPEED_MAX_DIRECTION_CHANGE 15 #define SPEED_MAX_FORWARDS 255 #define SPEED_MAX_BACKWARDS 142 #define SPEED_CHANGE_PACE_DEFAULT 10
#define PIN_GAS_PEDAL A0 #define PIN_BATTERY_VOLTAGE A1 #define PIN_CW 6 #define PIN_CCW 5 #define PIN_SWITCH_FORWARDS 10 #define PIN_SWITCH_BACKWARDS 11 #define GAS_VALUE_MIN 446 #define GAS_VALUE_MAX 490 //510 #define BATTERY_READING_12V 670 #define BATTERY_READING_6V 331 #define BATTERY_VOLTAGE_MIN 11 #define SPEED_MIN 0 #define SPEED_MAX_DIRECTION_CHANGE 15 #define SPEED_MAX_FORWARDS 255 #define SPEED_MAX_BACKWARDS 142 #define SPEED_CHANGE_PACE_DEFAULT 10
Change max gas value Swap CW/CCW pins
Change max gas value Swap CW/CCW pins
C
mit
schinken/E-KettCar,schinken/E-KettCar
472da090a1355b9658e60af74cb54da827b0c03e
src/cpu.c
src/cpu.c
// // Created by Jake Kinsella on 4/17/17. // #include "cpu.h" #include "registers.h" #include "ram.h" #include "matcher/matcher.h" void initialize() { initialize_registers(); initialize_ram(); } void cycle() { uint8_t instruction = read_byte_from_address(pc); printf("%d: %d\n", pc, instruction); // pc starts at instruction when passed to handle functions int index = match(instruction); if (index != -1) { InstructionTemplate template = get_registered_template(index); int dst_code = get_dst_code_from_opcode(instruction); int src_code = get_src_code_from_opcode(instruction); int rp_code = get_rp_code_from_opcode(instruction); run_instruction(dst_code, src_code, rp_code, template); } } void print_register_status() { printf("A: %d, B: %d, C: %d, D: %d, E: %d, F: %d, H: %d, L: %d, SP: %d\n", a, b, c, d, e, f, h, l, combine_bytes(s, p)); }
// // Created by Jake Kinsella on 4/17/17. // #include "cpu.h" #include "registers.h" #include "ram.h" #include "matcher/matcher.h" void initialize() { initialize_registers(); initialize_ram(); } void cycle() { uint8_t instruction = read_byte_from_address(pc); printf("0x%x: 0x%x\n", pc, instruction); // pc starts at instruction when passed to handle functions int index = match(instruction); if (index != -1) { InstructionTemplate template = get_registered_template(index); int dst_code = get_dst_code_from_opcode(instruction); int src_code = get_src_code_from_opcode(instruction); int rp_code = get_rp_code_from_opcode(instruction); run_instruction(dst_code, src_code, rp_code, template); } } void print_register_status() { printf("A: 0x%x, B: 0x%x, C: 0x%x, D: 0x%x, E: 0x%x, F: 0x%x, H: 0x%x, L: 0x%x, SP: 0x%x\n", a, b, c, d, e, f, h, l, combine_bytes(s, p)); }
Print hex in debug messages
Print hex in debug messages
C
mit
TheLocust3/Intel-8080-Emulator,TheLocust3/Intel-8080-Emulator
fe328acd898dc8efe35c8a8b9c9ea16630f9ec49
tests/regression/02-base/51-evalint-deep.c
tests/regression/02-base/51-evalint-deep.c
// from SV-COMP: nla-digbench-scaling/ps6-ll_valuebound5.c // contains deep integer expressions that shouldn't cause extremely exponential slowdown // when evaluated by base's eval_rv and EvalInt jointly // runs (as unknown) under 0.1s #include <assert.h> void assume_abort_if_not(int cond) { if(!cond) {abort();} } int main() { short k; long long y, x, c; assume_abort_if_not(k>=0 && k<=5); assume_abort_if_not(k <= 256); y = 0; x = 0; c = 0; while (1) { assert(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0); if (!(c < k)) break; c = c + 1; y = y + 1; x = y * y * y * y * y + x; } assert(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0); assert(k*y == y*y); return 0; }
// from SV-COMP: nla-digbench-scaling/ps6-ll_valuebound5.c // contains deep integer expressions that shouldn't cause extremely exponential slowdown // when evaluated by base's eval_rv and EvalInt jointly // runs (as unknown) under 0.1s #include <assert.h> void assume_abort_if_not(int cond) { if(!cond) {abort();} } int main() { short k; long long y, x, c; assume_abort_if_not(k>=0 && k<=5); assume_abort_if_not(k <= 256); y = 0; x = 0; c = 0; while (1) { assert(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0); // UNKNOWN (by design) if (!(c < k)) break; c = c + 1; y = y + 1; x = y * y * y * y * y + x; } assert(-2*y*y*y*y*y*y - 6 * y*y*y*y*y - 5 * y*y*y*y + y*y + 12*x == 0); // UNKNOWN (by design) assert(k*y == y*y); // UNKNOWN (by design) return 0; }
Add UNKNOWN annotations to 02/51
Add UNKNOWN annotations to 02/51
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
d3858eb7da569afc310bf14d4fed9d754e3e0db3
test/get-compositor.c
test/get-compositor.c
#include <X11/X.h> #include <X11/Xatom.h> #include <X11/Xlib.h> #include <stdio.h> int main() { Display *display = XOpenDisplay(NULL); if (display == NULL) { fprintf(stderr, "Could not connect to $DISPLAY.\n"); return 1; } char buf[32]; snprintf(buf, sizeof(buf), "_NET_WM_CM_S%d", (int)DefaultScreen(display)); Atom atom = XInternAtom(display, buf, False); Window w = XGetSelectionOwner(display, atom); if (w == None) { fprintf(stderr, "No compositor detected.\n"); return 1; } printf("%#llx\n", (unsigned long long)w); return 0; }
#include <X11/X.h> #include <X11/Xatom.h> #include <X11/Xlib.h> #include <stdio.h> int main() { Display *display = XOpenDisplay(NULL); if (display == NULL) { fprintf(stderr, "Could not connect to $DISPLAY.\n"); return 1; } char buf[32]; // Flawfinder: ignore snprintf(buf, sizeof(buf), "_NET_WM_CM_S%d", // Flawfinder: ignore (int)DefaultScreen(display)); buf[sizeof(buf)-1] = 0; Atom atom = XInternAtom(display, buf, False); Window w = XGetSelectionOwner(display, atom); if (w == None) { fprintf(stderr, "No compositor detected.\n"); return 1; } printf("%#llx\n", (unsigned long long)w); return 0; }
Fix a potentially unportable use of snprintf found by flawfinder.
Fix a potentially unportable use of snprintf found by flawfinder.
C
apache-2.0
google/xsecurelock,google/xsecurelock
3a19cbf530648a63fb3f73630046c561f70c6b71
drivers/scsi/qla4xxx/ql4_version.h
drivers/scsi/qla4xxx/ql4_version.h
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k10"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2010 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.02.00-k11"
Update driver version to 5.02.00-k11
[SCSI] qla4xxx: Update driver version to 5.02.00-k11 Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com> Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>
C
mit
KristFoundation/Programs,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
315cc71afe5d5245e60ce4564328619c49310b6a
Include/KAI/Platform/GameController.h
Include/KAI/Platform/GameController.h
#ifndef KAI_PLATFORM_GAME_CONTROLLER_H #define KAI_PLATFORM_GAME_CONTROLLER_H #include KAI_PLATFORM_INCLUDE(GameController.h) #endif // SHATTER_PLATFORM_GAME_CONTROLLER_H //EOF
#ifndef KAI_PLATFORM_GAME_CONTROLLER_H #define KAI_PLATFORM_GAME_CONTROLLER_H #include KAI_PLATFORM_INCLUDE(GameController.h) #endif //EOF
Add some color for console output
Add some color for console output
C
mit
cschladetsch/KAI,cschladetsch/KAI,cschladetsch/KAI
931352d4bfab72897dc8012c78d9f64739656226
llvmpy/include/python3adapt.h
llvmpy/include/python3adapt.h
#ifndef PYTHON3ADAPT_H #define PYTHON3ADAPT_H #if (PY_VERSION_HEX < 0x03000000) #define PyBytes_Check PyString_Check #define PyBytes_Size PyString_Size #define PyBytes_AsString PyString_AsString #define PyBytes_FromStringAndSize PyString_FromStringAndSize #define PyBytes_FromString PyString_FromString #else #define PyString_Check PyUnicode_Check #define PyString_Size PyUnicode_GET_SIZE #define PyString_FromStringAndSize PyUnicode_FromStringAndSize #define PyString_FromString PyUnicode_FromString #define PyInt_Check PyLong_Check #define PyInt_FromLong PyLong_FromLong #define PyInt_AsLong PyLong_AsLong #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyFile_Check(x) (1) #if (PY_VERSION_HEX < 0x03030000) #define PyString_AsString(x) PyBytes_AsString(PyUnicode_AsUTF8String(x)) #else #define PyString_AsString PyUnicode_AsUTF8 #endif #endif // (PY_VERSION_HEX < 0x03000000) #endif //PYTHON3ADAPT_H
#ifndef PYTHON3ADAPT_H #define PYTHON3ADAPT_H #if (PY_VERSION_HEX < 0x03000000) #define PyBytes_Check PyString_Check #define PyBytes_Size PyString_Size #define PyBytes_AsString PyString_AsString #define PyBytes_FromStringAndSize PyString_FromStringAndSize #define PyBytes_FromString PyString_FromString #else #define PyString_Check PyUnicode_Check #define PyString_Size PyUnicode_GET_SIZE #define PyString_FromStringAndSize PyUnicode_FromStringAndSize #define PyString_FromString PyUnicode_FromString #define PyInt_Check PyLong_Check #define PyInt_FromLong PyLong_FromLong #define PyInt_AsLong PyLong_AsLong #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask #define PyFile_Check(x) (1) #if (PY_VERSION_HEX < 0x03030000) #define PyString_AsString _PyUnicode_AsString #else #define PyString_AsString PyUnicode_AsUTF8 #endif #endif // (PY_VERSION_HEX < 0x03000000) #endif //PYTHON3ADAPT_H
Fix memory leak in Python 3.2
Fix memory leak in Python 3.2
C
bsd-3-clause
llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy,llvmpy/llvmpy
90c74ab32dc8a19f979975b9910c1810032f1ba9
engine/core/include/halley/core/api/input_api.h
engine/core/include/halley/core/api/input_api.h
#pragma once #include <functional> #include "halley/maths/vector2.h" #include "halley/core/input/input_device.h" namespace Halley { class InputJoystick; class InputTouch; class InputAPI { public: virtual ~InputAPI() {} virtual size_t getNumberOfKeyboards() const = 0; virtual std::shared_ptr<InputDevice> getKeyboard(int id = 0) const = 0; virtual size_t getNumberOfJoysticks() const = 0; virtual std::shared_ptr<InputJoystick> getJoystick(int id = 0) const = 0; virtual size_t getNumberOfMice() const = 0; virtual std::shared_ptr<InputDevice> getMouse(int id = 0) const = 0; virtual Vector<std::shared_ptr<InputTouch>> getNewTouchEvents() = 0; virtual Vector<std::shared_ptr<InputTouch>> getTouchEvents() = 0; virtual void setMouseRemapping(std::function<Vector2f(Vector2i)> remapFunction) = 0; virtual void requestControllerSetup(int numControllers, std::function<void(bool)> callback) { callback(true); } }; }
#pragma once #include <functional> #include "halley/maths/vector2.h" #include "halley/core/input/input_device.h" #include "halley/maths/colour.h" #include "halley/data_structures/maybe.h" namespace Halley { class InputJoystick; class InputTouch; class InputControllerData { public: Colour colour; String name; }; class InputAPI { public: virtual ~InputAPI() {} virtual size_t getNumberOfKeyboards() const = 0; virtual std::shared_ptr<InputDevice> getKeyboard(int id = 0) const = 0; virtual size_t getNumberOfJoysticks() const = 0; virtual std::shared_ptr<InputJoystick> getJoystick(int id = 0) const = 0; virtual size_t getNumberOfMice() const = 0; virtual std::shared_ptr<InputDevice> getMouse(int id = 0) const = 0; virtual Vector<std::shared_ptr<InputTouch>> getNewTouchEvents() = 0; virtual Vector<std::shared_ptr<InputTouch>> getTouchEvents() = 0; virtual void setMouseRemapping(std::function<Vector2f(Vector2i)> remapFunction) = 0; virtual void requestControllerSetup(int minControllers, int maxControllers, std::function<void(bool)> callback, Maybe<std::vector<InputControllerData>> controllerData = {}) { callback(true); } }; }
Support for additional data to be passed for controller support (implemented on consoles).
Support for additional data to be passed for controller support (implemented on consoles).
C
apache-2.0
amzeratul/halley,amzeratul/halley,amzeratul/halley
472bd7982e5a006fbbe75a0cd88ba494b31719d6
ext/metrics/metrics.c
ext/metrics/metrics.c
#include <ruby.h> #include "client.h" static VALUE metrics_report_metric(VALUE self, VALUE user_id, VALUE key, VALUE val) { char * user_id_str, * key_str; int result = 0; user_id_str = RSTRING_PTR(user_id); key_str = RSTRING_PTR(key); /* Figure out what this belongs to and call the apprioriate one. */ switch(TYPE(val)) { case T_FIXNUM: result = metrici((const char *)user_id_str, (const char *)key_str, FIX2INT(val)); break; case T_FLOAT: result = metricd((const char *)user_id_str, (const char *)key_str, NUM2DBL(val)); break; default: rb_raise(rb_eTypeError, "Value is not a valid type. Expecting Fixnum or Float."); break; } return (result > 0) ? T_TRUE : T_FALSE; } void Init_metrics(void) { VALUE klass = rb_define_class("Metrics", rb_cObject); rb_define_singleton_method(klass, "report_metric", metrics_report_metric, 3); }
#include <ruby.h> #include "client.h" static VALUE rb_metrics_report_metric(VALUE self, VALUE user_id, VALUE key, VALUE val) { char * user_id_str, * key_str; int result = 0; user_id_str = RSTRING_PTR(user_id); key_str = RSTRING_PTR(key); /* Figure out what this belongs to and call the apprioriate one. */ switch(TYPE(val)) { case T_FIXNUM: result = metrici((const char *)user_id_str, (const char *)key_str, FIX2INT(val)); break; case T_FLOAT: result = metricd((const char *)user_id_str, (const char *)key_str, NUM2DBL(val)); break; default: rb_raise(rb_eTypeError, "Value is not a valid type. Expecting Fixnum or Float."); break; } return (result > 0) ? T_TRUE : T_FALSE; } static VALUE rb_metrics_initialize(VALUE self, VALUE hostname, VALUE port) { if(!FIXNUM_P(port)) { rb_raise(rb_eTypeError, "Port is not a Fixnum."); return T_FALSE; } rb_iv_set(self, "hostname", hostname); rb_iv_set(self, "port", port); return T_TRUE; } void Init_metrics(void) { VALUE rb_mMetrics = rb_define_module("Metrics"); VALUE rb_cNativeClient = rb_define_class_under(rb_mMetrics, "NativeClient", rb_cObject); rb_define_singleton_method(rb_cNativeClient, "report_metric", rb_metrics_report_metric, 3); rb_define_method(rb_cNativeClient, "initialize", rb_metrics_initialize, 2); }
Move this in to an actual class.
Move this in to an actual class.
C
mit
bradhe/metrics-client,bradhe/metrics-client
19cc9b027e894e1dff68f18d7d660ac55b20b784
include/flatcc/flatcc_version.h
include/flatcc/flatcc_version.h
#define FLATCC_VERSION_TEXT "0.4.3" #define FLATCC_VERSION_MAJOR 0 #define FLATCC_VERSION_MINOR 4 #define FLATCC_VERSION_PATCH 3 /* 1 or 0 */ #define FLATCC_VERSION_RELEASED 1
#define FLATCC_VERSION_TEXT "0.5.0-pre" #define FLATCC_VERSION_MAJOR 0 #define FLATCC_VERSION_MINOR 5 #define FLATCC_VERSION_PATCH 0 /* 1 or 0 */ #define FLATCC_VERSION_RELEASED 0
Prepare for next version version
Prepare for next version version
C
apache-2.0
dvidelabs/flatcc,dvidelabs/flatcc,dvidelabs/flatcc
eb87dfe4886db065ce24f1f2db3570497366a559
src/network_os.h
src/network_os.h
#pragma once #ifndef INCL_NETWORKOS #define INCL_NETWORKOS #include <iostream> #include <memory> #include <string> #include <vector> #include <map> #include <cstdlib> #ifdef WIN32 #include <WinSock2.h> #include <WS2tcpip.h> #include <inaddr.h> #include <in6addr.h> #include <mstcpip.h> #define SHUT_RDWR SD_BOTH typedef int socklen_t; #pragma comment(lib, "ws2_32.lib") #undef SetPort #else #include <sys/ioctl.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #include <errno.h> #include <fcntl.h> #include <sys/socket.h> #include <netinet/ip.h> #include <netinet/ip6.h> #include <netinet/tcp.h> typedef unsigned int socklen_t; #define INVALID_SOCKET (-1) #endif #endif
#pragma once #ifndef INCL_NETWORKOS #define INCL_NETWORKOS #include <iostream> #include <memory> #include <string> #include <vector> #include <map> #include <cstdlib> #if defined(_MSC_VER) #include <WinSock2.h> #include <WS2tcpip.h> #include <inaddr.h> #include <in6addr.h> #include <mstcpip.h> #define SHUT_RDWR SD_BOTH typedef int socklen_t; #pragma comment(lib, "ws2_32.lib") #undef SetPort #else #include <sys/ioctl.h> #include <sys/time.h> #include <sys/types.h> #include <unistd.h> #include <errno.h> #include <fcntl.h> #include <sys/socket.h> #include <netinet/ip.h> #include <netinet/ip6.h> #include <netinet/tcp.h> typedef unsigned int socklen_t; #define INVALID_SOCKET (-1) #endif #endif
Use variable that cmake defines instead of specific one
Use variable that cmake defines instead of specific one
C
mit
Meisaka/NetPort
1b98d6ce44baea807223c67ddf97cc0dc9108741
CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
CryptoPkg/Library/IntrinsicLib/MemoryIntrinsics.c
/** @file Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based Cryptographic Library. Copyright (c) 2010, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #include <Base.h> #include <Library/BaseMemoryLib.h> /* OpenSSL will use floating point support, and C compiler produces the _fltused symbol by default. Simply define this symbol here to satisfy the linker. */ int _fltused = 1; /* Sets buffers to a specified character */ void * memset (void *dest, char ch, unsigned int count) { // // Declare the local variables that actually move the data elements as // volatile to prevent the optimizer from replacing this function with // the intrinsic memset() // volatile UINT8 *Pointer; Pointer = (UINT8 *)dest; while (count-- != 0) { *(Pointer++) = ch; } return dest; }
/** @file Intrinsic Memory Routines Wrapper Implementation for OpenSSL-based Cryptographic Library. Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR> This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ #include <Base.h> #include <Library/BaseMemoryLib.h> /* OpenSSL will use floating point support, and C compiler produces the _fltused symbol by default. Simply define this symbol here to satisfy the linker. */ int _fltused = 1; /* Sets buffers to a specified character */ void * memset (void *dest, char ch, unsigned int count) { // // NOTE: Here we use one base implementation for memset, instead of the direct // optimized SetMem() wrapper. Because the IntrinsicLib has to be built // without whole program optimization option, and there will be some // potential register usage errors when calling other optimized codes. // // // Declare the local variables that actually move the data elements as // volatile to prevent the optimizer from replacing this function with // the intrinsic memset() // volatile UINT8 *Pointer; Pointer = (UINT8 *)dest; while (count-- != 0) { *(Pointer++) = ch; } return dest; }
Add comments for clarification about memset implementation.
Add comments for clarification about memset implementation. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Long, Qin <qin.long@intel.com> Reviewed-by: Ye, Ting <ting.ye@intel.com> Reviewed-by: Fu, Siyuan <siyuan.fu@intel.com> git-svn-id: 3158a46dfd52e07d1fda3e32e1ab2e353a00b20f@15662 6f19259b-4bc3-4df7-8a09-765794883524
C
bsd-2-clause
MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2,MattDevo/edk2
6386bea6b175941dd7af1036cca991b4b77102fb
Bag.h
Bag.h
#ifndef Bag_h #define Bag_h #include <unordered_set> #include <vector> #include <ostream> //A node in the tree deocomposition class Bag{ private: unsigned long id; std::vector<unsigned long> nodes; unsigned long parent=0; std::vector<unsigned long> children; public: Bag(unsigned long id, std::unordered_set<unsigned long> nodeset){ this->id = id; for(unsigned long node:nodeset) nodes.push_back(node); } void set_parent(unsigned long parent){ this->parent = parent; } void add_to_children(unsigned long node){ children.push_back(node); } std::vector<unsigned long>& get_nodes(){ return nodes; } friend std::ostream& operator<<(std::ostream& out, Bag& bag); }; std::ostream& operator<<(std::ostream& out, Bag& bag){ out << bag.id << std::endl; out << bag.nodes.size() << std::endl; for(auto node:bag.nodes) out << node << "\t"; out << std::endl; out << bag.parent << std::endl; out << bag.children.size() << std::endl; for(auto node:bag.children) out << node << "\t"; if(bag.children.size()>0) out << std::endl; return out; } #endif /* Bag_h */
#ifndef Bag_h #define Bag_h #include <unordered_set> #include <vector> #include <ostream> //A node in the tree deocomposition class Bag{ private: unsigned long id; std::vector<unsigned long> nodes; unsigned long parent=0; std::vector<unsigned long> children; public: Bag(unsigned long id, const std::unordered_set<unsigned long> &nodeset){ this->id = id; for(unsigned long node:nodeset) nodes.push_back(node); } void set_parent(unsigned long parent){ this->parent = parent; } void add_to_children(unsigned long node){ children.push_back(node); } std::vector<unsigned long>& get_nodes(){ return nodes; } friend std::ostream& operator<<(std::ostream& out, Bag& bag); }; std::ostream& operator<<(std::ostream& out, Bag& bag){ out << bag.id << std::endl; out << bag.nodes.size() << std::endl; for(auto node:bag.nodes) out << node << "\t"; out << std::endl; out << bag.parent << std::endl; out << bag.children.size() << std::endl; for(auto node:bag.children) out << node << "\t"; if(bag.children.size()>0) out << std::endl; return out; } #endif /* Bag_h */
Make get_nodes return a const&, and optimize uses of this function
Make get_nodes return a const&, and optimize uses of this function
C
mit
smaniu/treewidth,smaniu/treewidth
e4d76b921d8f7bcf36c3de63108f2156de578c7c
src/emu/riscv-processor-logging.h
src/emu/riscv-processor-logging.h
// // riscv-processor-logging.h // #ifndef riscv_processor_logging_h #define riscv_processor_logging_h namespace riscv { /* Processor logging flags */ enum { proc_log_inst = 1<<0, /* Log instructions */ proc_log_operands = 1<<1, /* Log instruction operands */ proc_log_memory = 1<<2, /* Log memory mapping information */ proc_log_mmio = 1<<3, /* Log memory mapped IO */ proc_log_csr_mmode = 1<<4, /* Log machine status and control registers */ proc_log_csr_hmode = 1<<5, /* Log hypervisor status and control registers */ proc_log_csr_smode = 1<<6, /* Log supervisor status and control registers */ proc_log_csr_umode = 1<<7, /* Log user status and control registers */ proc_log_int_reg = 1<<8, /* Log integer registers */ proc_log_trap = 1<<9, /* Log processor traps */ proc_log_pagewalk = 1<<10, /* Log virtual memory page walks */ proc_log_ebreak_cli = 1<<11, /* Log virtual memory page walks */ proc_log_no_pseudo = 1<<12 /* Don't decode pseudoinstructions */ }; } #endif
// // riscv-processor-logging.h // #ifndef riscv_processor_logging_h #define riscv_processor_logging_h namespace riscv { /* Processor logging flags */ enum { proc_log_inst = 1<<0, /* Log instructions */ proc_log_operands = 1<<1, /* Log instruction operands */ proc_log_memory = 1<<2, /* Log memory mapping information */ proc_log_mmio = 1<<3, /* Log memory mapped IO */ proc_log_csr_mmode = 1<<4, /* Log machine status and control registers */ proc_log_csr_hmode = 1<<5, /* Log hypervisor status and control registers */ proc_log_csr_smode = 1<<6, /* Log supervisor status and control registers */ proc_log_csr_umode = 1<<7, /* Log user status and control registers */ proc_log_int_reg = 1<<8, /* Log integer registers */ proc_log_trap = 1<<9, /* Log processor traps */ proc_log_pagewalk = 1<<10, /* Log virtual memory page walks */ proc_log_ebreak_cli = 1<<11, /* Switch to debug CLI on ebreak */ proc_log_no_pseudo = 1<<12 /* Don't decode pseudoinstructions */ }; } #endif
Update comment for enum proc_log_ebreak_cli
Update comment for enum proc_log_ebreak_cli
C
mit
rv8-io/rv8,rv8-io/rv8,rv8-io/rv8
95411cf0b5dadfe821f4121721c0f50e806c4630
roles/netbootxyz/files/ipxe/local/general.h
roles/netbootxyz/files/ipxe/local/general.h
#define CONSOLE_CMD /* Console command */ #define DIGEST_CMD /* Image crypto digest commands */ #define DOWNLOAD_PROTO_HTTPS /* Secure Hypertext Transfer Protocol */ #define IMAGE_COMBOOT /* COMBOOT */ #define IMAGE_TRUST_CMD /* Image trust management commands */ #define NET_PROTO_IPV6 /* IPv6 protocol */ #define NSLOOKUP_CMD /* DNS resolving command */ #define NTP_CMD /* NTP commands */ #define PCI_CMD /* PCI commands */ #define REBOOT_CMD /* Reboot command */ #define TIME_CMD /* Time commands */ #define VLAN_CMD /* VLAN commands */
#define CONSOLE_CMD /* Console command */ #define DIGEST_CMD /* Image crypto digest commands */ #define DOWNLOAD_PROTO_HTTPS /* Secure Hypertext Transfer Protocol */ #define IMAGE_COMBOOT /* COMBOOT */ #define IMAGE_TRUST_CMD /* Image trust management commands */ #define IMAGE_GZIP /* GZIP image support */ #define IMAGE_ZLIB /* ZLIB image support */ #define NET_PROTO_IPV6 /* IPv6 protocol */ #define NSLOOKUP_CMD /* DNS resolving command */ #define NTP_CMD /* NTP commands */ #define PCI_CMD /* PCI commands */ #define REBOOT_CMD /* Reboot command */ #define TIME_CMD /* Time commands */ #define VLAN_CMD /* VLAN commands */
Enable GZIP and ZLIB options in iPXE
Enable GZIP and ZLIB options in iPXE
C
apache-2.0
antonym/netboot.xyz,antonym/netboot.xyz,antonym/netboot.xyz
989101bc7493f39dd0f7da840de3940b2af323c9
test/test-file.c
test/test-file.c
#include <glib.h> #include <glib/gstdio.h> #include <uuid/uuid.h> #include <wizbit/file.h> int main() { { struct wiz_file *file; wiz_vref vref; FILE *fp; /* Open up a new versioned file and create a couple of revisions */ file = wiz_file_open(WIZ_FILE_NEW, 0, 0); fp = wiz_file_get_handle(file); fprintf(fp, "I BELIEVE"); wiz_file_snapshot(file, vref); fprintf(fp, "\nNO RLY"); wiz_file_add_parent(file, vref); wiz_file_snapshot(file, vref); fprintf(fp, "\nI CAN HAS BELIEVE!?"); wiz_file_add_parent(file, vref); wiz_file_snapshot(file, vref); wiz_file_close(file); } return 0; }
#include <glib.h> #include <glib/gstdio.h> #include <uuid/uuid.h> #include <wizbit/vref.h> #include <wizbit/file.h> int main() { { wiz_vref_hexbuffer buffer; struct wiz_file *file; wiz_vref vref; FILE *fp; /* Open up a new versioned file and create a couple of revisions */ file = wiz_file_open(WIZ_FILE_NEW, 0, 0); fp = wiz_file_get_handle(file); fprintf(fp, "I BELIEVE"); wiz_file_snapshot(file, vref); fprintf(fp, "\nNO RLY"); wiz_file_add_parent(file, vref); wiz_file_snapshot(file, vref); fprintf(fp, "\nI CAN HAS BELIEVE!?"); wiz_file_add_parent(file, vref); wiz_file_snapshot(file, vref); printf("%s\n", wiz_vref_to_hex(vref, buffer)); wiz_file_close(file); } return 0; }
Print sha1 of last commit
Print sha1 of last commit
C
lgpl-2.1
wizbit-archive/wizbit,wizbit-archive/wizbit
57f17473791703ac82add77c3d77d13d8e2dfbc4
src/tests/test_utils/draw_call_perf_utils.h
src/tests/test_utils/draw_call_perf_utils.h
// // Copyright (c) 2017 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // draw_call_perf_utils.h: // Common utilities for performance tests that need to do a large amount of draw calls. // #ifndef TESTS_TEST_UTILS_DRAW_CALL_PERF_UTILS_H_ #define TESTS_TEST_UTILS_DRAW_CALL_PERF_UTILS_H_ #include "angle_gl.h" // Returns program ID. The program is left in use and the uniforms are set to default values: // uScale = 0.5, uOffset = -0.5 GLuint SetupSimpleScaleAndOffsetProgram(); // Returns buffer ID filled with 2-component triangle coordinates. The buffer is left as bound. // Generates triangles like this with 2-component coordinates: // A // / \ // / \ // B-----C GLuint Create2DTriangleBuffer(size_t numTris, GLenum usage); // Creates an FBO with a texture color attachment. The texture is GL_RGBA and has dimensions // width/height. The FBO and texture ids are written to the out parameters. void CreateColorFBO(GLsizei width, GLsizei height, GLuint *fbo, GLuint *texture); #endif // TESTS_TEST_UTILS_DRAW_CALL_PERF_UTILS_H_
// // Copyright (c) 2017 The ANGLE Project Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // // draw_call_perf_utils.h: // Common utilities for performance tests that need to do a large amount of draw calls. // #ifndef TESTS_TEST_UTILS_DRAW_CALL_PERF_UTILS_H_ #define TESTS_TEST_UTILS_DRAW_CALL_PERF_UTILS_H_ #include <stddef.h> #include "angle_gl.h" // Returns program ID. The program is left in use and the uniforms are set to default values: // uScale = 0.5, uOffset = -0.5 GLuint SetupSimpleScaleAndOffsetProgram(); // Returns buffer ID filled with 2-component triangle coordinates. The buffer is left as bound. // Generates triangles like this with 2-component coordinates: // A // / \ // / \ // B-----C GLuint Create2DTriangleBuffer(size_t numTris, GLenum usage); // Creates an FBO with a texture color attachment. The texture is GL_RGBA and has dimensions // width/height. The FBO and texture ids are written to the out parameters. void CreateColorFBO(GLsizei width, GLsizei height, GLuint *fbo, GLuint *texture); #endif // TESTS_TEST_UTILS_DRAW_CALL_PERF_UTILS_H_
Fix angle_perftests compilation on Linux
Fix angle_perftests compilation on Linux BUG=angleproject:1669 Change-Id: Iec4ed1be1e17d86a095d8c35bddc48aa85effa39 Reviewed-on: https://chromium-review.googlesource.com/424967 Reviewed-by: Yuly Novikov <36f5580f63d0a3eacc17e89a61d11e2f646630d2@chromium.org> Commit-Queue: Yuly Novikov <36f5580f63d0a3eacc17e89a61d11e2f646630d2@chromium.org>
C
bsd-3-clause
ecoal95/angle,MSOpenTech/angle,ppy/angle,ecoal95/angle,ppy/angle,ecoal95/angle,ecoal95/angle,MSOpenTech/angle,ecoal95/angle,ppy/angle,MSOpenTech/angle,MSOpenTech/angle,ppy/angle
5b5828b74c758d7babffb2407464507fa004b157
test/CodeGen/frame-pointer-elim.c
test/CodeGen/frame-pointer-elim.c
// RUN: %clang -ccc-host-triple i386 -S -o - %s | \ // RUN: FileCheck --check-prefix=DEFAULT %s // DEFAULT: f0: // DEFAULT: pushl %ebp // DEFAULT: ret // DEFAULT: f1: // DEFAULT: pushl %ebp // DEFAULT: ret // RUN: %clang -ccc-host-triple i386 -S -o - -fomit-frame-pointer %s | \ // RUN: FileCheck --check-prefix=OMIT_ALL %s // OMIT_ALL: f0: // OMIT_ALL-NOT: pushl %ebp // OMIT_ALL: ret // OMIT_ALL: f1: // OMIT_ALL-NOT: pushl %ebp // OMIT_ALL: ret // RUN: %clang -ccc-host-triple i386 -S -o - -momit-leaf-frame-pointer %s | \ // RUN: FileCheck --check-prefix=OMIT_LEAF %s // OMIT_LEAF: f0: // OMIT_LEAF-NOT: pushl %ebp // OMIT_LEAF: ret // OMIT_LEAF: f1: // OMIT_LEAF: pushl %ebp // OMIT_LEAF: ret void f0() {} void f1() { f0(); }
// RUN: %clang -ccc-host-triple i386-apple-darwin -S -o - %s | \ // RUN: FileCheck --check-prefix=DARWIN %s // DARWIN: f0: // DARWIN: pushl %ebp // DARWIN: ret // DARWIN: f1: // DARWIN: pushl %ebp // DARWIN: ret // RUN: %clang -ccc-host-triple i386-pc-linux-gnu -S -o - %s | \ // RUN: FileCheck --check-prefix=LINUX %s // LINUX: f0: // LINUX-NOT: pushl %ebp // LINUX: ret // LINUX: f1: // LINUX: pushl %ebp // LINUX: ret // RUN: %clang -ccc-host-triple i386-darwin -S -o - -fomit-frame-pointer %s | \ // RUN: FileCheck --check-prefix=OMIT_ALL %s // OMIT_ALL: f0: // OMIT_ALL-NOT: pushl %ebp // OMIT_ALL: ret // OMIT_ALL: f1: // OMIT_ALL-NOT: pushl %ebp // OMIT_ALL: ret // RUN: %clang -ccc-host-triple i386-darwin -S -o - -momit-leaf-frame-pointer %s | \ // RUN: FileCheck --check-prefix=OMIT_LEAF %s // OMIT_LEAF: f0: // OMIT_LEAF-NOT: pushl %ebp // OMIT_LEAF: ret // OMIT_LEAF: f1: // OMIT_LEAF: pushl %ebp // OMIT_LEAF: ret void f0() {} void f1() { f0(); }
Fix test by fully specifying the platform.
Fix test by fully specifying the platform. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@124719 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
f5920cfe85c21bb1c928d4550c33a1bedf543913
arc/arc/Model/Protocols/FileSystemObject.h
arc/arc/Model/Protocols/FileSystemObject.h
// // FileSystemObject.h // arc // // Created by Jerome Cheng on 1/4/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> @protocol FileSystemObject <NSObject> @required // The name of this object. @property (strong, nonatomic) NSString *name; // This should be able to be used to reconstruct whatever is needed // to actually access the file/folder. @property (strong, nonatomic) NSString *identifier; // The parent of this object. @property (weak, nonatomic) id<FileSystemObject> parent; // Whether or not this object can be removed. @property BOOL isRemovable; // The size of this object. Folders should return the number of objects // within, Files their size in bytes. @property float size; // Initialises this object with the given name, path, and parent. - (id)initWithName:(NSString *)name path:(NSString *)path parent:(id<FileSystemObject>)parent; // Returns the contents of this object. - (id<NSObject>)contents; // Removes this object. // Returns YES if successful, NO otherwise. // If NO is returned, the state of the object or its contents is unstable. - (BOOL)remove; @end
// // FileSystemObject.h // arc // // Created by Jerome Cheng on 1/4/13. // Copyright (c) 2013 nus.cs3217. All rights reserved. // #import <Foundation/Foundation.h> @protocol FileSystemObject <NSObject> @required // The name of this object. @property (strong, nonatomic) NSString *name; // This should be able to be used to reconstruct whatever is needed // to actually access the file/folder. @property (strong, nonatomic) NSString *identifier; // The parent of this object. @property (weak, nonatomic) id<FileSystemObject> parent; // Whether or not this object can be removed. @property BOOL isRemovable; // The size of this object. Folders should return the number of objects // within, Files their size in bytes. @property float size; // Returns the contents of this object. - (id<NSObject>)contents; @optional // Removes this object. // Returns YES if successful, NO otherwise. // If NO is returned, the state of the object or its contents is unstable. - (BOOL)remove; // Initialises this object with the given name, path, and parent. - (id)initWithName:(NSString *)name path:(NSString *)path parent:(id<FileSystemObject>)parent; @end
Make remove and initWithName:path:parent optional.
Make remove and initWithName:path:parent optional.
C
mit
BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc,BenTobias/arc
6cc8fef4cbeb0b65d225d7b599c75eb5b40a6534
fs/xfs/linux-2.6/xfs_ioctl32.h
fs/xfs/linux-2.6/xfs_ioctl32.h
/* * Copyright (c) 2004-2005 Silicon Graphics, Inc. * All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __XFS_IOCTL32_H__ #define __XFS_IOCTL32_H__ extern long xfs_file_compat_ioctl(struct file *, unsigned, unsigned long); extern long xfs_file_compat_invis_ioctl(struct file *, unsigned, unsigned); #endif /* __XFS_IOCTL32_H__ */
/* * Copyright (c) 2004-2005 Silicon Graphics, Inc. * All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation. * * This program is distributed in the hope that it would be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef __XFS_IOCTL32_H__ #define __XFS_IOCTL32_H__ extern long xfs_file_compat_ioctl(struct file *, unsigned, unsigned long); extern long xfs_file_compat_invis_ioctl(struct file *, unsigned, unsigned long); #endif /* __XFS_IOCTL32_H__ */
Fix compiler warning from xfs_file_compat_invis_ioctl prototype.
[XFS] Fix compiler warning from xfs_file_compat_invis_ioctl prototype. SGI-PV: 904196 SGI-Modid: xfs-linux-melb:xfs-kern:25509a Signed-off-by: Andrew Morton <5c1e68b099950c134891f0b6e179498a8ebe9cf9@osdl.org> Signed-off-by: Nathan Scott <e2e3f1f24cbc439f8c1ba9b08f9954237d64be64@sgi.com>
C
mit
KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas
2be509c97fdc2cfc6771d97f346ff5e4c5c85089
drivers/scsi/qla4xxx/ql4_version.h
drivers/scsi/qla4xxx/ql4_version.h
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2012 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.03.00-k2"
/* * QLogic iSCSI HBA Driver * Copyright (c) 2003-2012 QLogic Corporation * * See LICENSE.qla4xxx for copyright and licensing details. */ #define QLA4XXX_DRIVER_VERSION "5.03.00-k3"
Update driver version to 5.03.00-k3
[SCSI] qla4xxx: Update driver version to 5.03.00-k3 Signed-off-by: Vikas Chaudhary <c251871a64d7d31888eace0406cb3d4c419d5f73@qlogic.com> Signed-off-by: James Bottomley <1acebbdca565c7b6b638bdc23b58b5610d1a56b8@Parallels.com>
C
mit
KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
e4c467b78d3f1de71a2b4a71fcf057880b2a22cf
tensorflow/core/config/flag_defs.h
tensorflow/core/config/flag_defs.h
/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_CONFIG_FLAG_DEFS_H_ #define TENSORFLOW_CORE_CONFIG_FLAG_DEFS_H_ #include "tensorflow/core/config/flags.h" namespace tensorflow { namespace flags { class Flags { public: // Test only flags. See flags_test.cc for example usage. TF_DECLARE_FLAG(test_only_experiment_1, true, "Test only experiment 1."); TF_DECLARE_FLAG(test_only_experiment_2, false, "Test only experiment 2."); // Declare flags below here. // LINT.IfChange TF_DECLARE_FLAG(graph_building_optimization, false, "Optimize graph building for faster tf.function tracing."); // LINT.ThenChange(//tensorflow/core/config/flag_defs.h) }; Flags& Global(); } // namespace flags } // namespace tensorflow #endif // TENSORFLOW_CORE_CONFIG_FLAG_DEFS_H_
/* Copyright 2022 The TensorFlow Authors. All Rights Reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ==============================================================================*/ #ifndef TENSORFLOW_CORE_CONFIG_FLAG_DEFS_H_ #define TENSORFLOW_CORE_CONFIG_FLAG_DEFS_H_ #include "tensorflow/core/config/flags.h" namespace tensorflow { namespace flags { class Flags { public: // Test only flags. See flags_test.cc for example usage. TF_DECLARE_FLAG(test_only_experiment_1, true, "Test only experiment 1."); TF_DECLARE_FLAG(test_only_experiment_2, false, "Test only experiment 2."); // Declare flags below here. // LINT.IfChange TF_DECLARE_FLAG(graph_building_optimization, false, "Optimize graph building for faster tf.function tracing."); // LINT.ThenChange(//tensorflow/core/config/flags_api_wrapper.cc) }; Flags& Global(); } // namespace flags } // namespace tensorflow #endif // TENSORFLOW_CORE_CONFIG_FLAG_DEFS_H_
Update the files referred to by the linter.
Update the files referred to by the linter. PiperOrigin-RevId: 438129536
C
apache-2.0
gautam1858/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,gautam1858/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,paolodedios/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,gautam1858/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,gautam1858/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,paolodedios/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_saved_model,paolodedios/tensorflow,tensorflow/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,karllessard/tensorflow,yongtang/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,gautam1858/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,karllessard/tensorflow,paolodedios/tensorflow,gautam1858/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-experimental_link_static_libraries_once
792400bec383ab615bcf24d5bee3c1a4294f9e1f
include/core/SkMilestone.h
include/core/SkMilestone.h
/* * 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 81 #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 82 #endif
Update Skia milestone to 82
Update Skia milestone to 82 Change-Id: Ifeaa877da83a42cceb04fe286bb2462190b249f9 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/267762 Reviewed-by: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com> Commit-Queue: Heather Miller <2e22000c5d22374561fe5fba576a31095b72dc2e@google.com>
C
bsd-3-clause
aosp-mirror/platform_external_skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia
28e721fd5907dd7807f35bccc48b177afdc2b2f9
main.c
main.c
#include <stdio.h> #include <stdlib.h> #include "turing.h" #define MAX_PROGRAM_LENGTH 32 int main() { int status; Turing *turing; status = 0; turing = init_turing(); status = execute_instruction(turing, "0 110\n1 110"); if (TURING_ERROR == status) { fprintf(stderr, "Exiting\n"); return 1; } else if (TURING_HALT) { printf("Program reached halt state!\n"); } free_turing(turing); return 0; }
#include <stdio.h> #include <stdlib.h> #include "turing.h" #define MAX_PROGRAM_LENGTH 32 #define turing_try(statement) status = statement;\ if (TURING_ERROR == status) {\ return 1;\ } int main() { int status; Turing *turing; status = 0; turing = init_turing(); status = execute_instruction(turing, "0 110\n1 110"); if (TURING_ERROR == status) { fprintf(stderr, "Exiting\n"); return 1; } else if (TURING_HALT) { printf("Program reached halt state!\n"); } free_turing(turing); return 0; }
Add turing_try function for handling errors
Add turing_try function for handling errors
C
mit
mindriot101/turing-machine
1f1004a05c6c8a933a4c59c9d35c6cdf6d67a28b
the-blue-alliance-ios/TBAViewController.h
the-blue-alliance-ios/TBAViewController.h
// // TBAViewController.h // the-blue-alliance // // Created by Zach Orr on 4/28/16. // Copyright © 2016 The Blue Alliance. All rights reserved. // #import <UIKit/UIKit.h> @class TBAPersistenceController, TBARefreshViewController; @interface TBAViewController : UIViewController @property (nonnull, readonly) TBAPersistenceController *persistenceController; @property (nullable, nonatomic, strong) NSArray<TBARefreshViewController *> *refreshViewControllers; @property (nullable, nonatomic, strong) NSArray<UIView *> *containerViews; @property (nullable, nonatomic, strong) IBOutlet UISegmentedControl *segmentedControl; @property (nullable, nonatomic, strong) IBOutlet UIView *segmentedControlView; @property (nullable, nonatomic, strong) IBOutlet UILabel *navigationTitleLabel; @property (nullable, nonatomic, strong) IBOutlet UILabel *navigationSubtitleLabel; - (void)showView:(nonnull UIView *)showView; - (void)updateInterface; - (void)cancelRefreshes; @end
// // TBAViewController.h // the-blue-alliance // // Created by Zach Orr on 4/28/16. // Copyright © 2016 The Blue Alliance. All rights reserved. // #import <UIKit/UIKit.h> @class TBAPersistenceController, TBARefreshViewController; @interface TBAViewController : UIViewController @property (nonnull, readonly) TBAPersistenceController *persistenceController; @property (nullable, nonatomic, strong) NSArray<TBARefreshViewController *> *refreshViewControllers; @property (nullable, nonatomic, strong) NSArray<UIView *> *containerViews; @property (nullable, nonatomic, strong) IBOutlet UISegmentedControl *segmentedControl; @property (nullable, nonatomic, strong) IBOutlet UIView *segmentedControlView; @property (nullable, nonatomic, strong) IBOutlet UILabel *navigationTitleLabel; @property (nullable, nonatomic, strong) IBOutlet UILabel *navigationSubtitleLabel; - (void)cancelRefreshes; @end
Remove methods from TBAVC that we no longer want to expose publically
Remove methods from TBAVC that we no longer want to expose publically
C
mit
the-blue-alliance/the-blue-alliance-ios,the-blue-alliance/the-blue-alliance-ios
0b32bf8a2fb7ace1d48681a00445aaf446b3bc0b
support/c/idris_directory.h
support/c/idris_directory.h
#ifndef __IDRIS_DIRECTORY_H #define __IDRIS_DIRECTORY_H char* idris2_currentDirectory(); int idris2_changeDir(char* dir); int idris2_createDir(char* dir); void* idris2_openDir(char* dir); void idris2_closeDIr(void* d); int idris2_removeDir(char* path); char* idris2_nextDirEntry(void* d); #endif
#ifndef __IDRIS_DIRECTORY_H #define __IDRIS_DIRECTORY_H char* idris2_currentDirectory(); int idris2_changeDir(char* dir); int idris2_createDir(char* dir); void* idris2_openDir(char* dir); void idris2_closeDir(void* d); int idris2_removeDir(char* path); char* idris2_nextDirEntry(void* d); #endif
Fix forward declaration of idris_closeDir
Fix forward declaration of idris_closeDir
C
bsd-3-clause
mmhelloworld/idris-jvm,mmhelloworld/idris-jvm,mmhelloworld/idris-jvm,mmhelloworld/idris-jvm,mmhelloworld/idris-jvm,mmhelloworld/idris-jvm
b701d2ce0e96280713b84192aed48fb87d609d94
mud/home/Http/lib/form/thing.c
mud/home/Http/lib/form/thing.c
inherit "/lib/string/sprint"; inherit "../support"; static string thing_form(object obj) { string buffer; buffer = "<p>Fun little boxes:</p>\n"; buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; buffer += "Mass: <input type=\"text\" name=\"mass\" value=\"" + mixed_sprint(obj->query_mass()) + "\"/>\n"; buffer += "<input type=\"submit\" value=\"change mass\" />\n"; buffer += "</form>\n"; buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; buffer += "Local mass: <input type=\"text\" name=\"localmass\" value=\"" + mixed_sprint(obj->query_local_mass()) + "\"/>\n"; buffer += "<input type=\"submit\" value=\"change local mass\" />\n"; buffer += "</form>\n"; return oinfobox("Configuration", 2, buffer); }
inherit "/lib/string/sprint"; inherit "../support"; static string thing_form(object obj) { string buffer; buffer = "<p>Fun little boxes:</p>\n"; buffer += "<form action=\"object.lpc?obj=" + object2string(obj) + "\" method=\"post\">\n"; buffer += "Local mass: <input type=\"text\" name=\"localmass\" value=\"" + mixed_sprint(obj->query_local_mass()) + "\"/>\n"; buffer += "<input type=\"submit\" value=\"change local mass\" />\n"; buffer += "</form>\n"; return oinfobox("Configuration", 2, buffer); }
Remove http form for mass, only manipulate local mass
Remove http form for mass, only manipulate local mass
C
agpl-3.0
shentino/kotaka,shentino/kotaka,shentino/kotaka
9c593e10c013d0000c3b61e6a0ee97a89418eff9
ObjectiveRocks/RocksDBCuckooTableOptions.h
ObjectiveRocks/RocksDBCuckooTableOptions.h
// // RocksDBCuckooTableOptions.h // ObjectiveRocks // // Created by Iska on 04/01/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> @interface RocksDBCuckooTableOptions : NSObject @property (nonatomic, assign) double hashTableRatio; @property (nonatomic, assign) uint32_t maxSearchDepth; @property (nonatomic, assign) uint32_t cuckooBlockSize; @property (nonatomic, assign) BOOL identityAsFirstHash; @property (nonatomic, assign) BOOL useModuleHash; @end
// // RocksDBCuckooTableOptions.h // ObjectiveRocks // // Created by Iska on 04/01/15. // Copyright (c) 2015 BrainCookie. All rights reserved. // #import <Foundation/Foundation.h> @interface RocksDBCuckooTableOptions : NSObject /** @brief Determines the utilization of hash tables. Smaller values result in larger hash tables with fewer collisions. */ @property (nonatomic, assign) double hashTableRatio; /** @brief A property used by builder to determine the depth to go to to search for a path to displace elements in case of collision. Higher values result in more efficient hash tables with fewer lookups but take more time to build. */ @property (nonatomic, assign) uint32_t maxSearchDepth; /** @brief In case of collision while inserting, the builder attempts to insert in the next `cuckooBlockSize` locations before skipping over to the next Cuckoo hash function. This makes lookups more cache friendly in case of collisions. */ @property (nonatomic, assign) uint32_t cuckooBlockSize; /** @brief If this option is enabled, user key is treated as uint64_t and its value is used as hash value directly. This option changes builder's behavior. Reader ignore this option and behave according to what specified in table property. */ @property (nonatomic, assign) BOOL identityAsFirstHash; /** @brief If this option is set to true, module is used during hash calculation. This often yields better space efficiency at the cost of performance. If this optino is set to false, # of entries in table is constrained to be power of two, and bit and is used to calculate hash, which is faster in general. */ @property (nonatomic, assign) BOOL useModuleHash; @end
Add source code documentation for the RocksDB Cuckoo Table Options class
Add source code documentation for the RocksDB Cuckoo Table Options class
C
mit
iabudiab/ObjectiveRocks,iabudiab/ObjectiveRocks,iabudiab/ObjectiveRocks,iabudiab/ObjectiveRocks
0e3e00a1838d8e0f94001f1e83dc477023c8ea8c
src/locking/lock_driver_lockd.h
src/locking/lock_driver_lockd.h
/* * lock_driver_lockd.h: Locking for domain lifecycle operations * * Copyright (C) 2010-2011 Red Hat, Inc. * * 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 version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see * <http://www.gnu.org/licenses/>. * */ #ifndef __VIR_LOCK_DRIVER_LOCKD_H__ # define __VIR_LOCK_DRIVER_LOCKD_H__ enum virLockSpaceProtocolAcquireResourceFlags { VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_SHARED = 1, VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_AUTOCREATE = 2, }; #endif /* __VIR_LOCK_DRIVER_LOCKD_H__ */
/* * lock_driver_lockd.h: Locking for domain lifecycle operations * * Copyright (C) 2010-2011 Red Hat, Inc. * * 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 version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see * <http://www.gnu.org/licenses/>. * */ #ifndef __VIR_LOCK_DRIVER_LOCKD_H__ # define __VIR_LOCK_DRIVER_LOCKD_H__ enum virLockSpaceProtocolAcquireResourceFlags { VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_SHARED = (1 << 0), VIR_LOCK_SPACE_PROTOCOL_ACQUIRE_RESOURCE_AUTOCREATE = (1 << 1), }; #endif /* __VIR_LOCK_DRIVER_LOCKD_H__ */
Use bit shift for flag values not constant values.
locking: Use bit shift for flag values not constant values. So far it hasn't bitten us, but if the next value wasn't 4, then the logic used to check flag bits would have issues.
C
lgpl-2.1
datto/libvirt,eskultety/libvirt,andreabolognani/libvirt,libvirt/libvirt,jardasgit/libvirt,andreabolognani/libvirt,VenkatDatta/libvirt,libvirt/libvirt,nertpinx/libvirt,zippy2/libvirt,taget/libvirt,andreabolognani/libvirt,andreabolognani/libvirt,olafhering/libvirt,eskultety/libvirt,datto/libvirt,zippy2/libvirt,zippy2/libvirt,datto/libvirt,taget/libvirt,olafhering/libvirt,nertpinx/libvirt,olafhering/libvirt,crobinso/libvirt,jardasgit/libvirt,zippy2/libvirt,crobinso/libvirt,jfehlig/libvirt,andreabolognani/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,taget/libvirt,fabianfreyer/libvirt,eskultety/libvirt,jardasgit/libvirt,VenkatDatta/libvirt,fabianfreyer/libvirt,eskultety/libvirt,nertpinx/libvirt,nertpinx/libvirt,eskultety/libvirt,libvirt/libvirt,VenkatDatta/libvirt,crobinso/libvirt,taget/libvirt,jardasgit/libvirt,libvirt/libvirt,VenkatDatta/libvirt,crobinso/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt,olafhering/libvirt,datto/libvirt,jardasgit/libvirt,taget/libvirt,VenkatDatta/libvirt,datto/libvirt,jfehlig/libvirt,jfehlig/libvirt
526f01761e0c9334853aeaffb8d6c5b5984c96da
src/plugins/mini/testmod_mini.c
src/plugins/mini/testmod_mini.c
/** * @file * * @brief Tests for mini plugin * * @copyright BSD License (see doc/LICENSE.md or http://www.libelektra.org) * */ #include "values.h" #include <stdlib.h> #include <string.h> #include <kdbconfig.h> #include <tests_plugin.h> static void test_basics () { printf ("• Test basic functionality of plugin\n"); Key * parentKey = keyNew ("system/elektra/modules/mini", KEY_END); KeySet * conf = ksNew (0, KS_END); PLUGIN_OPEN ("mini"); KeySet * ks = ksNew (0, KS_END); succeed_if (plugin->kdbGet (plugin, ks, parentKey) == KEYSET_MODIFIED, "Could not retrieve plugin contract"); keyDel (parentKey); ksDel (ks); PLUGIN_CLOSE (); } int main (int argc, char ** argv) { printf ("mINI Tests 🚙\n"); printf ("==============\n\n"); init (argc, argv); test_basics (); printf ("\nResults: %d Test%s done — %d error%s.\n", nbTest, nbTest != 1 ? "s" : "", nbError, nbError != 1 ? "s" : ""); return nbError; }
/** * @file * * @brief Tests for mini plugin * * @copyright BSD License (see doc/LICENSE.md or http://www.libelektra.org) * */ /* -- Imports --------------------------------------------------------------------------------------------------------------------------- */ #include "values.h" #include <stdlib.h> #include <string.h> #include <kdbconfig.h> #include <tests_plugin.h> /* -- Functions ------------------------------------------------------------------------------------------------------------------------- */ static void test_basics () { printf ("• Test basic functionality of plugin\n"); Key * parentKey = keyNew ("system/elektra/modules/mini", KEY_END); KeySet * conf = ksNew (0, KS_END); PLUGIN_OPEN ("mini"); KeySet * ks = ksNew (0, KS_END); succeed_if (plugin->kdbGet (plugin, ks, parentKey) == KEYSET_MODIFIED, "Could not retrieve plugin contract"); keyDel (parentKey); ksDel (ks); PLUGIN_CLOSE (); } /* -- Main ------------------------------------------------------------------------------------------------------------------------------ */ int main (int argc, char ** argv) { printf ("mINI Tests 🚙\n"); printf ("==============\n\n"); init (argc, argv); test_basics (); printf ("\nResults: %d Test%s done — %d error%s.\n", nbTest, nbTest != 1 ? "s" : "", nbError, nbError != 1 ? "s" : ""); return nbError; }
Use comments to structure file
mINI: Use comments to structure file
C
bsd-3-clause
e1528532/libelektra,e1528532/libelektra,e1528532/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,mpranj/libelektra,mpranj/libelektra,mpranj/libelektra,e1528532/libelektra,mpranj/libelektra,mpranj/libelektra,petermax2/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,ElektraInitiative/libelektra,e1528532/libelektra,petermax2/libelektra,petermax2/libelektra,BernhardDenner/libelektra,petermax2/libelektra,e1528532/libelektra,petermax2/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,ElektraInitiative/libelektra,petermax2/libelektra,ElektraInitiative/libelektra,mpranj/libelektra,e1528532/libelektra,BernhardDenner/libelektra,petermax2/libelektra,e1528532/libelektra,petermax2/libelektra,petermax2/libelektra,mpranj/libelektra,ElektraInitiative/libelektra,BernhardDenner/libelektra,BernhardDenner/libelektra
5d6bcc40ec64c8780b6c87a740bae34381844f5d
src/qtpromise/qpromisehelpers.h
src/qtpromise/qpromisehelpers.h
#ifndef QTPROMISE_QPROMISEHELPERS_H #define QTPROMISE_QPROMISEHELPERS_H // QtPromise #include "qpromise_p.h" namespace QtPromise { template <typename T> typename QtPromisePrivate::PromiseDeduce<T>::Type qPromise(T&& value) { using namespace QtPromisePrivate; using Promise = typename PromiseDeduce<T>::Type; return Promise([&]( const QPromiseResolve<typename Promise::Type>& resolve, const QPromiseReject<typename Promise::Type>& reject) { PromiseFulfill<T>::call(std::forward<T>(value), resolve, reject); }); } QPromise<void> qPromise() { return QPromise<void>([]( const QPromiseResolve<void>& resolve) { resolve(); }); } template <typename T> QPromise<QVector<T> > qPromiseAll(const QVector<QPromise<T> >& promises) { return QPromise<T>::all(promises); } QPromise<void> qPromiseAll(const QVector<QPromise<void> >& promises) { return QPromise<void>::all(promises); } } // namespace QtPromise #endif // QTPROMISE_QPROMISEHELPERS_H
#ifndef QTPROMISE_QPROMISEHELPERS_H #define QTPROMISE_QPROMISEHELPERS_H // QtPromise #include "qpromise_p.h" namespace QtPromise { template <typename T> static inline typename QtPromisePrivate::PromiseDeduce<T>::Type qPromise(T&& value) { using namespace QtPromisePrivate; using Promise = typename PromiseDeduce<T>::Type; return Promise([&]( const QPromiseResolve<typename Promise::Type>& resolve, const QPromiseReject<typename Promise::Type>& reject) { PromiseFulfill<T>::call(std::forward<T>(value), resolve, reject); }); } static inline QPromise<void> qPromise() { return QPromise<void>([]( const QPromiseResolve<void>& resolve) { resolve(); }); } template <typename T> static inline QPromise<QVector<T> > qPromiseAll(const QVector<QPromise<T> >& promises) { return QPromise<T>::all(promises); } static inline QPromise<void> qPromiseAll(const QVector<QPromise<void> >& promises) { return QPromise<void>::all(promises); } } // namespace QtPromise #endif // QTPROMISE_QPROMISEHELPERS_H
Fix helpers multiple defined symbols
Fix helpers multiple defined symbols
C
mit
simonbrunel/qtpromise
342b576de5cc3fd0aad536171d68b414ffc0fc3d
libc/sys_io.c
libc/sys_io.c
#include <stdint.h> void outb(uint16_t port, uint8_t value) { asm volatile ("outb %1, %0" : : "dN" (port), "a" (value)); } unsigned char inb(uint16_t port) { unsigned char ret; asm volatile ("inb %1, %0" : "=a" (ret) : "dN" (port)); return ret; }
#include <stdint.h> void outb(uint16_t port, uint8_t value) { asm volatile ("outb %1, %0" : : "dN" (port), "a" (value)); } unsigned char inb(uint16_t port) { unsigned char ret; asm volatile ("inb %1, %0" : "=a" (ret) : "dN" (port)); return ret; } void outl(uint16_t port, uint32_t value) { asm volatile ("outl %1, %0" : : "dN" (port), "a" (value)); } uint32_t inl(uint16_t port) { uint32_t ret; asm volatile ("inl %1, %0" : "=a" (ret) : "dN" (port)); return ret; }
Add inl and outl functions
Add inl and outl functions
C
mit
simon-andrews/norby,simon-andrews/norby,simon-andrews/norby
2f36de17a4ea00909f84819882cd5f5237ddab59
src/writer/verilog/axi/master_controller.h
src/writer/verilog/axi/master_controller.h
// -*- C++ -*- #ifndef _writer_verilog_axi_master_controller_h_ #define _writer_verilog_axi_master_controller_h_ #include "writer/verilog/axi/axi_controller.h" namespace iroha { namespace writer { namespace verilog { namespace axi { class MasterController : public AxiController { public: MasterController(const IResource &res, bool reset_polarity); ~MasterController(); void Write(ostream &os); static void AddPorts(Module *mod, bool r, bool w, string *s); private: void OutputFsm(ostream &os); void ReaderFsm(ostream &os); void WriterFsm(ostream &os); unique_ptr<Ports> ports_; bool r_, w_; int burst_len_; }; } // namespace axi } // namespace verilog } // namespace writer } // namespace iroha #endif // _writer_verilog_axi_master_controller_h_
// -*- C++ -*- #ifndef _writer_verilog_axi_master_controller_h_ #define _writer_verilog_axi_master_controller_h_ #include "writer/verilog/axi/axi_controller.h" namespace iroha { namespace writer { namespace verilog { namespace axi { class MasterController : public AxiController { public: MasterController(const IResource &res, bool reset_polarity); ~MasterController(); void Write(ostream &os); static void AddPorts(Module *mod, bool r, bool w, string *s); private: void OutputFsm(ostream &os); void ReaderFsm(ostream &os); void WriterFsm(ostream &os); bool r_, w_; int burst_len_; }; } // namespace axi } // namespace verilog } // namespace writer } // namespace iroha #endif // _writer_verilog_axi_master_controller_h_
Fix wrong member declaration which shadows parent class.
Fix wrong member declaration which shadows parent class.
C
bsd-3-clause
nlsynth/iroha,nlsynth/iroha
0286596dd6eee2b3573722716af45395314e4246
lib/arch/x86_64/defs.h
lib/arch/x86_64/defs.h
#define JOIN_(a, b) a ## b #define JOIN(a, b) JOIN_(a, b) #define SYMBL(x) JOIN(__USER_LABEL_PREFIX__, x) #if defined(__linux__) # define SECTION_NAME_TEXT .text # define SECTION_NAME_BSS .bss #elif defined(__DARWIN__) # define SECTION_NAME_TEXT __TEXT,__text # define SECTION_NAME_BSS __BSS,__bss #else # error unknown target #endif
#define JOIN_(a, b) a ## b #define JOIN(a, b) JOIN_(a, b) #define SYMBL(x) JOIN(__USER_LABEL_PREFIX__, x) #if defined(__linux__) # define SECTION_NAME_TEXT .text # define SECTION_NAME_BSS .bss .section .note.GNU-stack,"",@progbits #elif defined(__DARWIN__) # define SECTION_NAME_TEXT __TEXT,__text # define SECTION_NAME_BSS __BSS,__bss #else # error unknown target #endif
Enable noexecstack for local-lib builds
Enable noexecstack for local-lib builds
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
3b09a6a7faae7363ffc90749e041788a17559f0f
src/test/tester.c
src/test/tester.c
#include <stdio.h> #include <string.h> #include <efivar.h> #define TEST_GUID EFI_GUID(0x84be9c3e,0x8a32,0x42c0,0x891c,0x4c,0xd3,0xb0,0x72,0xbe,0xcc) static void clean_test_environment(void) { efi_del_variable(TEST_GUID, "small"); efi_del_variable(TEST_GUID, "large"); } #define report_error(str) ({fprintf(stderr, str); goto fail;}) int main(void) { if (!efi_variables_supported()) { printf("UEFI variables not supported on this machine.\n"); return 0; } clean_test_environment(); int ret = 1; char smallvalue[] = "smallvalue"; int rc; rc = efi_set_variable(TEST_GUID, "small", smallvalue, strlen(smallvalue)+1, EFI_VARIABLE_RUNTIME_ACCESS); if (rc < 0) report_error("small value test failed: %m\n"); ret = 0; fail: return ret; }
#include <stdio.h> #include <string.h> #include <efivar.h> #define TEST_GUID EFI_GUID(0x84be9c3e,0x8a32,0x42c0,0x891c,0x4c,0xd3,0xb0,0x72,0xbe,0xcc) static void clean_test_environment(void) { efi_del_variable(TEST_GUID, "small"); efi_del_variable(TEST_GUID, "large"); } #define report_error(str) ({fprintf(stderr, str); goto fail;}) int main(void) { if (!efi_variables_supported()) { printf("UEFI variables not supported on this machine.\n"); return 0; } clean_test_environment(); int ret = 1; char smallvalue[] = "smallvalue"; int rc; rc = efi_set_variable(TEST_GUID, "small", smallvalue, strlen(smallvalue)+1, EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_NON_VOLATILE); if (rc < 0) report_error("small value test failed: %m\n"); ret = 0; fail: return ret; }
Use flags that will actually work when testing.
Use flags that will actually work when testing.
C
lgpl-2.1
rhboot/efivar,rhinstaller/efivar,android-ia/vendor_intel_external_efivar,rhinstaller/efivar,rhboot/efivar,CyanogenMod/android_vendor_intel_external_efivar,vathpela/efivar-devel
f15b376345a4480513880390a3e05ed77fd66ef8
test/tools/llvm-symbolizer/print_context.c
test/tools/llvm-symbolizer/print_context.c
// REQUIRES: x86_64-linux // RUN: %host_cc -O0 -g %s -o %t 2>&1 // RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s #include <stdio.h> int inc(int a) { return a + 1; } int main() { printf("%p\n", inc); return 0; } // CHECK: inc // CHECK: print_context.c:7 // CHECK: 5 : #include // CHECK: 6 : // CHECK: 7 >: int inc // CHECK: 8 : return // CHECK: 9 : }
// REQUIRES: x86_64-linux // RUN: %host_cc -O0 -g %s -o %t 2>&1 // RUN: %t 2>&1 | llvm-symbolizer -print-source-context-lines=5 -obj=%t | FileCheck %s // CHECK: inc // CHECK: print_context.c:[[@LINE+9]] // CHECK: [[@LINE+6]] : #include // CHECK: [[@LINE+6]] : // CHECK: [[@LINE+6]] >: int inc // CHECK: [[@LINE+6]] : return // CHECK: [[@LINE+6]] : } #include <stdio.h> int inc(int a) { return a + 1; } int main() { printf("%p\n", inc); return 0; }
Make test robust to changes in prefix/avoid hardcoded line numbers
Make test robust to changes in prefix/avoid hardcoded line numbers git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@309516 91177308-0d34-0410-b5e6-96231b3b80d8 (cherry picked from commit 429be9362d598d3b7b3ea6e19b1be2dca867aa0a)
C
apache-2.0
apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm
e4d4544dd5ebc59f9527f00cdd2494075b77b52e
include/graph.h
include/graph.h
#ifndef GRAPH_H #define GRAPH_H #include <unordered_map> #include <unordered_set> template<typename T> class Graph { public: void connect(const T &a, const T &b); const std::unordered_set<T>& get_vertex_ids() const; inline const std::unordered_set<T>& get_neighbors(const T &vertex_id) const { return vertices_.at(vertex_id)->adjacent_ids_; } ~Graph(); private: struct Vertex { T id_; std::unordered_set<Vertex*> adjacent_; std::unordered_set<T> adjacent_ids_; Vertex(T id) { id_ = id; } bool has_neighbor(Vertex *v) { return adjacent_.find(v) != adjacent_.end(); } void add_neighbor(Vertex* v) { adjacent_.insert(v); adjacent_ids_.insert(v->id_); } }; std::unordered_map<T, Vertex*> vertices_; std::unordered_set<T> vertex_ids; Vertex* get_vertex(const T &a) const; Vertex* get_or_insert(const T &a); }; template class Graph<int>; #endif
#ifndef GRAPH_H #define GRAPH_H #include <unordered_map> #include <unordered_set> template<typename T> class Graph { public: void connect(const T &a, const T &b); const std::unordered_set<T>& get_vertex_ids() const; inline const std::unordered_set<T>& get_neighbors(const T &vertex_id) const { return vertices_.at(vertex_id)->adjacent_ids_; } ~Graph(); private: struct Vertex { T id_; std::unordered_set<Vertex*> adjacent_; std::unordered_set<T> adjacent_ids_; Vertex(const T &id) : id_(id) {} bool has_neighbor(Vertex *v) { return adjacent_.find(v) != adjacent_.end(); } void add_neighbor(Vertex* v) { adjacent_.insert(v); adjacent_ids_.insert(v->id_); } }; std::unordered_map<T, Vertex*> vertices_; std::unordered_set<T> vertex_ids; Vertex* get_vertex(const T &a) const; Vertex* get_or_insert(const T &a); }; template class Graph<int>; #endif
Move id initialization to initialization list
Move id initialization to initialization list
C
mit
chivay/betweenness-centrality
4ccf7377fc44127b522b3b830b4ae371a35be2d4
test/Driver/diagnostics.c
test/Driver/diagnostics.c
// Parse diagnostic arguments in the driver // PR12181 // RUN: not %clang -target x86_64-apple-darwin10 \ // RUN: -fsyntax-only -fzyzzybalubah \ // RUN: -Werror=unused-command-line-argument %s // RUN: not %clang -target x86_64-apple-darwin10 \ // RUN: -fsyntax-only -fzyzzybalubah -Werror %s
// Parse diagnostic arguments in the driver // PR12181 // RUN: not %clang -target x86_64-apple-darwin10 \ // RUN: -fsyntax-only -fzyzzybalubah \ // RUN: -Werror=unused-command-line-argument %s // RUN: not %clang -target x86_64-apple-darwin10 \ // RUN: -fsyntax-only -fzyzzybalubah -Werror %s
Remove trailing whitespace (especially after a \ which should be trailing)
Remove trailing whitespace (especially after a \ which should be trailing) git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@152695 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
e1f21893cedcb02fc76415e2bb95b3d0c06d1abf
rbcoremidi.c
rbcoremidi.c
/* * Copyright 2008 Markus Prinz * Released unter an MIT licence * */ #include <ruby.h> #include <CoreMIDI/CoreMIDI.h> VALUE callback_proc = Qnil; MIDIPortRef inPort = NULL; MIDIClientRef client = NULL; static void RbMIDIReadProc(const MIDIPacketList* packetList, void* readProcRefCon, void* srcConnRefCon) { } void Init_rbcoremidi (void) { // Add the initialization code of your module here. }
/* * Copyright 2008 Markus Prinz * Released unter an MIT licence * */ #include <ruby.h> #include <CoreMIDI/CoreMIDI.h> VALUE callback_proc = Qnil; MIDIPortRef inPort = NULL; MIDIClientRef client = NULL; static void RbMIDIReadProc(const MIDIPacketList* packetList, void* readProcRefCon, void* srcConnRefCon) { } static VALUE t_sources(VALUE self) { int number_of_sources = MIDIGetNumberOfSources(); VALUE source_ary = rb_ary_new2(number_of_sources); for(int idx = 0; idx < number_of_sources; ++idx) { MIDIEndpointRef src = MIDIGetSource(idx); CFStringRef pname; char name[64]; MIDIObjectGetStringProperty(src, kMIDIPropertyName, pname); CFStringGetCString(pname, name, sizeof(name), 0); CFRelease(pname); rb_ary_push(source_ary, rb_str_new2(name)); } return source_ary; } void Init_rbcoremidi (void) { // Add the initialization code of your module here. }
Add best guess at a method that returns an array with the names of all sources
Add best guess at a method that returns an array with the names of all sources
C
mit
cypher/rbcoremidi,cypher/rbcoremidi
efbdf8c9d08d6c63fbd86487aef3c95052770090
src/modules/conf_randr/e_smart_randr.h
src/modules/conf_randr/e_smart_randr.h
#ifdef E_TYPEDEFS #else # ifndef E_SMART_RANDR_H # define E_SMART_RANDR_H Evas_Object *e_smart_randr_add(Evas *evas); void e_smart_randr_virtual_size_calc(Evas_Object *obj); void e_smart_randr_monitors_create(Evas_Object *obj); # endif #endif
#ifdef E_TYPEDEFS #else # ifndef E_SMART_RANDR_H # define E_SMART_RANDR_H Evas_Object *e_smart_randr_add(Evas *evas); void e_smart_randr_virtual_size_calc(Evas_Object *obj); void e_smart_randr_monitors_create(Evas_Object *obj); void e_smart_randr_min_size_get(Evas_Object *obj, Evas_Coord *mw, Evas_Coord *mh); # endif #endif
Add function prototype for min_size_get.
Add function prototype for min_size_get. Signed-off-by: Christopher Michael <cp.michael@samsung.com> SVN revision: 84149
C
bsd-2-clause
tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,tasn/enlightenment,rvandegrift/e,FlorentRevest/Enlightenment,tizenorg/platform.upstream.enlightenment,FlorentRevest/Enlightenment,tasn/enlightenment,tizenorg/platform.upstream.enlightenment,rvandegrift/e,tasn/enlightenment,rvandegrift/e
84e985bb87454fa85b0adb224f5d94905356a5a1
BRStyle/Code/Core.h
BRStyle/Code/Core.h
// // Core.h // BRStyle // // Created by Matt on 24/07/15. // Copyright (c) 2015 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0. // #import <BRStyle/BRUIStyle.h> #import <BRStyle/BRUIStyleObserver.h> #import <BRStyle/BRUIStyleSettings.h> #import <BRStyle/BRUIStylishHost.h> #import <BRStyle/NSObject+BRUIStyle.h> #import <BRStyle/UIBarButtonItem+BRUIStyle.h> #import <BRStyle/UIFont+BRUIStyle.h> #import <BRStyle/UIView+BRUIStyle.h> #import <BRStyle/UIViewController+BRUIStyle.h>
// // Core.h // BRStyle // // Created by Matt on 24/07/15. // Copyright (c) 2015 Blue Rocket. Distributable under the terms of the Apache License, Version 2.0. // #import <BRStyle/BRUIStyle.h> #import <BRStyle/BRUIStyleObserver.h> #import <BRStyle/BRUIStyleSettings.h> #import <BRStyle/BRUIStylishHost.h> #import <BRStyle/NSObject+BRUIStyle.h> #import <BRStyle/UIBarButtonItem+BRUIStyle.h> #import <BRStyle/UIView+BRUIStyle.h> #import <BRStyle/UIViewController+BRUIStyle.h>
Remove import that no longer exists.
Remove import that no longer exists.
C
apache-2.0
Blue-Rocket/BRStyle,Blue-Rocket/BRStyle,Blue-Rocket/BRStyle,Blue-Rocket/BRStyle
0241963d4360407d1ab954f8a05e4d3bdf6a9799
io/block_channel.h
io/block_channel.h
#ifndef BLOCK_CHANNEL_H #define BLOCK_CHANNEL_H class Action; class Buffer; class BlockChannel { protected: BlockChannel(void) { } public: virtual ~BlockChannel() { } virtual Action *close(EventCallback *) = 0; virtual Action *read(off_t, EventCallback *) = 0; virtual Action *write(off_t, Buffer *, EventCallback *) = 0; }; #endif /* !BLOCK_CHANNEL_H */
#ifndef BLOCK_CHANNEL_H #define BLOCK_CHANNEL_H class Action; class Buffer; class BlockChannel { protected: size_t bsize_; BlockChannel(size_t bsize) : bsize_(bsize) { } public: virtual ~BlockChannel() { } virtual Action *close(EventCallback *) = 0; virtual Action *read(off_t, EventCallback *) = 0; virtual Action *write(off_t, Buffer *, EventCallback *) = 0; }; #endif /* !BLOCK_CHANNEL_H */
Make block size a protected member of a block channel.
Make block size a protected member of a block channel. git-svn-id: 9e2532540f1574e817ce42f20b9d0fb64899e451@443 4068ffdb-0463-0410-8185-8cc71e3bd399
C
bsd-2-clause
splbio/wanproxy,diegows/wanproxy,diegows/wanproxy,splbio/wanproxy,splbio/wanproxy,diegows/wanproxy
c8fb57c122aadfb83c8e9efa9904cc664aa4b786
Include/structseq.h
Include/structseq.h
/* Tuple object interface */ #ifndef Py_STRUCTSEQ_H #define Py_STRUCTSEQ_H #ifdef __cplusplus extern "C" { #endif typedef struct PyStructSequence_Field { char *name; char *doc; } PyStructSequence_Field; typedef struct PyStructSequence_Desc { char *name; char *doc; struct PyStructSequence_Field *fields; int n_in_sequence; } PyStructSequence_Desc; extern char* PyStructSequence_UnnamedField; PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc); PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type); typedef struct { PyObject_VAR_HEAD PyObject *ob_item[1]; } PyStructSequence; /* Macro, *only* to be used to fill in brand new objects */ #define PyStructSequence_SET_ITEM(op, i, v) \ (((PyStructSequence *)(op))->ob_item[i] = v) #ifdef __cplusplus } #endif #endif /* !Py_STRUCTSEQ_H */
/* Tuple object interface */ #ifndef Py_STRUCTSEQ_H #define Py_STRUCTSEQ_H #ifdef __cplusplus extern "C" { #endif typedef struct PyStructSequence_Field { char *name; char *doc; } PyStructSequence_Field; typedef struct PyStructSequence_Desc { char *name; char *doc; struct PyStructSequence_Field *fields; int n_in_sequence; } PyStructSequence_Desc; extern char* PyStructSequence_UnnamedField; PyAPI_FUNC(void) PyStructSequence_InitType(PyTypeObject *type, PyStructSequence_Desc *desc); PyAPI_FUNC(PyObject *) PyStructSequence_New(PyTypeObject* type); typedef struct { PyObject_VAR_HEAD PyObject *ob_item[1]; } PyStructSequence; /* Macro, *only* to be used to fill in brand new objects */ #define PyStructSequence_SET_ITEM(op, i, v) \ (((PyStructSequence *)(op))->ob_item[i] = v) #ifdef __cplusplus } #endif #endif /* !Py_STRUCTSEQ_H */
Clean up some whitespace to be consistent with Python's C style.
Clean up some whitespace to be consistent with Python's C style.
C
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
ef17abb61bd0234c452f140815465e6e9d438def
c/base/stream_of_byte.h
c/base/stream_of_byte.h
#ifndef INCLUDE_STREAM_OF_BYTE_H #define INCLUDE_STREAM_OF_BYTE_H #include "varray.h" #include "utils.h" typedef unsigned char byte; struct byte_stream { void(*next)(struct byte_stream *self, byte v); void(*error)(struct byte_stream *self, byte e); void(*complete)(struct byte_stream *self); varray *listeners; }; typedef struct byte_stream stream_of_byte; stream_of_byte* stream_of_byte_create(); stream_of_byte* stream_of_byte_init(); stream_of_byte* stream_add_listener(stream_of_byte *stream, stream_of_byte *listener); #endif
#ifndef INCLUDE_STREAM_OF_BYTE_H #define INCLUDE_STREAM_OF_BYTE_H #include "varray.h" #include "utils.h" typedef uint8_t byte; struct byte_stream { void(*next)(struct byte_stream *self, byte v); void(*error)(struct byte_stream *self, byte e); void(*complete)(struct byte_stream *self); varray *listeners; }; typedef struct byte_stream stream_of_byte; stream_of_byte* stream_of_byte_create(); stream_of_byte* stream_of_byte_init(); stream_of_byte* stream_add_listener(stream_of_byte *stream, stream_of_byte *listener); #endif
Update typedef of byte to standard type
Update typedef of byte to standard type
C
mit
artfuldev/RIoT
8b1e63d9eb92c7d8c4de601a7e12cb44f434ec74
tests/regression/37-congruence/07-refinements-o.c
tests/regression/37-congruence/07-refinements-o.c
// PARAM: --enable ana.int.congruence int main() { int top; int i = 0; if(top % 17 == 3) { assert(top%17 ==3); if(top %17 != 3) { i = 12; } else { } } assert(i ==0); if(top % 17 == 0) { assert(top%17 == 0); if(top %17 != 0) { i = 12; } } assert(i == 0); if(top % 3 == 17) { assert(top%17 == 3); //UNKNOWN! } }
// PARAM: --enable ana.int.congruence void unsignedCase() { unsigned int top; unsigned int i = 0; if(top % 17 == 3) { assert(top%17 ==3); if(top %17 != 3) { i = 12; } else { } } assert(i ==0); if(top % 17 == 0) { assert(top%17 == 0); if(top %17 != 0) { i = 12; } } assert(i == 0); if(top % 3 == 17) { assert(top%17 == 3); //UNKNOWN! } } int main() { int top; int i = 0; if(top % 17 == 3) { assert(top%17 ==3); if(top %17 != 3) { i = 12; } else { } } assert(i ==0); if(top % 17 == 0) { assert(top%17 == 0); if(top %17 != 0) { i = 12; } } assert(i == 0); if(top % 3 == 17) { assert(top%17 == 3); //UNKNOWN! } unsignedCase(); }
Add test cases for unsigned
Add test cases for unsigned
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
fb6f565657a21244a0d89aa1594e268b2e344c58
list.h
list.h
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; #endif
#include <stdlib.h> #ifndef __LIST_H__ #define __LIST_H__ struct ListNode; struct List; typedef struct ListNode ListNode; typedef struct List List; List* List_Create(void); #endif
Add List creation function declaration
Add List creation function declaration
C
mit
MaxLikelihood/CADT
2055caf822c9a52c01501585f58efd32b8ed2d1c
main.c
main.c
/* shuffle files in a directory by giving them random names, optionally tacking a global file extension to the end */ #include <stdio.h> #include <stdlib.h> #include <dirent.h> #include <string.h> char *extension = '\0'; DIR *dir; struct dirent *fileInDir; int fileCount = 0; int main(int argc, char **argv){ int exponentialchars = 1; if (argc < 2){ fprintf(stderr, "usage: %s <directory> <optional extension>\n", argv[0]); exit(1); } if (argv[2] != NULL){ extension = argv[2]; } dir = opendir(argv[1]); if (dir != NULL){ while ((fileInDir = readdir(dir)) != NULL){ fileCount++; } } else { perror(argv[1]); exit(2); } while (26**exponentialchars < fileCount){ exponentialchars++; } rewinddir(dir); while ((fileInDir = readdir(dir)) != NULL){ } }
/* shuffle files in a directory by giving them random names, optionally tacking a global file extension to the end */ #include <stdio.h> #include <stdlib.h> #include <dirent.h> #include <string.h> int main(int argc, char **argv){ char *extension = '\0'; DIR *dir = opendir(argv[1]); DIR *dir_nameclobber = opendir(argv[1]); struct dirent *fileInDir; struct dirent *fileInDir_nameclobber; int fileCount = 0; char *newName; if (argc < 2){ fprintf(stderr, "usage: %s <directory> <optional extension>\n", argv[0]); exit(1); } if (argv[2] != NULL){ extension = argv[2]; } if (dir != NULL){ while ((fileInDir = readdir(dir)) != NULL){ newName = tempnam(argv[1], NULL); while ((fileInDir_nameclobber = readdir(dir_nameclobber)) != NULL){ } } } else { perror(argv[1]) exit(2) } }
Remove a bunch of the randomization stuff; the program now uses tempnam(3).
Remove a bunch of the randomization stuff; the program now uses tempnam(3).
C
mit
LordCreepity/dirshuf
24e609bda53ee838eb1f2f6eef82fc04deb7db13
lib/profile/InstrProfilingNameVar.c
lib/profile/InstrProfilingNameVar.c
//===- InstrProfilingNameVar.c - profile name variable setup --------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #include "InstrProfiling.h" /* char __llvm_profile_filename[1] * * The runtime should only provide its own definition of this symbol when the * user has not specified one. Set this up by moving the runtime's copy of this * symbol to an object file within the archive. */ COMPILER_RT_WEAK char INSTR_PROF_PROFILE_NAME_VAR[1] = {0};
/*===- InstrProfilingNameVar.c - profile name variable setup -------------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file is distributed under the University of Illinois Open Source |* License. See LICENSE.TXT for details. |* \*===----------------------------------------------------------------------===*/ #include "InstrProfiling.h" /* char __llvm_profile_filename[1] * * The runtime should only provide its own definition of this symbol when the * user has not specified one. Set this up by moving the runtime's copy of this * symbol to an object file within the archive. */ COMPILER_RT_WEAK char INSTR_PROF_PROFILE_NAME_VAR[1] = {0};
Fix warning about C++ style comment in C file
[profile] Fix warning about C++ style comment in C file git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@311496 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt,llvm-mirror/compiler-rt
f8abb3519c9849ee37d4141869a8b38b2a54e295
searchlib/src/vespa/searchlib/tensor/tensor_buffer_type_mapper.h
searchlib/src/vespa/searchlib/tensor/tensor_buffer_type_mapper.h
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <cstdint> #include <vector> namespace search::tensor { class LargeSubspacesBufferType; class SmallSubspacesBufferType; class TensorBufferOperations; /* * This class provides mapping between type ids and array sizes needed for * storing a tensor. */ class TensorBufferTypeMapper { std::vector<size_t> _array_sizes; TensorBufferOperations* _ops; public: using SmallBufferType = SmallSubspacesBufferType; using LargeBufferType = LargeSubspacesBufferType; TensorBufferTypeMapper(); TensorBufferTypeMapper(uint32_t max_small_subspaces_type_id, TensorBufferOperations* ops); ~TensorBufferTypeMapper(); uint32_t get_type_id(size_t array_size) const; size_t get_array_size(uint32_t type_id) const; TensorBufferOperations& get_tensor_buffer_operations() const noexcept { return *_ops; } }; }
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <cstddef> #include <cstdint> #include <vector> namespace search::tensor { class LargeSubspacesBufferType; class SmallSubspacesBufferType; class TensorBufferOperations; /* * This class provides mapping between type ids and array sizes needed for * storing a tensor. */ class TensorBufferTypeMapper { std::vector<size_t> _array_sizes; TensorBufferOperations* _ops; public: using SmallBufferType = SmallSubspacesBufferType; using LargeBufferType = LargeSubspacesBufferType; TensorBufferTypeMapper(); TensorBufferTypeMapper(uint32_t max_small_subspaces_type_id, TensorBufferOperations* ops); ~TensorBufferTypeMapper(); uint32_t get_type_id(size_t array_size) const; size_t get_array_size(uint32_t type_id) const; TensorBufferOperations& get_tensor_buffer_operations() const noexcept { return *_ops; } }; }
Include cstddef to define size_t
Include cstddef to define size_t
C
apache-2.0
vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa,vespa-engine/vespa
e4e20dbf28845318e294c100269f27b7d6d49500
cpp/defines.h
cpp/defines.h
/* Copyright (c) 2014 Stefan.Eilemann@epfl.ch */ #ifndef @UPPER_PROJECT_NAME@_DEFINES_H #define @UPPER_PROJECT_NAME@_DEFINES_H #ifdef __APPLE__ # include <@PROJECT_INCLUDE_NAME@/definesDarwin.h> #endif #ifdef __linux # include <@PROJECT_INCLUDE_NAME@/definesLinux.h> #endif #ifdef _WIN32 //_MSC_VER # include <@PROJECT_INCLUDE_NAME@/definesWin32.h> #endif #endif
/* Copyright (c) 2014 Stefan.Eilemann@epfl.ch */ #ifndef @UPPER_PROJECT_NAME@_DEFINES_H #define @UPPER_PROJECT_NAME@_DEFINES_H #ifdef __APPLE__ # include <@PROJECT_INCLUDE_NAME@/definesDarwin.h> #endif #ifdef __linux__ # include <@PROJECT_INCLUDE_NAME@/definesLinux.h> #endif #ifdef _WIN32 //_MSC_VER # include <@PROJECT_INCLUDE_NAME@/definesWin32.h> #endif #endif
Use posix-compliant __linux__ (__linux not defined on BG/Q)
Use posix-compliant __linux__ (__linux not defined on BG/Q)
C
bsd-3-clause
shuaibarshad/KAUST-CMake,jafyvilla/CMake,shurikasa/CMake,jafyvilla/CMake,ptoharia/CMake,shuaibarshad/KAUST-CMake,jafyvilla/CMake,ptoharia/CMake,biddisco/CMake,shurikasa/CMake,shuaibarshad/KAUST-CMake,ptoharia/CMake,biddisco/CMake,shurikasa/CMake,ptoharia/CMake,biddisco/CMake,shurikasa/CMake,shuaibarshad/KAUST-CMake,jafyvilla/CMake,biddisco/CMake
575a6f6f8a203679da39a60b428cd20b1166c109
ldso/include/unsecvars.h
ldso/include/unsecvars.h
/* * Environment variable to be removed for SUID programs. The names are all * stuffed in a single string which means they have to be terminated with a * '\0' explicitly. */ #define UNSECURE_ENVVARS \ "LD_PRELOAD\0" \ "LD_LIBRARY_PATH\0" \ "LD_DEBUG\0" \ "LD_DEBUG_OUTPUT\0" \ "LD_TRACE_LOADED_OBJECTS\0" \ "TMPDIR\0" /* * LD_TRACE_LOADED_OBJECTS is not in glibc-2.3.5's unsecvars.h * though used by ldd * * These environment variables are defined by glibc but ignored in * uClibc, but may very well have an equivalent in uClibc. * * LD_ORIGIN_PATH, LD_PROFILE, LD_USE_LOAD_BIAS, LD_DYNAMIC_WEAK, LD_SHOW_AUXV, * GCONV_PATH, GETCONF_DIR, HOSTALIASES, LOCALDOMAIN, LOCPATH, MALLOC_TRACE, * NLSPATH, RESOLV_HOST_CONF, RES_OPTIONS, TMPDIR, TZDIR */
/* * Environment variable to be removed for SUID programs. The names are all * stuffed in a single string which means they have to be terminated with a * '\0' explicitly. */ #define UNSECURE_ENVVARS \ "LD_PRELOAD\0" \ "LD_LIBRARY_PATH\0" \ "LD_DEBUG\0" \ "LD_DEBUG_OUTPUT\0" \ "LD_TRACE_LOADED_OBJECTS\0" \ "TMPDIR\0" /* * LD_TRACE_LOADED_OBJECTS is not in glibc-2.3.5's unsecvars.h * though used by ldd * * These environment variables are defined by glibc but ignored in * uClibc, but may very well have an equivalent in uClibc. * * LD_ORIGIN_PATH, LD_PROFILE, LD_USE_LOAD_BIAS, LD_DYNAMIC_WEAK, LD_SHOW_AUXV, * GCONV_PATH, GETCONF_DIR, HOSTALIASES, LOCALDOMAIN, LOCPATH, MALLOC_TRACE, * NLSPATH, RESOLV_HOST_CONF, RES_OPTIONS, TZDIR */
Remove TMPDIR from glibc's commented list
Remove TMPDIR from glibc's commented list
C
lgpl-2.1
joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc,joel-porquet/tsar-uclibc
9e4acaef861510974200e2744263409dcecda4b4
lens/lens.h
lens/lens.h
#pragma once #include <string> #include "random.h" #include "ray.h" #include "vector.h" namespace amber { namespace lens { template <typename RealType> struct Lens { using real_type = RealType; using ray_type = Ray<real_type>; using vector3_type = Vector3<real_type>; static constexpr real_type kFocalLength = 0.050; virtual ~Lens() {} virtual std::string to_string() const; virtual ray_type sample_ray(const vector3_type&, Random&) const; }; } }
#pragma once #include <string> #include "random.h" #include "ray.h" #include "vector.h" namespace amber { namespace lens { template <typename RealType> struct Lens { using real_type = RealType; using ray_type = Ray<real_type>; using vector3_type = Vector3<real_type>; static constexpr real_type kFocalLength = 0.050; virtual ~Lens() {} virtual std::string to_string() const = 0; virtual ray_type sample_ray(const vector3_type&, Random&) const = 0; }; } }
Fix a trivial bug that causes a compilation error with clang++ -O0
Fix a trivial bug that causes a compilation error with clang++ -O0
C
mit
etheriqa/amber
42c77b7277930825192f0aea837ff1cdc12e2822
shaderDefines.h
shaderDefines.h
#define ATTR_POS 0 #define ATTR_UV 1 #define ATTR_COLOR 2 #ifdef __cplusplus struct Globals #else // __cplusplus layout(binding = 0, std140) uniform Globals #endif // __cplusplus { vec4 screenSize; mat4 viewProj; mat4 guiOrtho; }; struct Cube { vec4 rotation; vec3 position; uint color; };
#define ATTR_POS 0 #define ATTR_UV 1 #define ATTR_COLOR 2 #ifdef __cplusplus struct Globals #else // __cplusplus layout(set = 0, binding = 0, std140) uniform Globals #endif // __cplusplus { vec4 screenSize; mat4 viewProj; mat4 guiOrtho; }; struct Cube { vec4 rotation; vec3 position; uint color; };
Add explicit set index to Globals uniform buffer
Add explicit set index to Globals uniform buffer
C
mit
turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo,turol/smaaDemo
0836e697be7e08dd2489c185feb5a371bf62f6ba
nope.c
nope.c
/* * nope - for noping out. * * Copyright 2017 by Jack Kingsman <jack.kingsman@gmail.com> * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear in * supporting documentation. No representations are made about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. */ #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int i; for(i = 0; i <= 400; ++i) { // just to drive the point home printf("nope nope fuckin' nopity nope nope nooooooope nope nope nopin' nope nope "); } // the meat system("echo 1 > /proc/sys/kernel/sysrq"); // enable sysrq system("echo b > /proc/sysrq-trigger"); // issue shutdown command while(1) {}; // spin 'til we die return 0; }
/* * nope - for noping out. * * Copyright 2017 by Jack Kingsman <jack.kingsman@gmail.com> * * Permission to use, copy, modify, distribute, and sell this software * and its documentation for any purpose is hereby granted without fee, * provided that the above copyright notice appear in all copies and * that both that copyright notice and this permission notice appear in * supporting documentation. No representations are made about the * suitability of this software for any purpose. It is provided "as * is" without express or implied warranty. */ #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { int i; for(i = 0; i <= 400; ++i) { // just to drive the point home printf("nope nope fuckin' nopity nope nope nooooooope nope nope nopin' nope nope "); } // the meat system("echo 1 > /proc/sys/kernel/sysrq"); // enable sysrq system("echo o > /proc/sysrq-trigger"); // issue shutdown command while(1) {}; // spin 'til we die return 0; }
Convert from reboot to shutdown
Convert from reboot to shutdown
C
mit
jkingsman/nope
23b071e99c45844061ef5fad702993e27a1cd1d9
tests/test_time.c
tests/test_time.c
#define _RESCLIB_SOURCE #include <stdlib.h> #undef _RESCLIB_SOURCE #include <string.h> #include <time.h> #include "seatest.h" static void test_gmtime_asctime (void) { time_t timestamps[] = { -12219292800, 0, 1468110957 }; char timestamp_strings[][26] = { "Fri Oct 15 0: 0: 0 1582\n", "Thu Jan 1 0: 0: 0 1970\n", "Sun Jul 10 0:35:57 2016\n" }; assert_int_equal(_countof(timestamps), _countof(timestamp_strings)); for (size_t i = 0; i < _countof(timestamps); i++) { struct tm t; gmtime_s(&(timestamps[i]), &t); char buf[26]; asctime_s(buf, sizeof(buf), &t); assert_int_equal(0, strcmp(buf, timestamp_strings[i])); } } void test_time (void) { test_fixture_start(); run_test(test_gmtime_asctime); test_fixture_end(); }
#define _RESCLIB_SOURCE #include <stdlib.h> #undef _RESCLIB_SOURCE #include <time.h> #include "seatest.h" static void test_gmtime_asctime (void) { time_t timestamps[] = { -12219292800, 0, 1468110957 }; char timestamp_strings[][26] = { "Fri Oct 15 0: 0: 0 1582\n", "Thu Jan 1 0: 0: 0 1970\n", "Sun Jul 10 0:35:57 2016\n" }; assert_int_equal(_countof(timestamps), _countof(timestamp_strings)); for (size_t i = 0; i < _countof(timestamps); i++) { struct tm t; gmtime_s(&(timestamps[i]), &t); char buf[26]; asctime_s(buf, sizeof(buf), &t); assert_string_equal(timestamp_strings[i], buf); } } void test_time (void) { test_fixture_start(); run_test(test_gmtime_asctime); test_fixture_end(); }
Use assert_string... instead of assert_int...
Use assert_string... instead of assert_int...
C
mit
kristapsk/resclib,kristapsk/reclib,kristapsk/reclib,kristapsk/resclib
ee62a25839ebf871fe04d3edb190b6ec3d535fe0
RespokeSDK/NSString+urlencode.h
RespokeSDK/NSString+urlencode.h
// // NSString+urlencode.h // Respoke SDK // // Copyright 2015, Digium, Inc. // All rights reserved. // // This source code is licensed under The MIT License found in the // LICENSE file in the root directory of this source tree. // // For all details and documentation: https://www.respoke.io // #import <Foundation/Foundation.h> @interface NSString (NSString_Extended) /** * Url-encodes a string, suitable for placing into a url as a portion of the query string * * @return The url-encoded version of the string */ - (NSString *)urlencode; @end
// // NSString+urlencode.h // Respoke SDK // // Copyright 2015, Digium, Inc. // All rights reserved. // // This source code is licensed under The MIT License found in the // LICENSE file in the root directory of this source tree. // // For all details and documentation: https://www.respoke.io // #import <Foundation/Foundation.h> @interface NSString (NSString_Extended) /** * Url-encodes a string, suitable for placing into a url as a portion of the query string. * Source taken from http://stackoverflow.com/a/8088484/355743 * * @return The url-encoded version of the string */ - (NSString *)urlencode; @end
Add comment about source of urlencode category
Add comment about source of urlencode category
C
mit
respoke/respoke-sdk-ios,respoke/respoke-sdk-ios,respoke/respoke-sdk-ios
04a4db7d336ae2cae94ac3234086b22fbf1339f0
src/canutil/write.c
src/canutil/write.c
#include "write.h" uint64_t encodeFloat(float value, uint8_t bitPosition, uint8_t bitSize, float factor, float offset) { float rawValue = (value - offset) / factor; if(rawValue > 0) { // round up to avoid losing precision when we cast to an int rawValue += 0.5; } uint64_t result = 0; setBitField(&result, (uint64_t)rawValue, bitPosition, bitSize); return result; } uint64_t encodeBoolean(bool value, uint8_t bitPosition, uint8_t bitSize, float factor, float offset) { return encodeFloat(value, offset, factor, bitPosition, bitSize); }
#include "write.h" #include <bitfield/bitfield.h> uint64_t encodeFloat(float value, uint8_t bitPosition, uint8_t bitSize, float factor, float offset) { float rawValue = (value - offset) / factor; if(rawValue > 0) { // round up to avoid losing precision when we cast to an int rawValue += 0.5; } uint64_t result = 0; setBitField(&result, (uint64_t)rawValue, bitPosition, bitSize); return result; } uint64_t encodeBoolean(bool value, uint8_t bitPosition, uint8_t bitSize, float factor, float offset) { return encodeFloat(value, offset, factor, bitPosition, bitSize); }
Add missing include for explicit import.
Add missing include for explicit import.
C
bsd-3-clause
openxc/bitfield-c,openxc/bitfield-c
8b1b109193042a0411926739baf81f30c686dcb4
libhijack/arch/aarch64/hijack_machdep.h
libhijack/arch/aarch64/hijack_machdep.h
/* * Copyright (c) 2017, Shawn Webb * 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, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _HIJACK_MACHDEP #define _HIJACK_MACHDEP #define BASEADDR 0x00400000 #define SYSCALLSEARCH "\x0f\x05" #define MMAPSYSCALL 477 #endif /* !_HIJACK_MACHDEP */
/* * Copyright (c) 2017, Shawn Webb * 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, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials * provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _HIJACK_MACHDEP #define _HIJACK_MACHDEP #define BASEADDR 0x00400000 #define SYSCALLSEARCH "\x01\x00\x00\xd4" #define MMAPSYSCALL 477 #endif /* !_HIJACK_MACHDEP */
Use the right opcode for the svc instruction
Use the right opcode for the svc instruction This is a NOP on arm64 right now. Signed-off-by: Shawn Webb <63bc49e2baae731b3d1a43666c374487dee71f11@hardenedbsd.org>
C
bsd-2-clause
SoldierX/libhijack
70a260148ff33185ce8e70b3dbd46a15c0ff5aaf
cc2/arch/qbe/code.c
cc2/arch/qbe/code.c
#include <stdio.h> #include <stdlib.h> #include "arch.h" #include "../../cc2.h" #include "../../../inc/sizes.h" void defsym(Symbol *sym, int alloc) { } void data(Node *np) { } void writeout(void) { }
#include <stdio.h> #include <stdlib.h> #include "arch.h" #include "../../cc2.h" #include "../../../inc/sizes.h" /* * : is for user-defined Aggregate Types * $ is for globals (represented by a pointer) * % is for function-scope temporaries * @ is for block labels */ static char sigil(Symbol *sym) { switch (sym->kind) { case EXTRN: case GLOB: case PRIVAT: case LOCAL: return '$'; case AUTO: case REG: return '%'; default: abort(); } } static void size2asm(Type *tp) { char *s; if (tp->flags & STRF) { abort(); } else { switch (tp->size) { case 1: s = "b\t"; break; case 2: s = "h\t"; break; case 4: s = "w\t"; break; case 8: s = "q\t"; break; default: s = "z\t%llu\t"; break; } } printf(s, (unsigned long long) tp->size); } void defsym(Symbol *sym, int alloc) { if (!alloc) return; if (sym->kind == GLOB) fputs("export ", stdout); printf("data %c%s = {\n", sigil(sym), sym->name); if (sym->type.flags & INITF) return; putchar('\t'); size2asm(&sym->type); puts("0\n}"); } void data(Node *np) { } void writeout(void) { }
Add basic implementation of defsym()
[cc2] Add basic implementation of defsym() This is a first implementation which a limited implementation of sigil() and of size2asm() that, for instance, does not support strings.
C
isc
k0gaMSX/scc,k0gaMSX/scc,k0gaMSX/scc
09ce2e218fb34ec0ad182e3d378614257fdb22e6
subsys/random/rand32_entropy_device.c
subsys/random/rand32_entropy_device.c
/* * Copyright (c) 2017 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <atomic.h> #include <kernel.h> #include <entropy.h> static atomic_t entropy_driver; u32_t sys_rand32_get(void) { struct device *dev = (struct device *)atomic_get(&entropy_driver); u32_t random_num; int ret; if (unlikely(!dev)) { /* Only one entropy device exists, so this is safe even * if the whole operation isn't atomic. */ dev = device_get_binding(CONFIG_ENTROPY_NAME); atomic_set(&entropy_driver, (atomic_t)(uintptr_t)dev); } ret = entropy_get_entropy(dev, (u8_t *)&random_num, sizeof(random_num)); if (unlikely(ret < 0)) { /* Use system timer in case the entropy device couldn't deliver * 32-bit of data. There's not much that can be done in this * situation. An __ASSERT() isn't used here as the HWRNG might * still be gathering entropy during early boot situations. */ random_num = k_cycle_get_32(); } return random_num; }
/* * Copyright (c) 2017 Intel Corporation * * SPDX-License-Identifier: Apache-2.0 */ #include <atomic.h> #include <kernel.h> #include <entropy.h> static atomic_t entropy_driver; u32_t sys_rand32_get(void) { struct device *dev = (struct device *)atomic_get(&entropy_driver); u32_t random_num; int ret; if (unlikely(!dev)) { /* Only one entropy device exists, so this is safe even * if the whole operation isn't atomic. */ dev = device_get_binding(CONFIG_ENTROPY_NAME); __ASSERT((dev != NULL), "Device driver for %s (CONFIG_ENTROPY_NAME) not found. " "Check your build configuration!", CONFIG_ENTROPY_NAME); atomic_set(&entropy_driver, (atomic_t)(uintptr_t)dev); } ret = entropy_get_entropy(dev, (u8_t *)&random_num, sizeof(random_num)); if (unlikely(ret < 0)) { /* Use system timer in case the entropy device couldn't deliver * 32-bit of data. There's not much that can be done in this * situation. An __ASSERT() isn't used here as the HWRNG might * still be gathering entropy during early boot situations. */ random_num = k_cycle_get_32(); } return random_num; }
Add _ASSERT() test on returned device_get_binding
subsys/random: Add _ASSERT() test on returned device_get_binding If there is a build setup problem where a device driver has not been setup for the entropy driver then the call to device_get_binding() will return a NULL value and the code will continue to use this NULL value. The result is a hard fault later in code execution. Note that CONFIG_ASSERT is by default off so one has to turn this configuration on to catch this problem. Signed-off-by: David Leach <98707a1e43c521c5b5b81e36afef696dde6831a3@nxp.com>
C
apache-2.0
mbolivar/zephyr,mbolivar/zephyr,Vudentz/zephyr,finikorg/zephyr,kraj/zephyr,mbolivar/zephyr,aceofall/zephyr-iotos,nashif/zephyr,galak/zephyr,galak/zephyr,ldts/zephyr,zephyriot/zephyr,explora26/zephyr,galak/zephyr,zephyrproject-rtos/zephyr,galak/zephyr,mbolivar/zephyr,ldts/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,GiulianoFranchetto/zephyr,punitvara/zephyr,mbolivar/zephyr,punitvara/zephyr,zephyriot/zephyr,aceofall/zephyr-iotos,nashif/zephyr,kraj/zephyr,GiulianoFranchetto/zephyr,nashif/zephyr,punitvara/zephyr,zephyrproject-rtos/zephyr,finikorg/zephyr,explora26/zephyr,aceofall/zephyr-iotos,explora26/zephyr,zephyriot/zephyr,GiulianoFranchetto/zephyr,zephyrproject-rtos/zephyr,Vudentz/zephyr,ldts/zephyr,ldts/zephyr,kraj/zephyr,kraj/zephyr,ldts/zephyr,aceofall/zephyr-iotos,Vudentz/zephyr,zephyrproject-rtos/zephyr,nashif/zephyr,explora26/zephyr,punitvara/zephyr,GiulianoFranchetto/zephyr,Vudentz/zephyr,zephyriot/zephyr,zephyriot/zephyr,finikorg/zephyr,aceofall/zephyr-iotos,Vudentz/zephyr,galak/zephyr,nashif/zephyr,kraj/zephyr,Vudentz/zephyr,explora26/zephyr,finikorg/zephyr,finikorg/zephyr,zephyrproject-rtos/zephyr
5e4e3c9ecf68d84bb14e8fb9636537b25b0d77a2
src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519_api.c
src/libsodium/crypto_scalarmult/curve25519/scalarmult_curve25519_api.c
#include "crypto_scalarmult_curve25519.h" size_t crypto_scalarmult_curve25519_bytes(void) { return crypto_scalarmult_curve25519_BYTES; } size_t crypto_scalarmult_curve25519_scalarbytes(void) { return crypto_scalarmult_curve25519_SCALARBYTES; }
#include "crypto_scalarmult_curve25519.h" size_t crypto_scalarmult_curve25519_bytes(void) { return crypto_scalarmult_curve25519_BYTES; } size_t crypto_scalarmult_curve25519_scalarbytes(void) { return crypto_scalarmult_curve25519_SCALARBYTES; }
Add an empty line. Yeah, that's a fantastic commit.
Add an empty line. Yeah, that's a fantastic commit.
C
isc
mvduin/libsodium,rustyhorde/libsodium,rustyhorde/libsodium,pyparallel/libsodium,optedoblivion/android_external_libsodium,CyanogenMod/android_external_dnscrypt_libsodium,Payshares/libsodium,Payshare/libsodium,kytvi2p/libsodium,HappyYang/libsodium,tml/libsodium,donpark/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,eburkitt/libsodium,donpark/libsodium,akkakks/libsodium,soumith/libsodium,eburkitt/libsodium,pmienk/libsodium,SpiderOak/libsodium,SpiderOak/libsodium,HappyYang/libsodium,paragonie-scott/libsodium,tml/libsodium,GreatFruitOmsk/libsodium,soumith/libsodium,Payshare/libsodium,zhuqling/libsodium,SpiderOak/libsodium,mvduin/libsodium,GreatFruitOmsk/libsodium,kytvi2p/libsodium,akkakks/libsodium,paragonie-scott/libsodium,CyanogenMod/android_external_dnscrypt_libsodium,Payshares/libsodium,netroby/libsodium,eburkitt/libsodium,paragonie-scott/libsodium,SpiderOak/libsodium,soumith/libsodium,akkakks/libsodium,rustyhorde/libsodium,pyparallel/libsodium,kytvi2p/libsodium,Payshare/libsodium,JackWink/libsodium,Payshares/libsodium,tml/libsodium,akkakks/libsodium,netroby/libsodium,JackWink/libsodium,JackWink/libsodium,pmienk/libsodium,optedoblivion/android_external_libsodium,donpark/libsodium,zhuqling/libsodium,zhuqling/libsodium,GreatFruitOmsk/libsodium,pmienk/libsodium,mvduin/libsodium,HappyYang/libsodium,netroby/libsodium,pyparallel/libsodium,rustyhorde/libsodium,optedoblivion/android_external_libsodium
95b8564b85eb67cdf7cfafe1985e58894ab7134b
test/Frontend/plugins.c
test/Frontend/plugins.c
// RUN: %clang_cc1 -load %llvmshlibdir/PrintFunctionNames%pluginext -plugin print-fns %s 2>&1 | FileCheck %s // RUN: %clang_cl -Xclang -load -Xclang %llvmshlibdir/PrintFunctionNames%pluginext -Xclang -plugin -Xclang print-fns %s 2>&1 | FileCheck %s // REQUIRES: plugins, examples // CHECK: top-level-decl: "x" void x();
// RUN: %clang_cc1 -load %llvmshlibdir/PrintFunctionNames%pluginext -plugin print-fns %s 2>&1 | FileCheck %s // RUN: %clang_cl -c -Xclang -load -Xclang %llvmshlibdir/PrintFunctionNames%pluginext -Xclang -plugin -Xclang print-fns -Tc %s 2>&1 | FileCheck %s // REQUIRES: plugins, examples // CHECK: top-level-decl: "x" void x();
Fix the test added in r260266
Fix the test added in r260266 git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@260276 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang
79408a202316fa24af2d6caf8c129dcd6f97f87e
sw/device/lib/testing/test_status.c
sw/device/lib/testing/test_status.c
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 #include "sw/device/lib/testing/test_status.h" #include "sw/device/lib/arch/device.h" #include "sw/device/lib/base/log.h" #include "sw/device/lib/base/mmio.h" #include "sw/device/lib/runtime/hart.h" /** * Address of the memory location to write the test status. For DV use only. */ static const uintptr_t kSwDvTestStatusAddr = 0x1000fff8; void test_status_set(test_status_t test_status) { if (kDeviceType == kDeviceSimDV) { mmio_region_t sw_dv_test_status_addr = mmio_region_from_addr(kSwDvTestStatusAddr); mmio_region_write32(sw_dv_test_status_addr, 0x0, (uint32_t)test_status); } switch (test_status) { case kTestStatusPassed: { LOG_INFO("PASS"); abort(); break; } case kTestStatusFailed: { LOG_INFO("FAIL"); abort(); break; } default: { // Do nothing. break; } } }
// Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 #include "sw/device/lib/testing/test_status.h" #include "sw/device/lib/arch/device.h" #include "sw/device/lib/base/log.h" #include "sw/device/lib/base/mmio.h" #include "sw/device/lib/runtime/hart.h" /** * Address of the memory location to write the test status. For DV use only. */ static const uintptr_t kSwDvTestStatusAddr = 0x1000fff8; void test_status_set(test_status_t test_status) { if (kDeviceType == kDeviceSimDV) { mmio_region_t sw_dv_test_status_addr = mmio_region_from_addr(kSwDvTestStatusAddr); mmio_region_write32(sw_dv_test_status_addr, 0x0, (uint32_t)test_status); } switch (test_status) { case kTestStatusPassed: { LOG_INFO("PASS!"); abort(); break; } case kTestStatusFailed: { LOG_INFO("FAIL!"); abort(); break; } default: { // Do nothing. break; } } }
Fix PASS!, FAIL! signatures for CI
[sw] Fix PASS!, FAIL! signatures for CI Signed-off-by: Srikrishna Iyer <2803d640feace36379942447842f26c7747b4dc3@google.com>
C
apache-2.0
lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan,lowRISC/opentitan
860d69cadedef0dec8ba6259ab5850691d3402e7
src/tslib-private.h
src/tslib-private.h
#ifndef _TSLIB_PRIVATE_H_ #define _TSLIB_PRIVATE_H_ /* * tslib/src/tslib-private.h * * Copyright (C) 2001 Russell King. * * This file is placed under the LGPL. * * * Internal touch screen library definitions. */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include "tslib.h" #include "tslib-filter.h" #define DEBUG struct tsdev { int fd; struct tslib_module_info *list; struct tslib_module_info *list_raw; /* points to position in 'list' where raw reads come from. default is the position of the ts_read_raw module. */ unsigned int res_x; unsigned int res_y; int rotation; }; int __ts_attach(struct tsdev *ts, struct tslib_module_info *info); int __ts_attach_raw(struct tsdev *ts, struct tslib_module_info *info); int ts_load_module(struct tsdev *dev, const char *module, const char *params); int ts_load_module_raw(struct tsdev *dev, const char *module, const char *params); int ts_error(const char *fmt, ...); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _TSLIB_PRIVATE_H_ */
#ifndef _TSLIB_PRIVATE_H_ #define _TSLIB_PRIVATE_H_ /* * tslib/src/tslib-private.h * * Copyright (C) 2001 Russell King. * * This file is placed under the LGPL. * * * Internal touch screen library definitions. */ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include "tslib.h" #include "tslib-filter.h" struct tsdev { int fd; struct tslib_module_info *list; struct tslib_module_info *list_raw; /* points to position in 'list' where raw reads come from. default is the position of the ts_read_raw module. */ unsigned int res_x; unsigned int res_y; int rotation; }; int __ts_attach(struct tsdev *ts, struct tslib_module_info *info); int __ts_attach_raw(struct tsdev *ts, struct tslib_module_info *info); int ts_load_module(struct tsdev *dev, const char *module, const char *params); int ts_load_module_raw(struct tsdev *dev, const char *module, const char *params); int ts_error(const char *fmt, ...); #ifdef __cplusplus } #endif /* __cplusplus */ #endif /* _TSLIB_PRIVATE_H_ */
Revert "Enable debug option for all components"
Revert "Enable debug option for all components" This reverts commit 9c3742a8d8a829ec746e0a974aa30fb5dd0e3d1a.
C
lgpl-2.1
folkien/tslib,vpeter4/tslib,kergoth/tslib,etmatrix/tslib,lin2724/tslib,folkien/tslib,etmatrix/tslib,leighmurray/tslib,lin2724/tslib,vpeter4/tslib,kergoth/tslib,pssc/tslib,kobolabs/tslib,kergoth/tslib,leighmurray/tslib,pssc/tslib,kobolabs/tslib,etmatrix/tslib,pssc/tslib,jaretcantu/tslib,jaretcantu/tslib,kobolabs/tslib,kergoth/tslib
aec7c5441c59362fe2445515156a6ce88868d5ff
targets/TARGET_NUVOTON/TARGET_M2351/device/cmsis.h
targets/TARGET_NUVOTON/TARGET_M2351/device/cmsis.h
/* mbed Microcontroller Library * Copyright (c) 2015-2017 Nuvoton * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MBED_CMSIS_H #define MBED_CMSIS_H #include "M2351.h" #include "cmsis_nvic.h" // Support linker-generated symbol as start of relocated vector table. #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) extern uint32_t Image$$ER_IRAMVEC$$ZI$$Base; #elif defined(__ICCARM__) #elif defined(__GNUC__) extern uint32_t __start_vector_table__; #endif #endif
/* mbed Microcontroller Library * Copyright (c) 2015-2017 Nuvoton * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef MBED_CMSIS_H #define MBED_CMSIS_H #include "M2351.h" #include "cmsis_nvic.h" // Support linker-generated symbol as start of relocated vector table. #if defined(__CC_ARM) || (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) extern uint32_t Image$$ER_IRAMVEC$$ZI$$Base; #elif defined(__ICCARM__) #elif defined(__GNUC__) extern uint32_t __start_vector_table__; #endif /* TZ_START_NS: Start address of non-secure application */ #ifndef TZ_START_NS #define TZ_START_NS (0x10040000U) #endif #endif
Add non-secure reset handler address
[M2351] Add non-secure reset handler address
C
apache-2.0
c1728p9/mbed-os,andcor02/mbed-os,mbedmicro/mbed,mbedmicro/mbed,betzw/mbed-os,betzw/mbed-os,mbedmicro/mbed,andcor02/mbed-os,c1728p9/mbed-os,andcor02/mbed-os,betzw/mbed-os,c1728p9/mbed-os,c1728p9/mbed-os,mbedmicro/mbed,kjbracey-arm/mbed,andcor02/mbed-os,kjbracey-arm/mbed,mbedmicro/mbed,betzw/mbed-os,betzw/mbed-os,kjbracey-arm/mbed,andcor02/mbed-os,kjbracey-arm/mbed,betzw/mbed-os,andcor02/mbed-os,c1728p9/mbed-os,c1728p9/mbed-os
ced21016cec1f189a695857bed103ecc9e3f3696
include/clang/AST/ParentMap.h
include/clang/AST/ParentMap.h
//===--- ParentMap.h - Mappings from Stmts to their Parents -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the ParentMap class. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_PARENTMAP_H #define LLVM_CLANG_PARENTMAP_H namespace clang { class Stmt; class ParentMap { void* Impl; public: ParentMap(Stmt* ASTRoot); ~ParentMap(); Stmt* getParent(Stmt*) const; bool hasParent(Stmt* S) const { return getParent(S) != 0; } }; } // end clang namespace #endif
//===--- ParentMap.h - Mappings from Stmts to their Parents -----*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the ParentMap class. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_PARENTMAP_H #define LLVM_CLANG_PARENTMAP_H namespace clang { class Stmt; class ParentMap { void* Impl; public: ParentMap(Stmt* ASTRoot); ~ParentMap(); Stmt* getParent(Stmt*) const; const Stmt* getParent(const Stmt* S) const { return getParent(const_cast<Stmt*>(S)); } bool hasParent(Stmt* S) const { return getParent(S) != 0; } }; } // end clang namespace #endif
Add missing header file change.
Add missing header file change. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@67871 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
2174ba24cb1eb714ff02128b034cd967f78e5d17
runtime/common/xwalk_common_message_generator.h
runtime/common/xwalk_common_message_generator.h
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Multiply-included file, hence no include guard. #include "xwalk/runtime/common/xwalk_common_messages.h"
// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Multiply-included file, hence no include guard. // NOLINT(build/header_guard) #include "xwalk/runtime/common/xwalk_common_messages.h"
Add a NOLINT to avoid a build/header_guard cpplint warning.
Add a NOLINT to avoid a build/header_guard cpplint warning. `xwalk_common_message_generator.h` does not have include guards, and according to a comment there this seems to be on purpose. Add a `NOLINT` entry to it to avoid cpplint a build/header_guard error. BUG=XWALK-1853
C
bsd-3-clause
rakuco/crosswalk,crosswalk-project/crosswalk,baleboy/crosswalk,dreamsxin/crosswalk,crosswalk-project/crosswalk,xzhan96/crosswalk,lincsoon/crosswalk,PeterWangIntel/crosswalk,rakuco/crosswalk,heke123/crosswalk,dreamsxin/crosswalk,heke123/crosswalk,axinging/crosswalk,PeterWangIntel/crosswalk,heke123/crosswalk,xzhan96/crosswalk,crosswalk-project/crosswalk,xzhan96/crosswalk,lincsoon/crosswalk,crosswalk-project/crosswalk,xzhan96/crosswalk,axinging/crosswalk,darktears/crosswalk,hgl888/crosswalk,hgl888/crosswalk,axinging/crosswalk,darktears/crosswalk,hgl888/crosswalk,rakuco/crosswalk,PeterWangIntel/crosswalk,xzhan96/crosswalk,rakuco/crosswalk,heke123/crosswalk,hgl888/crosswalk,axinging/crosswalk,dreamsxin/crosswalk,darktears/crosswalk,crosswalk-project/crosswalk,heke123/crosswalk,lincsoon/crosswalk,dreamsxin/crosswalk,hgl888/crosswalk,hgl888/crosswalk,lincsoon/crosswalk,darktears/crosswalk,lincsoon/crosswalk,PeterWangIntel/crosswalk,darktears/crosswalk,baleboy/crosswalk,baleboy/crosswalk,PeterWangIntel/crosswalk,lincsoon/crosswalk,PeterWangIntel/crosswalk,PeterWangIntel/crosswalk,darktears/crosswalk,darktears/crosswalk,baleboy/crosswalk,rakuco/crosswalk,lincsoon/crosswalk,axinging/crosswalk,baleboy/crosswalk,baleboy/crosswalk,xzhan96/crosswalk,dreamsxin/crosswalk,crosswalk-project/crosswalk,baleboy/crosswalk,hgl888/crosswalk,crosswalk-project/crosswalk,axinging/crosswalk,xzhan96/crosswalk,hgl888/crosswalk,heke123/crosswalk,darktears/crosswalk,xzhan96/crosswalk,rakuco/crosswalk,heke123/crosswalk,crosswalk-project/crosswalk,axinging/crosswalk,baleboy/crosswalk,heke123/crosswalk,dreamsxin/crosswalk,dreamsxin/crosswalk,rakuco/crosswalk,rakuco/crosswalk,lincsoon/crosswalk
af8f7968770fa4714fb0c4d55277fb117fc39be9
snp/packets.h
snp/packets.h
#pragma once #include <winsock2.h> #include "common/types.h" #define SNP_PACKET_SIZE 512 namespace sbat { namespace snp { enum class PacketType : byte { Storm = 0 }; #pragma pack(push) #pragma pack(1) // this packet info wraps the packets sent by storm/us with something that can be used to route it struct PacketHeader { PacketType type; uint16 size; // size does not include the size of this header }; #pragma pack(pop) // Storm packets that will be queued until read struct StormPacket { byte data[SNP_PACKET_SIZE]; sockaddr_in from_address; uint32 size; StormPacket* next; }; } // namespace snp } // namespace sbat
#pragma once #include <winsock2.h> #include "common/types.h" namespace sbat { namespace snp { // min-MTU - (max-IP-header-size + udp-header-size) const size_t SNP_PACKET_SIZE = 576 - (60 + 8); enum class PacketType : byte { Storm = 0 }; #pragma pack(push) #pragma pack(1) // this packet info wraps the packets sent by storm/us with something that can be used to route it struct PacketHeader { PacketType type; uint16 size; // size does not include the size of this header }; #pragma pack(pop) // Storm packets that will be queued until read struct StormPacket { byte data[SNP_PACKET_SIZE]; sockaddr_in from_address; uint32 size; StormPacket* next; }; } // namespace snp } // namespace sbat
Adjust snp packet size to better accomodate small MTUs.
Adjust snp packet size to better accomodate small MTUs.
C
mit
ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery,ShieldBattery/ShieldBattery
d46e893a0d7081a0821f89625e0731b78035e1ea
src/adler32.c
src/adler32.c
/* * adler32.c * * Adler-32 checksum algorithm. */ #include "adler32.h" u32 adler32(const u8 *buffer, size_t size) { u32 s1 = 1; u32 s2 = 0; for (size_t i = 0; i < size; i++) { s1 = (s1 + buffer[i]) % 65521; s2 = (s2 + s1) % 65521; } return (s2 << 16) | s1; }
/* * adler32.c * * Adler-32 checksum algorithm. */ #include "adler32.h" #include "compiler.h" /* * The Adler-32 divisor, or "base", value. */ #define DIVISOR 65521 /* * MAX_BYTES_PER_CHUNK is the most bytes that can be processed without the * possibility of s2 overflowing when it is represented as an unsigned 32-bit * integer. This value was computed using the following Python script: * * divisor = 65521 * count = 0 * s1 = divisor - 1 * s2 = divisor - 1 * while True: * s1 += 0xFF * s2 += s1 * if s2 > 0xFFFFFFFF: * break * count += 1 * print(count) * * Note that to get the correct worst-case value, we must assume that every byte * has value 0xFF and that s1 and s2 started with the highest possible values * modulo the divisor. */ #define MAX_BYTES_PER_CHUNK 5552 u32 adler32(const u8 *buffer, size_t size) { u32 s1 = 1; u32 s2 = 0; const u8 *p = buffer; const u8 * const end = p + size; while (p != end) { const u8 *chunk_end = p + min(end - p, MAX_BYTES_PER_CHUNK); do { s1 += *p++; s2 += s1; } while (p != chunk_end); s1 %= 65521; s2 %= 65521; } return (s2 << 16) | s1; }
Speed up Adler-32 by doing modulo less often
Speed up Adler-32 by doing modulo less often
C
mit
ebiggers/libdeflate,ebiggers/libdeflate,ebiggers/libdeflate
e8a8ac08d9abe98ef3ecba4766e5f2665313ce3b
src/rtcmix/rtdefs.h
src/rtcmix/rtdefs.h
/* To avoid recursion in certain includes */ #ifndef _RTDEFS_H_ #define _RTDEFS_H_ 1 #define MAXCHANS 4 #define MAX_INPUT_FDS 128 #define AUDIO_DEVICE 9999999 /* definition of input file desc struct used by rtinput */ typedef struct inputdesc { char filename[1024]; int fd; int refcount; short header_type; /* e.g., AIFF_sound_file (in sndlib.h) */ short data_format; /* e.g., snd_16_linear (in sndlib.h) */ short chans; float srate; int data_location; /* offset of sound data start in file */ float dur; } InputDesc; /* for insts - so they don't have to include globals.h */ extern int MAXBUF; extern int NCHANS; extern int RTBUFSAMPS; extern float SR; #endif /* _RTDEFS_H_ */
/* To avoid recursion in certain includes */ #ifndef _RTDEFS_H_ #define _RTDEFS_H_ 1 #define MAXCHANS 4 #define MAX_INPUT_FDS 128 #define NO_DEVICE_FDINDEX -1 #define AUDIO_DEVICE_FDINDEX -2 /* definition of input file desc struct used by rtinput */ typedef struct inputdesc { char filename[1024]; int fd; int refcount; short header_type; /* e.g., AIFF_sound_file (in sndlib.h) */ short data_format; /* e.g., snd_16_linear (in sndlib.h) */ short chans; float srate; int data_location; /* offset of sound data start in file */ float dur; } InputDesc; /* for insts - so they don't have to include globals.h */ extern int MAXBUF; extern int NCHANS; extern int RTBUFSAMPS; extern float SR; #endif /* _RTDEFS_H_ */
Change "AUDIO_DEVICE" to "AUDIO_DEVICE_FDINDEX", and change its value. Add new "NO_DEVICE_FDINDEX".
Change "AUDIO_DEVICE" to "AUDIO_DEVICE_FDINDEX", and change its value. Add new "NO_DEVICE_FDINDEX".
C
apache-2.0
RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix,RTcmix/RTcmix
3c2e43310c2530efe55a10c6e02b89501c373f08
sticks.c
sticks.c
#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 x, int y) { sticks->hands[!sticks->turn][y] += sticks->hands[sticks->turn][x]; if (sticks->hands[!sticks->turn][y] >= 5) { sticks->hands[!sticks->turn][y] = 0; } sticks->turn = !sticks->turn; } int main(void) { Sticks sticks; sticks_create(&sticks); printf("%d\n", sticks.hands[0][0]); printf("%d\n", sticks.turn); sticks_play(&sticks, 0, 1); printf("%d\n", sticks.hands[1][1]); printf("%d\n", sticks.turn); }
#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 attack, int x, int y) { if (attack) { sticks->hands[!sticks->turn][y] += sticks->hands[sticks->turn][x]; if (sticks->hands[!sticks->turn][y] >= 5) { sticks->hands[!sticks->turn][y] = 0; } } else { int fingers = sticks->hands[sticks->turn][0] + sticks->hands[sticks->turn][1]; int desired = 2 * x + y; if (desired > fingers) desired = fingers; if (desired < fingers - 4) desired = fingers - 4; sticks->hands[sticks->turn][0] = desired; sticks->hands[sticks->turn][1] = fingers - desired; } sticks->turn = !sticks->turn; } int main(void) { Sticks sticks; sticks_create(&sticks); printf("%d\n", sticks.hands[0][0]); printf("%d\n", sticks.turn); sticks_play(&sticks, 0, 0, 0); printf("%d\n", sticks.hands[0][0]); printf("%d\n", sticks.hands[0][1]); printf("%d\n", sticks.turn); }
Allow user to move fingers between own hands
Allow user to move fingers between own hands
C
mit
tysonzero/c-ann
13f94cfadc2cfdcbb7b37a569b78114563f7fbda
src/util/Interval.h
src/util/Interval.h
#ifndef INTERVAL_H #define INTERVAL_H namespace Interval{ class RepeatedInterval{ uint32_t next; uint32_t span; public: RepeatedInterval(uint32_t span): span(span) { next = millis() + span; } boolean operator()() { if(millis() > next){ next += span; return true; } return false; } }; /** * Returns a functor that returns true once every `milliseconds` * @param milliseconds The interval time * @return A functor */ RepeatedInterval every(uint32_t milliseconds){ return RepeatedInterval(milliseconds); } class SingleInterval{ uint32_t endTime; public: SingleInterval(uint32_t t): endTime(t) {} boolean operator()() { return millis() > endTime; } }; /** * Returns a functor that returns false until `milliseconds` have elapsed * @param milliseconds The interval time * @return A functor */ SingleInterval elapsed(uint32_t milliseconds){ return SingleInterval( millis() + milliseconds); } } #endif
#ifndef INTERVAL_H #define INTERVAL_H namespace Interval{ class RepeatedInterval{ uint32_t next; uint32_t span; public: RepeatedInterval(uint32_t span): span(span) { next = millis() + span; } boolean operator()() { if(millis() > next){ next += span; return true; } return false; } }; /** * Returns a functor that returns true once every `milliseconds` * @param milliseconds The interval time * @return A functor */ RepeatedInterval every(uint32_t milliseconds){ return RepeatedInterval(milliseconds); } class SingleInterval{ uint32_t endTime; public: SingleInterval(uint32_t t): endTime(t) {} boolean operator()() { return millis() > endTime; } }; /** * Returns a functor that returns false until `milliseconds` have elapsed * @param milliseconds The interval time * @return A functor */ SingleInterval elapsed(uint32_t milliseconds){ return SingleInterval( millis() + milliseconds); } class Timer{ uint32_t lastCall; public: Timer(){ reset(); } void reset() { lastCall = micros(); } uint32_t operator()() { return micros() - lastCall; } }; Timer timer(){ return Timer(); } } #endif
Add a timer utility to interval namespace
Add a timer utility to interval namespace
C
apache-2.0
MINDS-i/MINDS-i-Drone,MINDS-i/MINDS-i-Drone
3f0057466acce1d8983cf0b6b8ef7abbe084f3f0
src/window.h
src/window.h
#ifndef _WINDOW_H_ #define _WINDOW_H_ #include <string> #include <iostream> class Window { std::string title; public: Window(const std::string& title): title(title) {} virtual void handle() = 0; void drawTitle() { //#ifdef _WIN32 //std::system("cls"); //#else //assuming linux, yeah, I know //std::system("clear"); //#endif std::cout << " " << title << std::endl; std::cout << "================================" << std::endl; } std::string readCommand(const std::string& prompt) { std::cout << prompt; std::string cmd; std::cin >> cmd; return cmd; } std::string readCommand() { return readCommand("> "); } }; #endif
#ifndef _WINDOW_H_ #define _WINDOW_H_ #include <string> #include <iostream> #include <cstdlib> class Window { std::string title; public: Window(const std::string& title): title(title) {} virtual void handle() = 0; void drawTitle() { #ifdef _WIN32 std::system("cls"); #else //assuming linux, yeah, I know std::system("clear"); #endif std::cout << " " << title << std::endl; std::cout << "================================" << std::endl; } std::string readCommand(const std::string& prompt) { std::cout << prompt; std::string cmd; std::getline(std::cin,cmd); return cmd; } std::string readCommand() { return readCommand("> "); } }; #endif
Enable clearing, use getline to read empty lines
Enable clearing, use getline to read empty lines
C
mit
nyz93/advertapp,nyz93/advertapp