commit
stringlengths
40
40
old_file
stringlengths
4
112
new_file
stringlengths
4
112
old_contents
stringlengths
0
2.05k
new_contents
stringlengths
28
3.9k
subject
stringlengths
17
736
message
stringlengths
18
4.78k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
7
111k
326619bbabd0c1eec2532407d301474e92fab2aa
dp/longest_increasing_subsequence/c/lis.c
dp/longest_increasing_subsequence/c/lis.c
#include <stdio.h> const int N = 1e5; int lis(int a[], int n) { int i, j; int dp[N]; for(i = 0; i < n; ++i) dp[i] = 1; for(i = 0; i < n; ++i) for(j = 0; j < i; ++j) if(a[j] < a[i]) if(dp[i] < dp[j] + 1) dp[i] = dp[j] + 1; int mx = 0; for(i = 0; i < n; ++i) if(mx < dp[i]) mx = dp[i]; return mx; } int main() { int n; scanf("%d", &n); int a[N]; int i; for(i = 0; i < n; ++i) scanf("%d", &a[i]); printf("%d\n", lis(a, n)); }
Add longest increasing subsequence in C language.
Add longest increasing subsequence in C language.
C
cc0-1.0
ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms
21882ab7a21eb17f0d23d2d2459fdb3c6e787322
libpkg/pkg_util.h
libpkg/pkg_util.h
#ifndef _PKG_UTIL_H #define _PKG_UTIL_H #include <sys/types.h> #include <sys/sbuf.h> #include <sys/param.h> #define ARRAY_INIT {0, 0, NULL} struct array { size_t cap; size_t len; void **data; }; #define STARTS_WITH(string, needle) (strncasecmp(string, needle, strlen(needle)) == 0) #define ERROR_SQLITE(db) \ EMIT_PKG_ERROR("sqlite: %s", sqlite3_errmsg(db)) int sbuf_set(struct sbuf **, const char *); const char * sbuf_get(struct sbuf *); void sbuf_reset(struct sbuf *); void sbuf_free(struct sbuf *); int mkdirs(const char *path); int file_to_buffer(const char *, char **, off_t *); int format_exec_cmd(char **, const char *, const char *, const char *); int split_chr(char *, char); int file_fetch(const char *, const char *); int is_dir(const char *); int is_conf_file(const char *path, char newpath[MAXPATHLEN]); int sha256_file(const char *, char[65]); void sha256_str(const char *, char[65]); #endif
#ifndef _PKG_UTIL_H #define _PKG_UTIL_H #include <sys/types.h> #include <sys/sbuf.h> #include <sys/param.h> #define STARTS_WITH(string, needle) (strncasecmp(string, needle, strlen(needle)) == 0) #define ERROR_SQLITE(db) \ EMIT_PKG_ERROR("sqlite: %s", sqlite3_errmsg(db)) int sbuf_set(struct sbuf **, const char *); const char * sbuf_get(struct sbuf *); void sbuf_reset(struct sbuf *); void sbuf_free(struct sbuf *); int mkdirs(const char *path); int file_to_buffer(const char *, char **, off_t *); int format_exec_cmd(char **, const char *, const char *, const char *); int split_chr(char *, char); int file_fetch(const char *, const char *); int is_dir(const char *); int is_conf_file(const char *path, char newpath[MAXPATHLEN]); int sha256_file(const char *, char[65]); void sha256_str(const char *, char[65]); #endif
Remove last occurences of the dead struct array
Remove last occurences of the dead struct array
C
bsd-2-clause
en90/pkg,khorben/pkg,en90/pkg,khorben/pkg,Open343/pkg,skoef/pkg,Open343/pkg,skoef/pkg,junovitch/pkg,junovitch/pkg,khorben/pkg
246372f35d6e7025e7ff16ce8d7543e961800a0e
include/llvm/ExecutionEngine/GenericValue.h
include/llvm/ExecutionEngine/GenericValue.h
//===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // The GenericValue class is used to represent an LLVM value of arbitrary type. // //===----------------------------------------------------------------------===// #ifndef GENERIC_VALUE_H #define GENERIC_VALUE_H #include "Support/DataTypes.h" namespace llvm { typedef uint64_t PointerTy; union GenericValue { bool BoolVal; unsigned char UByteVal; signed char SByteVal; unsigned short UShortVal; signed short ShortVal; unsigned int UIntVal; signed int IntVal; uint64_t ULongVal; int64_t LongVal; double DoubleVal; float FloatVal; PointerTy PointerVal; unsigned char Untyped[8]; GenericValue() {} GenericValue(void *V) { PointerVal = (PointerTy)(intptr_t)V; } }; inline GenericValue PTOGV(void *P) { return GenericValue(P); } inline void* GVTOP(const GenericValue &GV) { return (void*)(intptr_t)GV.PointerVal; } } // End llvm namespace #endif
//===-- GenericValue.h - Represent any type of LLVM value -------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file was developed by the LLVM research group and is distributed under // the University of Illinois Open Source License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // The GenericValue class is used to represent an LLVM value of arbitrary type. // //===----------------------------------------------------------------------===// #ifndef GENERIC_VALUE_H #define GENERIC_VALUE_H #include "Support/DataTypes.h" namespace llvm { typedef uintptr_t PointerTy; union GenericValue { bool BoolVal; unsigned char UByteVal; signed char SByteVal; unsigned short UShortVal; signed short ShortVal; unsigned int UIntVal; signed int IntVal; uint64_t ULongVal; int64_t LongVal; double DoubleVal; float FloatVal; PointerTy PointerVal; unsigned char Untyped[8]; GenericValue() {} GenericValue(void *V) { PointerVal = (PointerTy)(intptr_t)V; } }; inline GenericValue PTOGV(void *P) { return GenericValue(P); } inline void* GVTOP(const GenericValue &GV) { return (void*)(intptr_t)GV.PointerVal; } } // End llvm namespace #endif
Use uintptr_t for pointer values in the ExecutionEngine.
Use uintptr_t for pointer values in the ExecutionEngine. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@10425 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
apple/swift-llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm
b841954d3e11a0d626016ca709f4b4fd3ad75e8e
Classes/Categories/NSDate+GTTimeAdditions.h
Classes/Categories/NSDate+GTTimeAdditions.h
// // NSDate+GTTimeAdditions.h // ObjectiveGitFramework // // Created by Danny Greg on 27/03/2013. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // #import <Foundation/Foundation.h> #import "git2.h" @interface NSDate (GTTimeAdditions) // Creates a new `NSDate` from the provided `git_time`. // // time - The `git_time` to base the returned date on. // timeZone - The timezone used by the time passed in. // // Returns an `NSDate` object representing the passed in `time`. + (NSDate *)gt_dateFromGitTime:(git_time)time timeZone:(NSTimeZone **)timeZone; // Converts the date to a `git_time`. // // timeZone - An `NSTimeZone` to describe the time offset. This is optional, if // `nil` the default time zone will be used. - (git_time)gt_gitTimeUsingTimeZone:(NSTimeZone *)timeZone; @end @interface NSTimeZone (GTTimeAdditions) // The difference, in minutes, between the current default timezone and GMT. @property (nonatomic, readonly) int gt_gitTimeOffset; @end
// // NSDate+GTTimeAdditions.h // ObjectiveGitFramework // // Created by Danny Greg on 27/03/2013. // Copyright (c) 2013 GitHub, Inc. All rights reserved. // #import <Foundation/Foundation.h> #import "git2.h" @interface NSDate (GTTimeAdditions) // Creates a new `NSDate` from the provided `git_time`. // // time - The `git_time` to base the returned date on. // timeZone - The timezone used by the time passed in. Optional. // // Returns an `NSDate` object representing the passed in `time`. + (NSDate *)gt_dateFromGitTime:(git_time)time timeZone:(NSTimeZone **)timeZone; // Converts the date to a `git_time`. // // timeZone - An `NSTimeZone` to describe the time offset. This is optional, if // `nil` the default time zone will be used. - (git_time)gt_gitTimeUsingTimeZone:(NSTimeZone *)timeZone; @end @interface NSTimeZone (GTTimeAdditions) // The difference, in minutes, between the current default timezone and GMT. @property (nonatomic, readonly) int gt_gitTimeOffset; @end
Document the timeZone as being optional.
Document the timeZone as being optional.
C
mit
tiennou/objective-git,blackpixel/objective-git,misterfifths/objective-git,javiertoledo/objective-git,Acidburn0zzz/objective-git,0x4a616e/objective-git,phatblat/objective-git,nerdishbynature/objective-git,TOMalley104/objective-git,c9s/objective-git,misterfifths/objective-git,javiertoledo/objective-git,c9s/objective-git,pietbrauer/objective-git,Acidburn0zzz/objective-git,0x4a616e/objective-git,misterfifths/objective-git,tiennou/objective-git,blackpixel/objective-git,dleehr/objective-git,blackpixel/objective-git,alehed/objective-git,nerdishbynature/objective-git,libgit2/objective-git,libgit2/objective-git,TOMalley104/objective-git,phatblat/objective-git,slavikus/objective-git,c9s/objective-git,javiertoledo/objective-git,libgit2/objective-git,Acidburn0zzz/objective-git,slavikus/objective-git,alehed/objective-git,0x4a616e/objective-git,dleehr/objective-git,c9s/objective-git,misterfifths/objective-git,dleehr/objective-git,alehed/objective-git,pietbrauer/objective-git,TOMalley104/objective-git,tiennou/objective-git,slavikus/objective-git,phatblat/objective-git,javiertoledo/objective-git,libgit2/objective-git,TOMalley104/objective-git,nerdishbynature/objective-git,dleehr/objective-git,pietbrauer/objective-git,blackpixel/objective-git,pietbrauer/objective-git,Acidburn0zzz/objective-git
6c1897af9f323a22cf53a195a12168e42985c62e
smallrl.c
smallrl.c
#include <stdlib.h> #include <curses.h> #include <time.h> #include "game.h" #include "ui.h" static void shutdown(void); int main(int argc, char ** argv) { srand(time(NULL)); initscr(); cbreak(); noecho(); curs_set(0); keypad(stdscr, TRUE); start_color(); init_pair(color_black, COLOR_BLACK, COLOR_BLACK); init_pair(color_yellow, COLOR_YELLOW, COLOR_BLACK); init_pair(color_blue, COLOR_BLUE, COLOR_BLACK); init_pair(color_red, COLOR_RED, COLOR_BLACK); init_pair(color_green, COLOR_GREEN, COLOR_BLACK); init_pair(color_cyan, COLOR_CYAN, COLOR_BLACK); init_pair(color_magenta, COLOR_MAGENTA, COLOR_BLACK); if (LINES < 24 || COLS < 80) { shutdown(); printf("Terminal too small."); exit(1); } do { erase(); new_game(); } while (play()); shutdown(); return 0; } static void shutdown(void) { endwin(); return; }
#include <stdlib.h> #include <curses.h> #include <time.h> #include "game.h" #include "ui.h" static void shutdown(void); int main(int argc, char ** argv) { time_t random_seed = time(NULL); printf("Random game #%ld\n", random_seed); srand(random_seed); initscr(); cbreak(); noecho(); curs_set(0); keypad(stdscr, TRUE); start_color(); init_pair(color_black, COLOR_BLACK, COLOR_BLACK); init_pair(color_yellow, COLOR_YELLOW, COLOR_BLACK); init_pair(color_blue, COLOR_BLUE, COLOR_BLACK); init_pair(color_red, COLOR_RED, COLOR_BLACK); init_pair(color_green, COLOR_GREEN, COLOR_BLACK); init_pair(color_cyan, COLOR_CYAN, COLOR_BLACK); init_pair(color_magenta, COLOR_MAGENTA, COLOR_BLACK); if (LINES < 24 || COLS < 80) { shutdown(); printf("Terminal too small."); exit(1); } do { erase(); new_game(); } while (play()); shutdown(); return 0; } static void shutdown(void) { endwin(); return; }
Print random seed for sharing / debugging purposes
Print random seed for sharing / debugging purposes
C
bsd-2-clause
happyponyland/smallrl,happyponyland/smallrl,happyponyland/smallrl
608e78d43eb205fd6bb4755c5495a7d1460a159b
src/tgl.c
src/tgl.c
/* Main program for TGL (Text Generation Language). */ #include <stdio.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <fcntl.h> int main(int argc, char** argv) { printf("hello world\n"); return 0; }
/* Main program for TGL (Text Generation Language). */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <time.h> #include <unistd.h> #include <sys/types.h> #include <sys/wait.h> #include <fcntl.h> /* BEGIN: String handling (strings may have NUL bytes within, and are not * NUL-terminated). */ /* Defines a length-prefixed string. * The string contents start at the byte after the struct itself. */ typedef struct string { unsigned len; }* string; typedef unsigned char byte; /* Returns a pointer to the beginning of character data of the given string. */ static inline byte* string_data(string s) { byte* c = (byte*)s; return c + sizeof(struct string); } /* Converts a C string to a TGL string. * The string must be free()d by the caller. */ static string covert_string(char* str) { unsigned int len = strlen(str); string result = malloc(sizeof(struct string) + len); result->len = len; memcpy(string_data(result), str, len); return result; } /* Duplicates the given TGL string. * The string must be free()d by the caller. */ static string dupe_string(string str) { string result = malloc(sizeof(struct string) + str->len); memcpy(result, str, sizeof(struct string) + str->len); return result; } /* END: String handling */ int main(int argc, char** argv) { printf("hello world\n"); return 0; }
Add length-prefixed string handling functions.
Add length-prefixed string handling functions.
C
bsd-3-clause
AltSysrq/tgl,AltSysrq/tgl
536df7c46c031adf1591ed44b5c51c905422e63f
BBBAPI/BBBAPI/Classes/BBASearchSuggestionsResult.h
BBBAPI/BBBAPI/Classes/BBASearchSuggestionsResult.h
// // BBASearchSuggestionsResult.h // BBBAPI // // Created by Owen Worley on 12/01/2015. // Copyright (c) 2015 Blinkbox Entertainment Ltd. All rights reserved. // #import <Foundation/Foundation.h> @class FEMObjectMapping; /** * Represents data returned from the book search suggestions service (search/suggestions) */ @interface BBASearchSuggestionsResult : NSObject @property (nonatomic, copy) NSString *type; @property (nonatomic, copy) NSArray *items; /** * Describes the mapping of server search result data to `BBASearchSuggestionsResult` */ + (FEMObjectMapping *) searchSuggestionsResultMapping; @end
// // BBASearchSuggestionsResult.h // BBBAPI // // Created by Owen Worley on 12/01/2015. // Copyright (c) 2015 Blinkbox Entertainment Ltd. All rights reserved. // #import <Foundation/Foundation.h> @class FEMObjectMapping; /** * Represents data returned from the book search suggestions service (search/suggestions) */ @interface BBASearchSuggestionsResult : NSObject @property (nonatomic, copy) NSString *type; /** * Contains `BBASearchServiceSuggestion` objects */ @property (nonatomic, copy) NSArray *items; /** * Describes the mapping of server search result data to `BBASearchSuggestionsResult` */ + (FEMObjectMapping *) searchSuggestionsResultMapping; @end
Document contents of items array
Document contents of items array
C
mit
blinkboxbooks/blinkbox-network.objc,blinkboxbooks/blinkbox-network.objc
6f81fa70bca7bbf082253c5f2e6cef5b02cb4b7d
x86_64/unix/2.2.4progamain.c
x86_64/unix/2.2.4progamain.c
#include <stdlib.h> #include <stdio.h> typedef struct Poly Poly; struct Poly { int32_t coef; int32_t abc; Poly *link; }; int add(Poly *q, Poly *p); Poly *avail; int main(int argc, char **argv) { Poly *pool, *p; pool = calloc(500, sizeof(*pool)); for(p = pool; p < pool+499; p++) p->link = p+1; p->link = NULL; avail = pool; exit(0); }
#include <stdlib.h> #include <stdio.h> #include <stdint.h> typedef struct Poly Poly; struct Poly { int32_t coef; int32_t abc; Poly *link; }; int add(Poly *q, Poly *p); Poly *avail; Poly* makepoly(void) { Poly *p; if(avail == NULL) return NULL; p = avail; avail = avail->link; p->abc = -1; p->coef = 0; p->link = p; return p; } int addterm(Poly *p, int32_t coef, unsigned char a, unsigned char b, unsigned char c) { Poly *q, *r; int32_t abc; abc = (a << 16) + (b << 8) + c; for(r = p->link; abc < r->abc; r = p->link) p = r; if(abc == r->abc) { r->coef += coef; return 0; } if(avail == NULL) return -1; q = avail; avail = avail->link; q->coef = coef; q->abc = abc; q->link = r; p->link = q; return 0; } int main(int argc, char **argv) { Poly *pool, *p; pool = calloc(500, sizeof(*pool)); for(p = pool; p < pool+499; p++) p->link = p+1; p->link = NULL; avail = pool; exit(0); }
Add infrastructure for constructing polynomials
Add infrastructure for constructing polynomials
C
isc
spewspew/TAOCP,spewspews/TAOCP
abcc32beb01e1beb2f274de94d6917d90aae0ffd
ASFFeedly/ASFRequestBuilder.h
ASFFeedly/ASFRequestBuilder.h
// // ASFRequestBuilder.h // ASFFeedly // // Created by Anton Simakov on 12/12/13. // Copyright (c) 2013 Anton Simakov. All rights reserved. // #import <Foundation/Foundation.h> extern NSURL *ASFURLByAppendingParameters(NSURL *URL, NSDictionary *parameters); extern NSString *ASFQueryFromURL(NSURL *URL); extern NSString *ASFQueryFromParameters(NSDictionary *parameters); extern NSString *ASFURLEncodedString(NSString *string); extern NSString *ASFURLDecodedString(NSString *string); extern NSDictionary *ASFParametersFromQuery(NSString *query); @interface ASFRequestBuilder : NSObject + (NSMutableURLRequest *)requestWithMethod:(NSString *)method URLString:(NSString *)URLString parameters:(NSDictionary *)parameters token:(NSString *)token error:(NSError *__autoreleasing *)error; + (NSMutableURLRequest *)requestWithURL:(NSURL *)URL method:(NSString *)method parameters:(NSDictionary *)parameters error:(NSError *__autoreleasing *)error; @end
// // ASFRequestBuilder.h // ASFFeedly // // Created by Anton Simakov on 12/12/13. // Copyright (c) 2013 Anton Simakov. All rights reserved. // #import <Foundation/Foundation.h> extern NSURL *ASFURLByAppendingParameters(NSURL *URL, NSDictionary *parameters); extern NSString *ASFQueryFromURL(NSURL *URL); extern NSString *ASFQueryFromParameters(NSDictionary *parameters); extern NSString *ASFURLEncodedString(NSString *string); extern NSString *ASFURLDecodedString(NSString *string); extern NSDictionary *ASFParametersFromQuery(NSString *query); @interface ASFRequestBuilder : NSObject + (NSMutableURLRequest *)requestWithMethod:(NSString *)method URLString:(NSString *)URLString parameters:(NSDictionary *)parameters token:(NSString *)token error:(NSError *__autoreleasing *)error; @end
Remove private method from the public interface
Remove private method from the public interface
C
mit
anton-simakov/ASFeedly
7e4e4f0f7ea96059d18b65ffa9fcc3d6f9a5bce3
OCCommunicationLib/OCCommunicationLib/OCErrorMsg.h
OCCommunicationLib/OCCommunicationLib/OCErrorMsg.h
// // OCErrorMsg.h // Owncloud iOs Client // // Copyright (c) 2014 ownCloud (http://www.owncloud.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // 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. // #define kOCErrorServerUnauthorized 401 #define kOCErrorServerForbidden 403 #define kOCErrorServerPathNotFound 404 #define kOCErrorProxyAuth 407 #define kOCErrorServerTimeout 408
// // OCErrorMsg.h // Owncloud iOs Client // // Copyright (c) 2014 ownCloud (http://www.owncloud.org/) // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // 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. // #define kOCErrorServerUnauthorized 401 #define kOCErrorServerForbidden 403 #define kOCErrorServerPathNotFound 404 #define kOCErrorServerMethodNotPermitted 405c #define kOCErrorProxyAuth 407 #define kOCErrorServerTimeout 408
Add error constant for not permmited methods in the server
Add error constant for not permmited methods in the server
C
mit
blueseaguo/ios-library,pd81999/ios-library,owncloud/ios-library
a4d60fe0ef77abcc9d91cdca0c6f276e5a7fb627
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
cinnamoncoin/Feathercoin,nanocoins/mycoin,nanocoins/mycoin,cinnamoncoin/Feathercoin,saydulk/Feathercoin,cinnamoncoin/Feathercoin,nanocoins/mycoin,ghostlander/Feathercoin,enlighter/Feathercoin,saydulk/Feathercoin,cqtenq/Feathercoin,enlighter/Feathercoin,cqtenq/Feathercoin,cinnamoncoin/Feathercoin,nanocoins/mycoin,ghostlander/Feathercoin,enlighter/Feathercoin,ghostlander/Feathercoin,nanocoins/mycoin,enlighter/Feathercoin,cinnamoncoin/Feathercoin,ghostlander/Feathercoin,ghostlander/Feathercoin,enlighter/Feathercoin,cqtenq/Feathercoin,saydulk/Feathercoin,saydulk/Feathercoin,cqtenq/Feathercoin,cqtenq/Feathercoin,saydulk/Feathercoin
c756758fa6f074ca17423326c40c6e298184d997
eval/src/vespa/eval/tensor/test/test_utils.h
eval/src/vespa/eval/tensor/test/test_utils.h
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/eval/eval/tensor_spec.h> #include <vespa/eval/tensor/default_tensor_engine.h> #include <vespa/vespalib/testkit/test_kit.h> namespace vespalib::tensor::test { template <typename T> std::unique_ptr<T> makeTensor(const vespalib::eval::TensorSpec &spec) { auto value = DefaultTensorEngine::ref().from_spec(spec); const T *tensor = dynamic_cast<const T *>(value->as_tensor()); ASSERT_TRUE(tensor); value.release(); return std::unique_ptr<T>(const_cast<T *>(tensor)); } }
// Copyright 2019 Oath Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. #pragma once #include <vespa/eval/eval/tensor_spec.h> #include <vespa/eval/tensor/default_tensor_engine.h> #include <vespa/vespalib/testkit/test_kit.h> namespace vespalib::tensor::test { template <typename T> std::unique_ptr<const T> makeTensor(const vespalib::eval::TensorSpec &spec) { auto value = DefaultTensorEngine::ref().from_spec(spec); const T *tensor = dynamic_cast<const T *>(value->as_tensor()); ASSERT_TRUE(tensor); value.release(); return std::unique_ptr<const T>(tensor); } }
Return unique pointer to const tensor instead.
Return unique pointer to const tensor instead.
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
fc819be192e956dcd856f6ca7032d766d1b4a6e3
Utilities/ParseOGLExt/Tokenizer.h
Utilities/ParseOGLExt/Tokenizer.h
/*========================================================================= Program: Visualization Toolkit Module: Tokenizer.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ /* * Copyright 2003 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the * U.S. Government. Redistribution and use in source and binary forms, with * or without modification, are permitted provided that this Notice and any * statement of authorship are reproduced on all copies. */ #include <vtkstd/string> class Tokenizer { public: Tokenizer(const char *s, const char *delim = " \t\n"); Tokenizer(const vtkstd::string &s, const char *delim = " \t\n"); vtkstd::string GetNextToken(); vtkstd::string GetRemainingString() const; bool HasMoreTokens() const; void Reset(); private: vtkstd::string FullString; vtkstd::string Delim; vtkstd::string::size_type Position; };
/*========================================================================= Program: Visualization Toolkit Module: Tokenizer.h Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen All rights reserved. See Copyright.txt or http://www.kitware.com/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notice for more information. =========================================================================*/ /* * Copyright 2003 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the * U.S. Government. Redistribution and use in source and binary forms, with * or without modification, are permitted provided that this Notice and any * statement of authorship are reproduced on all copies. */ #include <vtkstd/string> class Tokenizer { public: Tokenizer(const char *s, const char *delim = " \t\n\r"); Tokenizer(const vtkstd::string &s, const char *delim = " \t\n\r"); vtkstd::string GetNextToken(); vtkstd::string GetRemainingString() const; bool HasMoreTokens() const; void Reset(); private: vtkstd::string FullString; vtkstd::string Delim; vtkstd::string::size_type Position; };
Add carriage return to the list of default delimiters to correctly handle "windows-style" end of line on "unix-style" systems.
BUG: Add carriage return to the list of default delimiters to correctly handle "windows-style" end of line on "unix-style" systems.
C
bsd-3-clause
candy7393/VTK,mspark93/VTK,spthaolt/VTK,biddisco/VTK,demarle/VTK,aashish24/VTK-old,gram526/VTK,spthaolt/VTK,ashray/VTK-EVM,naucoin/VTKSlicerWidgets,spthaolt/VTK,aashish24/VTK-old,mspark93/VTK,Wuteyan/VTK,johnkit/vtk-dev,sgh/vtk,jmerkow/VTK,keithroe/vtkoptix,gram526/VTK,johnkit/vtk-dev,spthaolt/VTK,ashray/VTK-EVM,sankhesh/VTK,gram526/VTK,candy7393/VTK,hendradarwin/VTK,keithroe/vtkoptix,sankhesh/VTK,gram526/VTK,daviddoria/PointGraphsPhase1,hendradarwin/VTK,mspark93/VTK,msmolens/VTK,demarle/VTK,sumedhasingla/VTK,Wuteyan/VTK,aashish24/VTK-old,hendradarwin/VTK,naucoin/VTKSlicerWidgets,hendradarwin/VTK,jeffbaumes/jeffbaumes-vtk,jmerkow/VTK,spthaolt/VTK,ashray/VTK-EVM,gram526/VTK,sgh/vtk,jeffbaumes/jeffbaumes-vtk,jmerkow/VTK,johnkit/vtk-dev,mspark93/VTK,keithroe/vtkoptix,collects/VTK,arnaudgelas/VTK,naucoin/VTKSlicerWidgets,arnaudgelas/VTK,Wuteyan/VTK,sgh/vtk,daviddoria/PointGraphsPhase1,naucoin/VTKSlicerWidgets,demarle/VTK,demarle/VTK,hendradarwin/VTK,cjh1/VTK,jmerkow/VTK,biddisco/VTK,mspark93/VTK,collects/VTK,aashish24/VTK-old,biddisco/VTK,daviddoria/PointGraphsPhase1,biddisco/VTK,spthaolt/VTK,candy7393/VTK,biddisco/VTK,daviddoria/PointGraphsPhase1,gram526/VTK,collects/VTK,ashray/VTK-EVM,jmerkow/VTK,Wuteyan/VTK,berendkleinhaneveld/VTK,biddisco/VTK,johnkit/vtk-dev,jmerkow/VTK,cjh1/VTK,sgh/vtk,jmerkow/VTK,Wuteyan/VTK,msmolens/VTK,collects/VTK,demarle/VTK,msmolens/VTK,sgh/vtk,cjh1/VTK,msmolens/VTK,sumedhasingla/VTK,SimVascular/VTK,sankhesh/VTK,aashish24/VTK-old,berendkleinhaneveld/VTK,candy7393/VTK,gram526/VTK,berendkleinhaneveld/VTK,sankhesh/VTK,keithroe/vtkoptix,sumedhasingla/VTK,cjh1/VTK,daviddoria/PointGraphsPhase1,candy7393/VTK,SimVascular/VTK,ashray/VTK-EVM,Wuteyan/VTK,aashish24/VTK-old,SimVascular/VTK,candy7393/VTK,daviddoria/PointGraphsPhase1,msmolens/VTK,sankhesh/VTK,sumedhasingla/VTK,sumedhasingla/VTK,SimVascular/VTK,jmerkow/VTK,keithroe/vtkoptix,berendkleinhaneveld/VTK,jeffbaumes/jeffbaumes-vtk,candy7393/VTK,msmolens/VTK,ashray/VTK-EVM,keithroe/vtkoptix,cjh1/VTK,demarle/VTK,demarle/VTK,keithroe/vtkoptix,sankhesh/VTK,johnkit/vtk-dev,ashray/VTK-EVM,mspark93/VTK,jeffbaumes/jeffbaumes-vtk,biddisco/VTK,johnkit/vtk-dev,sumedhasingla/VTK,demarle/VTK,collects/VTK,cjh1/VTK,mspark93/VTK,ashray/VTK-EVM,arnaudgelas/VTK,jeffbaumes/jeffbaumes-vtk,SimVascular/VTK,arnaudgelas/VTK,msmolens/VTK,spthaolt/VTK,berendkleinhaneveld/VTK,candy7393/VTK,Wuteyan/VTK,arnaudgelas/VTK,gram526/VTK,SimVascular/VTK,berendkleinhaneveld/VTK,hendradarwin/VTK,arnaudgelas/VTK,berendkleinhaneveld/VTK,keithroe/vtkoptix,SimVascular/VTK,sankhesh/VTK,hendradarwin/VTK,SimVascular/VTK,sgh/vtk,naucoin/VTKSlicerWidgets,mspark93/VTK,sankhesh/VTK,collects/VTK,sumedhasingla/VTK,sumedhasingla/VTK,msmolens/VTK,jeffbaumes/jeffbaumes-vtk,naucoin/VTKSlicerWidgets,johnkit/vtk-dev
70cb60b7ed2a04f3054cffda01b961decbf0827a
edXVideoLocker/OEXRegistrationFieldValidator.h
edXVideoLocker/OEXRegistrationFieldValidator.h
// // OEXRegistrationFieldValidation.h // edXVideoLocker // // Created by Jotiram Bhagat on 03/03/15. // Copyright (c) 2015 edX. All rights reserved. // #import <Foundation/Foundation.h> #import "OEXRegistrationFormField.h" @interface OEXRegistrationFieldValidator : NSObject +(NSString *)validateField:(OEXRegistrationFormField *)field withText:(NSString *)currentValue; @end
// // OEXRegistrationFieldValidation.h // edXVideoLocker // // Created by Jotiram Bhagat on 03/03/15. // Copyright (c) 2015 edX. All rights reserved. // #import <Foundation/Foundation.h> #import "OEXRegistrationFormField.h" @interface OEXRegistrationFieldValidator : NSObject /// Returns an error string, or nil if no error +(NSString *)validateField:(OEXRegistrationFormField *)field withText:(NSString *)currentValue; @end
Add comment for validation method
Add comment for validation method
C
apache-2.0
appsembler/edx-app-ios,chinlam91/edx-app-ios,chinlam91/edx-app-ios,appsembler/edx-app-ios,proversity-org/edx-app-ios,yrchen/edx-app-ios,Ben21hao/edx-app-ios-enterprise-new,nagyistoce/edx-app-ios,ehmadzubair/edx-app-ios,edx/edx-app-ios,knehez/edx-app-ios,edx/edx-app-ios,edx/edx-app-ios,keyeMyria/edx-app-ios,edx/edx-app-ios,proversity-org/edx-app-ios,ehmadzubair/edx-app-ios,Ben21hao/edx-app-ios-new,lovehhf/edx-app-ios,edx/edx-app-ios,yrchen/edx-app-ios,proversity-org/edx-app-ios,nagyistoce/edx-app-ios,lovehhf/edx-app-ios,edx/edx-app-ios,adoosii/edx-app-ios,ehmadzubair/edx-app-ios,appsembler/edx-app-ios,keyeMyria/edx-app-ios,nagyistoce/edx-app-ios,edx/edx-app-ios,adoosii/edx-app-ios,knehez/edx-app-ios,proversity-org/edx-app-ios,proversity-org/edx-app-ios,Ben21hao/edx-app-ios-enterprise-new,proversity-org/edx-app-ios,adoosii/edx-app-ios,yrchen/edx-app-ios,nagyistoce/edx-app-ios,Ben21hao/edx-app-ios-enterprise-new,Ben21hao/edx-app-ios-new,Ben21hao/edx-app-ios-enterprise-new,knehez/edx-app-ios,chinlam91/edx-app-ios,Ben21hao/edx-app-ios-new,appsembler/edx-app-ios,lovehhf/edx-app-ios,ehmadzubair/edx-app-ios,knehez/edx-app-ios,chinlam91/edx-app-ios,keyeMyria/edx-app-ios,Ben21hao/edx-app-ios-enterprise-new,keyeMyria/edx-app-ios,appsembler/edx-app-ios,nagyistoce/edx-app-ios,adoosii/edx-app-ios,Ben21hao/edx-app-ios-new,knehez/edx-app-ios,Ben21hao/edx-app-ios-new,lovehhf/edx-app-ios
d695d87aaabe6bb8e2ca2ba8f1db45d4a62dc7c9
FUState.h
FUState.h
#ifndef FUSTATE_H #define FUSTATE_H #include <SFML/Window/Event.hpp> #include <SFML/System/Time.hpp> #include <SFML/Graphics/RenderWindow.hpp> #include <memory> class FUStateManager; class FUState { public: struct FUContext { FUContext(std::shared_ptr<sf::RenderWindow> window) : renderWindow(window) {} std::shared_ptr<sf::RenderWindow> renderWindow; }; public: FUState(FUContext context); virtual ~FUState(); virtual void handleEvent(sf::Event &event); virtual void update(sf::Time dt); virtual void draw(); virtual void pause(); virtual void resume(); protected: bool mIsPaused; }; #endif // FUSTATE_H
#ifndef FUSTATE_H #define FUSTATE_H #include <SFML/Window/Event.hpp> #include <SFML/System/Time.hpp> #include <SFML/Graphics/RenderWindow.hpp> #include <memory> class FUState { public: struct FUContext { FUContext(std::shared_ptr<sf::RenderWindow> window) : renderWindow(window) {} std::shared_ptr<sf::RenderWindow> renderWindow; }; public: FUState(FUContext context); virtual ~FUState(); virtual void handleEvent(sf::Event &event); virtual void update(sf::Time dt); virtual void draw(); virtual void pause(); virtual void resume(); protected: bool mIsPaused; }; #endif // FUSTATE_H
Delete an unnecessary forward decleration
Delete an unnecessary forward decleration
C
unlicense
Furkanzmc/StateManager
94ed2e430b1180c296f7dcb327296c64d6260daa
fmacros.h
fmacros.h
#ifndef __HIREDIS_FMACRO_H #define __HIREDIS_FMACRO_H #if defined(__linux__) #define _BSD_SOURCE #define _DEFAULT_SOURCE #endif #if defined(__CYGWIN__) #include <sys/cdefs.h> #endif #if defined(__sun__) #define _POSIX_C_SOURCE 200112L #else #if !(defined(__APPLE__) && defined(__MACH__)) && !(defined(__FreeBSD__)) #define _XOPEN_SOURCE 600 #endif #endif #if defined(__APPLE__) && defined(__MACH__) #define _OSX #endif #endif
#ifndef __HIREDIS_FMACRO_H #define __HIREDIS_FMACRO_H #if defined(__linux__) #define _BSD_SOURCE #define _DEFAULT_SOURCE #endif #if defined(__CYGWIN__) #include <sys/cdefs.h> #endif #if defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) #define _XOPEN_SOURCE 600 #elif defined(__APPLE__) && defined(__MACH__) #define _XOPEN_SOURCE #elif defined(__FreeBSD__) // intentionally left blank, don't define _XOPEN_SOURCE #else #define _XOPEN_SOURCE #endif #if defined(__sun__) #define _POSIX_C_SOURCE 200112L #endif #if defined(__APPLE__) && defined(__MACH__) #define _OSX #endif #endif
Make XOPEN_SOURCE definition explicit per architecture
Make XOPEN_SOURCE definition explicit per architecture Fixes #441
C
bsd-3-clause
charsyam/hiredis,redis/hiredis,thomaslee/hiredis,jinguoli/hiredis,jinguoli/hiredis,jinguoli/hiredis,redis/hiredis,thomaslee/hiredis,redis/hiredis,charsyam/hiredis
33ce733a70bf89570454a161a64adb56da57a0f3
Settings/Tabs/SettingsTab.h
Settings/Tabs/SettingsTab.h
#pragma once #include "../Controls/Controls.h" #include "../Controls/TabPage.h" /// <summary> /// Abstract class that encapsulates functionality for dealing with /// property sheet pages (tabs). /// </summary> class SettingsTab : public TabPage { public: SettingsTab(HINSTANCE hInstance, LPCWSTR tabTemplate, LPCWSTR title = L""); ~SettingsTab(); /// <summary>Processes messages sent to the tab page.</summary> virtual INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); /// <summary>Persists changes made on the tab page</summary> virtual void SaveSettings() = 0; protected: /// <summary> /// Performs intitialization for the tab page, similar to a constructor. /// Since tab page windows are created on demand, this method could be /// called much later than the constructor for the tab. /// </summary> virtual void Initialize() = 0; /// <summary>Applies the current settings state to the tab page.</summary> virtual void LoadSettings() = 0; };
#pragma once #include "../Controls/Controls.h" #include "../Controls/TabPage.h" #include "../resource.h" /// <summary> /// Abstract class that encapsulates functionality for dealing with /// property sheet pages (tabs). /// </summary> class SettingsTab : public TabPage { public: SettingsTab(HINSTANCE hInstance, LPCWSTR tabTemplate, LPCWSTR title = L""); ~SettingsTab(); /// <summary>Processes messages sent to the tab page.</summary> virtual INT_PTR CALLBACK DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam); /// <summary>Persists changes made on the tab page</summary> virtual void SaveSettings() = 0; protected: /// <summary> /// Performs intitialization for the tab page, similar to a constructor. /// Since tab page windows are created on demand, this method could be /// called much later than the constructor for the tab. /// </summary> virtual void Initialize() = 0; /// <summary>Applies the current settings state to the tab page.</summary> virtual void LoadSettings() = 0; };
Include dialog resources to make things easier
Include dialog resources to make things easier
C
bsd-2-clause
malensek/3RVX,malensek/3RVX,malensek/3RVX
1faf4681396ca217899ace40a2b60b04a2a8e3c3
config.h
config.h
#ifndef THM_CONFIG_HG #define THM_CONFIG_HG // Vertex ID type // # of vertices < MAX(thm_Vid) typedef unsigned long thm_Vid; // Arc reference type // # of arcs in any digraph <= MAX(thm_Arcref) typedef unsigned long thm_Arcref; // Block label type // # of blocks < MAX(thm_Blklab) typedef unsigned long thm_Blklab; #endif
#ifndef THM_CONFIG_HG #define THM_CONFIG_HG // Block label type (must be unsigned) // # of blocks <= MAX(thm_Blklab) typedef uint32_t thm_Blklab; #endif
Move typedef to digraph header
Move typedef to digraph header
C
lgpl-2.1
fsavje/scclust,fsavje/scclust,fsavje/scclust
e8a46c51e607caedec168f26c73595fed10b3afb
lib/shared/mem.h
lib/shared/mem.h
#ifndef MEM_H__ #define MEM_H__ #include <stdlib.h> void *xmalloc (size_t size); void *xcalloc (size_t count, size_t size); void *xrealloc (void *ptr, size_t size); char *xstralloc (size_t len); void *xmemdupz (const void *data, size_t len); char *xstrndup (const char *str, size_t len); void xfree (void *ptr); void xmemreport (void); #endif /* MEM_H__ */ /* Local Variables: mode: C tab-width: 2 indent-tabs-mode: nil End: vim: sw=2:sts=2:expandtab */
#ifndef MEM_H__ #define MEM_H__ #include <stdlib.h> void *xmalloc (size_t size); void *xcalloc (size_t count, size_t size); void *xrealloc (void *ptr, size_t size); char *xstralloc (size_t len); void *xmemdupz (const void *data, size_t len); char *xstrndup (const char *str, size_t len); void xfree (void *ptr); size_t xmembytes(); size_t xmemnew(); size_t xmemfreed(); void xmemreport (void); #endif /* MEM_H__ */ /* Local Variables: mode: C tab-width: 2 indent-tabs-mode: nil End: vim: sw=2:sts=2:expandtab */
Add report functions for x*()
Add report functions for x*() Signed-off-by: Olivier Mehani <[email protected]>
C
mit
lees0414/EUproject,mytestbed/oml,mytestbed/oml,lees0414/EUproject,alco90/soml,alco90/soml,lees0414/EUproject,lees0414/EUproject,mytestbed/oml,mytestbed/oml,alco90/soml,alco90/soml,mytestbed/oml,lees0414/EUproject,alco90/soml
ee3a5993668d17a478a4e1ec7edd2f706b5bdfce
include/cpr/body.h
include/cpr/body.h
#ifndef CPR_BODY_H #define CPR_BODY_H #include <cstring> #include <initializer_list> #include <string> #include "defines.h" namespace cpr { class Body : public std::string { public: Body() = default; Body(const Body& rhs) = default; Body(Body&& rhs) = default; Body& operator=(const Body& rhs) = default; Body& operator=(Body&& rhs) = default; explicit Body(const char* raw_string) : std::string(raw_string) {} explicit Body(const char* raw_string, size_t length) : std::string(raw_string, length) {} explicit Body(size_t to_fill, char character) : std::string(to_fill, character) {} explicit Body(const std::string& std_string) : std::string(std_string) {} explicit Body(const std::string& std_string, size_t position, size_t length = std::string::npos) : std::string(std_string, position, length) {} explicit Body(std::initializer_list<char> il) : std::string(il) {} template <class InputIterator> explicit Body(InputIterator first, InputIterator last) : std::string(first, last) {} }; } // namespace cpr #endif
#ifndef CPR_BODY_H #define CPR_BODY_H #include <cstring> #include <initializer_list> #include <string> #include "defines.h" namespace cpr { class Body : public std::string { public: Body() = default; Body(const Body& rhs) = default; Body(Body&& rhs) = default; Body& operator=(const Body& rhs) = default; Body& operator=(Body&& rhs) = default; explicit Body(const char* raw_string) : std::string(raw_string) {} explicit Body(const char* raw_string, size_t length) : std::string(raw_string, length) {} explicit Body(size_t to_fill, char character) : std::string(to_fill, character) {} explicit Body(const std::string& std_string) : std::string(std_string) {} explicit Body(const std::string& std_string, size_t position, size_t length = std::string::npos) : std::string(std_string, position, length) {} explicit Body(std::string&& std_string) : std::string(std::move(std_string)) {} explicit Body(std::initializer_list<char> il) : std::string(il) {} template <class InputIterator> explicit Body(InputIterator first, InputIterator last) : std::string(first, last) {} }; } // namespace cpr #endif
Move constructor from std::string for cpr::Body
Move constructor from std::string for cpr::Body Currently it uses only copy-stors.
C
mit
whoshuu/cpr,whoshuu/cpr,whoshuu/cpr
b1de9c948f9794db97ed7d34b8cbcdccc206ea77
src/gallium/drivers/nv30/nv30_clear.c
src/gallium/drivers/nv30/nv30_clear.c
#include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" #include "nv30_context.h" void nv30_clear(struct pipe_context *pipe, struct pipe_surface *ps, unsigned clearValue) { pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue); }
#include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_state.h" #include "nv30_context.h" void nv30_clear(struct pipe_context *pipe, struct pipe_surface *ps, unsigned clearValue) { pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue); ps->status = PIPE_SURFACE_STATUS_CLEAR; }
Set pipe status on clear
nv30: Set pipe status on clear
C
mit
metora/MesaGLSLCompiler,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,KTXSoftware/glsl2agal,mcanthony/glsl-optimizer,tokyovigilante/glsl-optimizer,adobe/glsl2agal,tokyovigilante/glsl-optimizer,wolf96/glsl-optimizer,bkaradzic/glsl-optimizer,zz85/glsl-optimizer,djreep81/glsl-optimizer,djreep81/glsl-optimizer,benaadams/glsl-optimizer,zeux/glsl-optimizer,benaadams/glsl-optimizer,benaadams/glsl-optimizer,zz85/glsl-optimizer,zeux/glsl-optimizer,dellis1972/glsl-optimizer,adobe/glsl2agal,wolf96/glsl-optimizer,benaadams/glsl-optimizer,tokyovigilante/glsl-optimizer,tokyovigilante/glsl-optimizer,KTXSoftware/glsl2agal,wolf96/glsl-optimizer,bkaradzic/glsl-optimizer,adobe/glsl2agal,jbarczak/glsl-optimizer,adobe/glsl2agal,bkaradzic/glsl-optimizer,wolf96/glsl-optimizer,djreep81/glsl-optimizer,bkaradzic/glsl-optimizer,zeux/glsl-optimizer,metora/MesaGLSLCompiler,zeux/glsl-optimizer,KTXSoftware/glsl2agal,jbarczak/glsl-optimizer,dellis1972/glsl-optimizer,mapbox/glsl-optimizer,metora/MesaGLSLCompiler,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,dellis1972/glsl-optimizer,mcanthony/glsl-optimizer,zeux/glsl-optimizer,mapbox/glsl-optimizer,KTXSoftware/glsl2agal,benaadams/glsl-optimizer,benaadams/glsl-optimizer,djreep81/glsl-optimizer,djreep81/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,bkaradzic/glsl-optimizer,tokyovigilante/glsl-optimizer,mcanthony/glsl-optimizer,wolf96/glsl-optimizer,jbarczak/glsl-optimizer,zz85/glsl-optimizer,adobe/glsl2agal,zz85/glsl-optimizer,jbarczak/glsl-optimizer,mapbox/glsl-optimizer,zz85/glsl-optimizer,mapbox/glsl-optimizer,KTXSoftware/glsl2agal,jbarczak/glsl-optimizer
22c6aa126d7d88b4e19c64418aeecdc6cc032233
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 85 #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 86 #endif
Update Skia milestone to 86
Update Skia milestone to 86 Change-Id: Id81c58007f74816a8c2ac0831d61c041c5a7468c Reviewed-on: https://skia-review.googlesource.com/c/skia/+/298916 Reviewed-by: Heather Miller <[email protected]>
C
bsd-3-clause
google/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,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,aosp-mirror/platform_external_skia,google/skia,google/skia
03186dd5ad61d9d9bc366ec5e23e313910ddb48f
sigaltstack.c
sigaltstack.c
#include <stdio.h> #include <signal.h> #include <unistd.h> #include <assert.h> #include <stdlib.h> #include <setjmp.h> jmp_buf try; void handler(int sig) { static int i = 0; write(2, "stack overflow\n", 15); longjmp(try, ++i); _exit(1); } unsigned recurse(unsigned x) { return recurse(x)+1; } int main() { static char stack[SIGSTKSZ]; stack_t ss = { .ss_size = SIGSTKSZ, .ss_sp = stack, }; struct sigaction sa = { .sa_handler = handler, .sa_flags = SA_ONSTACK }; sigaltstack(&ss, 0); sigfillset(&sa.sa_mask); sigaction(SIGSEGV, &sa, 0); if (setjmp(try) < 3) { recurse(0); } else { printf("caught exception!\n"); } return 0; }
#include <stdio.h> #include <signal.h> #include <unistd.h> #include <assert.h> #include <stdlib.h> #include <setjmp.h> jmp_buf try; void handler(int sig) { static int i = 0; write(2, "stack overflow\n", 15); longjmp(try, ++i); _exit(1); } unsigned recurse(unsigned x) { return recurse(x)+1; } int main() { char* stack; stack = malloc(sizeof(stack) * SIGSTKSZ); stack_t ss = { .ss_size = SIGSTKSZ, .ss_sp = stack, }; struct sigaction sa = { .sa_handler = handler, .sa_flags = SA_ONSTACK }; sigaltstack(&ss, 0); sigfillset(&sa.sa_mask); sigaction(SIGSEGV, &sa, 0); if (setjmp(try) < 3) { recurse(0); } else { printf("caught exception!\n"); } return 0; }
Put alternate stack on heap
Put alternate stack on heap
C
apache-2.0
danluu/setjmp-longjmp-ucontext-snippets,danluu/setjmp-longjmp-ucontext-snippets
4222e15ceb2f64cbc517d8290d2c8fb7c2a6b178
include/patts/admin.h
include/patts/admin.h
/* * libpatts - Backend library for PATTS Ain't Time Tracking Software * Copyright (C) 2014 Delwink, LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DELWINK_PATTS_ADMIN_H #define DELWINK_PATTS_ADMIN_H #include <cquel.h> #ifdef __cplusplus extern "C" { #endif int patts_create_user(const struct dlist *info, const char *host, const char *passwd); int patts_create_task(const struct dlist *info); int patts_enable_user(const char *id); int patts_enable_task(const char *id); int patts_disable_user(const char *id); int patts_disable_task(const char *id); int patts_grant_admin(const char *id); int patts_revoke_admin(const char *id); #ifdef __cplusplus } #endif #endif
/* * libpatts - Backend library for PATTS Ain't Time Tracking Software * Copyright (C) 2014 Delwink, LLC * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation. * * This program 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 Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef DELWINK_PATTS_ADMIN_H #define DELWINK_PATTS_ADMIN_H #include <cquel.h> #ifdef __cplusplus extern "C" { #endif int patts_create_user(const struct dlist *info, const char *host, const char *passwd); int patts_create_task(const struct dlist *info); int patts_delete_user(const char *id); int patts_delete_task(const char *id); int patts_grant_admin(const char *id); int patts_revoke_admin(const char *id); #ifdef __cplusplus } #endif #endif
Change scope of state column
Change scope of state column
C
agpl-3.0
delwink/libpatts,delwink/libpatts
e6afdae011102bc110d072c33e2704bccc7cc6e4
utils.h
utils.h
#ifndef UTILS_H #define UTILS_H #include <string> /** \brief Convert given container to it's hex representation */ template< typename T > std::string toHex( const T& data ) { static const char charTable[] = "0123456789abcdef"; std::string ret; if ( data.size() > 1024 ) { ret = "*** LARGE *** "; for ( size_t i=0; i<40; i++ ) { ret.push_back( charTable[ ( data[i] >> 4 ) & 0xF ] ); ret.push_back( charTable[ ( data[i] >> 0 ) & 0xF ] ); } ret.append("..."); for ( size_t i=data.size()-40; i<data.size(); i++ ) { ret.push_back( charTable[ ( data[i] >> 4 ) & 0xF ] ); ret.push_back( charTable[ ( data[i] >> 0 ) & 0xF ] ); } } else { for ( const auto& val: data ) { ret.push_back( charTable[ ( val >> 4 ) & 0xF ] ); ret.push_back( charTable[ ( val >> 0 ) & 0xF ] ); } } return ret; } #endif // UTILS_H
#ifndef UTILS_H #define UTILS_H #include <string> /** \brief Convert given container to it's hex representation */ template< typename T > std::string toHex( const T& data ) { static const char charTable[] = "0123456789abcdef"; std::string ret; if ( data.size() > 80 ) { ret = "*** LARGE *** "; for ( size_t i=0; i<40; i++ ) { ret.push_back( charTable[ ( data[i] >> 4 ) & 0xF ] ); ret.push_back( charTable[ ( data[i] >> 0 ) & 0xF ] ); } ret.append("..."); for ( size_t i=data.size()-40; i<data.size(); i++ ) { ret.push_back( charTable[ ( data[i] >> 4 ) & 0xF ] ); ret.push_back( charTable[ ( data[i] >> 0 ) & 0xF ] ); } } else { for ( const auto& val: data ) { ret.push_back( charTable[ ( val >> 4 ) & 0xF ] ); ret.push_back( charTable[ ( val >> 0 ) & 0xF ] ); } } return ret; } #endif // UTILS_H
Make the hex dump size limit much smaller
Make the hex dump size limit much smaller
C
bsd-3-clause
cinode/cpptestapp,cinode/cpptestapp
67b7a13204c1505a59351de0d25eeeb51fc93e89
uranus_dp/include/uranus_dp/vortex_helper.h
uranus_dp/include/uranus_dp/vortex_helper.h
#ifndef VORTEX_HELPER_H #define VORTEX_HELPER_H #include "uranus_dp/control_mode_enum.h" inline std::string controlModeString(ControlMode control_mode) { std::string s; switch(control_mode) { case ControlModes::OPEN_LOOP: s = "Open Loop"; break; case ControlModes::SIXDOF: s = "Six DOF"; break; case ControlModes::RPY_DEPTH: s = "RPY Depth"; break; case ControlModes::DEPTH_HOLD: s = "Depth Hold"; break; default: s = "Invalid Control Mode"; break; } return s; } #endif
Write control mode to string function
Write control mode to string function
C
mit
vortexntnu/rov-control,vortexntnu/rov-control,vortexntnu/rov-control
ec43d9ca215e7e9f0ea782e26367d52c9468f7ff
src/lextest.c
src/lextest.c
#include "config.h" #include <stdio.h> #include <string.h> #include "lexicon.h" #include "hash.h" #include "array.h" #include "util.h" #include "mem.h" int main(int argc, char **argv) { lexicon_pt l=read_lexicon_file(argv[1]); char s[4000]; printf("Read %ld lexical entries.\n", (long int)hash_size(l->words)); while (fgets(s, 1000, stdin)) { word_pt w; int i, sl=strlen(s); for (sl--; sl>=0 && s[sl]=='\n'; sl--) { s[sl]='\0'; } w=hash_get(l->words, s); if (!w) { printf("No such word \"%s\".\n", s); continue; } printf("%s[%d,%s]:", s, w->defaulttag, tagname(l, w->defaulttag)); for (i=0; w->sorter[i]>0; i++) { printf("\t%s %d", (char *)array_get(l->tags, w->sorter[i]), w->tagcount[w->sorter[i]]); } printf("\n"); } /* Free the memory held by util.c. */ util_teardown(); }
#include "config.h" #include <stdio.h> #include <string.h> #include "lexicon.h" #include "hash.h" #include "array.h" #include "util.h" #include "mem.h" int main(int argc, char **argv) { lexicon_pt l=read_lexicon_file(argv[1]); char s[4000]; printf("Read %ld lexical entries.\n", (long int)hash_size(l->words)); while (fgets(s, 1000, stdin)) { word_pt w; int i, sl=strlen(s); for (sl--; sl>=0 && s[sl]=='\n'; sl--) { s[sl]='\0'; } w=hash_get(l->words, s); if (!w) { printf("No such word \"%s\".\n", s); continue; } printf("%s[%d,%s]:", s, w->defaulttag, tagname(l, w->defaulttag)); for (i=0; w->sorter[i]>0; i++) { printf("\t%s %d", (char *)array_get(l->tags, w->sorter[i]), w->tagcount[w->sorter[i]]); } printf("\n"); } /* Free the memory held by util.c. */ util_teardown(); return 0; }
Return 0 from main as it should.
Return 0 from main as it should.
C
bsd-3-clause
giuliopaci/acopost,giuliopaci/acopost,giuliopaci/acopost,giuliopaci/acopost
762f4e479e147e15cb8bed3fb0113e04279f87ae
lib/packet_queue.h
lib/packet_queue.h
#ifndef PACKET_QUEUE_H_INCLUDED__ #define PACKET_QUEUE_H_INCLUDED__ #include "radio.h" #include <stdbool.h> #define PACKET_QUEUE_SIZE 10 typedef struct { radio_packet_t * head; radio_packet_t * tail; radio_packet_t packets[PACKET_QUEUE_SIZE]; } packet_queue_t; uint32_t packet_queue_init(packet_queue_t * queue); bool packet_queue_is_empty(packet_queue_t * queue); bool packet_queue_is_full(packet_queue_t * queue); uint32_t packet_queue_add(packet_queue_t * queue, radio_packet_t * packet); uint32_t packet_queue_get(packet_queue_t * queue, radio_packet_t ** packet); #endif
#ifndef PACKET_QUEUE_H_INCLUDED__ #define PACKET_QUEUE_H_INCLUDED__ #include "radio.h" #include <stdbool.h> #define PACKET_QUEUE_SIZE 10 typedef struct { uint32_t head; uint32_t tail; radio_packet_t packets[PACKET_QUEUE_SIZE]; } packet_queue_t; uint32_t packet_queue_init(packet_queue_t * queue); bool packet_queue_is_empty(packet_queue_t * queue); bool packet_queue_is_full(packet_queue_t * queue); uint32_t packet_queue_add(packet_queue_t * queue, radio_packet_t * packet); uint32_t packet_queue_get(packet_queue_t * queue, radio_packet_t ** packet); #endif
Fix types of head and tail.
Fix types of head and tail.
C
bsd-3-clause
hlnd/nrf51-simple-radio,hlnd/nrf51-simple-radio
2b7eda48618299374655d85ed355973c93d82201
libavutil/random_seed.h
libavutil/random_seed.h
/* * Copyright (c) 2009 Baptiste Coudurier <[email protected]> * * This file is part of FFmpeg. * * FFmpeg 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. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVUTIL_RANDOM_SEED_H #define AVUTIL_RANDOM_SEED_H #include <stdint.h> /** * Gets a seed to use in conjuction with random functions. */ uint32_t ff_random_get_seed(void); #endif /* AVUTIL_RANDOM_SEED_H */
/* * Copyright (c) 2009 Baptiste Coudurier <[email protected]> * * This file is part of FFmpeg. * * FFmpeg 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. * * FFmpeg 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 FFmpeg; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef AVUTIL_RANDOM_SEED_H #define AVUTIL_RANDOM_SEED_H #include <stdint.h> /** * Gets a seed to use in conjunction with random functions. */ uint32_t ff_random_get_seed(void); #endif /* AVUTIL_RANDOM_SEED_H */
Fix typo: 'conjuction' -> 'conjunction'.
Fix typo: 'conjuction' -> 'conjunction'. git-svn-id: a4d7c1866f8397a4106e0b57fc4fbf792bbdaaaf@17989 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
C
lgpl-2.1
prajnashi/ffmpeg,prajnashi/ffmpeg,prajnashi/ffmpeg,prajnashi/ffmpeg
952aaca3d7c3be9da8487e6316721a802ab5261b
server/tests/stat-main.c
server/tests/stat-main.c
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* Copyright (C) 2015 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/>. */ /* check statistics */ #include <config.h> #include <glib.h> typedef void test_func_t(void); test_func_t stat_test1; test_func_t stat_test2; test_func_t stat_test3; test_func_t stat_test4; static test_func_t *test_funcs[] = { stat_test1, stat_test2, stat_test3, stat_test4, NULL }; int main(void) { test_func_t **func_p; for (func_p = test_funcs; *func_p; ++func_p) { (*func_p)(); } return 0; }
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */ /* Copyright (C) 2015 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/>. */ /* check statistics */ #include <config.h> #include <glib.h> typedef void test_func_t(void); test_func_t stat_test1; test_func_t stat_test2; test_func_t stat_test3; test_func_t stat_test4; static test_func_t *test_funcs[] = { stat_test1, stat_test2, stat_test3, stat_test4, NULL }; int main(void) { test_func_t **func_p; for (func_p = test_funcs; *func_p; ++func_p) { (*func_p)(); } return 0; }
Remove empty line at EOF
syntax-check: Remove empty line at EOF Acked-by: Christophe Fergeau <[email protected]>
C
lgpl-2.1
fgouget/spice,SPICE/spice,fgouget/spice,fgouget/spice,SPICE/spice,SPICE/spice,fgouget/spice
96430e414762391ff89b48b6c63c0983ff11365f
source/udc/src/udc_libusbg.c
source/udc/src/udc_libusbg.c
/* * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd. * * 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. */ #include "udc.h" #include <stdlib.h> struct gt_udc_backend gt_udc_backend_libusbg = { .udc = NULL, };
/* * Copyright (c) 2012-2015 Samsung Electronics Co., Ltd. * * 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. */ #include <stdio.h> #include <usbg/usbg.h> #include "backend.h" #include "udc.h" static int udc_func(void *data) { usbg_udc *u; const char *name; usbg_for_each_udc(u, backend_ctx.libusbg_state) { name = usbg_get_udc_name(u); if (name == NULL) { fprintf(stderr, "Error getting udc name\n"); return -1; } puts(name); } return 0; } struct gt_udc_backend gt_udc_backend_libusbg = { .udc = udc_func, };
Add gadget udc command at libusbg backend
udc: Add gadget udc command at libusbg backend Change-Id: If1510069df2e6cd2620c89576ebba80685cb07d7 Signed-off-by: Pawel Szewczyk <[email protected]>
C
apache-2.0
kopasiak/gt,kopasiak/gt
2d4b83275dd0ce04a117a78e1eaca45d189c24f9
test/tsan/libdispatch/dispatch_once_deadlock.c
test/tsan/libdispatch/dispatch_once_deadlock.c
// Check that calling dispatch_once from a report callback works. // RUN: %clang_tsan %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s #include <dispatch/dispatch.h> #include <pthread.h> #include <stdio.h> long g = 0; long h = 0; void f() { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ g++; }); h++; } void __tsan_on_report() { fprintf(stderr, "Report.\n"); f(); } int main() { fprintf(stderr, "Hello world.\n"); f(); pthread_mutex_t mutex = {0}; pthread_mutex_lock(&mutex); fprintf(stderr, "g = %ld.\n", g); fprintf(stderr, "h = %ld.\n", h); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: Report. // CHECK: g = 1 // CHECK: h = 2 // CHECK: Done.
// Check that calling dispatch_once from a report callback works. // RUN: %clang_tsan %s -o %t // RUN: not %run %t 2>&1 | FileCheck %s #include <dispatch/dispatch.h> #include <pthread.h> #include <stdio.h> long g = 0; long h = 0; void f() { static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ g++; }); h++; } void __tsan_on_report() { fprintf(stderr, "Report.\n"); f(); } int main() { fprintf(stderr, "Hello world.\n"); f(); pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; pthread_mutex_unlock(&mutex); // Unlock of an unlocked mutex fprintf(stderr, "g = %ld.\n", g); fprintf(stderr, "h = %ld.\n", h); fprintf(stderr, "Done.\n"); } // CHECK: Hello world. // CHECK: Report. // CHECK: g = 1 // CHECK: h = 2 // CHECK: Done.
Make test work on Linux, pt. 2
[TSan][libdispatch] Make test work on Linux, pt. 2 git-svn-id: c199f293c43da69278bea8e88f92242bf3aa95f7@357741 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
ed8496dd8db282150831412ba02fe27476877d1f
You-QueryEngine/internal/action/filter_task.h
You-QueryEngine/internal/action/filter_task.h
/// \file update_task.h /// Defines action for updating tasks. /// \author A0112054Y #pragma once #ifndef YOU_QUERYENGINE_INTERNAL_ACTION_FILTER_TASK_H_ #define YOU_QUERYENGINE_INTERNAL_ACTION_FILTER_TASK_H_ #include <functional> #include "../../filter.h" #include "../../api.h" namespace You { namespace QueryEngine { namespace Internal { namespace Action { /// Define action for updating task class FilterTask : public Query { public: /// Constructor explicit FilterTask(const Filter& filter) : filter(filter) {} /// Destructor virtual ~FilterTask() = default; private: /// Execute add task. Response execute(State& tasks) override; FilterTask& operator=(const FilterTask&) = delete; const Filter& filter; }; } // namespace Action } // namespace Internal } // namespace QueryEngine } // namespace You #endif // YOU_QUERYENGINE_INTERNAL_ACTION_FILTER_TASK_H_
/// \file update_task.h /// Defines action for updating tasks. /// \author A0112054Y #pragma once #ifndef YOU_QUERYENGINE_INTERNAL_ACTION_FILTER_TASK_H_ #define YOU_QUERYENGINE_INTERNAL_ACTION_FILTER_TASK_H_ #include <functional> #include "../../filter.h" #include "../../api.h" namespace You { namespace QueryEngine { namespace Internal { namespace Action { /// Define action for updating task class FilterTask : public Query { public: /// Constructor explicit FilterTask(const Filter& filter) : filter(filter) {} /// Destructor virtual ~FilterTask() = default; private: /// Execute add task. Response execute(State& tasks) override; FilterTask& operator=(const FilterTask&) = delete; Filter filter; }; } // namespace Action } // namespace Internal } // namespace QueryEngine } // namespace You #endif // YOU_QUERYENGINE_INTERNAL_ACTION_FILTER_TASK_H_
Store filter by value in FilterTask
Store filter by value in FilterTask
C
mit
cs2103aug2014-w10-1c/main,cs2103aug2014-w10-1c/main
c2830d3c934ed6643ff4a07e92bce6367651d9ee
src/condor_util_lib/sig_install.c
src/condor_util_lib/sig_install.c
/* ** Copyright 1994 by Miron Livny, and Mike Litzkow ** ** Permission to use, copy, modify, and distribute this software and its ** documentation for any purpose and without fee is hereby granted, ** provided that the above copyright notice appear in all copies and that ** both that copyright notice and this permission notice appear in ** supporting documentation, and that the names of the University of ** Wisconsin and the copyright holders not be used in advertising or ** publicity pertaining to distribution of the software without specific, ** written prior permission. The University of Wisconsin and the ** copyright holders make no representations about the suitability of this ** software for any purpose. It is provided "as is" without express ** or implied warranty. ** ** THE UNIVERSITY OF WISCONSIN AND THE COPYRIGHT HOLDERS DISCLAIM ALL ** WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES ** OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE UNIVERSITY OF ** WISCONSIN OR THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT ** OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS ** OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE ** OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE ** OR PERFORMANCE OF THIS SOFTWARE. ** ** Author: Mike Litzkow ** */ #define _POSIX_SOURCE #include <signal.h> #include "condor_debug.h" static char *_FileName_ = __FILE__; typedef void (*SIG_HANDLER)(); void install_sig_handler( int sig, SIG_HANDLER handler ) { struct sigaction act; act.sa_handler = handler; sigemptyset( &act.sa_mask ); act.sa_flags = 0; if( sigaction(sig,&act,0) < 0 ) { EXCEPT( "sigaction" ); } }
Install a sig handler using sigaction(), ensure that handler stays installed across invocations.
Install a sig handler using sigaction(), ensure that handler stays installed across invocations.
C
apache-2.0
zhangzhehust/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,mambelli/osg-bosco-marco,djw8605/condor,clalancette/condor-dcloud,clalancette/condor-dcloud,djw8605/htcondor,zhangzhehust/htcondor,clalancette/condor-dcloud,djw8605/htcondor,mambelli/osg-bosco-marco,zhangzhehust/htcondor,djw8605/htcondor,neurodebian/htcondor,clalancette/condor-dcloud,zhangzhehust/htcondor,neurodebian/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/condor,djw8605/condor,mambelli/osg-bosco-marco,djw8605/condor,zhangzhehust/htcondor,mambelli/osg-bosco-marco,htcondor/htcondor,mambelli/osg-bosco-marco,clalancette/condor-dcloud,zhangzhehust/htcondor,djw8605/htcondor,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,mambelli/osg-bosco-marco,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,htcondor/htcondor,djw8605/htcondor,zhangzhehust/htcondor,neurodebian/htcondor,htcondor/htcondor,bbockelm/condor-network-accounting,mambelli/osg-bosco-marco,djw8605/htcondor,neurodebian/htcondor,djw8605/condor,bbockelm/condor-network-accounting,htcondor/htcondor,neurodebian/htcondor,djw8605/htcondor,htcondor/htcondor,djw8605/condor,djw8605/htcondor,bbockelm/condor-network-accounting,bbockelm/condor-network-accounting,neurodebian/htcondor,djw8605/condor,clalancette/condor-dcloud,bbockelm/condor-network-accounting,djw8605/condor,zhangzhehust/htcondor,htcondor/htcondor,zhangzhehust/htcondor,neurodebian/htcondor
55cfa656096e17cb624643b292d479752eff9b84
myrrh/python/registry.h
myrrh/python/registry.h
/** @file Copyright John Reid 2013 */ #ifndef MYRRH_PYTHON_REGISTRY_H_ #define MYRRH_PYTHON_REGISTRY_H_ #ifdef _MSC_VER # pragma once #endif //_MSC_VER namespace myrrh { namespace python { /** * Queries if the the type specified is in the registry. */ template< typename QueryT > bool in_registry() { namespace bp = boost::python; bp::type_info info = boost::python::type_id< QueryT >(); bp::converter::registration * registration = boost::python::converter::registry::query( info ); return registration != 0; } } //namespace myrrh } //namespace python #endif //MYRRH_PYTHON_REGISTRY_H_
/** @file Copyright John Reid 2013 */ #ifndef MYRRH_PYTHON_REGISTRY_H_ #define MYRRH_PYTHON_REGISTRY_H_ #ifdef _MSC_VER # pragma once #endif //_MSC_VER namespace myrrh { namespace python { /** * Queries if the the type specified is in the registry. This can be used to avoid registering * the same type more than once. */ template< typename QueryT > const boost::python::converter::registration * get_registration() { namespace bp = boost::python; const bp::type_info info = boost::python::type_id< QueryT >(); const bp::converter::registration * registration = boost::python::converter::registry::query( info ); // need to check for m_to_python converter: see http://stackoverflow.com/a/13017303/959926 if( registration != 0 && registration->m_to_python != 0 ) { return registration; } else { return 0; } } } //namespace myrrh } //namespace python #endif //MYRRH_PYTHON_REGISTRY_H_
Fix for inner class registration check
Fix for inner class registration check
C
mit
JohnReid/myrrh,JohnReid/myrrh
2b1a93b1c435fa60ffe3011bfdd70f104bc34e93
alura/c/adivinhacao.c
alura/c/adivinhacao.c
#include <stdio.h> int main() { // imprime o cabecalho do nosso jogo printf("******************************************\n"); printf("* Bem vindo ao nosso jogo de adivinhação *\n"); printf("******************************************\n"); int numerosecreto = 42; int chute; printf("Qual é o seu chute? "); scanf("%d", &chute); printf("Seu chute foi %d\n", chute); int acertou = chute == numerosecreto; if(acertou) { printf("Parabéns! Você acertou!\n"); printf("Jogue de novo, você é um bom jogador!\n"); } else { int maior = chute > numerosecreto; if(maior) { printf("Seu chute foi maior que o número secreto\n"); } else { printf("Seu chute foi menor que o número secreto\n"); } printf("Você errou!\n"); printf("Mas não desanime, tente de novo!\n"); } }
#include <stdio.h> int main() { // imprime o cabecalho do nosso jogo printf("******************************************\n"); printf("* Bem vindo ao nosso jogo de adivinhação *\n"); printf("******************************************\n"); int numerosecreto = 42; int chute; for(int i = 1; i <= 3; i++) { printf("Tentativa %d de 3\n", i); printf("Qual é o seu chute? "); scanf("%d", &chute); printf("Seu chute foi %d\n", chute); int acertou = chute == numerosecreto; if(acertou) { printf("Parabéns! Você acertou!\n"); printf("Jogue de novo, você é um bom jogador!\n"); } else { int maior = chute > numerosecreto; if(maior) { printf("Seu chute foi maior que o número secreto\n"); } else { printf("Seu chute foi menor que o número secreto\n"); } printf("Você errou!\n"); printf("Mas não desanime, tente de novo!\n"); } } printf("Fim de jogo!\n"); }
Update files, Alura, Introdução a C, Aula 2.5
Update files, Alura, Introdução a C, Aula 2.5
C
mit
fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs,fabriciofmsilva/labs
b6be5329bed253db517553152ee1f76e5ee68074
src/parse/stmt/equivalence.c
src/parse/stmt/equivalence.c
#include "../parse.h" unsigned parse_stmt_equivalence( const sparse_t* src, const char* ptr, parse_stmt_t* stmt) { unsigned i = parse_keyword( src, ptr, PARSE_KEYWORD_EQUIVALENCE); if (i == 0) return 0; stmt->type = PARSE_STMT_EQUIVALENCE; stmt->equivalence.count = 0; stmt->equivalence.group = NULL; unsigned len = parse_list(src, ptr, &stmt->equivalence.count, (void***)&stmt->equivalence.group, (void*)parse_lhs_list_bracketed, (void*)parse_lhs_list_delete); if (len == 0) return 0; i += len; return i; }
#include "../parse.h" unsigned parse_stmt_equivalence( const sparse_t* src, const char* ptr, parse_stmt_t* stmt) { unsigned i = parse_keyword( src, ptr, PARSE_KEYWORD_EQUIVALENCE); if (i == 0) return 0; stmt->type = PARSE_STMT_EQUIVALENCE; stmt->equivalence.count = 0; stmt->equivalence.group = NULL; unsigned len = parse_list(src, &ptr[i], &stmt->equivalence.count, (void***)&stmt->equivalence.group, (void*)parse_lhs_list_bracketed, (void*)parse_lhs_list_delete); if (len == 0) return 0; i += len; return i; }
Fix bug in EQUIVALENCE parsing
Fix bug in EQUIVALENCE parsing
C
apache-2.0
CodethinkLabs/ofc,CodethinkLabs/ofc,CodethinkLabs/ofc,CodethinkLabs/ofc
eae3d77193813825d7c4cb8dcb86d341c0b5b756
src/wrappers/themis/Obj-C/objcthemis/smessage.h
src/wrappers/themis/Obj-C/objcthemis/smessage.h
/* * Copyright (C) 2015 CossackLabs * * 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. */ #import <Foundation/Foundation.h> #import <themis/themis.h> @interface SKeygen : NSObject { NSData* _priv_key; NSData* _pub_key; } - (id)init; - (NSData*)priv_key: error:(NSError**)errorPtr; - (NSData*)pub_key: error:(NSError**)errorPtr; @end
/* * Copyright (C) 2015 CossackLabs * * 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. */ #import <Foundation/Foundation.h> #import <themis/themis.h> @interface SMessage : NSObject { NSMutableData* _priv_key; NSMutableData* _pub_key; } - (id)initWithPrivateKey: (NSData*)private_key peerPublicKey:(NSData*)peer_pub_key; - (NSData*)wrap: (NSData*)message error:(NSError**)errorPtr; - (NSData*)unwrap: (NSData*)message error:(NSError**)errorPtr; @end
Add some correction to Obj-C wrappers
Add some correction to Obj-C wrappers
C
apache-2.0
mnaza/themis,storojs72/themis,cossacklabs/themis,Lagovas/themis,storojs72/themis,mnaza/themis,storojs72/themis,cossacklabs/themis,Lagovas/themis,storojs72/themis,mnaza/themis,cossacklabs/themis,mnaza/themis,cossacklabs/themis,Lagovas/themis,Lagovas/themis,cossacklabs/themis,cossacklabs/themis,storojs72/themis,storojs72/themis,storojs72/themis,cossacklabs/themis,mnaza/themis,cossacklabs/themis,cossacklabs/themis,cossacklabs/themis,mnaza/themis,cossacklabs/themis,storojs72/themis,cossacklabs/themis,mnaza/themis,Lagovas/themis,Lagovas/themis,Lagovas/themis,mnaza/themis,Lagovas/themis,storojs72/themis,Lagovas/themis,mnaza/themis,cossacklabs/themis,storojs72/themis
a5ff559cf1182c4e86293784a64a52574eada1b4
printing/metafile_impl.h
printing/metafile_impl.h
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef PRINTING_METAFILE_IMPL_H_ #define PRINTING_METAFILE_IMPL_H_ #if defined(OS_WIN) #include "printing/emf_win.h" #elif defined(OS_MACOSX) #include "printing/pdf_metafile_cg_mac.h" #elif defined(OS_POSIX) #include "printing/pdf_metafile_cairo_linux.h" #endif #if !defined(OS_MACOSX) || defined(USE_SKIA) #include "printing/pdf_metafile_skia.h" #endif namespace printing { #if defined(OS_WIN) typedef Emf NativeMetafile; typedef PdfMetafileSkia PreviewMetafile; #elif defined(OS_MACOSX) #if defined(USE_SKIA) typedef PdfMetafileSkia NativeMetafile; typedef PdfMetafileSkia PreviewMetafile; #else typedef PdfMetafileCg NativeMetafile; typedef PdfMetafileCg PreviewMetafile; #endif #elif defined(OS_POSIX) typedef PdfMetafileCairo NativeMetafile; typedef PdfMetafileSkia PreviewMetafile; #endif } // namespace printing #endif // PRINTING_METAFILE_IMPL_H_
// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef PRINTING_METAFILE_IMPL_H_ #define PRINTING_METAFILE_IMPL_H_ #if defined(OS_WIN) #include "printing/emf_win.h" #elif defined(OS_MACOSX) #include "printing/pdf_metafile_cg_mac.h" #elif defined(OS_POSIX) #include "printing/pdf_metafile_cairo_linux.h" #endif #if !defined(OS_MACOSX) || defined(USE_SKIA) #include "printing/pdf_metafile_skia.h" #endif namespace printing { #if defined(OS_WIN) typedef Emf NativeMetafile; typedef PdfMetafileSkia PreviewMetafile; #elif defined(OS_MACOSX) #if defined(USE_SKIA) typedef PdfMetafileSkia NativeMetafile; typedef PdfMetafileSkia PreviewMetafile; #else typedef PdfMetafileCg NativeMetafile; typedef PdfMetafileCg PreviewMetafile; #endif #elif defined(OS_POSIX) typedef PdfMetafileSkia NativeMetafile; typedef PdfMetafileSkia PreviewMetafile; #endif } // namespace printing #endif // PRINTING_METAFILE_IMPL_H_
Switch the native print path on Linux and ChromeOS to use Skia instead of Cairo
Switch the native print path on Linux and ChromeOS to use Skia instead of Cairo BUG= TEST=Pages printed via cloud print to raster based printers should successfully print images. Review URL: http://codereview.chromium.org/7817007 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@99318 0039d316-1c4b-4281-b951-d872f2087c98
C
bsd-3-clause
hujiajie/pa-chromium,Pluto-tv/chromium-crosswalk,patrickm/chromium.src,axinging/chromium-crosswalk,hgl888/chromium-crosswalk-efl,hujiajie/pa-chromium,fujunwei/chromium-crosswalk,nacl-webkit/chrome_deps,dednal/chromium.src,Chilledheart/chromium,chuan9/chromium-crosswalk,markYoungH/chromium.src,keishi/chromium,ondra-novak/chromium.src,bright-sparks/chromium-spacewalk,littlstar/chromium.src,M4sse/chromium.src,robclark/chromium,chuan9/chromium-crosswalk,pozdnyakov/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,nacl-webkit/chrome_deps,fujunwei/chromium-crosswalk,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,littlstar/chromium.src,anirudhSK/chromium,timopulkkinen/BubbleFish,Just-D/chromium-1,keishi/chromium,hgl888/chromium-crosswalk,ondra-novak/chromium.src,robclark/chromium,ltilve/chromium,bright-sparks/chromium-spacewalk,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,patrickm/chromium.src,axinging/chromium-crosswalk,nacl-webkit/chrome_deps,jaruba/chromium.src,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,pozdnyakov/chromium-crosswalk,Jonekee/chromium.src,markYoungH/chromium.src,Fireblend/chromium-crosswalk,M4sse/chromium.src,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,anirudhSK/chromium,timopulkkinen/BubbleFish,keishi/chromium,Jonekee/chromium.src,timopulkkinen/BubbleFish,hujiajie/pa-chromium,Fireblend/chromium-crosswalk,Chilledheart/chromium,fujunwei/chromium-crosswalk,markYoungH/chromium.src,zcbenz/cefode-chromium,zcbenz/cefode-chromium,keishi/chromium,ltilve/chromium,chuan9/chromium-crosswalk,rogerwang/chromium,rogerwang/chromium,ltilve/chromium,markYoungH/chromium.src,nacl-webkit/chrome_deps,dushu1203/chromium.src,M4sse/chromium.src,hujiajie/pa-chromium,markYoungH/chromium.src,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,Just-D/chromium-1,anirudhSK/chromium,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,PeterWangIntel/chromium-crosswalk,hgl888/chromium-crosswalk,patrickm/chromium.src,jaruba/chromium.src,M4sse/chromium.src,pozdnyakov/chromium-crosswalk,mogoweb/chromium-crosswalk,zcbenz/cefode-chromium,M4sse/chromium.src,Jonekee/chromium.src,Jonekee/chromium.src,Chilledheart/chromium,ChromiumWebApps/chromium,littlstar/chromium.src,krieger-od/nwjs_chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,dednal/chromium.src,hgl888/chromium-crosswalk-efl,Chilledheart/chromium,Fireblend/chromium-crosswalk,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,ChromiumWebApps/chromium,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,junmin-zhu/chromium-rivertrail,TheTypoMaster/chromium-crosswalk,junmin-zhu/chromium-rivertrail,markYoungH/chromium.src,TheTypoMaster/chromium-crosswalk,bright-sparks/chromium-spacewalk,rogerwang/chromium,hujiajie/pa-chromium,axinging/chromium-crosswalk,dednal/chromium.src,dednal/chromium.src,rogerwang/chromium,Jonekee/chromium.src,jaruba/chromium.src,zcbenz/cefode-chromium,bright-sparks/chromium-spacewalk,mohamed--abdel-maksoud/chromium.src,keishi/chromium,junmin-zhu/chromium-rivertrail,hgl888/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,rogerwang/chromium,chuan9/chromium-crosswalk,dushu1203/chromium.src,anirudhSK/chromium,ondra-novak/chromium.src,crosswalk-project/chromium-crosswalk-efl,patrickm/chromium.src,mogoweb/chromium-crosswalk,jaruba/chromium.src,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,littlstar/chromium.src,rogerwang/chromium,bright-sparks/chromium-spacewalk,axinging/chromium-crosswalk,rogerwang/chromium,robclark/chromium,timopulkkinen/BubbleFish,krieger-od/nwjs_chromium.src,ondra-novak/chromium.src,Pluto-tv/chromium-crosswalk,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk-efl,krieger-od/nwjs_chromium.src,hgl888/chromium-crosswalk,timopulkkinen/BubbleFish,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,pozdnyakov/chromium-crosswalk,hgl888/chromium-crosswalk,mogoweb/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,nacl-webkit/chrome_deps,Just-D/chromium-1,markYoungH/chromium.src,ltilve/chromium,ChromiumWebApps/chromium,nacl-webkit/chrome_deps,mohamed--abdel-maksoud/chromium.src,dednal/chromium.src,hujiajie/pa-chromium,Jonekee/chromium.src,markYoungH/chromium.src,PeterWangIntel/chromium-crosswalk,junmin-zhu/chromium-rivertrail,mohamed--abdel-maksoud/chromium.src,krieger-od/nwjs_chromium.src,Chilledheart/chromium,keishi/chromium,junmin-zhu/chromium-rivertrail,timopulkkinen/BubbleFish,robclark/chromium,littlstar/chromium.src,markYoungH/chromium.src,ltilve/chromium,M4sse/chromium.src,dushu1203/chromium.src,pozdnyakov/chromium-crosswalk,krieger-od/nwjs_chromium.src,markYoungH/chromium.src,axinging/chromium-crosswalk,robclark/chromium,Fireblend/chromium-crosswalk,pozdnyakov/chromium-crosswalk,junmin-zhu/chromium-rivertrail,anirudhSK/chromium,timopulkkinen/BubbleFish,PeterWangIntel/chromium-crosswalk,nacl-webkit/chrome_deps,Chilledheart/chromium,Fireblend/chromium-crosswalk,patrickm/chromium.src,hujiajie/pa-chromium,zcbenz/cefode-chromium,Just-D/chromium-1,nacl-webkit/chrome_deps,dednal/chromium.src,hgl888/chromium-crosswalk-efl,hgl888/chromium-crosswalk-efl,crosswalk-project/chromium-crosswalk-efl,dushu1203/chromium.src,ChromiumWebApps/chromium,axinging/chromium-crosswalk,ChromiumWebApps/chromium,zcbenz/cefode-chromium,TheTypoMaster/chromium-crosswalk,ChromiumWebApps/chromium,patrickm/chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,Chilledheart/chromium,chuan9/chromium-crosswalk,junmin-zhu/chromium-rivertrail,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,axinging/chromium-crosswalk,anirudhSK/chromium,hujiajie/pa-chromium,jaruba/chromium.src,hujiajie/pa-chromium,pozdnyakov/chromium-crosswalk,anirudhSK/chromium,chuan9/chromium-crosswalk,bright-sparks/chromium-spacewalk,fujunwei/chromium-crosswalk,fujunwei/chromium-crosswalk,ondra-novak/chromium.src,rogerwang/chromium,pozdnyakov/chromium-crosswalk,littlstar/chromium.src,krieger-od/nwjs_chromium.src,anirudhSK/chromium,keishi/chromium,robclark/chromium,zcbenz/cefode-chromium,PeterWangIntel/chromium-crosswalk,junmin-zhu/chromium-rivertrail,patrickm/chromium.src,ChromiumWebApps/chromium,Fireblend/chromium-crosswalk,krieger-od/nwjs_chromium.src,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,ltilve/chromium,PeterWangIntel/chromium-crosswalk,axinging/chromium-crosswalk,keishi/chromium,markYoungH/chromium.src,robclark/chromium,Pluto-tv/chromium-crosswalk,ondra-novak/chromium.src,ChromiumWebApps/chromium,crosswalk-project/chromium-crosswalk-efl,rogerwang/chromium,junmin-zhu/chromium-rivertrail,dednal/chromium.src,hgl888/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,dushu1203/chromium.src,krieger-od/nwjs_chromium.src,dushu1203/chromium.src,mohamed--abdel-maksoud/chromium.src,Chilledheart/chromium,jaruba/chromium.src,fujunwei/chromium-crosswalk,dushu1203/chromium.src,littlstar/chromium.src,pozdnyakov/chromium-crosswalk,Pluto-tv/chromium-crosswalk,fujunwei/chromium-crosswalk,patrickm/chromium.src,jaruba/chromium.src,timopulkkinen/BubbleFish,dednal/chromium.src,ondra-novak/chromium.src,krieger-od/nwjs_chromium.src,PeterWangIntel/chromium-crosswalk,Jonekee/chromium.src,crosswalk-project/chromium-crosswalk-efl,Just-D/chromium-1,Fireblend/chromium-crosswalk,M4sse/chromium.src,timopulkkinen/BubbleFish,M4sse/chromium.src,mohamed--abdel-maksoud/chromium.src,Just-D/chromium-1,nacl-webkit/chrome_deps,crosswalk-project/chromium-crosswalk-efl,TheTypoMaster/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,axinging/chromium-crosswalk,ondra-novak/chromium.src,nacl-webkit/chrome_deps,keishi/chromium,hgl888/chromium-crosswalk-efl,anirudhSK/chromium,PeterWangIntel/chromium-crosswalk,crosswalk-project/chromium-crosswalk-efl,chuan9/chromium-crosswalk,ChromiumWebApps/chromium,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,hgl888/chromium-crosswalk,Just-D/chromium-1,hgl888/chromium-crosswalk-efl,PeterWangIntel/chromium-crosswalk,rogerwang/chromium,ChromiumWebApps/chromium,bright-sparks/chromium-spacewalk,zcbenz/cefode-chromium,hujiajie/pa-chromium,mogoweb/chromium-crosswalk,mogoweb/chromium-crosswalk,fujunwei/chromium-crosswalk,mohamed--abdel-maksoud/chromium.src,zcbenz/cefode-chromium,dednal/chromium.src,dednal/chromium.src,chuan9/chromium-crosswalk,Jonekee/chromium.src,anirudhSK/chromium,patrickm/chromium.src,Jonekee/chromium.src,pozdnyakov/chromium-crosswalk,timopulkkinen/BubbleFish,Jonekee/chromium.src,keishi/chromium,ondra-novak/chromium.src,littlstar/chromium.src,jaruba/chromium.src,robclark/chromium,Just-D/chromium-1,jaruba/chromium.src,TheTypoMaster/chromium-crosswalk,hujiajie/pa-chromium,robclark/chromium,Pluto-tv/chromium-crosswalk,jaruba/chromium.src,hgl888/chromium-crosswalk,ltilve/chromium,Chilledheart/chromium,anirudhSK/chromium,timopulkkinen/BubbleFish,ChromiumWebApps/chromium,chuan9/chromium-crosswalk,krieger-od/nwjs_chromium.src,robclark/chromium,mohamed--abdel-maksoud/chromium.src,crosswalk-project/chromium-crosswalk-efl,Pluto-tv/chromium-crosswalk,axinging/chromium-crosswalk,Fireblend/chromium-crosswalk,M4sse/chromium.src,hgl888/chromium-crosswalk-efl,ltilve/chromium,keishi/chromium,Fireblend/chromium-crosswalk,junmin-zhu/chromium-rivertrail,zcbenz/cefode-chromium,junmin-zhu/chromium-rivertrail,dednal/chromium.src,ltilve/chromium,anirudhSK/chromium,M4sse/chromium.src,dushu1203/chromium.src
86f04cd3f2d5c23f1745acdaa86ef526c174ce9a
aescpuid.c
aescpuid.c
/** * cpuid.c * * Checks if CPU has support of AES instructions * * @author [email protected] * @version 4.0 * * For Putty AES NI project * http://putty-aes-ni.googlecode.com/ */ #ifndef SILENT #include <stdio.h> #endif #if defined(__clang__) || defined(__GNUC__) #include <cpuid.h> static int CheckCPUsupportAES() { unsigned int CPUInfo[4]; __cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); return (CPUInfo[2] & (1 << 25)) && (CPUInfo[2] & (1 << 19)); /* Check AES and SSE4.1 */ } #else /* defined(__clang__) || defined(__GNUC__) */ static int CheckCPUsupportAES() { unsigned int CPUInfo[4]; __cpuid(CPUInfo, 1); return (CPUInfo[2] & (1 << 25)) && (CPUInfo[2] & (1 << 19)); /* Check AES and SSE4.1 */ } #endif /* defined(__clang__) || defined(__GNUC__) */ int main(int argc, char ** argv) { const int res = !CheckCPUsupportAES(); #ifndef SILENT printf("This CPU %s AES-NI\n", res ? "does not support" : "supports"); #endif return res; }
/** * cpuid.c * * Checks if CPU has support of AES instructions * * @author [email protected] * @version 4.0 * * For Putty AES NI project * http://putty-aes-ni.googlecode.com/ */ #include <stdio.h> #if defined(__clang__) || defined(__GNUC__) #include <cpuid.h> static int CheckCPUsupportAES() { unsigned int CPUInfo[4]; __cpuid(1, CPUInfo[0], CPUInfo[1], CPUInfo[2], CPUInfo[3]); return (CPUInfo[2] & (1 << 25)) && (CPUInfo[2] & (1 << 19)); /* Check AES and SSE4.1 */ } #else /* defined(__clang__) || defined(__GNUC__) */ static int CheckCPUsupportAES() { unsigned int CPUInfo[4]; __cpuid(CPUInfo, 1); return (CPUInfo[2] & (1 << 25)) && (CPUInfo[2] & (1 << 19)); /* Check AES and SSE4.1 */ } #endif /* defined(__clang__) || defined(__GNUC__) */ int main(int argc, char ** argv) { const int res = !CheckCPUsupportAES(); printf("This CPU %s AES-NI\n", res ? "does not support" : "supports"); return res; }
Print CPUID result to output
Print CPUID result to output
C
mit
pavelkryukov/putty-aes-ni,pavelkryukov/putty-aes-ni
1e437be581a3d2e1176a66f4e2420ce7f37ead37
TRD/AliTRDPreprocessor.h
TRD/AliTRDPreprocessor.h
#ifndef ALI_TRD_PREPROCESSOR_H #define ALI_TRD_PREPROCESSOR_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ //////////////////////////////////////////////////////////////////////////// // // // TRD preprocessor for the database SHUTTLE // // // //////////////////////////////////////////////////////////////////////////// #include "AliPreprocessor.h" class AliTRDPreprocessor : public AliPreprocessor { public: AliTRDPreprocessor(AliShuttleInterface *shuttle); virtual ~AliTRDPreprocessor(); protected: virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime); virtual UInt_t Process(TMap* /*dcsAliasMap*/); private: ClassDef(AliTRDPreprocessor,0); }; #endif
#ifndef ALI_TRD_PREPROCESSOR_H #define ALI_TRD_PREPROCESSOR_H /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * See cxx source for full Copyright notice */ /* $Id$ */ //////////////////////////////////////////////////////////////////////////// // // // TRD preprocessor for the database SHUTTLE // // // //////////////////////////////////////////////////////////////////////////// #include "AliPreprocessor.h" class AliTRDPreprocessor : public AliPreprocessor { public: AliTRDPreprocessor(AliShuttleInterface *shuttle); virtual ~AliTRDPreprocessor(); protected: virtual void Initialize(Int_t run, UInt_t startTime, UInt_t endTime); virtual UInt_t Process(TMap* /*dcsAliasMap*/); private: ClassDef(AliTRDPreprocessor,0) // The SHUTTLE preprocessor for TRD }; #endif
Add a comment behind ClassDef
Add a comment behind ClassDef
C
bsd-3-clause
ecalvovi/AliRoot,alisw/AliRoot,ecalvovi/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,mkrzewic/AliRoot,jgrosseo/AliRoot,jgrosseo/AliRoot,sebaleh/AliRoot,coppedis/AliRoot,coppedis/AliRoot,ecalvovi/AliRoot,jgrosseo/AliRoot,ecalvovi/AliRoot,ALICEHLT/AliRoot,sebaleh/AliRoot,coppedis/AliRoot,miranov25/AliRoot,shahor02/AliRoot,alisw/AliRoot,shahor02/AliRoot,shahor02/AliRoot,coppedis/AliRoot,alisw/AliRoot,ALICEHLT/AliRoot,coppedis/AliRoot,shahor02/AliRoot,ALICEHLT/AliRoot,coppedis/AliRoot,miranov25/AliRoot,shahor02/AliRoot,shahor02/AliRoot,ALICEHLT/AliRoot,ecalvovi/AliRoot,mkrzewic/AliRoot,miranov25/AliRoot,alisw/AliRoot,jgrosseo/AliRoot,shahor02/AliRoot,ALICEHLT/AliRoot,ecalvovi/AliRoot,alisw/AliRoot,mkrzewic/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,miranov25/AliRoot,jgrosseo/AliRoot,coppedis/AliRoot,miranov25/AliRoot,jgrosseo/AliRoot,coppedis/AliRoot,mkrzewic/AliRoot,alisw/AliRoot,alisw/AliRoot,ALICEHLT/AliRoot,mkrzewic/AliRoot,ecalvovi/AliRoot,sebaleh/AliRoot,mkrzewic/AliRoot,sebaleh/AliRoot,ALICEHLT/AliRoot,miranov25/AliRoot,sebaleh/AliRoot,jgrosseo/AliRoot,alisw/AliRoot,mkrzewic/AliRoot
b7206937d9779b2e90ec28fe3ca42d00916eab14
osu.Framework/Resources/Shaders/sh_yuv2rgb.h
osu.Framework/Resources/Shaders/sh_yuv2rgb.h
uniform sampler2D m_SamplerY; uniform sampler2D m_SamplerU; uniform sampler2D m_SamplerV; uniform mat3 yuvCoeff; // Y - 16, Cb - 128, Cr - 128 const mediump vec3 offsets = vec3(-0.0625, -0.5, -0.5); lowp vec3 sampleRgb(vec2 loc) { float y = texture2D(m_SamplerY, loc).r; float u = texture2D(m_SamplerU, loc).r; float v = texture2D(m_SamplerV, loc).r; return yuvCoeff * (vec3(y, u, v) + offsets); }
uniform sampler2D m_SamplerY; uniform sampler2D m_SamplerU; uniform sampler2D m_SamplerV; uniform mediump mat3 yuvCoeff; // Y - 16, Cb - 128, Cr - 128 const mediump vec3 offsets = vec3(-0.0625, -0.5, -0.5); lowp vec3 sampleRgb(vec2 loc) { lowp float y = texture2D(m_SamplerY, loc).r; lowp float u = texture2D(m_SamplerU, loc).r; lowp float v = texture2D(m_SamplerV, loc).r; return yuvCoeff * (vec3(y, u, v) + offsets); }
Add precision prefixes to shaders
Add precision prefixes to shaders Co-Authored-By: Dan Balasescu <[email protected]>
C
mit
ppy/osu-framework,ZLima12/osu-framework,EVAST9919/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,ppy/osu-framework,ZLima12/osu-framework,smoogipooo/osu-framework,peppy/osu-framework,peppy/osu-framework,EVAST9919/osu-framework,smoogipooo/osu-framework,EVAST9919/osu-framework,ppy/osu-framework
b59d8199e0a0a3d1c77cc36f3cfb1c6716a254a8
include/llvm/Transforms/IPO.h
include/llvm/Transforms/IPO.h
//===- llvm/Transforms/CleanupGCCOutput.h - Cleanup GCC Output ---*- C++ -*--=// // // //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_CLEANUPGCCOUTPUT_H #define LLVM_TRANSFORMS_CLEANUPGCCOUTPUT_H class Pass; Pass *createCleanupGCCOutputPass(); #endif
//===- llvm/Transforms/CleanupGCCOutput.h - Cleanup GCC Output ---*- C++ -*--=// // // These passes are used to cleanup the output of GCC. GCC's output is // unneccessarily gross for a couple of reasons. This pass does the following // things to try to clean it up: // // * Eliminate names for GCC types that we know can't be needed by the user. // * Eliminate names for types that are unused in the entire translation unit // * Fix various problems that we might have in PHI nodes and casts // * Link uses of 'void %foo(...)' to 'void %foo(sometypes)' // // Note: This code produces dead declarations, it is a good idea to run DCE // after this pass. // //===----------------------------------------------------------------------===// #ifndef LLVM_TRANSFORMS_CLEANUPGCCOUTPUT_H #define LLVM_TRANSFORMS_CLEANUPGCCOUTPUT_H class Pass; // CleanupGCCOutputPass - Perform all of the function body transformations. // Pass *createCleanupGCCOutputPass(); // FunctionResolvingPass - Go over the functions that are in the module and // look for functions that have the same name. More often than not, there will // be things like: // void "foo"(...) // void "foo"(int, int) // because of the way things are declared in C. If this is the case, patch // things up. // // This is an interprocedural pass. // Pass *createFunctionResolvingPass(); #endif
Split the CleanupGCCOutput pass into two passes, and add real life actual documentation on when they do.
Split the CleanupGCCOutput pass into two passes, and add real life actual documentation on when they do. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@2222 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
GPUOpen-Drivers/llvm,llvm-mirror/llvm,chubbymaggie/asap,dslab-epfl/asap,dslab-epfl/asap,llvm-mirror/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,chubbymaggie/asap,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,chubbymaggie/asap,llvm-mirror/llvm,dslab-epfl/asap,apple/swift-llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,dslab-epfl/asap,apple/swift-llvm,chubbymaggie/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm
56ecad6907dea785ebffba414dfe3ff586e5f2e0
src/shutdown/hpr_wall.c
src/shutdown/hpr_wall.c
/* ISC license. */ #include <string.h> #include <utmpx.h> #include <skalibs/posixishard.h> #include <skalibs/allreadwrite.h> #include <skalibs/strerr2.h> #include <skalibs/djbunix.h> #include "hpr.h" #ifndef UT_LINESIZE #define UT_LINESIZE 32 #endif void hpr_wall (char const *s) { size_t n = strlen(s) ; char tty[10 + UT_LINESIZE] = "/dev/" ; char msg[n+1] ; memcpy(msg, s, n) ; msg[n++] = '\n' ; setutxent() ; for (;;) { size_t linelen ; int fd ; struct utmpx *utx = getutxent() ; if (!utx) break ; if (utx->ut_type != USER_PROCESS) continue ; linelen = strnlen(utx->ut_line, UT_LINESIZE) ; memcpy(tty + 5, utx->ut_line, linelen) ; tty[5 + linelen] = 0 ; fd = open_append(tty) ; if (fd == -1) continue ; allwrite(fd, msg, n) ; fd_close(fd) ; } endutxent() ; }
/* ISC license. */ #include <string.h> #include <utmpx.h> #include <skalibs/allreadwrite.h> #include <skalibs/strerr2.h> #include <skalibs/djbunix.h> #include <skalibs/posixishard.h> #include "hpr.h" #ifndef UT_LINESIZE #define UT_LINESIZE 32 #endif void hpr_wall (char const *s) { size_t n = strlen(s) ; char tty[10 + UT_LINESIZE] = "/dev/" ; char msg[n+1] ; memcpy(msg, s, n) ; msg[n++] = '\n' ; setutxent() ; for (;;) { size_t linelen ; int fd ; struct utmpx *utx = getutxent() ; if (!utx) break ; if (utx->ut_type != USER_PROCESS) continue ; linelen = strnlen(utx->ut_line, UT_LINESIZE) ; memcpy(tty + 5, utx->ut_line, linelen) ; tty[5 + linelen] = 0 ; fd = open_append(tty) ; if (fd == -1) continue ; allwrite(fd, msg, n) ; fd_close(fd) ; } endutxent() ; }
Include posixishard as late as possible
Include posixishard as late as possible
C
isc
skarnet/s6-linux-init,skarnet/s6-linux-init
60da6bc748cf4366005a047a1ab2637184150333
gc_none.c
gc_none.c
#include "visibility.h" #include "objc/runtime.h" #include "gc_ops.h" #include "class.h" #include <stdlib.h> #include <stdio.h> static id allocate_class(Class cls, size_t extraBytes) { intptr_t *addr = calloc(cls->instance_size + extraBytes + sizeof(intptr_t), 1); return (id)(addr + 1); } static void free_object(id obj) { free((void*)(((intptr_t)obj) - 1)); } static void *alloc(size_t size) { return calloc(size, 1); } PRIVATE struct gc_ops gc_ops_none = { .allocate_class = allocate_class, .free_object = free_object, .malloc = alloc, .free = free }; PRIVATE struct gc_ops *gc = &gc_ops_none; PRIVATE BOOL isGCEnabled = NO; #ifndef ENABLE_GC PRIVATE void enableGC(BOOL exclusive) { fprintf(stderr, "Attempting to enable garbage collection, but your" "Objective-C runtime was built without garbage collection" "support\n"); abort(); } #endif
#include "visibility.h" #include "objc/runtime.h" #include "gc_ops.h" #include "class.h" #include <stdlib.h> #include <stdio.h> static id allocate_class(Class cls, size_t extraBytes) { intptr_t *addr = calloc(cls->instance_size + extraBytes + sizeof(intptr_t), 1); return (id)(addr + 1); } static void free_object(id obj) { free((void*)(((intptr_t*)obj) - 1)); } static void *alloc(size_t size) { return calloc(size, 1); } PRIVATE struct gc_ops gc_ops_none = { .allocate_class = allocate_class, .free_object = free_object, .malloc = alloc, .free = free }; PRIVATE struct gc_ops *gc = &gc_ops_none; PRIVATE BOOL isGCEnabled = NO; #ifndef ENABLE_GC PRIVATE void enableGC(BOOL exclusive) { fprintf(stderr, "Attempting to enable garbage collection, but your" "Objective-C runtime was built without garbage collection" "support\n"); abort(); } #endif
Fix bug spotted by Justin Hibbits.
Fix bug spotted by Justin Hibbits. git-svn-id: f6517e426f81db5247881cd92f7386583ace04fa@33751 72102866-910b-0410-8b05-ffd578937521
C
mit
crontab/libobjc2,skudryas/gnustep-libobjc2,skudryas/gnustep-libobjc2,crontab/libobjc2
b6a760e55482bed227ab71c77727766ec134fe33
tests/47_switch_return.c
tests/47_switch_return.c
#include <stdio.h> void fred(int x) { switch (x) { case 1: printf("1\n"); return; case 2: printf("2\n"); break; case 3: printf("3\n"); return; } printf("out\n"); } int main() { fred(1); fred(2); fred(3); return 0; }
Test for switch with return inside a case.
Test for switch with return inside a case. git-svn-id: 1b2893900746d3474b20c0dea7456040123c3b26@505 21eae674-98b7-11dd-bd71-f92a316d2d60
C
bsd-3-clause
jpoirier/picoc
3593b3c46b605566d4523330f452a2fbe738e074
minunit.h
minunit.h
// Thanks to JeraTech for this minimalist TDD code, // which I've modified to resemble AngularJS's a bit more. // http://www.jera.com/techinfo/jtns/jtn002.html int tests_run = 0; #define _it_should(message, test) do { if (!(test)) return message; } while (0) #define _run_test(test) do { char *message = test(); tests_run++; if (message) return message; } while (0)
Define a minimal unit testing framework.
Define a minimal unit testing framework.
C
agpl-3.0
ryepdx/keyphrase,ryepdx/keyphrase
315c996e6e6fac57514d4faa73329060edf714dc
libechonest/src/ENAPI_utils.h
libechonest/src/ENAPI_utils.h
// // ENAPI_utils.h // libechonest // // Created by Art Gillespie on 3/15/11. [email protected] // #import "NSMutableDictionary+QueryString.h" #import "NSData+MD5.h" #import "ENAPI.h" #define CHECK_API_KEY if (nil == [ENAPI apiKey]) { @throw [NSException exceptionWithName:@"APIKeyNotSetException" reason:@"Set the API key before calling this method" userInfo:nil]; } static NSString __attribute__((unused)) * const ECHONEST_API_URL = @"http://developer.echonest.com/api/v4/";
// // ENAPI_utils.h // libechonest // // Created by Art Gillespie on 3/15/11. [email protected] // #import "NSMutableDictionary+QueryString.h" #import "NSData+MD5.h" #import "ENAPI.h" #define CHECK_API_KEY if (nil == [ENAPI apiKey]) { @throw [NSException exceptionWithName:@"APIKeyNotSetException" reason:@"Set the API key before calling this method" userInfo:nil]; } #define CHECK_OAUTH_KEYS if (nil == [ENAPI consumerKey] && nil == [ENAPI sharedSecret]) { @throw [NSException exceptionWithName:@"OAuthKeysNotSetException" reason:@"Set the consumer key & shared secret before calling this method" userInfo:nil]; } static NSString __attribute__((unused)) * const ECHONEST_API_URL = @"http://developer.echonest.com/api/v4/";
Add macro for checking OAuth keys.
Add macro for checking OAuth keys.
C
bsd-3-clause
echonest/libechonest
08d8a5ec7d018c771787bd33b429c2b2d096a578
AAChartKit/ChartsDemo/SecondViewController.h
AAChartKit/ChartsDemo/SecondViewController.h
// // ViewController.h // AAChartKit // // Created by An An on 17/3/13. // Copyright © 2017年 An An. All rights reserved. // source code ----*** https://github.com/AAChartModel/AAChartKit ***--- source code // #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger,ENUM_secondeViewController_chartType){ ENUM_secondeViewController_chartTypeColumn =0, ENUM_secondeViewController_chartTypeBar, ENUM_secondeViewController_chartTypeArea, ENUM_secondeViewController_chartTypeAreaspline, ENUM_secondeViewController_chartTypeLine, ENUM_secondeViewController_chartTypeSpline, ENUM_secondeViewController_chartTypeScatter, }; @interface SecondViewController : UIViewController @property(nonatomic,assign)NSInteger ENUM_secondeViewController_chartType; @property(nonatomic,copy)NSString *receivedChartType; @end
// // ViewController.h // AAChartKit // // Created by An An on 17/3/13. // Copyright © 2017年 An An. All rights reserved. // source code ----*** https://github.com/AAChartModel/AAChartKit ***--- source code // #import <UIKit/UIKit.h> typedef NS_ENUM(NSInteger,SecondeViewControllerChartType){ SecondeViewControllerChartTypeColumn =0, SecondeViewControllerChartTypeBar, SecondeViewControllerChartTypeArea, SecondeViewControllerChartTypeAreaspline, SecondeViewControllerChartTypeLine, SecondeViewControllerChartTypeSpline, SecondeViewControllerChartTypeScatter, }; @interface SecondViewController : UIViewController @property(nonatomic,assign)NSInteger SecondeViewControllerChartType; @property(nonatomic,copy)NSString *receivedChartType; @end
Correct the naming notations of enumeration
Correct the naming notations of enumeration
C
mit
AAChartModel/AAChartKit,AAChartModel/AAChartKit,AAChartModel/AAChartKit
ad42bb9a0b167e38bd2fef333c1d725bc41f0dc0
src/media/tagreader.h
src/media/tagreader.h
#ifndef TAGREADER_H #define TAGREADER_H #include <taglib/fileref.h> #include <taglib/tag.h> #include <taglib/mpegfile.h> #include <taglib/id3v2tag.h> #include <taglib/attachedpictureframe.h> #include <QString> #include <QImage> class TagReader { public: TagReader(const QString &file); ~TagReader(); bool isValid() const; bool hasAudioProperties() const; QString title() const; QString album() const; QString artist() const; int track() const; int year() const; QString genre() const; QString comment() const; int length() const; int bitrate() const; int sampleRate() const; int channels() const; QImage thumbnailImage() const; QByteArray thumbnail() const; private: TagLib::FileRef m_fileRef; TagLib::Tag *m_tag; TagLib::AudioProperties *m_audioProperties; }; #endif // TAGREADER_H
#ifndef TAGREADER_H #define TAGREADER_H #include "taglib/fileref.h" #include "taglib/tag.h" #include "taglib/mpeg/mpegfile.h" #include "taglib/mpeg/id3v2/id3v2tag.h" #include "taglib/mpeg/id3v2/frames/attachedpictureframe.h" #include <QString> #include <QImage> class TagReader { public: TagReader(const QString &file); ~TagReader(); bool isValid() const; bool hasAudioProperties() const; QString title() const; QString album() const; QString artist() const; int track() const; int year() const; QString genre() const; QString comment() const; int length() const; int bitrate() const; int sampleRate() const; int channels() const; QImage thumbnailImage() const; QByteArray thumbnail() const; private: TagLib::FileRef m_fileRef; TagLib::Tag *m_tag; TagLib::AudioProperties *m_audioProperties; }; #endif // TAGREADER_H
Use our package taglib headers and not the hosts!
Use our package taglib headers and not the hosts!
C
bsd-3-clause
qtmediahub/sasquatch,qtmediahub/sasquatch,qtmediahub/sasquatch
4ad6e5a49c4894661fabd40382f2482dd8011ac0
test2/structs/lvalue/cant.c
test2/structs/lvalue/cant.c
// RUN: %check -e %s main() { struct A { int i; } a, b, c; a = b ? : c; // CHECK: error: struct involved in if-expr }
// RUN: %check -e %s main() { struct A { int i; } a, b, c; a = b ? : c; // CHECK: error: struct involved in ?: }
Fix struct if-expression test warning
Fix struct if-expression test warning
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
d5e1c63c19ff5d4b8dd74bd4b16500becd869322
command_mode.c
command_mode.c
#include "mode.h" #include <stdlib.h> #include <string.h> #include <termbox.h> #include "buf.h" #include "editor.h" // TODO(isbadawi): Command mode needs a cursor, but modes don't affect drawing. static void command_mode_key_pressed(editor_t *editor, struct tb_event *ev) { char ch; switch (ev->key) { case TB_KEY_ESC: buf_printf(editor->status, ""); editor->mode = normal_mode(); return; case TB_KEY_BACKSPACE2: buf_delete(editor->status, editor->status->len - 1, 1); if (editor->status->len == 0) { editor->mode = normal_mode(); return; } return; case TB_KEY_ENTER: { char *command = strdup(editor->status->buf + 1); editor_execute_command(editor, command); free(command); editor->mode = normal_mode(); return; } case TB_KEY_SPACE: ch = ' '; break; default: ch = ev->ch; } char s[2] = {ch, '\0'}; buf_append(editor->status, s); } static editing_mode_t impl = {command_mode_key_pressed}; editing_mode_t *command_mode(void) { return &impl; }
#include "mode.h" #include <stdlib.h> #include <string.h> #include <termbox.h> #include "buf.h" #include "editor.h" // TODO(isbadawi): Command mode needs a cursor, but modes don't affect drawing. static void command_mode_key_pressed(editor_t *editor, struct tb_event *ev) { char ch; switch (ev->key) { case TB_KEY_ESC: buf_printf(editor->status, ""); editor->mode = normal_mode(); return; case TB_KEY_BACKSPACE2: buf_delete(editor->status, editor->status->len - 1, 1); if (editor->status->len == 0) { editor->mode = normal_mode(); return; } return; case TB_KEY_ENTER: { if (editor->status->len > 1) { char *command = strdup(editor->status->buf + 1); editor_execute_command(editor, command); free(command); } editor->mode = normal_mode(); return; } case TB_KEY_SPACE: ch = ' '; break; default: ch = ev->ch; } char s[2] = {ch, '\0'}; buf_append(editor->status, s); } static editing_mode_t impl = {command_mode_key_pressed}; editing_mode_t *command_mode(void) { return &impl; }
Fix segfault on empty : command.
Fix segfault on empty : command.
C
mit
isbadawi/badavi
1b7032c1539b38a4e6af2688bedf25ddf3450333
test/performance/clock.h
test/performance/clock.h
// A currentTime function for use in the tests. #ifdef _WIN32 extern "C" bool QueryPerformanceCounter(uint64_t *); extern "C" bool QueryPerformanceFrequency(uint64_t *); double currentTime() { uint64_t t, freq; QueryPerformanceCounter(&t); QueryPerformanceFrequency(&freq); return (t * 1000.0) / freq; } #else #include <sys/time.h> double currentTime() { static bool first_call = true; static timeval reference_time; if (first_call) { first_call = false; gettimeofday(&reference_time, NULL); return 0.0; } else { timeval t; gettimeofday(&t, NULL); return ((t.tv_sec - reference_time.tv_sec)*1000.0 + (t.tv_usec - reference_time.tv_usec)/1000.0); } } #endif
// A currentTime function for use in the tests. // Returns time in milliseconds. #ifdef _WIN32 extern "C" bool QueryPerformanceCounter(uint64_t *); extern "C" bool QueryPerformanceFrequency(uint64_t *); double currentTime() { uint64_t t, freq; QueryPerformanceCounter(&t); QueryPerformanceFrequency(&freq); return (t * 1000.0) / freq; } #else #include <sys/time.h> double currentTime() { static bool first_call = true; static timeval reference_time; if (first_call) { first_call = false; gettimeofday(&reference_time, NULL); return 0.0; } else { timeval t; gettimeofday(&t, NULL); return ((t.tv_sec - reference_time.tv_sec)*1000.0 + (t.tv_usec - reference_time.tv_usec)/1000.0); } } #endif
Add a comment that currentTime returns result in milliseconds.
Add a comment that currentTime returns result in milliseconds. Former-commit-id: 397c814dcee2df63ded6cbf17b63b601a10984e2
C
mit
darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide,darkbuck/Halide,Trass3r/Halide,Trass3r/Halide,darkbuck/Halide,Trass3r/Halide,darkbuck/Halide
f811db9dd6a03c198717b68afd00eb56200e19bc
src/lcd.c
src/lcd.c
/* COR:a.bc PE:a.bc BAC:a.bc */ void lcd_voltage() { string top, bottom; sprintf(top, "COR:%1.2f PE:%1.2f", nImmediateBatteryLevel * 0.001, SensorValue(PowerExpanderBattery) / 280); sprintf(bottom, "BAC:%1.2f", BackupBatteryLevel * 0.001); displayLCDString(LCD_LINE_TOP, 0, top); displayLCDString(LCD_LINE_BOTTOM, 0, bottom); } void lcd_clear() { clearLCDLine(LCD_LINE_TOP); clearLCDLine(LCD_LINE_BOTTOM); }
/* COR:a.bc PE:a.bc BAC:a.bc */ void lcd_voltage() { string top, bottom; sprintf(top, "COR:%1.2f PE:%1.2f", nImmediateBatteryLevel * 0.001, SensorValue(PowerExpanderBattery) / 280.0); sprintf(bottom, "BAC:%1.2f", BackupBatteryLevel * 0.001); displayLCDString(LCD_LINE_TOP, 0, top); displayLCDString(LCD_LINE_BOTTOM, 0, bottom); } void lcd_clear() { clearLCDLine(LCD_LINE_TOP); clearLCDLine(LCD_LINE_BOTTOM); }
Change power expander to float
Change power expander to float
C
mit
qsctr/vex-4194b-2016
a221dd6a4d5ebf75e3f5a278c753824914ae7661
hopstack/di/main.c
hopstack/di/main.c
#include <stdio.h> #include <string.h> #include <stdlib.h> struct URI { char * scheme; char * user; char * password; char * host; char * port; char * path; char * query; char * fragment; }; struct rule { char * name; char * rule; char * levels; char * priority; }; struct URP { struct URI uri; struct rule * rules; }; struct URI * parse_uri(char * raw_uri) { struct URI *uri = malloc (sizeof (struct URI)); int scheme_found = 0; int scheme_end = 0; char * tmp_uriptr; for (tmp_uriptr = raw_uri; *tmp_uriptr != '\0'; ++tmp_uriptr) { if (*tmp_uriptr == ':') { if (!scheme_found) { scheme_end = tmp_uriptr - raw_uri; uri->scheme = (char *) malloc(scheme_end); strncpy(uri->scheme, raw_uri, scheme_end); scheme_found = 1; } } } return uri; } int main() { char * raw_uri = "scheme://dir1/dir2/dir3"; struct URI * parsed_uri; parsed_uri = parse_uri(raw_uri); printf("%s\n", parsed_uri->scheme); }
CREATE start of di in C
CREATE start of di in C
C
mit
willpatterson/HOPSTACK,willpatterson/LASubway,willpatterson/HOPSTACK
0c7a489e65b7bc51cc15af88197eb162f54cff13
JazzHands/IFTTTAnimator.h
JazzHands/IFTTTAnimator.h
// // IFTTTAnimator.h // JazzHands // // Created by Devin Foley on 9/28/13. // Copyright (c) 2013 IFTTT Inc. All rights reserved. // @protocol IFTTTAnimatable; @interface IFTTTAnimator : NSObject - (void)addAnimation:(id<IFTTTAnimatable>)animation; - (void)animate:(CGFloat)time; @end
// // IFTTTAnimator.h // JazzHands // // Created by Devin Foley on 9/28/13. // Copyright (c) 2013 IFTTT Inc. All rights reserved. // #import <UIKit/UIKit.h> @protocol IFTTTAnimatable; @interface IFTTTAnimator : NSObject - (void)addAnimation:(id<IFTTTAnimatable>)animation; - (void)animate:(CGFloat)time; @end
Add UIKit import to allow for compiling without precompiled header
Add UIKit import to allow for compiling without precompiled header
C
mit
IFTTT/JazzHands,revolter/JazzHands,IFTTT/JazzHands,AlexanderMazaletskiy/JazzHands,ernestopino/JazzHands,ernestopino/JazzHands,lionkon/JazzHands,liuruxian/JazzHands,zorroblue/JazzHands,revolter/JazzHands,AlexanderMazaletskiy/JazzHands,wintersweet/JazzHands,ramoslin02/JazzHands,tangwei6423471/JazzHands,wintersweet/JazzHands,IFTTT/JazzHands,lionkon/JazzHands,lionkon/JazzHands,marcelofariasantos/JazzHands,tangwei6423471/JazzHands,marcelofariasantos/JazzHands,liuruxian/JazzHands,marcelofariasantos/JazzHands,liuruxian/JazzHands,wintersweet/JazzHands,AlexanderMazaletskiy/JazzHands,ernestopino/JazzHands,revolter/JazzHands,ramoslin02/JazzHands,liuruxian/JazzHands,zorroblue/JazzHands,tangwei6423471/JazzHands,zorroblue/JazzHands,tangwei6423471/JazzHands,ramoslin02/JazzHands,liuruxian/JazzHands,tangwei6423471/JazzHands
7f6be0874b9900c0188d7319412521f341dcf648
Classes/Constants.h
Classes/Constants.h
/* * Constants.h * phonegap-mac * * Created by shazron on 10-04-08. * Copyright 2010 Nitobi Software Inc. All rights reserved. * */ #define kStartPage @"index.html" //Sencha Demos #define kStartFolder @"www/sencha" // PhoneGap Docs Only //#define kStartFolder @"www/phonegap-docs/template/phonegap/"
/* * Constants.h * phonegap-mac * * Created by shazron on 10-04-08. * Copyright 2010 Nitobi Software Inc. All rights reserved. * */ #define kStartPage @"index.html" //Sencha Demos //#define kStartFolder @"www/sencha" // PhoneGap Docs Only #define kStartFolder @"www/phonegap-docs/template/phonegap/"
Revert "kStartFolder switch back to Sencha configuration"
Revert "kStartFolder switch back to Sencha configuration" This reverts commit 034cbb7f82a7c034ac8fe83c991ed6838b9a03b2.
C
apache-2.0
adobe-rnd/cordova-osx,apache/cordova-osx,adobe-rnd/cordova-osx,gitterHQ/cordova-osx,apache/cordova-osx,gitterHQ/cordova-osx,Jigsaw-Code/cordova-osx,adobe-rnd/cordova-osx,adobe-rnd/cordova-osx,onflapp/cordova-osx,adobe-rnd/cordova-osx,apache/cordova-osx,tripodsan/cordova-osx,Jigsaw-Code/cordova-osx,apache/cordova-osx,gitterHQ/cordova-osx,onflapp/cordova-osx,apache/cordova-osx,Jigsaw-Code/cordova-osx,tripodsan/cordova-osx,onflapp/cordova-osx,tripodsan/cordova-osx,Jigsaw-Code/cordova-osx,gitterHQ/cordova-osx,onflapp/cordova-osx,tripodsan/cordova-osx,onflapp/cordova-osx,tripodsan/cordova-osx,Jigsaw-Code/cordova-osx
59c91c8d0000af8f8a1022ee0f0eec46c397b347
include/clang/AST/CommentBriefParser.h
include/clang/AST/CommentBriefParser.h
//===--- CommentBriefParser.h - Dumb comment parser -------------*- 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 a very simple Doxygen comment parser. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_AST_BRIEF_COMMENT_PARSER_H #define LLVM_CLANG_AST_BRIEF_COMMENT_PARSER_H #include "clang/AST/CommentLexer.h" namespace clang { namespace comments { /// A very simple comment parser that extracts "a brief description". /// /// Due to a variety of comment styles, it considers the following as "a brief /// description", in order of priority: /// \li a \\brief or \\short command, /// \li the first paragraph, /// \li a \\result or \\return or \\returns paragraph. class BriefParser { Lexer &L; const CommandTraits &Traits; /// Current lookahead token. Token Tok; SourceLocation ConsumeToken() { SourceLocation Loc = Tok.getLocation(); L.lex(Tok); return Loc; } public: BriefParser(Lexer &L, const CommandTraits &Traits); /// Return \\brief paragraph, if it exists; otherwise return the first /// paragraph. std::string Parse(); }; } // end namespace comments } // end namespace clang #endif
//===--- CommentBriefParser.h - Dumb comment parser -------------*- 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 a very simple Doxygen comment parser. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_AST_BRIEF_COMMENT_PARSER_H #define LLVM_CLANG_AST_BRIEF_COMMENT_PARSER_H #include "clang/AST/CommentLexer.h" namespace clang { namespace comments { /// A very simple comment parser that extracts "a brief description". /// /// Due to a variety of comment styles, it considers the following as "a brief /// description", in order of priority: /// \li a \\brief or \\short command, /// \li the first paragraph, /// \li a \\result or \\return or \\returns paragraph. class BriefParser { Lexer &L; const CommandTraits &Traits; /// Current lookahead token. Token Tok; SourceLocation ConsumeToken() { SourceLocation Loc = Tok.getLocation(); L.lex(Tok); return Loc; } public: BriefParser(Lexer &L, const CommandTraits &Traits); /// Return the best "brief description" we can find. std::string Parse(); }; } // end namespace comments } // end namespace clang #endif
Update comment to match the reality.
Update comment to match the reality. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@162316 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/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,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,apple/swift-clang
9137574e4d330370df242a0fa6c914f2f0eb5528
features/mbedtls/platform/inc/platform_mbed.h
features/mbedtls/platform/inc/platform_mbed.h
/** * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved * 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. * * This file is part of mbed TLS (https://tls.mbed.org) */ #if defined(DEVICE_TRNG) #define MBEDTLS_ENTROPY_HARDWARE_ALT #endif #if defined(DEVICE_CRYPTO) #include "mbedtls_device.h" #endif
/** * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved * 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. * * This file is part of mbed TLS (https://tls.mbed.org) */ #if defined(DEVICE_TRNG) #define MBEDTLS_ENTROPY_HARDWARE_ALT #endif #if defined(MBEDTLS_HW_SUPPORT) #include "mbedtls_device.h" #endif
Move mbed TLS configuration symbol to macro section
Move mbed TLS configuration symbol to macro section The configuration option for the mbed TLS specific hardware acceleration has to be in the macro section and not in the device capabilities section in targets.json. The option has also been renamed to better reflect its function.
C
apache-2.0
netzimme/mbed-os,nRFMesh/mbed-os,screamerbg/mbed,monkiineko/mbed-os,kl-cruz/mbed-os,screamerbg/mbed,nvlsianpu/mbed,ryankurte/mbed-os,mmorenobarm/mbed-os,screamerbg/mbed,netzimme/mbed-os,bcostm/mbed-os,fanghuaqi/mbed,adustm/mbed,NXPmicro/mbed,ryankurte/mbed-os,andcor02/mbed-os,infinnovation/mbed-os,CalSol/mbed,adamgreen/mbed,CalSol/mbed,arostm/mbed-os,NXPmicro/mbed,radhika-raghavendran/mbed-os5.1-onsemi,bcostm/mbed-os,mbedmicro/mbed,c1728p9/mbed-os,adamgreen/mbed,betzw/mbed-os,catiedev/mbed-os,catiedev/mbed-os,andcor02/mbed-os,arostm/mbed-os,ryankurte/mbed-os,j-greffe/mbed-os,svogl/mbed-os,maximmbed/mbed,pradeep-gr/mbed-os5-onsemi,nRFMesh/mbed-os,radhika-raghavendran/mbed-os5.1-onsemi,Archcady/mbed-os,CalSol/mbed,cvtsi2sd/mbed-os,NXPmicro/mbed,kl-cruz/mbed-os,nvlsianpu/mbed,mikaleppanen/mbed-os,fanghuaqi/mbed,kjbracey-arm/mbed,cvtsi2sd/mbed-os,mmorenobarm/mbed-os,YarivCol/mbed-os,CalSol/mbed,adamgreen/mbed,mikaleppanen/mbed-os,betzw/mbed-os,c1728p9/mbed-os,maximmbed/mbed,pradeep-gr/mbed-os5-onsemi,j-greffe/mbed-os,c1728p9/mbed-os,ryankurte/mbed-os,fahhem/mbed-os,mbedmicro/mbed,fahhem/mbed-os,bcostm/mbed-os,catiedev/mbed-os,Archcady/mbed-os,mbedmicro/mbed,radhika-raghavendran/mbed-os5.1-onsemi,c1728p9/mbed-os,infinnovation/mbed-os,nvlsianpu/mbed,bulislaw/mbed-os,nRFMesh/mbed-os,netzimme/mbed-os,nRFMesh/mbed-os,adustm/mbed,theotherjimmy/mbed,HeadsUpDisplayInc/mbed,screamerbg/mbed,cvtsi2sd/mbed-os,arostm/mbed-os,svogl/mbed-os,c1728p9/mbed-os,netzimme/mbed-os,RonEld/mbed,mazimkhan/mbed-os,bulislaw/mbed-os,fanghuaqi/mbed,kjbracey-arm/mbed,nRFMesh/mbed-os,HeadsUpDisplayInc/mbed,infinnovation/mbed-os,CalSol/mbed,RonEld/mbed,kl-cruz/mbed-os,mikaleppanen/mbed-os,Archcady/mbed-os,adustm/mbed,adamgreen/mbed,arostm/mbed-os,netzimme/mbed-os,catiedev/mbed-os,YarivCol/mbed-os,svogl/mbed-os,theotherjimmy/mbed,mmorenobarm/mbed-os,RonEld/mbed,YarivCol/mbed-os,RonEld/mbed,nRFMesh/mbed-os,karsev/mbed-os,YarivCol/mbed-os,netzimme/mbed-os,mazimkhan/mbed-os,monkiineko/mbed-os,mikaleppanen/mbed-os,bulislaw/mbed-os,karsev/mbed-os,nvlsianpu/mbed,adamgreen/mbed,infinnovation/mbed-os,nvlsianpu/mbed,arostm/mbed-os,andcor02/mbed-os,karsev/mbed-os,YarivCol/mbed-os,bcostm/mbed-os,theotherjimmy/mbed,mbedmicro/mbed,fahhem/mbed-os,CalSol/mbed,maximmbed/mbed,HeadsUpDisplayInc/mbed,HeadsUpDisplayInc/mbed,fahhem/mbed-os,mmorenobarm/mbed-os,radhika-raghavendran/mbed-os5.1-onsemi,svogl/mbed-os,catiedev/mbed-os,bcostm/mbed-os,svogl/mbed-os,radhika-raghavendran/mbed-os5.1-onsemi,cvtsi2sd/mbed-os,kjbracey-arm/mbed,j-greffe/mbed-os,adamgreen/mbed,monkiineko/mbed-os,mmorenobarm/mbed-os,catiedev/mbed-os,adustm/mbed,Archcady/mbed-os,radhika-raghavendran/mbed-os5.1-onsemi,theotherjimmy/mbed,j-greffe/mbed-os,pradeep-gr/mbed-os5-onsemi,monkiineko/mbed-os,bulislaw/mbed-os,adustm/mbed,mazimkhan/mbed-os,theotherjimmy/mbed,betzw/mbed-os,pradeep-gr/mbed-os5-onsemi,monkiineko/mbed-os,mbedmicro/mbed,cvtsi2sd/mbed-os,maximmbed/mbed,maximmbed/mbed,mikaleppanen/mbed-os,infinnovation/mbed-os,j-greffe/mbed-os,andcor02/mbed-os,fahhem/mbed-os,karsev/mbed-os,betzw/mbed-os,mikaleppanen/mbed-os,fanghuaqi/mbed,mazimkhan/mbed-os,pradeep-gr/mbed-os5-onsemi,karsev/mbed-os,ryankurte/mbed-os,mmorenobarm/mbed-os,mazimkhan/mbed-os,RonEld/mbed,monkiineko/mbed-os,infinnovation/mbed-os,ryankurte/mbed-os,NXPmicro/mbed,maximmbed/mbed,andcor02/mbed-os,RonEld/mbed,arostm/mbed-os,mazimkhan/mbed-os,NXPmicro/mbed,karsev/mbed-os,betzw/mbed-os,pradeep-gr/mbed-os5-onsemi,Archcady/mbed-os,kl-cruz/mbed-os,cvtsi2sd/mbed-os,andcor02/mbed-os,bulislaw/mbed-os,YarivCol/mbed-os,betzw/mbed-os,HeadsUpDisplayInc/mbed,fahhem/mbed-os,kl-cruz/mbed-os,svogl/mbed-os,c1728p9/mbed-os,Archcady/mbed-os,NXPmicro/mbed,HeadsUpDisplayInc/mbed,theotherjimmy/mbed,nvlsianpu/mbed,bcostm/mbed-os,fanghuaqi/mbed,bulislaw/mbed-os,kjbracey-arm/mbed,j-greffe/mbed-os,kl-cruz/mbed-os,screamerbg/mbed,adustm/mbed,screamerbg/mbed
dcbb118c40a472014ca77bf3f63afc35651657cc
inc/area.h
inc/area.h
#ifndef AREA_H #define AREA_H #include "base.h" typedef struct area area; struct area{ char name[10]; int capacity; int areasAround; char ** adjec; // STRINGS SIZE ARE ALWAYS 10 }; void listAreas(area * a, int size); void addArea(area * a, int size); void deleteArea(area * a, int size); #endif
#ifndef AREA_H #define AREA_H #include "base.h" typedef struct area area; struct area{ char name[10]; int capacity; int areasAround; char ** adjec; // STRINGS SIZE ARE ALWAYS 10 }; void listAreas(area * a, int size); void addArea(area ** a, int *size); void deleteArea(area ** a, int *size); int checkAreaExist(area * z, int zSize, char * areaName); int getAreaCapacity(area * z, int zSize, char * areaName); #endif
Add Area capacity functions. Add addArea function
Add Area capacity functions. Add addArea function
C
mit
leovegetium/Trabalho-P
06ccd3a0b986f0eb634bf642fe69ba9434a39ed2
cc1/tests/test036.c
cc1/tests/test036.c
/* name: TEST036 description: Duff's device output: */ /* Disgusting, no? But it compiles and runs just fine. I feel a combination of pride and revulsion at this discovery. If no one's thought of it before, I think I'll name it after myself. It amazes me that after 10 years of writing C there are still little corners that I haven't explored fully. - Tom Duff */ send(to, from, count) register short *to, *from; register count; { register n=(count+7)/8; switch(count%8){ case 0: do{*to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; }while(--n>0); } }
Add test for Duff device
Add test for Duff device
C
mit
k0gaMSX/kcc,k0gaMSX/scc,8l/scc,k0gaMSX/kcc,k0gaMSX/scc,8l/scc,k0gaMSX/scc,8l/scc
941075e6a69846082231e76aca8642d299c2093c
polygon.h
polygon.h
#ifndef _POLYGON_H_ #define _POLYGON_H_ /* * geometric properties of the polygon meant for solving * * The default C pre-processor configuration here is to solve triangles. */ #define POLYGON_DEPTH 3 #if (POLYGON_DEPTH < 3) #error You cannot have a polygon with fewer than 3 sides! #endif #if (POLYGON_DEPTH > 'Z' - 'A') #error Angle labels are currently lettered. Sorry for this limitation. #endif /* * All polygons have a fixed limit to the total measure of their angles. * For example, the angles of a triangle always sum up to 180 degrees. */ #define INTERIOR_DEGREES (180 * ((POLYGON_DEPTH) - 2)) /* * Geometric lengths cannot be negative or zero. * We will reserve non-positive measures to indicate un-solved "unknowns". */ #define KNOWN(measure) ((measure) > 0) extern int solve_polygon(double * angles, double * sides); extern int already_solved(double * angels, double * sides); extern int find_angle(double * angles); extern int find_side(double * sides, const double * angles); extern int arc_find_angles(double * angles, const double * sides); #endif
#ifndef _POLYGON_H_ #define _POLYGON_H_ /* * geometric properties of the polygon meant for solving * * The default C pre-processor configuration here is to solve triangles. */ #ifndef POLYGON_DEPTH #define POLYGON_DEPTH 3 #endif #if (POLYGON_DEPTH < 3) #error You cannot have a polygon with fewer than 3 sides! #endif #if (POLYGON_DEPTH > 'Z' - 'A') #error Angle labels are currently lettered. Sorry for this limitation. #endif /* * All polygons have a fixed limit to the total measure of their angles. * For example, the angles of a triangle always sum up to 180 degrees. */ #define INTERIOR_DEGREES (180 * ((POLYGON_DEPTH) - 2)) /* * Geometric lengths cannot be negative or zero. * We will reserve non-positive measures to indicate un-solved "unknowns". */ #define KNOWN(measure) ((measure) > 0) extern int solve_polygon(double * angles, double * sides); extern int already_solved(double * angels, double * sides); extern int find_angle(double * angles); extern int find_side(double * sides, const double * angles); extern int arc_find_angles(double * angles, const double * sides); #endif
Allow POLYGON_DEPTH to be configurable by compile commands.
Allow POLYGON_DEPTH to be configurable by compile commands.
C
cc0-1.0
cxd4/trig,cxd4/trig
6e2253071014ec086daa6e1ad4c10d955617e5a5
ASN1Decoder/ASN1Decoder.h
ASN1Decoder/ASN1Decoder.h
// // ASN1Decoder.h // ASN1Decoder // // Created by Filippo Maguolo on 8/29/17. // Copyright © 2017 Filippo Maguolo. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for ASN1Decoder. FOUNDATION_EXPORT double ASN1DecoderVersionNumber; //! Project version string for ASN1Decoder. FOUNDATION_EXPORT const unsigned char ASN1DecoderVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <ASN1Decoder/PublicHeader.h>
// // ASN1Decoder.h // ASN1Decoder // // Created by Filippo Maguolo on 8/29/17. // Copyright © 2017 Filippo Maguolo. All rights reserved. // #import <UIKit/UIKit.h> //! Project version number for ASN1Decoder. FOUNDATION_EXPORT double ASN1DecoderVersionNumber; //! Project version string for ASN1Decoder. FOUNDATION_EXPORT const unsigned char ASN1DecoderVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import <ASN1Decoder/PublicHeader.h>
Remove double whitespace on header file
Remove double whitespace on header file
C
mit
filom/ASN1Decoder,filom/ASN1Decoder
e667a7e04b163eef4461e72246e8effd7be8f9fa
include/arch/x86/arch/machine/cpu_registers.h
include/arch/x86/arch/machine/cpu_registers.h
/* * Copyright 2014, General Dynamics C4 Systems * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(GD_GPL) */ #ifndef __ARCH_MACHINE_CPU_REGISTERS_H #define __ARCH_MACHINE_CPU_REGISTERS_H #define CR0_MONITOR_COPROC BIT(1) /* Trap on FPU "WAIT" commands. */ #define CR0_EMULATION BIT(2) /* Enable OS emulation of FPU. */ #define CR0_TASK_SWITCH BIT(3) /* Trap on any FPU usage, for lazy FPU. */ #define CR0_NUMERIC_ERROR BIT(5) /* Internally handle FPU problems. */ #define CR4_OSFXSR BIT(9) /* Enable SSE et. al. features. */ #define CR4_OSXMMEXCPT BIT(10) /* Enable SSE exceptions. */ /* We use a dummy variable to synchronize reads and writes to the control registers. * this allows us to write inline asm blocks that do not have enforced memory * clobbers for ordering. */ static unsigned long control_reg_order; #include <mode/machine/cpu_registers.h> #endif
/* * Copyright 2014, General Dynamics C4 Systems * * This software may be distributed and modified according to the terms of * the GNU General Public License version 2. Note that NO WARRANTY is provided. * See "LICENSE_GPLv2.txt" for details. * * @TAG(GD_GPL) */ #ifndef __ARCH_MACHINE_CPU_REGISTERS_H #define __ARCH_MACHINE_CPU_REGISTERS_H #define CR0_MONITOR_COPROC BIT(1) /* Trap on FPU "WAIT" commands. */ #define CR0_EMULATION BIT(2) /* Enable OS emulation of FPU. */ #define CR0_TASK_SWITCH BIT(3) /* Trap on any FPU usage, for lazy FPU. */ #define CR0_NUMERIC_ERROR BIT(5) /* Internally handle FPU problems. */ #define CR4_OSFXSR BIT(9) /* Enable SSE et. al. features. */ #define CR4_OSXMMEXCPT BIT(10) /* Enable SSE exceptions. */ #define CR4_OSXSAVE BIT(18) /* Enavle XSAVE feature set */ /* We use a dummy variable to synchronize reads and writes to the control registers. * this allows us to write inline asm blocks that do not have enforced memory * clobbers for ordering. */ static unsigned long control_reg_order; #include <mode/machine/cpu_registers.h> #endif
Add missing CR4 bit definition
x86: Add missing CR4 bit definition
C
bsd-2-clause
cmr/seL4,cmr/seL4,cmr/seL4
358d98c9444ba6a7b181506220ef3ecddc4e7f04
CWStatusBarNotification/CWStatusBarNotification.h
CWStatusBarNotification/CWStatusBarNotification.h
// // CWStatusBarNotification // CWNotificationDemo // // Created by Cezary Wojcik on 11/15/13. // Copyright (c) 2013 Cezary Wojcik. All rights reserved. // #import <Foundation/Foundation.h> @interface CWStatusBarNotification : NSObject enum { CWNotificationStyleStatusBarNotification, CWNotificationStyleNavigationBarNotification }; enum { CWNotificationAnimationStyleTop, CWNotificationAnimationStyleBottom, CWNotificationAnimationStyleLeft, CWNotificationAnimationStyleRight }; @property (strong, nonatomic) UIColor *notificationLabelBackgroundColor; @property (strong, nonatomic) UIColor *notificationLabelTextColor; @property (nonatomic) NSInteger notificationStyle; @property (nonatomic) NSInteger notificationAnimationInStyle; @property (nonatomic) NSInteger notificationAnimationOutStyle; @property (nonatomic) BOOL notificationIsShowing; - (void)displayNotificationWithMessage:(NSString *)message forDuration:(CGFloat)duration; - (void)displayNotificationWithMessage:(NSString *)message completion:(void (^)(void))completion; - (void)dismissNotification; @end
// // CWStatusBarNotification // CWNotificationDemo // // Created by Cezary Wojcik on 11/15/13. // Copyright (c) 2013 Cezary Wojcik. All rights reserved. // #import <Foundation/Foundation.h> @interface CWStatusBarNotification : NSObject typedef NS_ENUM(NSInteger, CWNotificationStyle){ CWNotificationStyleStatusBarNotification, CWNotificationStyleNavigationBarNotification }; typedef NS_ENUM(NSInteger, CWNotificationAnimationStyle) { CWNotificationAnimationStyleTop, CWNotificationAnimationStyleBottom, CWNotificationAnimationStyleLeft, CWNotificationAnimationStyleRight }; @property (strong, nonatomic) UIColor *notificationLabelBackgroundColor; @property (strong, nonatomic) UIColor *notificationLabelTextColor; @property (nonatomic) CWNotificationStyle notificationStyle; @property (nonatomic) CWNotificationAnimationStyle notificationAnimationInStyle; @property (nonatomic) CWNotificationAnimationStyle notificationAnimationOutStyle; @property (nonatomic) BOOL notificationIsShowing; - (void)displayNotificationWithMessage:(NSString *)message forDuration:(CGFloat)duration; - (void)displayNotificationWithMessage:(NSString *)message completion:(void (^)(void))completion; - (void)dismissNotification; @end
Make types for enums, add types to properties
Make types for enums, add types to properties
C
mit
kazmasaurus/CRToast,maranik/CRToast,hoanganh6491/CRToast,DerLobi/CRToast,perrystreetsoftware/CRToast,dmiedema/CRToast,AdamCampbell/CRToast,dedelost/CRToast,iosdevvivek/CRToast,mmmilo/CRToast,cnbin/CRToast,chinaljw/CRToast,Kevin775263419/CRToast,Trueey/CRToast,Naithar/CRToast,vladzz/CRToast,hulu001/CRToast,leoschweizer/CRToast,cruffenach/CRToast,Ashton-W/CRToast,Adorkable-forkable/CRToast,Kevin775263419/CRToast,grzesir/CRToast,yeahdongcn/CRToast,hoanganh6491/CRToast,gohjohn/CRToast
9490094b141003d692320113a662224a9fa2ef42
include/asm-mips/i8253.h
include/asm-mips/i8253.h
/* * Machine specific IO port address definition for generic. * Written by Osamu Tomita <[email protected]> */ #ifndef _MACH_IO_PORTS_H #define _MACH_IO_PORTS_H /* i8253A PIT registers */ #define PIT_MODE 0x43 #define PIT_CH0 0x40 #define PIT_CH2 0x42 /* i8259A PIC registers */ #define PIC_MASTER_CMD 0x20 #define PIC_MASTER_IMR 0x21 #define PIC_MASTER_ISR PIC_MASTER_CMD #define PIC_MASTER_POLL PIC_MASTER_ISR #define PIC_MASTER_OCW3 PIC_MASTER_ISR #define PIC_SLAVE_CMD 0xa0 #define PIC_SLAVE_IMR 0xa1 /* i8259A PIC related value */ #define PIC_CASCADE_IR 2 #define MASTER_ICW4_DEFAULT 0x01 #define SLAVE_ICW4_DEFAULT 0x01 #define PIC_ICW4_AEOI 2 extern void setup_pit_timer(void); #endif /* !_MACH_IO_PORTS_H */
/* * Machine specific IO port address definition for generic. * Written by Osamu Tomita <[email protected]> */ #ifndef __ASM_I8253_H #define __ASM_I8253_H /* i8253A PIT registers */ #define PIT_MODE 0x43 #define PIT_CH0 0x40 #define PIT_CH2 0x42 /* i8259A PIC registers */ #define PIC_MASTER_CMD 0x20 #define PIC_MASTER_IMR 0x21 #define PIC_MASTER_ISR PIC_MASTER_CMD #define PIC_MASTER_POLL PIC_MASTER_ISR #define PIC_MASTER_OCW3 PIC_MASTER_ISR #define PIC_SLAVE_CMD 0xa0 #define PIC_SLAVE_IMR 0xa1 /* i8259A PIC related value */ #define PIC_CASCADE_IR 2 #define MASTER_ICW4_DEFAULT 0x01 #define SLAVE_ICW4_DEFAULT 0x01 #define PIC_ICW4_AEOI 2 extern void setup_pit_timer(void); #endif /* __ASM_I8253_H */
Fix include wrapper symbol to something sane.
[MIPS] Fix include wrapper symbol to something sane. And why are there i8253.h and 8253pit.h ... Signed-off-by: Ralf Baechle <[email protected]>
C
mit
KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs,TeamVee-Kanas/android_kernel_samsung_kanas,KristFoundation/Programs
be6de4c1215a8ad5607b1fcc7e9e6da1de780877
src/include/common/controldata_utils.h
src/include/common/controldata_utils.h
/* * controldata_utils.h * Common code for pg_controldata output * * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/common/controldata_utils.h */ #ifndef COMMON_CONTROLDATA_UTILS_H #define COMMON_CONTROLDATA_UTILS_H extern ControlFileData *get_controlfile(char *DataDir, const char *progname); #endif /* COMMON_CONTROLDATA_UTILS_H */
/* * controldata_utils.h * Common code for pg_controldata output * * Portions Copyright (c) 1996-2016, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/common/controldata_utils.h */ #ifndef COMMON_CONTROLDATA_UTILS_H #define COMMON_CONTROLDATA_UTILS_H #include "catalog/pg_control.h" extern ControlFileData *get_controlfile(char *DataDir, const char *progname); #endif /* COMMON_CONTROLDATA_UTILS_H */
Add missing include for self-containment
Add missing include for self-containment
C
apache-2.0
greenplum-db/gpdb,greenplum-db/gpdb,adam8157/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,50wu/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,lisakowen/gpdb,xinzweb/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,adam8157/gpdb,50wu/gpdb,50wu/gpdb,xinzweb/gpdb,greenplum-db/gpdb,adam8157/gpdb,ashwinstar/gpdb,lisakowen/gpdb,50wu/gpdb,50wu/gpdb,xinzweb/gpdb,xinzweb/gpdb,jmcatamney/gpdb,adam8157/gpdb,lisakowen/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,jmcatamney/gpdb,adam8157/gpdb,xinzweb/gpdb,xinzweb/gpdb,lisakowen/gpdb,ashwinstar/gpdb,lisakowen/gpdb,50wu/gpdb,greenplum-db/gpdb,lisakowen/gpdb,jmcatamney/gpdb,50wu/gpdb,jmcatamney/gpdb,adam8157/gpdb,lisakowen/gpdb,lisakowen/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,jmcatamney/gpdb,ashwinstar/gpdb,adam8157/gpdb,xinzweb/gpdb,50wu/gpdb,xinzweb/gpdb,adam8157/gpdb,greenplum-db/gpdb
7b91a38d79ab14ea212a91a69a19b31111d1ba91
include/fish_detector/common/species_dialog.h
include/fish_detector/common/species_dialog.h
/// @file /// @brief Defines SpeciesDialog class. #ifndef SPECIES_DIALOG_H #define SPECIES_DIALOG_H #include <memory> #include <QWidget> #include <QDialog> #include "fish_detector/common/species.h" namespace Ui { class SpeciesDialog; } namespace fish_detector { class SpeciesDialog : public QDialog { Q_OBJECT #ifndef NO_TESTING friend class TestSpeciesDialog; #endif public: /// @brief Constructor. /// /// @param parent Parent widget. explicit SpeciesDialog(QWidget *parent = 0); /// @brief Returns a Species object corresponding to the dialog values. /// /// @return Species object corresponding to the dialog values. Species getSpecies(); private slots: /// @brief Emits the accepted signal. void on_ok_clicked(); /// @brief Emits the rejected signal. void on_cancel_clicked(); /// @brief Removes currently selected subspecies. void on_removeSubspecies_clicked(); /// @brief Adds a new subspecies. void on_addSubspecies_clicked(); private: /// @brief Widget loaded from ui file. std::unique_ptr<Ui::SpeciesDialog> ui_; }; } // namespace fish_detector #endif // SPECIES_DIALOG_H
/// @file /// @brief Defines SpeciesDialog class. #ifndef SPECIES_DIALOG_H #define SPECIES_DIALOG_H #include <memory> #include <QWidget> #include <QDialog> #include "fish_detector/common/species.h" namespace Ui { class SpeciesDialog; } namespace fish_detector { class SpeciesDialog : public QDialog { Q_OBJECT public: /// @brief Constructor. /// /// @param parent Parent widget. explicit SpeciesDialog(QWidget *parent = 0); /// @brief Returns a Species object corresponding to the dialog values. /// /// @return Species object corresponding to the dialog values. Species getSpecies(); private slots: /// @brief Calls inherited accept function. void on_ok_clicked(); /// @brief Calls inherited reject function. void on_cancel_clicked(); /// @brief Removes currently selected subspecies. void on_removeSubspecies_clicked(); /// @brief Adds a new subspecies. void on_addSubspecies_clicked(); private: /// @brief Widget loaded from ui file. std::unique_ptr<Ui::SpeciesDialog> ui_; }; } // namespace fish_detector #endif // SPECIES_DIALOG_H
Remove unused friend class declaration
Remove unused friend class declaration
C
mit
BGWoodward/FishDetector
2a655bcf9e5c30077197d314690ffbf86a042712
STTweetLabel/STTweetLabel.h
STTweetLabel/STTweetLabel.h
// // STTweetLabel.h // STTweetLabel // // Created by Sebastien Thiebaud on 09/29/13. // Copyright (c) 2013 Sebastien Thiebaud. All rights reserved. // typedef enum { STTweetHandle = 0, STTweetHashtag, STTweetLink } STTweetHotWord; @interface STTweetLabel : UILabel @property (nonatomic, strong) NSArray *validProtocols; @property (nonatomic, assign) BOOL leftToRight; @property (nonatomic, assign) BOOL textSelectable; @property (nonatomic, strong) UIColor *selectionColor; @property (nonatomic, copy) void (^detectionBlock)(STTweetHotWord hotWord, NSString *string, NSString *protocol, NSRange range); - (void)setAttributes:(NSDictionary *)attributes; - (void)setAttributes:(NSDictionary *)attributes hotWord:(STTweetHotWord)hotWord; - (NSDictionary *)attributes; - (NSDictionary *)attributesForHotWord:(STTweetHotWord)hotWord; - (CGSize)suggestedFrameSizeToFitEntireStringConstraintedToWidth:(CGFloat)width; @end
// // STTweetLabel.h // STTweetLabel // // Created by Sebastien Thiebaud on 09/29/13. // Copyright (c) 2013 Sebastien Thiebaud. All rights reserved. // typedef NS_ENUM(NSInteger, STTweetHotWord) { STTweetHandle = 0, STTweetHashtag, STTweetLink }; @interface STTweetLabel : UILabel @property (nonatomic, strong) NSArray *validProtocols; @property (nonatomic, assign) BOOL leftToRight; @property (nonatomic, assign) BOOL textSelectable; @property (nonatomic, strong) UIColor *selectionColor; @property (nonatomic, copy) void (^detectionBlock)(STTweetHotWord hotWord, NSString *string, NSString *protocol, NSRange range); - (void)setAttributes:(NSDictionary *)attributes; - (void)setAttributes:(NSDictionary *)attributes hotWord:(STTweetHotWord)hotWord; - (NSDictionary *)attributes; - (NSDictionary *)attributesForHotWord:(STTweetHotWord)hotWord; - (CGSize)suggestedFrameSizeToFitEntireStringConstraintedToWidth:(CGFloat)width; @end
Make enum available to swift
Make enum available to swift
C
mit
bespider/STTweetLabel,pankkor/STTweetLabel,pabelnl/STTweetLabel,HackRoy/STTweetLabel,SebastienThiebaud/STTweetLabel,quanquan1986/STTweetLabel
0699830cd0dd5b606647c28c7e4b0965c418e6b8
MenuItemKit/MenuItemKit.h
MenuItemKit/MenuItemKit.h
// // MenuItemKit.h // MenuItemKit // // Created by CHEN Xian’an on 1/16/16. // Copyright © 2016 lazyapps. All rights reserved. // #import <UIKit/UIKit.h> #import "Headers.h" //! Project version number for MenuItemKit. FOUNDATION_EXPORT double MenuItemKitVersionNumber; //! Project version string for MenuItemKit. FOUNDATION_EXPORT const unsigned char MenuItemKitVersionString[];
// // MenuItemKit.h // MenuItemKit // // Created by CHEN Xian’an on 1/16/16. // Copyright © 2016 lazyapps. All rights reserved. // #import <UIKit/UIKit.h> #import <MenuItemKit/Headers.h> //! Project version number for MenuItemKit. FOUNDATION_EXPORT double MenuItemKitVersionNumber; //! Project version string for MenuItemKit. FOUNDATION_EXPORT const unsigned char MenuItemKitVersionString[];
Use brackets for headers as Xcode suggested
Use brackets for headers as Xcode suggested
C
mit
cxa/MenuItemKit,cxa/MenuItemKit
2b71152eafc98a35bca1b99a8fa0ab4a053876f8
RMGallery/RMGallery.h
RMGallery/RMGallery.h
// // RMGallery.h // RMGallery // // Created by Hermés Piqué on 16/05/14. // Copyright (c) 2014 Robot Media. 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. // #import "RMGalleryViewController.h" #import "RMGalleryTransition.h"
// // RMGallery.h // RMGallery // // Created by Hermés Piqué on 16/05/14. // Copyright (c) 2014 Robot Media. 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. // #import "RMGalleryViewController.h" #import "RMGalleryTransition.h"
Add new line at end of file to fix build
Add new line at end of file to fix build
C
apache-2.0
UrbanCompass/RMGallery
c923f1c951486603591d797c5f7fb7a0c2b923a5
FTFountain/iOS/FTFountainiOS.h
FTFountain/iOS/FTFountainiOS.h
// // FTFountainiOS.h // FTFountain // // Created by Tobias Kräntzer on 18.07.15. // Copyright (c) 2015 Tobias Kräntzer. All rights reserved. // // Adapter #import "FTTableViewAdapter.h" #import "FTCollectionViewAdapter.h"
// // FTFountainiOS.h // FTFountain // // Created by Tobias Kräntzer on 18.07.15. // Copyright (c) 2015 Tobias Kräntzer. All rights reserved. // // Adapter #import "FTTableViewAdapter.h" #import "FTTableViewAdapter+Subclassing.h" #import "FTCollectionViewAdapter.h" #import "FTCollectionViewAdapter+Subclassing.h"
Add subclassing headers for the table and collection view adapter to the umbrella header
Add subclassing headers for the table and collection view adapter to the umbrella header
C
bsd-3-clause
anagromataf/Fountain,anagromataf/Fountain
cf0aebe327a7086e4c31a37aaa9b91491c619681
src/Engine/Input.h
src/Engine/Input.h
#pragma once #include "SDL.h" #include "Component.h" #include "Point.h" #define NUM_MOUSE_BUTTONS 5 #define CONTROLLER_JOYSTICK_DEATHZONE 8000 class Input { public: Input(); ~Input(); void Poll(const SDL_Event& e); bool IsKeyPressed(SDL_Scancode key); bool IsKeyHeld(SDL_Scancode key) const; bool IsKeyReleased(SDL_Scancode key); SDL_GameController *controller1 = nullptr; SDL_GameController *controller2 = nullptr; bool IsControllerButtonPressed(SDL_GameController* controller, SDL_GameControllerButton button); bool IsControllerButtonHeld(SDL_GameController* controller, SDL_GameControllerButton button) const; bool IsControllerButtonReleased(SDL_GameController* controller, SDL_GameControllerButton button); bool IsMouseButtonPressed(int button) const; bool IsMouseButtonHeld(int button) const; bool IsMouseButtonReleased(int button) const; float MouseX() const; float MouseY() const; Point GetMousePosition(Point& position) const; private: bool keys[SDL_NUM_SCANCODES]; bool lastKeys[SDL_NUM_SCANCODES]; bool lastControllerButtons[SDL_CONTROLLER_BUTTON_MAX]; void OpenControllers(); bool mouseButtons[NUM_MOUSE_BUTTONS]; bool lastMouseButtons[NUM_MOUSE_BUTTONS]; };
#pragma once #include "SDL.h" #include "Component.h" #include "Point.h" #define NUM_MOUSE_BUTTONS 5 #define CONTROLLER_JOYSTICK_DEATHZONE 8000 class Input { public: Input(); ~Input(); void Poll(const SDL_Event& e); bool IsKeyPressed(SDL_Scancode key); bool IsKeyHeld(SDL_Scancode key) const; bool IsKeyReleased(SDL_Scancode key); SDL_GameController *controller1 = nullptr; SDL_GameController *controller2 = nullptr; bool IsControllerButtonPressed(SDL_GameController* controller, SDL_GameControllerButton button); bool IsControllerButtonHeld(SDL_GameController* controller, SDL_GameControllerButton button) const; bool IsControllerButtonReleased(SDL_GameController* controller, SDL_GameControllerButton button); bool IsMouseButtonPressed(int button) const; bool IsMouseButtonHeld(int button) const; bool IsMouseButtonReleased(int button) const; float MouseX() const; float MouseY() const; Point GetMousePosition(Point& position) const; private: bool keys[SDL_NUM_SCANCODES]; bool lastKeys[SDL_NUM_SCANCODES]; bool lastControllerButtons[SDL_CONTROLLER_BUTTON_MAX]; void OpenControllers(); bool mouseButtons[NUM_MOUSE_BUTTONS]; bool lastMouseButtons[NUM_MOUSE_BUTTONS]; //Might need SDL_MouseMotionEvent instead //Point mousePosition; };
Add mousePosition as Point, now commented for reworking
Add mousePosition as Point, now commented for reworking
C
mit
CollegeBart/bart-sdl-engine-e16,CollegeBart/bart-sdl-engine-e16
a71cffa0a3a3efb64a8ea3b4ce110217f62b90fa
Solutions/03/view.stat.c
Solutions/03/view.stat.c
#include <stdio.h> #include <linux/types.h> #include <unistd.h> #include <fcntl.h> int main (int argc, char * argv []) { __u64 rdtsc = 0; __u64 i = 0; int fileStat = open (argv [1], O_RDONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); while (read (fileStat, &rdtsc, sizeof (rdtsc) ) > 0) { printf ("%llu:\t%llu\n", ++i, rdtsc); } close (fileStat); }
#include <stdio.h> #include <linux/types.h> #include <unistd.h> #include <fcntl.h> #include <stdlib.h> int main (int argc, char * argv []) { __u64 rdtsc = 0; __u64 i = 0; int fileStat = open (argv [1], O_RDONLY, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); while (read (fileStat, &rdtsc, sizeof (rdtsc) ) > 0) { printf ("%llu:\t%llu\n", ++i, rdtsc); } close (fileStat); return EXIT_SUCCESS; }
Fix trivial error: return void in main function.
Fix trivial error: return void in main function.
C
mit
Gluttton/PslRK,Gluttton/PslRK,Gluttton/PslRK
ca7fe8327518ae9d04f8e5b68f01ffabe699db52
native/fallocate_darwin.c
native/fallocate_darwin.c
#define _FILE_OFFSET_BITS 64 #include <fcntl.h> int native_fallocate(int fd, uint64_t len) { fstore_t fstore; fstore.fst_flags = F_ALLOCATECONTIG; fstore.fst_posmode = F_PEOFPOSMODE; fstore.fst_offset = 0; fstore.fst_length = len; fstore.fst_bytesalloc = 0; return fcntl(fd, F_PREALLOCATE, &fstore); }
#define _FILE_OFFSET_BITS 64 #include <fcntl.h> #include <stdint.h> int native_fallocate(int fd, uint64_t len) { fstore_t fstore; fstore.fst_flags = F_ALLOCATECONTIG; fstore.fst_posmode = F_PEOFPOSMODE; fstore.fst_offset = 0; fstore.fst_length = len; fstore.fst_bytesalloc = 0; return fcntl(fd, F_PREALLOCATE, &fstore); }
Add proper header for darwin build
Add proper header for darwin build
C
isc
Luminarys/synapse,Luminarys/synapse,Luminarys/synapse
657f21bee4750eb28dfb4d60662919417a53d724
test/Frontend/ast-main.c
test/Frontend/ast-main.c
// RUN: clang -emit-llvm -S -o %t1.ll %s && // RUN: clang -emit-ast -o %t.ast %s && // RUN: clang -emit-llvm -S -o %t2.ll %t.ast && // RUN: diff %t1.ll %t2.ll // XFAIL: * int main() { return 0; }
Add an XFAIL test which compiles differently from a .ast.
Add an XFAIL test which compiles differently from a .ast. git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@82437 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/clang,llvm-mirror/clang,llvm-mirror/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,apple/swift-clang,apple/swift-clang,apple/swift-clang,apple/swift-clang,llvm-mirror/clang,llvm-mirror/clang,apple/swift-clang,apple/swift-clang,apple/swift-clang
90ed0ea74eee58e37da5efe1ad61dc3d70fee0f8
ExtendTypedef/BuildSignature.h
ExtendTypedef/BuildSignature.h
//use a different header for this section as it needs //the boost pre-processor //next step is to convert the boost mpl types back to a worklet //signature. To get this to work with all functor we need to use //boost pre-processor #if !BOOST_PP_IS_ITERATING # ifndef __buildSignature_ # define __buildSignature_ # include <boost/mpl/at.hpp> # include <boost/preprocessor/iteration/iterate.hpp> # include <boost/preprocessor/repetition/enum_shifted_params.hpp> # include <boost/preprocessor/repetition/enum_shifted.hpp> # define _arg_enum___(x) BOOST_PP_ENUM_SHIFTED(BOOST_PP_ITERATION(), _arg_enum_, x) # define _arg_enum_(z,n,x) x(n) # define _MPL_ARG_(n) typename boost::mpl::at_c<T,n>::type namespace detail { template<int N, typename T> struct BuildSig; # define BOOST_PP_ITERATION_PARAMS_1 (3, (1, 11, "BuildSignature.h")) # include BOOST_PP_ITERATE() } template<typename T> struct BuildSignature { typedef boost::mpl::size<T> Size; typedef typename ::detail::BuildSig<Size::value,T>::type type; }; # endif #else template<typename T> struct BuildSig<BOOST_PP_ITERATION(), T> { typedef typename boost::mpl::at_c<T,0>::type type(_arg_enum___(_MPL_ARG_)); }; #endif
Add code to build arbitrary length function signature from mpl.
Add code to build arbitrary length function signature from mpl.
C
bsd-2-clause
robertmaynard/Sandbox,robertmaynard/Sandbox,robertmaynard/Sandbox,robertmaynard/Sandbox
4390c6c6c9de3934e1bf05cb7132f3ae908a4c35
src/main.c
src/main.c
// Copyright 2016 Mitchell Kember. Subject to the MIT License. #include "translate.h" #include "transmit.h" #include "util.h" #include <stdio.h> #include <unistd.h> int main(int argc, char **argv) { setup_util(argv[0]); // Initialize the default mode. int mode = 'e'; // Get command line options. int c; extern char *optarg; extern int optind, optopt; while ((c = getopt(argc, argv, "hedt")) != -1) { switch (c) { case 'h': print_usage(stdout); return 0; case 'e': case 'd': case 't': mode = c; break; case '?': return 1; } } // Make sure all arguments were processed. if (optind != argc) { print_usage(stderr); return 1; } // Dispatch to the chosen subprogram. switch (mode) { case 'e': return encode(); case 'd': return decode(); case 't': return transmit(); } }
// Copyright 2016 Mitchell Kember. Subject to the MIT License. #include "translate.h" #include "transmit.h" #include "util.h" #include <stdio.h> #include <unistd.h> int main(int argc, char **argv) { setup_util(argv[0]); // Initialize the default mode. int mode = 'e'; // Get command line options. int c; extern char *optarg; extern int optind, optopt; while ((c = getopt(argc, argv, "hedt")) != -1) { switch (c) { case 'h': print_usage(stdout); return 0; case 'e': case 'd': case 't': mode = c; break; case '?': print_usage(stderr); return 1; } } // Make sure all arguments were processed. if (optind != argc) { print_usage(stderr); return 1; } // Dispatch to the chosen subprogram. switch (mode) { case 'e': return encode(); case 'd': return decode(); case 't': return transmit(); } }
Print usage message on getopt error
Print usage message on getopt error
C
mit
mk12/morse
2cc15c99daced80a3d85e0cbd7f7a0d015b18b54
tests/regression/34-congruence/03-branching.c
tests/regression/34-congruence/03-branching.c
// PARAM: --sets solver td3 --enable ana.int.congruence --disable ana.int.def_exc int main(){ // A refinement of a congruence class should only take place for the == and != operator. int i; if (i==0){ assert(i==0); } else { assert(i!=0); //UNKNOWN! } int j; if (j != 0){ assert (j != 0); //UNKNOWN! } else { assert (j == 0); } int k; if (k > 0) { assert (k == 0); //UNKNOWN! } else { assert (k != 0); //UNKNOWN! } return 0; }
Add branching test for congruence domain
Add branching test for congruence domain
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
92ccc1fa3f8ac72673dd56e3d691103c0a6ec871
src/lock.h
src/lock.h
#ifndef LOCK_H #define LOCK_H enum lockstat { GET_LOCK_NOT_GOT=0, GET_LOCK_ERROR, GET_LOCK_GOT }; typedef struct lock lock_t; struct lock { int fd; enum lockstat status; char *path; lock_t *next; }; extern struct lock *lock_alloc(void); extern int lock_init(struct lock *lock, const char *path); extern struct lock *lock_alloc_and_init(const char *path); extern void lock_free(struct lock **lock); // Need to test lock->status to find out what happened when calling these. extern void lock_get_quick(struct lock *lock); extern void lock_get(struct lock *lock); extern int lock_test(const char *path); extern int lock_release(struct lock *lock); extern void lock_add_to_list(struct lock **locklist, struct lock *lock); extern void locks_release_and_free(struct lock **locklist); #endif
#ifndef LOCK_H #define LOCK_H enum lockstat { GET_LOCK_NOT_GOT=0, GET_LOCK_ERROR, GET_LOCK_GOT }; struct lock { int fd; enum lockstat status; char *path; struct lock *next; }; extern struct lock *lock_alloc(void); extern int lock_init(struct lock *lock, const char *path); extern struct lock *lock_alloc_and_init(const char *path); extern void lock_free(struct lock **lock); // Need to test lock->status to find out what happened when calling these. extern void lock_get_quick(struct lock *lock); extern void lock_get(struct lock *lock); extern int lock_test(const char *path); extern int lock_release(struct lock *lock); extern void lock_add_to_list(struct lock **locklist, struct lock *lock); extern void locks_release_and_free(struct lock **locklist); #endif
Fix a build issue on Solaris
Fix a build issue on Solaris
C
agpl-3.0
rubenk/burp,rubenk/burp,rubenk/burp
7b0b2ca43517ef59aa78c3ad4ce2c49df9bffaff
include/private/SkSpinlock.h
include/private/SkSpinlock.h
/* * Copyright 2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkSpinlock_DEFINED #define SkSpinlock_DEFINED #include <atomic> class SkSpinlock { public: void acquire() { // To act as a mutex, we need an acquire barrier when we acquire the lock. if (fLocked.exchange(true, std::memory_order_acquire)) { // Lock was contended. Fall back to an out-of-line spin loop. this->contendedAcquire(); } } void release() { // To act as a mutex, we need a release barrier when we release the lock. fLocked.store(false, std::memory_order_release); } private: void contendedAcquire(); std::atomic<bool> fLocked{false}; }; #endif//SkSpinlock_DEFINED
/* * Copyright 2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ #ifndef SkSpinlock_DEFINED #define SkSpinlock_DEFINED #include "SkTypes.h" #include <atomic> class SkSpinlock { public: void acquire() { // To act as a mutex, we need an acquire barrier when we acquire the lock. if (fLocked.exchange(true, std::memory_order_acquire)) { // Lock was contended. Fall back to an out-of-line spin loop. this->contendedAcquire(); } } void release() { // To act as a mutex, we need a release barrier when we release the lock. fLocked.store(false, std::memory_order_release); } private: SK_API void contendedAcquire(); std::atomic<bool> fLocked{false}; }; #endif//SkSpinlock_DEFINED
Make Cmake work with debug build
Make Cmake work with debug build Before this CL, the following failed to link: cd .../skia git fetch git checkout origin/master git clean -ffdx SKIA="$PWD" cd $(mktemp -d); cmake "${SKIA}/cmake" -DCMAKE_BUILD_TYPE=Debug -G Ninja ninja GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1757993006 Review URL: https://codereview.chromium.org/1757993006
C
bsd-3-clause
HalCanary/skia-hc,google/skia,qrealka/skia-hc,Hikari-no-Tenshi/android_external_skia,HalCanary/skia-hc,google/skia,google/skia,tmpvar/skia.cc,qrealka/skia-hc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,tmpvar/skia.cc,qrealka/skia-hc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,tmpvar/skia.cc,google/skia,rubenvb/skia,aosp-mirror/platform_external_skia,google/skia,HalCanary/skia-hc,rubenvb/skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,tmpvar/skia.cc,tmpvar/skia.cc,qrealka/skia-hc,rubenvb/skia,tmpvar/skia.cc,aosp-mirror/platform_external_skia,HalCanary/skia-hc,aosp-mirror/platform_external_skia,qrealka/skia-hc,tmpvar/skia.cc,Hikari-no-Tenshi/android_external_skia,aosp-mirror/platform_external_skia,rubenvb/skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,HalCanary/skia-hc,aosp-mirror/platform_external_skia,google/skia,aosp-mirror/platform_external_skia,Hikari-no-Tenshi/android_external_skia,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,HalCanary/skia-hc,qrealka/skia-hc,google/skia,google/skia,google/skia,aosp-mirror/platform_external_skia,aosp-mirror/platform_external_skia,HalCanary/skia-hc,tmpvar/skia.cc,tmpvar/skia.cc,rubenvb/skia,google/skia,qrealka/skia-hc,Hikari-no-Tenshi/android_external_skia,rubenvb/skia,HalCanary/skia-hc,HalCanary/skia-hc,qrealka/skia-hc
9b4050f924a3ac59e1a390fff1ca94690c7b648c
hw/mcu/nordic/nrf52xxx-compat/include/nrfx_config.h
hw/mcu/nordic/nrf52xxx-compat/include/nrfx_config.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 NRFX_CONFIG_H__ #define NRFX_CONFIG_H__ #if NRF52 #include "../../nrf52xxx-compat/include/nrfx52_config.h" #elif NRF52840_XXAA #include "../../nrf52xxx-compat/include/nrfx52840_config.h" #else #error Unsupported chip selected #endif #endif // NRFX_CONFIG_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 NRFX_CONFIG_H__ #define NRFX_CONFIG_H__ #if NRF52 #include "nrfx52_config.h" #elif NRF52840_XXAA #include "nrfx52840_config.h" #else #error Unsupported chip selected #endif #endif // NRFX_CONFIG_H__
Fix weird includes in compat package
hw/mcu/nordic: Fix weird includes in compat package
C
apache-2.0
mlaz/mynewt-core,mlaz/mynewt-core,mlaz/mynewt-core,mlaz/mynewt-core,mlaz/mynewt-core
3c701bdbd8c761b885c8f7332b034ab6c6b6daab
core/metautils/src/vectorLinkdef.h
core/metautils/src/vectorLinkdef.h
#include <string> #include <vector> #ifndef __hpux using namespace std; #endif #pragma create TClass vector<bool>; #pragma create TClass vector<char>; #pragma create TClass vector<short>; #pragma create TClass vector<long>; #pragma create TClass vector<unsigned char>; #pragma create TClass vector<unsigned short>; #pragma create TClass vector<unsigned int>; #pragma create TClass vector<unsigned long>; #pragma create TClass vector<float>; #pragma create TClass vector<double>; #pragma create TClass vector<char*>; #pragma create TClass vector<const char*>; #pragma create TClass vector<string>; #if (!(G__GNUC==3 && G__GNUC_MINOR==1)) && !defined(G__KCC) && (!defined(G__VISUAL) || G__MSC_VER<1300) // gcc3.1,3.2 has a problem with iterator<void*,...,void&> #pragma create TClass vector<void*>; #endif
#include <string> #include <vector> #ifndef __hpux using namespace std; #endif #pragma create TClass vector<bool>; #pragma create TClass vector<char>; #pragma create TClass vector<short>; #pragma create TClass vector<long>; #pragma create TClass vector<unsigned char>; #pragma create TClass vector<unsigned short>; #pragma create TClass vector<unsigned int>; #pragma create TClass vector<unsigned long>; #pragma create TClass vector<float>; #pragma create TClass vector<double>; #pragma create TClass vector<char*>; #pragma create TClass vector<const char*>; #pragma create TClass vector<string>; #pragma create TClass vector<Long64_t>; #pragma create TClass vector<ULong64_t>; #if (!(G__GNUC==3 && G__GNUC_MINOR==1)) && !defined(G__KCC) && (!defined(G__VISUAL) || G__MSC_VER<1300) // gcc3.1,3.2 has a problem with iterator<void*,...,void&> #pragma create TClass vector<void*>; #endif
Add missing TClass creation for vector<Long64_t> and vector<ULong64_t>
Add missing TClass creation for vector<Long64_t> and vector<ULong64_t> git-svn-id: acec3fd5b7ea1eb9e79d6329d318e8118ee2e14f@38659 27541ba8-7e3a-0410-8455-c3a389f83636
C
lgpl-2.1
thomaskeck/root,Duraznos/root,beniz/root,perovic/root,perovic/root,Y--/root,agarciamontoro/root,georgtroska/root,sawenzel/root,gganis/root,nilqed/root,buuck/root,buuck/root,simonpf/root,nilqed/root,davidlt/root,omazapa/root,0x0all/ROOT,perovic/root,veprbl/root,esakellari/my_root_for_test,lgiommi/root,dfunke/root,ffurano/root5,ffurano/root5,BerserkerTroll/root,BerserkerTroll/root,mattkretz/root,tc3t/qoot,abhinavmoudgil95/root,esakellari/my_root_for_test,esakellari/my_root_for_test,gganis/root,davidlt/root,0x0all/ROOT,olifre/root,gganis/root,evgeny-boger/root,krafczyk/root,bbockelm/root,zzxuanyuan/root-compressor-dummy,davidlt/root,Y--/root,BerserkerTroll/root,cxx-hep/root-cern,lgiommi/root,omazapa/root-old,arch1tect0r/root,CristinaCristescu/root,smarinac/root,evgeny-boger/root,esakellari/root,gbitzes/root,gganis/root,beniz/root,kirbyherm/root-r-tools,beniz/root,thomaskeck/root,nilqed/root,omazapa/root-old,jrtomps/root,beniz/root,evgeny-boger/root,arch1tect0r/root,gbitzes/root,sirinath/root,perovic/root,buuck/root,davidlt/root,tc3t/qoot,zzxuanyuan/root,perovic/root,esakellari/root,mattkretz/root,lgiommi/root,agarciamontoro/root,gbitzes/root,karies/root,vukasinmilosevic/root,dfunke/root,simonpf/root,BerserkerTroll/root,zzxuanyuan/root-compressor-dummy,olifre/root,abhinavmoudgil95/root,pspe/root,BerserkerTroll/root,mhuwiler/rootauto,bbockelm/root,mhuwiler/rootauto,mkret2/root,Dr15Jones/root,nilqed/root,Y--/root,tc3t/qoot,dfunke/root,evgeny-boger/root,veprbl/root,mkret2/root,CristinaCristescu/root,veprbl/root,kirbyherm/root-r-tools,evgeny-boger/root,veprbl/root,zzxuanyuan/root,mhuwiler/rootauto,buuck/root,karies/root,georgtroska/root,omazapa/root-old,Y--/root,0x0all/ROOT,satyarth934/root,simonpf/root,zzxuanyuan/root-compressor-dummy,arch1tect0r/root,agarciamontoro/root,jrtomps/root,simonpf/root,Dr15Jones/root,thomaskeck/root,zzxuanyuan/root,sbinet/cxx-root,esakellari/root,gbitzes/root,veprbl/root,Y--/root,tc3t/qoot,zzxuanyuan/root,satyarth934/root,perovic/root,mattkretz/root,olifre/root,pspe/root,CristinaCristescu/root,satyarth934/root,CristinaCristescu/root,zzxuanyuan/root,ffurano/root5,esakellari/root,pspe/root,jrtomps/root,mkret2/root,satyarth934/root,bbockelm/root,strykejern/TTreeReader,esakellari/root,Dr15Jones/root,veprbl/root,cxx-hep/root-cern,0x0all/ROOT,sawenzel/root,beniz/root,zzxuanyuan/root,zzxuanyuan/root-compressor-dummy,karies/root,beniz/root,zzxuanyuan/root,sawenzel/root,Y--/root,sawenzel/root,zzxuanyuan/root-compressor-dummy,Dr15Jones/root,nilqed/root,simonpf/root,esakellari/root,satyarth934/root,georgtroska/root,perovic/root,lgiommi/root,abhinavmoudgil95/root,karies/root,esakellari/my_root_for_test,satyarth934/root,mkret2/root,root-mirror/root,sbinet/cxx-root,agarciamontoro/root,sirinath/root,zzxuanyuan/root-compressor-dummy,0x0all/ROOT,buuck/root,ffurano/root5,mattkretz/root,root-mirror/root,lgiommi/root,vukasinmilosevic/root,thomaskeck/root,olifre/root,bbockelm/root,kirbyherm/root-r-tools,alexschlueter/cern-root,Y--/root,vukasinmilosevic/root,root-mirror/root,veprbl/root,esakellari/my_root_for_test,abhinavmoudgil95/root,sawenzel/root,esakellari/root,georgtroska/root,Y--/root,esakellari/root,jrtomps/root,sirinath/root,abhinavmoudgil95/root,buuck/root,gbitzes/root,omazapa/root,nilqed/root,mkret2/root,georgtroska/root,sawenzel/root,karies/root,nilqed/root,evgeny-boger/root,BerserkerTroll/root,nilqed/root,nilqed/root,buuck/root,strykejern/TTreeReader,cxx-hep/root-cern,olifre/root,sbinet/cxx-root,mattkretz/root,root-mirror/root,sirinath/root,tc3t/qoot,strykejern/TTreeReader,Duraznos/root,pspe/root,jrtomps/root,davidlt/root,simonpf/root,sbinet/cxx-root,mattkretz/root,gganis/root,lgiommi/root,dfunke/root,satyarth934/root,esakellari/my_root_for_test,satyarth934/root,BerserkerTroll/root,olifre/root,simonpf/root,omazapa/root,arch1tect0r/root,CristinaCristescu/root,Duraznos/root,karies/root,Dr15Jones/root,CristinaCristescu/root,zzxuanyuan/root-compressor-dummy,pspe/root,mhuwiler/rootauto,karies/root,strykejern/TTreeReader,zzxuanyuan/root-compressor-dummy,root-mirror/root,strykejern/TTreeReader,jrtomps/root,alexschlueter/cern-root,satyarth934/root,karies/root,zzxuanyuan/root,krafczyk/root,root-mirror/root,evgeny-boger/root,perovic/root,Y--/root,kirbyherm/root-r-tools,gbitzes/root,gbitzes/root,satyarth934/root,krafczyk/root,bbockelm/root,bbockelm/root,CristinaCristescu/root,nilqed/root,Duraznos/root,thomaskeck/root,smarinac/root,kirbyherm/root-r-tools,karies/root,georgtroska/root,lgiommi/root,ffurano/root5,pspe/root,Y--/root,omazapa/root,smarinac/root,sbinet/cxx-root,gbitzes/root,jrtomps/root,dfunke/root,mattkretz/root,tc3t/qoot,abhinavmoudgil95/root,zzxuanyuan/root,pspe/root,sirinath/root,sirinath/root,mhuwiler/rootauto,sawenzel/root,omazapa/root-old,dfunke/root,abhinavmoudgil95/root,zzxuanyuan/root-compressor-dummy,krafczyk/root,ffurano/root5,zzxuanyuan/root,strykejern/TTreeReader,Duraznos/root,krafczyk/root,omazapa/root-old,alexschlueter/cern-root,georgtroska/root,CristinaCristescu/root,thomaskeck/root,vukasinmilosevic/root,sirinath/root,0x0all/ROOT,omazapa/root,tc3t/qoot,agarciamontoro/root,evgeny-boger/root,simonpf/root,davidlt/root,strykejern/TTreeReader,gganis/root,smarinac/root,root-mirror/root,omazapa/root-old,0x0all/ROOT,mhuwiler/rootauto,cxx-hep/root-cern,davidlt/root,dfunke/root,abhinavmoudgil95/root,alexschlueter/cern-root,omazapa/root,buuck/root,dfunke/root,mhuwiler/rootauto,esakellari/root,beniz/root,thomaskeck/root,CristinaCristescu/root,sbinet/cxx-root,dfunke/root,alexschlueter/cern-root,Duraznos/root,smarinac/root,gganis/root,gganis/root,mkret2/root,root-mirror/root,satyarth934/root,karies/root,Duraznos/root,zzxuanyuan/root-compressor-dummy,ffurano/root5,esakellari/my_root_for_test,cxx-hep/root-cern,omazapa/root-old,agarciamontoro/root,sbinet/cxx-root,mkret2/root,gganis/root,sirinath/root,sirinath/root,Dr15Jones/root,0x0all/ROOT,perovic/root,jrtomps/root,vukasinmilosevic/root,olifre/root,olifre/root,mhuwiler/rootauto,BerserkerTroll/root,thomaskeck/root,alexschlueter/cern-root,root-mirror/root,thomaskeck/root,krafczyk/root,olifre/root,sbinet/cxx-root,tc3t/qoot,omazapa/root-old,agarciamontoro/root,perovic/root,omazapa/root,omazapa/root-old,arch1tect0r/root,gbitzes/root,sbinet/cxx-root,arch1tect0r/root,kirbyherm/root-r-tools,davidlt/root,smarinac/root,krafczyk/root,beniz/root,agarciamontoro/root,agarciamontoro/root,esakellari/my_root_for_test,omazapa/root-old,cxx-hep/root-cern,simonpf/root,gbitzes/root,davidlt/root,simonpf/root,Duraznos/root,lgiommi/root,omazapa/root,smarinac/root,pspe/root,pspe/root,georgtroska/root,veprbl/root,alexschlueter/cern-root,sawenzel/root,smarinac/root,bbockelm/root,Duraznos/root,veprbl/root,zzxuanyuan/root-compressor-dummy,esakellari/my_root_for_test,georgtroska/root,vukasinmilosevic/root,sbinet/cxx-root,root-mirror/root,mhuwiler/rootauto,omazapa/root,gbitzes/root,vukasinmilosevic/root,agarciamontoro/root,arch1tect0r/root,mattkretz/root,beniz/root,mhuwiler/rootauto,mhuwiler/rootauto,lgiommi/root,buuck/root,Duraznos/root,georgtroska/root,CristinaCristescu/root,BerserkerTroll/root,bbockelm/root,sawenzel/root,dfunke/root,Dr15Jones/root,veprbl/root,root-mirror/root,arch1tect0r/root,nilqed/root,sbinet/cxx-root,CristinaCristescu/root,krafczyk/root,lgiommi/root,BerserkerTroll/root,jrtomps/root,beniz/root,omazapa/root,arch1tect0r/root,perovic/root,mkret2/root,mattkretz/root,davidlt/root,vukasinmilosevic/root,beniz/root,olifre/root,omazapa/root,esakellari/root,pspe/root,krafczyk/root,vukasinmilosevic/root,vukasinmilosevic/root,tc3t/qoot,thomaskeck/root,jrtomps/root,bbockelm/root,smarinac/root,agarciamontoro/root,evgeny-boger/root,abhinavmoudgil95/root,cxx-hep/root-cern,davidlt/root,zzxuanyuan/root,sirinath/root,sawenzel/root,mattkretz/root,0x0all/ROOT,mattkretz/root,bbockelm/root,lgiommi/root,esakellari/root,Duraznos/root,esakellari/my_root_for_test,krafczyk/root,simonpf/root,zzxuanyuan/root,vukasinmilosevic/root,georgtroska/root,arch1tect0r/root,bbockelm/root,BerserkerTroll/root,gganis/root,omazapa/root-old,karies/root,sirinath/root,evgeny-boger/root,sawenzel/root,smarinac/root,Y--/root,dfunke/root,krafczyk/root,arch1tect0r/root,jrtomps/root,buuck/root,olifre/root,abhinavmoudgil95/root,tc3t/qoot,evgeny-boger/root,kirbyherm/root-r-tools,abhinavmoudgil95/root,pspe/root,mkret2/root,cxx-hep/root-cern,mkret2/root,veprbl/root,buuck/root,gganis/root,mkret2/root
b49fa616d47a39193c59d610964276ddb1df732a
runtime/GCCLibraries/libc/memory.c
runtime/GCCLibraries/libc/memory.c
//===-- memory.c - String functions for the LLVM libc Library ----*- C -*-===// // // A lot of this code is ripped gratuitously from glibc and libiberty. // //===----------------------------------------------------------------------===// #include <stdlib.h> void *malloc(size_t) __attribute__((weak)); void free(void *) __attribute__((weak)); void *memset(void *, int, size_t) __attribute__((weak)); void *calloc(size_t nelem, size_t elsize) __attribute__((weak)); void *calloc(size_t nelem, size_t elsize) { void *Result = malloc(nelem*elsize); return memset(Result, 0, nelem*elsize); }
//===-- memory.c - String functions for the LLVM libc Library ----*- C -*-===// // // A lot of this code is ripped gratuitously from glibc and libiberty. // //===---------------------------------------------------------------------===// #include <stdlib.h> // If we're not being compiled with GCC, turn off attributes. Question is how // to handle overriding of memory allocation functions in that case. #ifndef __GNUC__ #define __attribute__(X) #endif // For now, turn off the weak linkage attribute on Mac OS X. #if defined(__GNUC__) && defined(__APPLE_CC__) #define __ATTRIBUTE_WEAK__ #elif defined(__GNUC__) #define __ATTRIBUTE_WEAK__ __attribute__((weak)) #else #define __ATTRIBUTE_WEAK__ #endif void *malloc(size_t) __ATTRIBUTE_WEAK__; void free(void *) __ATTRIBUTE_WEAK__; void *memset(void *, int, size_t) __ATTRIBUTE_WEAK__; void *calloc(size_t nelem, size_t elsize) __ATTRIBUTE_WEAK__; void *calloc(size_t nelem, size_t elsize) { void *Result = malloc(nelem*elsize); return memset(Result, 0, nelem*elsize); }
Disable __attribute__((weak)) on Mac OS X and other lame platforms.
Disable __attribute__((weak)) on Mac OS X and other lame platforms. git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@10489 91177308-0d34-0410-b5e6-96231b3b80d8
C
bsd-2-clause
dslab-epfl/asap,GPUOpen-Drivers/llvm,apple/swift-llvm,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,dslab-epfl/asap,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,apple/swift-llvm,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,dslab-epfl/asap,llvm-mirror/llvm
127cab2cc7e9b6f474d4768b173af630d8b81840
runtime/libprofile/EdgeProfiling.c
runtime/libprofile/EdgeProfiling.c
/*===-- EdgeProfiling.c - Support library for edge profiling --------------===*\ |* |* The LLVM Compiler Infrastructure |* |* This file was developed by the LLVM research group and is distributed under |* the University of Illinois Open Source License. See LICENSE.TXT for details. |* |*===----------------------------------------------------------------------===*| |* |* This file implements the call back routines for the edge profiling |* instrumentation pass. This should be used with the -insert-edge-profiling |* LLVM pass. |* \*===----------------------------------------------------------------------===*/ #include "Profiling.h" #include <stdlib.h> static unsigned *ArrayStart; static unsigned NumElements; /* EdgeProfAtExitHandler - When the program exits, just write out the profiling * data. */ static void EdgeProfAtExitHandler() { /* Note that if this were doing something more intellegent with the instrumentation, that we could do some computation here to expand what we collected into simple edge profiles. Since we directly count each edge, we just write out all of the counters directly. */ write_profiling_data(Edge, ArrayStart, NumElements); } /* llvm_start_edge_profiling - This is the main entry point of the edge * profiling library. It is responsible for setting up the atexit handler. */ int llvm_start_edge_profiling(int argc, const char **argv, unsigned *arrayStart, unsigned numElements) { int Ret = save_arguments(argc, argv); ArrayStart = arrayStart; NumElements = numElements; atexit(EdgeProfAtExitHandler); return Ret; }
Add edge profiling support to the runtime library
Add edge profiling support to the runtime library git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@12227 91177308-0d34-0410-b5e6-96231b3b80d8
C
apache-2.0
llvm-mirror/llvm,llvm-mirror/llvm,chubbymaggie/asap,chubbymaggie/asap,llvm-mirror/llvm,apple/swift-llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,dslab-epfl/asap,chubbymaggie/asap,GPUOpen-Drivers/llvm,GPUOpen-Drivers/llvm,chubbymaggie/asap,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,apple/swift-llvm,GPUOpen-Drivers/llvm,dslab-epfl/asap,llvm-mirror/llvm,GPUOpen-Drivers/llvm,llvm-mirror/llvm,llvm-mirror/llvm,apple/swift-llvm,apple/swift-llvm,dslab-epfl/asap,dslab-epfl/asap,chubbymaggie/asap,dslab-epfl/asap,chubbymaggie/asap,apple/swift-llvm
99cfb3fab40afe555fc0c84292630d04f10301ce
tests/regression/36-octapron/42-threadenter-arg.c
tests/regression/36-octapron/42-threadenter-arg.c
// SKIP PARAM: --sets ana.activated[+] octApron #include <pthread.h> #include <assert.h> void *t_fun(int arg) { assert(arg == 3); // TODO (cast through void*) return NULL; } int main(void) { int x = 3; pthread_t id; pthread_create(&id, NULL, t_fun, x); return 0; }
Add octApron test where thread function has tracked arg
Add octApron test where thread function has tracked arg
C
mit
goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer
24663de702224e464ac5036ddea96f4cc070f090
TrackingControllerDefs.h
TrackingControllerDefs.h
// // TrackingControllerDefs.h // // Created by Matt Martel on 02/20/09 // Copyright Mundue LLC 2008-2011. All rights reserved. // // Create an account at http://www.flurry.com // Code and integration instructions at // http://dev.flurry.com/createProjectSelectPlatform.do #define USES_FLURRY #define kFlurryAPIKey @"YOUR_FLURRY_API_KEY" // Create an account at http://www.localytics.com // Code and integration instructions at // http://wiki.localytics.com/doku.php #define USES_LOCALYTICS #define kLocalyticsAppKey @"YOUR_LOCALITICS_APP_KEY" // Create an account at http://www.google.com/analytics // Code and integration instructions at // http://code.google.com/mobile/analytics/docs/iphone/ #define USES_GANTRACKER #define kGANAccountIDKey @"YOUR_GOOGLE_ANALYTICS_ACCOUNT_ID" #define kGANCategoryKey @"YOUR_APP_NAME"
// // TrackingControllerDefs.h // // Created by Matt Martel on 02/20/09 // Copyright Mundue LLC 2008-2011. All rights reserved. // // Create an account at http://www.flurry.com // Code and integration instructions at // http://dev.flurry.com/createProjectSelectPlatform.do // Uncomment the following two lines to use Flurry //#define USES_FLURRY //#define kFlurryAPIKey @"YOUR_FLURRY_API_KEY" // Create an account at http://www.localytics.com // Code and integration instructions at // http://wiki.localytics.com/doku.php // Uncomment the following two lines to use Localytics //#define USES_LOCALYTICS //#define kLocalyticsAppKey @"YOUR_LOCALITICS_APP_KEY" // Create an account at http://www.google.com/analytics // Code and integration instructions at // http://code.google.com/mobile/analytics/docs/iphone/ // Uncomment the following three lines to use Google Analytics //#define USES_GANTRACKER //#define kGANAccountIDKey @"YOUR_GOOGLE_ANALYTICS_ACCOUNT_ID" //#define kGANCategoryKey @"YOUR_APP_NAME"
Comment out services by default
Comment out services by default
C
mit
mundue/MMTrackingController
a1649d151f681dc4b3d8d65fabc5bedee80b3e0e
driver/ioexpander_pca9555.h
driver/ioexpander_pca9555.h
/* Copyright 2017 The Chromium OS Authors. All rights reserved. * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. * * NXP PCA9555 I/O Port expander driver header */ #ifndef __CROS_EC_IOEXPANDER_PCA9555_H #define __CROS_EC_IOEXPANDER_PCA9555_H #include "i2c.h" #define PCA9555_CMD_INPUT_PORT_0 0 #define PCA9555_CMD_INPUT_PORT_1 1 #define PCA9555_CMD_OUTPUT_PORT_0 2 #define PCA9555_CMD_OUTPUT_PORT_1 3 #define PCA9555_CMD_POLARITY_INVERSION_PORT_0 4 #define PCA9555_CMD_POLARITY_INVERSION_PORT_1 5 #define PCA9555_CMD_CONFIGURATION_PORT_0 6 #define PCA9555_CMD_CONFIGURATION_PORT_1 7 #define PCA9555_IO_0 (1 << 0) #define PCA9555_IO_1 (1 << 1) #define PCA9555_IO_2 (1 << 2) #define PCA9555_IO_3 (1 << 3) #define PCA9555_IO_4 (1 << 4) #define PCA9555_IO_5 (1 << 5) #define PCA9555_IO_6 (1 << 6) #define PCA9555_IO_7 (1 << 7) static inline int pca9555_read(int port, int addr, int reg, int *data_ptr) { return i2c_read8(port, addr, reg, data_ptr); } static inline int pca9555_write(int port, int addr, int reg, int data) { return i2c_write8(port, addr, reg, data); } #endif /* __CROS_EC_IOEXPANDER_PCA9555_H */
Add driver header for PCA9555 I/O port controller
driver: Add driver header for PCA9555 I/O port controller BUG=b:64394037 BRANCH=glkrvp TEST=Manually tested on GLKRVP, i2cxfer works Change-Id: If65e5039987ecbb7fa2a3a5eeeef5af6d73ab66a Signed-off-by: Vijay Hiremath <[email protected]> Reviewed-on: https://chromium-review.googlesource.com/603987 Commit-Ready: Vijay P Hiremath <[email protected]> Tested-by: Vijay P Hiremath <[email protected]> Reviewed-by: Aaron Durbin <[email protected]> Reviewed-by: Aseda Aboagye <[email protected]>
C
bsd-3-clause
coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec,coreboot/chrome-ec
be6731907e49267c90782990833b71513d3ae7f6
solutions/uri/1061/1061.c
solutions/uri/1061/1061.c
#include <stdio.h> int main() { int d, dd, h, hh, m, mm, s, ss; scanf("Dia %d", &d); scanf("%d : %d : %d\n", &h, &m, &s); scanf("Dia %d", &dd); scanf("%d : %d : %d", &hh, &mm, &ss); s = ss - s; m = mm - m; h = hh - h; d = dd - d; if (s < 0) { s += 60; m--; } if (m < 0) { m += 60; h--; } if (h < 0) { h += 24; d--; } printf("%d dia(s)\n", d); printf("%d hora(s)\n", h); printf("%d minuto(s)\n", m); printf("%d segundo(s)\n", s); return 0; }
Solve Event Time in c
Solve Event Time in c
C
mit
deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground
dc6eb0cb921f9b92a234145877fc8036b224df29
tests/test_lexlines.c
tests/test_lexlines.c
/* Tests for preprocessor rules, comments, line continuations, etc.*/ #include <sys/neutrino.h> // comment #include <sys/mman.h> // comment #include <xxx.h> // comment \ comment REGULAR LINE #include <xxx.h> // comment \ REGULAR LINE #include \ <xxx.h> <REGULAR LINE> #define macro // comment \ comment #define macro() /* block comment \ comment */ body \ #define NOT_A_NAME, still the body \ void not_a_function(void) {} #define exprintf(expr, \ /* optional */ msg...) \ __exprintf(#expr, \ (int) (expr), \ "%s: %d\n" msg) #define __exprintf(str_expr, \ expr, fmt, args...) \ printf(fmt, \ str_expr, expr, ##args) #if 0 #define COMMENT comment #endif // comment \ // comment \ still a comment REGULAR LINE // comment /* block */ comment #assert <- DEPRECATED #sdfasd <- INVALID #line
Add a test for line-based rules
lex-continuation: Add a test for line-based rules I.e. # preprocessor directives, // line comments, \ line continuations and their inter-op.
C
mit
abusalimov/SublimeCImproved,abusalimov/SublimeCImproved
e4f4ddadac119535f6cd7e1eb612f3de35100516
include/tasks/train_master.h
include/tasks/train_master.h
#ifndef __TRAIN_MASTER_H__ #define __TRAIN_MASTER_H__ void __attribute__ ((noreturn)) train_master(); typedef enum { MASTER_CHANGE_SPEED, MASTER_REVERSE, // step 1 MASTER_REVERSE2, // step 2 (used by delay courier) MASTER_REVERSE3, // step 3 (used by delay courier) MASTER_WHERE_ARE_YOU, MASTER_STOP_AT_SENSOR, MASTER_GOTO_LOCATION, MASTER_DUMP_VELOCITY_TABLE, MASTER_UPDATE_FEEDBACK_THRESHOLD, MASTER_UPDATE_FEEDBACK_ALPHA, MASTER_UPDATE_STOP_OFFSET, MASTER_UPDATE_CLEARANCE_OFFSET, MASTER_ACCELERATION_COMPLETE, MASTER_NEXT_NODE_ESTIMATE, MASTER_SENSOR_FEEDBACK, MASTER_UNEXPECTED_SENSOR_FEEDBACK } master_req_type; typedef struct { master_req_type type; int arg1; int arg2; int arg3; } master_req; #endif
#ifndef __TRAIN_MASTER_H__ #define __TRAIN_MASTER_H__ void __attribute__ ((noreturn)) train_master(); typedef enum { MASTER_CHANGE_SPEED, MASTER_REVERSE, // step 1 MASTER_REVERSE2, // step 2 (used by delay courier) MASTER_REVERSE3, // step 3 (used by delay courier) MASTER_WHERE_ARE_YOU, MASTER_STOP_AT_SENSOR, MASTER_GOTO_LOCATION, MASTER_DUMP_VELOCITY_TABLE, MASTER_UPDATE_FEEDBACK_THRESHOLD, MASTER_UPDATE_FEEDBACK_ALPHA, MASTER_UPDATE_STOP_OFFSET, MASTER_UPDATE_CLEARANCE_OFFSET, MASTER_ACCELERATION_COMPLETE, MASTER_NEXT_NODE_ESTIMATE, MASTER_SENSOR_FEEDBACK, MASTER_UNEXPECTED_SENSOR_FEEDBACK } master_req_type; typedef struct { master_req_type type; int arg1; int arg2; } master_req; #endif
Remove unused argument space from master req
Remove unused argument space from master req
C
mit
ferrous26/cs452-flaming-meme,ferrous26/cs452-flaming-meme,ferrous26/cs452-flaming-meme
61797de177d095713049cbd8c4f830cc5d0c7045
BotKit/BotKit.h
BotKit/BotKit.h
// // BotKit.h // BotKit // // Created by Mark Adams on 9/28/12. // Copyright (c) 2012 thoughtbot. All rights reserved. // #import "BKCoreDataManager.h" #import "BKManagedViewController.h" #import "BKManagedTableViewController.h" #import "NSObject+BKCoding.h" #import "NSArray+ObjectAccess.h" #import "NSDate+RelativeDates.h" #import "UIColor+AdjustColor.h" #import "UIColor+Serialization.h" /* TODOS: BKImageLoader -imageWithContentsOfURL:completionHandler: -imageWithContentsOFURLPath:completionHandler: UIImage: +imageWithContentsOfURLPath: NSURLRequest: +requestWithString: +requestWithURL: NSDate: -dateStringWithFormat: -dateStringWithStyle: */
// // BotKit.h // BotKit // // Created by Mark Adams on 9/28/12. // Copyright (c) 2012 thoughtbot. All rights reserved. // #import "BKCoreDataManager.h" #import "BKManagedViewController.h" #import "BKManagedTableViewController.h" #import "NSObject+BKCoding.h" #import "NSArray+ObjectAccess.h" #import "NSDate+RelativeDates.h" #import "UIColor+AdjustColor.h" #import "UIColor+Serialization.h" #import "NSData+Base64Encoding.h" /* TODOS: BKImageLoader -imageWithContentsOfURL:completionHandler: -imageWithContentsOFURLPath:completionHandler: UIImage: +imageWithContentsOfURLPath: NSURLRequest: +requestWithString: +requestWithURL: NSDate: -dateStringWithFormat: -dateStringWithStyle: */
Add NSData+Base64Encoding.h to main header
Add NSData+Base64Encoding.h to main header
C
mit
thoughtbot/BotKit,thoughtbot/BotKit
f3e611c9e373a0147be472cb7913f3604baf2a08
log.c
log.c
#include "log.h" #include "timeutil.h" #include <stdarg.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> static bool flushAfterLog = false; void proxyLogSetFlush(bool enabled) { flushAfterLog = enabled; } void proxyLog(const char* format, ...) { va_list args; va_start(args, format); printTimeString(); printf(" "); vprintf(format, args); printf("\n"); if (flushAfterLog) { fflush(stdout); } va_end(args); }
#include "log.h" #include "timeutil.h" #include <stdarg.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <string.h> static bool flushAfterLog = false; void proxyLogSetFlush(bool enabled) { flushAfterLog = enabled; } void proxyLog(const char* format, ...) { va_list args; va_start(args, format); printTimeString(); putchar(' '); vprintf(format, args); putchar('\n'); if (flushAfterLog) { fflush(stdout); } va_end(args); }
Use putchar instead of printf.
Use putchar instead of printf.
C
mit
aaronriekenberg/openbsd_cproxy,aaronriekenberg/openbsd_cproxy
ad9cd9bfff8f0b7428c68ba02857a5789d8c3b77
demo/embedding/helloworld.c
demo/embedding/helloworld.c
#include <stdio.h> #include <mpi.h> #include <Python.h> const char helloworld[] = \ "from mpi4py import MPI \n" "hwmess = 'Hello, World! I am process %d of %d on %s.' \n" "myrank = MPI.COMM_WORLD.Get_rank() \n" "nprocs = MPI.COMM_WORLD.Get_size() \n" "procnm = MPI.Get_processor_name() \n" "print (hwmess % (myrank, nprocs, procnm)) \n" ""; int main(int argc, char *argv[]) { int ierr, rank, size; ierr = MPI_Init(&argc, &argv); ierr = MPI_Comm_rank(MPI_COMM_WORLD, &rank); ierr = MPI_Comm_size(MPI_COMM_WORLD, &size); MPI_Barrier(MPI_COMM_WORLD); Py_Initialize(); PyRun_SimpleString(helloworld); Py_Finalize(); MPI_Barrier(MPI_COMM_WORLD); if (rank == 0) { printf("\n"); fflush(stdout); fflush(stderr); } MPI_Barrier(MPI_COMM_WORLD); Py_Initialize(); PyRun_SimpleString(helloworld); Py_Finalize(); MPI_Barrier(MPI_COMM_WORLD); ierr = MPI_Finalize(); return 0; }
/* * You can use safely use mpi4py between multiple * Py_Initialize()/Py_Finalize() calls ... * but do not blame me for the memory leaks ;-) * */ #include <mpi.h> #include <Python.h> const char helloworld[] = \ "from mpi4py import MPI \n" "hwmess = 'Hello, World! I am process %d of %d on %s.' \n" "myrank = MPI.COMM_WORLD.Get_rank() \n" "nprocs = MPI.COMM_WORLD.Get_size() \n" "procnm = MPI.Get_processor_name() \n" "print (hwmess % (myrank, nprocs, procnm)) \n" ""; int main(int argc, char *argv[]) { int i,n=5; MPI_Init(&argc, &argv); for (i=0; i<n; i++) { Py_Initialize(); PyRun_SimpleString(helloworld); Py_Finalize(); } MPI_Finalize(); return 0; }
Update and simplify embedding demo
Update and simplify embedding demo
C
bsd-2-clause
pressel/mpi4py,pressel/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py,mpi4py/mpi4py,pressel/mpi4py,pressel/mpi4py
c3aad0461ff755aaf50dc5c734f362fc488b6d31
utility.h
utility.h
#pragma once namespace mmh { template <typename Size, typename Object> constexpr Size sizeof_t() { return gsl::narrow<Size>(sizeof Object); } template <typename Size, typename Value> constexpr Size sizeof_t(const Value& value) { return gsl::narrow<Size>(sizeof value); } } // namespace mmh
#pragma once namespace mmh { template <typename Size, typename Object> constexpr Size sizeof_t() { return gsl::narrow<Size>(sizeof(Object)); } template <typename Size, typename Value> constexpr Size sizeof_t(const Value& value) { return gsl::narrow<Size>(sizeof value); } } // namespace mmh
Add missing brackets needed for Clang
Add missing brackets needed for Clang
C
bsd-3-clause
reupen/mmh,reupen/mmh
2953f13d4dd38f06ae52ff09532bc2e401c46738
src/main.c
src/main.c
#include <pebble.h> #include "pebcessing/pebcessing.h" static Window *window = NULL; static void init(void) { window = window_create(); window_set_fullscreen(window, true); window_stack_push(window, true); } static void deinit(void) { window_destroy(window); } int main(void) { init(); init_pebcessing(window, window_get_root_layer(window)); app_event_loop(); deinit_pebcessing(); deinit(); return 0; }
#include <pebble.h> #include "pebcessing/pebcessing.h" static Window *window = NULL; static void init(void) { window = window_create(); // Make the window fullscreen. // All Windows are fullscreen-only on the Basalt platform. #ifdef PBL_PLATFORM_APLITE window_set_fullscreen(window, true); #endif window_stack_push(window, true); } static void deinit(void) { window_destroy(window); } int main(void) { init(); init_pebcessing(window, window_get_root_layer(window)); app_event_loop(); deinit_pebcessing(); deinit(); return 0; }
Change so that window_set_fullscreen() is called only on the Aplite platform
Change so that window_set_fullscreen() is called only on the Aplite platform
C
mit
hikoLab/pebcessing,hikoLab/pebcessing,itosue/pebcessing,itosue/pebcessing,hikoLab/pebcessing,itosue/pebcessing
fe59f3886ddc97f26e2bbad5039302aa7061a918
include/skbuff.h
include/skbuff.h
#ifndef SKBUFF_H_ #define SKBUFF_H_ #include "netdev.h" #include "dst.h" #include "list.h" #include <pthread.h> struct sk_buff { struct list_head list; struct dst_entry *dst; struct netdev *netdev; uint16_t protocol; uint32_t len; uint8_t *tail; uint8_t *end; uint8_t *head; uint8_t *data; }; struct sk_buff_head { struct list_head head; uint32_t qlen; pthread_mutex_t lock; }; struct sk_buff *alloc_skb(unsigned int size); void free_skb(struct sk_buff *skb); uint8_t *skb_push(struct sk_buff *skb, unsigned int len); uint8_t *skb_head(struct sk_buff *skb); void *skb_reserve(struct sk_buff *skb, unsigned int len); void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst); static inline void skb_queue_init(struct sk_buff_head *list) { list_init(&list->head); list->qlen = 0; pthread_mutex_init(&list->lock, NULL); } #endif
#ifndef SKBUFF_H_ #define SKBUFF_H_ #include "netdev.h" #include "dst.h" #include "list.h" #include <pthread.h> struct sk_buff { struct list_head list; struct dst_entry *dst; struct netdev *netdev; uint16_t protocol; uint32_t len; uint8_t *tail; uint8_t *end; uint8_t *head; uint8_t *data; }; struct sk_buff_head { struct list_head head; uint32_t qlen; pthread_mutex_t lock; }; struct sk_buff *alloc_skb(unsigned int size); void free_skb(struct sk_buff *skb); uint8_t *skb_push(struct sk_buff *skb, unsigned int len); uint8_t *skb_head(struct sk_buff *skb); void *skb_reserve(struct sk_buff *skb, unsigned int len); void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst); static inline uint32_t skb_queue_len(const struct sk_buff_head *list) { return list->qlen; } static inline void skb_queue_init(struct sk_buff_head *list) { list_init(&list->head); list->qlen = 0; pthread_mutex_init(&list->lock, NULL); } #endif
Add skb queue length getter
Add skb queue length getter
C
mit
saminiir/level-ip,saminiir/level-ip
e64c4a9d47aafaa59bbc42ab7b6ad7b3c0e76cb8
test/format/precision_fieldwidth.c
test/format/precision_fieldwidth.c
// RUN: %check --only --prefix=linux %s -target x86_64-linux // RUN: %check --prefix=darwin %s -target x86_64-darwin int printf(const char *, ...) __attribute((format(printf, 1, 2))); typedef unsigned long size_t; typedef long ptrdiff_t; typedef unsigned long uintptr_t; typedef long intptr_t; int main() { // TODO: // [ ] test all these // [ ] truncations part way // [ ] bad length modifiers // modifiers: "#0- +'" // field width: 0-9 | * // precision: . ( 0-9 | * ) // length modifiers: 'h' 'l' 'L' 'j' 't' 'z' // format char // %m on {,non-}linux printf("%#f", 5.2f); printf("%0f", 5.2f); printf("%-f", 5.2f); printf("% f", 5.2f); printf("%+f", 5.2f); printf("%'f", 5.2f); printf("%#0' +f", 21.f); printf("%23d", 5); printf("%35a", 5.2); printf("%35.a", 5.2); printf("%*.g", 3, 5.2); printf("%'.*g", 3, 5.2); printf("%#2.*g", 3, 5.2); printf("%+*.1e", 3, 5.2); printf("%m\n"); // CHECK-darwin: warning: %m used on non-linux system printf("%+*.1q", 3, 5.2); // CHECK-linux: warning: invalid conversion character printf("%#"); // CHECK-linux: warning: invalid modifier character printf("%23"); // CHECK-linux: warning: invalid field width printf("%35."); // CHECK-linux: warning: incomplete format specifier (missing precision) printf("%*"); // CHECK-linux: warning: invalid field width printf("%'.*"); // CHECK-linux: warning: invalid precision printf("%+*.1"); // CHECK-linux: warning: invalid precision }
Test precision and field-width format handling
Test precision and field-width format handling
C
mit
bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler,bobrippling/ucc-c-compiler
f599206963000fd0de474893ba63016392ce988c
WOLRelay.c
WOLRelay.c
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/socket.h> int main(int argc, char* argv[]){ }
Add main C file with standard includes
Add main C file with standard includes
C
mit
ytaben/WakeOnLanRelay
122f9363682e5de8ce4056c4c05c1eaf8935cf19
src/libstddjb/cdb_free.c
src/libstddjb/cdb_free.c
/* ISC license. */ #include <sys/mman.h> #include <skalibs/cdb.h> extern void cdb_free (struct cdb *c) { if (c->map) munmap(c->map, c->size) ; *c = cdb_zero ; }
/* ISC license. */ #include <sys/mman.h> #include <errno.h> #include <skalibs/cdb.h> extern void cdb_free (struct cdb *c) { if (c->map) { int e = errno ; munmap(c->map, c->size) ; errno = e ; } *c = cdb_zero ; }
Save errno when freeing a cdb
Save errno when freeing a cdb Signed-off-by: Laurent Bercot <[email protected]>
C
isc
skarnet/skalibs,skarnet/skalibs